diff --git a/assets/css/demo.min.css b/assets/css/demo.min.css index 4a2b81e7..2c9df97a 100644 --- a/assets/css/demo.min.css +++ b/assets/css/demo.min.css @@ -1,8 +1,8 @@ /** formeo - https://formeo.io -Version: 2.1.4 +Version: 2.1.5 Author: Draggable https://draggable.io */ -*{margin:0;padding:0;box-sizing:border-box}body,html{height:100%}body{background:linear-gradient(135deg,#e4efe9,#7db9e8);background-attachment:fixed;font-family:Helvetica,Arial,sans-serif}.site-wrap{display:flex;flex-direction:column;height:100vh;align-items:center;justify-content:space-between}#demo-header,#demo-footer{width:100%}#demo-header{text-align:center}#demo-header nav{text-align:left;background-color:#efefef;display:block}#demo-footer{width:100%}#demo-footer nav{background-color:#666;text-align:right}#main_content{padding-bottom:50px;flex:1;width:100%;display:flex;flex-direction:column}#demo-footer ul,#demo-header ul{list-style:none;padding:7px 5px 0;max-width:1280px;margin:auto}#demo-footer li,#demo-header li{display:inline-block}#demo-footer a,#demo-header a{padding:5px 10px;display:inline-block;color:#fff;text-decoration:none;line-height:0}.inner{width:100%;max-width:1280px;margin:auto}#debug-wrap{display:none;text-align:left}#debug-wrap.open{display:block;background:#4b4b4bbf}.debug-window{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-start;align-content:stretch;align-items:flex-start}#debug-wrap .debug-type{width:33%;-webkit-order:0;-ms-flex-order:0;order:0;-webkit-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto;-webkit-align-self:stretch;-ms-flex-item-align:stretch;align-self:stretch;padding:20px}.form-rendered .build-form{display:none}.render-form{display:none;width:100%;max-width:800px;margin:auto;padding:32px 0}.form-rendered .render-form{display:block}.render-btn-wrap{text-align:center;padding:32px 0;display:flex;gap:8px}.render-btn-wrap button{padding:4px 8px;border-radius:4px;border:1px solid gray}#control-filter{line-height:1em}@keyframes shimmer{0%{transform:translate(-100%)}to{transform:translate(100%)}}@keyframes shimmer{0%,80%{background-position:-120px 0}81%{background-position:120px 0}to{background-position:120px 0}}#formeo-logo-wrap{display:inline-block;width:224px;height:150px;-webkit-mask-image:url(/formeo/assets/img/formeo-logo.svg);mask-image:url(/formeo/assets/img/formeo-logo.svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;background-image:linear-gradient(-60deg,#000 45%,#fff9,#000 55%);background-position:-120px 0;background-size:105% 100%;animation:shimmer 45s ease-in-out infinite} +*{margin:0;padding:0;box-sizing:border-box}body,html{height:100%}body{background:linear-gradient(135deg,#e4efe9,#7db9e8);background-attachment:fixed;font-family:Helvetica,Arial,sans-serif}.site-wrap{display:flex;flex-direction:column;height:100vh;align-items:center;justify-content:space-between}#demo-header,#demo-footer{width:100%}#demo-header{text-align:center}#demo-header nav{text-align:left;background-color:#efefef;display:block}#demo-footer{width:100%}#demo-footer nav{background-color:#666;text-align:right}#main_content{padding-bottom:50px;flex:1;width:100%;display:flex;flex-direction:column}#demo-footer ul,#demo-header ul{list-style:none;padding:7px 5px 0;max-width:1280px;margin:auto}#demo-footer li,#demo-header li{display:inline-block}#demo-footer a,#demo-header a{padding:5px 10px;display:inline-block;color:#fff;text-decoration:none;line-height:0}.inner{width:100%;max-width:1280px;margin:auto}#debug-wrap{display:none;text-align:left}#debug-wrap.open{display:block;background:#4b4b4bbf}.debug-window{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-start;align-content:stretch;align-items:flex-start}#debug-wrap .debug-type{width:33%;-webkit-order:0;-ms-flex-order:0;order:0;-webkit-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto;-webkit-align-self:stretch;-ms-flex-item-align:stretch;align-self:stretch;padding:20px}.form-rendered .build-form{display:none}.render-form{display:none;width:100%;max-width:800px;margin:auto;padding:32px 0}.form-rendered .render-form{display:block}.render-btn-wrap{text-align:center;padding:32px 0;display:flex;gap:8px}.render-btn-wrap button{padding:4px 8px;border-radius:4px;border:1px solid gray}#control-filter{line-height:1em}@keyframes shimmer{0%{transform:translate(-100%)}to{transform:translate(100%)}}@keyframes shimmer{0%,80%{background-position:-120px 0}81%{background-position:120px 0}to{background-position:120px 0}}#formeo-logo-wrap{display:inline-block;width:224px;height:150px;-webkit-mask-image:url(/formeo/assets/img/formeo-logo.svg);mask-image:url(/formeo/assets/img/formeo-logo.svg);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;background-image:linear-gradient(-60deg,#000 45%,#fff9,#000 55%);background-position:-120px 0;background-size:105% 100%;animation:shimmer 45s ease-in-out infinite}.svg-icon{display:inline-block;width:24px;height:24px;pointer-events:none}.f-i-remove:hover{fill:#d9534f}button[class*=-move]:hover{background-color:#9954bb!important}button[class*=-move]:hover .svg-icon{fill:#fff}button[class*=-remove]:hover{background-color:#d9534f!important}button[class*=-remove]:hover .svg-icon{fill:#fff}button[class*=-clone]:hover{background-color:#93c54b!important}button[class*=-clone]:hover .svg-icon{fill:#fff}.item-edit-toggle:hover{background-color:#325d88!important}.item-edit-toggle:hover .svg-icon{fill:#fff}.f-autocomplete-list{background-color:#fff;display:none;list-style:none;padding:0;position:absolute;z-index:20;max-height:200px;overflow-y:auto;width:100%;margin:0 -1px;border:1px solid #999999;border-width:1px 1px 0;box-shadow:0 1px 4px #00000080}.f-autocomplete-list li{border:1px solid #999999;display:none;cursor:default;padding:4px;margin:-1px 0 0;border-width:1px 0;transition:background-color 133ms ease-in-out;will-change:background-color;font-size:.85em}.f-autocomplete-list li.active-option{background-color:#e1cceb}.f-autocomplete-list li:hover{background-color:#bd91d3}.f-autocomplete-list .component-type{color:#666;font-style:italic;font-size:.75em}.formeo-panels-wrap h5{margin:0;padding:.55em 0;color:#666;font-weight:400;display:inline-block;width:100%}.formeo-panels-wrap nav{position:relative;padding:0;overflow:hidden}.formeo-panels-wrap nav button{position:absolute;width:24px;color:#000;height:100%;padding:0;line-height:0;z-index:1}.formeo-panels-wrap nav button:focus{outline:none;border:1px solid rgb(102,175,233);box-shadow:none}.formeo-panels-wrap nav button .svg-icon{width:20px;height:20px}.formeo-panels-wrap nav button.next-group{right:0;top:0;border-top-left-radius:0;border-bottom-left-radius:0}.formeo-panels-wrap nav button.prev-group{left:0;top:0;border-top-right-radius:0;border-bottom-right-radius:0}.formeo-panels-wrap ul{margin:0;padding:0;list-style:none}.formeo-panels-wrap .f-panel{vertical-align:top;display:inline-block;width:100%;flex-direction:column;flex:1 0 100%}.formeo-panels-wrap .f-panel>li:last-child{border-radius:0 0 4px 4px}.formeo-panels-wrap .panels{white-space:nowrap;transition-property:height;transition-duration:.15s;transition-timing-function:ease-in-out;will-change:transform;flex-direction:row}.formeo-panels-wrap .panel-labels{height:100%;background:#fff;overflow:hidden;text-align:center;white-space:nowrap}.tabbed-panels .panel-nav{height:auto}.tabbed-panels .panel-nav button{display:none}.tabbed-panels .f-panel{background-color:#fff}.tabbed-panels .panel-labels div{flex-direction:row;justify-content:flex-start;flex-wrap:nowrap;align-content:stretch;align-items:stretch;display:flex}.tabbed-panels .panel-labels h5{flex-direction:column;flex:1;cursor:pointer;background-color:#ccc;box-shadow:0 -1px 8px #999 inset}.tabbed-panels .panel-labels h5.active-tab{color:#000;box-shadow:none;background-color:#fff}.formeo-sprite{display:none!important}.formeo *{box-sizing:inherit;font-family:inherit}.formeo .pill-buttons>button{border-radius:50px}.formeo hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid #cccccc}.formeo .f-field-group{flex-wrap:wrap;margin-bottom:12px}.formeo .f-field-group:last-child{margin-bottom:0}.formeo .f-field-group label+.badge{margin-left:8px}.formeo .f-field-group>label{display:inline-block;margin-bottom:4px}.formeo .f-field-group button{margin-right:4px}.formeo select{font-size:100%;font-family:inherit;height:2.1em;line-height:1.5;margin:0;border:1px solid #cccccc;border-radius:4px;background-color:#fff;width:100%;padding:.3em .6em;box-sizing:border-box}.formeo select:focus{border:1px solid rgb(102,175,233);outline:none}.formeo input{font-size:100%;font-family:inherit;height:2.1em;line-height:1.5;margin:0;border:1px solid #cccccc;border-radius:4px;background-color:#fff;width:100%;padding:.3em .6em;box-sizing:border-box}.formeo input:focus{border:1px solid rgb(102,175,233);outline:none}.formeo input[type=checkbox],.formeo input[type=radio]{width:auto;height:auto;margin-right:4px}.formeo input[type=date]{max-width:280px;display:block}.formeo textarea{font-size:100%;font-family:inherit;height:2.1em;line-height:1.5;margin:0;border:1px solid #cccccc;border-radius:4px;background-color:#fff;width:100%;padding:.3em .6em;box-sizing:border-box;height:auto}.formeo textarea:focus{border:1px solid rgb(102,175,233);outline:none}.formeo button{border-radius:4px;border:1px solid #666666;color:#333;background-color:#fff;padding:4px 8px;line-height:1.5em}.formeo button:active{transform:scale(.97)}.formeo button:hover{filter:brightness(.9)}.formeo button.primary,.formeo button.success,.formeo button.warning,.formeo button.error{color:#fff}.formeo button.primary{background-color:#325d88;border-color:#244463}.formeo button.success{background-color:#93c54b;border-color:#79a736}.formeo button.warning{background-color:#f47c3c;border-color:#ef5c0e}.formeo button.error{background-color:#d9534f;border-color:#c9302c}.formeo button[disabled]{background-color:#ccc;color:#fff}.formeo button:focus{border:1px solid rgb(102,175,233)}.formeo button:hover,.formeo button:focus{outline:0 none}.formeo .f-addon{font-size:100%;font-family:inherit;height:2.1em;line-height:1.5;margin:0;border:1px solid #cccccc;border-radius:4px;background-color:#fff;width:100%;padding:.3em .6em;box-sizing:border-box;width:auto}.formeo .f-addon:focus{border:1px solid rgb(102,175,233);outline:none}.formeo .f-addon label{margin:1px 0 0 3px}.formeo .f-addon:last-child{margin-left:-1px}.formeo .f-btn-group{display:inline-flex;vertical-align:middle}.formeo .f-btn-group>button{flex:0 1 auto}.formeo .f-btn-group>button:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.formeo .f-btn-group>button:last-child:not(:first-child):not(.dropdown-toggle){border-bottom-left-radius:0;border-top-left-radius:0}.formeo .f-btn-group>button:first-child{margin-left:0}.formeo .f-btn-group>button:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.formeo .f-btn-group button+button,.formeo .f-btn-group button+.f-btn-group,.formeo .f-btn-group .f-btn-group+button,.formeo .f-btn-group .f-btn-group+.f-btn-group,.formeo .f-btn-group .f-btn-group-vertical button+button,.formeo .f-btn-group .f-btn-group-vertical button+.f-btn-group,.formeo .f-btn-group .f-btn-group-vertical .f-btn-group+button,.formeo .f-btn-group .f-btn-group-vertical .f-btn-group+.f-btn-group{margin-left:-1px}.formeo .f-input-group{display:flex;flex-direction:row;justify-content:flex-start;flex-wrap:nowrap;align-content:stretch;align-items:stretch;display:inline-flex;vertical-align:bottom}.formeo .f-input-group input+input,.formeo .f-input-group input+select,.formeo .f-input-group select+select,.formeo .f-input-group select+input{margin-left:-1px}.formeo .f-input-group select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0ZWQgYnkgSWNvTW9vbi5pbyAtLT4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIyNCIgaGVpZ2h0PSIzMiIgdmlld0JveD0iMCAwIDI0IDMyIj4KPHBhdGggZmlsbD0iIzQ0NCIgZD0iTTAgMTJsMTEuOTkyIDExLjk5MiAxMS45OTItMTEuOTkyaC0yMy45ODR6Ij48L3BhdGg+Cjwvc3ZnPgo=);background-position:right 10px top 2px;background-repeat:no-repeat;background-size:16px}.formeo .f-input-group select::-ms-expand{display:none}.formeo .f-input-group .f-addon,.formeo .f-input-group input,.formeo .f-input-group select{flex:0 1 auto;border-radius:0}.formeo .f-input-group .f-addon:last-child,.formeo .f-input-group input:last-child,.formeo .f-input-group select:last-child{border-right-width:1px;border-radius:0 4px 4px 0}.formeo .f-input-group .f-addon:first-child,.formeo .f-input-group input:first-child,.formeo .f-input-group select:first-child{border-radius:4px 0 0 4px;border-left-width:1px}.formeo .f-input-group .f-addon:first-child:last-child,.formeo .f-input-group input:first-child:last-child,.formeo .f-input-group select:first-child:last-child{border-radius:4px}.formeo .f-input-group .f-addon:focus+input,.formeo .f-input-group .f-addon:focus+select,.formeo .f-input-group input:focus+input,.formeo .f-input-group input:focus+select,.formeo .f-input-group select:focus+input,.formeo .f-input-group select:focus+select{border-left:1px solid rgb(102,175,233)}.formeo .text-primary{color:#325d88}.formeo .text-success{color:#93c54b}.formeo .text-warning{color:#f47c3c}.formeo .text-error{color:#d9534f}.formeo.formeo-editor{display:flex;flex-direction:row;text-align:left;gap:16px}@keyframes PLACEHOLDER{0%{height:1px}to{height:15px}}@keyframes DRAG_GHOST{0%{box-shadow:0 0 #999}to{box-shadow:0 0 30px #999}}@keyframes EDIT_PULSE{0%,to{border-color:#66afe9}50%{border-color:#bfdef6}}@keyframes HIDE_CONDITION_FIELD{0%{display:none}to{display:none}}@keyframes COMPONENT_HIGHLIGHT_PULSE{0%{box-shadow:0 0 1px 8px #9954bb}to{box-shadow:0 0 #9954bb}}@keyframes SLIDE_UP{0%{transform:translateY(100%);clip-path:inset(0 0 100% -20%)}to{transform:translateY(0);clip-path:inset(0 0 0 -20%)}}.formeo.formeo-editor .component-tag{display:none;height:24px;z-index:200;flex-direction:row;gap:4px;align-items:center;position:absolute;font-size:.8em;padding:0 8px;left:50%;top:-24px;border-top-left-radius:8px;border-top-right-radius:8px;background-color:#fff;border-color:#ccc;border-style:solid;border-width:1px 1px 0 1px}.formeo.formeo-editor .component-tag [class*=-handle-]{width:12px;height:12px}.formeo.formeo-editor .component-tag .f-i-component-corner{position:absolute;width:8px;height:8px}.formeo.formeo-editor .component-tag .f-i-component-corner.bottom-right{bottom:0;right:-8px}.formeo.formeo-editor .component-tag .f-i-component-corner.bottom-left{bottom:0;left:-8px;transform:scaleX(-1)}.formeo.formeo-editor .children{margin:0;padding:0;list-style:none;height:100%}.formeo.formeo-editor .group-actions{display:flex;transition:opacity .3s ease-in-out allow-discrete;position:absolute;top:0;line-height:0;z-index:2;align-items:center;justify-content:center;flex-direction:row;border-radius:8px}.formeo.formeo-editor .group-actions .action-btn-wrap{display:none;align-items:center;justify-content:center;border-top-right-radius:8px;border-bottom-left-radius:8px;border-bottom-right-radius:8px;transition:opacity 1s ease-in-out allow-discrete}.formeo.formeo-editor .group-actions .action-btn-wrap .component-handle{opacity:.65}.formeo.formeo-editor .group-actions .action-btn-wrap button{background-color:#fff}.formeo.formeo-editor .group-actions button{background-color:transparent;width:24px;height:24px;padding:6px;border:0 none;line-height:0}.formeo.formeo-editor .group-actions button:focus{border:0 none;outline:0 none;box-shadow:none}.formeo.formeo-editor .group-actions .svg-icon{width:12px;height:12px}.formeo.formeo-editor .last-field .group-actions button:last-child{border-radius:0}.formeo.formeo-editor .column-editing-field .column-actions{display:none}.formeo.formeo-editor .group-config{display:none;padding:.5rem}.formeo.formeo-editor .editing-row .column-actions{display:none}.formeo.formeo-editor .hovering>.children,.formeo.formeo-editor .hovering>.field-preview,.formeo.formeo-editor .hovering>.prev-label{opacity:.65}.formeo.formeo-editor .hovering .group-actions .f-i-handle{display:none}.formeo.formeo-editor .formeo-row{transition:background-color 125ms ease-in-out;position:relative;clear:both;background-color:#fff;box-shadow:0 0 0 1px #ccc;padding:16px}.formeo.formeo-editor .formeo-row>.children{display:flex;flex-direction:row;justify-content:flex-start;flex-wrap:nowrap;align-content:stretch;align-items:stretch;gap:16px;min-height:32px}.formeo.formeo-editor .formeo-row:after{clear:both}.formeo.formeo-editor .formeo-row.control-ghost{padding:10px}.formeo.formeo-editor .formeo-row:first-child{border-top-right-radius:8px}.formeo.formeo-editor .formeo-row:first-child:not(.editing-row,.hovering-row){border-top-left-radius:8px}.formeo.formeo-editor .formeo-row:last-child{border-bottom-left-radius:8px;border-bottom-right-radius:8px}.formeo.formeo-editor .formeo-row:only-child{border-radius:8px}.formeo.formeo-editor .formeo-row.resizing-columns .formeo-column{transition:none}.formeo.formeo-editor .formeo-row.empty:after{left:0;transform:translate(8px,-50%)}.formeo.formeo-editor .formeo-row .layout-row-control{display:none}.formeo.formeo-editor .formeo-row .row-tag{left:-1px;border-color:#ef476f}.formeo.formeo-editor .formeo-row .row-tag .f-i-component-corner{fill:#fff;stroke:#ef476f}.formeo.formeo-editor .formeo-row:has(.hovering-column) .row-actions,.formeo.formeo-editor .formeo-row:has(.hovering-column) .field-actions{display:none}.formeo.formeo-editor .formeo-row.sortable-ghost{background-color:#fef0f3;box-shadow:0 0 0 1px #ef476f}.formeo.formeo-editor .formeo-row.sortable-ghost *{opacity:0}.formeo.formeo-editor .row-moving{background-color:#fef0f3!important}.formeo.formeo-editor .row-moving .action-btn-wrap button,.formeo.formeo-editor .row-moving .row-tag{background-color:#fef0f3}.formeo.formeo-editor .row-moving .row-tag .f-i-component-corner{fill:#fef0f3}.formeo.formeo-editor .row-actions{left:0}.formeo.formeo-editor .hovering-row .column-actions,.formeo.formeo-editor .hovering-row .field-actions{display:none}.formeo.formeo-editor .hovering-row:first-child{border-top-left-radius:0}.formeo.formeo-editor .hovering-row.editing-row:before{border-right-width:0}.formeo.formeo-editor .editing-row,.formeo.formeo-editor .editing-row .row-edit{display:block}.formeo.formeo-editor .editing-row.hovering-row .formeo-column{opacity:1}.formeo.formeo-editor .hovering-row,.formeo.formeo-editor .editing-row{box-shadow:0 0 0 1px #ef476f}.formeo.formeo-editor .hovering-row .row-handle,.formeo.formeo-editor .editing-row .row-handle{display:none}.formeo.formeo-editor .hovering-row .row-tag,.formeo.formeo-editor .editing-row .row-tag,.formeo.formeo-editor .hovering-row .row-action-btn-wrap,.formeo.formeo-editor .editing-row .row-action-btn-wrap{display:flex}.formeo.formeo-editor .hovering-row .row-action-btn-wrap button:last-child,.formeo.formeo-editor .editing-row .row-action-btn-wrap button:last-child{border-bottom-right-radius:8px}.formeo.formeo-editor .row-edit{padding-top:2rem}.formeo.formeo-editor .input-group-addon label{margin-bottom:0}.formeo.formeo-editor .formeo-column{margin:0;padding:0;list-style:none;transition:width 266ms;position:relative;flex-direction:column;will-change:width;max-width:100%}.formeo.formeo-editor .formeo-column>.children{display:flex;flex-direction:column;justify-content:flex-start;gap:16px}.formeo.formeo-editor .formeo-column .column-tag{border-color:#06d6a0}.formeo.formeo-editor .formeo-column .column-tag .f-i-component-corner{fill:#fff;stroke:#06d6a0}.formeo.formeo-editor .formeo-column .column-tag,.formeo.formeo-editor .formeo-column .column-actions{transform:translate(-50%)}.formeo.formeo-editor .formeo-column[class*=col-]{padding:0}.formeo.formeo-editor .formeo-column:first-child{border-bottom-left-radius:8px}.formeo.formeo-editor .formeo-column:last-child{border-bottom-right-radius:8px}.formeo.formeo-editor .formeo-column:last-child .resize-x-handle{display:none!important}.formeo.formeo-editor .formeo-column:only-child{border-bottom-right-radius:8px;border-bottom-left-radius:8px}.formeo.formeo-editor .formeo-column:only-child .resize-x-handle{display:none!important}.formeo.formeo-editor .formeo-column .resize-x-handle{display:none;position:absolute;right:-16px;top:0;bottom:0;width:16px;z-index:2;cursor:ew-resize}.formeo.formeo-editor .formeo-column .resize-x-handle:before{width:0;right:6px;border:1px dashed rgb(47.3227272727,249.1772727273,196.7727272727);border-width:0 2px;display:block;top:0;position:absolute;height:100%;content:""}.formeo.formeo-editor .formeo-column .resize-x-handle svg{fill:#2ff9c5;position:absolute;right:1px;width:14px}.formeo.formeo-editor .formeo-column .resize-x-handle svg.f-i-triangle-down{top:-14px}.formeo.formeo-editor .formeo-column .resize-x-handle svg.f-i-triangle-up{bottom:-14px}.formeo.formeo-editor .formeo-column .resize-x-handle:hover:before{border-color:#06d6a0}.formeo.formeo-editor .formeo-column .resize-x-handle:hover svg{fill:#06d6a0}.formeo.formeo-editor .formeo-column.editing-column{overflow:hidden}.formeo.formeo-editor .formeo-column.editing-column .column-edit{display:block}.formeo.formeo-editor .formeo-column:has(.hovering-field) .column-actions{display:none}.formeo.formeo-editor .formeo-column.sortable-ghost{background-color:#ddfef5;box-shadow:0 0 0 1px #06d6a0}.formeo.formeo-editor .formeo-column.sortable-ghost *{opacity:0}.formeo.formeo-editor .editing-row .formeo-column,.formeo.formeo-editor .editing-row .empty{border-radius:8px;height:60px;background-color:#e6e6e6}.formeo.formeo-editor .editing-row .formeo-column.empty,.formeo.formeo-editor .editing-row .empty.empty{min-height:0}.formeo.formeo-editor .editing-row .formeo-column .formeo-field,.formeo.formeo-editor .editing-row .empty .formeo-field{display:none}.formeo.formeo-editor .editing-row .formeo-column .resize-x-handle,.formeo.formeo-editor .editing-row .empty .resize-x-handle{display:block}.formeo.formeo-editor .editing-row .formeo-column:after,.formeo.formeo-editor .editing-row .empty:after{color:#333!important;line-height:1em;opacity:1;font-size:1.1em;content:attr(data-col-width)!important;display:block;width:100%;text-align:center;position:absolute;left:50%;margin-top:0;top:50%;transform:translate(-50%,-50%)}.formeo.formeo-editor .editing-field-preview .column-actions{display:none}.formeo.formeo-editor .column-moving,.formeo.formeo-editor .column-moving .action-btn-wrap button,.formeo.formeo-editor .column-moving .column-tag{background-color:#ddfef5}.formeo.formeo-editor .column-moving .column-tag .f-i-component-corner{fill:#ddfef5}.formeo.formeo-editor .hovering-column .column-tag{display:flex}.formeo.formeo-editor .hovering-column .column-handle{display:none}.formeo.formeo-editor .hovering-column .column-action-btn-wrap{display:flex}.formeo.formeo-editor .hovering-column:first-child{border-top-left-radius:0}.formeo.formeo-editor .hovering-column:after{opacity:0}.formeo.formeo-editor .hovering-column,.formeo.formeo-editor .editing-column{box-shadow:0 0 0 1px #06d6a0}.formeo.formeo-editor .column-actions{padding:0;left:50%;z-index:1;transition:width .15s}.formeo.formeo-editor .column-actions .f-i-handle{transform:rotate(90deg)}.formeo.formeo-editor .formeo-field{min-height:24px;position:relative;list-style:none;margin:0;will-change:box-shadow}.formeo.formeo-editor .formeo-field:last-child{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.formeo.formeo-editor .formeo-field.first-field,.formeo.formeo-editor .formeo-field.first-field .field-actions{border-top-right-radius:4px}.formeo.formeo-editor .formeo-field .prev-label{min-height:24px;max-width:calc(100% - 24px);display:flex;align-items:flex-end;margin-bottom:4px}.formeo.formeo-editor .formeo-field [contenteditable]{padding:1px 2px;-webkit-user-select:text;user-select:text;display:inline-block;position:relative;min-width:24px}.formeo.formeo-editor .formeo-field [contenteditable]:after{content:"";width:100%;position:absolute;bottom:0;left:0;border-bottom:1px dashed #cccccc}.formeo.formeo-editor .formeo-field [contenteditable]:focus{border-radius:4px;border-bottom-color:transparent;outline:none;box-shadow:0 0 0 1px #66afe9 inset}.formeo.formeo-editor .formeo-field [contenteditable]:focus:after{display:none}.formeo.formeo-editor .formeo-field .form-check{margin-left:1.25em}.formeo.formeo-editor .formeo-field .form-check-input:only-child{position:absolute}.formeo.formeo-editor .formeo-field.field-type-hidden{border:1px dashed #cccccc}.formeo.formeo-editor .formeo-field.sortable-ghost{background-color:#b8d2e9;box-shadow:0 0 0 1px #26547c}.formeo.formeo-editor .formeo-field.sortable-ghost *{opacity:0}.formeo.formeo-editor .field-tag{right:-1px;left:auto;top:-24px;border-color:#26547c;background-color:#fff}.formeo.formeo-editor .field-tag .f-i-component-corner{fill:#fff;stroke:#26547c}.formeo.formeo-editor .editing-field,.formeo.formeo-editor .hovering-field{box-shadow:0 0 0 1px #26547c}.formeo.formeo-editor .editing-field .field-tag,.formeo.formeo-editor .hovering-field .field-tag,.formeo.formeo-editor .editing-field .field-action-btn-wrap,.formeo.formeo-editor .hovering-field .field-action-btn-wrap{display:flex}.formeo.formeo-editor .editing-field .field-handle,.formeo.formeo-editor .hovering-field .field-handle{display:none}.formeo.formeo-editor .field-actions{border-color:transparent;border-width:1px 1px 0 0;border-style:solid;right:0;text-align:right;border-bottom-left-radius:4px;border-bottom-right-radius:0}.formeo.formeo-editor .field-actions .action-btn-wrap{flex-direction:row-reverse}.formeo.formeo-editor .field-moving,.formeo.formeo-editor .field-moving .action-btn-wrap button,.formeo.formeo-editor .field-moving .field-tag{background-color:#b8d2e9}.formeo.formeo-editor .field-moving .field-tag .f-i-component-corner{fill:#b8d2e9}.formeo.formeo-editor .editing-field{z-index:1}.formeo.formeo-editor .editing-field-preview .field-actions{display:none}.formeo.formeo-editor .field-preview p{white-space:normal}.formeo.formeo-editor .field-edit{display:none;overflow:hidden;margin-top:16px;border-top:1px solid #cccccc}.formeo.formeo-editor .field-edit label{font-size:.825em}.formeo.formeo-editor .field-edit .panel-nav{margin-bottom:0;padding:0;overflow:hidden}.formeo.formeo-editor .field-edit .panel-nav button{border-bottom-left-radius:0;border-bottom-right-radius:0}.formeo.formeo-editor .field-edit.field-edit-options{list-style:decimal}.formeo.formeo-editor .field-edit .active-panel{background-color:#fff}.formeo.formeo-editor .field-edit .field-prop{display:flex}.formeo.formeo-editor .field-edit .prop-controls{flex-shrink:0;align-items:center;display:flex;margin-left:3px}.formeo.formeo-editor .field-edit .prop-controls button{position:relative}.formeo.formeo-editor .field-edit .prop-controls .svg-icon{width:12px;height:12px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.formeo.formeo-editor .field-edit .prop-control{width:24px;height:24px;right:0;bottom:0;position:absolute;padding:0}.formeo.formeo-editor .field-edit .prop-control:nth-of-type(1){right:0}.formeo.formeo-editor .field-edit .prop-control:nth-of-type(2){right:24px}.formeo.formeo-editor .field-edit .prop-control:nth-of-type(3){right:48px}.formeo.formeo-editor .field-edit .prop-control:nth-of-type(4){right:72px}.formeo.formeo-editor .field-edit .prop-control:first-child{right:0}.formeo.formeo-editor :not(.control-count-1) .field-edit .prop-control:last-child{border-radius:4px 0 0 4px;margin-right:-1px;display:none}.formeo.formeo-editor :not(.control-count-1) .field-edit .prop-control:first-child{border-radius:4px}.formeo.formeo-editor .field-edit .prop-control:hover:first-child{border-radius:0 4px 4px 0}.formeo.formeo-editor .field-edit .prop-control:hover:first-child:last-child{border-radius:4px}.formeo.formeo-editor .field-edit .prop-control:hover:last-child{display:inline-block}.formeo.formeo-editor .field-edit .prop-control:last-child:first-child{display:inline-block;border-radius:4px;margin-right:0}.formeo.formeo-editor .field-edit .prop-wrap{position:relative;margin-bottom:8px;list-style:none;margin-left:0}.formeo.formeo-editor .field-edit .field-edit-group{padding:8px 8px 0}.formeo.formeo-editor .field-edit [contenteditable]{display:flex;flex-direction:row;justify-content:flex-start;flex-wrap:nowrap;align-content:stretch;align-items:stretch}.formeo.formeo-editor .field-edit .prop-inputs,.formeo.formeo-editor .field-edit .prop-controls{transition:width .15s;will-change:width}.formeo.formeo-editor .field-edit .prop-inputs .f-addon,.formeo.formeo-editor .field-edit .prop-inputs input:not([type=checkbox]):not([type=radio]),.formeo.formeo-editor .field-edit .prop-inputs select,.formeo.formeo-editor .field-edit .prop-inputs textarea,.formeo.formeo-editor .field-edit .prop-inputs [contenteditable],.formeo.formeo-editor .field-edit .prop-controls .f-addon,.formeo.formeo-editor .field-edit .prop-controls input:not([type=checkbox]):not([type=radio]),.formeo.formeo-editor .field-edit .prop-controls select,.formeo.formeo-editor .field-edit .prop-controls textarea,.formeo.formeo-editor .field-edit .prop-controls [contenteditable]{font-size:.825em;flex:1 1 auto}.formeo.formeo-editor .field-edit .prop-inputs .f-addon:focus,.formeo.formeo-editor .field-edit .prop-inputs input:not([type=checkbox]):not([type=radio]):focus,.formeo.formeo-editor .field-edit .prop-inputs select:focus,.formeo.formeo-editor .field-edit .prop-inputs textarea:focus,.formeo.formeo-editor .field-edit .prop-inputs [contenteditable]:focus,.formeo.formeo-editor .field-edit .prop-controls .f-addon:focus,.formeo.formeo-editor .field-edit .prop-controls input:not([type=checkbox]):not([type=radio]):focus,.formeo.formeo-editor .field-edit .prop-controls select:focus,.formeo.formeo-editor .field-edit .prop-controls textarea:focus,.formeo.formeo-editor .field-edit .prop-controls [contenteditable]:focus{z-index:1}.formeo.formeo-editor .field-edit .prop-inputs [class^=condition-]+select,.formeo.formeo-editor .field-edit .prop-inputs select+[class^=condition-],.formeo.formeo-editor .field-edit .prop-controls [class^=condition-]+select,.formeo.formeo-editor .field-edit .prop-controls select+[class^=condition-]{margin-left:-1px}.formeo.formeo-editor .field-edit .control-count-2 .prop-controls:hover{width:48px}.formeo.formeo-editor .field-edit .control-count-2 .prop-controls:hover+.prop-inputs{width:calc(100% - 24px)}.formeo.formeo-editor .field-edit.panel-count-1 .panel-nav{border-bottom:1px solid #999999}.formeo.formeo-editor .field-edit.panel-count-1 .panel-nav button{display:none}.formeo.formeo-editor .field-edit.panel-count-1 .panel-labels{background-color:transparent}.formeo.formeo-editor .f-condition-row{display:flex;width:100%;margin-top:-1px;border:1px solid #cccccc}.formeo.formeo-editor .f-condition-row input,.formeo.formeo-editor .f-condition-row select,.formeo.formeo-editor .f-condition-row [contenteditable]{border-width:0;border-radius:0;width:inherit;box-shadow:0 0 0 1px #ccc}.formeo.formeo-editor .f-condition-row input:focus,.formeo.formeo-editor .f-condition-row select:focus,.formeo.formeo-editor .f-condition-row [contenteditable]:focus{box-shadow:0 0 0 1px #66afe9}.formeo.formeo-editor .f-condition-row:first-child input:last-child,.formeo.formeo-editor .f-condition-row:first-child select:last-child{border-top-right-radius:4px}.formeo.formeo-editor .f-condition-row:last-child input:last-child,.formeo.formeo-editor .f-condition-row:last-child select:last-child{border-bottom-right-radius:4px}.formeo.formeo-editor .f-condition-row:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.formeo.formeo-editor .f-condition-row:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px}.formeo.formeo-editor .f-condition-row .condition-logical{max-width:56px;text-transform:uppercase}.formeo.formeo-editor .f-condition-row div.condition-source,.formeo.formeo-editor .f-condition-row div.condition-target{position:relative;width:100%}.formeo.formeo-editor .f-condition-row [class^=condition-]{max-width:100%;transition:max-width 266ms;will-change:max-width}.formeo.formeo-editor .f-condition-row.if-condition-row.condition-sourceProperty-isVisible .condition-comparison,.formeo.formeo-editor .f-condition-row.if-condition-row.condition-sourceProperty-isVisible .condition-target,.formeo.formeo-editor .f-condition-row.if-condition-row.condition-sourceProperty-isVisible .condition-assignment,.formeo.formeo-editor .f-condition-row.if-condition-row.condition-sourceProperty-isVisible .condition-value,.formeo.formeo-editor .f-condition-row.if-condition-row.condition-sourceProperty-isVisible .condition-targetProperty,.formeo.formeo-editor .f-condition-row.if-condition-row.condition-sourceProperty-isNotVisible .condition-comparison,.formeo.formeo-editor .f-condition-row.if-condition-row.condition-sourceProperty-isNotVisible .condition-target,.formeo.formeo-editor .f-condition-row.if-condition-row.condition-sourceProperty-isNotVisible .condition-assignment,.formeo.formeo-editor .f-condition-row.if-condition-row.condition-sourceProperty-isNotVisible .condition-value,.formeo.formeo-editor .f-condition-row.if-condition-row.condition-sourceProperty-isNotVisible .condition-targetProperty,.formeo.formeo-editor .f-condition-row.then-condition-row.condition-targetProperty-isVisible .condition-comparison,.formeo.formeo-editor .f-condition-row.then-condition-row.condition-targetProperty-isVisible .condition-assignment,.formeo.formeo-editor .f-condition-row.then-condition-row.condition-targetProperty-isVisible .condition-value,.formeo.formeo-editor .f-condition-row.then-condition-row.condition-targetProperty-isNotVisible .condition-comparison,.formeo.formeo-editor .f-condition-row.then-condition-row.condition-targetProperty-isNotVisible .condition-assignment,.formeo.formeo-editor .f-condition-row.then-condition-row.condition-targetProperty-isNotVisible .condition-value,.formeo.formeo-editor .f-condition-row.condition-target .condition-targetProperty,.formeo.formeo-editor .f-condition-row.condition-source .condition-sourceProperty{max-width:0%;padding:0;border:0 none;overflow:hidden}.formeo.formeo-editor .f-autocomplete-display-field+.f-autocomplete-list:focus{z-index:100}.formeo.formeo-editor [class$=-focused]{z-index:1}.formeo.formeo-editor [class$=-focused] .f-autocomplete-list{z-index:100}.formeo.formeo-editor .conditions-prop-inputs label.condition-label{display:inline-flex;flex:0 0 auto;box-shadow:0 0 0 1px #ccc;align-items:center;padding:4px;border-right:0;text-transform:uppercase;color:#999}.formeo.formeo-editor .conditions-prop-inputs label.condition-label.if-condition-label{border-top-left-radius:4px;border-bottom-left-radius:0;border-bottom-right-radius:0}.formeo.formeo-editor .conditions-prop-inputs label.condition-label.then-condition-label{border-bottom-left-radius:4px;border-top-left-radius:0;border-top-right-radius:0;border-top:0}.formeo.formeo-editor .field-edit-group{margin:0;padding:0;list-style:none}.formeo.formeo-editor .hidden-property{display:none}.formeo.formeo-editor .options-panel .prop-wrap{margin-bottom:8px}.formeo.formeo-editor .options-panel .input-group-addon{line-height:0}.formeo.formeo-editor .options-panel .prop-labels{padding:8px 34px 8px 8px}.formeo.formeo-editor .options-panel .prop-labels .input-group-addon{font-size:12px}.formeo.formeo-editor .options-panel .prop-labels label{font-size:12px;width:50%;position:relative;display:table-cell}.formeo.formeo-editor .options-panel .prop-label-selected,.formeo.formeo-editor .options-panel .prop-label-disabled{width:1%!important;white-space:nowrap;vertical-align:middle;border:0 none;background-color:transparent}.formeo.formeo-editor .panel-action-buttons{padding:0 8px 8px}.formeo.formeo-editor .panel-action-buttons:after{content:"";display:table;clear:both}.formeo.formeo-editor .panel-action-buttons [class^=add-]{float:right}.formeo.formeo-editor .prop-inputs{width:100%;align-items:center;vertical-align:bottom;display:flex;flex-direction:row;flex-grow:1}.formeo.formeo-editor .prop-inputs.conditions-prop-inputs{flex-direction:column}.formeo.formeo-editor .prop-inputs .f-field-group{width:100%;margin-bottom:0;display:inline-flex;align-items:center}.formeo.formeo-editor .prop-inputs .f-addon{display:flex;align-items:center;flex:0}.formeo.formeo-editor .prop-inputs .f-addon:first-child{margin-right:-1px}.formeo.formeo-editor .prop-inputs .f-addon:last-child{margin-left:-1px}.formeo.formeo-editor .prop-inputs label{padding-right:1em;margin-bottom:0}.formeo.formeo-editor .prop-inputs.attrs-prop-inputs .f-addon,.formeo.formeo-editor .prop-inputs.attrs-prop-inputs input:not([type=checkbox]):not([type=radio]),.formeo.formeo-editor .prop-inputs.attrs-prop-inputs select,.formeo.formeo-editor .prop-inputs.attrs-prop-inputs textarea,.formeo.formeo-editor .prop-inputs.attrs-prop-inputs [contenteditable]{flex:2}.formeo.formeo-editor .highlight-component{box-shadow:0 0 4px 2px #9954bb}.formeo.formeo-editor .formeo-stage{width:73%;box-sizing:border-box;transition:width .25s;flex:1 1 auto;position:relative;transition-property:background-color,border-color;transition-duration:.5s,333ms;border:0 dashed transparent;background-color:#fff0;overflow:visible;margin:0;padding:0;list-style:none}.formeo.formeo-editor .formeo-stage>.children{display:flex;flex-direction:column;justify-content:flex-start;gap:16px}.formeo.formeo-editor .formeo-stage.empty{border:3px dashed #cccccc;background-color:#ffffff40}.formeo.formeo-editor .formeo-stage.removing-all-fields .formeo-row{transition:margin-top .25s ease-in}.formeo.formeo-editor .formeo-stage>.formeo-field{background-color:#fff}@media (max-width: 481px){.formeo.formeo-editor .formeo-stage{width:calc(100% - 50px)}}.formeo.formeo-editor .formeo-stage:has(.editing-field) .column-actions{display:none}.formeo.formeo-editor .formeo-stage:has(.editing-field) .row-actions{display:none}.formeo.formeo-editor .editing-stage .formeo-settings{display:block}.formeo.formeo-editor .editing-stage .formeo-stage{display:none}.formeo.formeo-editor .f-field-group{margin-bottom:0}.formeo.formeo-editor [class$=empty][class*=editing-]:after{opacity:0}.formeo.formeo-editor [class$=empty]:after{opacity:1;font-size:24px;position:absolute;top:50%;left:50%;color:#999;transition:opacity .2s ease-in-out;will-change:opacity;text-align:center;transform:translate(-50%,-50%);content:attr(data-hover-tag)}.formeo.formeo-editor .formeo-settings{display:none}.formeo.formeo-editor [dir=rtl] .f-btn-group{display:inline-flex;vertical-align:middle}.formeo.formeo-editor [dir=rtl] .f-btn-group>button{flex:0 1 auto}.formeo.formeo-editor [dir=rtl] .f-btn-group>button:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.formeo.formeo-editor [dir=rtl] .f-btn-group>button:last-child:not(:first-child):not(.dropdown-toggle){border-radius:4px 0 0 4px}.formeo.formeo-editor [dir=rtl] .f-btn-group>button:first-child{margin-left:0}.formeo.formeo-editor [dir=rtl] .f-btn-group>button:first-child:not(:last-child):not(.dropdown-toggle){border-radius:0 4px 4px 0}.formeo.formeo-editor [dir=rtl] .f-btn-group button+button,.formeo.formeo-editor [dir=rtl] .f-btn-group button+.f-btn-group,.formeo.formeo-editor [dir=rtl] .f-btn-group .f-btn-group+button,.formeo.formeo-editor [dir=rtl] .f-btn-group .f-btn-group+.f-btn-group,.formeo.formeo-editor [dir=rtl] .f-btn-group .f-btn-group-vertical button+button,.formeo.formeo-editor [dir=rtl] .f-btn-group .f-btn-group-vertical button+.f-btn-group,.formeo.formeo-editor [dir=rtl] .f-btn-group .f-btn-group-vertical .f-btn-group+button,.formeo.formeo-editor [dir=rtl] .f-btn-group .f-btn-group-vertical .f-btn-group+.f-btn-group{margin-right:-1px}.formeo.formeo-editor [dir=rtl] .formeo-controls,.formeo.formeo-editor [dir=rtl] .formeo-controls .form-actions{float:left}.formeo.formeo-editor [dir=rtl] .formeo-stage-wrap{float:right}.formeo.formeo-editor [dir=rtl] .formeo-stage-wrap .formeo-stage{padding-left:4px;padding-right:23px}.formeo.formeo-editor [dir=rtl] .formeo-row:before{border-bottom-left-radius:8px;border-bottom-right-radius:0;right:0;left:auto}.formeo.formeo-editor [dir=rtl] .formeo-row:first-child{border-top-left-radius:8px;border-top-right-radius:0}.formeo.formeo-editor [dir=rtl] .formeo-row:last-child{border-bottom-left-radius:8px;border-bottom-right-radius:8px}.formeo.formeo-editor [dir=rtl] .formeo-row.hovering-row:first-child{border-top-left-radius:0}.formeo.formeo-editor [dir=rtl] .formeo-row.hovering-row:before{border-left-width:1px}.formeo.formeo-editor [dir=rtl] .formeo-row.empty:after{left:0;right:auto}.formeo.formeo-render .formeo-row,.formeo.formeo-render .formeo-column,.formeo.formeo-render .formeo-field{position:relative}.formeo.formeo-render .f-input-group-wrap>fieldset{position:relative}.formeo.formeo-render .f-input-group-wrap>fieldset .remove-input-group{top:8px}.formeo.formeo-render .will-remove{background-color:#d9534f40;box-shadow:0 0 1px #d9534f inset}.formeo.formeo-render .formeo-row{margin-bottom:1em;flex-direction:row;justify-content:flex-start;flex-wrap:nowrap;align-content:stretch;align-items:stretch;display:flex;border-radius:8px;transition:background-color .2s,padding .2s;padding:4px 0}.formeo.formeo-render .formeo-row.will-remove{padding:4px}.formeo.formeo-render .formeo-row:last-of-type{margin-bottom:0}.formeo.formeo-render .formeo-row-wrap{margin-bottom:1em}.formeo.formeo-render .formeo-row-wrap:last-child{margin-bottom:0}.formeo.formeo-render .f-input-group-wrap:after{content:"";display:table;clear:both}.formeo.formeo-render .f-input-group-wrap .formeo-row:first-of-type .remove-input-group{display:none}.formeo.formeo-render .f-input-group{position:relative}.formeo.formeo-render .f-input-group:first-child .remove-input-group{display:none}.formeo.formeo-render .add-input-group{float:right;margin-top:10px}.formeo.formeo-render .remove-input-group{position:absolute;right:0;top:0;width:16px;height:16px;border:0 none;background:transparent;outline:0 none;line-height:0;padding:4px}.formeo.formeo-render .remove-input-group:hover .svg-icon{fill:#d9534f}.formeo.formeo-render .remove-input-group .svg-icon{pointer-events:none}.formeo.formeo-render .form-check-input:only-child{position:absolute}.formeo.formeo-render .svg-icon{max-width:100%;max-height:100%}.formeo.formeo-render .formeo-column{padding:0 4px;float:left;max-width:none;flex-direction:column}.formeo.formeo-render .formeo-column:first-of-type{padding-left:0}.formeo.formeo-render .formeo-column:last-of-type{padding-right:0}.formeo-controls{width:26%;overflow:hidden}.formeo-controls.formeo-sticky{position:sticky;top:0;align-self:flex-start}.formeo-controls.pull-left .form-actions{float:left}.formeo-controls .filtered-term{background-color:#fff;text-align:center;border-radius:4px 4px 0 0;border:1px solid #cccccc;border-bottom:0 none;width:calc(100% - 2px)}.formeo-controls .tabbed-panels nav{padding:0}.formeo-controls nav{position:relative;padding:0 24px;overflow:hidden}.formeo-controls nav h5{font-size:13px;line-height:22px}.formeo-controls nav button{position:absolute;width:24px;color:#000;height:calc(100% + 1px);padding:0;line-height:0;margin:0;border-color:#ccc}.formeo-controls nav button.next-group{right:0;top:0;border-radius:0 8px 0 0}.formeo-controls nav button.prev-group{border-top-left-radius:8px;border-bottom-left-radius:0;left:0}.formeo-controls .formeo-panels-wrap{font-size:.85em;line-height:1.8em}.formeo-controls .panel-labels{border-top:1px solid #cccccc}.formeo-controls .panel-count-1{border-bottom-left-radius:0}.formeo-controls .panel-count-1 .panel-nav{display:none}.formeo-controls .panel-count-1 .control-group li:first-child{border-radius:8px 8px 0 0}.formeo-controls ul{margin:0;padding:0;list-style:none}.formeo-controls .control-group{vertical-align:top;display:inline-block;width:100%;border-top:1px solid #cccccc}.formeo-controls .control-group>li:first-child{border-top-right-radius:0}.formeo-controls .control-group>li:last-child{border-radius:0 0 8px 8px}.formeo-controls.filtered .panel-nav{display:none}.formeo-controls.filtered .control-group{display:block}.formeo-controls.filtered .control-group>li{border-radius:0}.formeo-controls.filtered .control-group:last-child>li:last-child{border-radius:0 0 0 4px}.formeo-controls .control-groups{white-space:nowrap}.formeo-controls .control-group-labels{height:100%;background:#fff;overflow:hidden}.formeo-controls .control-group-labels div{white-space:nowrap}.formeo-controls .control-group-labels h4{display:inline-block;width:100%}.formeo-controls .form-actions{float:right;margin-top:4px}.formeo-controls .form-actions .svg-icon{fill:#666;display:none}.formeo-controls .form-actions .svg-icon:hover{fill:#000}.formeo-controls .form-actions .save-form:hover,.formeo-controls .form-actions .clear-form:hover{color:#fff}.formeo-controls .form-actions .save-form:hover{background-color:#325d88}.formeo-controls .form-actions .clear-form:hover{background-color:#d9534f}@media (max-width: 481px){.formeo-controls{width:45px}.formeo-controls .control-group{text-indent:-9999px}.formeo-controls .form-actions{display:inline-block;width:100%;position:relative;vertical-align:middle;float:none;margin-top:10px}.formeo-controls .form-actions>button+button{margin-top:-1px;margin-left:0}.formeo-controls .form-actions>button{max-width:100%;padding:10px;border-radius:0;line-height:0;width:100%;float:none;position:relative;display:block}.formeo-controls .form-actions>button:not(:first-child):not(:last-child){border-radius:0}.formeo-controls .form-actions>button:first-child:not(:last-child){border-radius:4px 4px 0 0}.formeo-controls .form-actions>button:last-child:not(:first-child){border-radius:0 0 4px 4px}.formeo-controls .form-actions .control-icon{display:inline-block;margin-right:10px}}.formeo-controls .field-control{cursor:move;list-style:none;margin:-1px 0 0;border:1px solid #cccccc;text-align:left;background:#fff;-webkit-user-select:none;user-select:none;overflow:hidden}.formeo-controls .field-control.control-moving{border-radius:8px;animation:DRAG_GHOST .5s forwards}.formeo-controls .field-control:before{margin-right:8px;font-size:16px}.formeo-controls .field-control:hover{background-color:#f2f2f2}.formeo-controls .field-control button{box-sizing:border-box;font-size:1em;line-height:1.8em;display:flex;height:100%;width:100%;background:transparent;border:0 none;text-align:left;padding:8px;border-radius:0}.formeo-controls .field-control button:focus{outline:0 none;background-color:#f2f2f2;box-shadow:0 0 0 1px #66afe9 inset;border-radius:0!important}.formeo-controls .field-control button:active{transform:none}.formeo-controls .field-control button:hover{filter:none}.formeo-controls .field-control .control-icon{margin-right:8px;text-align:center;width:24px;height:24px;display:flex;align-items:center;justify-content:center}[dir=rtl] .formeo-controls .field-control button{text-align:right!important}[dir=rtl] .formeo-controls .field-control svg{float:right!important;margin:0 0 0 8px!important}.formeo-controls .field-control .control-icon{pointer-events:none}.formeo-controls .field-control .control-icon .f-i-hash{padding:2px}.field-control{cursor:move;list-style:none;margin:-1px 0 0;border:1px solid #cccccc;text-align:left;background:#fff;-webkit-user-select:none;user-select:none;overflow:hidden}.field-control.control-moving{border-radius:8px;animation:DRAG_GHOST .5s forwards}.field-control:before{margin-right:8px;font-size:16px}.field-control:hover{background-color:#f2f2f2}.field-control button{box-sizing:border-box;font-size:1em;line-height:1.8em;display:flex;height:100%;width:100%;background:transparent;border:0 none;text-align:left;padding:8px;border-radius:0}.field-control button:focus{outline:0 none;background-color:#f2f2f2;box-shadow:0 0 0 1px #66afe9 inset;border-radius:0!important}.field-control button:active{transform:none}.field-control button:hover{filter:none}.field-control .control-icon{margin-right:8px;text-align:center;width:24px;height:24px;display:flex;align-items:center;justify-content:center}[dir=rtl] .field-control button{text-align:right!important}[dir=rtl] .field-control svg{float:right!important;margin:0 0 0 8px!important}.field-control .svg-icon{pointer-events:none} diff --git a/assets/css/demo.min.css.gz b/assets/css/demo.min.css.gz new file mode 100644 index 00000000..38a62b51 Binary files /dev/null and b/assets/css/demo.min.css.gz differ diff --git a/assets/css/formeo.min.css b/assets/css/formeo.min.css deleted file mode 100644 index ff2f58cd..00000000 --- a/assets/css/formeo.min.css +++ /dev/null @@ -1,8 +0,0 @@ - -/** -formeo - https://formeo.io -Version: 2.1.4 -Author: Draggable https://draggable.io -*/ - -.svg-icon{display:inline-block;width:24px;height:24px;pointer-events:none}.f-i-remove:hover{fill:#d9534f}button[class*=-move]:hover{background-color:#9954bb!important}button[class*=-move]:hover .svg-icon{fill:#fff}button[class*=-remove]:hover{background-color:#d9534f!important}button[class*=-remove]:hover .svg-icon{fill:#fff}button[class*=-clone]:hover{background-color:#93c54b!important}button[class*=-clone]:hover .svg-icon{fill:#fff}.item-edit-toggle:hover{background-color:#325d88!important}.item-edit-toggle:hover .svg-icon{fill:#fff}.f-autocomplete-list{background-color:#fff;display:none;list-style:none;padding:0;position:absolute;z-index:20;max-height:200px;overflow-y:auto;width:100%;margin:0 -1px;border:1px solid #999999;border-width:1px 1px 0;box-shadow:0 1px 4px #00000080}.f-autocomplete-list li{border:1px solid #999999;display:none;cursor:default;padding:4px;margin:-1px 0 0;border-width:1px 0;transition:background-color 133ms ease-in-out;will-change:background-color;font-size:.85em}.f-autocomplete-list li.active-option{background-color:#e1cceb}.f-autocomplete-list li:hover{background-color:#bd91d3}.f-autocomplete-list .component-type{color:#666;font-style:italic;font-size:.75em}.formeo-panels-wrap h5{margin:0;padding:.55em 0;color:#666;font-weight:400;display:inline-block;width:100%}.formeo-panels-wrap nav{position:relative;padding:0;overflow:hidden}.formeo-panels-wrap nav button{position:absolute;width:24px;color:#000;height:100%;padding:0;line-height:0;z-index:1}.formeo-panels-wrap nav button:focus{outline:none;border:1px solid rgb(102,175,233);box-shadow:none}.formeo-panels-wrap nav button .svg-icon{width:20px;height:20px}.formeo-panels-wrap nav button.next-group{right:0;top:0;border-top-left-radius:0;border-bottom-left-radius:0}.formeo-panels-wrap nav button.prev-group{left:0;top:0;border-top-right-radius:0;border-bottom-right-radius:0}.formeo-panels-wrap ul{margin:0;padding:0;list-style:none}.formeo-panels-wrap .f-panel{vertical-align:top;display:inline-block;width:100%;flex-direction:column;flex:1 0 100%}.formeo-panels-wrap .f-panel>li:last-child{border-radius:0 0 4px 4px}.formeo-panels-wrap .panels{white-space:nowrap;transition-property:height;transition-duration:.15s;transition-timing-function:ease-in-out;will-change:transform;flex-direction:row}.formeo-panels-wrap .panel-labels{height:100%;background:#fff;overflow:hidden;text-align:center;white-space:nowrap}.tabbed-panels .panel-nav{height:auto}.tabbed-panels .panel-nav button{display:none}.tabbed-panels .f-panel{background-color:#fff}.tabbed-panels .panel-labels div{flex-direction:row;justify-content:flex-start;flex-wrap:nowrap;align-content:stretch;align-items:stretch;display:flex}.tabbed-panels .panel-labels h5{flex-direction:column;flex:1;cursor:pointer;background-color:#ccc;box-shadow:0 -1px 8px #999 inset}.tabbed-panels .panel-labels h5.active-tab{color:#000;box-shadow:none;background-color:#fff}.formeo-sprite{display:none!important}.formeo *{box-sizing:inherit;font-family:inherit}.formeo .pill-buttons>button{border-radius:50px}.formeo hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid #cccccc}.formeo .f-field-group{flex-wrap:wrap;margin-bottom:12px}.formeo .f-field-group:last-child{margin-bottom:0}.formeo .f-field-group label+.badge{margin-left:8px}.formeo .f-field-group>label{display:inline-block;margin-bottom:4px}.formeo .f-field-group button{margin-right:4px}.formeo select{font-size:100%;font-family:inherit;height:2.1em;line-height:1.5;margin:0;border:1px solid #cccccc;border-radius:4px;background-color:#fff;width:100%;padding:.3em .6em;box-sizing:border-box}.formeo select:focus{border:1px solid rgb(102,175,233);outline:none}.formeo input{font-size:100%;font-family:inherit;height:2.1em;line-height:1.5;margin:0;border:1px solid #cccccc;border-radius:4px;background-color:#fff;width:100%;padding:.3em .6em;box-sizing:border-box}.formeo input:focus{border:1px solid rgb(102,175,233);outline:none}.formeo input[type=checkbox],.formeo input[type=radio]{width:auto;height:auto;margin-right:4px}.formeo input[type=date]{max-width:280px;display:block}.formeo textarea{font-size:100%;font-family:inherit;height:2.1em;line-height:1.5;margin:0;border:1px solid #cccccc;border-radius:4px;background-color:#fff;width:100%;padding:.3em .6em;box-sizing:border-box;height:auto}.formeo textarea:focus{border:1px solid rgb(102,175,233);outline:none}.formeo button{border-radius:4px;border:1px solid #666666;color:#333;background-color:#fff;padding:4px 8px;line-height:1.5em}.formeo button:active{transform:scale(.97)}.formeo button:hover{filter:brightness(.9)}.formeo button.primary,.formeo button.success,.formeo button.warning,.formeo button.error{color:#fff}.formeo button.primary{background-color:#325d88;border-color:#244463}.formeo button.success{background-color:#93c54b;border-color:#79a736}.formeo button.warning{background-color:#f47c3c;border-color:#ef5c0e}.formeo button.error{background-color:#d9534f;border-color:#c9302c}.formeo button[disabled]{background-color:#ccc;color:#fff}.formeo button:focus{border:1px solid rgb(102,175,233)}.formeo button:hover,.formeo button:focus{outline:0 none}.formeo .f-addon{font-size:100%;font-family:inherit;height:2.1em;line-height:1.5;margin:0;border:1px solid #cccccc;border-radius:4px;background-color:#fff;width:100%;padding:.3em .6em;box-sizing:border-box;width:auto}.formeo .f-addon:focus{border:1px solid rgb(102,175,233);outline:none}.formeo .f-addon label{margin:1px 0 0 3px}.formeo .f-addon:last-child{margin-left:-1px}.formeo .f-btn-group{display:inline-flex;vertical-align:middle}.formeo .f-btn-group>button{flex:0 1 auto}.formeo .f-btn-group>button:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.formeo .f-btn-group>button:last-child:not(:first-child):not(.dropdown-toggle){border-bottom-left-radius:0;border-top-left-radius:0}.formeo .f-btn-group>button:first-child{margin-left:0}.formeo .f-btn-group>button:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.formeo .f-btn-group button+button,.formeo .f-btn-group button+.f-btn-group,.formeo .f-btn-group .f-btn-group+button,.formeo .f-btn-group .f-btn-group+.f-btn-group,.formeo .f-btn-group .f-btn-group-vertical button+button,.formeo .f-btn-group .f-btn-group-vertical button+.f-btn-group,.formeo .f-btn-group .f-btn-group-vertical .f-btn-group+button,.formeo .f-btn-group .f-btn-group-vertical .f-btn-group+.f-btn-group{margin-left:-1px}.formeo .f-input-group{display:flex;flex-direction:row;justify-content:flex-start;flex-wrap:nowrap;align-content:stretch;align-items:stretch;display:inline-flex;vertical-align:bottom}.formeo .f-input-group input+input,.formeo .f-input-group input+select,.formeo .f-input-group select+select,.formeo .f-input-group select+input{margin-left:-1px}.formeo .f-input-group select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0ZWQgYnkgSWNvTW9vbi5pbyAtLT4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIyNCIgaGVpZ2h0PSIzMiIgdmlld0JveD0iMCAwIDI0IDMyIj4KPHBhdGggZmlsbD0iIzQ0NCIgZD0iTTAgMTJsMTEuOTkyIDExLjk5MiAxMS45OTItMTEuOTkyaC0yMy45ODR6Ij48L3BhdGg+Cjwvc3ZnPgo=);background-position:right 10px top 2px;background-repeat:no-repeat;background-size:16px}.formeo .f-input-group select::-ms-expand{display:none}.formeo .f-input-group .f-addon,.formeo .f-input-group input,.formeo .f-input-group select{flex:0 1 auto;border-radius:0}.formeo .f-input-group .f-addon:last-child,.formeo .f-input-group input:last-child,.formeo .f-input-group select:last-child{border-right-width:1px;border-radius:0 4px 4px 0}.formeo .f-input-group .f-addon:first-child,.formeo .f-input-group input:first-child,.formeo .f-input-group select:first-child{border-radius:4px 0 0 4px;border-left-width:1px}.formeo .f-input-group .f-addon:first-child:last-child,.formeo .f-input-group input:first-child:last-child,.formeo .f-input-group select:first-child:last-child{border-radius:4px}.formeo .f-input-group .f-addon:focus+input,.formeo .f-input-group .f-addon:focus+select,.formeo .f-input-group input:focus+input,.formeo .f-input-group input:focus+select,.formeo .f-input-group select:focus+input,.formeo .f-input-group select:focus+select{border-left:1px solid rgb(102,175,233)}.formeo .text-primary{color:#325d88}.formeo .text-success{color:#93c54b}.formeo .text-warning{color:#f47c3c}.formeo .text-error{color:#d9534f}.formeo.formeo-editor{display:flex;flex-direction:row;text-align:left;gap:16px}@keyframes PLACEHOLDER{0%{height:1px}to{height:15px}}@keyframes DRAG_GHOST{0%{box-shadow:0 0 #999}to{box-shadow:0 0 30px #999}}@keyframes EDIT_PULSE{0%,to{border-color:#66afe9}50%{border-color:#bfdef6}}@keyframes HIDE_CONDITION_FIELD{0%{display:none}to{display:none}}@keyframes COMPONENT_HIGHLIGHT_PULSE{0%{box-shadow:0 0 1px 8px #9954bb}to{box-shadow:0 0 #9954bb}}@keyframes SLIDE_UP{0%{transform:translateY(100%);clip-path:inset(0 0 100% -20%)}to{transform:translateY(0);clip-path:inset(0 0 0 -20%)}}.formeo.formeo-editor .component-tag{display:none;height:24px;z-index:200;flex-direction:row;gap:4px;align-items:center;position:absolute;font-size:.8em;padding:0 8px;left:50%;top:-24px;border-top-left-radius:8px;border-top-right-radius:8px;background-color:#fff;border-color:#ccc;border-style:solid;border-width:1px 1px 0 1px}.formeo.formeo-editor .component-tag [class*=-handle-]{width:12px;height:12px}.formeo.formeo-editor .component-tag .f-i-component-corner{position:absolute;width:8px;height:8px}.formeo.formeo-editor .component-tag .f-i-component-corner.bottom-right{bottom:0;right:-8px}.formeo.formeo-editor .component-tag .f-i-component-corner.bottom-left{bottom:0;left:-8px;transform:scaleX(-1)}.formeo.formeo-editor .children{margin:0;padding:0;list-style:none;height:100%}.formeo.formeo-editor .group-actions{display:flex;transition:opacity .3s ease-in-out allow-discrete;position:absolute;top:0;line-height:0;z-index:2;align-items:center;justify-content:center;flex-direction:row;border-radius:8px}.formeo.formeo-editor .group-actions .action-btn-wrap{display:none;align-items:center;justify-content:center;border-top-right-radius:8px;border-bottom-left-radius:8px;border-bottom-right-radius:8px;transition:opacity 1s ease-in-out allow-discrete}.formeo.formeo-editor .group-actions .action-btn-wrap .component-handle{opacity:.65}.formeo.formeo-editor .group-actions .action-btn-wrap button{background-color:#fff}.formeo.formeo-editor .group-actions button{background-color:transparent;width:24px;height:24px;padding:6px;border:0 none;line-height:0}.formeo.formeo-editor .group-actions button:focus{border:0 none;outline:0 none;box-shadow:none}.formeo.formeo-editor .group-actions .svg-icon{width:12px;height:12px}.formeo.formeo-editor .last-field .group-actions button:last-child{border-radius:0}.formeo.formeo-editor .column-editing-field .column-actions{display:none}.formeo.formeo-editor .group-config{display:none;padding:.5rem}.formeo.formeo-editor .editing-row .column-actions{display:none}.formeo.formeo-editor .hovering>.children,.formeo.formeo-editor .hovering>.field-preview,.formeo.formeo-editor .hovering>.prev-label{opacity:.65}.formeo.formeo-editor .hovering .group-actions .f-i-handle{display:none}.formeo.formeo-editor .formeo-row{transition:background-color 125ms ease-in-out;position:relative;clear:both;background-color:#fff;box-shadow:0 0 0 1px #ccc;padding:16px}.formeo.formeo-editor .formeo-row>.children{display:flex;flex-direction:row;justify-content:flex-start;flex-wrap:nowrap;align-content:stretch;align-items:stretch;gap:16px;min-height:32px}.formeo.formeo-editor .formeo-row:after{clear:both}.formeo.formeo-editor .formeo-row.control-ghost{padding:10px}.formeo.formeo-editor .formeo-row:first-child{border-top-right-radius:8px}.formeo.formeo-editor .formeo-row:first-child:not(.editing-row,.hovering-row){border-top-left-radius:8px}.formeo.formeo-editor .formeo-row:last-child{border-bottom-left-radius:8px;border-bottom-right-radius:8px}.formeo.formeo-editor .formeo-row:only-child{border-radius:8px}.formeo.formeo-editor .formeo-row.resizing-columns .formeo-column{transition:none}.formeo.formeo-editor .formeo-row.empty:after{left:0;transform:translate(8px,-50%)}.formeo.formeo-editor .formeo-row .layout-row-control{display:none}.formeo.formeo-editor .formeo-row .row-tag{left:-1px;border-color:#ef476f}.formeo.formeo-editor .formeo-row .row-tag .f-i-component-corner{fill:#fff;stroke:#ef476f}.formeo.formeo-editor .formeo-row:has(.hovering-column) .row-actions,.formeo.formeo-editor .formeo-row:has(.hovering-column) .field-actions{display:none}.formeo.formeo-editor .formeo-row.sortable-ghost{background-color:#fef0f3;box-shadow:0 0 0 1px #ef476f}.formeo.formeo-editor .formeo-row.sortable-ghost *{opacity:0}.formeo.formeo-editor .row-moving{background-color:#fef0f3!important}.formeo.formeo-editor .row-moving .action-btn-wrap button,.formeo.formeo-editor .row-moving .row-tag{background-color:#fef0f3}.formeo.formeo-editor .row-moving .row-tag .f-i-component-corner{fill:#fef0f3}.formeo.formeo-editor .row-actions{left:0}.formeo.formeo-editor .hovering-row .column-actions,.formeo.formeo-editor .hovering-row .field-actions{display:none}.formeo.formeo-editor .hovering-row:first-child{border-top-left-radius:0}.formeo.formeo-editor .hovering-row.editing-row:before{border-right-width:0}.formeo.formeo-editor .editing-row,.formeo.formeo-editor .editing-row .row-edit{display:block}.formeo.formeo-editor .editing-row.hovering-row .formeo-column{opacity:1}.formeo.formeo-editor .hovering-row,.formeo.formeo-editor .editing-row{box-shadow:0 0 0 1px #ef476f}.formeo.formeo-editor .hovering-row .row-handle,.formeo.formeo-editor .editing-row .row-handle{display:none}.formeo.formeo-editor .hovering-row .row-tag,.formeo.formeo-editor .editing-row .row-tag,.formeo.formeo-editor .hovering-row .row-action-btn-wrap,.formeo.formeo-editor .editing-row .row-action-btn-wrap{display:flex}.formeo.formeo-editor .hovering-row .row-action-btn-wrap button:last-child,.formeo.formeo-editor .editing-row .row-action-btn-wrap button:last-child{border-bottom-right-radius:8px}.formeo.formeo-editor .row-edit{padding-top:2rem}.formeo.formeo-editor .input-group-addon label{margin-bottom:0}.formeo.formeo-editor .formeo-column{margin:0;padding:0;list-style:none;transition:width 266ms;position:relative;flex-direction:column;will-change:width;max-width:100%}.formeo.formeo-editor .formeo-column>.children{display:flex;flex-direction:column;justify-content:flex-start;gap:16px}.formeo.formeo-editor .formeo-column .column-tag{border-color:#06d6a0}.formeo.formeo-editor .formeo-column .column-tag .f-i-component-corner{fill:#fff;stroke:#06d6a0}.formeo.formeo-editor .formeo-column .column-tag,.formeo.formeo-editor .formeo-column .column-actions{transform:translate(-50%)}.formeo.formeo-editor .formeo-column[class*=col-]{padding:0}.formeo.formeo-editor .formeo-column:first-child{border-bottom-left-radius:8px}.formeo.formeo-editor .formeo-column:last-child{border-bottom-right-radius:8px}.formeo.formeo-editor .formeo-column:last-child .resize-x-handle{display:none!important}.formeo.formeo-editor .formeo-column:only-child{border-bottom-right-radius:8px;border-bottom-left-radius:8px}.formeo.formeo-editor .formeo-column:only-child .resize-x-handle{display:none!important}.formeo.formeo-editor .formeo-column .resize-x-handle{display:none;position:absolute;right:-16px;top:0;bottom:0;width:16px;z-index:2;cursor:ew-resize}.formeo.formeo-editor .formeo-column .resize-x-handle:before{width:0;right:6px;border:1px dashed rgb(47.3227272727,249.1772727273,196.7727272727);border-width:0 2px;display:block;top:0;position:absolute;height:100%;content:""}.formeo.formeo-editor .formeo-column .resize-x-handle svg{fill:#2ff9c5;position:absolute;right:1px;width:14px}.formeo.formeo-editor .formeo-column .resize-x-handle svg.f-i-triangle-down{top:-14px}.formeo.formeo-editor .formeo-column .resize-x-handle svg.f-i-triangle-up{bottom:-14px}.formeo.formeo-editor .formeo-column .resize-x-handle:hover:before{border-color:#06d6a0}.formeo.formeo-editor .formeo-column .resize-x-handle:hover svg{fill:#06d6a0}.formeo.formeo-editor .formeo-column.editing-column{overflow:hidden}.formeo.formeo-editor .formeo-column.editing-column .column-edit{display:block}.formeo.formeo-editor .formeo-column:has(.hovering-field) .column-actions{display:none}.formeo.formeo-editor .formeo-column.sortable-ghost{background-color:#ddfef5;box-shadow:0 0 0 1px #06d6a0}.formeo.formeo-editor .formeo-column.sortable-ghost *{opacity:0}.formeo.formeo-editor .editing-row .formeo-column,.formeo.formeo-editor .editing-row .empty{border-radius:8px;height:60px;background-color:#e6e6e6}.formeo.formeo-editor .editing-row .formeo-column.empty,.formeo.formeo-editor .editing-row .empty.empty{min-height:0}.formeo.formeo-editor .editing-row .formeo-column .formeo-field,.formeo.formeo-editor .editing-row .empty .formeo-field{display:none}.formeo.formeo-editor .editing-row .formeo-column .resize-x-handle,.formeo.formeo-editor .editing-row .empty .resize-x-handle{display:block}.formeo.formeo-editor .editing-row .formeo-column:after,.formeo.formeo-editor .editing-row .empty:after{color:#333!important;line-height:1em;opacity:1;font-size:1.1em;content:attr(data-col-width)!important;display:block;width:100%;text-align:center;position:absolute;left:50%;margin-top:0;top:50%;transform:translate(-50%,-50%)}.formeo.formeo-editor .editing-field-preview .column-actions{display:none}.formeo.formeo-editor .column-moving,.formeo.formeo-editor .column-moving .action-btn-wrap button,.formeo.formeo-editor .column-moving .column-tag{background-color:#ddfef5}.formeo.formeo-editor .column-moving .column-tag .f-i-component-corner{fill:#ddfef5}.formeo.formeo-editor .hovering-column .column-tag{display:flex}.formeo.formeo-editor .hovering-column .column-handle{display:none}.formeo.formeo-editor .hovering-column .column-action-btn-wrap{display:flex}.formeo.formeo-editor .hovering-column:first-child{border-top-left-radius:0}.formeo.formeo-editor .hovering-column:after{opacity:0}.formeo.formeo-editor .hovering-column,.formeo.formeo-editor .editing-column{box-shadow:0 0 0 1px #06d6a0}.formeo.formeo-editor .column-actions{padding:0;left:50%;z-index:1;transition:width .15s}.formeo.formeo-editor .column-actions .f-i-handle{transform:rotate(90deg)}.formeo.formeo-editor .formeo-field{min-height:24px;position:relative;list-style:none;margin:0;will-change:box-shadow}.formeo.formeo-editor .formeo-field:last-child{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.formeo.formeo-editor .formeo-field.first-field,.formeo.formeo-editor .formeo-field.first-field .field-actions{border-top-right-radius:4px}.formeo.formeo-editor .formeo-field .prev-label{min-height:24px;max-width:calc(100% - 24px);display:flex;align-items:flex-end;margin-bottom:4px}.formeo.formeo-editor .formeo-field [contenteditable]{padding:1px 2px;-webkit-user-select:text;user-select:text;display:inline-block;position:relative;min-width:24px}.formeo.formeo-editor .formeo-field [contenteditable]:after{content:"";width:100%;position:absolute;bottom:0;left:0;border-bottom:1px dashed #cccccc}.formeo.formeo-editor .formeo-field [contenteditable]:focus{border-radius:4px;border-bottom-color:transparent;outline:none;box-shadow:0 0 0 1px #66afe9 inset}.formeo.formeo-editor .formeo-field [contenteditable]:focus:after{display:none}.formeo.formeo-editor .formeo-field .form-check{margin-left:1.25em}.formeo.formeo-editor .formeo-field .form-check-input:only-child{position:absolute}.formeo.formeo-editor .formeo-field.field-type-hidden{border:1px dashed #cccccc}.formeo.formeo-editor .formeo-field.sortable-ghost{background-color:#b8d2e9;box-shadow:0 0 0 1px #26547c}.formeo.formeo-editor .formeo-field.sortable-ghost *{opacity:0}.formeo.formeo-editor .field-tag{right:-1px;left:auto;top:-24px;border-color:#26547c;background-color:#fff}.formeo.formeo-editor .field-tag .f-i-component-corner{fill:#fff;stroke:#26547c}.formeo.formeo-editor .editing-field,.formeo.formeo-editor .hovering-field{box-shadow:0 0 0 1px #26547c}.formeo.formeo-editor .editing-field .field-tag,.formeo.formeo-editor .hovering-field .field-tag,.formeo.formeo-editor .editing-field .field-action-btn-wrap,.formeo.formeo-editor .hovering-field .field-action-btn-wrap{display:flex}.formeo.formeo-editor .editing-field .field-handle,.formeo.formeo-editor .hovering-field .field-handle{display:none}.formeo.formeo-editor .field-actions{border-color:transparent;border-width:1px 1px 0 0;border-style:solid;right:0;text-align:right;border-bottom-left-radius:4px;border-bottom-right-radius:0}.formeo.formeo-editor .field-actions .action-btn-wrap{flex-direction:row-reverse}.formeo.formeo-editor .field-moving,.formeo.formeo-editor .field-moving .action-btn-wrap button,.formeo.formeo-editor .field-moving .field-tag{background-color:#b8d2e9}.formeo.formeo-editor .field-moving .field-tag .f-i-component-corner{fill:#b8d2e9}.formeo.formeo-editor .editing-field{z-index:1}.formeo.formeo-editor .editing-field-preview .field-actions{display:none}.formeo.formeo-editor .field-preview p{white-space:normal}.formeo.formeo-editor .field-edit{display:none;overflow:hidden;margin-top:16px;border-top:1px solid #cccccc}.formeo.formeo-editor .field-edit label{font-size:.825em}.formeo.formeo-editor .field-edit .panel-nav{margin-bottom:0;padding:0;overflow:hidden}.formeo.formeo-editor .field-edit .panel-nav button{border-bottom-left-radius:0;border-bottom-right-radius:0}.formeo.formeo-editor .field-edit.field-edit-options{list-style:decimal}.formeo.formeo-editor .field-edit .active-panel{background-color:#fff}.formeo.formeo-editor .field-edit .field-prop{display:flex}.formeo.formeo-editor .field-edit .prop-controls{flex-shrink:0;align-items:center;display:flex;margin-left:3px}.formeo.formeo-editor .field-edit .prop-controls button{position:relative}.formeo.formeo-editor .field-edit .prop-controls .svg-icon{width:12px;height:12px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.formeo.formeo-editor .field-edit .prop-control{width:24px;height:24px;right:0;bottom:0;position:absolute;padding:0}.formeo.formeo-editor .field-edit .prop-control:nth-of-type(1){right:0}.formeo.formeo-editor .field-edit .prop-control:nth-of-type(2){right:24px}.formeo.formeo-editor .field-edit .prop-control:nth-of-type(3){right:48px}.formeo.formeo-editor .field-edit .prop-control:nth-of-type(4){right:72px}.formeo.formeo-editor .field-edit .prop-control:first-child{right:0}.formeo.formeo-editor :not(.control-count-1) .field-edit .prop-control:last-child{border-radius:4px 0 0 4px;margin-right:-1px;display:none}.formeo.formeo-editor :not(.control-count-1) .field-edit .prop-control:first-child{border-radius:4px}.formeo.formeo-editor .field-edit .prop-control:hover:first-child{border-radius:0 4px 4px 0}.formeo.formeo-editor .field-edit .prop-control:hover:first-child:last-child{border-radius:4px}.formeo.formeo-editor .field-edit .prop-control:hover:last-child{display:inline-block}.formeo.formeo-editor .field-edit .prop-control:last-child:first-child{display:inline-block;border-radius:4px;margin-right:0}.formeo.formeo-editor .field-edit .prop-wrap{position:relative;margin-bottom:8px;list-style:none;margin-left:0}.formeo.formeo-editor .field-edit .field-edit-group{padding:8px 8px 0}.formeo.formeo-editor .field-edit [contenteditable]{display:flex;flex-direction:row;justify-content:flex-start;flex-wrap:nowrap;align-content:stretch;align-items:stretch}.formeo.formeo-editor .field-edit .prop-inputs,.formeo.formeo-editor .field-edit .prop-controls{transition:width .15s;will-change:width}.formeo.formeo-editor .field-edit .prop-inputs .f-addon,.formeo.formeo-editor .field-edit .prop-inputs input:not([type=checkbox]):not([type=radio]),.formeo.formeo-editor .field-edit .prop-inputs select,.formeo.formeo-editor .field-edit .prop-inputs textarea,.formeo.formeo-editor .field-edit .prop-inputs [contenteditable],.formeo.formeo-editor .field-edit .prop-controls .f-addon,.formeo.formeo-editor .field-edit .prop-controls input:not([type=checkbox]):not([type=radio]),.formeo.formeo-editor .field-edit .prop-controls select,.formeo.formeo-editor .field-edit .prop-controls textarea,.formeo.formeo-editor .field-edit .prop-controls [contenteditable]{font-size:.825em;flex:1 1 auto}.formeo.formeo-editor .field-edit .prop-inputs .f-addon:focus,.formeo.formeo-editor .field-edit .prop-inputs input:not([type=checkbox]):not([type=radio]):focus,.formeo.formeo-editor .field-edit .prop-inputs select:focus,.formeo.formeo-editor .field-edit .prop-inputs textarea:focus,.formeo.formeo-editor .field-edit .prop-inputs [contenteditable]:focus,.formeo.formeo-editor .field-edit .prop-controls .f-addon:focus,.formeo.formeo-editor .field-edit .prop-controls input:not([type=checkbox]):not([type=radio]):focus,.formeo.formeo-editor .field-edit .prop-controls select:focus,.formeo.formeo-editor .field-edit .prop-controls textarea:focus,.formeo.formeo-editor .field-edit .prop-controls [contenteditable]:focus{z-index:1}.formeo.formeo-editor .field-edit .prop-inputs [class^=condition-]+select,.formeo.formeo-editor .field-edit .prop-inputs select+[class^=condition-],.formeo.formeo-editor .field-edit .prop-controls [class^=condition-]+select,.formeo.formeo-editor .field-edit .prop-controls select+[class^=condition-]{margin-left:-1px}.formeo.formeo-editor .field-edit .control-count-2 .prop-controls:hover{width:48px}.formeo.formeo-editor .field-edit .control-count-2 .prop-controls:hover+.prop-inputs{width:calc(100% - 24px)}.formeo.formeo-editor .field-edit.panel-count-1 .panel-nav{border-bottom:1px solid #999999}.formeo.formeo-editor .field-edit.panel-count-1 .panel-nav button{display:none}.formeo.formeo-editor .field-edit.panel-count-1 .panel-labels{background-color:transparent}.formeo.formeo-editor .f-condition-row{display:flex;width:100%;margin-top:-1px;border:1px solid #cccccc}.formeo.formeo-editor .f-condition-row input,.formeo.formeo-editor .f-condition-row select,.formeo.formeo-editor .f-condition-row [contenteditable]{border-width:0;border-radius:0;width:inherit;box-shadow:0 0 0 1px #ccc}.formeo.formeo-editor .f-condition-row input:focus,.formeo.formeo-editor .f-condition-row select:focus,.formeo.formeo-editor .f-condition-row [contenteditable]:focus{box-shadow:0 0 0 1px #66afe9}.formeo.formeo-editor .f-condition-row:first-child input:last-child,.formeo.formeo-editor .f-condition-row:first-child select:last-child{border-top-right-radius:4px}.formeo.formeo-editor .f-condition-row:last-child input:last-child,.formeo.formeo-editor .f-condition-row:last-child select:last-child{border-bottom-right-radius:4px}.formeo.formeo-editor .f-condition-row:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.formeo.formeo-editor .f-condition-row:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px}.formeo.formeo-editor .f-condition-row .condition-logical{max-width:56px;text-transform:uppercase}.formeo.formeo-editor .f-condition-row div.condition-source,.formeo.formeo-editor .f-condition-row div.condition-target{position:relative;width:100%}.formeo.formeo-editor .f-condition-row [class^=condition-]{max-width:100%;transition:max-width 266ms;will-change:max-width}.formeo.formeo-editor .f-condition-row.if-condition-row.condition-sourceProperty-isVisible .condition-comparison,.formeo.formeo-editor .f-condition-row.if-condition-row.condition-sourceProperty-isVisible .condition-target,.formeo.formeo-editor .f-condition-row.if-condition-row.condition-sourceProperty-isVisible .condition-assignment,.formeo.formeo-editor .f-condition-row.if-condition-row.condition-sourceProperty-isVisible .condition-value,.formeo.formeo-editor .f-condition-row.if-condition-row.condition-sourceProperty-isVisible .condition-targetProperty,.formeo.formeo-editor .f-condition-row.if-condition-row.condition-sourceProperty-isNotVisible .condition-comparison,.formeo.formeo-editor .f-condition-row.if-condition-row.condition-sourceProperty-isNotVisible .condition-target,.formeo.formeo-editor .f-condition-row.if-condition-row.condition-sourceProperty-isNotVisible .condition-assignment,.formeo.formeo-editor .f-condition-row.if-condition-row.condition-sourceProperty-isNotVisible .condition-value,.formeo.formeo-editor .f-condition-row.if-condition-row.condition-sourceProperty-isNotVisible .condition-targetProperty,.formeo.formeo-editor .f-condition-row.then-condition-row.condition-targetProperty-isVisible .condition-comparison,.formeo.formeo-editor .f-condition-row.then-condition-row.condition-targetProperty-isVisible .condition-assignment,.formeo.formeo-editor .f-condition-row.then-condition-row.condition-targetProperty-isVisible .condition-value,.formeo.formeo-editor .f-condition-row.then-condition-row.condition-targetProperty-isNotVisible .condition-comparison,.formeo.formeo-editor .f-condition-row.then-condition-row.condition-targetProperty-isNotVisible .condition-assignment,.formeo.formeo-editor .f-condition-row.then-condition-row.condition-targetProperty-isNotVisible .condition-value,.formeo.formeo-editor .f-condition-row.condition-target .condition-targetProperty,.formeo.formeo-editor .f-condition-row.condition-source .condition-sourceProperty{max-width:0%;padding:0;border:0 none;overflow:hidden}.formeo.formeo-editor .f-autocomplete-display-field+.f-autocomplete-list:focus{z-index:100}.formeo.formeo-editor [class$=-focused]{z-index:1}.formeo.formeo-editor [class$=-focused] .f-autocomplete-list{z-index:100}.formeo.formeo-editor .conditions-prop-inputs label.condition-label{display:inline-flex;flex:0 0 auto;box-shadow:0 0 0 1px #ccc;align-items:center;padding:4px;border-right:0;text-transform:uppercase;color:#999}.formeo.formeo-editor .conditions-prop-inputs label.condition-label.if-condition-label{border-top-left-radius:4px;border-bottom-left-radius:0;border-bottom-right-radius:0}.formeo.formeo-editor .conditions-prop-inputs label.condition-label.then-condition-label{border-bottom-left-radius:4px;border-top-left-radius:0;border-top-right-radius:0;border-top:0}.formeo.formeo-editor .field-edit-group{margin:0;padding:0;list-style:none}.formeo.formeo-editor .hidden-property{display:none}.formeo.formeo-editor .options-panel .prop-wrap{margin-bottom:8px}.formeo.formeo-editor .options-panel .input-group-addon{line-height:0}.formeo.formeo-editor .options-panel .prop-labels{padding:8px 34px 8px 8px}.formeo.formeo-editor .options-panel .prop-labels .input-group-addon{font-size:12px}.formeo.formeo-editor .options-panel .prop-labels label{font-size:12px;width:50%;position:relative;display:table-cell}.formeo.formeo-editor .options-panel .prop-label-selected,.formeo.formeo-editor .options-panel .prop-label-disabled{width:1%!important;white-space:nowrap;vertical-align:middle;border:0 none;background-color:transparent}.formeo.formeo-editor .panel-action-buttons{padding:0 8px 8px}.formeo.formeo-editor .panel-action-buttons:after{content:"";display:table;clear:both}.formeo.formeo-editor .panel-action-buttons [class^=add-]{float:right}.formeo.formeo-editor .prop-inputs{width:100%;align-items:center;vertical-align:bottom;display:flex;flex-direction:row;flex-grow:1}.formeo.formeo-editor .prop-inputs.conditions-prop-inputs{flex-direction:column}.formeo.formeo-editor .prop-inputs .f-field-group{width:100%;margin-bottom:0;display:inline-flex;align-items:center}.formeo.formeo-editor .prop-inputs .f-addon{display:flex;align-items:center;flex:0}.formeo.formeo-editor .prop-inputs .f-addon:first-child{margin-right:-1px}.formeo.formeo-editor .prop-inputs .f-addon:last-child{margin-left:-1px}.formeo.formeo-editor .prop-inputs label{padding-right:1em;margin-bottom:0}.formeo.formeo-editor .prop-inputs.attrs-prop-inputs .f-addon,.formeo.formeo-editor .prop-inputs.attrs-prop-inputs input:not([type=checkbox]):not([type=radio]),.formeo.formeo-editor .prop-inputs.attrs-prop-inputs select,.formeo.formeo-editor .prop-inputs.attrs-prop-inputs textarea,.formeo.formeo-editor .prop-inputs.attrs-prop-inputs [contenteditable]{flex:2}.formeo.formeo-editor .highlight-component{box-shadow:0 0 4px 2px #9954bb}.formeo.formeo-editor .formeo-stage{width:73%;box-sizing:border-box;transition:width .25s;flex:1 1 auto;position:relative;transition-property:background-color,border-color;transition-duration:.5s,333ms;border:0 dashed transparent;background-color:#fff0;overflow:visible;margin:0;padding:0;list-style:none}.formeo.formeo-editor .formeo-stage>.children{display:flex;flex-direction:column;justify-content:flex-start;gap:16px}.formeo.formeo-editor .formeo-stage.empty{border:3px dashed #cccccc;background-color:#ffffff40}.formeo.formeo-editor .formeo-stage.removing-all-fields .formeo-row{transition:margin-top .25s ease-in}.formeo.formeo-editor .formeo-stage>.formeo-field{background-color:#fff}@media (max-width: 481px){.formeo.formeo-editor .formeo-stage{width:calc(100% - 50px)}}.formeo.formeo-editor .formeo-stage:has(.editing-field) .column-actions{display:none}.formeo.formeo-editor .formeo-stage:has(.editing-field) .row-actions{display:none}.formeo.formeo-editor .editing-stage .formeo-settings{display:block}.formeo.formeo-editor .editing-stage .formeo-stage{display:none}.formeo.formeo-editor .f-field-group{margin-bottom:0}.formeo.formeo-editor [class$=empty][class*=editing-]:after{opacity:0}.formeo.formeo-editor [class$=empty]:after{opacity:1;font-size:24px;position:absolute;top:50%;left:50%;color:#999;transition:opacity .2s ease-in-out;will-change:opacity;text-align:center;transform:translate(-50%,-50%);content:attr(data-hover-tag)}.formeo.formeo-editor .formeo-settings{display:none}.formeo.formeo-editor [dir=rtl] .f-btn-group{display:inline-flex;vertical-align:middle}.formeo.formeo-editor [dir=rtl] .f-btn-group>button{flex:0 1 auto}.formeo.formeo-editor [dir=rtl] .f-btn-group>button:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.formeo.formeo-editor [dir=rtl] .f-btn-group>button:last-child:not(:first-child):not(.dropdown-toggle){border-radius:4px 0 0 4px}.formeo.formeo-editor [dir=rtl] .f-btn-group>button:first-child{margin-left:0}.formeo.formeo-editor [dir=rtl] .f-btn-group>button:first-child:not(:last-child):not(.dropdown-toggle){border-radius:0 4px 4px 0}.formeo.formeo-editor [dir=rtl] .f-btn-group button+button,.formeo.formeo-editor [dir=rtl] .f-btn-group button+.f-btn-group,.formeo.formeo-editor [dir=rtl] .f-btn-group .f-btn-group+button,.formeo.formeo-editor [dir=rtl] .f-btn-group .f-btn-group+.f-btn-group,.formeo.formeo-editor [dir=rtl] .f-btn-group .f-btn-group-vertical button+button,.formeo.formeo-editor [dir=rtl] .f-btn-group .f-btn-group-vertical button+.f-btn-group,.formeo.formeo-editor [dir=rtl] .f-btn-group .f-btn-group-vertical .f-btn-group+button,.formeo.formeo-editor [dir=rtl] .f-btn-group .f-btn-group-vertical .f-btn-group+.f-btn-group{margin-right:-1px}.formeo.formeo-editor [dir=rtl] .formeo-controls,.formeo.formeo-editor [dir=rtl] .formeo-controls .form-actions{float:left}.formeo.formeo-editor [dir=rtl] .formeo-stage-wrap{float:right}.formeo.formeo-editor [dir=rtl] .formeo-stage-wrap .formeo-stage{padding-left:4px;padding-right:23px}.formeo.formeo-editor [dir=rtl] .formeo-row:before{border-bottom-left-radius:8px;border-bottom-right-radius:0;right:0;left:auto}.formeo.formeo-editor [dir=rtl] .formeo-row:first-child{border-top-left-radius:8px;border-top-right-radius:0}.formeo.formeo-editor [dir=rtl] .formeo-row:last-child{border-bottom-left-radius:8px;border-bottom-right-radius:8px}.formeo.formeo-editor [dir=rtl] .formeo-row.hovering-row:first-child{border-top-left-radius:0}.formeo.formeo-editor [dir=rtl] .formeo-row.hovering-row:before{border-left-width:1px}.formeo.formeo-editor [dir=rtl] .formeo-row.empty:after{left:0;right:auto}.formeo.formeo-render .formeo-row,.formeo.formeo-render .formeo-column,.formeo.formeo-render .formeo-field{position:relative}.formeo.formeo-render .f-input-group-wrap>fieldset{position:relative}.formeo.formeo-render .f-input-group-wrap>fieldset .remove-input-group{top:8px}.formeo.formeo-render .will-remove{background-color:#d9534f40;box-shadow:0 0 1px #d9534f inset}.formeo.formeo-render .formeo-row{margin-bottom:1em;flex-direction:row;justify-content:flex-start;flex-wrap:nowrap;align-content:stretch;align-items:stretch;display:flex;border-radius:8px;transition:background-color .2s,padding .2s;padding:4px 0}.formeo.formeo-render .formeo-row.will-remove{padding:4px}.formeo.formeo-render .formeo-row:last-of-type{margin-bottom:0}.formeo.formeo-render .formeo-row-wrap{margin-bottom:1em}.formeo.formeo-render .formeo-row-wrap:last-child{margin-bottom:0}.formeo.formeo-render .f-input-group-wrap:after{content:"";display:table;clear:both}.formeo.formeo-render .f-input-group-wrap .formeo-row:first-of-type .remove-input-group{display:none}.formeo.formeo-render .f-input-group{position:relative}.formeo.formeo-render .f-input-group:first-child .remove-input-group{display:none}.formeo.formeo-render .add-input-group{float:right;margin-top:10px}.formeo.formeo-render .remove-input-group{position:absolute;right:0;top:0;width:16px;height:16px;border:0 none;background:transparent;outline:0 none;line-height:0;padding:4px}.formeo.formeo-render .remove-input-group:hover .svg-icon{fill:#d9534f}.formeo.formeo-render .remove-input-group .svg-icon{pointer-events:none}.formeo.formeo-render .form-check-input:only-child{position:absolute}.formeo.formeo-render .svg-icon{max-width:100%;max-height:100%}.formeo.formeo-render .formeo-column{padding:0 4px;float:left;max-width:none;flex-direction:column}.formeo.formeo-render .formeo-column:first-of-type{padding-left:0}.formeo.formeo-render .formeo-column:last-of-type{padding-right:0}.formeo-controls{width:26%;overflow:hidden}.formeo-controls.formeo-sticky{position:sticky;top:0;align-self:flex-start}.formeo-controls.pull-left .form-actions{float:left}.formeo-controls .filtered-term{background-color:#fff;text-align:center;border-radius:4px 4px 0 0;border:1px solid #cccccc;border-bottom:0 none;width:calc(100% - 2px)}.formeo-controls .tabbed-panels nav{padding:0}.formeo-controls nav{position:relative;padding:0 24px;overflow:hidden}.formeo-controls nav h5{font-size:13px;line-height:22px}.formeo-controls nav button{position:absolute;width:24px;color:#000;height:calc(100% + 1px);padding:0;line-height:0;margin:0;border-color:#ccc}.formeo-controls nav button.next-group{right:0;top:0;border-radius:0 8px 0 0}.formeo-controls nav button.prev-group{border-top-left-radius:8px;border-bottom-left-radius:0;left:0}.formeo-controls .formeo-panels-wrap{font-size:.85em;line-height:1.8em}.formeo-controls .panel-labels{border-top:1px solid #cccccc}.formeo-controls .panel-count-1{border-bottom-left-radius:0}.formeo-controls .panel-count-1 .panel-nav{display:none}.formeo-controls .panel-count-1 .control-group li:first-child{border-radius:8px 8px 0 0}.formeo-controls ul{margin:0;padding:0;list-style:none}.formeo-controls .control-group{vertical-align:top;display:inline-block;width:100%;border-top:1px solid #cccccc}.formeo-controls .control-group>li:first-child{border-top-right-radius:0}.formeo-controls .control-group>li:last-child{border-radius:0 0 8px 8px}.formeo-controls.filtered .panel-nav{display:none}.formeo-controls.filtered .control-group{display:block}.formeo-controls.filtered .control-group>li{border-radius:0}.formeo-controls.filtered .control-group:last-child>li:last-child{border-radius:0 0 0 4px}.formeo-controls .control-groups{white-space:nowrap}.formeo-controls .control-group-labels{height:100%;background:#fff;overflow:hidden}.formeo-controls .control-group-labels div{white-space:nowrap}.formeo-controls .control-group-labels h4{display:inline-block;width:100%}.formeo-controls .form-actions{float:right;margin-top:4px}.formeo-controls .form-actions .svg-icon{fill:#666;display:none}.formeo-controls .form-actions .svg-icon:hover{fill:#000}.formeo-controls .form-actions .save-form:hover,.formeo-controls .form-actions .clear-form:hover{color:#fff}.formeo-controls .form-actions .save-form:hover{background-color:#325d88}.formeo-controls .form-actions .clear-form:hover{background-color:#d9534f}@media (max-width: 481px){.formeo-controls{width:45px}.formeo-controls .control-group{text-indent:-9999px}.formeo-controls .form-actions{display:inline-block;width:100%;position:relative;vertical-align:middle;float:none;margin-top:10px}.formeo-controls .form-actions>button+button{margin-top:-1px;margin-left:0}.formeo-controls .form-actions>button{max-width:100%;padding:10px;border-radius:0;line-height:0;width:100%;float:none;position:relative;display:block}.formeo-controls .form-actions>button:not(:first-child):not(:last-child){border-radius:0}.formeo-controls .form-actions>button:first-child:not(:last-child){border-radius:4px 4px 0 0}.formeo-controls .form-actions>button:last-child:not(:first-child){border-radius:0 0 4px 4px}.formeo-controls .form-actions .control-icon{display:inline-block;margin-right:10px}}.formeo-controls .field-control{cursor:move;list-style:none;margin:-1px 0 0;border:1px solid #cccccc;text-align:left;background:#fff;-webkit-user-select:none;user-select:none;overflow:hidden}.formeo-controls .field-control.control-moving{border-radius:8px;animation:DRAG_GHOST .5s forwards}.formeo-controls .field-control:before{margin-right:8px;font-size:16px}.formeo-controls .field-control:hover{background-color:#f2f2f2}.formeo-controls .field-control button{box-sizing:border-box;font-size:1em;line-height:1.8em;display:flex;height:100%;width:100%;background:transparent;border:0 none;text-align:left;padding:8px;border-radius:0}.formeo-controls .field-control button:focus{outline:0 none;background-color:#f2f2f2;box-shadow:0 0 0 1px #66afe9 inset;border-radius:0!important}.formeo-controls .field-control button:active{transform:none}.formeo-controls .field-control button:hover{filter:none}.formeo-controls .field-control .control-icon{margin-right:8px;text-align:center;width:24px;height:24px;display:flex;align-items:center;justify-content:center}[dir=rtl] .formeo-controls .field-control button{text-align:right!important}[dir=rtl] .formeo-controls .field-control svg{float:right!important;margin:0 0 0 8px!important}.formeo-controls .field-control .control-icon{pointer-events:none}.formeo-controls .field-control .control-icon .f-i-hash{padding:2px}.field-control{cursor:move;list-style:none;margin:-1px 0 0;border:1px solid #cccccc;text-align:left;background:#fff;-webkit-user-select:none;user-select:none;overflow:hidden}.field-control.control-moving{border-radius:8px;animation:DRAG_GHOST .5s forwards}.field-control:before{margin-right:8px;font-size:16px}.field-control:hover{background-color:#f2f2f2}.field-control button{box-sizing:border-box;font-size:1em;line-height:1.8em;display:flex;height:100%;width:100%;background:transparent;border:0 none;text-align:left;padding:8px;border-radius:0}.field-control button:focus{outline:0 none;background-color:#f2f2f2;box-shadow:0 0 0 1px #66afe9 inset;border-radius:0!important}.field-control button:active{transform:none}.field-control button:hover{filter:none}.field-control .control-icon{margin-right:8px;text-align:center;width:24px;height:24px;display:flex;align-items:center;justify-content:center}[dir=rtl] .field-control button{text-align:right!important}[dir=rtl] .field-control svg{float:right!important;margin:0 0 0 8px!important}.field-control .svg-icon{pointer-events:none} diff --git a/assets/css/formeo.min.css.gz b/assets/css/formeo.min.css.gz deleted file mode 100644 index c327d86d..00000000 Binary files a/assets/css/formeo.min.css.gz and /dev/null differ diff --git a/assets/js/demo.min.js b/assets/js/demo.min.js index 445c0572..953dd25d 100644 --- a/assets/js/demo.min.js +++ b/assets/js/demo.min.js @@ -1,8 +1,8 @@ /** formeo - https://formeo.io -Version: 2.1.4 +Version: 2.1.5 Author: Draggable https://draggable.io */ -import{t as e,g as t,F as n,a as o}from"./formeo.min.js";!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver((e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)})).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();const r=-1!==window.location.href.indexOf("draggable.github.io");if(r){"https:"!==window.location.protocol&&(window.location.protocol="https:"),((window.gitter={}).chat={}).options={room:"Draggable/formeo",activationElement:".toggle-gitter"};[{src:"//platform.twitter.com/widgets.js",id:"twitter-script"},{src:"//buttons.github.io/buttons.js",id:"github-script"},{src:"//www.google-analytics.com/analytics.js",id:"google-analytics",onload:()=>{window.ga("create","UA-79014176-2","auto"),window.ga("send","pageview")}}].forEach((function(e){const[t]=document.getElementsByTagName("script");if(document.getElementById(e.id))return;const n=Object.assign(document.createElement("script"),e);t.parentNode.insertBefore(n,t)}))}const i={user:{isAuthenticated:!0,userName:"Kevin"}},u={rows:{all:{events:{onRender:e=>{}}}},fields:{checkbox:{actionButtons:{}},"a33bcc32-c54c-46ed-9609-7cdb5b3dc511":{events:{onRender:e=>{const t=setTimeout((()=>{e.querySelector(".next-group").click(),clearTimeout(t)}),333)}},panels:{attrs:{hideDisabled:!0},disabled:[]}}}},a={editorContainer:document.querySelector(".build-form"),i18n:{location:"./assets/lang"},actions:{},external:i,controls:{sortable:!1,groupOrder:["common","html"],disable:{},elements:[{tag:"input",config:{label:"Email",disabledAttrs:["type"],lockedAttrs:["required","className"]},meta:{group:"common",id:"email",icon:"@"},attrs:{className:"custom-email",type:"email",required:!0}}],elementOrder:{common:["button","checkbox","date-input","hidden","upload","number","radio","select","text-input","textarea"]}},config:u,events:{onSave:console.log},sessionStorage:!0,editPanelOrder:["attrs","options"]},c={renderContainer:".render-form",external:i,elements:{tinymce:{dependencies:{js:"cdnjs.cloudflare.com/ajax/libs/tinymce/4.9.11/tinymce.min.js"},action:{onRender:e=>{if(e.id){const t=`#${e.id}`;window.tinymce.remove(t),window.tinymce.init({selector:t})}}}}}};var d=function(e,t,n,o){var r=-1,i=null==e?0:e.length;for(o&&i&&(n=e[++r]);++rr?0:r+t),(n=n>r?r:n)<0&&(n+=r),r=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(r);++o=o?e:V(e,t,n)},Q=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var X=function(e){return Q.test(e)};var ee=function(e){return e.split("")},te="\\ud800-\\udfff",ne="["+te+"]",oe="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",re="\\ud83c[\\udffb-\\udfff]",ie="[^"+te+"]",ue="(?:\\ud83c[\\udde6-\\uddff]){2}",ae="[\\ud800-\\udbff][\\udc00-\\udfff]",ce="(?:"+oe+"|"+re+")"+"?",de="[\\ufe0e\\ufe0f]?",fe=de+ce+("(?:\\u200d(?:"+[ie,ue,ae].join("|")+")"+de+ce+")*"),se="(?:"+[ie+oe+"?",oe,ue,ae,ne].join("|")+")",le=RegExp(re+"(?="+re+")|"+se+fe,"g");var me=ee,ge=X,pe=function(e){return e.match(le)||[]};var xe=W,be=X,ve=function(e){return ge(e)?pe(e):me(e)},we=e;var he=function(e){return function(t){t=we(t);var n=be(t)?ve(t):void 0,o=n?n[0]:t.charAt(0),r=n?xe(n,1).join(""):t.slice(1);return o[e]()+r}}("toUpperCase");const ye=t(_((function(e,t,n){return e+(n?" ":"")+he(t)}))),Ee=document.getElementById("editor-action-buttons"),Ae=document.querySelector(".render-form"),je=new n(a);((e,t)=>{const n=((e,t)=>({renderForm:()=>{Ae.style.display="block",t.render(e.formData)},logJSON:()=>{},viewData:()=>{Object.entries(e.formData).forEach((([e,t])=>{}))},resetEditor:()=>{window.sessionStorage.removeItem("formeo-formData"),window.location.reload()}}))(e,t);Object.entries(n).map((([e,t])=>{const n={id:e,type:"button"},o=Object.assign(document.createElement("button"),n),r=document.createTextNode(ye(e));return o.appendChild(r),o.addEventListener("click",t,!1),Ee.appendChild(o),o}))})(je,new o(c)),(e=>{const t=document.getElementById("control-filter"),n=document.getElementById("locale"),o=window.sessionStorage.getItem("formeo-locale");t.addEventListener("input",(({target:{value:t}})=>e.controls.actions.filter(t))),n.value=o||"en-US",n.addEventListener("change",(({target:{value:t}})=>{window.sessionStorage.setItem("formeo-locale",t),e.i18n.setLang(t)}),!1)})(je); +var t=Object.defineProperty,e=(e,n,o)=>((e,n,o)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o)(e,"symbol"!=typeof n?n+"":n,o);!function(){const t=document.createElement("link").relList;if(!(t&&t.supports&&t.supports("modulepreload"))){for(const t of document.querySelectorAll('link[rel="modulepreload"]'))e(t);new MutationObserver((t=>{for(const n of t)if("childList"===n.type)for(const t of n.addedNodes)"LINK"===t.tagName&&"modulepreload"===t.rel&&e(t)})).observe(document,{childList:!0,subtree:!0})}function e(t){if(t.ep)return;t.ep=!0;const e=function(t){const e={};return t.integrity&&(e.integrity=t.integrity),t.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),"use-credentials"===t.crossOrigin?e.credentials="include":"anonymous"===t.crossOrigin?e.credentials="omit":e.credentials="same-origin",e}(t);fetch(t.href,e)}}();const n=-1!==window.location.href.indexOf("draggable.github.io");if(n){"https:"!==window.location.protocol&&(window.location.protocol="https:"),((window.gitter={}).chat={}).options={room:"Draggable/formeo",activationElement:".toggle-gitter"};[{src:"//platform.twitter.com/widgets.js",id:"twitter-script"},{src:"//buttons.github.io/buttons.js",id:"github-script"},{src:"//www.google-analytics.com/analytics.js",id:"google-analytics",onload:()=>{window.ga("create","UA-79014176-2","auto"),window.ga("send","pageview")}}].forEach((function(t){const[e]=document.getElementsByTagName("script");if(document.getElementById(t.id))return;const n=Object.assign(document.createElement("script"),t);e.parentNode.insertBefore(n,e)}))}const o={user:{isAuthenticated:!0,userName:"Kevin"}},i={rows:{all:{events:{onRender:t=>{}}}},fields:{checkbox:{actionButtons:{}},"a33bcc32-c54c-46ed-9609-7cdb5b3dc511":{events:{onRender:t=>{const e=setTimeout((()=>{t.querySelector(".next-group").click(),clearTimeout(e)}),333)}},panels:{attrs:{hideDisabled:!0},disabled:[]}}}},r={editorContainer:document.querySelector(".build-form"),i18n:{location:"./assets/lang"},actions:{},external:o,controls:{sortable:!1,groupOrder:["common","html"],disable:{},elements:[{tag:"input",config:{label:"Email",disabledAttrs:["type"],lockedAttrs:["required","className"]},meta:{group:"common",id:"email",icon:"@"},attrs:{className:"custom-email",type:"email",required:!0}}],elementOrder:{common:["button","checkbox","date-input","hidden","upload","number","radio","select","text-input","textarea"]}},config:i,events:{onSave:console.log},sessionStorage:!0,editPanelOrder:["attrs","options"]},s={renderContainer:".render-form",external:o,elements:{tinymce:{dependencies:{js:"cdnjs.cloudflare.com/ajax/libs/tinymce/4.9.11/tinymce.min.js"},action:{onRender:t=>{if(t.id){const e=`#${t.id}`;window.tinymce.remove(e),window.tinymce.init({selector:e})}}}}}};var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function l(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var c=function(t,e,n,o){var i=-1,r=null==t?0:t.length;for(o&&r&&(n=t[++i]);++ii?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var r=Array(i);++o=o?t:At(t,e,n)},_t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var Dt=function(t){return _t.test(t)};var jt=function(t){return t.split("")},kt="\\ud800-\\udfff",Tt="["+kt+"]",Lt="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Pt="\\ud83c[\\udffb-\\udfff]",zt="[^"+kt+"]",$t="(?:\\ud83c[\\udde6-\\uddff]){2}",It="[\\ud800-\\udbff][\\udc00-\\udfff]",Ht="(?:"+Lt+"|"+Pt+")"+"?",Vt="[\\ufe0e\\ufe0f]?",Rt=Vt+Ht+("(?:\\u200d(?:"+[zt,$t,It].join("|")+")"+Vt+Ht+")*"),Bt="(?:"+[zt+Lt+"?",Lt,$t,It,Tt].join("|")+")",Ft=RegExp(Pt+"(?="+Pt+")|"+Bt+Rt,"g");var Wt=jt,qt=Dt,Ut=function(t){return t.match(Ft)||[]};var Gt=Mt,Xt=Dt,Yt=function(t){return qt(t)?Ut(t):Wt(t)},Zt=V;var Jt=function(t){return function(e){e=Zt(e);var n=Xt(e)?Yt(e):void 0,o=n?n[0]:e.charAt(0),i=n?Gt(n,1).join(""):e.slice(1);return o[t]()+i}}("toUpperCase");const Kt=l(Nt((function(t,e,n){return t+(n?" ":"")+Jt(e)}))),Qt=document.getElementById("editor-action-buttons"),te=document.querySelector(".render-form");const ee={extension:".lang",location:"assets/lang/",langs:["en-US"],locale:"en-US",override:{}};class ne{constructor(t=ee){this.langs=Object.create(null),this.loaded=[],this.processConfig(t)}processConfig(t){const{location:e,...n}={...ee,...t},o=e.replace(/\/?$/,"/");this.config={location:o,...n};const{override:i,preloaded:r={}}=this.config,s=Object.entries(this.langs).concat(Object.entries(i||r));this.langs=s.reduce(((t,[e,n])=>(t[e]=this.applyLanguage(e,n),t)),{}),this.locale=this.config.locale||this.config.langs[0]}init(t){return this.processConfig({...this.config,...t}),this.setCurrent(this.locale)}addLanguage(t,e={}){e="string"==typeof e?ne.processFile(e):e,this.applyLanguage(t,e),this.config.langs.push("locale")}getValue(t,e=this.locale){var n;return(null==(n=this.langs[e])?void 0:n[t])||this.getFallbackValue(t)}getFallbackValue(t){const e=Object.values(this.langs).find((e=>e[t]));return null==e?void 0:e[t]}makeSafe(t){const e={"{":"\\{","}":"\\}","|":"\\|"};return t=t.replace(/[{}|]/g,(t=>e[t])),new RegExp(t,"g")}put(t,e){return this.current[t]=e,e}get(t,e){const n=this;let o=this.getValue(t);if(!o)return;const i=o.match(/\{[^}]+?\}/g);if(e&&i)if("object"==typeof e)for(const r of i){const t=r.substring(1,r.length-1);o=o.replace(n.makeSafe(r),e[t]||"")}else o=o.replace(/\{[^}]+?\}/g,e);return o}static processFile(t){return ne.fromFile(t.replace(/\n\n/g,"\n"))}static fromFile(t){const e=t.split("\n"),n={};for(let o,i=0;i{const i=ne.processFile(e);return n.applyLanguage(t,i),n.loaded.push(t),o(n.langs[t])})).catch((e=>{const i=n.applyLanguage(t);o(i)}))}))}applyLanguage(t,e={}){const n=this.config.override[t]||{},o=this.langs[t]||{};return this.langs[t]={...o,...e,...n},this.langs[t]}get getLangs(){return this.config.langs}async setCurrent(t="en-US"){return await this.loadLang(t),this.locale=t,this.current=this.langs[t],this.current}}const oe=new ne,ie="formeo",re=[{name:"cssPreload",src:"//cdnjs.cloudflare.com/ajax/libs/loadCSS/2.0.1/cssrelpreload.min.js"},{name:"mutationObserver",src:"//cdn.jsdelivr.net/npm/mutationobserver-shim/dist/mutationobserver.min.js"},{name:"fetch",src:"https://unpkg.com/unfetch/polyfill"}],se="control-group",ae=`${ie}-stage`,le=`${ie}-row`,ce=`${ie}-column`,de=`${ie}-field`,he="custom-column-widths",ue="column-preset",pe="resizing-columns",me=new Map([[ae,le],[le,ce],[ce,de]]),fe=["external","stages","rows","columns","fields"],ge=["stage","row","column","field"].reduce(((t,e)=>({...t,[e]:e})),{}),ve=[{name:"controls",className:se},{name:"stage",className:ae},{name:"row",className:le},{name:"column",className:ce},{name:"field",className:de}],be={controls:se,stage:ae,row:le,column:ce,field:de},ye=Object.entries(be).reduce(((t,[e,n])=>({...t,[n]:e})),{}),we=Object.values(be),xe=new RegExp(`${we.join("|")}`,"g"),Ce=ve.map((({name:t},e,n)=>{const{name:o}=n[e+1]||{};return o&&[t,o]})).filter(Boolean),Se=Ce.slice().map((t=>t.slice().reverse())).reverse(),Ee=new Map(Ce),Oe=new Map(Se.slice()),Ne=new Map([[{value:"100.0",label:"100%"}],[{value:"50.0,50.0",label:"50 | 50"},{value:"33.3,66.6",label:"33 | 66"},{value:"66.6,33.3",label:"66 | 33"}],[{value:"33.3,33.3,33.3",label:"33 | 33 | 33"},{value:"25.0,25.0,50.0",label:"25 | 25 | 50"},{value:"50.0,25.0,25.0",label:"50 | 25 | 25"},{value:"25.0,50.0,25.0",label:"25 | 50 | 25"}],[{value:"25.0,25.0,25.0,25.0",label:"25 | 25 | 25 | 25"}],[{value:"20.0,20.0,20.0,20.0,20.0",label:"20 | 20 | 20 | 20 | 20"}],[{value:"16.66,16.66,16.66,16.66,16.66,16.66",label:"16.66 | 16.66 | 16.66 | 16.66 | 16.66 | 16.66"}]].reduce(((t,e,n)=>(t.push([n,e]),t)),[])),Ae=[{type:"added",condition:(t,e)=>Boolean(void 0===t&&e)}],Me=`${ie}-formData`,_e=`${ie}-locale`,De=333,je=Math.round(166.5),ke=Math.round(666),Te="formeoSaved",Le="formeoUpdated",Pe="formeoOnRender",ze=["label","logical","source","thenTarget","sourceProperty","comparison","target","targetProperty","assignment","value"],$e={value:"attrs.value",checked:"attrs.checked",isVisible:"config.isVisible",isNotVisible:"config.isNotVisible"},Ie={comparison:{equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},assignment:{equals:"="},logical:{and:"&&",or:"||"},property:$e},He=/(\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b)/gi,Ve=/\bcol-\w+-\d+/g,Re="f-i-";var Be=function(){this.__data__=[],this.size=0};var Fe=function(t,e){return t===e||t!=t&&e!=e},We=Fe;var qe=function(t,e){for(var n=t.length;n--;)if(We(t[n][0],e))return n;return-1},Ue=qe,Ge=Array.prototype.splice;var Xe=qe;var Ye=qe;var Ze=qe;var Je=Be,Ke=function(t){var e=this.__data__,n=Ue(e,t);return!(n<0)&&(n==e.length-1?e.pop():Ge.call(e,n,1),--this.size,!0)},Qe=function(t){var e=this.__data__,n=Xe(e,t);return n<0?void 0:e[n][1]},tn=function(t){return Ye(this.__data__,t)>-1},en=function(t,e){var n=this.__data__,o=Ze(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};function nn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=9007199254740991},ui=mn,pi=hi;var mi=function(t){return null!=t&&pi(t.length)&&!ui(t)},fi=mi,gi=_;var vi=function(t){return gi(t)&&fi(t)},bi={exports:{}};var yi=function(){return!1};!function(t,e){var n=m,o=yi,i=e&&!e.nodeType&&e,r=i&&t&&!t.nodeType&&t,s=r&&r.exports===i?n.Buffer:void 0,a=(s?s.isBuffer:void 0)||o;t.exports=a}(bi,bi.exports);var wi=bi.exports,xi=M,Ci=Zo,Si=_,Ei=Function.prototype,Oi=Object.prototype,Ni=Ei.toString,Ai=Oi.hasOwnProperty,Mi=Ni.call(Object);var _i=function(t){if(!Si(t)||"[object Object]"!=xi(t))return!1;var e=Ci(t);if(null===e)return!0;var n=Ai.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Ni.call(n)==Mi},Di=M,ji=hi,ki=_,Ti={};Ti["[object Float32Array]"]=Ti["[object Float64Array]"]=Ti["[object Int8Array]"]=Ti["[object Int16Array]"]=Ti["[object Int32Array]"]=Ti["[object Uint8Array]"]=Ti["[object Uint8ClampedArray]"]=Ti["[object Uint16Array]"]=Ti["[object Uint32Array]"]=!0,Ti["[object Arguments]"]=Ti["[object Array]"]=Ti["[object ArrayBuffer]"]=Ti["[object Boolean]"]=Ti["[object DataView]"]=Ti["[object Date]"]=Ti["[object Error]"]=Ti["[object Function]"]=Ti["[object Map]"]=Ti["[object Number]"]=Ti["[object Object]"]=Ti["[object RegExp]"]=Ti["[object Set]"]=Ti["[object String]"]=Ti["[object WeakMap]"]=!1;var Li=function(t){return ki(t)&&ji(t.length)&&!!Ti[Di(t)]};var Pi=function(t){return function(e){return t(e)}},zi={exports:{}};!function(t,e){var n=h,o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,r=i&&i.exports===o&&n.process,s=function(){try{var t=i&&i.require&&i.require("util").types;return t||r&&r.binding&&r.binding("util")}catch(e){}}();t.exports=s}(zi,zi.exports);var $i=zi.exports,Ii=Li,Hi=Pi,Vi=$i&&$i.isTypedArray,Ri=Vi?Hi(Vi):Ii;var Bi=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},Fi=Ao,Wi=Fe,qi=Object.prototype.hasOwnProperty;var Ui=function(t,e,n){var o=t[e];qi.call(t,e)&&Wi(o,n)&&(void 0!==n||e in t)||Fi(t,e,n)},Gi=Ui,Xi=Ao;var Yi=function(t,e,n,o){var i=!n;n||(n={});for(var r=-1,s=e.length;++r-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(qr),Xr=Hr,Yr=Br,Zr=Gr;var Jr=Fe,Kr=mi,Qr=Ji,ts=dn;var es=function(t,e){return Zr(Yr(t,e,Xr),t+"")},ns=function(t,e,n){if(!ts(n))return!1;var o=typeof e;return!!("number"==o?Kr(n)&&Qr(e,n.length):"string"==o&&e in n)&&Jr(n[e],t)};var os=Ir;const is=l(function(t){return es((function(e,n){var o=-1,i=n.length,r=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(r=t.length>3&&"function"==typeof r?(i--,r):void 0,s&&ns(n[0],n[1],s)&&(r=i<3?void 0:r,i=1),e=Object(e);++ocrypto.randomUUID(),ss=(t="",e)=>{if(!e)return!1;const n=/[|\\{}()[\]^*$+?.]/g;let o="string"==typeof e?[e]:e;o=o.map((t=>"*"===t?"":t.replace(n,"\\$&")));let i=!0;return o.length&&(i=!new RegExp(o.join("|"),"i").exec(t)),i},as=t=>{var e;const n=null==(e=t.className)?void 0:e.match(xe);return n&&ye[n[0]]},ls=t=>Array.from(new Set(t)),cs=t=>{let e;if(t){const{attrs:n={}}=t;e=n.id||t.id||rs(),t.id=e}else e=rs();return e},ds=(t,e,n=Object.create(null))=>is({},t,e,((t,e)=>{if(Array.isArray(t))return Array.isArray(e)?ls(n.mergeArray?t.concat(e):e):e})),hs=t=>{let e;if(null===t||!("object"==typeof t)||t instanceof Promise)return t;if(t instanceof Date)return e=new Date,e.setTime(t.getTime()),e;if(Array.isArray(t)){e=[];for(let n=0,o=t.length;nt/e*100,ps=t=>`${t.toString()}%`,ms=Object.create(null,{get:{value:t=>{var e;const n=null==(e=window.sessionStorage)?void 0:e.getItem(t);try{return JSON.parse(n)}catch(o){return n}}},set:{value:(t,e)=>{var n;try{return null==(n=window.sessionStorage)?void 0:n.setItem(t,JSON.stringify(e))}catch(o){}}}}),fs=t=>fe.some((e=>new RegExp(`^${e}.`).test(t))),gs=t=>t.startsWith("external");function vs(t,e){let n=!1;return function(){if(!n){t(...arguments),n=!0;const o=setTimeout((()=>{n=!1,clearTimeout(o)}),e)}}}function bs(t){return t}function ys(){}var ws=v,xs=k,Cs=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ss=/^\w*$/;var Es=function(t,e){if(ws(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!xs(t))||(Ss.test(t)||!Cs.test(t)||null!=e&&t in Object(e))},Os=uo;function Ns(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var o=arguments,i=e?e.apply(this,o):o[0],r=n.cache;if(r.has(i))return r.get(i);var s=t.apply(this,o);return n.cache=r.set(i,s)||r,s};return n.cache=new(Ns.Cache||Os),n}Ns.Cache=Os;var As=Ns;var Ms=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,_s=/\\(\\)?/g,Ds=function(t){var e=As(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Ms,(function(t,n,o,i){e.push(o?i.replace(_s,"$1"):n||t)})),e})),js=v,ks=Es,Ts=Ds,Ls=V;var Ps=function(t,e){return js(t)?t:ks(t,e)?[t]:Ts(Ls(t))},zs=k;var $s=function(t){if("string"==typeof t||zs(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e},Is=Ui,Hs=Ps,Vs=Ji,Rs=dn,Bs=$s;var Fs=function(t,e,n,o){if(!Rs(t))return t;for(var i=-1,r=(e=Hs(e,t)).length,s=r-1,a=t;null!=a&&++i{const e={...t},n={string:()=>"",boolean:()=>!1,object:t=>Zs(t)};for(const o of Object.keys(t)){const i=typeof t[o];n[i]&&(e[o]=n[i](t[o]))}return e},Js="a an and as at but by for for from in into near nor of on onto or the to with".split(" ").map((t=>`\\s${t}\\s`)),Ks=new RegExp(`(?!${Js.join("|")})\\w\\S*`,"g"),Qs=/\s+/g;function ta(t){if("string"!=typeof t)return t;if(t.trim().match(Qs))return t;return t.replace(Ks,(t=>t.charAt(0).toUpperCase()+t.substring(1).replace(/[A-Z]/g,(t=>` ${t}`))))}const ea=(t,e="-")=>t.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,e),na=t=>Number.isInteger(Number(t)),oa=(t,e)=>{const n=e||t.parentElement;return Array.prototype.slice.call(n.childNodes).indexOf(t)},ia=(t,e,n)=>{const o=n.split("||"),i=ls(e).map((e=>t.find((t=>{const n=o.find((e=>!!Xs(t,e)));return n&&Xs(t,n)===e})))).filter(Boolean).concat(t);return ls(i)},ra=(t,e,n)=>{for(let o=0;o{const n=[];return ra(t,((t,o)=>n.push(e(t,o)))),n},aa={},la=t=>t.replace(/\b\w/g,(t=>t.toUpperCase())),ca=()=>-1!==window.navigator.userAgent.indexOf("MSIE "),da={capitalize:la,safeAttrName:t=>{if(aa[t])return aa[t];const e=({className:"class"}[t]||t).replace(/^\d/,"").replace(/[^a-zA-Z0-9-:]/g,"");return aa[t]=e,e},forEach:ra,copyObj:t=>window.JSON.parse(window.JSON.stringify(t)),map:sa,subtract:(t,e)=>e.filter((e=>!~t.indexOf(e))),indexOfNode:oa,isInt:na,get:Xs,orderObjectsBy:ia,isIE:ca},ha={getStyle:(t,e=!1)=>{let n;return window.getComputedStyle?n=window.getComputedStyle(t,null):t.currentStyle&&(n=t.currentStyle),e?n[e]:n},fadeOut:(t,e=250)=>{const n=1/(e/60);t.style.opacity=1,function e(){const o=Number(t.style.opacity)-n;o>0?(t.style.opacity=o,window.requestAnimationFrame(e)):t.remove()}()},slideDown:(t,e=250,n=!1)=>{t.style.display="block";const o=ha.getStyle(t),i=parseInt(o.height,10),r=i/(e/60);t.style.height="0px",function e(){const o=parseFloat(t.style.height),s=o+r;o{const o=ha.getStyle(t),i=parseInt(o.height),r=o.overflow;t.style.overflow="hidden",t.style.height=i+"px";const s=o.minHeight;t.style.minHeight="auto";const a=parseFloat(i/(e/60)).toFixed(2);!function e(){const o=parseInt(t.style.height,10)-a;o>0?(t.style.height=o+"px",window.requestAnimationFrame(e)):(t.style.overflow=r,t.style.display="none",t.style.minHeight=s,delete t.style.height,n&&n(t))}()},slideToggle:(t,e=250,n="none"===ha.getStyle(t,"display"))=>{n?ha.slideDown(t,e):ha.slideUp(t,e)}},ua="no-transition",pa={debug:!1,bubbles:!0,formeoLoaded:t=>{},onAdd:()=>{},onUpdate:t=>fa.opts.debug&&void 0,onUpdateStage:t=>fa.opts.debug&&void 0,onUpdateRow:t=>fa.opts.debug&&void 0,onUpdateColumn:t=>fa.opts.debug&&void 0,onUpdateField:t=>fa.opts.debug&&void 0,onRender:t=>fa.opts.debug&&void 0,onSave:t=>{},confirmClearAll:t=>{window.confirm(t.confirmationMessage)&&t.clearAllAction(t)}},ma=({src:t,...e},n=Le)=>{const o=new window.CustomEvent(n,{detail:e,bubbles:fa.opts.debug||fa.opts.bubbles});return o.data=(t||document).dispatchEvent(o),o},fa={init:function(t){return this.opts={...pa,...t},this},formeoSaved:t=>ma(t,Te),formeoUpdated:t=>ma(t,Le),formeoCleared:t=>ma(t,"formeoCleared"),formeoOnRender:t=>ma(t,Pe),formeoConditionUpdated:t=>ma(t,"formeoConditionUpdated")},ga=vs((()=>{fa.opts.onUpdate({timeStamp:window.performance.now(),type:Le,detail:Yh.formData})}),je);let va;document.addEventListener(Le,ga),document.addEventListener("formeoUpdatedStage",(t=>{const{timeStamp:e,type:n,detail:o}=t;fa.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedRow",(t=>{const{timeStamp:e,type:n,detail:o}=t;fa.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedColumn",(t=>{const{timeStamp:e,type:n,detail:o}=t;fa.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedField",(t=>{const{timeStamp:e,type:n,detail:o}=t;fa.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener(Pe,(t=>{const{timeStamp:e,type:n,detail:o}=t;fa.opts.onRender({timeStamp:e,type:n,detail:o})})),document.addEventListener("confirmClearAll",(t=>{t={timeStamp:t.timeStamp,type:t.type,confirmationMessage:t.detail.confirmationMessage,clearAllAction:t.detail.clearAllAction,btnCoords:t.detail.btnCoords},fa.opts.confirmClearAll(t)})),document.addEventListener(Te,(({timeStamp:t,type:e,detail:{formData:n}})=>{const o={timeStamp:t,type:e,formData:n};fa.opts.onSave(o)})),document.addEventListener("formeoLoaded",(t=>{fa.opts.formeoLoaded(t.detail.formeo)})),window.addEventListener("resize",(function(){va=va||window.requestAnimationFrame((()=>{va=!1,Object.values(Wh.data).forEach((t=>{t.dom.classList.add(ua),Uh.dom.classList.add(ua),Uh.panels.nav.refresh(),t.refreshFieldPanels()}))}))}));var ba=uo,ya=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},wa=function(t){return this.__data__.has(t)};function xa(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new ba;++ea))return!1;var c=r.get(t),d=r.get(e);if(c&&d)return c==e&&d==t;var h=-1,u=!0,p=2&n?new Ca:void 0;for(r.set(t,e),r.set(e,t);++hJSON.stringify(t,null,e))),e(this,"get",(t=>Xs(this.data,t))),e(this,"getChangeType",((t,e)=>{const n=Ae.find((({condition:n})=>n(t,e)))||{type:"unknown"};return n.desc="added"===n.type?`${t} to ${e}`:e,n})),e(this,"add",((t,e=Object.create(null))=>{const{id:n}=e,o=t||n||cs();return this.set(o,e)})),e(this,"remove",(t=>{const e=t.split("."),n=e.pop(),o=this.get(e);return Array.isArray(o)?o.splice(Number(n),1):delete o[n],o})),e(this,"getData",(()=>Object.entries(this.data).reduce(((t,[e,n])=>(t[e]=(null==n?void 0:n.data)?n.getData():n,t)),{}))),e(this,"setCallbacks",{}),e(this,"configVal",Object.create(null)),this.name=t,this.data=n,this.dataPath=""}get size(){return Object.keys(this.data).length}get js(){return this.data}get json(){return this.data}set(t,e){const n=Xs(this.data,t);if(Pl(n,e))return this.data;const o=Ys(this.data,t,e),i=Array.isArray(t)?t.join("."):t,r=Object.keys(this.setCallbacks).filter((t=>new RegExp(t).test(i))),s={newVal:e,oldVal:n,path:t};for(const a of r)for(const t of this.setCallbacks[a])t(s);if(!this.disableEvents){const i=this.getChangeType(n,e),r={entity:this,dataPath:this.dataPath.replace(/\.+$/,""),changePath:this.dataPath+t,value:e,data:o,change:`${i.type}: ${i.desc}`,src:this.dom};n&&(r.previousValue=n),fa.formeoUpdated(r)}return o}addSetCallback(t,e){this.setCallbacks[t]?this.setCallbacks[t].push(e):this.setCallbacks[t]=[e]}removeSetCallback(t,e){this.setCallbacks[t]=this.setCallbacks[t].filter((t=>t!==e))}empty(){this.data=Object.create(null)}}function $l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function Il(t){for(var e=1;e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Fl(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var Wl=Fl(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),ql=Fl(/Edge/i),Ul=Fl(/firefox/i),Gl=Fl(/safari/i)&&!Fl(/chrome/i)&&!Fl(/android/i),Xl=Fl(/iP(ad|od|hone)/i),Yl=Fl(/chrome/i)&&Fl(/android/i),Zl={capture:!1,passive:!1};function Jl(t,e,n){t.addEventListener(e,n,!Wl&&Zl)}function Kl(t,e,n){t.removeEventListener(e,n,!Wl&&Zl)}function Ql(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(n){return!1}return!1}}function tc(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function ec(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&Ql(t,e):Ql(t,e))||o&&t===n)return t;if(t===n)break}while(t=tc(t))}return null}var nc,oc=/\s+/g;function ic(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(oc," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(oc," ")}}function rc(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function sc(t,e){var n="";if("string"==typeof t)n=t;else do{var o=rc(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function ac(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i=cc(o)[n]))return o;if(o===lc())break;o=fc(o,!1)}return!1}function hc(t,e,n,o){for(var i=0,r=0,s=t.children;r2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,i=Bl(n,Nc);Oc.pluginEvent.bind(yd)(t,e,Il({dragEl:_c,parentEl:Dc,ghostEl:jc,rootEl:kc,nextEl:Tc,lastDownEl:Lc,cloneEl:Pc,cloneHidden:zc,dragStarted:Yc,putSortable:Bc,activeSortable:yd.active,originalEvent:o,oldIndex:$c,oldDraggableIndex:Hc,newIndex:Ic,newDraggableIndex:Vc,hideGhostForTarget:fd,unhideGhostForTarget:gd,cloneNowHidden:function(){zc=!0},cloneNowShown:function(){zc=!1},dispatchSortableEvent:function(t){Mc({sortable:e,name:t,originalEvent:o})}},i))};function Mc(t){!function(t){var e=t.sortable,n=t.rootEl,o=t.name,i=t.targetEl,r=t.cloneEl,s=t.toEl,a=t.fromEl,l=t.oldIndex,c=t.newIndex,d=t.oldDraggableIndex,h=t.newDraggableIndex,u=t.originalEvent,p=t.putSortable,m=t.extraEventProperties;if(e=e||n&&n[xc]){var f,g=e.options,v="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||Wl||ql?(f=document.createEvent("Event")).initEvent(o,!0,!0):f=new CustomEvent(o,{bubbles:!0,cancelable:!0}),f.to=s||n,f.from=a||n,f.item=i||n,f.clone=r,f.oldIndex=l,f.newIndex=c,f.oldDraggableIndex=d,f.newDraggableIndex=h,f.originalEvent=u,f.pullMode=p?p.lastPutMode:void 0;var b=Il(Il({},m),Oc.getEventProperties(o,e));for(var y in b)f[y]=b[y];n&&n.dispatchEvent(f),g[v]&&g[v].call(e,f)}}(Il({putSortable:Bc,cloneEl:Pc,targetEl:_c,rootEl:kc,oldIndex:$c,oldDraggableIndex:Hc,newIndex:Ic,newDraggableIndex:Vc},t))}var _c,Dc,jc,kc,Tc,Lc,Pc,zc,$c,Ic,Hc,Vc,Rc,Bc,Fc,Wc,qc,Uc,Gc,Xc,Yc,Zc,Jc,Kc,Qc,td=!1,ed=!1,nd=[],od=!1,id=!1,rd=[],sd=!1,ad=[],ld="undefined"!=typeof document,cd=Xl,dd=ql||Wl?"cssFloat":"float",hd=ld&&!Yl&&!Xl&&"draggable"in document.createElement("div"),ud=function(){if(ld){if(Wl)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),pd=function(t,e){var n=rc(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=hc(t,0,e),r=hc(t,1,e),s=i&&rc(i),a=r&&rc(r),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+cc(i).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+cc(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&s.float&&"none"!==s.float){var d="left"===s.float?"left":"right";return!r||"both"!==a.clear&&a.clear!==d?"horizontal":"vertical"}return i&&("block"===s.display||"flex"===s.display||"table"===s.display||"grid"===s.display||l>=o&&"none"===n[dd]||r&&"none"===n[dd]&&l+c>o)?"vertical":"horizontal"},md=function(t){function e(t,n){return function(o,i,r,s){var a=o.options.group.name&&i.options.group.name&&o.options.group.name===i.options.group.name;if(null==t&&(n||a))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(o,i,r,s),n)(o,i,r,s);var l=(n?o:i).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var n={},o=t.group;o&&"object"==Hl(o)||(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n},fd=function(){!ud&&jc&&rc(jc,"display","none")},gd=function(){!ud&&jc&&rc(jc,"display","")};ld&&!Yl&&document.addEventListener("click",(function(t){if(ed)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),ed=!1,!1}),!0);var vd=function(t){if(_c){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,nd.some((function(t){var e=t[xc].options.emptyInsertThreshold;if(e&&!uc(t)){var n=cc(t),o=i>=n.left-e&&i<=n.right+e,a=r>=n.top-e&&r<=n.bottom+e;return o&&a?s=t:void 0}})),s);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[xc]._onDragOver(n)}}var i,r,s},bd=function(t){_c&&_c.parentNode[xc]._isOutsideThisEl(t.target)};function yd(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=Rl({},e),t[xc]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return pd(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==yd.supportPointer&&"PointerEvent"in window&&!Gl,emptyInsertThreshold:5};for(var o in Oc.initializePlugins(this,t,n),n)!(o in e)&&(e[o]=n[o]);for(var i in md(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&hd,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Jl(t,"pointerdown",this._onTapStart):(Jl(t,"mousedown",this._onTapStart),Jl(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Jl(t,"dragover",this),Jl(t,"dragenter",this)),nd.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Rl(this,Cc())}function wd(t,e,n,o,i,r,s,a){var l,c,d=t[xc],h=d.options.onMove;return!window.CustomEvent||Wl||ql?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=n,l.draggedRect=o,l.related=i||e,l.relatedRect=r||cc(e),l.willInsertAfter=a,l.originalEvent=s,t.dispatchEvent(l),h&&(c=h.call(d,l,s)),c}function xd(t){t.draggable=!1}function Cd(){sd=!1}function Sd(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function Ed(t){return setTimeout(t,0)}function Od(t){return clearTimeout(t)}yd.prototype={constructor:yd,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(Zc=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,_c):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,i=o.preventOnFilter,r=t.type,s=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,a=(s||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,c=o.filter;if(function(t){ad.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&ad.push(o)}}(n),!_c&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!Gl||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=ec(a,o.draggable,n,!1))&&a.animated||Lc===a)){if($c=pc(a),Hc=pc(a,o.draggable),"function"==typeof c){if(c.call(this,t,a,this))return Mc({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),Ac("filter",e,{evt:t}),void(i&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=ec(l,o.trim(),n,!1))return Mc({sortable:e,rootEl:o,name:"filter",targetEl:a,fromEl:n,toEl:n}),Ac("filter",e,{evt:t}),!0}))))return void(i&&t.cancelable&&t.preventDefault());o.handle&&!ec(l,o.handle,n,!1)||this._prepareDragStart(t,s,a)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,s=i.options,a=r.ownerDocument;if(n&&!_c&&n.parentNode===r){var l=cc(n);if(kc=r,Dc=(_c=n).parentNode,Tc=_c.nextSibling,Lc=n,Rc=s.group,yd.dragged=_c,Fc={target:_c,clientX:(e||t).clientX,clientY:(e||t).clientY},Gc=Fc.clientX-l.left,Xc=Fc.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,_c.style["will-change"]="all",o=function(){Ac("delayEnded",i,{evt:t}),yd.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!Ul&&i.nativeDraggable&&(_c.draggable=!0),i._triggerDragStart(t,e),Mc({sortable:i,name:"choose",originalEvent:t}),ic(_c,s.chosenClass,!0))},s.ignore.split(",").forEach((function(t){ac(_c,t.trim(),xd)})),Jl(a,"dragover",vd),Jl(a,"mousemove",vd),Jl(a,"touchmove",vd),Jl(a,"mouseup",i._onDrop),Jl(a,"touchend",i._onDrop),Jl(a,"touchcancel",i._onDrop),Ul&&this.nativeDraggable&&(this.options.touchStartThreshold=4,_c.draggable=!0),Ac("delayStart",this,{evt:t}),!s.delay||s.delayOnTouchOnly&&!e||this.nativeDraggable&&(ql||Wl))o();else{if(yd.eventCanceled)return void this._onDrop();Jl(a,"mouseup",i._disableDelayedDrag),Jl(a,"touchend",i._disableDelayedDrag),Jl(a,"touchcancel",i._disableDelayedDrag),Jl(a,"mousemove",i._delayedDragTouchMoveHandler),Jl(a,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&Jl(a,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,s.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){_c&&xd(_c),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;Kl(t,"mouseup",this._disableDelayedDrag),Kl(t,"touchend",this._disableDelayedDrag),Kl(t,"touchcancel",this._disableDelayedDrag),Kl(t,"mousemove",this._delayedDragTouchMoveHandler),Kl(t,"touchmove",this._delayedDragTouchMoveHandler),Kl(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?Jl(document,"pointermove",this._onTouchMove):Jl(document,e?"touchmove":"mousemove",this._onTouchMove):(Jl(_c,"dragend",this),Jl(kc,"dragstart",this._onDragStart));try{document.selection?Ed((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(t,e){if(td=!1,kc&&_c){Ac("dragStarted",this,{evt:e}),this.nativeDraggable&&Jl(document,"dragover",bd);var n=this.options;!t&&ic(_c,n.dragClass,!1),ic(_c,n.ghostClass,!0),yd.active=this,t&&this._appendGhost(),Mc({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Wc){this._lastX=Wc.clientX,this._lastY=Wc.clientY,fd();for(var t=document.elementFromPoint(Wc.clientX,Wc.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Wc.clientX,Wc.clientY))!==e;)e=t;if(_c.parentNode[xc]._isOutsideThisEl(t),e)do{if(e[xc]){if(e[xc]._onDragOver({clientX:Wc.clientX,clientY:Wc.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=tc(e));gd()}},_onTouchMove:function(t){if(Fc){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=jc&&sc(jc,!0),s=jc&&r&&r.a,a=jc&&r&&r.d,l=cd&&Qc&&mc(Qc),c=(i.clientX-Fc.clientX+o.x)/(s||1)+(l?l[0]-rd[0]:0)/(s||1),d=(i.clientY-Fc.clientY+o.y)/(a||1)+(l?l[1]-rd[1]:0)/(a||1);if(!yd.active&&!td){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))i.right+r||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>i.bottom+r||t.clientX>o.right&&t.clientY>o.top}(t,i,this)&&!f.animated){if(f===_c)return j(!1);if(f&&r===t.target&&(s=f),s&&(n=cc(s)),!1!==wd(kc,r,_c,e,s,n,t,!!s))return D(),f&&f.nextSibling?r.insertBefore(_c,f.nextSibling):r.appendChild(_c),Dc=r,k(),j(!0)}else if(f&&function(t,e,n){var o=cc(hc(n.el,0,n.options,!0)),i=wc(n.el,n.options,jc),r=10;return e?t.clientXd+c*r/2:lh-Kc)return-Jc}else if(l>d+c*(1-i)/2&&lh-c*r/2))return l>d+c/2?1:-1;return 0}(t,s,n,i,x?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,id,Zc===s),0!==v){var O=pc(_c);do{O-=v,y=Dc.children[O]}while(y&&("none"===rc(y,"display")||y===jc))}if(0===v||y===s)return j(!1);Zc=s,Jc=v;var N=s.nextElementSibling,A=!1,M=wd(kc,r,_c,e,s,n,t,A=1===v);if(!1!==M)return 1!==M&&-1!==M||(A=1===M),sd=!0,setTimeout(Cd,30),D(),A&&!N?r.appendChild(_c):s.parentNode.insertBefore(_c,A?N:s),S&&bc(S,0,E-S.scrollTop),Dc=_c.parentNode,void 0===b||id||(Kc=Math.abs(b-cc(s)[C])),k(),j(!0)}if(r.contains(_c))return j(!1)}return!1}function _(a,l){Ac(a,p,Il({evt:t,isOwner:d,axis:i?"vertical":"horizontal",revert:o,dragRect:e,targetRect:n,canSort:h,fromSortable:u,target:s,completed:j,onMove:function(n,o){return wd(kc,r,_c,e,n,cc(n),t,o)},changed:k},l))}function D(){_("dragOverAnimationCapture"),p.captureAnimationState(),p!==u&&u.captureAnimationState()}function j(e){return _("dragOverCompleted",{insertion:e}),e&&(d?c._hideClone():c._showClone(p),p!==u&&(ic(_c,Bc?Bc.options.ghostClass:c.options.ghostClass,!1),ic(_c,a.ghostClass,!0)),Bc!==p&&p!==yd.active?Bc=p:p===yd.active&&Bc&&(Bc=null),u===p&&(p._ignoreWhileAnimating=s),p.animateAll((function(){_("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==u&&(u.animateAll(),u._ignoreWhileAnimating=null)),(s===_c&&!_c.animated||s===r&&!s.animated)&&(Zc=null),a.dragoverBubble||t.rootEl||s===document||(_c.parentNode[xc]._isOutsideThisEl(t.target),!e&&vd(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),m=!0}function k(){Ic=pc(_c),Vc=pc(_c,a.draggable),Mc({sortable:p,name:"change",toEl:r,newIndex:Ic,newDraggableIndex:Vc,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){Kl(document,"mousemove",this._onTouchMove),Kl(document,"touchmove",this._onTouchMove),Kl(document,"pointermove",this._onTouchMove),Kl(document,"dragover",vd),Kl(document,"mousemove",vd),Kl(document,"touchmove",vd)},_offUpEvents:function(){var t=this.el.ownerDocument;Kl(t,"mouseup",this._onDrop),Kl(t,"touchend",this._onDrop),Kl(t,"pointerup",this._onDrop),Kl(t,"touchcancel",this._onDrop),Kl(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;Ic=pc(_c),Vc=pc(_c,n.draggable),Ac("drop",this,{evt:t}),Dc=_c&&_c.parentNode,Ic=pc(_c),Vc=pc(_c,n.draggable),yd.eventCanceled||(td=!1,id=!1,od=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Od(this.cloneId),Od(this._dragStartId),this.nativeDraggable&&(Kl(document,"drop",this),Kl(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Gl&&rc(document.body,"user-select",""),rc(_c,"transform",""),t&&(Yc&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),jc&&jc.parentNode&&jc.parentNode.removeChild(jc),(kc===Dc||Bc&&"clone"!==Bc.lastPutMode)&&Pc&&Pc.parentNode&&Pc.parentNode.removeChild(Pc),_c&&(this.nativeDraggable&&Kl(_c,"dragend",this),xd(_c),_c.style["will-change"]="",Yc&&!td&&ic(_c,Bc?Bc.options.ghostClass:this.options.ghostClass,!1),ic(_c,this.options.chosenClass,!1),Mc({sortable:this,name:"unchoose",toEl:Dc,newIndex:null,newDraggableIndex:null,originalEvent:t}),kc!==Dc?(Ic>=0&&(Mc({rootEl:Dc,name:"add",toEl:Dc,fromEl:kc,originalEvent:t}),Mc({sortable:this,name:"remove",toEl:Dc,originalEvent:t}),Mc({rootEl:Dc,name:"sort",toEl:Dc,fromEl:kc,originalEvent:t}),Mc({sortable:this,name:"sort",toEl:Dc,originalEvent:t})),Bc&&Bc.save()):Ic!==$c&&Ic>=0&&(Mc({sortable:this,name:"update",toEl:Dc,originalEvent:t}),Mc({sortable:this,name:"sort",toEl:Dc,originalEvent:t})),yd.active&&(null!=Ic&&-1!==Ic||(Ic=$c,Vc=Hc),Mc({sortable:this,name:"end",toEl:Dc,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){Ac("nulling",this),kc=_c=Dc=jc=Tc=Pc=Lc=zc=Fc=Wc=Yc=Ic=Vc=$c=Hc=Zc=Jc=Bc=Rc=yd.dragged=yd.ghost=yd.clone=yd.active=null,ad.forEach((function(t){t.checked=!0})),ad.length=qc=Uc=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":_c&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,i=n.length,r=this.options;o{const e=window.prompt(t.message.attr);if(e&&t.isDisabled(e))return window.alert(oe.get("attributeNotPermitted",e||"")),Rd.add.attrs(t);let n;e&&(n=String(window.prompt(t.message.value,"")),t.addAction(e,n))},option:t=>{t.addAction()},condition:t=>{t.addAction(t)}},click:{btn:t=>{t.action()}},save:{form:bs}},Rd={init:function(t){const e=Object.keys(Vd);return this.opts=e.reduce(((e,n)=>(e[n]={...Vd[n],...t[n]},e)),t),this},add:{attrs:t=>Rd.opts.add.attr(t),options:t=>Rd.opts.add.option(t),conditions:t=>(t.template={if:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],then:[{target:"",targetProperty:"",assignment:"",value:""}]},Rd.opts.add.condition(t))},click:{btn:t=>Rd.opts.click.btn(t)},save:{form:t=>(Rd.opts.sessionStorage&&ms.set(Me,t),fa.formeoSaved({formData:t}),Rd.opts.save.form(t))}},Bd=Object.freeze({type:"field",displayType:"slider"}),Fd=t=>({transform:`translateX(${t?`${t}px`:0})`});class Wd{constructor(t){e(this,"toggleTabbedLayout",(()=>{this.getPanelDisplay();const t=this.isTabbed;return this.panelsWrap.parentElement.classList.toggle("tabbed-panels",t),t&&this.panelNav.removeAttribute("style"),t})),e(this,"resizePanels",(()=>{this.toggleTabbedLayout();const t=this.panelsWrap.style,e=Jh.getStyle(this.currentPanel,"height");return t.height=e,e})),this.opts=ds(Bd,t),this.panelDisplay=this.opts.displayType,this.activePanelIndex=0,this.panelNav=this.createPanelNav();const n=this.createPanelsWrap();this.nav=this.navActions();const o=new window.ResizeObserver((([{contentRect:{width:t}}])=>{this.currentWidth!==t&&(this.toggleTabbedLayout(),this.currentWidth=t,this.nav.setTranslateX(this.activePanelIndex,!1))})),i=window.setTimeout((()=>{o.observe(n),window.clearTimeout(i)}),ke)}getPanelDisplay(){const t=this.panelsWrap,e=Number.parseInt(Jh.getStyle(t,"width"))>390?"tabbed":"slider",n="auto"===this.opts.displayType;return this.panelDisplay=n?e:this.opts.displayType||Bd.displayType,this.panelDisplay}createPanelsWrap(){const t=Jh.create({className:"panels",content:this.opts.panels.map((({config:t,...e})=>e))});return"field"===this.opts.type&&this.sortableProperties(t),this.panelsWrap=t,this.panels=t.children,this.currentPanel=this.panels[this.activePanelIndex],t}sortableProperties(t){const e=t.getElementsByClassName("field-edit-group");return da.forEach(e,(t=>{t.fieldId=this.opts.id,t.isSortable&&yd.create(t,{animation:150,group:{name:`edit-${t.editGroup}`,pull:!0,put:["properties"]},sort:!0,handle:".prop-order",onSort:t=>{this.propertySave(t.to),this.resizePanels()}})}))}createPanelNavLabels(){const t=this.opts.panels.map((t=>({tag:"h5",action:{click:t=>{const e=oa(t.target,t.target.parentElement);this.currentPanel=this.panels[e];const n=t.target.parentElement.childNodes;this.nav.refresh(e),Jh.removeClasses(n,"active-tab"),t.target.classList.add("active-tab")}},content:t.config.label}))),e={className:"panel-labels",content:{content:t}},[n]=t;return n.className="active-tab",Jh.create(e)}createPanelNav(){this.labels=this.createPanelNavLabels();const t={tag:"button",attrs:{className:"next-group",title:oe.get("controlGroups.nextGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:t=>this.nav.nextGroup(t)},content:Jh.icon("triangle-right")},e={tag:"button",attrs:{className:"prev-group",title:oe.get("controlGroups.prevGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:t=>this.nav.prevGroup(t)},content:Jh.icon("triangle-left")};return Jh.create({tag:"nav",attrs:{className:"panel-nav"},content:[e,this.labels,t]})}get isTabbed(){return"tabbed"===this.panelDisplay}navActions(){const t={},e=this.currentPanel.parentElement,n=this.labels.firstChild,o=this.currentPanel.parentElement.childNodes;this.activePanelIndex=oa(this.currentPanel,e);let i={nav:0,panel:0},r={...i};t.groupChange=t=>{const e=n.children;return Jh.removeClasses(o,"active-panel"),Jh.removeClasses(e,"active-tab"),this.currentPanel=o[t],this.currentPanel.classList.add("active-panel"),e[t].classList.add("active-tab"),this.currentPanel};const s=({offset:t,reset:o,duration:i=je,animate:s=!this.isTabbed})=>{const a=[Fd(r.panel),Fd(t.panel)],l=[Fd(r.nav),Fd(this.isTabbed?0:t.nav)];if(o){const[t]=a,[e]=l;a.push(t),l.push(e)}const c={easing:"ease-in-out",duration:s?i:0,fill:"forwards"},d=e.animate(a,c);n.animate(l,c);const h=()=>{this.panelsWrap.style.height=Jh.getStyle(this.currentPanel,"height"),d.removeEventListener("finish",h),o||(r=t)};d.addEventListener("finish",h)};return t.setTranslateX=(t=this.activePanelIndex,o=!0)=>{var r;r=t,i={nav:-n.offsetWidth*r,panel:-e.offsetWidth*r},s({offset:i,animate:o})},t.refresh=(e=this.activePanelIndex)=>{this.activePanelIndex!==e&&(this.activePanelIndex=e,t.groupChange(e)),t.setTranslateX(this.activePanelIndex),this.resizePanels()},t.nextGroup=()=>{const e=this.activePanelIndex+1;if(e!==o.length){const o=t.groupChange(e);i={nav:-n.offsetWidth*e,panel:-o.offsetLeft},s({offset:i}),this.activePanelIndex++}else i={nav:r.nav-8,panel:r.panel-8},s({offset:i,reset:!0});return this.currentPanel},t.prevGroup=()=>{if(0!==this.activePanelIndex){const e=this.activePanelIndex-1,o=t.groupChange(e);i={nav:-n.offsetWidth*e,panel:-o.offsetLeft},s({offset:i}),this.activePanelIndex--}else i={nav:8,panel:8},s({offset:i,reset:!0})},t}}const qd="f-autocomplete",Ud="highlight-component";let Gd,Xd=Date.now();const Yd=({name:t,id:e,...n})=>["config.label","attrs.id","meta.id"].reduce(((t,e)=>(t||(t=n.get(e)),t)),null)||"external"===t&&((...t)=>oe.get(t.join("."))||ta(t.join(" ")))(t,e);class Zd{constructor(t,e,n){this.key=t,this.className=t.replace(/\./g,"-"),this.value=e,this.events=[],this.i18nKey=n,this.build()}build(){const t=t=>{const e=this.list,n=this.getActiveOption();let o=new Map([[38,()=>{const t=this.getPreviousOption(n);t&&this.selectOption(t)}],[40,()=>{const t=this.getNextOption(n);t&&this.selectOption(t)}],[13,()=>{n&&(this.selectOption(n),this.setValue(n),"none"===e.style.display?this.showList(n):this.hideList()),t.preventDefault()}],[27,()=>{this.hideList()}]]).get(t.keyCode);return o||(o=()=>!1),o()},e={focus:({target:e})=>{this.updateOptions(),e.parentElement.classList.add(`${this.className}-focused`);const n=Jh.toggleElementsByStr(this.list.querySelectorAll("li"),e.value);e.addEventListener("keydown",t);const o=this.list.querySelector(".active-option")||n[0];this.showList(o)},blur:({target:e})=>{e.parentElement.classList.remove(`${this.className}-focused`),e.removeEventListener("keydown",t),this.hideList()},input:t=>{const e=Jh.toggleElementsByStr(this.list.querySelectorAll("li"),t.target.value);if(0===t.target.value.length&&this.clearValue(),0===e.length)this.hideList();else{const t=this.getActiveOption()||e[0];this.showList(t)}this.hiddenField.value=t.target.value,this.value=t.target.value,this.runEvent("onChange",{target:this.hiddenField})}};return this.displayField=Jh.create({tag:"input",autocomplete:"off",action:e,attrs:{type:"text",className:`${qd}-display-field`,value:this.label||this.value,placeholder:oe.get(`${this.i18nKey}.${this.key}.placeholder`)}}),this.hiddenField=Jh.create({tag:"input",attrs:{type:"hidden",className:this.className,value:this.value}}),this.list=Jh.create({tag:"ul",attrs:{className:`${qd}-list`}}),this.dom=Jh.create({children:[this.displayField,this.hiddenField,this.list],className:this.className,action:{onRender:()=>{const t=this.value&&Yh.getAddress(this.value);this.label=t&&Yd(t),this.label&&(this.displayField.value=this.label),this.updateOptions()}}}),this.dom}updateOptions(){const t=Date.now();t-Xd>ke&&(Jh.empty(this.list),this.generateOptions(),Xd=t);(Gd||this.generateOptions()).forEach((t=>this.list.appendChild(t)))}generateOptions(){const t=(t=>{const e=[],n=Yh.flatList();return Object.entries(n).map((([n,o])=>{const i=Yd(o);if(i){const r={tag:"span",content:` ${ta(o.name)}`,className:"component-type"},s=`${o.name}.${i}`;e.push(s);const a=((t,e)=>t.reduce(((t,n)=>t+(n===e)),0))(e,s),l={tag:"span",content:a>1&&`(${a})`,className:"component-label-count"};return Jh.makeOption([n,[`${i} `,l,r]],t)}})).filter(Boolean)})(),e=t=>{const e=`${qd}-list-item`;return t.classList.contains(e)||(t=t.parentElement),t};return Gd=t.map((t=>{const n=t.value;let[o]=t.label;o=o.trim();const i={tag:"li",children:t.label,dataset:{value:n,label:o},className:`${qd}-list-item`,action:{mousedown:({target:t})=>{t=e(t),this.setValue(t),this.selectOption(t),this.hideList()},mouseover:({target:t})=>{t=e(t),this.removeHighlight(),this.highlightComponent(t)}}};return Jh.create(i)})),Gd}hideList(t=this.list){ha.slideUp(t,je),this.removeHighlight()}showList(t,e=this.list){this.selectOption(t),ha.slideDown(e,je)}getActiveOption(t=this.list){const e=t.getElementsByClassName("active-option")[0];return e&&"none"!==e.style.display?e:null}getPreviousOption(t){let e=t;do{e=e?e.previousSibling:null}while(null!=e&&"none"===e.style.display);return e}getNextOption(t){let e=t;do{e=e?e.nextSibling:null}while(null!=e&&"none"===e.style.display);return e}selectOption(t,e=this.list){const n=e.querySelectorAll("li");for(let o=0;o{n===t&&o(e)}))}}const Jd=(t,e)=>{const n=(t=>{const e=gs(t),n={"field.property":$e,...Ie},o=e?(i=t,Yh.getAddress(i).getData()):n[t];var i;return Object.keys(o).reduce(((t,e)=>(t[e]=e,t)),{})})(t);return Object.entries(n).reduce(((n,[o,i])=>{if("id"!==o){const r={tag:"option",content:oe.get(`${t}.${o}`)||o.toLowerCase(),attrs:{value:i}};e===i&&(r.attrs.selected=!0),n.push(Jh.create(r))}return n}),[])},Kd=(t,e)=>{Jh.empty(t),e.forEach((e=>t.add(e)))},Qd=({key:t,value:e,type:n="text",checked:o})=>{const i={tag:"input",attrs:{type:n,value:e,placeholder:oe.get(`${t}.placeholder`)||ta(t)},className:t.replace(/\./g,"-"),config:{}};return o&&(i.attrs.checked=!0),i},th=t=>{const e=oe.get(t);if(e)return e;const n=t.split(".");return oe.get(n[n.length-1])},eh={autocomplete:(t,e,n)=>new Zd(t,e,n),string:(t,e)=>Qd({key:t,value:e}),boolean:(t,e)=>Qd({key:t,value:e,type:"selected"===t?"radio":"checkbox",checked:e}),number:(t,e)=>Qd({key:t,value:e,type:"number"}),array:(t,e=[])=>({tag:"select",attrs:{placeholder:th(`placeholder.${t}`)},className:t.replace(/\./g,"-"),options:e}),object:t=>Object.entries(t).map((([t,e])=>eh[Jh.childType(e)](t,e)))},nh=["selected","checked"],oh={boolean:(t,e)=>({click:({target:{checked:n}})=>{var o,i;"radio"===(null==(i=null==(o=e.data)?void 0:o.attrs)?void 0:i.type)&&e.set("options",e.data.options.map((t=>({...t,selected:!1})))),e.set(t,n),e.updatePreview()}}),string:(t,e)=>({input:({target:{value:n}})=>{e.set(t,n)}}),number:(t,e)=>({input:({target:{value:n}})=>{e.set(t,Number(n)),e.updatePreview()}}),array:(t,e)=>({change:({target:{value:n}})=>{e.set(t,n),e.updatePreview()}}),object:()=>({})};class ih{constructor({key:t,data:n,index:o,field:i}){e(this,"generateConditionFields",((t,e)=>{const n={tag:"label",className:`condition-label ${t}-condition-label`,content:oe.get(t)||t};return e.map(((e,o)=>{const i=[],r=Object.entries(e).map((([e,n])=>{const r=this.conditionInput(e,n,t,o);return r&&i.push([r.className,n.trim()].filter(Boolean).join("-")),r})).filter(Boolean),s=ia(r,ze.map((t=>`condition-${t}`)),"className||dom.className");return this.processConditionUIState(s),o||s.unshift(n),this.itemFieldGroups.push(s),{children:s,className:`f-condition-row ${t}-condition-row ${i.join(" ")}`}}))})),e(this,"processConditionUIState",(t=>{const e=e=>(e=e.split("|"),t.filter((t=>e.includes(t.className)))),n=t=>{t=Array.isArray(t)?t:[t];const e=setTimeout((()=>{t.forEach((t=>{t.dom&&(t=t.dom),t.style.display="none"})),clearTimeout(e)}),De)},o=t=>{t=Array.isArray(t)?t:[t];const e=setTimeout((()=>{t.forEach((t=>{t.dom&&(t=t.dom),t.removeAttribute("style")})),clearTimeout(e)}),De)},i=new Map([["condition-source",t=>{const i=e("condition-sourceProperty"),r=i[0],s=gs(t.value)?t.value:"field.property",a=Jd(s,r.value);return Kd(r,a),t.value?o(i):n(i)}],["condition-target",t=>{const i=e("condition-targetProperty");return fs(t.value)&&t.value?o(i):n(i)}],["condition-sourceProperty",t=>{const i=e("condition-comparison|condition-targetProperty|condition-target"),r=t.value;return(t=>/^is|^has/.test(t))(r.substring(r.lastIndexOf(".")+1,r.length))?n(i):o(i)}]]);t.forEach((t=>{const e=i.get(t.className);e&&e(t)}))})),e(this,"conditionInput",((t,e,n,o)=>{const i=this.field,r=`${this.itemKey}.${n}.${o}`,s=`${this.field.id}.${r}`,a=`${i.name}s.${s}.${t}`,l=(t,e,n)=>{const o=Jd(n||t,e),i=eh.array(`condition.${t}`);i.action={change:c,onRender:t=>c({target:t})};const r=Jh.create(i);return Kd(r,o),r},c=({target:t})=>{const e=t.closest(".f-condition-row"),n=new RegExp(`${t.className}(?:\\S?)+`,"gm");e.className=e.className.replace(n,""),e.classList.add([t.className,t.value].filter(Boolean).join("-"));const o={dataPath:a,value:t.value,src:t};fa.formeoUpdated(o),Yh.setAddress(a,t.value);const i=t.closest(".f-condition-row"),r=oa(i);this.processConditionUIState(this.itemFieldGroups[r])},d={comparison:t=>l("comparison",t),logical:t=>l("logical",t),source:(t,e="source")=>{const o=eh.autocomplete(`condition.${e}`,t,n);return Yh.setConditionMap(t,i),o.addEvent("onChange",(t=>{Yh.removeConditionMap(Yh.getAddress(a)),c(t),Yh.setConditionMap(t.target.value,i)})),o},sourceProperty:t=>l("sourceProperty",t,"field.property"),targetProperty:t=>l("targetProperty",t,"field.property"),target:t=>d.source(t,"target"),value:t=>{const e=eh.string("condition.value",t);return e.action={input:c},Jh.create(e)},assignment:t=>l("assignment",t)};if(d[t])return d[t](e)})),this.itemValues=ia(Object.entries(n),nh,"0");const[r,s]=t.split(".");this.field=i,this.itemKey=t,this.itemIndex=o,this.panelName=r,this.isDisabled=i.isDisabledProp(s,r),this.isHidden=this.isDisabled&&i.config.panels[r].hideDisabled,this.isLocked=i.isLockedProp(s,r),this.dom=Jh.create({tag:"li",className:[`field-${t.replace(/\./g,"-")}`,"prop-wrap",this.isHidden&&"hidden-property"],children:{className:"field-prop",children:[this.itemInputs,this.itemControls]}})}get itemInputs(){this.itemFieldGroups=[];return{className:`${this.panelName}-prop-inputs prop-inputs f-input-group`,children:this.itemValues.map((([t,e])=>{let n="conditions"===this.panelName?this.generateConditionFields(t,e):this.itemInput(t,e);return["selected","checked"].includes(t)&&(n={className:"f-addon",children:n}),n}))}}get itemControls(){if(this.isLocked){return{className:`${this.panelName}-prop-controls prop-controls`,content:[]}}const t={tag:"button",attrs:{type:"button",className:"prop-remove prop-control"},action:{click:()=>{ha.slideUp(this.dom,250,(t=>{this.field.remove(this.itemKey),Jh.remove(t),this.field.resizePanelWrap()}))}},content:Jh.icon("remove")};return{className:`${this.panelName}-prop-controls prop-controls`,content:[t]}}itemInput(t,e){const n=Jh.childType(e)||"string",o={config:{},attrs:{},...eh[n](t,e)},i=this.itemKey.replace(/.\d+$/,(e=>`${e}.${t}`)),r=i.split(".").filter(Number.isNaN).join("."),[s,a]=[[...this.itemKey.split("."),t],[t]].map((t=>[this.field.id,...t].filter(Boolean).join("-")));return o.config={...o.config,label:"options"!==this.panelName&&th(r),labelAfter:!1},o.attrs={...o.attrs,name:"checkbox"===o.attrs.type?`${a}[]`:a,id:s,disabled:this.isDisabled,locked:this.isLocked},o.action={...oh[n](i,this.field)},o}}class rh{constructor(t,n,o){e(this,"addAttribute",((t,e)=>{const n=ea(t),o=`attrs.${n}`;oe.current[o]||oe.put(o,la(t)),"string"==typeof e&&["true","false"].includes(e)&&(e=JSON.parse(e)),this.field.set(`attrs.${t}`,e);const i=this.props.querySelector(`.field-attrs-${n}`),r=new ih({key:o,data:{[n]:e},field:this.field});i?this.props.replaceChild(r.dom,i):this.props.appendChild(r.dom),this.field.resizePanelWrap()})),e(this,"addOption",(()=>{const t=this.field.data.meta.id,e=this.field.get("options"),n="select"===t?"option":t,o=oe.get("newOptionLabel",{type:n})||"New Option",i=`options.${this.data.length}`,r={...e.length?Zs(e[e.length-1]):{},label:o,value:ea(o)},s=new ih({key:i,data:r,field:this.field,index:this.props.children.length});this.editPanelItems.push(s),this.props.appendChild(s.dom),this.field.set(i,r),this.field.resizePanelWrap()})),e(this,"addCondition",(t=>{const e=`conditions.${this.field.get("conditions").length}`,n=this.props.querySelector(`.field-${e.replace(".","-")}`),o=new ih({key:e,data:t.template,field:this.field});n?this.props.replaceChild(o.dom,n):this.props.appendChild(o.dom),this.field.set(e,t.template),this.field.resizePanelWrap()})),this.type=Jh.childType(t),this.data="object"===this.type?Object.entries(t):t,this.name=n,this.field=o,this.panelConfig=this.getPanelConfig(this.data)}getPanelConfig(t){return this.props=this.createProps(t),this.editButtons=this.createEditButtons(),{id:`${this.field.id}-${this.name}-panel`,config:{label:oe.get(`panel.label.${this.name}`)},attrs:{className:`f-panel ${this.name}-panel`},children:[this.props,this.editButtons]}}createProps(t){this.editPanelItems=Array.from(t).map(((t,e)=>{const n="array"===this.type,o=[this.name,n?String(e):t[0]].join("."),i=n?t:{[t[0]]:t[1]};return new ih({key:o,data:i,field:this.field})}));const e={tag:"ul",attrs:{className:["field-edit-group",`field-edit-${this.name}`]},editGroup:this.name,isSortable:"options"===this.name,content:this.editPanelItems};return Jh.create(e)}createEditButtons(){const t=this,e=this.name,n=oe.get(`panelEditButtons.${e}`),o={attrs:t.addAttribute,options:t.addOption,conditions:t.addCondition};return{className:"panel-action-buttons",content:[{...Jh.btnTemplate({content:n,title:n}),className:`add-${e}`,action:{click:n=>{const i={btnCoords:Jh.coords(n.target),addAction:o[e]};"attrs"===e&&(i.isDisabled=t.field.isDisabledProp,i.isLocked=t.field.isLockedProp,i.message={attr:oe.get(`action.add.${e}.attr`),value:oe.get(`action.add.${e}.value`)});const r=ta(e),s=new window.CustomEvent(`onAdd${r}`,{detail:i});Rd.add[e](i),document.dispatchEvent(s)}}}]}}}class sh extends zl{constructor(t,n={},o){super(t,{...n,id:n.id||cs()}),e(this,"mutationHandler",(t=>t.map((t=>{})))),e(this,"remove",(t=>{if(t){const e=t.split("."),n=e.pop(),o=this.get(e);return Array.isArray(o)?na(n)?o.splice(Number(n),1):this.set(e,o.filter((t=>t!==n))):delete o[n],o}if("stage"===this.name)return null;const e=this.parent,n=this.children;return ra(n,(t=>t.remove())),this.dom.parentElement.removeChild(this.dom),((t,e)=>{const n=t.indexOf(e);-1!==n&&t.splice(n,1)})(Yh.getAddress(`${e.name}s.${e.id}.children`),this.id),e.children.length||e.emptyClass(),"row"===e.name&&e.autoColumnWidths(),Yh[`${this.name}s`].delete(this.id)})),e(this,"emptyClass",(()=>this.dom.classList.toggle("empty",!this.children.length))),e(this,"getComponentTag",(()=>Jh.create({tag:"span",className:["component-tag",`${this.name}-tag`],children:[(this.isColumn||this.isField)&&Jh.icon("component-corner",["bottom-left"]),Jh.icon(`handle-${this.name}`),ta(this.name),(this.isColumn||this.isRow)&&Jh.icon("component-corner",["bottom-right"])].filter(Boolean)}))),e(this,"removeClasses",(t=>{const e={string:()=>this.dom.classList.remove(t),array:()=>t.map((t=>this.dom.classList.remove(t)))};return e.object=e.string,e[Jh.childType(t)](this.dom)})),e(this,"loadChildren",((t=this.data.children)=>t.map((t=>this.addChild({id:t}))))),e(this,"saveChildOrder",(()=>{if(this.render)return;const t=this.children.map((({id:t})=>t));return this.set("children",t),t})),e(this,"onSort",(()=>this.saveChildOrder())),e(this,"onEnd",(({to:{parentElement:t},from:{parentElement:e}})=>{null==t||t.classList.remove(`hovering-${as(t)}`),null==e||e.classList.remove(`hovering-${as(e)}`)})),e(this,"runConditions",(()=>{const t=this.get("conditions");if(!(null==t?void 0:t.length))return null;return t.map((t=>{const e=this.processConditions(t.if),n=this.processResults(t.then);return e.map((t=>this.evaluateConditions(t)&&this.execResults(n)))}))})),e(this,"value",((t,e)=>{const n=t.split("."),o=this.getComponent(t),i=o&&n.slice(2,n.length).join(".");return[!o,!i,!$e[i]].some(Boolean)?t:e?o.set($e[i],e):o.get($e[i])})),e(this,"getResult",(t=>({"=":(t,e,n)=>t.set(e,n)}[t]))),e(this,"processResults",(t=>t.map((({operator:t,target:e,value:n})=>{const o=this.getComponent(e);return{target:o,propertyPath:o&&e.split(".").slice(2,e.length).join("."),action:this.getResult(t),value:this.value(n)}})))),e(this,"execResults",(t=>{const e=t.map((t=>this.execResult(t)));return Promise.all(e)})),e(this,"execResult",(({target:t,action:e,value:n,propertyPath:o})=>new Promise(((o,i)=>{try{return o(e(t,n))}catch(r){return i(r)}})))),e(this,"cloneData",(()=>{const t={...hs(this.data),id:cs()};return"field"!==this.name&&(t.children=[]),t})),e(this,"clone",((t=this.parent)=>{const e=t.addChild(this.cloneData(),this.index+1);return"field"!==this.name&&this.cloneChildren(e),e})),e(this,"createChildWrap",(t=>Jh.create({tag:"ul",attrs:{className:"children"},children:t}))),this.id=this.data.id,this.name=t,this.config=Yh[`${this.name}s`].config,ds(this.config,n.config),this.dataPath=`${this.name}s.${this.id}.`,this.observer=new MutationObserver(this.mutationHandler),this.render=o}observe(t){this.observer.disconnect(),this.observer.observe(t,{childList:!0})}get js(){return this.data}get json(){return this.data}empty(){const t=this.children.map((t=>t.remove()));return this.data.children=this.data.children.filter((e=>-1===t.indexOf(e))),this.dom.classList.add("empty"),t}getActionButtons(){const t=[`hovering-${this.name}`,"hovering"];return{className:[`${this.name}-actions`,"group-actions"],action:{mouseenter:({target:e})=>{Yh.stages.active.dom.classList.add(`active-hover-${this.name}`),this.dom.classList.add(...t)},mouseleave:({target:e})=>{this.dom.classList.remove(...t),Yh.stages.active.dom.classList.remove(`active-hover-${this.name}`),e.removeAttribute("style")}},children:[{...Jh.btnTemplate({content:Jh.icon(`handle-${this.name}`)}),className:["component-handle",`${this.name}-handle`]},{className:["action-btn-wrap",`${this.name}-action-btn-wrap`],children:this.buttons}]}}toggleEdit(t=!this.isEditing){this.isEditing=t;const e=this.dom,n="editing",o=`${n}-${this.name}`,i=this.dom.querySelector(`.${this.name}-edit`);ha.slideToggle(i,De,t),"field"===this.name&&(ha.slideToggle(this.preview,De,!t),e.parentElement.classList.toggle(`column-${o}`,t)),e.classList.toggle(n,t),e.classList.toggle(o,t)}get buttons(){if(this.actionButtons)return this.actionButtons;const t={handle:(t=`handle-${this.name}`)=>({...Jh.btnTemplate({content:Jh.icon(t)}),className:["component-handle"]}),move:(t="move")=>({...Jh.btnTemplate({content:Jh.icon(t)}),className:["item-move"],meta:{id:"move"}}),edit:(t="edit")=>({...Jh.btnTemplate({content:Jh.icon(t)}),className:["item-edit-toggle"],meta:{id:"edit"},action:{click:t=>{this.toggleEdit()}}}),remove:(t="remove")=>({...Jh.btnTemplate({content:Jh.icon(t)}),className:["item-remove"],meta:{id:"remove"},action:{click:(t,e)=>{ha.slideUp(this.dom,De,(()=>{if("column"===this.name){this.parent.autoColumnWidths(),this.remove()}else this.remove()}))}}}),clone:(t="copy")=>({...Jh.btnTemplate({content:Jh.icon(t)}),className:["item-clone"],meta:{id:"clone"},action:{click:()=>{this.clone(this.parent),"column"===this.name&&this.parent.autoColumnWidths()}}})},{buttons:e,disabled:n}=this.config.actionButtons,o=e.filter((t=>!n.includes(t))).map((e=>{var n;return(null==(n=t[e])?void 0:n.call(t))||e}));return this.actionButtons=o,this.actionButtons}get index(){return oa(this.dom)}get parentType(){return Oe.get(this.name)}get parent(){const t=this.parentType;if(!this.dom||!t)return null;const e=this.dom.closest(`.${be[t]}`);return e&&Jh.asComponent(e)}get children(){if(!this.dom)return[];const t=this.domChildren,e=Ee.get(this.name);return sa(t,(t=>Yh.getAddress(`${e}s.${t.id}`))).filter(Boolean)}get domChildren(){const t=this.dom.querySelector(".children");return t?t.children:[]}addChild(t={},e=this.domChildren.length){var n,o;let i=t;"object"!=typeof t&&(i={id:i});const r=this.dom.querySelector(".children"),{id:s=cs()}=i,a=Ee.get(this.name);if(!a)return null;const l=`${a}s`,c=Yh.getAddress(`${l}.${s}`)||Yh[l].add(s,i);r.insertBefore(c.dom,r.children[e]),null==(o=null==(n=this.config.events)?void 0:n.onAddChild)||o.call(n,{parent:this,child:c});const d=c.get("children");return(null==d?void 0:d.length)&&c.loadChildren(d),this.removeClasses("empty"),this.saveChildOrder(),c}onAdd({from:t,to:e,item:n,newIndex:o}){var i;t.classList.contains(se)||(t=t.parentElement);const r=as(t),s=as(e.parentElement),a=new Map([[-2,()=>{const t=this.addChild({},o).addChild();return t.addChild.bind(t)}],[-1,()=>{const t=this.addChild({},o);return t.addChild.bind(t)}],[0,()=>this.addChild.bind(this)],[1,t=>{const e=oa(this.dom);return()=>this.parent.addChild(t,e+1)}],[2,t=>()=>this.parent.parent.addChild(t)]]),l={controls:()=>{const{controlData:t}=Nh.get(n.id),{meta:{id:e}}=t,i=e.startsWith("layout-")?e.replace(/^layout-/,""):"field",r=Xs({stage:{row:0,column:-1,field:-2},row:{row:1,column:0,field:-1},column:{row:2,column:1,field:0},field:1},`${this.name}.${i}`),s=a.get(r)();Jh.remove(n);return s(t,o)},row:()=>{const t=(a.get({stage:-1,row:0,column:1}[s])||bs)();return null==t?void 0:t({id:n.id},o)},column:()=>{const t=(a.get({stage:-2,row:-1}[s])||bs)();return null==t?void 0:t(n.id)}},c=null==(i=l[r])?void 0:i.call(l,n,o);return(()=>{this.saveChildOrder(),this.removeClasses("empty")})(),c}onRemove({from:{parentElement:t}}){return t.classList.contains(ce)&&t.classList.remove("column-editing-field"),"stage"===this.name||this.children.length?(this.emptyClass(),this.saveChildOrder()):this.remove()}onRender(){const{events:t}=this.config;if(!t)return null;t.onRender&&Jh.onRender(this.dom,t.onRender)}set config(t){const e=Xs(this.data,"meta.id"),n=[Xs(t,"all"),e&&Xs(t,e),Xs(t,this.id)].reduce(((t,e)=>e?ds(t,e):t),this.configVal);this.configVal=n}get config(){return this.configVal}getComponent(t){const[e,n]=t.split("."),o=Yh[e];return n===this.id?this:null==o?void 0:o.get(n)}cloneChildren(t){for(const e of this.children)null==e||e.clone(t)}get isRow(){return this.name===ge.row}get isColumn(){return this.name===ge.column}get isField(){return this.name===ge.field}}class ah extends sh{constructor(t=Object.create(null)){super("field",{conditions:[{if:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],then:[{target:"",targetProperty:"",assignment:"",value:""}]}],...t}),e(this,"updateConditionsPanel",(()=>{const t=setTimeout((()=>{const e=this.editPanels.find((({name:t})=>"conditions"===t));if(!e)return null;const n=e.createProps(),o=this.dom.querySelector(".field-edit-conditions");o.parentElement.replaceChild(n,o),clearTimeout(t)}),De)})),e(this,"updatePreview",vs((()=>{if(!this.preview.parentElement)return null;this.updateLabel();const t=Jh.create(this.fieldPreview(),!0);this.preview.parentElement.replaceChild(t,this.preview),this.preview=t}),De)),e(this,"isDisabledProp",((t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.disabled.concat(this.get(`config.disabled${ta(e)}`)).includes(t)})),e(this,"isLockedProp",((t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.locked.concat(this.get(`config.locked${ta(e)}`)).includes(t)})),this.label=Jh.create(this.labelConfig),this.preview=Jh.create({}),this.editPanels=[];const n=this.getActionButtons(),o=this.actionButtons.some((t=>{var e;return"edit"===(null==(e=t.meta)?void 0:e.id)}));let i={tag:"li",attrs:{className:de},id:this.id,children:[this.label,this.getComponentTag(),n,o&&this.fieldEdit,this.preview].filter(Boolean),panelNav:this.panelNav,dataset:{hoverTag:oe.get("field")}};i=Jh.create(i),this.observe(i),this.dom=i,this.isEditing=!1,this.onRender(i)}get labelConfig(){if(!!this.get("config.hideLabel"))return;const t=this.get("config.editorLabel")||this.get("config.label"),e=this.get("attrs.required"),n=this.config.label.disableHTML;return{className:"prev-label",children:[{...(()=>{const e={tag:"label",attrs:{}};return n?(e.tag="input",e.attrs.value=t,e):(e.attrs.contenteditable=!0,e.children=t,e)})(),action:{input:({target:{innerHTML:t,innerText:e,value:o}})=>{super.set("config.label",n?o:t);const i=Yh.getConditionMap(`fields.${this.id}`);if(i)return i.updateConditionSourceLabel(`${this.name}s.${this.id}`,n?o:e)}}},e&&Jh.requiredMark()]}}updateConditionSourceLabel(t,e){const n=this.editPanels.find((({name:t})=>"conditions"===t));if(!n)return null;for(const{itemFieldGroups:o}of n.editPanelItems)for(const n of o){const o=n.find((e=>e.value===t));o&&(o.displayField.value=e)}}set(...t){const[e,n]=t,o=super.set(e,n);return this.updatePreview(),o}updateLabel(){if(!this.label)return null;const t=Jh.create(this.labelConfig);this.label.parentElement.replaceChild(t,this.label),this.label=t}get fieldEdit(){this.editPanels=[];const t=["object","array"],e=["config","meta","action","events",...this.config.panels.disabled],n=ls([...this.config.panels.order,...Object.keys(this.data)]).filter((t=>!e.includes(t))),o={className:["field-edit","slide-toggle","formeo-panels-wrap"]};for(const s of n){const e=this.get(s),n=Jh.childType(e);if(t.includes(n)){const t=new rh(e,s,this);this.editPanels.push(t)}}const i={panels:this.editPanels.map((({panelConfig:t})=>t)),id:this.id,displayType:"auto"},r=this.editPanels.length;return r&&(this.panels=new Wd(i),o.className.push(`panel-count-${r}`),o.content=[this.panels.panelNav,this.panels.panelsWrap],this.panelNav=this.panels.nav,this.resizePanelWrap=this.panels.nav.refresh,o.action={onRender:()=>{if(this.resizePanelWrap(),!r){const t=this.dom,e=t.querySelector(".item-edit-toggle"),n=t.querySelector(".field-actions"),o=n.getElementsByTagName("button");n.style.maxWidth=o.length*o[0].clientWidth+"px",Jh.remove(e)}}}),o}get defaultPreviewActions(){return{change:t=>{const{target:e}=t,{checked:n,type:o}=e;if(["checkbox","radio"].includes(o)){const t=+e.id.split("-").pop();"radio"===o&&this.set("options",this.get("options").map((t=>({...t,selected:!1}))));const i="checkbox"===o?"checked":"selected";this.set(`options.${t}.${i}`,n)}},click:t=>{"true"===t.target.contentEditable&&t.preventDefault()},input:t=>{["input","meter","progress","button"].includes(this.data.tag)&&super.set("attrs.value",t.target.value),t.target.contentEditable&&super.set("content",t.target.innerHTML)}}}fieldPreview(){var t;const e=hs(this.data),{action:n={}}=Nh.get(e.meta.id);e.id=`prev-${this.id}`,e.action=n,(null==(t=this.data)?void 0:t.config.editableContent)&&(e.attrs={...e.attrs,contenteditable:!0});return{attrs:{className:"field-preview",style:this.isEditing&&"display: none;"},content:Jh.create(e,!0),action:this.defaultPreviewActions}}}const lh={js:new Set,css:new Set},ch=(t,e)=>{t.removeEventListener("load",ch),t.rel="stylesheet",e(t.src)},dh=(t,e)=>{t.removeEventListener("load",dh),e(t.src)},hh=t=>new Promise(((e,n)=>{if(lh.js.has(t))return e(t);lh.js.add(t);const o=Jh.create({tag:"script",attrs:{type:"text/javascript",async:!0,src:`//${t.replace(/^https?:\/\//,"")}`},action:{load:()=>dh(o,e),error:()=>n(new Error(`${t} failed to load.`))}});document.head.appendChild(o)})),uh=t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>new Promise(((e,n)=>{if(lh.css.has(t))return e(t);lh.css.add(t);const o=Jh.create({tag:"link",attrs:{rel:"preload",href:t,as:"style"},action:{load:()=>ch(o,e),error:()=>n(new Error(`${(void 0).src} failed to load.`))}});document.head.appendChild(o)}))));return Promise.all(e)},ph=t=>("string"==typeof t?Promise.resolve(t):t.text()).then((t=>{const e="formeo-sprite";let n=document.getElementById(e);return n||(n=Jh.create({id:e,children:t,attrs:{hidden:!0,style:"display: none;"}}),document.body.insertBefore(n,document.body.childNodes[0])),n})),mh=(t,e,n=ys)=>new Promise(((o,i)=>fetch(t).then((t=>o(e?e(t):t))).catch((t=>i(new Error(n(t))))))),fh={js:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>hh(t)));return Promise.all(e)},css:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>uh(t)));return Promise.all(e)}},gh=t=>{const e=Object.entries(t).map((([t,e])=>fh[t](e)));return Promise.all(e)};class vh{constructor({events:t={},dependencies:n={},controlAction:o,...i}){e(this,"controlCache",new Set),this.events=t,this.controlData=i,this.controlAction=o,this.dependencies=n,this.id=i.id||cs()}get controlId(){var t;return null==(t=this.controlData.meta)?void 0:t.id}get dom(){const{meta:t,config:e}=this.controlData,n=this.i18n(e.label)||e.label,o={tag:"button",attrs:{type:"button"},content:[{tag:"span",className:"control-icon",children:Jh.icon(t.icon)},n],action:{focus:({target:t})=>{const e=t.closest(`.${se}`);return e&&Nh.panels.nav.refresh(oa(e))},click:({target:t})=>{Nh.addElement(t.parentElement.id)}}};return Jh.create({tag:"li",id:this.id,className:["field-control",`${t.group}-control`,`${t.id}-control`],content:o,meta:t,action:this.controlAction})}promise(){return gh(this.dependencies)}i18n(t,e){var n,o;const i=oe.locale,r=null==(n=this.definition)?void 0:n.i18n,s=(null==r?void 0:r[i])||{};return((null==(o=s[t])?void 0:o.call(s))??s[t])||oe.get(t,e)}}const bh=[{config:{label:"row"},meta:{group:"layout",icon:"rows",id:"layout-row"}},{config:{label:"column"},meta:{group:"layout",icon:"columns",id:"layout-column"}}];const yh=(t,e=3)=>Array.from({length:e},((t,e)=>e+1)).map((e=>{const n="checkbox"===t?"checked":"selected";return{label:oe.get("labelCount",{label:ta(t),count:e}),value:`${t}-${e}`,[n]:!e}}));const wh=[class extends vh{constructor(){super({tag:"button",attrs:{className:[{label:"grouped",value:"f-btn-group"},{label:"ungrouped",value:"f-field-group"}]},config:{label:oe.get("controls.form.button"),hideLabel:!0},meta:{group:"common",icon:"button",id:"button"},options:[{label:oe.get("button"),type:["button","submit","reset"].map(((t,e)=>({label:t,type:t}))),className:[{label:"default",value:"",selected:!0},{label:"primary",value:"primary"},{label:"danger",value:"error"},{label:"success",value:"success"},{label:"warning",value:"warning"}]}]})}},class extends vh{constructor(){super({tag:"input",attrs:{type:"date",required:!1,className:""},config:{label:oe.get("controls.form.input.date")},meta:{group:"common",icon:"calendar",id:"date-input"}})}},class extends vh{constructor(){super({tag:"input",attrs:{type:"hidden",value:""},config:{label:oe.get("hidden"),hideLabel:!0},meta:{group:"common",icon:"hidden",id:"hidden"}})}},class extends vh{constructor(){super({tag:"input",attrs:{type:"number",required:!1,className:""},config:{label:oe.get("number")},meta:{group:"common",icon:"hash",id:"number"}})}},class extends vh{constructor(){super({tag:"textarea",config:{label:oe.get("controls.form.textarea")},meta:{group:"common",icon:"textarea",id:"textarea"},attrs:{required:!1}})}},class extends vh{constructor(){super({tag:"input",attrs:{required:!1,type:"text",className:""},config:{label:oe.get("controls.form.input.text")},meta:{group:"common",icon:"text-input",id:"text-input"}})}},class extends vh{constructor(){super({tag:"input",attrs:{type:"file",required:!1},config:{label:oe.get("fileUpload")},meta:{group:"common",icon:"upload",id:"upload"}})}},class extends vh{constructor(){super({tag:"select",config:{label:oe.get("controls.form.select")},attrs:{required:!1,className:""},meta:{group:"common",icon:"select",id:"select"},options:yh("option")})}},class extends vh{constructor(){super({tag:"input",attrs:{type:"checkbox",required:!1},config:{label:oe.get("controls.form.checkbox-group"),disabledAttrs:["type"]},meta:{group:"common",icon:"checkbox",id:"checkbox"},options:yh("checkbox",1)})}},class extends vh{constructor(){super({tag:"input",attrs:{type:"radio",required:!1},config:{label:oe.get("controls.form.radio-group"),disabledAttrs:["type"]},meta:{group:"common",icon:"radio-group",id:"radio"},options:yh("radio")})}}],xh=Array.from(Array(5).keys()).slice(1).map((t=>`h${t}`)),Ch="controls.html.header";const Sh=[class extends vh{constructor(){super({tag:xh[0],attrs:{tag:xh.map(((t,e)=>({label:t.toUpperCase(),value:t,selected:!e}))),className:""},config:{label:oe.get(Ch),hideLabel:!0,editableContent:!0},meta:{group:"html",icon:"header",id:"html.header"},content:oe.get(Ch),action:{onRender:t=>{},click:t=>{}}})}static get definition(){return{i18n:{"en-US":{header:"Custom English Header"}}}}get content(){return super.i18n(Ch)}},class extends vh{constructor(){super({tag:"p",attrs:{className:""},config:{label:oe.get("controls.html.paragraph"),hideLabel:!0,editableContent:!0},meta:{group:"html",icon:"paragraph",id:"paragraph"},content:"Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment."})}},class extends vh{constructor(){super({tag:"hr",config:{label:oe.get("controls.html.divider"),hideLabel:!0},meta:{group:"html",icon:"divider",id:"divider"}})}},class extends vh{constructor(t){super(ds({tag:"textarea",config:{label:"WYSIWYG",editableContent:!0},meta:{group:"html",icon:"rich-text",id:"tinymce"},attrs:{required:!1},dependencies:{js:"cdnjs.cloudflare.com/ajax/libs/tinymce/4.9.11/tinymce.min.js"},action:{onRender:t=>{const e=`#${t.id}`;window.tinymce.remove(e),window.tinymce.init({selector:e})}},controlAction:{click:()=>{},onRender:()=>{}}},t))}}],Eh=Object.freeze({sortable:!0,elementOrder:{},groupOrder:[],groups:[{id:"layout",label:"controls.groups.layout",elementOrder:["row","column"]},{id:"common",label:"controls.groups.form",elementOrder:["button","checkbox"]},{id:"html",label:"controls.groups.html",elementOrder:["header","block-text"]}],disable:{groups:[],elements:[],formActions:[]},elements:[],container:null,panels:{displayType:"slider"}}),Oh=[...wh,...Sh,...bh];const Nh=new class{constructor(){e(this,"groupLabel",(t=>oe.get(t)||t||"")),e(this,"addElement",(t=>{const e=Xs(this.get(t),"controlData"),{meta:{group:n,id:o}}=e,i={row:()=>Bh.active.addChild(),column:()=>i.row().addChild(),field:t=>i.column().addChild(t)};return"layout"!==n?i.field(e):i[o.replace("layout-","")]()})),e(this,"applyOptions",(async(t={})=>{const{container:e,elements:n,groupOrder:o,...i}=ds(Eh,t);return this.container=e,this.groupOrder=ls(o.concat(["common","html","layout"])),this.options=i,Promise.all(this.registerControls([...Oh,...n]))})),this.data=new Map,this.buttonActions={focus:({target:t})=>{const e=t.closest(`.${se}`);return e&&this.panels.nav.refresh(oa(e))},click:({target:t})=>{this.addElement(t.parentElement.id)}}}async init(t,e=!1){return await this.applyOptions(t),this.buildDOM(e),this}registerControls(t){return this.controls=[],t.map((async t=>{let e;return e="function"==typeof t?new t:new vh(t),this.add(e),this.controls.push(e.dom),e.promise()}))}groupElements(){let t=this.options.groups.slice(),e=this.controls.slice(),n=[];const o=[];return t=ia(t,this.groupOrder,"id"),t=t.filter((t=>ss(t.id,this.options.disable.groups))),n=t.map((t=>{const n={tag:"ul",attrs:{className:se,id:`${t.id}-${se}`},config:{label:this.groupLabel(t.label)}};if(this.options.elementOrder[t.id]){const e=this.options.elementOrder[t.id],n=ls(e.concat(t.elementOrder));t.elementOrder=n}return e=ia(e,t.elementOrder,"meta.id"),n.content=e.filter((e=>{const{controlData:n}=this.get(e.id),i=n.meta.id||"";let r=!0;return r=[ss(i,this.options.disable.elements),n.meta.group===t.id,!o.includes(n.meta.id)].every((t=>!0===t)),r&&o.push(i),r})),n})),n}add(t=Object.create(null)){const e=hs(t);return this.data.set(e.id,e),e.controlData.meta.id&&this.data.set(e.controlData.meta.id,e.controlData),e}get(t){return this.data.get(t)}formActions(){if(!0===this.options.disable.formActions)return null;const t={...Jh.btnTemplate({content:[Jh.icon("bin"),oe.get("clear")],title:oe.get("clearAll")}),className:["clear-form"],action:{click:t=>{Fh.size?(fa.confirmClearAll=new window.CustomEvent("confirmClearAll",{detail:{confirmationMessage:oe.get("confirmClearAll"),clearAllAction:()=>{Bh.clearAll().then((()=>{const e={src:t.target};fa.formeoCleared(e)}))},btnCoords:Jh.coords(t.target)}}),document.dispatchEvent(fa.confirmClearAll)):window.alert(oe.get("cannotClearFields"))}}},e={...Jh.btnTemplate({content:[Jh.icon("floppy-disk"),oe.get("save")],title:oe.get("save")}),className:["save-form"],action:{click:({target:t})=>{const{formData:e}=Yh,n={action:()=>{},coords:Jh.coords(t),message:"",button:t};return Rd.click.btn(n),Rd.save.form(e)}}};return{className:"form-actions f-btn-group",content:Object.entries({clearBtn:t,saveBtn:e}).reduce(((t,[e,n])=>(this.options.disable.formActions.includes(e)||t.push(n),t)),[])}}buildDOM(t){const e=this.groupElements(),n=this.formActions(),{displayType:o}=this.options.panels;this.panels=new Wd({panels:e,type:"controls",displayType:o});const i=["control-groups","formeo-panels-wrap",`panel-count-${e.length}`],r=Jh.create({className:i,content:[this.panels.panelNav,this.panels.panelsWrap]}),s=["formeo-controls"];t&&s.push("formeo-sticky");const a=Jh.create({className:s,content:[r,n]}),l=a.getElementsByClassName("control-group");this.dom=a,this.groups=l;const[c]=l;this.currentGroup=c,this.actions={filter:t=>{const e=""!==t,n=this.controls;let o=r.querySelector(".filtered-term");if(Jh.toggleElementsByStr(n,t),e){const e=oe.get("controls.filteringTerm",t);a.classList.add("filtered"),o?o.textContent=e:(o=Jh.create({tag:"h5",className:"filtered-term",content:e}),r.insertBefore(o,r.firstChild))}else o&&(a.classList.remove("filtered"),o.remove())},addElement:this.addElement,addGroup:t=>{}};for(let d=l.length-1;d>=0;d--){const t=`formeo-controls-${l[d]}`;this.options.sortable||window.localStorage.removeItem(t),yd.create(l[d],{animation:150,forceFallback:!0,fallbackClass:"control-moving",fallbackOnBody:!0,group:{name:"controls",pull:"clone",put:!1},onStart:({item:t})=>{const{controlData:e}=this.get(t.id);this.options.ghostPreview&&(t.innerHTML="",t.appendChild(new ah(e).preview))},onEnd:({from:t,item:e,clone:n})=>{t.contains(n)&&t.replaceChild(e,n)},sort:this.options.sortable,store:{get:()=>{const e=window.localStorage.getItem(t);return e?e.split("|"):[]},set:e=>{const n=e.toArray();window.localStorage.setItem(t,n.join("|"))}}})}return a}};class Ah extends zl{constructor(){super(...arguments),e(this,"load",((t=Object.create(null))=>(this.empty(),"string"==typeof t&&(t=JSON.parse(t)),Object.entries(t).forEach((([t,e])=>this.add(t,e))),this.data))),e(this,"get",(t=>t?Xs(this.data,t):this.add())),e(this,"add",((t,e=Object.create(null))=>{const n=t||cs(),o=this.Component({...e,id:n});return this.set(n,o),this.active=o,o})),e(this,"remove",(t=>(Array.isArray(t)?t.forEach((t=>{this.get(t).remove()})):this.get(t).remove(),this.data))),e(this,"delete",(t=>(delete this.data[t],t))),e(this,"clearAll",((t=!0)=>{const e=Object.values(this.data).map((e=>e.empty(t)));return Promise.all(e)})),e(this,"conditionMap",new Map)}set config(t){this.configVal=ds(this.configVal,hs(t))}get config(){return this.configVal}}class Mh extends sh{constructor(t,e){super("stage",{...Object.freeze({children:[]}),...t},e);const n=this.createChildWrap();this.dom=Jh.create({attrs:{className:[ae,"empty"],id:this.id},children:n}),yd.create(n,{animation:150,fallbackClass:"row-moving",forceFallback:!0,group:{name:"stage",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onAdd:this.onAdd.bind(this),onRemove:this.onRemove.bind(this),onStart:()=>{_h.active=this},onSort:this.onSort.bind(this),draggable:`.${le}`,handle:".item-move"})}empty(t=!0){return new Promise((e=>{t?(this.dom.classList.add("removing-all-fields"),ha.slideUp(this.dom,De,(()=>{e(super.empty(t)),this.dom.classList.remove("removing-all-fields"),ha.slideDown(this.dom,De)}))):e(super.empty())}))}onAdd(...t){const e=super.onAdd(...t);e&&"column"===e.name&&e.parent.autoColumnWidths()}}const _h=new class extends Ah{constructor(t){super("stages",t)}Component(t){return new Mh(t)}};class Dh extends sh{constructor(t){super("row",{...Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[le]}),...t}),e(this,"autoColumnWidths",(()=>{const t=this.children;if(!t.length)return;const e=Number.parseFloat((100/t.length).toFixed(1))/1;for(const n of t){n.removeClasses(Ve);const t=n.dom,o=ps(e);n.set("config.width",o),t.style.width=o,t.dataset.colWidth=o;const i=setTimeout((()=>{clearTimeout(i),n.refreshFieldPanels()}),je);document.dispatchEvent(fa.columnResized)}this.updateColumnPreset()})),e(this,"updateColumnPreset",(()=>{this.columnPresetControl.innerHTML="";const t=this.getColumnPresetOptions.map((({label:t,...e})=>Jh.create({tag:"option",content:t,attrs:e})));this.columnPresetControl.append(...t)})),e(this,"setColumnWidths",(t=>{"string"==typeof t&&(t=t.split(",")),this.children.forEach(((e,n)=>{e.setWidth(`${t[n]}%`),e.refreshFieldPanels()}))}));const n=this.createChildWrap();this.dom=Jh.create({tag:"li",className:[le,"empty"],dataset:{hoverTag:oe.get("row"),editingHoverTag:oe.get("editing.row")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),this.editWindow,n]}),yd.create(n,{animation:150,fallbackClass:"column-moving",forceFallback:!0,group:{name:"row",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onRemove:this.onRemove.bind(this),onEnd:this.onEnd.bind(this),onAdd:this.onAdd.bind(this),onSort:this.onSort.bind(this),draggable:`.${ce}`,handle:".item-move"})}get editWindow(){const t={tag:"input",id:`${this.id}-fieldset`,attrs:{type:"checkbox",checked:this.get("config.fieldset"),ariaLabel:oe.get("row.settings.fieldsetWrap.aria")},action:{click:({target:{checked:t}})=>{this.set("config.fieldset",Boolean(t))}},config:{label:oe.get("row.settings.fieldsetWrap")}},e={tag:"input",id:`${this.id}-inputGroup`,attrs:{type:"checkbox",checked:this.get("config.inputGroup"),ariaLabel:oe.get("row.settings.inputGroup.aria")},action:{click:({target:{checked:t}})=>this.set("config.inputGroup",t)},config:{label:oe.get("row.makeInputGroup"),description:oe.get("row.makeInputGroupDesc")}},n={className:"input-group",content:{tag:"input",attrs:{type:"text",ariaLabel:"Legend for fieldset",value:this.get("config.legend"),placeholder:"Legend"},action:{input:({target:{value:t}})=>this.set("config.legend",t)},className:""}},o=Jh.formGroup([t,n]),i={tag:"label",content:oe.get("defineColumnWidths"),className:"col-sm-4 form-control-label"};this.columnPresetControl=Jh.create(this.columnPresetControlConfig);const r={className:"col-sm-8",content:this.columnPresetControl,action:{onRender:()=>{this.updateColumnPreset()}}},s=[e,"hr",o,"hr",Jh.formGroup([i,r],"row")];return Jh.create({className:`${this.name}-edit group-config`,action:{onRender:t=>{const e=s.map((t=>Jh.create(t)));t.append(...e)}}})}onAdd(...t){super.onAdd(...t),this.autoColumnWidths()}onRemove(...t){super.onRemove(...t),this.autoColumnWidths()}get getColumnPresetOptions(){const t=this.children,e=Ne.get(t.length-1)||[],n=t.map((t=>{const e=t.get("config.width")||"";return Number(e.replace("%","")).toFixed(1)})).join(",");if(e.length){const t=e.slice();return!t.find((t=>t.value===n))&&t.push({value:n,label:n.replace(/,/g," | "),className:he}),t.map((t=>{const e={...t};return e.selected=t.value===n,e}))}return[]}get columnPresetControlConfig(){return{tag:"select",attrs:{ariaLabel:oe.get("defineColumnLayout"),className:ue},action:{change:({target:t})=>{const{value:e}=t;this.setColumnWidths(e)}},options:this.getColumnPresetOptions}}}const jh={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}};const kh=new class extends Ah{constructor(t){super("rows",t),this.config={all:jh}}Component(t){return new Dh(t)}};class Th{constructor(){this.onMove=this.onMove.bind(this),this.onStop=this.onStop.bind(this),this.cleanup=this.cleanup.bind(this)}getRowWidth(t){const e=t.querySelector(".children");if(!e)return 0;const n=e.children.length,o=Jh.getStyle(e,"gap")||"0px",i=parseFloat(o,10)||0;return this.totalGapWidth=i*(n-1),e.offsetWidth-this.totalGapWidth}validateResizeTarget(t,e){return t&&e&&t.offsetWidth&&e.offsetWidth}onStart(t){if(t.preventDefault(),this.resized=!1,0!==t.button)return;const e=t.target.parentElement,n=e.nextSibling||e.previousSibling,o=e.closest(`.${le}`);if(this.validateResizeTarget(e,n))if(this.startX="touchstart"===t.type?t.touches[0].clientX:t.clientX,o.classList.add(pe),this.columnPreset=o.querySelector(`.${ue}`),this.originalColumnClass=e.className,this.originalSiblingClass=n.className,e.className=e.className.replace(Ve,""),n.className=n.className.replace(Ve,""),this.colStartWidth=e.offsetWidth,this.sibStartWidth=n.offsetWidth,this.rowWidth=this.getRowWidth(o),this.rowWidth<=0)this.cleanup();else{this.column=e,this.sibling=n,this.row=o;try{window.addEventListener("pointermove",this.onMove,!1),window.addEventListener("pointerup",this.onStop,!1)}catch(i){this.cleanup()}}else this.cleanup()}calculateNewWidths(t){const e=this.colStartWidth+t-this.startX,n=this.sibStartWidth-t+this.startX,o=parseFloat(us(e,this.rowWidth)),i=parseFloat(us(n,this.rowWidth));return o<10||i<10?null:{colWidth:ps(o.toFixed(1)),siblingColWidth:ps(i.toFixed(1))}}onMove(t){t.preventDefault();const{column:e,sibling:n}=this,o="touchmove"===t.type?t.touches[0].clientX:t.clientX,i=this.calculateNewWidths(o);if(!i)return;const{colWidth:r,siblingColWidth:s}=i;e.dataset.colWidth=r,n.dataset.colWidth=s,e.style.width=r,n.style.width=s,this.resized=!0}onStop(){const{column:t,sibling:e}=this;window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop),this.resized&&(this.setCustomWidthValue(),Yh.setAddress(`columns.${t.id}.config.width`,t.dataset.colWidth),Yh.setAddress(`columns.${e.id}.config.width`,e.dataset.colWidth),this.row.classList.remove(pe),this.resized=!1,this.cleanup())}cleanup(){this.column&&this.originalColumnClass&&(this.column.className=this.originalColumnClass),this.sibling&&this.originalSiblingClass&&(this.sibling.className=this.originalSiblingClass),this.row&&this.row.classList.remove(pe),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const t=this.columnPreset;let e=t.querySelector(`.${he}`);const n=this.row.querySelector(".children").children,o=sa(n,(t=>us(t.clientWidth,this.rowWidth).toFixed(1))),i=o.join(","),r=o.join(" | ");return e||(e=Jh.create({tag:"option",attrs:{className:he,value:i,selected:!0},content:r}),t.append(e)),e.value=i,e.textContent=r,i}}const Lh=t=>({className:"resize-x-handle",action:{pointerdown:t.onStart.bind(t)},content:[Jh.icon("triangle-down"),Jh.icon("triangle-up")]}),Ph=()=>({className:"column-edit group-config"});class zh extends sh{constructor(t){super("column",{...Object.freeze({config:{width:"100%"},children:[],className:[ce]}),...t}),e(this,"refreshFieldPanels",(()=>{this.children.forEach((t=>t.panels.nav.refresh()))})),e(this,"setWidth",(t=>(this.dom.dataset.colWidth=t,this.dom.style.width=t,this.set("config.width",t))));const n=this.createChildWrap();this.dom=Jh.create({tag:"li",className:[ce,"empty"],dataset:{hoverTag:oe.get("column")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),Ph(),Lh(new Th),n]}),this.processConfig(this.dom),fa.columnResized=new window.CustomEvent("columnResized",{detail:{column:this.dom,instance:this}}),yd.create(n,{animation:150,fallbackClass:"field-moving",forceFallback:!0,group:{name:"column",pull:!0,put:["column","controls"]},sort:!0,disabled:!1,onEnd:this.onEnd.bind(this),onAdd:this.onAdd.bind(this),onSort:this.onSort.bind(this),onRemove:this.onRemove.bind(this),onMove:t=>{t.from!==t.to&&t.from.classList.remove("hovering-column")},draggable:`.${de}`,handle:".item-move"})}processConfig(t){const e=da.get(this.data,"config.width");e&&(t.dataset.colWidth=e,t.style.width=e)}}const $h={actionButtons:{buttons:["clone","move","remove"],disabled:[]}};const Ih=new class extends Ah{constructor(t){super("columns",t),this.config={all:$h}}Component(t){return new zh(t)}},Hh={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}};const Vh=new class extends Ah{constructor(t){super("fields",t),e(this,"get",(t=>{let e=t&&Xs(this.data,t);if(!e){const n=Nh.get(t);n&&(e=this.add(null,n.controlData))}return e})),this.config={all:Hh}}Component(t){return new ah(t)}};const Rh=new class extends Ah{constructor(t){super("externals",t)}Component(t){return new sh("external",t)}},Bh=_h,Fh=kh,Wh=Ih,qh=Vh,Uh=Nh,Gh=Rh,Xh={id:cs()};const Yh=new class extends zl{constructor(t){super("components"),e(this,"sessionFormData",(()=>{var t;if(null==(t=this.opts)?void 0:t.sessionStorage)return ms.get(Me)})),e(this,"load",((t,e=this.opts||Object.create(null))=>{let n=t;this.empty(),"string"==typeof t&&(n=JSON.parse(t)),this.opts=e;const{stages:o={[cs()]:{}},rows:i,columns:r,fields:s,id:a=cs()}={...this.sessionFormData(),...n};this.set("id",a),this.add("stages",Bh.load(o)),this.add("rows",Fh.load(i)),this.add("columns",Wh.load(r)),this.add("fields",qh.load(s)),this.add("externals",Gh.load(e.external));for(const l of Object.values(this.get("stages")))l.loadChildren();return this.data})),this.opts=t,this.data=Xh,this.disableEvents=!0,this.stages=Bh,this.rows=Fh,this.columns=Wh,this.fields=qh,this.controls=Uh,this.externals=Gh}flatList(t=this.data,e=Object.create(null)){return Object.entries(t).reduce(((t,[e,n])=>{if("object"==typeof n)for(const[o,i]of Object.entries(n))t[`${e}.${o}`]=i;return t}),e)}get json(){return window.JSON.stringify(this.formData)}get formData(){return{id:this.get("id"),stages:_h.getData(),rows:kh.getData(),columns:Ih.getData(),fields:Vh.getData()}}set config(t){const{stages:e,rows:n,columns:o,fields:i}=t;Bh.config=e,Fh.config=n,Wh.config=o,qh.config=i}setAddress(t,e){const[n,o,...i]=Array.isArray(t)?t:t.split("."),r=this[n.replace(/s?$/,"s")].get(o);return null==r||r.set(i,e),r}getAddress(t){if(!fs(t))return;const[e,n,...o]=Array.isArray(t)?t:t.split("."),i=this[e.replace(/s?$/,"s")].get(n);return o.length?i.get(o):i}getConditionMap(t){if(fs(t)){const e=t.split(".");return e.every((t=>Boolean(t)))&&this[e[0]].conditionMap.get(e[1])}}setConditionMap(t,e){if(fs(t)){const n=t.split(".");return n.every((t=>Boolean(t)))&&this[n[0]].conditionMap.set(n[1],e)}}removeConditionMap(t){if(fs(t)){const e=t.split(".");return e.every((t=>Boolean(t)))&&this[e[0]].conditionMap.delete(e[1])}}},Zh={glyphicons:t=>``,"font-awesome":t=>{const[e,n]=t.split(" ");return``},fontello:t=>`${t}`};const Jh=new class{constructor(){e(this,"render",(t=>(t.id=`f-${t.id||cs()}`,this.create(t)))),e(this,"create",((t,e=!1)=>{let n=t;if(!n)return;n=this.processTagName(n);const o=this;let i;const{tag:r}=n,s=["children","content"];let a;const l={attrs:{},className:[da.get(n,"config.inputWrap")||"f-field-group"],children:[],config:{}};let c=document.createElement(r);const d={string:t=>{c.innerHTML+=t},object:t=>t&&c.appendChild(o.create(t,e)),node:t=>c.appendChild(t),component:t=>c.appendChild(t.dom),array:t=>{for(const e of t)i=o.childType(e),d[i](e)},function:t=>{t=t(),i=o.childType(t),d[i](t)},undefined:()=>null,boolean:()=>null};if(s.push("tag"),n.className){const{className:t}=n;n.attrs=Object.assign({},n.attrs,{className:t}),delete n.className}if(n.options){let{options:t}=n;if(t=this.processOptions(t,n,e),!this.holdsContent(c)||"button"===r)return da.forEach(t,(t=>{l.children.push(o.create(t,e))})),n.attrs.className&&(l.className=n.attrs.className),l.config=Object.assign({},n.config),this.create(l,e);d.array.call(this,t),delete n.content,s.push("options")}if("OPTION"===c.tagName){const t=setTimeout((()=>{c.selected=!1,clearTimeout(t)}),0)}if(n.attrs&&(o.processAttrs(n,c,e),s.push("attrs")),n.config){if(n.config.label&&(n.config.label&&"button"!==r||["radio","checkbox"].includes(da.get(n,"attrs.type")))&&!e){const t=o.label(n);if(!n.config.hideLabel){const e=[...o.labelAfter(n)?[c,t]:[t,c]];l.children.push(e)}}s.push("config")}if(n.content||n.children){const t=n.content||n.children;i=o.childType(t),d[i],d[i].call(this,t)}if(n.dataset){for(const t in n.dataset)Object.hasOwn(n.dataset,t)&&(c.dataset[t]="function"==typeof n.dataset[t]?n.dataset[t]():n.dataset[t]);s.push("dataset")}n.action&&(this.actionHandler(c,n.action),s.push("action"));const h=da.subtract(s,Object.keys(n));for(a=h.length-1;a>=0;a--)c[h[a]]=n[h[a]];return l.children.length&&(c=this.create(l)),c})),e(this,"onRender",((t,e)=>{t.parentElement?e(t):window.requestAnimationFrame((()=>this.onRender(t,e)))})),e(this,"toggleElementsByStr",((t,e)=>{const n=[];return Jh.elementsContainText(t,e,((t,e)=>{e?(t.style.display="block",n.push(t)):t.style.display="none"})),n})),e(this,"elementsContainText",((t,e,n)=>{const o=[];return ra(t,(t=>{const i=-1!==t.textContent.toLowerCase().indexOf(e.toLowerCase());null==n||n(t,i),i&&o.push(t)})),o})),e(this,"generateOption",(({type:t="option",label:e,value:n,i:o=0,selected:i})=>({tag:"option"===t?"option":"input",attrs:{type:t,value:n||`${t}-${o}`,["option"===t?"selected":"checked"]:i||!o},config:{label:e||oe.get("labelCount",{label:oe.get("option"),count:o})}}))),e(this,"makeOption",(([t,e],n,o)=>{const i={value:t,label:oe.get(`${o}.${e}`)||e};return t===n&&(i.selected=!0),i})),e(this,"requiredMark",(()=>({tag:"span",className:"text-error",children:"*"}))),e(this,"removeEmpty",(t=>{const e=t.parentElement,n=as(t),o=e.getElementsByClassName(`formeo-${n}`);if(this.remove(t),!o.length){if(!this.isStage(e))return this.removeEmpty(e);this.emptyClass(e)}})),e(this,"btnTemplate",(({title:t="",...e})=>({tag:"button",attrs:{type:"button",title:t},...e}))),e(this,"isControls",(t=>as(t)===se)),e(this,"isStage",(t=>as(t)===ae)),e(this,"isRow",(t=>as(t)===le)),e(this,"isColumn",(t=>as(t)===ce)),e(this,"isField",(t=>as(t)===de)),e(this,"asComponent",(t=>Yh[`${as(t)}s`].get(t.id))),this.options=Object.create(null),this.styleSheet=(()=>{const t=document.createElement("style");return t.setAttribute("media","screen"),t.setAttribute("type","text/css"),t.appendChild(document.createTextNode("")),document.head.appendChild(t),t.sheet})()}set setOptions(t){this.options=ds(Object.assign({},this.options,t))}processTagName(t){let e;if("string"==typeof t&&(e=t,t={tag:e}),t.attrs){const{tag:n,...o}=t.attrs;if(n)if("string"==typeof n)e=n;else{e=(n.find((t=>!0===t.selected))||n[0]).value}t.attrs=o}return t.tag=e||t.tag||"div",t}actionHandler(t,e){const n={onRender:Jh.onRender,render:Jh.onRender},o=["focus","blur"];return Object.entries(e).map((([e,i])=>(Array.isArray(i)?i:[i]).map((i=>{const r=n[e]||(t=>(e,n)=>e.addEventListener(t,n,o.includes(t)))(e);return r(t,i)}))))}get icons(){if(this.iconSymbols)return this.iconSymbols;const t=document.querySelectorAll("#formeo-sprite svg symbol");return this.iconSymbols=Array.from(t).reduce(((t,e)=>{var n;return t[e.id.replace(Re,"")]=Jh.create({tag:"svg",attrs:{className:`svg-icon ${n=e.id}`},children:[{tag:"use",attrs:{"xmlns:xlink":"http://www.w3.org/1999/xlink","xlink:href":`#${n}`}}]}),t}),{}),this.iconSymbols}icon(t=null,e=[]){var n;if(!t)return;const o=this.icons[t];if(o){const t=o.cloneNode(!0);return t.classList.add(...e),t.outerHTML}return(null==(n=Zh[Jh.options.iconFont])?void 0:n.call(Zh,t))||t}processAttrs(t,e,n){const{attrs:o={}}=t;n||!o.name&&this.isInput(t.tag)&&e.setAttribute("name",cs(t));for(const i of Object.keys(o)){const t=da.safeAttrName(i);let n=o[i]||"";if(Array.isArray(n))if("object"==typeof n[0]){const t=n.filter((t=>!0===t.selected));n=t.length?t[0].value:n[0].value}else n=n.join(" ");if(n)if("OPTION"===e.tagName&&"selected"===t){const o=setTimeout((()=>{e.setAttribute(t,n),clearTimeout(o)}),0)}else e.setAttribute(t,n)}}processOptions(t,e,n){const{action:o,attrs:i}=e,r=i.type||e.tag,s=i.id||e.id;return t.map(((t,i)=>{var a;const{label:l,...c}=t,d=()=>{const a={tag:"input",attrs:{name:s,type:r,value:t.value||"",id:`${s}-${i}`,...c},action:o},l={tag:"label",attrs:{for:`${s}-${i}`},config:{inputWrap:"form-check"},children:t.label},d={children:[a,l],className:[`f-${r}`]};return e.attrs.className&&(e.config.inputWrap=e.attrs.className),e.config.inline&&d.className.push(`f-${r}-inline`),t.selected&&(a.attrs.checked=!0),n&&(l.attrs.contenteditable=!0),d},h={select:()=>({tag:"option",attrs:t,children:t.label}),button:t=>{const{type:n,label:o,className:i,id:r}=t;return{...e,attrs:{type:n},className:i,id:r||cs(),options:void 0,children:o,action:e.action}},checkbox:d,radio:d};return null==(a=h[r])?void 0:a.call(h,t)}))}holdsContent(t){return-1!==t.outerHTML.indexOf("/")}isBlockInput(t){return!this.isInput(t)&&this.holdsContent(t)}isInput(t){return"string"!=typeof t&&(t=t.tagName),-1!==["input","textarea","select"].indexOf(t)}parsedHtml(t){const e=document.createElement("textarea");return e.innerHTML=t,e.textContent}labelAfter(t){const e=da.get(t,"attrs.type"),n=da.get(t,"config.labelAfter");return void 0!==n?n:"checkbox"===e||"radio"===e}label(t,e){const n=da.get(t,"attrs.required");let{config:{label:o=""}}=t;const{id:i,attrs:r}=t;"function"==typeof o&&(o=o());const s={tag:"label",attrs:{for:i||(null==r?void 0:r.id)},className:[],children:[o,n&&this.requiredMark()],action:{}};return e&&(delete s.attrs.for,s.attrs.contenteditable=!0,s.fMap=e),s}childType(t){return void 0===t?t:[["array",t=>Array.isArray(t)],["node",t=>t instanceof window.Node||t instanceof window.HTMLElement],["component",()=>null==t?void 0:t.dom],[typeof t,()=>!0]].find((e=>e[1](t)))[0]}getStyle(t,e=!1){let n;return window.getComputedStyle?n=window.getComputedStyle(t,null):t.currentStyle&&(n=t.currentStyle),e?n[e]:n}getElement(t){return{node:()=>t,object:()=>document.getElementById(t.id),string:()=>document.getElementById(t)}[this.childType(t)]()}empty(t){for(;t.firstChild;)this.remove(t.firstChild);return t}remove(t){const e=as(t);return e?Yh.remove(`${e}s.${t.id}`):t.parentElement.removeChild(t)}removeClasses(t,e){const n={string:t=>t.classList.remove(e),array:t=>{for(const n of e)t.classList.remove(n)}};n.object=n.string,da.forEach(t,n[this.childType(e)])}addClasses(t,e){const n={string:t=>t.classList.add(e),array:t=>{for(const n of e)t.classList.add(n)}};da.forEach(t,n[this.childType(e)])}formGroup(t,e=""){return{className:["f-field-group",e],children:t}}coords(t){const e=t.getBoundingClientRect(),n=document.body.getBoundingClientRect();return{pageX:e.left+e.width/2,pageY:e.top-n.top-e.height/2}}clearStage(t){t.classList.add("removing-all-fields");ha.slideUp(t,600,(()=>{Jh.empty(t),t.classList.remove("removing-all-fields"),Jh.emptyClass(t),ha.slideDown(t,300)}))}toggleSortable(t,e){const n=as(t);if(!n)return;const o=as(t.parentElement),i=Jh[n].get(t.id).sortable;e||(e=!i.option("disabled")),i.option("disabled",e),o&&["rows","columns","stages"].includes(o)&&this.toggleSortable(t.parentElement,e)}emptyClass(t){const e=t.getElementsByClassName(me.get(t.classList.item(0)));t.classList.toggle("empty",!e.length)}};const Kh={"en-US":"English",dir:"ltr","action.add.attrs.attr":"What attribute would you like to add?","action.add.attrs.value":"Default Value",addOption:"Add Option",allFieldsRemoved:"All fields were removed.",allowSelect:"Allow Select",attribute:"Attribute",attributes:"Attributes","attrs.class":"Class","attrs.className":"Class","attrs.dir":"Direction","attrs.id":"Id","attrs.required":"Required","attrs.style":"Style","attrs.title":"Title","attrs.type":"Type","attrs.value":"Value",autocomplete:"Autocomplete",button:"Button",cannotBeEmpty:"This field cannot be empty",checkbox:"Checkbox",checkboxes:"Checkboxes",class:"Class",clear:"Clear",clearAllMessage:"Are you sure you want to clear all fields?",close:"Close",column:"Column",confirmClearAll:"Are you sure you want to remove all fields?",content:"Content",control:"Control","controlGroups.nextGroup":"Next Group","controlGroups.prevGroup":"Previous Group","controls.form.button":"Button","controls.form.checkbox-group":"Checkbox Group","controls.form.input.date":"Date","controls.form.input.email":"Email","controls.form.input.file":"File Upload","controls.form.input.hidden":"Hidden Input","controls.form.input.number":"Number","controls.form.input.text":"Text Input","controls.form.radio-group":"Radio Group","controls.form.select":"Select","controls.form.textarea":"TextArea","controls.groups.form":"Form Fields","controls.groups.html":"HTML Elements","controls.groups.layout":"Layout","controls.html.divider":"Divider","controls.html.header":"Header","controls.html.paragraph":"Paragraph","controls.layout.column":"Column","controls.layout.row":"Row","controls.filteringTerm":'Filtering "{term}"',copy:"Copy To Clipboard",danger:"Danger",description:"Help Text",descriptionField:"Description",defineColumnLayout:"Define a column layout",defineColumnWidths:"Define column widths","editing.row":"Editing Row",editorTitle:"Form Elements",field:"Field",fieldNonEditable:"This field cannot be edited.",fieldRemoveWarning:"Are you sure you want to remove this field?",fileUpload:"File Upload",formUpdated:"Form Updated",getStarted:"Drag a field from the right to get started.",group:"Group",grouped:"Grouped",hidden:"Hidden Input",hide:"Edit",htmlElements:"HTML Elements",if:"If",info:"Info","input.date":"Date","input.text":"Text",label:"Label",labelCount:"{label} {count}",labelEmpty:"Field Label cannot be empty",layout:"Layout",limitRole:"Limit access to one or more of the following roles:",mandatory:"Mandatory",maxlength:"Max Length","meta.group":"Group","meta.icon":"Ico","meta.label":"Label",minOptionMessage:"This field requires a minimum of 2 options",name:"Name",no:"No",number:"Number",off:"Off",on:"On",option:"Option",optional:"optional",optionEmpty:"Option value required",optionLabel:"Option {count}",options:"Options",order:"Order","panel.label.attrs":"Attributes","panel.label.conditions":"Conditions","panel.label.config":"Configuration","panel.label.meta":"Meta","panel.label.options":"Options","panelEditButtons.attrs":"+ Attribute","panelEditButtons.options":"+ Option","panelEditButtons.conditions":"+ Condition",placeholder:"Placeholder","placeholder.className":"space separated classes","placeholder.email":"Enter you email","placeholder.label":"Label","placeholder.password":"Enter your password","placeholder.placeholder":"Placeholder","placeholder.text":"Enter some Text","placeholder.textarea":"Enter a lot of text","placeholder.value":"Value",preview:"Preview",primary:"Primary",remove:"Remove",removeType:"Remove {type}",removeMessage:"Remove Element",required:"Required",reset:"Reset",richText:"Rich Text Editor",roles:"Access",row:"Row","row.makeInputGroup":"Make this row an input group.","row.makeInputGroupDesc":"Input Groups enable users to add sets of inputs at a time.","row.settings.fieldsetWrap":"Wrap row in a <fieldset> tag","row.settings.fieldsetWrap.aria":"Wrap Row in Fieldset",cannotClearFields:"There are no fields to clear",save:"Save",secondary:"Secondary",select:"Select",selectColor:"Select Color",selectionsMessage:"Allow Multiple Selections",selectOptions:"Options",separator:"Separator",settings:"Settings",size:"Size",sizes:"Sizes","sizes.lg":"Large","sizes.m":"Default","sizes.sm":"Small","sizes.xs":"Extra Small",style:"Style",styles:"Styles","styles.btn":"Button Style","styles.btn.danger":"Danger","styles.btn.default":"Default","styles.btn.info":"Info","styles.btn.primary":"Primary","styles.btn.success":"Success","styles.btn.warning":"Warning",subtype:"Type",success:"Success",text:"Text Field",then:"Then",toggle:"Toggle",ungrouped:"Un-Grouped",warning:"Warning",yes:"Yes",and:"and",or:"or","field.property.value":"value","field.property.label":"label","field.property.valid":"valid","field.property.invalid":"not valid","field.property.isVisible":"is visible","field.property.isNotVisible":"is not visible",newOptionLabel:"New {type}","operator.visible":"visible","operator.notVisible":"not visible","operator.equals":"equals","operator.notEquals":"not equal","operator.contains":"contains","operator.notContains":"not contains","condition.target.placeholder":"target","if.condition.target.placeholder":"target / value","if.condition.source.placeholder":"source","then.condition.target.placeholder":"target","condition.value.placeholder":"value",attributeNotPermitted:'Attribute "{attribute}" is not permitted, please choose another.'};oe.addLanguage("en-US",Kh);const Qh={get editor(){return{stickyControls:!1,allowEdit:!0,dataType:"json",debug:!1,sessionStorage:!1,editorContainer:null,external:{},svgSprite:null,iconFont:null,config:{},events:{},actions:{},controls:{},polyfills:ca(),i18n:{location:"https://draggable.github.io/formeo/assets/lang/"}}}};let tu=class{constructor({formData:t,...e},n){const o=ds(Qh.editor,e),{actions:i,events:r,debug:s,config:a,editorContainer:l,...c}=o;l&&(this.editorContainer="string"==typeof l?document.querySelector(l):l),this.opts=c,Jh.setOptions=c,Yh.config=a,this.userFormData=n||t,this.Components=Yh,this.dom=Jh,fa.init({debug:s,...r}),Rd.init({debug:s,sessionStorage:c.sessionStorage,...i}),this.loadResources().then((()=>{c.allowEdit&&this.init()}))}get formData(){return this.Components.formData}set formData(t={}){this.load({...this.userFormData,...t},this.opts)}get json(){return this.Components.json}loadResources(){var t;const e=[];return this.opts.polyfills&&(t=>{const e=Array.isArray(t)?re.filter((({name:e})=>-1!==t.indexOf(e))):re;Promise.all(e.map((({src:t})=>hh(t))))})(this.opts.polyfills),this.opts.style&&e.push(uh(this.opts.style)),this.opts.svgSprite?e.push(mh(this.opts.svgSprite,ph,(()=>mh("https://draggable.github.io/formeo/assets/img/formeo-sprite.svg",ph)))):e.push(ph('image/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xml')),e.push(oe.init({...this.opts.i18n,locale:null==(t=window.sessionStorage)?void 0:t.getItem(_e)})),Promise.all(e)}init(){Nh.init(this.opts.controls,this.opts.stickyControls).then((t=>{this.controls=t,this.load(this.userFormData,this.opts),this.formId=Yh.get("id"),this.i18n={setLang:t=>{var e;null==(e=window.sessionStorage)||e.setItem(_e,t);oe.setCurrent(t).then((()=>{this.init()}),console.error)}},this.render()}))}load(t=this.userFormData,e=this.opts){return this.Components.load(t,e)}render(){if(!this.controls)return window.requestAnimationFrame((()=>this.render()));if(this.stages=Object.values(Yh.get("stages")),this.opts.controlOnLeft)for(const e of this.stages)e.dom.style.order=1;const t={attrs:{className:"formeo formeo-editor",id:this.formId},content:[this.stages.map((({dom:t})=>t))]};oe.current.dir&&(t.attrs.dir=oe.current.dir,Jh.dir=oe.current.dir),this.editor=Jh.create(t);(this.controls.container||this.editor).appendChild(this.controls.dom),this.editorContainer&&(Jh.empty(this.editorContainer),this.editorContainer.appendChild(this.editor)),fa.formeoLoaded=new window.CustomEvent("formeoLoaded",{detail:{formeo:this}}),document.dispatchEvent(fa.formeoLoaded)}};const eu=t=>{const e=t.match(He);return(null==e?void 0:e[0])||t},nu=t=>t.replace(He,cs());let ou=class{constructor(t,n={}){e(this,"render",((t=this.form)=>{this.form=t;const e=document.getElementsByClassName("formeo-render").length,n={id:this.form.id,className:`formeo-render formeo formeo-rendered-${e}`,children:this.processedData};this.renderedForm=Jh.render(n),this.applyConditions();const o=this.container.querySelector(".formeo-render");o?o.replaceWith(this.renderedForm):this.container.appendChild(this.renderedForm)})),e(this,"orderChildren",((t,e)=>e.reduce(((e,n)=>(e.push(this.form[t][n]),e)),[]))),e(this,"prefixId",(t=>"f-"+t)),e(this,"processColumn",(({id:t,...e})=>({...e,id:this.prefixId(t),children:this.processFields(e.children),style:`width: ${e.config.width||"100%"}`}))),e(this,"processRows",(t=>this.orderChildren("rows",this.form.stages[t].children).reduce(((t,e)=>(e&&t.push(this.processRow(e)),t)),[]))),e(this,"cacheComponent",(t=>(this.components[eu(t.id)]=t,t))),e(this,"processRow",((t,e="row")=>{const{config:n,id:o}=t,i=[`formeo-${e}-wrap`],r={...t,children:this.processColumns(t.id),id:this.prefixId(o)};this.cacheComponent(r);const s=[{condition:n.legend,result:()=>({tag:n.fieldset?"legend":"h3",children:n.legend})},{condition:!0,result:()=>r},{condition:n.inputGroup,result:()=>this.addButton(o)}].reduce(((t,{condition:e,result:n})=>(e&&t.push(n()),t)),[]);return n.inputGroup&&i.push("f-input-group-wrap"),{tag:n.fieldset?"fieldset":"div",id:cs(),className:i,children:s}})),e(this,"cloneComponentData",(t=>{const{children:e=[],id:n,...o}=this.components[t];return Object.assign({},o,{id:nu(n),children:e.length&&e.map((({id:t})=>this.cloneComponentData(eu(t))))})})),e(this,"addButton",(t=>Jh.render({tag:"button",attrs:{className:"add-input-group btn pull-right",type:"button"},children:"Add +",action:{click:e=>{const n=e.target.parentElement,o=Jh.render(this.cloneComponentData(t));n.insertBefore(o,n.lastChild),o.appendChild(Jh.render(Jh.btnTemplate({className:"remove-input-group",children:Jh.icon("remove"),action:{mouseover:({target:t})=>t.parentElement.classList.add("will-remove"),mouseleave:({target:t})=>t.parentElement.classList.remove("will-remove"),click:({target:t})=>t.parentElement.remove()}})))}}}))),e(this,"processColumns",(t=>this.orderChildren("columns",this.form.rows[t].children).map((t=>this.cacheComponent(this.processColumn(t)))))),e(this,"processFieldsOrig",(t=>this.orderChildren("fields",t).map((({id:t,...e})=>this.cacheComponent(Object.assign({},e,{id:this.prefixId(t)})))))),e(this,"processFields",(t=>this.orderChildren("fields",t).map((({id:t,...e})=>{const{action:n={},dependencies:o={}}=this.elements[e.meta.id]||{};o&&gh(o);const i=ds({action:n},e);return this.cacheComponent({...i,id:this.prefixId(t)})})))),e(this,"applyConditions",(()=>{Object.values(this.components).forEach((({conditions:t})=>{t&&t.forEach(((t,e)=>{const{if:n,then:o}=t;n.forEach((t=>{const{source:e,...n}=t;if(fs(e)){this.getComponents(e).forEach((t=>{const e=iu(t);e&&t.addEventListener(e,(t=>this.evaluateCondition(n,t)&&o.forEach((e=>this.execResult(e,t)))),!1);const i={target:t};this.evaluateCondition(n,i)&&o.forEach((t=>this.execResult(t,i)))}))}}))}))}))})),e(this,"evaluateCondition",(({sourceProperty:t,targetProperty:e,comparison:n,target:o},i)=>{var r;const s={equals:Pl,notEquals:(t,e)=>!Pl(t,e),contains:(t,e)=>t.includes(e),notContains:(t,e)=>!t.includes(e)},a=String(i.target[t]),l=String(fs(o)?this.getComponent(o)[e]:o);return null==(r=s[n])?void 0:r.call(s,a,l)})),e(this,"execResult",(({assignment:t,target:e,targetProperty:n,value:o})=>{var i;const r={equals:t=>{var e;const i={value:()=>{t[n]=o},isNotVisible:()=>{t.parentElement.setAttribute("hidden",!0),t.required=!1},isVisible:()=>{t.parentElement.removeAttribute("hidden"),t.required=t._required}};null==(e=i[n])||e.call(i)}};if(fs(e)){const n=this.getComponent(e);n&&void 0===n._required&&(n._required=n.required),null==(i=r[t])||i.call(r,n)}})),e(this,"getComponent",(t=>{const e=t.slice(t.indexOf(".")+1);return gs(t)?this.external[e]:this.renderedForm.querySelector(`#f-${e}`)})),e(this,"getComponents",(t=>{const e=[],n=t.slice(t.indexOf(".")+1);return gs(t)?e.push(this.external[n]):e.push(...this.renderedForm.querySelectorAll(`[name=f-${n}]`)),e}));const{renderContainer:o,external:i,elements:r}=(({editorContainer:t,renderContainer:e,...n})=>{const o=t=>"string"==typeof t?document.querySelector(t):t;return{...n,renderContainer:o(e),editorContainer:o(t)}})(t);this.container=o,this.form=n,this.external=i,this.dom=Jh,this.components=Object.create(null),this.elements=r}get processedData(){return Object.values(this.form.stages).map((t=>(t.children=this.processRows(t.id),t.className=ae,Jh.render(t))))}};const iu=t=>{const[e]=[["input",t=>["textarea","text"].includes(t.type)],["change",t=>["select"].includes(t.tagName.toLowerCase())||["checkbox","radio"].includes(t.type)]].find((e=>e[1](t)))||[!1];return e};void 0!==window&&(window.FormeoEditor=tu,window.FormeoRenderer=ou);const ru=ou,su=new tu(r);((t,e)=>{const n=((t,e)=>({renderForm:()=>{te.style.display="block",e.render(t.formData)},logJSON:()=>{},viewData:()=>{Object.entries(t.formData).forEach((([t,e])=>{}))},resetEditor:()=>{window.sessionStorage.removeItem("formeo-formData"),window.location.reload()}}))(t,e);Object.entries(n).map((([t,e])=>{const n={id:t,type:"button"},o=Object.assign(document.createElement("button"),n),i=document.createTextNode(Kt(t));return o.appendChild(i),o.addEventListener("click",e,!1),Qt.appendChild(o),o}))})(su,new ru(s)),(t=>{const e=document.getElementById("control-filter"),n=document.getElementById("locale"),o=window.sessionStorage.getItem("formeo-locale");e.addEventListener("input",(({target:{value:e}})=>t.controls.actions.filter(e))),n.value=o||"en-US",n.addEventListener("change",(({target:{value:e}})=>{window.sessionStorage.setItem("formeo-locale",e),t.i18n.setLang(e)}),!1)})(su); diff --git a/assets/js/demo.min.js.gz b/assets/js/demo.min.js.gz new file mode 100644 index 00000000..1c8c1c47 Binary files /dev/null and b/assets/js/demo.min.js.gz differ diff --git a/assets/js/formeo.min.js b/assets/js/formeo.min.js index 0f788357..8f0a46fb 100644 --- a/assets/js/formeo.min.js +++ b/assets/js/formeo.min.js @@ -1,8 +1,14 @@ /** formeo - https://formeo.io -Version: 2.1.4 +Version: 2.1.5 Author: Draggable https://draggable.io */ -var t=Object.defineProperty,e=(e,n,o)=>((e,n,o)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o)(e,"symbol"!=typeof n?n+"":n,o),n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var i="object"==typeof n&&n&&n.Object===Object&&n,r=i,s="object"==typeof self&&self&&self.Object===Object&&self,a=r||s||Function("return this")(),l=a.Symbol;var c=function(t,e){for(var n=-1,o=null==t?0:t.length,i=Array(o);++n(t[e]=this.applyLanguage(e,n),t)),{}),this.locale=this.config.locale||this.config.langs[0]}init(t){return this.processConfig({...this.config,...t}),this.setCurrent(this.locale)}addLanguage(t,e={}){e="string"==typeof e?L.processFile(e):e,this.applyLanguage(t,e),this.config.langs.push("locale")}getValue(t,e=this.locale){var n;return(null==(n=this.langs[e])?void 0:n[t])||this.getFallbackValue(t)}getFallbackValue(t){const e=Object.values(this.langs).find((e=>e[t]));return null==e?void 0:e[t]}makeSafe(t){const e={"{":"\\{","}":"\\}","|":"\\|"};return t=t.replace(/[{}|]/g,(t=>e[t])),new RegExp(t,"g")}put(t,e){return this.current[t]=e,e}get(t,e){const n=this;let o=this.getValue(t);if(!o)return;const i=o.match(/\{[^}]+?\}/g);if(e&&i)if("object"==typeof e)for(const r of i){const t=r.substring(1,r.length-1);o=o.replace(n.makeSafe(r),e[t]||"")}else o=o.replace(/\{[^}]+?\}/g,e);return o}static processFile(t){return L.fromFile(t.replace(/\n\n/g,"\n"))}static fromFile(t){const e=t.split("\n"),n={};for(let o,i=0;i{const i=L.processFile(e);return n.applyLanguage(t,i),n.loaded.push(t),o(n.langs[t])})).catch((e=>{const i=n.applyLanguage(t);o(i)}))}))}applyLanguage(t,e={}){const n=this.config.override[t]||{},o=this.langs[t]||{};return this.langs[t]={...o,...e,...n},this.langs[t]}get getLangs(){return this.config.langs}async setCurrent(t="en-US"){return await this.loadLang(t),this.locale=t,this.current=this.langs[t],this.current}}const z=new L,$="formeo",H=[{name:"cssPreload",src:"//cdnjs.cloudflare.com/ajax/libs/loadCSS/2.0.1/cssrelpreload.min.js"},{name:"mutationObserver",src:"//cdn.jsdelivr.net/npm/mutationobserver-shim/dist/mutationobserver.min.js"},{name:"fetch",src:"https://unpkg.com/unfetch/polyfill"}],V="control-group",I=`${$}-stage`,F=`${$}-row`,R=`${$}-column`,B=`${$}-field`,W="custom-column-widths",q="column-preset",U="resizing-columns",G=new Map([[I,F],[F,R],[R,B]]),X=["external","stages","rows","columns","fields"],Y=["stage","row","column","field"].reduce(((t,e)=>({...t,[e]:e})),{}),Z=[{name:"controls",className:V},{name:"stage",className:I},{name:"row",className:F},{name:"column",className:R},{name:"field",className:B}],J={controls:V,stage:I,row:F,column:R,field:B},K=Object.entries(J).reduce(((t,[e,n])=>({...t,[n]:e})),{}),Q=Object.values(J),tt=new RegExp(`${Q.join("|")}`,"g"),et=Z.map((({name:t},e,n)=>{const{name:o}=n[e+1]||{};return o&&[t,o]})).filter(Boolean),nt=et.slice().map((t=>t.slice().reverse())).reverse(),ot=new Map(et),it=new Map(nt.slice()),rt=new Map([[{value:"100.0",label:"100%"}],[{value:"50.0,50.0",label:"50 | 50"},{value:"33.3,66.6",label:"33 | 66"},{value:"66.6,33.3",label:"66 | 33"}],[{value:"33.3,33.3,33.3",label:"33 | 33 | 33"},{value:"25.0,25.0,50.0",label:"25 | 25 | 50"},{value:"50.0,25.0,25.0",label:"50 | 25 | 25"},{value:"25.0,50.0,25.0",label:"25 | 50 | 25"}],[{value:"25.0,25.0,25.0,25.0",label:"25 | 25 | 25 | 25"}],[{value:"20.0,20.0,20.0,20.0,20.0",label:"20 | 20 | 20 | 20 | 20"}],[{value:"16.66,16.66,16.66,16.66,16.66,16.66",label:"16.66 | 16.66 | 16.66 | 16.66 | 16.66 | 16.66"}]].reduce(((t,e,n)=>(t.push([n,e]),t)),[])),st=[{type:"added",condition:(t,e)=>Boolean(void 0===t&&e)}],at=`${$}-formData`,lt=`${$}-locale`,ct=333,dt=Math.round(166.5),ht=Math.round(666),ut="formeoSaved",pt="formeoUpdated",mt="formeoOnRender",gt=["label","logical","source","thenTarget","sourceProperty","comparison","target","targetProperty","assignment","value"],ft={value:"attrs.value",checked:"attrs.checked",isVisible:"config.isVisible",isNotVisible:"config.isNotVisible"},vt={comparison:{equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},assignment:{equals:"="},logical:{and:"&&",or:"||"},property:ft},bt=/(\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b)/gi,yt=/\bcol-\w+-\d+/g,wt="f-i-";var xt=function(){this.__data__=[],this.size=0};var Ct=function(t,e){return t===e||t!=t&&e!=e},St=Ct;var Et=function(t,e){for(var n=t.length;n--;)if(St(t[n][0],e))return n;return-1},Ot=Et,Mt=Array.prototype.splice;var Nt=Et;var _t=Et;var At=Et;var Dt=xt,kt=function(t){var e=this.__data__,n=Ot(e,t);return!(n<0)&&(n==e.length-1?e.pop():Mt.call(e,n,1),--this.size,!0)},Tt=function(t){var e=this.__data__,n=Nt(e,t);return n<0?void 0:e[n][1]},jt=function(t){return _t(this.__data__,t)>-1},Pt=function(t,e){var n=this.__data__,o=At(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};function Lt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=9007199254740991},Wn=Ut,qn=Bn;var Un=function(t){return null!=t&&qn(t.length)&&!Wn(t)},Gn=Un,Xn=C;var Yn=function(t){return Xn(t)&&Gn(t)},Zn={exports:{}};var Jn=function(){return!1};!function(t,e){var n=a,o=Jn,i=e&&!e.nodeType&&e,r=i&&t&&!t.nodeType&&t,s=r&&r.exports===i?n.Buffer:void 0,l=(s?s.isBuffer:void 0)||o;t.exports=l}(Zn,Zn.exports);var Kn=Zn.exports,Qn=x,to=_n,eo=C,no=Function.prototype,oo=Object.prototype,io=no.toString,ro=oo.hasOwnProperty,so=io.call(Object);var ao=function(t){if(!eo(t)||"[object Object]"!=Qn(t))return!1;var e=to(t);if(null===e)return!0;var n=ro.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&io.call(n)==so},lo=x,co=Bn,ho=C,uo={};uo["[object Float32Array]"]=uo["[object Float64Array]"]=uo["[object Int8Array]"]=uo["[object Int16Array]"]=uo["[object Int32Array]"]=uo["[object Uint8Array]"]=uo["[object Uint8ClampedArray]"]=uo["[object Uint16Array]"]=uo["[object Uint32Array]"]=!0,uo["[object Arguments]"]=uo["[object Array]"]=uo["[object ArrayBuffer]"]=uo["[object Boolean]"]=uo["[object DataView]"]=uo["[object Date]"]=uo["[object Error]"]=uo["[object Function]"]=uo["[object Map]"]=uo["[object Number]"]=uo["[object Object]"]=uo["[object RegExp]"]=uo["[object Set]"]=uo["[object String]"]=uo["[object WeakMap]"]=!1;var po=function(t){return ho(t)&&co(t.length)&&!!uo[lo(t)]};var mo=function(t){return function(e){return t(e)}},go={exports:{}};!function(t,e){var n=i,o=e&&!e.nodeType&&e,r=o&&t&&!t.nodeType&&t,s=r&&r.exports===o&&n.process,a=function(){try{var t=r&&r.require&&r.require("util").types;return t||s&&s.binding&&s.binding("util")}catch(e){}}();t.exports=a}(go,go.exports);var fo=go.exports,vo=po,bo=mo,yo=fo&&fo.isTypedArray,wo=yo?bo(yo):vo;var xo=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},Co=rn,So=Ct,Eo=Object.prototype.hasOwnProperty;var Oo=function(t,e,n){var o=t[e];Eo.call(t,e)&&So(o,n)&&(void 0!==n||e in t)||Co(t,e,n)},Mo=Oo,No=rn;var _o=function(t,e,n,o){var i=!n;n||(n={});for(var r=-1,s=e.length;++r-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Ei),Ni=bi,_i=xi,Ai=Mi;var Di=Ct,ki=Un,Ti=Do,ji=Rt;var Pi=function(t,e){return Ai(_i(t,e,Ni),t+"")},Li=function(t,e,n){if(!ji(n))return!1;var o=typeof e;return!!("number"==o?ki(n)&&Ti(e,n.length):"string"==o&&e in n)&&Di(n[e],t)};var zi=vi;const $i=o(function(t){return Pi((function(e,n){var o=-1,i=n.length,r=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(r=t.length>3&&"function"==typeof r?(i--,r):void 0,s&&Li(n[0],n[1],s)&&(r=i<3?void 0:r,i=1),e=Object(e);++ocrypto.randomUUID(),Vi=(t="",e)=>{if(!e)return!1;const n=/[|\\{}()[\]^*$+?.]/g;let o="string"==typeof e?[e]:e;o=o.map((t=>"*"===t?"":t.replace(n,"\\$&")));let i=!0;return o.length&&(i=!new RegExp(o.join("|"),"i").exec(t)),i},Ii=t=>{var e;const n=null==(e=t.className)?void 0:e.match(tt);return n&&K[n[0]]},Fi=t=>Array.from(new Set(t)),Ri=t=>{let e;if(t){const{attrs:n={}}=t;e=n.id||t.id||Hi(),t.id=e}else e=Hi();return e},Bi=(t,e,n=Object.create(null))=>$i({},t,e,((t,e)=>{if(Array.isArray(t))return Array.isArray(e)?Fi(n.mergeArray?t.concat(e):e):e})),Wi=t=>{let e;if(null===t||!("object"==typeof t)||t instanceof Promise)return t;if(t instanceof Date)return e=new Date,e.setTime(t.getTime()),e;if(Array.isArray(t)){e=[];for(let n=0,o=t.length;nt/e*100,Ui=t=>`${t.toString()}%`,Gi=Object.create(null,{get:{value:t=>{var e;const n=null==(e=window.sessionStorage)?void 0:e.getItem(t);try{return JSON.parse(n)}catch(o){return n}}},set:{value:(t,e)=>{var n;try{return null==(n=window.sessionStorage)?void 0:n.setItem(t,JSON.stringify(e))}catch(o){}}}}),Xi=t=>X.some((e=>new RegExp(`^${e}.`).test(t))),Yi=t=>t.startsWith("external");function Zi(t,e){let n=!1;return function(){if(!n){t(...arguments),n=!0;const o=setTimeout((()=>{n=!1,clearTimeout(o)}),e)}}}function Ji(t){return t}function Ki(){}var Qi=d,tr=O,er=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nr=/^\w*$/;var or=function(t,e){if(Qi(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!tr(t))||(nr.test(t)||!er.test(t)||null!=e&&t in Object(e))},ir=Be;function rr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var o=arguments,i=e?e.apply(this,o):o[0],r=n.cache;if(r.has(i))return r.get(i);var s=t.apply(this,o);return n.cache=r.set(i,s)||r,s};return n.cache=new(rr.Cache||ir),n}rr.Cache=ir;var sr=rr;var ar=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,lr=/\\(\\)?/g,cr=function(t){var e=sr(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(ar,(function(t,n,o,i){e.push(o?i.replace(lr,"$1"):n||t)})),e})),dr=d,hr=or,ur=cr,pr=j;var mr=function(t,e){return dr(t)?t:hr(t,e)?[t]:ur(pr(t))},gr=O;var fr=function(t){if("string"==typeof t||gr(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e},vr=Oo,br=mr,yr=Do,wr=Rt,xr=fr;var Cr=function(t,e,n,o){if(!wr(t))return t;for(var i=-1,r=(e=br(e,t)).length,s=r-1,a=t;null!=a&&++i{const e={...t},n={string:()=>"",boolean:()=>!1,object:t=>Ar(t)};for(const o of Object.keys(t)){const i=typeof t[o];n[i]&&(e[o]=n[i](t[o]))}return e},Dr="a an and as at but by for for from in into near nor of on onto or the to with".split(" ").map((t=>`\\s${t}\\s`)),kr=new RegExp(`(?!${Dr.join("|")})\\w\\S*`,"g"),Tr=/\s+/g;function jr(t){if("string"!=typeof t)return t;if(t.trim().match(Tr))return t;return t.replace(kr,(t=>t.charAt(0).toUpperCase()+t.substring(1).replace(/[A-Z]/g,(t=>` ${t}`))))}const Pr=(t,e="-")=>t.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,e),Lr=t=>Number.isInteger(Number(t)),zr=(t,e)=>{const n=e||t.parentElement;return Array.prototype.slice.call(n.childNodes).indexOf(t)},$r=(t,e,n)=>{const o=n.split("||"),i=Fi(e).map((e=>t.find((t=>{const n=o.find((e=>!!Nr(t,e)));return n&&Nr(t,n)===e})))).filter(Boolean).concat(t);return Fi(i)},Hr=(t,e,n)=>{for(let o=0;o{const n=[];return Hr(t,((t,o)=>n.push(e(t,o)))),n},Ir={},Fr=t=>t.replace(/\b\w/g,(t=>t.toUpperCase())),Rr=()=>-1!==window.navigator.userAgent.indexOf("MSIE "),Br={capitalize:Fr,safeAttrName:t=>{if(Ir[t])return Ir[t];const e=({className:"class"}[t]||t).replace(/^\d/,"").replace(/[^a-zA-Z0-9-:]/g,"");return Ir[t]=e,e},forEach:Hr,copyObj:t=>window.JSON.parse(window.JSON.stringify(t)),map:Vr,subtract:(t,e)=>e.filter((e=>!~t.indexOf(e))),indexOfNode:zr,isInt:Lr,get:Nr,orderObjectsBy:$r,isIE:Rr},Wr={getStyle:(t,e=!1)=>{let n;return window.getComputedStyle?n=window.getComputedStyle(t,null):t.currentStyle&&(n=t.currentStyle),e?n[e]:n},fadeOut:(t,e=250)=>{const n=1/(e/60);t.style.opacity=1,function e(){const o=Number(t.style.opacity)-n;o>0?(t.style.opacity=o,window.requestAnimationFrame(e)):t.remove()}()},slideDown:(t,e=250,n=!1)=>{t.style.display="block";const o=Wr.getStyle(t),i=parseInt(o.height,10),r=i/(e/60);t.style.height="0px",function e(){const o=parseFloat(t.style.height),s=o+r;o{const o=Wr.getStyle(t),i=parseInt(o.height),r=o.overflow;t.style.overflow="hidden",t.style.height=i+"px";const s=o.minHeight;t.style.minHeight="auto";const a=parseFloat(i/(e/60)).toFixed(2);!function e(){const o=parseInt(t.style.height,10)-a;o>0?(t.style.height=o+"px",window.requestAnimationFrame(e)):(t.style.overflow=r,t.style.display="none",t.style.minHeight=s,delete t.style.height,n&&n(t))}()},slideToggle:(t,e=250,n="none"===Wr.getStyle(t,"display"))=>{n?Wr.slideDown(t,e):Wr.slideUp(t,e)}},qr="no-transition",Ur={debug:!1,bubbles:!0,formeoLoaded:t=>{},onAdd:()=>{},onUpdate:t=>Xr.opts.debug&&void 0,onUpdateStage:t=>Xr.opts.debug&&void 0,onUpdateRow:t=>Xr.opts.debug&&void 0,onUpdateColumn:t=>Xr.opts.debug&&void 0,onUpdateField:t=>Xr.opts.debug&&void 0,onRender:t=>Xr.opts.debug&&void 0,onSave:t=>{},confirmClearAll:t=>{window.confirm(t.confirmationMessage)&&t.clearAllAction(t)}},Gr=({src:t,...e},n=pt)=>{const o=new window.CustomEvent(n,{detail:e,bubbles:Xr.opts.debug||Xr.opts.bubbles});return o.data=(t||document).dispatchEvent(o),o},Xr={init:function(t){return this.opts={...Ur,...t},this},formeoSaved:t=>Gr(t,ut),formeoUpdated:t=>Gr(t,pt),formeoCleared:t=>Gr(t,"formeoCleared"),formeoOnRender:t=>Gr(t,mt),formeoConditionUpdated:t=>Gr(t,"formeoConditionUpdated")},Yr=Zi((()=>{Xr.opts.onUpdate({timeStamp:window.performance.now(),type:pt,detail:_d.formData})}),dt);let Zr;document.addEventListener(pt,Yr),document.addEventListener("formeoUpdatedStage",(t=>{const{timeStamp:e,type:n,detail:o}=t;Xr.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedRow",(t=>{const{timeStamp:e,type:n,detail:o}=t;Xr.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedColumn",(t=>{const{timeStamp:e,type:n,detail:o}=t;Xr.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedField",(t=>{const{timeStamp:e,type:n,detail:o}=t;Xr.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener(mt,(t=>{const{timeStamp:e,type:n,detail:o}=t;Xr.opts.onRender({timeStamp:e,type:n,detail:o})})),document.addEventListener("confirmClearAll",(t=>{t={timeStamp:t.timeStamp,type:t.type,confirmationMessage:t.detail.confirmationMessage,clearAllAction:t.detail.clearAllAction,btnCoords:t.detail.btnCoords},Xr.opts.confirmClearAll(t)})),document.addEventListener(ut,(({timeStamp:t,type:e,detail:{formData:n}})=>{const o={timeStamp:t,type:e,formData:n};Xr.opts.onSave(o)})),document.addEventListener("formeoLoaded",(t=>{Xr.opts.formeoLoaded(t.detail.formeo)})),window.addEventListener("resize",(function(){Zr=Zr||window.requestAnimationFrame((()=>{Zr=!1,Object.values(Sd.data).forEach((t=>{t.dom.classList.add(qr),Od.dom.classList.add(qr),Od.panels.nav.refresh(),t.refreshFieldPanels()}))}))}));var Jr=Be,Kr=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Qr=function(t){return this.__data__.has(t)};function ts(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Jr;++ea))return!1;var c=r.get(t),d=r.get(e);if(c&&d)return c==e&&d==t;var h=-1,u=!0,p=2&n?new es:void 0;for(r.set(t,e),r.set(e,t);++hJSON.stringify(t,null,e))),e(this,"get",(t=>Nr(this.data,t))),e(this,"getChangeType",((t,e)=>{const n=st.find((({condition:n})=>n(t,e)))||{type:"unknown"};return n.desc="added"===n.type?`${t} to ${e}`:e,n})),e(this,"add",((t,e=Object.create(null))=>{const{id:n}=e,o=t||n||Ri();return this.set(o,e)})),e(this,"remove",(t=>{const e=t.split("."),n=e.pop(),o=this.get(e);return Array.isArray(o)?o.splice(Number(n),1):delete o[n],o})),e(this,"getData",(()=>Object.entries(this.data).reduce(((t,[e,n])=>(t[e]=(null==n?void 0:n.data)?n.getData():n,t)),{}))),e(this,"setCallbacks",{}),e(this,"configVal",Object.create(null)),this.name=t,this.data=n,this.dataPath=""}get size(){return Object.keys(this.data).length}get js(){return this.data}get json(){return this.data}set(t,e){const n=Nr(this.data,t);if(ma(n,e))return this.data;const o=_r(this.data,t,e),i=Array.isArray(t)?t.join("."):t,r=Object.keys(this.setCallbacks).filter((t=>new RegExp(t).test(i))),s={newVal:e,oldVal:n,path:t};for(const a of r)for(const t of this.setCallbacks[a])t(s);if(!this.disableEvents){const i=this.getChangeType(n,e),r={entity:this,dataPath:this.dataPath.replace(/\.+$/,""),changePath:this.dataPath+t,value:e,data:o,change:`${i.type}: ${i.desc}`,src:this.dom};n&&(r.previousValue=n),Xr.formeoUpdated(r)}return o}addSetCallback(t,e){this.setCallbacks[t]?this.setCallbacks[t].push(e):this.setCallbacks[t]=[e]}removeSetCallback(t,e){this.setCallbacks[t]=this.setCallbacks[t].filter((t=>t!==e))}empty(){this.data=Object.create(null)}}function fa(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function va(t){for(var e=1;e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Ca(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var Sa=Ca(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ea=Ca(/Edge/i),Oa=Ca(/firefox/i),Ma=Ca(/safari/i)&&!Ca(/chrome/i)&&!Ca(/android/i),Na=Ca(/iP(ad|od|hone)/i),_a=Ca(/chrome/i)&&Ca(/android/i),Aa={capture:!1,passive:!1};function Da(t,e,n){t.addEventListener(e,n,!Sa&&Aa)}function ka(t,e,n){t.removeEventListener(e,n,!Sa&&Aa)}function Ta(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(n){return!1}return!1}}function ja(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function Pa(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&Ta(t,e):Ta(t,e))||o&&t===n)return t;if(t===n)break}while(t=ja(t))}return null}var La,za=/\s+/g;function $a(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(za," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(za," ")}}function Ha(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function Va(t,e){var n="";if("string"==typeof t)n=t;else do{var o=Ha(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Ia(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i=Ra(o)[n]))return o;if(o===Fa())break;o=Xa(o,!1)}return!1}function Wa(t,e,n,o){for(var i=0,r=0,s=t.children;r2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,i=xa(n,rl);il.pluginEvent.bind(Kl)(t,e,va({dragEl:ll,parentEl:cl,ghostEl:dl,rootEl:hl,nextEl:ul,lastDownEl:pl,cloneEl:ml,cloneHidden:gl,dragStarted:_l,putSortable:xl,activeSortable:Kl.active,originalEvent:o,oldIndex:fl,oldDraggableIndex:bl,newIndex:vl,newDraggableIndex:yl,hideGhostForTarget:Xl,unhideGhostForTarget:Yl,cloneNowHidden:function(){gl=!0},cloneNowShown:function(){gl=!1},dispatchSortableEvent:function(t){al({sortable:e,name:t,originalEvent:o})}},i))};function al(t){!function(t){var e=t.sortable,n=t.rootEl,o=t.name,i=t.targetEl,r=t.cloneEl,s=t.toEl,a=t.fromEl,l=t.oldIndex,c=t.newIndex,d=t.oldDraggableIndex,h=t.newDraggableIndex,u=t.originalEvent,p=t.putSortable,m=t.extraEventProperties;if(e=e||n&&n[tl]){var g,f=e.options,v="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||Sa||Ea?(g=document.createEvent("Event")).initEvent(o,!0,!0):g=new CustomEvent(o,{bubbles:!0,cancelable:!0}),g.to=s||n,g.from=a||n,g.item=i||n,g.clone=r,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=d,g.newDraggableIndex=h,g.originalEvent=u,g.pullMode=p?p.lastPutMode:void 0;var b=va(va({},m),il.getEventProperties(o,e));for(var y in b)g[y]=b[y];n&&n.dispatchEvent(g),f[v]&&f[v].call(e,g)}}(va({putSortable:xl,cloneEl:ml,targetEl:ll,rootEl:hl,oldIndex:fl,oldDraggableIndex:bl,newIndex:vl,newDraggableIndex:yl},t))}var ll,cl,dl,hl,ul,pl,ml,gl,fl,vl,bl,yl,wl,xl,Cl,Sl,El,Ol,Ml,Nl,_l,Al,Dl,kl,Tl,jl=!1,Pl=!1,Ll=[],zl=!1,$l=!1,Hl=[],Vl=!1,Il=[],Fl="undefined"!=typeof document,Rl=Na,Bl=Ea||Sa?"cssFloat":"float",Wl=Fl&&!_a&&!Na&&"draggable"in document.createElement("div"),ql=function(){if(Fl){if(Sa)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Ul=function(t,e){var n=Ha(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=Wa(t,0,e),r=Wa(t,1,e),s=i&&Ha(i),a=r&&Ha(r),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+Ra(i).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Ra(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&s.float&&"none"!==s.float){var d="left"===s.float?"left":"right";return!r||"both"!==a.clear&&a.clear!==d?"horizontal":"vertical"}return i&&("block"===s.display||"flex"===s.display||"table"===s.display||"grid"===s.display||l>=o&&"none"===n[Bl]||r&&"none"===n[Bl]&&l+c>o)?"vertical":"horizontal"},Gl=function(t){function e(t,n){return function(o,i,r,s){var a=o.options.group.name&&i.options.group.name&&o.options.group.name===i.options.group.name;if(null==t&&(n||a))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(o,i,r,s),n)(o,i,r,s);var l=(n?o:i).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var n={},o=t.group;o&&"object"==ba(o)||(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n},Xl=function(){!ql&&dl&&Ha(dl,"display","none")},Yl=function(){!ql&&dl&&Ha(dl,"display","")};Fl&&!_a&&document.addEventListener("click",(function(t){if(Pl)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Pl=!1,!1}),!0);var Zl=function(t){if(ll){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,Ll.some((function(t){var e=t[tl].options.emptyInsertThreshold;if(e&&!qa(t)){var n=Ra(t),o=i>=n.left-e&&i<=n.right+e,a=r>=n.top-e&&r<=n.bottom+e;return o&&a?s=t:void 0}})),s);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[tl]._onDragOver(n)}}var i,r,s},Jl=function(t){ll&&ll.parentNode[tl]._isOutsideThisEl(t.target)};function Kl(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=wa({},e),t[tl]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Ul(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Kl.supportPointer&&"PointerEvent"in window&&!Ma,emptyInsertThreshold:5};for(var o in il.initializePlugins(this,t,n),n)!(o in e)&&(e[o]=n[o]);for(var i in Gl(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&Wl,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Da(t,"pointerdown",this._onTapStart):(Da(t,"mousedown",this._onTapStart),Da(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Da(t,"dragover",this),Da(t,"dragenter",this)),Ll.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),wa(this,el())}function Ql(t,e,n,o,i,r,s,a){var l,c,d=t[tl],h=d.options.onMove;return!window.CustomEvent||Sa||Ea?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=n,l.draggedRect=o,l.related=i||e,l.relatedRect=r||Ra(e),l.willInsertAfter=a,l.originalEvent=s,t.dispatchEvent(l),h&&(c=h.call(d,l,s)),c}function tc(t){t.draggable=!1}function ec(){Vl=!1}function nc(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function oc(t){return setTimeout(t,0)}function ic(t){return clearTimeout(t)}Kl.prototype={constructor:Kl,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(Al=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,ll):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,i=o.preventOnFilter,r=t.type,s=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,a=(s||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,c=o.filter;if(function(t){Il.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&Il.push(o)}}(n),!ll&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!Ma||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=Pa(a,o.draggable,n,!1))&&a.animated||pl===a)){if(fl=Ua(a),bl=Ua(a,o.draggable),"function"==typeof c){if(c.call(this,t,a,this))return al({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),sl("filter",e,{evt:t}),void(i&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=Pa(l,o.trim(),n,!1))return al({sortable:e,rootEl:o,name:"filter",targetEl:a,fromEl:n,toEl:n}),sl("filter",e,{evt:t}),!0}))))return void(i&&t.cancelable&&t.preventDefault());o.handle&&!Pa(l,o.handle,n,!1)||this._prepareDragStart(t,s,a)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,s=i.options,a=r.ownerDocument;if(n&&!ll&&n.parentNode===r){var l=Ra(n);if(hl=r,cl=(ll=n).parentNode,ul=ll.nextSibling,pl=n,wl=s.group,Kl.dragged=ll,Cl={target:ll,clientX:(e||t).clientX,clientY:(e||t).clientY},Ml=Cl.clientX-l.left,Nl=Cl.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,ll.style["will-change"]="all",o=function(){sl("delayEnded",i,{evt:t}),Kl.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!Oa&&i.nativeDraggable&&(ll.draggable=!0),i._triggerDragStart(t,e),al({sortable:i,name:"choose",originalEvent:t}),$a(ll,s.chosenClass,!0))},s.ignore.split(",").forEach((function(t){Ia(ll,t.trim(),tc)})),Da(a,"dragover",Zl),Da(a,"mousemove",Zl),Da(a,"touchmove",Zl),Da(a,"mouseup",i._onDrop),Da(a,"touchend",i._onDrop),Da(a,"touchcancel",i._onDrop),Oa&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ll.draggable=!0),sl("delayStart",this,{evt:t}),!s.delay||s.delayOnTouchOnly&&!e||this.nativeDraggable&&(Ea||Sa))o();else{if(Kl.eventCanceled)return void this._onDrop();Da(a,"mouseup",i._disableDelayedDrag),Da(a,"touchend",i._disableDelayedDrag),Da(a,"touchcancel",i._disableDelayedDrag),Da(a,"mousemove",i._delayedDragTouchMoveHandler),Da(a,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&Da(a,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,s.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ll&&tc(ll),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;ka(t,"mouseup",this._disableDelayedDrag),ka(t,"touchend",this._disableDelayedDrag),ka(t,"touchcancel",this._disableDelayedDrag),ka(t,"mousemove",this._delayedDragTouchMoveHandler),ka(t,"touchmove",this._delayedDragTouchMoveHandler),ka(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?Da(document,"pointermove",this._onTouchMove):Da(document,e?"touchmove":"mousemove",this._onTouchMove):(Da(ll,"dragend",this),Da(hl,"dragstart",this._onDragStart));try{document.selection?oc((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(t,e){if(jl=!1,hl&&ll){sl("dragStarted",this,{evt:e}),this.nativeDraggable&&Da(document,"dragover",Jl);var n=this.options;!t&&$a(ll,n.dragClass,!1),$a(ll,n.ghostClass,!0),Kl.active=this,t&&this._appendGhost(),al({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Sl){this._lastX=Sl.clientX,this._lastY=Sl.clientY,Xl();for(var t=document.elementFromPoint(Sl.clientX,Sl.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Sl.clientX,Sl.clientY))!==e;)e=t;if(ll.parentNode[tl]._isOutsideThisEl(t),e)do{if(e[tl]){if(e[tl]._onDragOver({clientX:Sl.clientX,clientY:Sl.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=ja(e));Yl()}},_onTouchMove:function(t){if(Cl){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=dl&&Va(dl,!0),s=dl&&r&&r.a,a=dl&&r&&r.d,l=Rl&&Tl&&Ga(Tl),c=(i.clientX-Cl.clientX+o.x)/(s||1)+(l?l[0]-Hl[0]:0)/(s||1),d=(i.clientY-Cl.clientY+o.y)/(a||1)+(l?l[1]-Hl[1]:0)/(a||1);if(!Kl.active&&!jl){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))i.right+r||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>i.bottom+r||t.clientX>o.right&&t.clientY>o.top}(t,i,this)&&!g.animated){if(g===ll)return k(!1);if(g&&r===t.target&&(s=g),s&&(n=Ra(s)),!1!==Ql(hl,r,ll,e,s,n,t,!!s))return D(),g&&g.nextSibling?r.insertBefore(ll,g.nextSibling):r.appendChild(ll),cl=r,T(),k(!0)}else if(g&&function(t,e,n){var o=Ra(Wa(n.el,0,n.options,!0)),i=Qa(n.el,n.options,dl),r=10;return e?t.clientXd+c*r/2:lh-kl)return-Dl}else if(l>d+c*(1-i)/2&&lh-c*r/2))return l>d+c/2?1:-1;return 0}(t,s,n,i,x?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,$l,Al===s),0!==v){var O=Ua(ll);do{O-=v,y=cl.children[O]}while(y&&("none"===Ha(y,"display")||y===dl))}if(0===v||y===s)return k(!1);Al=s,Dl=v;var M=s.nextElementSibling,N=!1,_=Ql(hl,r,ll,e,s,n,t,N=1===v);if(!1!==_)return 1!==_&&-1!==_||(N=1===_),Vl=!0,setTimeout(ec,30),D(),N&&!M?r.appendChild(ll):s.parentNode.insertBefore(ll,N?M:s),S&&Ja(S,0,E-S.scrollTop),cl=ll.parentNode,void 0===b||$l||(kl=Math.abs(b-Ra(s)[C])),T(),k(!0)}if(r.contains(ll))return k(!1)}return!1}function A(a,l){sl(a,p,va({evt:t,isOwner:d,axis:i?"vertical":"horizontal",revert:o,dragRect:e,targetRect:n,canSort:h,fromSortable:u,target:s,completed:k,onMove:function(n,o){return Ql(hl,r,ll,e,n,Ra(n),t,o)},changed:T},l))}function D(){A("dragOverAnimationCapture"),p.captureAnimationState(),p!==u&&u.captureAnimationState()}function k(e){return A("dragOverCompleted",{insertion:e}),e&&(d?c._hideClone():c._showClone(p),p!==u&&($a(ll,xl?xl.options.ghostClass:c.options.ghostClass,!1),$a(ll,a.ghostClass,!0)),xl!==p&&p!==Kl.active?xl=p:p===Kl.active&&xl&&(xl=null),u===p&&(p._ignoreWhileAnimating=s),p.animateAll((function(){A("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==u&&(u.animateAll(),u._ignoreWhileAnimating=null)),(s===ll&&!ll.animated||s===r&&!s.animated)&&(Al=null),a.dragoverBubble||t.rootEl||s===document||(ll.parentNode[tl]._isOutsideThisEl(t.target),!e&&Zl(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),m=!0}function T(){vl=Ua(ll),yl=Ua(ll,a.draggable),al({sortable:p,name:"change",toEl:r,newIndex:vl,newDraggableIndex:yl,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){ka(document,"mousemove",this._onTouchMove),ka(document,"touchmove",this._onTouchMove),ka(document,"pointermove",this._onTouchMove),ka(document,"dragover",Zl),ka(document,"mousemove",Zl),ka(document,"touchmove",Zl)},_offUpEvents:function(){var t=this.el.ownerDocument;ka(t,"mouseup",this._onDrop),ka(t,"touchend",this._onDrop),ka(t,"pointerup",this._onDrop),ka(t,"touchcancel",this._onDrop),ka(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;vl=Ua(ll),yl=Ua(ll,n.draggable),sl("drop",this,{evt:t}),cl=ll&&ll.parentNode,vl=Ua(ll),yl=Ua(ll,n.draggable),Kl.eventCanceled||(jl=!1,$l=!1,zl=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),ic(this.cloneId),ic(this._dragStartId),this.nativeDraggable&&(ka(document,"drop",this),ka(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ma&&Ha(document.body,"user-select",""),Ha(ll,"transform",""),t&&(_l&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),dl&&dl.parentNode&&dl.parentNode.removeChild(dl),(hl===cl||xl&&"clone"!==xl.lastPutMode)&&ml&&ml.parentNode&&ml.parentNode.removeChild(ml),ll&&(this.nativeDraggable&&ka(ll,"dragend",this),tc(ll),ll.style["will-change"]="",_l&&!jl&&$a(ll,xl?xl.options.ghostClass:this.options.ghostClass,!1),$a(ll,this.options.chosenClass,!1),al({sortable:this,name:"unchoose",toEl:cl,newIndex:null,newDraggableIndex:null,originalEvent:t}),hl!==cl?(vl>=0&&(al({rootEl:cl,name:"add",toEl:cl,fromEl:hl,originalEvent:t}),al({sortable:this,name:"remove",toEl:cl,originalEvent:t}),al({rootEl:cl,name:"sort",toEl:cl,fromEl:hl,originalEvent:t}),al({sortable:this,name:"sort",toEl:cl,originalEvent:t})),xl&&xl.save()):vl!==fl&&vl>=0&&(al({sortable:this,name:"update",toEl:cl,originalEvent:t}),al({sortable:this,name:"sort",toEl:cl,originalEvent:t})),Kl.active&&(null!=vl&&-1!==vl||(vl=fl,yl=bl),al({sortable:this,name:"end",toEl:cl,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){sl("nulling",this),hl=ll=cl=dl=ul=ml=pl=gl=Cl=Sl=_l=vl=yl=fl=bl=Al=Dl=xl=wl=Kl.dragged=Kl.ghost=Kl.clone=Kl.active=null,Il.forEach((function(t){t.checked=!0})),Il.length=El=Ol=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":ll&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,i=n.length,r=this.options;o{const e=window.prompt(t.message.attr);if(e&&t.isDisabled(e))return window.alert(z.get("attributeNotPermitted",e||"")),wc.add.attrs(t);let n;e&&(n=String(window.prompt(t.message.value,"")),t.addAction(e,n))},option:t=>{t.addAction()},condition:t=>{t.addAction(t)}},click:{btn:t=>{t.action()}},save:{form:Ji}},wc={init:function(t){const e=Object.keys(yc);return this.opts=e.reduce(((e,n)=>(e[n]={...yc[n],...t[n]},e)),t),this},add:{attrs:t=>wc.opts.add.attr(t),options:t=>wc.opts.add.option(t),conditions:t=>(t.template={if:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],then:[{target:"",targetProperty:"",assignment:"",value:""}]},wc.opts.add.condition(t))},click:{btn:t=>wc.opts.click.btn(t)},save:{form:t=>(wc.opts.sessionStorage&&Gi.set(at,t),Xr.formeoSaved({formData:t}),wc.opts.save.form(t))}},xc=Object.freeze({type:"field",displayType:"slider"}),Cc=t=>({transform:`translateX(${t?`${t}px`:0})`});class Sc{constructor(t){e(this,"toggleTabbedLayout",(()=>{this.getPanelDisplay();const t=this.isTabbed;return this.panelsWrap.parentElement.classList.toggle("tabbed-panels",t),t&&this.panelNav.removeAttribute("style"),t})),e(this,"resizePanels",(()=>{this.toggleTabbedLayout();const t=this.panelsWrap.style,e=Dd.getStyle(this.currentPanel,"height");return t.height=e,e})),this.opts=Bi(xc,t),this.panelDisplay=this.opts.displayType,this.activePanelIndex=0,this.panelNav=this.createPanelNav();const n=this.createPanelsWrap();this.nav=this.navActions();const o=new window.ResizeObserver((([{contentRect:{width:t}}])=>{this.currentWidth!==t&&(this.toggleTabbedLayout(),this.currentWidth=t,this.nav.setTranslateX(this.activePanelIndex,!1))})),i=window.setTimeout((()=>{o.observe(n),window.clearTimeout(i)}),ht)}getPanelDisplay(){const t=this.panelsWrap,e=Number.parseInt(Dd.getStyle(t,"width"))>390?"tabbed":"slider",n="auto"===this.opts.displayType;return this.panelDisplay=n?e:this.opts.displayType||xc.displayType,this.panelDisplay}createPanelsWrap(){const t=Dd.create({className:"panels",content:this.opts.panels.map((({config:t,...e})=>e))});return"field"===this.opts.type&&this.sortableProperties(t),this.panelsWrap=t,this.panels=t.children,this.currentPanel=this.panels[this.activePanelIndex],t}sortableProperties(t){const e=t.getElementsByClassName("field-edit-group");return Br.forEach(e,(t=>{t.fieldId=this.opts.id,t.isSortable&&Kl.create(t,{animation:150,group:{name:`edit-${t.editGroup}`,pull:!0,put:["properties"]},sort:!0,handle:".prop-order",onSort:t=>{this.propertySave(t.to),this.resizePanels()}})}))}createPanelNavLabels(){const t=this.opts.panels.map((t=>({tag:"h5",action:{click:t=>{const e=zr(t.target,t.target.parentElement);this.currentPanel=this.panels[e];const n=t.target.parentElement.childNodes;this.nav.refresh(e),Dd.removeClasses(n,"active-tab"),t.target.classList.add("active-tab")}},content:t.config.label}))),e={className:"panel-labels",content:{content:t}},[n]=t;return n.className="active-tab",Dd.create(e)}createPanelNav(){this.labels=this.createPanelNavLabels();const t={tag:"button",attrs:{className:"next-group",title:z.get("controlGroups.nextGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:t=>this.nav.nextGroup(t)},content:Dd.icon("triangle-right")},e={tag:"button",attrs:{className:"prev-group",title:z.get("controlGroups.prevGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:t=>this.nav.prevGroup(t)},content:Dd.icon("triangle-left")};return Dd.create({tag:"nav",attrs:{className:"panel-nav"},content:[e,this.labels,t]})}get isTabbed(){return"tabbed"===this.panelDisplay}navActions(){const t={},e=this.currentPanel.parentElement,n=this.labels.firstChild,o=this.currentPanel.parentElement.childNodes;this.activePanelIndex=zr(this.currentPanel,e);let i={nav:0,panel:0},r={...i};t.groupChange=t=>{const e=n.children;return Dd.removeClasses(o,"active-panel"),Dd.removeClasses(e,"active-tab"),this.currentPanel=o[t],this.currentPanel.classList.add("active-panel"),e[t].classList.add("active-tab"),this.currentPanel};const s=({offset:t,reset:o,duration:i=dt,animate:s=!this.isTabbed})=>{const a=[Cc(r.panel),Cc(t.panel)],l=[Cc(r.nav),Cc(this.isTabbed?0:t.nav)];if(o){const[t]=a,[e]=l;a.push(t),l.push(e)}const c={easing:"ease-in-out",duration:s?i:0,fill:"forwards"},d=e.animate(a,c);n.animate(l,c);const h=()=>{this.panelsWrap.style.height=Dd.getStyle(this.currentPanel,"height"),d.removeEventListener("finish",h),o||(r=t)};d.addEventListener("finish",h)};return t.setTranslateX=(t=this.activePanelIndex,o=!0)=>{var r;r=t,i={nav:-n.offsetWidth*r,panel:-e.offsetWidth*r},s({offset:i,animate:o})},t.refresh=(e=this.activePanelIndex)=>{this.activePanelIndex!==e&&(this.activePanelIndex=e,t.groupChange(e)),t.setTranslateX(this.activePanelIndex),this.resizePanels()},t.nextGroup=()=>{const e=this.activePanelIndex+1;if(e!==o.length){const o=t.groupChange(e);i={nav:-n.offsetWidth*e,panel:-o.offsetLeft},s({offset:i}),this.activePanelIndex++}else i={nav:r.nav-8,panel:r.panel-8},s({offset:i,reset:!0});return this.currentPanel},t.prevGroup=()=>{if(0!==this.activePanelIndex){const e=this.activePanelIndex-1,o=t.groupChange(e);i={nav:-n.offsetWidth*e,panel:-o.offsetLeft},s({offset:i}),this.activePanelIndex--}else i={nav:8,panel:8},s({offset:i,reset:!0})},t}}const Ec="f-autocomplete",Oc="highlight-component";let Mc,Nc=Date.now();const _c=({name:t,id:e,...n})=>["config.label","attrs.id","meta.id"].reduce(((t,e)=>(t||(t=n.get(e)),t)),null)||"external"===t&&((...t)=>z.get(t.join("."))||jr(t.join(" ")))(t,e);class Ac{constructor(t,e,n){this.key=t,this.className=t.replace(/\./g,"-"),this.value=e,this.events=[],this.i18nKey=n,this.build()}build(){const t=t=>{const e=this.list,n=this.getActiveOption();let o=new Map([[38,()=>{const t=this.getPreviousOption(n);t&&this.selectOption(t)}],[40,()=>{const t=this.getNextOption(n);t&&this.selectOption(t)}],[13,()=>{n&&(this.selectOption(n),this.setValue(n),"none"===e.style.display?this.showList(n):this.hideList()),t.preventDefault()}],[27,()=>{this.hideList()}]]).get(t.keyCode);return o||(o=()=>!1),o()},e={focus:({target:e})=>{this.updateOptions(),e.parentElement.classList.add(`${this.className}-focused`);const n=Dd.toggleElementsByStr(this.list.querySelectorAll("li"),e.value);e.addEventListener("keydown",t);const o=this.list.querySelector(".active-option")||n[0];this.showList(o)},blur:({target:e})=>{e.parentElement.classList.remove(`${this.className}-focused`),e.removeEventListener("keydown",t),this.hideList()},input:t=>{const e=Dd.toggleElementsByStr(this.list.querySelectorAll("li"),t.target.value);if(0===t.target.value.length&&this.clearValue(),0===e.length)this.hideList();else{const t=this.getActiveOption()||e[0];this.showList(t)}this.hiddenField.value=t.target.value,this.value=t.target.value,this.runEvent("onChange",{target:this.hiddenField})}};return this.displayField=Dd.create({tag:"input",autocomplete:"off",action:e,attrs:{type:"text",className:`${Ec}-display-field`,value:this.label||this.value,placeholder:z.get(`${this.i18nKey}.${this.key}.placeholder`)}}),this.hiddenField=Dd.create({tag:"input",attrs:{type:"hidden",className:this.className,value:this.value}}),this.list=Dd.create({tag:"ul",attrs:{className:`${Ec}-list`}}),this.dom=Dd.create({children:[this.displayField,this.hiddenField,this.list],className:this.className,action:{onRender:()=>{const t=this.value&&_d.getAddress(this.value);this.label=t&&_c(t),this.label&&(this.displayField.value=this.label),this.updateOptions()}}}),this.dom}updateOptions(){const t=Date.now();t-Nc>ht&&(Dd.empty(this.list),this.generateOptions(),Nc=t);(Mc||this.generateOptions()).forEach((t=>this.list.appendChild(t)))}generateOptions(){const t=(t=>{const e=[],n=_d.flatList();return Object.entries(n).map((([n,o])=>{const i=_c(o);if(i){const r={tag:"span",content:` ${jr(o.name)}`,className:"component-type"},s=`${o.name}.${i}`;e.push(s);const a=((t,e)=>t.reduce(((t,n)=>t+(n===e)),0))(e,s),l={tag:"span",content:a>1&&`(${a})`,className:"component-label-count"};return Dd.makeOption([n,[`${i} `,l,r]],t)}})).filter(Boolean)})(),e=t=>{const e=`${Ec}-list-item`;return t.classList.contains(e)||(t=t.parentElement),t};return Mc=t.map((t=>{const n=t.value;let[o]=t.label;o=o.trim();const i={tag:"li",children:t.label,dataset:{value:n,label:o},className:`${Ec}-list-item`,action:{mousedown:({target:t})=>{t=e(t),this.setValue(t),this.selectOption(t),this.hideList()},mouseover:({target:t})=>{t=e(t),this.removeHighlight(),this.highlightComponent(t)}}};return Dd.create(i)})),Mc}hideList(t=this.list){Wr.slideUp(t,dt),this.removeHighlight()}showList(t,e=this.list){this.selectOption(t),Wr.slideDown(e,dt)}getActiveOption(t=this.list){const e=t.getElementsByClassName("active-option")[0];return e&&"none"!==e.style.display?e:null}getPreviousOption(t){let e=t;do{e=e?e.previousSibling:null}while(null!=e&&"none"===e.style.display);return e}getNextOption(t){let e=t;do{e=e?e.nextSibling:null}while(null!=e&&"none"===e.style.display);return e}selectOption(t,e=this.list){const n=e.querySelectorAll("li");for(let o=0;o{n===t&&o(e)}))}}const Dc=(t,e)=>{const n=(t=>{const e=Yi(t),n={"field.property":ft,...vt},o=e?(i=t,_d.getAddress(i).getData()):n[t];var i;return Object.keys(o).reduce(((t,e)=>(t[e]=e,t)),{})})(t);return Object.entries(n).reduce(((n,[o,i])=>{if("id"!==o){const r={tag:"option",content:z.get(`${t}.${o}`)||o.toLowerCase(),attrs:{value:i}};e===i&&(r.attrs.selected=!0),n.push(Dd.create(r))}return n}),[])},kc=(t,e)=>{Dd.empty(t),e.forEach((e=>t.add(e)))},Tc=({key:t,value:e,type:n="text",checked:o})=>{const i={tag:"input",attrs:{type:n,value:e,placeholder:z.get(`${t}.placeholder`)||jr(t)},className:t.replace(/\./g,"-"),config:{}};return o&&(i.attrs.checked=!0),i},jc=t=>{const e=z.get(t);if(e)return e;const n=t.split(".");return z.get(n[n.length-1])},Pc={autocomplete:(t,e,n)=>new Ac(t,e,n),string:(t,e)=>Tc({key:t,value:e}),boolean:(t,e)=>Tc({key:t,value:e,type:"selected"===t?"radio":"checkbox",checked:e}),number:(t,e)=>Tc({key:t,value:e,type:"number"}),array:(t,e=[])=>({tag:"select",attrs:{placeholder:jc(`placeholder.${t}`)},className:t.replace(/\./g,"-"),options:e}),object:t=>Object.entries(t).map((([t,e])=>Pc[Dd.childType(e)](t,e)))},Lc=["selected","checked"],zc={boolean:(t,e)=>({click:({target:{checked:n}})=>{var o,i;"radio"===(null==(i=null==(o=e.data)?void 0:o.attrs)?void 0:i.type)&&e.set("options",e.data.options.map((t=>({...t,selected:!1})))),e.set(t,n),e.updatePreview()}}),string:(t,e)=>({input:({target:{value:n}})=>{e.set(t,n)}}),number:(t,e)=>({input:({target:{value:n}})=>{e.set(t,Number(n)),e.updatePreview()}}),array:(t,e)=>({change:({target:{value:n}})=>{e.set(t,n),e.updatePreview()}}),object:()=>({})};class $c{constructor({key:t,data:n,index:o,field:i}){e(this,"generateConditionFields",((t,e)=>{const n={tag:"label",className:`condition-label ${t}-condition-label`,content:z.get(t)||t};return e.map(((e,o)=>{const i=[],r=Object.entries(e).map((([e,n])=>{const r=this.conditionInput(e,n,t,o);return r&&i.push([r.className,n.trim()].filter(Boolean).join("-")),r})).filter(Boolean),s=$r(r,gt.map((t=>`condition-${t}`)),"className||dom.className");return this.processConditionUIState(s),o||s.unshift(n),this.itemFieldGroups.push(s),{children:s,className:`f-condition-row ${t}-condition-row ${i.join(" ")}`}}))})),e(this,"processConditionUIState",(t=>{const e=e=>(e=e.split("|"),t.filter((t=>e.includes(t.className)))),n=t=>{t=Array.isArray(t)?t:[t];const e=setTimeout((()=>{t.forEach((t=>{t.dom&&(t=t.dom),t.style.display="none"})),clearTimeout(e)}),ct)},o=t=>{t=Array.isArray(t)?t:[t];const e=setTimeout((()=>{t.forEach((t=>{t.dom&&(t=t.dom),t.removeAttribute("style")})),clearTimeout(e)}),ct)},i=new Map([["condition-source",t=>{const i=e("condition-sourceProperty"),r=i[0],s=Yi(t.value)?t.value:"field.property",a=Dc(s,r.value);return kc(r,a),t.value?o(i):n(i)}],["condition-target",t=>{const i=e("condition-targetProperty");return Xi(t.value)&&t.value?o(i):n(i)}],["condition-sourceProperty",t=>{const i=e("condition-comparison|condition-targetProperty|condition-target"),r=t.value;return(t=>/^is|^has/.test(t))(r.substring(r.lastIndexOf(".")+1,r.length))?n(i):o(i)}]]);t.forEach((t=>{const e=i.get(t.className);e&&e(t)}))})),e(this,"conditionInput",((t,e,n,o)=>{const i=this.field,r=`${this.itemKey}.${n}.${o}`,s=`${this.field.id}.${r}`,a=`${i.name}s.${s}.${t}`,l=(t,e,n)=>{const o=Dc(n||t,e),i=Pc.array(`condition.${t}`);i.action={change:c,onRender:t=>c({target:t})};const r=Dd.create(i);return kc(r,o),r},c=({target:t})=>{const e=t.closest(".f-condition-row"),n=new RegExp(`${t.className}(?:\\S?)+`,"gm");e.className=e.className.replace(n,""),e.classList.add([t.className,t.value].filter(Boolean).join("-"));const o={dataPath:a,value:t.value,src:t};Xr.formeoUpdated(o),_d.setAddress(a,t.value);const i=t.closest(".f-condition-row"),r=zr(i);this.processConditionUIState(this.itemFieldGroups[r])},d={comparison:t=>l("comparison",t),logical:t=>l("logical",t),source:(t,e="source")=>{const o=Pc.autocomplete(`condition.${e}`,t,n);return _d.setConditionMap(t,i),o.addEvent("onChange",(t=>{_d.removeConditionMap(_d.getAddress(a)),c(t),_d.setConditionMap(t.target.value,i)})),o},sourceProperty:t=>l("sourceProperty",t,"field.property"),targetProperty:t=>l("targetProperty",t,"field.property"),target:t=>d.source(t,"target"),value:t=>{const e=Pc.string("condition.value",t);return e.action={input:c},Dd.create(e)},assignment:t=>l("assignment",t)};if(d[t])return d[t](e)})),this.itemValues=$r(Object.entries(n),Lc,"0");const[r,s]=t.split(".");this.field=i,this.itemKey=t,this.itemIndex=o,this.panelName=r,this.isDisabled=i.isDisabledProp(s,r),this.isHidden=this.isDisabled&&i.config.panels[r].hideDisabled,this.isLocked=i.isLockedProp(s,r),this.dom=Dd.create({tag:"li",className:[`field-${t.replace(/\./g,"-")}`,"prop-wrap",this.isHidden&&"hidden-property"],children:{className:"field-prop",children:[this.itemInputs,this.itemControls]}})}get itemInputs(){this.itemFieldGroups=[];return{className:`${this.panelName}-prop-inputs prop-inputs f-input-group`,children:this.itemValues.map((([t,e])=>{let n="conditions"===this.panelName?this.generateConditionFields(t,e):this.itemInput(t,e);return["selected","checked"].includes(t)&&(n={className:"f-addon",children:n}),n}))}}get itemControls(){if(this.isLocked){return{className:`${this.panelName}-prop-controls prop-controls`,content:[]}}const t={tag:"button",attrs:{type:"button",className:"prop-remove prop-control"},action:{click:()=>{Wr.slideUp(this.dom,250,(t=>{this.field.remove(this.itemKey),Dd.remove(t),this.field.resizePanelWrap()}))}},content:Dd.icon("remove")};return{className:`${this.panelName}-prop-controls prop-controls`,content:[t]}}itemInput(t,e){const n=Dd.childType(e)||"string",o={config:{},attrs:{},...Pc[n](t,e)},i=this.itemKey.replace(/.\d+$/,(e=>`${e}.${t}`)),r=i.split(".").filter(Number.isNaN).join("."),[s,a]=[[...this.itemKey.split("."),t],[t]].map((t=>[this.field.id,...t].filter(Boolean).join("-")));return o.config={...o.config,label:"options"!==this.panelName&&jc(r),labelAfter:!1},o.attrs={...o.attrs,name:"checkbox"===o.attrs.type?`${a}[]`:a,id:s,disabled:this.isDisabled,locked:this.isLocked},o.action={...zc[n](i,this.field)},o}}class Hc{constructor(t,n,o){e(this,"addAttribute",((t,e)=>{const n=Pr(t),o=`attrs.${n}`;z.current[o]||z.put(o,Fr(t)),"string"==typeof e&&["true","false"].includes(e)&&(e=JSON.parse(e)),this.field.set(`attrs.${t}`,e);const i=this.props.querySelector(`.field-attrs-${n}`),r=new $c({key:o,data:{[n]:e},field:this.field});i?this.props.replaceChild(r.dom,i):this.props.appendChild(r.dom),this.field.resizePanelWrap()})),e(this,"addOption",(()=>{const t=this.field.data.meta.id,e=this.field.get("options"),n="select"===t?"option":t,o=z.get("newOptionLabel",{type:n})||"New Option",i=`options.${this.data.length}`,r={...e.length?Ar(e[e.length-1]):{},label:o,value:Pr(o)},s=new $c({key:i,data:r,field:this.field,index:this.props.children.length});this.editPanelItems.push(s),this.props.appendChild(s.dom),this.field.set(i,r),this.field.resizePanelWrap()})),e(this,"addCondition",(t=>{const e=`conditions.${this.field.get("conditions").length}`,n=this.props.querySelector(`.field-${e.replace(".","-")}`),o=new $c({key:e,data:t.template,field:this.field});n?this.props.replaceChild(o.dom,n):this.props.appendChild(o.dom),this.field.set(e,t.template),this.field.resizePanelWrap()})),this.type=Dd.childType(t),this.data="object"===this.type?Object.entries(t):t,this.name=n,this.field=o,this.panelConfig=this.getPanelConfig(this.data)}getPanelConfig(t){return this.props=this.createProps(t),this.editButtons=this.createEditButtons(),{id:`${this.field.id}-${this.name}-panel`,config:{label:z.get(`panel.label.${this.name}`)},attrs:{className:`f-panel ${this.name}-panel`},children:[this.props,this.editButtons]}}createProps(t){this.editPanelItems=Array.from(t).map(((t,e)=>{const n="array"===this.type,o=[this.name,n?String(e):t[0]].join("."),i=n?t:{[t[0]]:t[1]};return new $c({key:o,data:i,field:this.field})}));const e={tag:"ul",attrs:{className:["field-edit-group",`field-edit-${this.name}`]},editGroup:this.name,isSortable:"options"===this.name,content:this.editPanelItems};return Dd.create(e)}createEditButtons(){const t=this,e=this.name,n=z.get(`panelEditButtons.${e}`),o={attrs:t.addAttribute,options:t.addOption,conditions:t.addCondition};return{className:"panel-action-buttons",content:[{...Dd.btnTemplate({content:n,title:n}),className:`add-${e}`,action:{click:n=>{const i={btnCoords:Dd.coords(n.target),addAction:o[e]};"attrs"===e&&(i.isDisabled=t.field.isDisabledProp,i.isLocked=t.field.isLockedProp,i.message={attr:z.get(`action.add.${e}.attr`),value:z.get(`action.add.${e}.value`)});const r=jr(e),s=new window.CustomEvent(`onAdd${r}`,{detail:i});wc.add[e](i),document.dispatchEvent(s)}}}]}}}class Vc extends ga{constructor(t,n={},o){super(t,{...n,id:n.id||Ri()}),e(this,"mutationHandler",(t=>t.map((t=>{})))),e(this,"remove",(t=>{if(t){const e=t.split("."),n=e.pop(),o=this.get(e);return Array.isArray(o)?Lr(n)?o.splice(Number(n),1):this.set(e,o.filter((t=>t!==n))):delete o[n],o}if("stage"===this.name)return null;const e=this.parent,n=this.children;return Hr(n,(t=>t.remove())),this.dom.parentElement.removeChild(this.dom),((t,e)=>{const n=t.indexOf(e);-1!==n&&t.splice(n,1)})(_d.getAddress(`${e.name}s.${e.id}.children`),this.id),e.children.length||e.emptyClass(),"row"===e.name&&e.autoColumnWidths(),_d[`${this.name}s`].delete(this.id)})),e(this,"emptyClass",(()=>this.dom.classList.toggle("empty",!this.children.length))),e(this,"getComponentTag",(()=>Dd.create({tag:"span",className:["component-tag",`${this.name}-tag`],children:[(this.isColumn||this.isField)&&Dd.icon("component-corner",["bottom-left"]),Dd.icon(`handle-${this.name}`),jr(this.name),(this.isColumn||this.isRow)&&Dd.icon("component-corner",["bottom-right"])].filter(Boolean)}))),e(this,"removeClasses",(t=>{const e={string:()=>this.dom.classList.remove(t),array:()=>t.map((t=>this.dom.classList.remove(t)))};return e.object=e.string,e[Dd.childType(t)](this.dom)})),e(this,"loadChildren",((t=this.data.children)=>t.map((t=>this.addChild({id:t}))))),e(this,"saveChildOrder",(()=>{if(this.render)return;const t=this.children.map((({id:t})=>t));return this.set("children",t),t})),e(this,"onSort",(()=>this.saveChildOrder())),e(this,"onEnd",(({to:{parentElement:t},from:{parentElement:e}})=>{null==t||t.classList.remove(`hovering-${Ii(t)}`),null==e||e.classList.remove(`hovering-${Ii(e)}`)})),e(this,"runConditions",(()=>{const t=this.get("conditions");if(!(null==t?void 0:t.length))return null;return t.map((t=>{const e=this.processConditions(t.if),n=this.processResults(t.then);return e.map((t=>this.evaluateConditions(t)&&this.execResults(n)))}))})),e(this,"value",((t,e)=>{const n=t.split("."),o=this.getComponent(t),i=o&&n.slice(2,n.length).join(".");return[!o,!i,!ft[i]].some(Boolean)?t:e?o.set(ft[i],e):o.get(ft[i])})),e(this,"getResult",(t=>({"=":(t,e,n)=>t.set(e,n)}[t]))),e(this,"processResults",(t=>t.map((({operator:t,target:e,value:n})=>{const o=this.getComponent(e);return{target:o,propertyPath:o&&e.split(".").slice(2,e.length).join("."),action:this.getResult(t),value:this.value(n)}})))),e(this,"execResults",(t=>{const e=t.map((t=>this.execResult(t)));return Promise.all(e)})),e(this,"execResult",(({target:t,action:e,value:n,propertyPath:o})=>new Promise(((o,i)=>{try{return o(e(t,n))}catch(r){return i(r)}})))),e(this,"cloneData",(()=>{const t={...Wi(this.data),id:Ri()};return"field"!==this.name&&(t.children=[]),t})),e(this,"clone",((t=this.parent)=>{const e=t.addChild(this.cloneData(),this.index+1);return"field"!==this.name&&this.cloneChildren(e),e})),e(this,"createChildWrap",(t=>Dd.create({tag:"ul",attrs:{className:"children"},children:t}))),this.id=this.data.id,this.name=t,this.config=_d[`${this.name}s`].config,Bi(this.config,n.config),this.dataPath=`${this.name}s.${this.id}.`,this.observer=new MutationObserver(this.mutationHandler),this.render=o}observe(t){this.observer.disconnect(),this.observer.observe(t,{childList:!0})}get js(){return this.data}get json(){return this.data}empty(){const t=this.children.map((t=>t.remove()));return this.data.children=this.data.children.filter((e=>-1===t.indexOf(e))),this.dom.classList.add("empty"),t}getActionButtons(){const t=[`hovering-${this.name}`,"hovering"];return{className:[`${this.name}-actions`,"group-actions"],action:{mouseenter:({target:e})=>{_d.stages.active.dom.classList.add(`active-hover-${this.name}`),this.dom.classList.add(...t)},mouseleave:({target:e})=>{this.dom.classList.remove(...t),_d.stages.active.dom.classList.remove(`active-hover-${this.name}`),e.removeAttribute("style")}},children:[{...Dd.btnTemplate({content:Dd.icon(`handle-${this.name}`)}),className:["component-handle",`${this.name}-handle`]},{className:["action-btn-wrap",`${this.name}-action-btn-wrap`],children:this.buttons}]}}toggleEdit(t=!this.isEditing){this.isEditing=t;const e=this.dom,n="editing",o=`${n}-${this.name}`,i=this.dom.querySelector(`.${this.name}-edit`);Wr.slideToggle(i,ct,t),"field"===this.name&&(Wr.slideToggle(this.preview,ct,!t),e.parentElement.classList.toggle(`column-${o}`,t)),e.classList.toggle(n,t),e.classList.toggle(o,t)}get buttons(){if(this.actionButtons)return this.actionButtons;const t={handle:(t=`handle-${this.name}`)=>({...Dd.btnTemplate({content:Dd.icon(t)}),className:["component-handle"]}),move:(t="move")=>({...Dd.btnTemplate({content:Dd.icon(t)}),className:["item-move"],meta:{id:"move"}}),edit:(t="edit")=>({...Dd.btnTemplate({content:Dd.icon(t)}),className:["item-edit-toggle"],meta:{id:"edit"},action:{click:t=>{this.toggleEdit()}}}),remove:(t="remove")=>({...Dd.btnTemplate({content:Dd.icon(t)}),className:["item-remove"],meta:{id:"remove"},action:{click:(t,e)=>{Wr.slideUp(this.dom,ct,(()=>{if("column"===this.name){this.parent.autoColumnWidths(),this.remove()}else this.remove()}))}}}),clone:(t="copy")=>({...Dd.btnTemplate({content:Dd.icon(t)}),className:["item-clone"],meta:{id:"clone"},action:{click:()=>{this.clone(this.parent),"column"===this.name&&this.parent.autoColumnWidths()}}})},{buttons:e,disabled:n}=this.config.actionButtons,o=e.filter((t=>!n.includes(t))).map((e=>{var n;return(null==(n=t[e])?void 0:n.call(t))||e}));return this.actionButtons=o,this.actionButtons}get index(){return zr(this.dom)}get parentType(){return it.get(this.name)}get parent(){const t=this.parentType;if(!this.dom||!t)return null;const e=this.dom.closest(`.${J[t]}`);return e&&Dd.asComponent(e)}get children(){if(!this.dom)return[];const t=this.domChildren,e=ot.get(this.name);return Vr(t,(t=>_d.getAddress(`${e}s.${t.id}`))).filter(Boolean)}get domChildren(){const t=this.dom.querySelector(".children");return t?t.children:[]}addChild(t={},e=this.domChildren.length){var n,o;let i=t;"object"!=typeof t&&(i={id:i});const r=this.dom.querySelector(".children"),{id:s=Ri()}=i,a=ot.get(this.name);if(!a)return null;const l=`${a}s`,c=_d.getAddress(`${l}.${s}`)||_d[l].add(s,i);r.insertBefore(c.dom,r.children[e]),null==(o=null==(n=this.config.events)?void 0:n.onAddChild)||o.call(n,{parent:this,child:c});const d=c.get("children");return(null==d?void 0:d.length)&&c.loadChildren(d),this.removeClasses("empty"),this.saveChildOrder(),c}onAdd({from:t,to:e,item:n,newIndex:o}){var i;t.classList.contains(V)||(t=t.parentElement);const r=Ii(t),s=Ii(e.parentElement),a=new Map([[-2,()=>{const t=this.addChild({},o).addChild();return t.addChild.bind(t)}],[-1,()=>{const t=this.addChild({},o);return t.addChild.bind(t)}],[0,()=>this.addChild.bind(this)],[1,t=>{const e=zr(this.dom);return()=>this.parent.addChild(t,e+1)}],[2,t=>()=>this.parent.parent.addChild(t)]]),l={controls:()=>{const{controlData:t}=rd.get(n.id),{meta:{id:e}}=t,i=e.startsWith("layout-")?e.replace(/^layout-/,""):"field",r=Nr({stage:{row:0,column:-1,field:-2},row:{row:1,column:0,field:-1},column:{row:2,column:1,field:0},field:1},`${this.name}.${i}`),s=a.get(r)();Dd.remove(n);return s(t,o)},row:()=>{const t=(a.get({stage:-1,row:0,column:1}[s])||Ji)();return null==t?void 0:t({id:n.id},o)},column:()=>{const t=(a.get({stage:-2,row:-1}[s])||Ji)();return null==t?void 0:t(n.id)}},c=null==(i=l[r])?void 0:i.call(l,n,o);return(()=>{this.saveChildOrder(),this.removeClasses("empty")})(),c}onRemove({from:{parentElement:t}}){return t.classList.contains(R)&&t.classList.remove("column-editing-field"),"stage"===this.name||this.children.length?(this.emptyClass(),this.saveChildOrder()):this.remove()}onRender(){const{events:t}=this.config;if(!t)return null;t.onRender&&Dd.onRender(this.dom,t.onRender)}set config(t){const e=Nr(this.data,"meta.id"),n=[Nr(t,"all"),e&&Nr(t,e),Nr(t,this.id)].reduce(((t,e)=>e?Bi(t,e):t),this.configVal);this.configVal=n}get config(){return this.configVal}getComponent(t){const[e,n]=t.split("."),o=_d[e];return n===this.id?this:null==o?void 0:o.get(n)}cloneChildren(t){for(const e of this.children)null==e||e.clone(t)}get isRow(){return this.name===Y.row}get isColumn(){return this.name===Y.column}get isField(){return this.name===Y.field}}class Ic extends Vc{constructor(t=Object.create(null)){super("field",{conditions:[{if:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],then:[{target:"",targetProperty:"",assignment:"",value:""}]}],...t}),e(this,"updateConditionsPanel",(()=>{const t=setTimeout((()=>{const e=this.editPanels.find((({name:t})=>"conditions"===t));if(!e)return null;const n=e.createProps(),o=this.dom.querySelector(".field-edit-conditions");o.parentElement.replaceChild(n,o),clearTimeout(t)}),ct)})),e(this,"updatePreview",Zi((()=>{if(!this.preview.parentElement)return null;this.updateLabel();const t=Dd.create(this.fieldPreview(),!0);this.preview.parentElement.replaceChild(t,this.preview),this.preview=t}),ct)),e(this,"isDisabledProp",((t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.disabled.concat(this.get(`config.disabled${jr(e)}`)).includes(t)})),e(this,"isLockedProp",((t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.locked.concat(this.get(`config.locked${jr(e)}`)).includes(t)})),this.label=Dd.create(this.labelConfig),this.preview=Dd.create({}),this.editPanels=[];const n=this.getActionButtons(),o=this.actionButtons.some((t=>{var e;return"edit"===(null==(e=t.meta)?void 0:e.id)}));let i={tag:"li",attrs:{className:B},id:this.id,children:[this.label,this.getComponentTag(),n,o&&this.fieldEdit,this.preview].filter(Boolean),panelNav:this.panelNav,dataset:{hoverTag:z.get("field")}};i=Dd.create(i),this.observe(i),this.dom=i,this.isEditing=!1,this.onRender(i)}get labelConfig(){if(!!this.get("config.hideLabel"))return;const t=this.get("config.editorLabel")||this.get("config.label"),e=this.get("attrs.required"),n=this.config.label.disableHTML;return{className:"prev-label",children:[{...(()=>{const e={tag:"label",attrs:{}};return n?(e.tag="input",e.attrs.value=t,e):(e.attrs.contenteditable=!0,e.children=t,e)})(),action:{input:({target:{innerHTML:t,innerText:e,value:o}})=>{super.set("config.label",n?o:t);const i=_d.getConditionMap(`fields.${this.id}`);if(i)return i.updateConditionSourceLabel(`${this.name}s.${this.id}`,n?o:e)}}},e&&Dd.requiredMark()]}}updateConditionSourceLabel(t,e){const n=this.editPanels.find((({name:t})=>"conditions"===t));if(!n)return null;for(const{itemFieldGroups:o}of n.editPanelItems)for(const n of o){const o=n.find((e=>e.value===t));o&&(o.displayField.value=e)}}set(...t){const[e,n]=t,o=super.set(e,n);return this.updatePreview(),o}updateLabel(){if(!this.label)return null;const t=Dd.create(this.labelConfig);this.label.parentElement.replaceChild(t,this.label),this.label=t}get fieldEdit(){this.editPanels=[];const t=["object","array"],e=["config","meta","action","events",...this.config.panels.disabled],n=Fi([...this.config.panels.order,...Object.keys(this.data)]).filter((t=>!e.includes(t))),o={className:["field-edit","slide-toggle","formeo-panels-wrap"]};for(const s of n){const e=this.get(s),n=Dd.childType(e);if(t.includes(n)){const t=new Hc(e,s,this);this.editPanels.push(t)}}const i={panels:this.editPanels.map((({panelConfig:t})=>t)),id:this.id,displayType:"auto"},r=this.editPanels.length;return r&&(this.panels=new Sc(i),o.className.push(`panel-count-${r}`),o.content=[this.panels.panelNav,this.panels.panelsWrap],this.panelNav=this.panels.nav,this.resizePanelWrap=this.panels.nav.refresh,o.action={onRender:()=>{if(this.resizePanelWrap(),!r){const t=this.dom,e=t.querySelector(".item-edit-toggle"),n=t.querySelector(".field-actions"),o=n.getElementsByTagName("button");n.style.maxWidth=o.length*o[0].clientWidth+"px",Dd.remove(e)}}}),o}get defaultPreviewActions(){return{change:t=>{const{target:e}=t,{checked:n,type:o}=e;if(["checkbox","radio"].includes(o)){const t=+e.id.split("-").pop();"radio"===o&&this.set("options",this.get("options").map((t=>({...t,selected:!1}))));const i="checkbox"===o?"checked":"selected";this.set(`options.${t}.${i}`,n)}},click:t=>{"true"===t.target.contentEditable&&t.preventDefault()},input:t=>{["input","meter","progress","button"].includes(this.data.tag)&&super.set("attrs.value",t.target.value),t.target.contentEditable&&super.set("content",t.target.innerHTML)}}}fieldPreview(){var t;const e=Wi(this.data),{action:n={}}=rd.get(e.meta.id);e.id=`prev-${this.id}`,e.action=n,(null==(t=this.data)?void 0:t.config.editableContent)&&(e.attrs={...e.attrs,contenteditable:!0});return{attrs:{className:"field-preview",style:this.isEditing&&"display: none;"},content:Dd.create(e,!0),action:this.defaultPreviewActions}}}const Fc={js:new Set,css:new Set},Rc=(t,e)=>{t.removeEventListener("load",Rc),t.rel="stylesheet",e(t.src)},Bc=(t,e)=>{t.removeEventListener("load",Bc),e(t.src)},Wc=t=>new Promise(((e,n)=>{if(Fc.js.has(t))return e(t);Fc.js.add(t);const o=Dd.create({tag:"script",attrs:{type:"text/javascript",async:!0,src:`//${t.replace(/^https?:\/\//,"")}`},action:{load:()=>Bc(o,e),error:()=>n(new Error(`${t} failed to load.`))}});document.head.appendChild(o)})),qc=t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>new Promise(((e,n)=>{if(Fc.css.has(t))return e(t);Fc.css.add(t);const o=Dd.create({tag:"link",attrs:{rel:"preload",href:t,as:"style"},action:{load:()=>Rc(o,e),error:()=>n(new Error(`${(void 0).src} failed to load.`))}});document.head.appendChild(o)}))));return Promise.all(e)},Uc=t=>("string"==typeof t?Promise.resolve(t):t.text()).then((t=>{const e="formeo-sprite";let n=document.getElementById(e);return n||(n=Dd.create({id:e,children:t,attrs:{hidden:!0,style:"display: none;"}}),document.body.insertBefore(n,document.body.childNodes[0])),n})),Gc=(t,e,n=Ki)=>new Promise(((o,i)=>fetch(t).then((t=>o(e?e(t):t))).catch((t=>i(new Error(n(t))))))),Xc={js:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>Wc(t)));return Promise.all(e)},css:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>qc(t)));return Promise.all(e)}},Yc=t=>{const e=Object.entries(t).map((([t,e])=>Xc[t](e)));return Promise.all(e)};class Zc{constructor({events:t={},dependencies:n={},controlAction:o,...i}){e(this,"controlCache",new Set),this.events=t,this.controlData=i,this.controlAction=o,this.dependencies=n,this.id=i.id||Ri()}get controlId(){var t;return null==(t=this.controlData.meta)?void 0:t.id}get dom(){const{meta:t,config:e}=this.controlData,n=this.i18n(e.label)||e.label,o={tag:"button",attrs:{type:"button"},content:[{tag:"span",className:"control-icon",children:Dd.icon(t.icon)},n],action:{focus:({target:t})=>{const e=t.closest(`.${V}`);return e&&rd.panels.nav.refresh(zr(e))},click:({target:t})=>{rd.addElement(t.parentElement.id)}}};return Dd.create({tag:"li",id:this.id,className:["field-control",`${t.group}-control`,`${t.id}-control`],content:o,meta:t,action:this.controlAction})}promise(){return Yc(this.dependencies)}i18n(t,e){var n,o;const i=z.locale,r=null==(n=this.definition)?void 0:n.i18n,s=(null==r?void 0:r[i])||{};return((null==(o=s[t])?void 0:o.call(s))??s[t])||z.get(t,e)}}const Jc=[{config:{label:"row"},meta:{group:"layout",icon:"rows",id:"layout-row"}},{config:{label:"column"},meta:{group:"layout",icon:"columns",id:"layout-column"}}];const Kc=(t,e=3)=>Array.from({length:e},((t,e)=>e+1)).map((e=>{const n="checkbox"===t?"checked":"selected";return{label:z.get("labelCount",{label:jr(t),count:e}),value:`${t}-${e}`,[n]:!e}}));const Qc=[class extends Zc{constructor(){super({tag:"button",attrs:{className:[{label:"grouped",value:"f-btn-group"},{label:"ungrouped",value:"f-field-group"}]},config:{label:z.get("controls.form.button"),hideLabel:!0},meta:{group:"common",icon:"button",id:"button"},options:[{label:z.get("button"),type:["button","submit","reset"].map(((t,e)=>({label:t,type:t}))),className:[{label:"default",value:"",selected:!0},{label:"primary",value:"primary"},{label:"danger",value:"error"},{label:"success",value:"success"},{label:"warning",value:"warning"}]}]})}},class extends Zc{constructor(){super({tag:"input",attrs:{type:"date",required:!1,className:""},config:{label:z.get("controls.form.input.date")},meta:{group:"common",icon:"calendar",id:"date-input"}})}},class extends Zc{constructor(){super({tag:"input",attrs:{type:"hidden",value:""},config:{label:z.get("hidden"),hideLabel:!0},meta:{group:"common",icon:"hidden",id:"hidden"}})}},class extends Zc{constructor(){super({tag:"input",attrs:{type:"number",required:!1,className:""},config:{label:z.get("number")},meta:{group:"common",icon:"hash",id:"number"}})}},class extends Zc{constructor(){super({tag:"textarea",config:{label:z.get("controls.form.textarea")},meta:{group:"common",icon:"textarea",id:"textarea"},attrs:{required:!1}})}},class extends Zc{constructor(){super({tag:"input",attrs:{required:!1,type:"text",className:""},config:{label:z.get("controls.form.input.text")},meta:{group:"common",icon:"text-input",id:"text-input"}})}},class extends Zc{constructor(){super({tag:"input",attrs:{type:"file",required:!1},config:{label:z.get("fileUpload")},meta:{group:"common",icon:"upload",id:"upload"}})}},class extends Zc{constructor(){super({tag:"select",config:{label:z.get("controls.form.select")},attrs:{required:!1,className:""},meta:{group:"common",icon:"select",id:"select"},options:Kc("option")})}},class extends Zc{constructor(){super({tag:"input",attrs:{type:"checkbox",required:!1},config:{label:z.get("controls.form.checkbox-group"),disabledAttrs:["type"]},meta:{group:"common",icon:"checkbox",id:"checkbox"},options:Kc("checkbox",1)})}},class extends Zc{constructor(){super({tag:"input",attrs:{type:"radio",required:!1},config:{label:z.get("controls.form.radio-group"),disabledAttrs:["type"]},meta:{group:"common",icon:"radio-group",id:"radio"},options:Kc("radio")})}}],td=Array.from(Array(5).keys()).slice(1).map((t=>`h${t}`)),ed="controls.html.header";const nd=[class extends Zc{constructor(){super({tag:td[0],attrs:{tag:td.map(((t,e)=>({label:t.toUpperCase(),value:t,selected:!e}))),className:""},config:{label:z.get(ed),hideLabel:!0,editableContent:!0},meta:{group:"html",icon:"header",id:"html.header"},content:z.get(ed),action:{onRender:t=>{},click:t=>{}}})}static get definition(){return{i18n:{"en-US":{header:"Custom English Header"}}}}get content(){return super.i18n(ed)}},class extends Zc{constructor(){super({tag:"p",attrs:{className:""},config:{label:z.get("controls.html.paragraph"),hideLabel:!0,editableContent:!0},meta:{group:"html",icon:"paragraph",id:"paragraph"},content:"Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment."})}},class extends Zc{constructor(){super({tag:"hr",config:{label:z.get("controls.html.divider"),hideLabel:!0},meta:{group:"html",icon:"divider",id:"divider"}})}},class extends Zc{constructor(t){super(Bi({tag:"textarea",config:{label:"WYSIWYG",editableContent:!0},meta:{group:"html",icon:"rich-text",id:"tinymce"},attrs:{required:!1},dependencies:{js:"cdnjs.cloudflare.com/ajax/libs/tinymce/4.9.11/tinymce.min.js"},action:{onRender:t=>{const e=`#${t.id}`;window.tinymce.remove(e),window.tinymce.init({selector:e})}},controlAction:{click:()=>{},onRender:()=>{}}},t))}}],od=Object.freeze({sortable:!0,elementOrder:{},groupOrder:[],groups:[{id:"layout",label:"controls.groups.layout",elementOrder:["row","column"]},{id:"common",label:"controls.groups.form",elementOrder:["button","checkbox"]},{id:"html",label:"controls.groups.html",elementOrder:["header","block-text"]}],disable:{groups:[],elements:[],formActions:[]},elements:[],container:null,panels:{displayType:"slider"}}),id=[...Qc,...nd,...Jc];const rd=new class{constructor(){e(this,"groupLabel",(t=>z.get(t)||t||"")),e(this,"addElement",(t=>{const e=Nr(this.get(t),"controlData"),{meta:{group:n,id:o}}=e,i={row:()=>xd.active.addChild(),column:()=>i.row().addChild(),field:t=>i.column().addChild(t)};return"layout"!==n?i.field(e):i[o.replace("layout-","")]()})),e(this,"applyOptions",(async(t={})=>{const{container:e,elements:n,groupOrder:o,...i}=Bi(od,t);return this.container=e,this.groupOrder=Fi(o.concat(["common","html","layout"])),this.options=i,Promise.all(this.registerControls([...id,...n]))})),this.data=new Map,this.buttonActions={focus:({target:t})=>{const e=t.closest(`.${V}`);return e&&this.panels.nav.refresh(zr(e))},click:({target:t})=>{this.addElement(t.parentElement.id)}}}async init(t,e=!1){return await this.applyOptions(t),this.buildDOM(e),this}registerControls(t){return this.controls=[],t.map((async t=>{let e;return e="function"==typeof t?new t:new Zc(t),this.add(e),this.controls.push(e.dom),e.promise()}))}groupElements(){let t=this.options.groups.slice(),e=this.controls.slice(),n=[];const o=[];return t=$r(t,this.groupOrder,"id"),t=t.filter((t=>Vi(t.id,this.options.disable.groups))),n=t.map((t=>{const n={tag:"ul",attrs:{className:V,id:`${t.id}-${V}`},config:{label:this.groupLabel(t.label)}};if(this.options.elementOrder[t.id]){const e=this.options.elementOrder[t.id],n=Fi(e.concat(t.elementOrder));t.elementOrder=n}return e=$r(e,t.elementOrder,"meta.id"),n.content=e.filter((e=>{const{controlData:n}=this.get(e.id),i=n.meta.id||"";let r=!0;return r=[Vi(i,this.options.disable.elements),n.meta.group===t.id,!o.includes(n.meta.id)].every((t=>!0===t)),r&&o.push(i),r})),n})),n}add(t=Object.create(null)){const e=Wi(t);return this.data.set(e.id,e),e.controlData.meta.id&&this.data.set(e.controlData.meta.id,e.controlData),e}get(t){return this.data.get(t)}formActions(){if(!0===this.options.disable.formActions)return null;const t={...Dd.btnTemplate({content:[Dd.icon("bin"),z.get("clear")],title:z.get("clearAll")}),className:["clear-form"],action:{click:t=>{Cd.size?(Xr.confirmClearAll=new window.CustomEvent("confirmClearAll",{detail:{confirmationMessage:z.get("confirmClearAll"),clearAllAction:()=>{xd.clearAll().then((()=>{const e={src:t.target};Xr.formeoCleared(e)}))},btnCoords:Dd.coords(t.target)}}),document.dispatchEvent(Xr.confirmClearAll)):window.alert(z.get("cannotClearFields"))}}},e={...Dd.btnTemplate({content:[Dd.icon("floppy-disk"),z.get("save")],title:z.get("save")}),className:["save-form"],action:{click:({target:t})=>{const{formData:e}=_d,n={action:()=>{},coords:Dd.coords(t),message:"",button:t};return wc.click.btn(n),wc.save.form(e)}}};return{className:"form-actions f-btn-group",content:Object.entries({clearBtn:t,saveBtn:e}).reduce(((t,[e,n])=>(this.options.disable.formActions.includes(e)||t.push(n),t)),[])}}buildDOM(t){const e=this.groupElements(),n=this.formActions(),{displayType:o}=this.options.panels;this.panels=new Sc({panels:e,type:"controls",displayType:o});const i=["control-groups","formeo-panels-wrap",`panel-count-${e.length}`],r=Dd.create({className:i,content:[this.panels.panelNav,this.panels.panelsWrap]}),s=["formeo-controls"];t&&s.push("formeo-sticky");const a=Dd.create({className:s,content:[r,n]}),l=a.getElementsByClassName("control-group");this.dom=a,this.groups=l;const[c]=l;this.currentGroup=c,this.actions={filter:t=>{const e=""!==t,n=this.controls;let o=r.querySelector(".filtered-term");if(Dd.toggleElementsByStr(n,t),e){const e=z.get("controls.filteringTerm",t);a.classList.add("filtered"),o?o.textContent=e:(o=Dd.create({tag:"h5",className:"filtered-term",content:e}),r.insertBefore(o,r.firstChild))}else o&&(a.classList.remove("filtered"),o.remove())},addElement:this.addElement,addGroup:t=>{}};for(let d=l.length-1;d>=0;d--){const t=`formeo-controls-${l[d]}`;this.options.sortable||window.localStorage.removeItem(t),Kl.create(l[d],{animation:150,forceFallback:!0,fallbackClass:"control-moving",fallbackOnBody:!0,group:{name:"controls",pull:"clone",put:!1},onStart:({item:t})=>{const{controlData:e}=this.get(t.id);this.options.ghostPreview&&(t.innerHTML="",t.appendChild(new Ic(e).preview))},onEnd:({from:t,item:e,clone:n})=>{t.contains(n)&&t.replaceChild(e,n)},sort:this.options.sortable,store:{get:()=>{const e=window.localStorage.getItem(t);return e?e.split("|"):[]},set:e=>{const n=e.toArray();window.localStorage.setItem(t,n.join("|"))}}})}return a}};class sd extends ga{constructor(){super(...arguments),e(this,"load",((t=Object.create(null))=>(this.empty(),"string"==typeof t&&(t=JSON.parse(t)),Object.entries(t).forEach((([t,e])=>this.add(t,e))),this.data))),e(this,"get",(t=>t?Nr(this.data,t):this.add())),e(this,"add",((t,e=Object.create(null))=>{const n=t||Ri(),o=this.Component({...e,id:n});return this.set(n,o),this.active=o,o})),e(this,"remove",(t=>(Array.isArray(t)?t.forEach((t=>{this.get(t).remove()})):this.get(t).remove(),this.data))),e(this,"delete",(t=>(delete this.data[t],t))),e(this,"clearAll",((t=!0)=>{const e=Object.values(this.data).map((e=>e.empty(t)));return Promise.all(e)})),e(this,"conditionMap",new Map)}set config(t){this.configVal=Bi(this.configVal,Wi(t))}get config(){return this.configVal}}class ad extends Vc{constructor(t,e){super("stage",{...Object.freeze({children:[]}),...t},e);const n=this.createChildWrap();this.dom=Dd.create({attrs:{className:[I,"empty"],id:this.id},children:n}),Kl.create(n,{animation:150,fallbackClass:"row-moving",forceFallback:!0,group:{name:"stage",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onAdd:this.onAdd.bind(this),onRemove:this.onRemove.bind(this),onStart:()=>{ld.active=this},onSort:this.onSort.bind(this),draggable:`.${F}`,handle:".item-move"})}empty(t=!0){return new Promise((e=>{t?(this.dom.classList.add("removing-all-fields"),Wr.slideUp(this.dom,ct,(()=>{e(super.empty(t)),this.dom.classList.remove("removing-all-fields"),Wr.slideDown(this.dom,ct)}))):e(super.empty())}))}onAdd(...t){const e=super.onAdd(...t);e&&"column"===e.name&&e.parent.autoColumnWidths()}}const ld=new class extends sd{constructor(t){super("stages",t)}Component(t){return new ad(t)}};class cd extends Vc{constructor(t){super("row",{...Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[F]}),...t}),e(this,"autoColumnWidths",(()=>{const t=this.children;if(!t.length)return;const e=Number.parseFloat((100/t.length).toFixed(1))/1;for(const n of t){n.removeClasses(yt);const t=n.dom,o=Ui(e);n.set("config.width",o),t.style.width=o,t.dataset.colWidth=o;const i=setTimeout((()=>{clearTimeout(i),n.refreshFieldPanels()}),dt);document.dispatchEvent(Xr.columnResized)}this.updateColumnPreset()})),e(this,"updateColumnPreset",(()=>{this.columnPresetControl.innerHTML="";const t=this.getColumnPresetOptions.map((({label:t,...e})=>Dd.create({tag:"option",content:t,attrs:e})));this.columnPresetControl.append(...t)})),e(this,"setColumnWidths",(t=>{"string"==typeof t&&(t=t.split(",")),this.children.forEach(((e,n)=>{e.setWidth(`${t[n]}%`),e.refreshFieldPanels()}))}));const n=this.createChildWrap();this.dom=Dd.create({tag:"li",className:[F,"empty"],dataset:{hoverTag:z.get("row"),editingHoverTag:z.get("editing.row")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),this.editWindow,n]}),Kl.create(n,{animation:150,fallbackClass:"column-moving",forceFallback:!0,group:{name:"row",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onRemove:this.onRemove.bind(this),onEnd:this.onEnd.bind(this),onAdd:this.onAdd.bind(this),onSort:this.onSort.bind(this),draggable:`.${R}`,handle:".item-move"})}get editWindow(){const t={tag:"input",id:`${this.id}-fieldset`,attrs:{type:"checkbox",checked:this.get("config.fieldset"),ariaLabel:z.get("row.settings.fieldsetWrap.aria")},action:{click:({target:{checked:t}})=>{this.set("config.fieldset",Boolean(t))}},config:{label:z.get("row.settings.fieldsetWrap")}},e={tag:"input",id:`${this.id}-inputGroup`,attrs:{type:"checkbox",checked:this.get("config.inputGroup"),ariaLabel:z.get("row.settings.inputGroup.aria")},action:{click:({target:{checked:t}})=>this.set("config.inputGroup",t)},config:{label:z.get("row.makeInputGroup"),description:z.get("row.makeInputGroupDesc")}},n={className:"input-group",content:{tag:"input",attrs:{type:"text",ariaLabel:"Legend for fieldset",value:this.get("config.legend"),placeholder:"Legend"},action:{input:({target:{value:t}})=>this.set("config.legend",t)},className:""}},o=Dd.formGroup([t,n]),i={tag:"label",content:z.get("defineColumnWidths"),className:"col-sm-4 form-control-label"};this.columnPresetControl=Dd.create(this.columnPresetControlConfig);const r={className:"col-sm-8",content:this.columnPresetControl,action:{onRender:()=>{this.updateColumnPreset()}}},s=[e,"hr",o,"hr",Dd.formGroup([i,r],"row")];return Dd.create({className:`${this.name}-edit group-config`,action:{onRender:t=>{const e=s.map((t=>Dd.create(t)));t.append(...e)}}})}onAdd(...t){super.onAdd(...t),this.autoColumnWidths()}onRemove(...t){super.onRemove(...t),this.autoColumnWidths()}get getColumnPresetOptions(){const t=this.children,e=rt.get(t.length-1)||[],n=t.map((t=>{const e=t.get("config.width")||"";return Number(e.replace("%","")).toFixed(1)})).join(",");if(e.length){const t=e.slice();return!t.find((t=>t.value===n))&&t.push({value:n,label:n.replace(/,/g," | "),className:W}),t.map((t=>{const e={...t};return e.selected=t.value===n,e}))}return[]}get columnPresetControlConfig(){return{tag:"select",attrs:{ariaLabel:z.get("defineColumnLayout"),className:q},action:{change:({target:t})=>{const{value:e}=t;this.setColumnWidths(e)}},options:this.getColumnPresetOptions}}}const dd={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}};const hd=new class extends sd{constructor(t){super("rows",t),this.config={all:dd}}Component(t){return new cd(t)}};class ud{constructor(){this.onMove=this.onMove.bind(this),this.onStop=this.onStop.bind(this),this.cleanup=this.cleanup.bind(this)}getRowWidth(t){const e=t.querySelector(".children");if(!e)return 0;const n=e.children.length,o=Dd.getStyle(e,"gap")||"0px",i=parseFloat(o,10)||0;return this.totalGapWidth=i*(n-1),e.offsetWidth-this.totalGapWidth}validateResizeTarget(t,e){return t&&e&&t.offsetWidth&&e.offsetWidth}onStart(t){if(t.preventDefault(),this.resized=!1,0!==t.button)return;const e=t.target.parentElement,n=e.nextSibling||e.previousSibling,o=e.closest(`.${F}`);if(this.validateResizeTarget(e,n))if(this.startX="touchstart"===t.type?t.touches[0].clientX:t.clientX,o.classList.add(U),this.columnPreset=o.querySelector(`.${q}`),this.originalColumnClass=e.className,this.originalSiblingClass=n.className,e.className=e.className.replace(yt,""),n.className=n.className.replace(yt,""),this.colStartWidth=e.offsetWidth,this.sibStartWidth=n.offsetWidth,this.rowWidth=this.getRowWidth(o),this.rowWidth<=0)this.cleanup();else{this.column=e,this.sibling=n,this.row=o;try{window.addEventListener("pointermove",this.onMove,!1),window.addEventListener("pointerup",this.onStop,!1)}catch(i){this.cleanup()}}else this.cleanup()}calculateNewWidths(t){const e=this.colStartWidth+t-this.startX,n=this.sibStartWidth-t+this.startX,o=parseFloat(qi(e,this.rowWidth)),i=parseFloat(qi(n,this.rowWidth));return o<10||i<10?null:{colWidth:Ui(o.toFixed(1)),siblingColWidth:Ui(i.toFixed(1))}}onMove(t){t.preventDefault();const{column:e,sibling:n}=this,o="touchmove"===t.type?t.touches[0].clientX:t.clientX,i=this.calculateNewWidths(o);if(!i)return;const{colWidth:r,siblingColWidth:s}=i;e.dataset.colWidth=r,n.dataset.colWidth=s,e.style.width=r,n.style.width=s,this.resized=!0}onStop(){const{column:t,sibling:e}=this;window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop),this.resized&&(this.setCustomWidthValue(),_d.setAddress(`columns.${t.id}.config.width`,t.dataset.colWidth),_d.setAddress(`columns.${e.id}.config.width`,e.dataset.colWidth),this.row.classList.remove(U),this.resized=!1,this.cleanup())}cleanup(){this.column&&this.originalColumnClass&&(this.column.className=this.originalColumnClass),this.sibling&&this.originalSiblingClass&&(this.sibling.className=this.originalSiblingClass),this.row&&this.row.classList.remove(U),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const t=this.columnPreset;let e=t.querySelector(`.${W}`);const n=this.row.querySelector(".children").children,o=Vr(n,(t=>qi(t.clientWidth,this.rowWidth).toFixed(1))),i=o.join(","),r=o.join(" | ");return e||(e=Dd.create({tag:"option",attrs:{className:W,value:i,selected:!0},content:r}),t.append(e)),e.value=i,e.textContent=r,i}}const pd=t=>({className:"resize-x-handle",action:{pointerdown:t.onStart.bind(t)},content:[Dd.icon("triangle-down"),Dd.icon("triangle-up")]}),md=()=>({className:"column-edit group-config"});class gd extends Vc{constructor(t){super("column",{...Object.freeze({config:{width:"100%"},children:[],className:[R]}),...t}),e(this,"refreshFieldPanels",(()=>{this.children.forEach((t=>t.panels.nav.refresh()))})),e(this,"setWidth",(t=>(this.dom.dataset.colWidth=t,this.dom.style.width=t,this.set("config.width",t))));const n=this.createChildWrap();this.dom=Dd.create({tag:"li",className:[R,"empty"],dataset:{hoverTag:z.get("column")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),md(),pd(new ud),n]}),this.processConfig(this.dom),Xr.columnResized=new window.CustomEvent("columnResized",{detail:{column:this.dom,instance:this}}),Kl.create(n,{animation:150,fallbackClass:"field-moving",forceFallback:!0,group:{name:"column",pull:!0,put:["column","controls"]},sort:!0,disabled:!1,onEnd:this.onEnd.bind(this),onAdd:this.onAdd.bind(this),onSort:this.onSort.bind(this),onRemove:this.onRemove.bind(this),onMove:t=>{t.from!==t.to&&t.from.classList.remove("hovering-column")},draggable:`.${B}`,handle:".item-move"})}processConfig(t){const e=Br.get(this.data,"config.width");e&&(t.dataset.colWidth=e,t.style.width=e)}}const fd={actionButtons:{buttons:["clone","move","remove"],disabled:[]}};const vd=new class extends sd{constructor(t){super("columns",t),this.config={all:fd}}Component(t){return new gd(t)}},bd={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}};const yd=new class extends sd{constructor(t){super("fields",t),e(this,"get",(t=>{let e=t&&Nr(this.data,t);if(!e){const n=rd.get(t);n&&(e=this.add(null,n.controlData))}return e})),this.config={all:bd}}Component(t){return new Ic(t)}};const wd=new class extends sd{constructor(t){super("externals",t)}Component(t){return new Vc("external",t)}},xd=ld,Cd=hd,Sd=vd,Ed=yd,Od=rd,Md=wd,Nd={id:Ri()};const _d=new class extends ga{constructor(t){super("components"),e(this,"sessionFormData",(()=>{var t;if(null==(t=this.opts)?void 0:t.sessionStorage)return Gi.get(at)})),e(this,"load",((t,e=this.opts||Object.create(null))=>{let n=t;this.empty(),"string"==typeof t&&(n=JSON.parse(t)),this.opts=e;const{stages:o={[Ri()]:{}},rows:i,columns:r,fields:s,id:a=Ri()}={...this.sessionFormData(),...n};this.set("id",a),this.add("stages",xd.load(o)),this.add("rows",Cd.load(i)),this.add("columns",Sd.load(r)),this.add("fields",Ed.load(s)),this.add("externals",Md.load(e.external));for(const l of Object.values(this.get("stages")))l.loadChildren();return this.data})),this.opts=t,this.data=Nd,this.disableEvents=!0,this.stages=xd,this.rows=Cd,this.columns=Sd,this.fields=Ed,this.controls=Od,this.externals=Md}flatList(t=this.data,e=Object.create(null)){return Object.entries(t).reduce(((t,[e,n])=>{if("object"==typeof n)for(const[o,i]of Object.entries(n))t[`${e}.${o}`]=i;return t}),e)}get json(){return window.JSON.stringify(this.formData)}get formData(){return{id:this.get("id"),stages:ld.getData(),rows:hd.getData(),columns:vd.getData(),fields:yd.getData()}}set config(t){const{stages:e,rows:n,columns:o,fields:i}=t;xd.config=e,Cd.config=n,Sd.config=o,Ed.config=i}setAddress(t,e){const[n,o,...i]=Array.isArray(t)?t:t.split("."),r=this[n.replace(/s?$/,"s")].get(o);return null==r||r.set(i,e),r}getAddress(t){if(!Xi(t))return;const[e,n,...o]=Array.isArray(t)?t:t.split("."),i=this[e.replace(/s?$/,"s")].get(n);return o.length?i.get(o):i}getConditionMap(t){if(Xi(t)){const e=t.split(".");return e.every((t=>Boolean(t)))&&this[e[0]].conditionMap.get(e[1])}}setConditionMap(t,e){if(Xi(t)){const n=t.split(".");return n.every((t=>Boolean(t)))&&this[n[0]].conditionMap.set(n[1],e)}}removeConditionMap(t){if(Xi(t)){const e=t.split(".");return e.every((t=>Boolean(t)))&&this[e[0]].conditionMap.delete(e[1])}}},Ad={glyphicons:t=>``,"font-awesome":t=>{const[e,n]=t.split(" ");return``},fontello:t=>`${t}`};const Dd=new class{constructor(){e(this,"render",(t=>(t.id=`f-${t.id||Ri()}`,this.create(t)))),e(this,"create",((t,e=!1)=>{let n=t;if(!n)return;n=this.processTagName(n);const o=this;let i;const{tag:r}=n,s=["children","content"];let a;const l={attrs:{},className:[Br.get(n,"config.inputWrap")||"f-field-group"],children:[],config:{}};let c=document.createElement(r);const d={string:t=>{c.innerHTML+=t},object:t=>t&&c.appendChild(o.create(t,e)),node:t=>c.appendChild(t),component:t=>c.appendChild(t.dom),array:t=>{for(const e of t)i=o.childType(e),d[i](e)},function:t=>{t=t(),i=o.childType(t),d[i](t)},undefined:()=>null,boolean:()=>null};if(s.push("tag"),n.className){const{className:t}=n;n.attrs=Object.assign({},n.attrs,{className:t}),delete n.className}if(n.options){let{options:t}=n;if(t=this.processOptions(t,n,e),!this.holdsContent(c)||"button"===r)return Br.forEach(t,(t=>{l.children.push(o.create(t,e))})),n.attrs.className&&(l.className=n.attrs.className),l.config=Object.assign({},n.config),this.create(l,e);d.array.call(this,t),delete n.content,s.push("options")}if("OPTION"===c.tagName){const t=setTimeout((()=>{c.selected=!1,clearTimeout(t)}),0)}if(n.attrs&&(o.processAttrs(n,c,e),s.push("attrs")),n.config){if(n.config.label&&(n.config.label&&"button"!==r||["radio","checkbox"].includes(Br.get(n,"attrs.type")))&&!e){const t=o.label(n);if(!n.config.hideLabel){const e=[...o.labelAfter(n)?[c,t]:[t,c]];l.children.push(e)}}s.push("config")}if(n.content||n.children){const t=n.content||n.children;i=o.childType(t),d[i],d[i].call(this,t)}if(n.dataset){for(const t in n.dataset)Object.hasOwn(n.dataset,t)&&(c.dataset[t]="function"==typeof n.dataset[t]?n.dataset[t]():n.dataset[t]);s.push("dataset")}n.action&&(this.actionHandler(c,n.action),s.push("action"));const h=Br.subtract(s,Object.keys(n));for(a=h.length-1;a>=0;a--)c[h[a]]=n[h[a]];return l.children.length&&(c=this.create(l)),c})),e(this,"onRender",((t,e)=>{t.parentElement?e(t):window.requestAnimationFrame((()=>this.onRender(t,e)))})),e(this,"toggleElementsByStr",((t,e)=>{const n=[];return Dd.elementsContainText(t,e,((t,e)=>{e?(t.style.display="block",n.push(t)):t.style.display="none"})),n})),e(this,"elementsContainText",((t,e,n)=>{const o=[];return Hr(t,(t=>{const i=-1!==t.textContent.toLowerCase().indexOf(e.toLowerCase());null==n||n(t,i),i&&o.push(t)})),o})),e(this,"generateOption",(({type:t="option",label:e,value:n,i:o=0,selected:i})=>({tag:"option"===t?"option":"input",attrs:{type:t,value:n||`${t}-${o}`,["option"===t?"selected":"checked"]:i||!o},config:{label:e||z.get("labelCount",{label:z.get("option"),count:o})}}))),e(this,"makeOption",(([t,e],n,o)=>{const i={value:t,label:z.get(`${o}.${e}`)||e};return t===n&&(i.selected=!0),i})),e(this,"requiredMark",(()=>({tag:"span",className:"text-error",children:"*"}))),e(this,"removeEmpty",(t=>{const e=t.parentElement,n=Ii(t),o=e.getElementsByClassName(`formeo-${n}`);if(this.remove(t),!o.length){if(!this.isStage(e))return this.removeEmpty(e);this.emptyClass(e)}})),e(this,"btnTemplate",(({title:t="",...e})=>({tag:"button",attrs:{type:"button",title:t},...e}))),e(this,"isControls",(t=>Ii(t)===V)),e(this,"isStage",(t=>Ii(t)===I)),e(this,"isRow",(t=>Ii(t)===F)),e(this,"isColumn",(t=>Ii(t)===R)),e(this,"isField",(t=>Ii(t)===B)),e(this,"asComponent",(t=>_d[`${Ii(t)}s`].get(t.id))),this.options=Object.create(null),this.styleSheet=(()=>{const t=document.createElement("style");return t.setAttribute("media","screen"),t.setAttribute("type","text/css"),t.appendChild(document.createTextNode("")),document.head.appendChild(t),t.sheet})()}set setOptions(t){this.options=Bi(Object.assign({},this.options,t))}processTagName(t){let e;if("string"==typeof t&&(e=t,t={tag:e}),t.attrs){const{tag:n,...o}=t.attrs;if(n)if("string"==typeof n)e=n;else{e=(n.find((t=>!0===t.selected))||n[0]).value}t.attrs=o}return t.tag=e||t.tag||"div",t}actionHandler(t,e){const n={onRender:Dd.onRender,render:Dd.onRender},o=["focus","blur"];return Object.entries(e).map((([e,i])=>(Array.isArray(i)?i:[i]).map((i=>{const r=n[e]||(t=>(e,n)=>e.addEventListener(t,n,o.includes(t)))(e);return r(t,i)}))))}get icons(){if(this.iconSymbols)return this.iconSymbols;const t=document.querySelectorAll("#formeo-sprite svg symbol");return this.iconSymbols=Array.from(t).reduce(((t,e)=>{var n;return t[e.id.replace(wt,"")]=Dd.create({tag:"svg",attrs:{className:`svg-icon ${n=e.id}`},children:[{tag:"use",attrs:{"xmlns:xlink":"http://www.w3.org/1999/xlink","xlink:href":`#${n}`}}]}),t}),{}),this.iconSymbols}icon(t=null,e=[]){var n;if(!t)return;const o=this.icons[t];if(o){const t=o.cloneNode(!0);return t.classList.add(...e),t.outerHTML}return(null==(n=Ad[Dd.options.iconFont])?void 0:n.call(Ad,t))||t}processAttrs(t,e,n){const{attrs:o={}}=t;n||!o.name&&this.isInput(t.tag)&&e.setAttribute("name",Ri(t));for(const i of Object.keys(o)){const t=Br.safeAttrName(i);let n=o[i]||"";if(Array.isArray(n))if("object"==typeof n[0]){const t=n.filter((t=>!0===t.selected));n=t.length?t[0].value:n[0].value}else n=n.join(" ");if(n)if("OPTION"===e.tagName&&"selected"===t){const o=setTimeout((()=>{e.setAttribute(t,n),clearTimeout(o)}),0)}else e.setAttribute(t,n)}}processOptions(t,e,n){const{action:o,attrs:i}=e,r=i.type||e.tag,s=i.id||e.id;return t.map(((t,i)=>{var a;const{label:l,...c}=t,d=()=>{const a={tag:"input",attrs:{name:s,type:r,value:t.value||"",id:`${s}-${i}`,...c},action:o},l={tag:"label",attrs:{for:`${s}-${i}`},config:{inputWrap:"form-check"},children:t.label},d={children:[a,l],className:[`f-${r}`]};return e.attrs.className&&(e.config.inputWrap=e.attrs.className),e.config.inline&&d.className.push(`f-${r}-inline`),t.selected&&(a.attrs.checked=!0),n&&(l.attrs.contenteditable=!0),d},h={select:()=>({tag:"option",attrs:t,children:t.label}),button:t=>{const{type:n,label:o,className:i,id:r}=t;return{...e,attrs:{type:n},className:i,id:r||Ri(),options:void 0,children:o,action:e.action}},checkbox:d,radio:d};return null==(a=h[r])?void 0:a.call(h,t)}))}holdsContent(t){return-1!==t.outerHTML.indexOf("/")}isBlockInput(t){return!this.isInput(t)&&this.holdsContent(t)}isInput(t){return"string"!=typeof t&&(t=t.tagName),-1!==["input","textarea","select"].indexOf(t)}parsedHtml(t){const e=document.createElement("textarea");return e.innerHTML=t,e.textContent}labelAfter(t){const e=Br.get(t,"attrs.type"),n=Br.get(t,"config.labelAfter");return void 0!==n?n:"checkbox"===e||"radio"===e}label(t,e){const n=Br.get(t,"attrs.required");let{config:{label:o=""}}=t;const{id:i,attrs:r}=t;"function"==typeof o&&(o=o());const s={tag:"label",attrs:{for:i||(null==r?void 0:r.id)},className:[],children:[o,n&&this.requiredMark()],action:{}};return e&&(delete s.attrs.for,s.attrs.contenteditable=!0,s.fMap=e),s}childType(t){return void 0===t?t:[["array",t=>Array.isArray(t)],["node",t=>t instanceof window.Node||t instanceof window.HTMLElement],["component",()=>null==t?void 0:t.dom],[typeof t,()=>!0]].find((e=>e[1](t)))[0]}getStyle(t,e=!1){let n;return window.getComputedStyle?n=window.getComputedStyle(t,null):t.currentStyle&&(n=t.currentStyle),e?n[e]:n}getElement(t){return{node:()=>t,object:()=>document.getElementById(t.id),string:()=>document.getElementById(t)}[this.childType(t)]()}empty(t){for(;t.firstChild;)this.remove(t.firstChild);return t}remove(t){const e=Ii(t);return e?_d.remove(`${e}s.${t.id}`):t.parentElement.removeChild(t)}removeClasses(t,e){const n={string:t=>t.classList.remove(e),array:t=>{for(const n of e)t.classList.remove(n)}};n.object=n.string,Br.forEach(t,n[this.childType(e)])}addClasses(t,e){const n={string:t=>t.classList.add(e),array:t=>{for(const n of e)t.classList.add(n)}};Br.forEach(t,n[this.childType(e)])}formGroup(t,e=""){return{className:["f-field-group",e],children:t}}coords(t){const e=t.getBoundingClientRect(),n=document.body.getBoundingClientRect();return{pageX:e.left+e.width/2,pageY:e.top-n.top-e.height/2}}clearStage(t){t.classList.add("removing-all-fields");Wr.slideUp(t,600,(()=>{Dd.empty(t),t.classList.remove("removing-all-fields"),Dd.emptyClass(t),Wr.slideDown(t,300)}))}toggleSortable(t,e){const n=Ii(t);if(!n)return;const o=Ii(t.parentElement),i=Dd[n].get(t.id).sortable;e||(e=!i.option("disabled")),i.option("disabled",e),o&&["rows","columns","stages"].includes(o)&&this.toggleSortable(t.parentElement,e)}emptyClass(t){const e=t.getElementsByClassName(G.get(t.classList.item(0)));t.classList.toggle("empty",!e.length)}};const kd={"en-US":"English",dir:"ltr","action.add.attrs.attr":"What attribute would you like to add?","action.add.attrs.value":"Default Value",addOption:"Add Option",allFieldsRemoved:"All fields were removed.",allowSelect:"Allow Select",attribute:"Attribute",attributes:"Attributes","attrs.class":"Class","attrs.className":"Class","attrs.dir":"Direction","attrs.id":"Id","attrs.required":"Required","attrs.style":"Style","attrs.title":"Title","attrs.type":"Type","attrs.value":"Value",autocomplete:"Autocomplete",button:"Button",cannotBeEmpty:"This field cannot be empty",checkbox:"Checkbox",checkboxes:"Checkboxes",class:"Class",clear:"Clear",clearAllMessage:"Are you sure you want to clear all fields?",close:"Close",column:"Column",confirmClearAll:"Are you sure you want to remove all fields?",content:"Content",control:"Control","controlGroups.nextGroup":"Next Group","controlGroups.prevGroup":"Previous Group","controls.form.button":"Button","controls.form.checkbox-group":"Checkbox Group","controls.form.input.date":"Date","controls.form.input.email":"Email","controls.form.input.file":"File Upload","controls.form.input.hidden":"Hidden Input","controls.form.input.number":"Number","controls.form.input.text":"Text Input","controls.form.radio-group":"Radio Group","controls.form.select":"Select","controls.form.textarea":"TextArea","controls.groups.form":"Form Fields","controls.groups.html":"HTML Elements","controls.groups.layout":"Layout","controls.html.divider":"Divider","controls.html.header":"Header","controls.html.paragraph":"Paragraph","controls.layout.column":"Column","controls.layout.row":"Row","controls.filteringTerm":'Filtering "{term}"',copy:"Copy To Clipboard",danger:"Danger",description:"Help Text",descriptionField:"Description",defineColumnLayout:"Define a column layout",defineColumnWidths:"Define column widths","editing.row":"Editing Row",editorTitle:"Form Elements",field:"Field",fieldNonEditable:"This field cannot be edited.",fieldRemoveWarning:"Are you sure you want to remove this field?",fileUpload:"File Upload",formUpdated:"Form Updated",getStarted:"Drag a field from the right to get started.",group:"Group",grouped:"Grouped",hidden:"Hidden Input",hide:"Edit",htmlElements:"HTML Elements",if:"If",info:"Info","input.date":"Date","input.text":"Text",label:"Label",labelCount:"{label} {count}",labelEmpty:"Field Label cannot be empty",layout:"Layout",limitRole:"Limit access to one or more of the following roles:",mandatory:"Mandatory",maxlength:"Max Length","meta.group":"Group","meta.icon":"Ico","meta.label":"Label",minOptionMessage:"This field requires a minimum of 2 options",name:"Name",no:"No",number:"Number",off:"Off",on:"On",option:"Option",optional:"optional",optionEmpty:"Option value required",optionLabel:"Option {count}",options:"Options",order:"Order","panel.label.attrs":"Attributes","panel.label.conditions":"Conditions","panel.label.config":"Configuration","panel.label.meta":"Meta","panel.label.options":"Options","panelEditButtons.attrs":"+ Attribute","panelEditButtons.options":"+ Option","panelEditButtons.conditions":"+ Condition",placeholder:"Placeholder","placeholder.className":"space separated classes","placeholder.email":"Enter you email","placeholder.label":"Label","placeholder.password":"Enter your password","placeholder.placeholder":"Placeholder","placeholder.text":"Enter some Text","placeholder.textarea":"Enter a lot of text","placeholder.value":"Value",preview:"Preview",primary:"Primary",remove:"Remove",removeType:"Remove {type}",removeMessage:"Remove Element",required:"Required",reset:"Reset",richText:"Rich Text Editor",roles:"Access",row:"Row","row.makeInputGroup":"Make this row an input group.","row.makeInputGroupDesc":"Input Groups enable users to add sets of inputs at a time.","row.settings.fieldsetWrap":"Wrap row in a <fieldset> tag","row.settings.fieldsetWrap.aria":"Wrap Row in Fieldset",cannotClearFields:"There are no fields to clear",save:"Save",secondary:"Secondary",select:"Select",selectColor:"Select Color",selectionsMessage:"Allow Multiple Selections",selectOptions:"Options",separator:"Separator",settings:"Settings",size:"Size",sizes:"Sizes","sizes.lg":"Large","sizes.m":"Default","sizes.sm":"Small","sizes.xs":"Extra Small",style:"Style",styles:"Styles","styles.btn":"Button Style","styles.btn.danger":"Danger","styles.btn.default":"Default","styles.btn.info":"Info","styles.btn.primary":"Primary","styles.btn.success":"Success","styles.btn.warning":"Warning",subtype:"Type",success:"Success",text:"Text Field",then:"Then",toggle:"Toggle",ungrouped:"Un-Grouped",warning:"Warning",yes:"Yes",and:"and",or:"or","field.property.value":"value","field.property.label":"label","field.property.valid":"valid","field.property.invalid":"not valid","field.property.isVisible":"is visible","field.property.isNotVisible":"is not visible",newOptionLabel:"New {type}","operator.visible":"visible","operator.notVisible":"not visible","operator.equals":"equals","operator.notEquals":"not equal","operator.contains":"contains","operator.notContains":"not contains","condition.target.placeholder":"target","if.condition.target.placeholder":"target / value","if.condition.source.placeholder":"source","then.condition.target.placeholder":"target","condition.value.placeholder":"value",attributeNotPermitted:'Attribute "{attribute}" is not permitted, please choose another.'};z.addLanguage("en-US",kd);const Td={get editor(){return{stickyControls:!1,allowEdit:!0,dataType:"json",debug:!1,sessionStorage:!1,editorContainer:null,external:{},svgSprite:null,iconFont:null,config:{},events:{},actions:{},controls:{},polyfills:Rr(),i18n:{location:"https://draggable.github.io/formeo/assets/lang/"}}}};let jd=class{constructor({formData:t,...e},n){const o=Bi(Td.editor,e),{actions:i,events:r,debug:s,config:a,editorContainer:l,...c}=o;l&&(this.editorContainer="string"==typeof l?document.querySelector(l):l),this.opts=c,Dd.setOptions=c,_d.config=a,this.userFormData=n||t,this.Components=_d,this.dom=Dd,Xr.init({debug:s,...r}),wc.init({debug:s,sessionStorage:c.sessionStorage,...i}),this.loadResources().then((()=>{c.allowEdit&&this.init()}))}get formData(){return this.Components.formData}set formData(t={}){this.load({...this.userFormData,...t},this.opts)}get json(){return this.Components.json}loadResources(){var t;const e=[];return this.opts.polyfills&&(t=>{const e=Array.isArray(t)?H.filter((({name:e})=>-1!==t.indexOf(e))):H;Promise.all(e.map((({src:t})=>Wc(t))))})(this.opts.polyfills),this.opts.style&&e.push(qc(this.opts.style)),this.opts.svgSprite?e.push(Gc(this.opts.svgSprite,Uc,(()=>Gc("https://draggable.github.io/formeo/assets/img/formeo-sprite.svg",Uc)))):e.push(Uc('image/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xml')),e.push(z.init({...this.opts.i18n,locale:null==(t=window.sessionStorage)?void 0:t.getItem(lt)})),Promise.all(e)}init(){rd.init(this.opts.controls,this.opts.stickyControls).then((t=>{this.controls=t,this.load(this.userFormData,this.opts),this.formId=_d.get("id"),this.i18n={setLang:t=>{var e;null==(e=window.sessionStorage)||e.setItem(lt,t);z.setCurrent(t).then((()=>{this.init()}),console.error)}},this.render()}))}load(t=this.userFormData,e=this.opts){return this.Components.load(t,e)}render(){if(!this.controls)return window.requestAnimationFrame((()=>this.render()));if(this.stages=Object.values(_d.get("stages")),this.opts.controlOnLeft)for(const e of this.stages)e.dom.style.order=1;const t={attrs:{className:"formeo formeo-editor",id:this.formId},content:[this.stages.map((({dom:t})=>t))]};z.current.dir&&(t.attrs.dir=z.current.dir,Dd.dir=z.current.dir),this.editor=Dd.create(t);(this.controls.container||this.editor).appendChild(this.controls.dom),this.editorContainer&&(Dd.empty(this.editorContainer),this.editorContainer.appendChild(this.editor)),Xr.formeoLoaded=new window.CustomEvent("formeoLoaded",{detail:{formeo:this}}),document.dispatchEvent(Xr.formeoLoaded)}};const Pd=t=>{const e=t.match(bt);return(null==e?void 0:e[0])||t},Ld=t=>t.replace(bt,Ri());let zd=class{constructor(t,n={}){e(this,"render",((t=this.form)=>{this.form=t;const e=document.getElementsByClassName("formeo-render").length,n={id:this.form.id,className:`formeo-render formeo formeo-rendered-${e}`,children:this.processedData};this.renderedForm=Dd.render(n),this.applyConditions();const o=this.container.querySelector(".formeo-render");o?o.replaceWith(this.renderedForm):this.container.appendChild(this.renderedForm)})),e(this,"orderChildren",((t,e)=>e.reduce(((e,n)=>(e.push(this.form[t][n]),e)),[]))),e(this,"prefixId",(t=>"f-"+t)),e(this,"processColumn",(({id:t,...e})=>({...e,id:this.prefixId(t),children:this.processFields(e.children),style:`width: ${e.config.width||"100%"}`}))),e(this,"processRows",(t=>this.orderChildren("rows",this.form.stages[t].children).reduce(((t,e)=>(e&&t.push(this.processRow(e)),t)),[]))),e(this,"cacheComponent",(t=>(this.components[Pd(t.id)]=t,t))),e(this,"processRow",((t,e="row")=>{const{config:n,id:o}=t,i=[`formeo-${e}-wrap`],r={...t,children:this.processColumns(t.id),id:this.prefixId(o)};this.cacheComponent(r);const s=[{condition:n.legend,result:()=>({tag:n.fieldset?"legend":"h3",children:n.legend})},{condition:!0,result:()=>r},{condition:n.inputGroup,result:()=>this.addButton(o)}].reduce(((t,{condition:e,result:n})=>(e&&t.push(n()),t)),[]);return n.inputGroup&&i.push("f-input-group-wrap"),{tag:n.fieldset?"fieldset":"div",id:Ri(),className:i,children:s}})),e(this,"cloneComponentData",(t=>{const{children:e=[],id:n,...o}=this.components[t];return Object.assign({},o,{id:Ld(n),children:e.length&&e.map((({id:t})=>this.cloneComponentData(Pd(t))))})})),e(this,"addButton",(t=>Dd.render({tag:"button",attrs:{className:"add-input-group btn pull-right",type:"button"},children:"Add +",action:{click:e=>{const n=e.target.parentElement,o=Dd.render(this.cloneComponentData(t));n.insertBefore(o,n.lastChild),o.appendChild(Dd.render(Dd.btnTemplate({className:"remove-input-group",children:Dd.icon("remove"),action:{mouseover:({target:t})=>t.parentElement.classList.add("will-remove"),mouseleave:({target:t})=>t.parentElement.classList.remove("will-remove"),click:({target:t})=>t.parentElement.remove()}})))}}}))),e(this,"processColumns",(t=>this.orderChildren("columns",this.form.rows[t].children).map((t=>this.cacheComponent(this.processColumn(t)))))),e(this,"processFieldsOrig",(t=>this.orderChildren("fields",t).map((({id:t,...e})=>this.cacheComponent(Object.assign({},e,{id:this.prefixId(t)})))))),e(this,"processFields",(t=>this.orderChildren("fields",t).map((({id:t,...e})=>{const{action:n={},dependencies:o={}}=this.elements[e.meta.id]||{};o&&Yc(o);const i=Bi({action:n},e);return this.cacheComponent({...i,id:this.prefixId(t)})})))),e(this,"applyConditions",(()=>{Object.values(this.components).forEach((({conditions:t})=>{t&&t.forEach(((t,e)=>{const{if:n,then:o}=t;n.forEach((t=>{const{source:e,...n}=t;if(Xi(e)){this.getComponents(e).forEach((t=>{const e=$d(t);e&&t.addEventListener(e,(t=>this.evaluateCondition(n,t)&&o.forEach((e=>this.execResult(e,t)))),!1);const i={target:t};this.evaluateCondition(n,i)&&o.forEach((t=>this.execResult(t,i)))}))}}))}))}))})),e(this,"evaluateCondition",(({sourceProperty:t,targetProperty:e,comparison:n,target:o},i)=>{var r;const s={equals:ma,notEquals:(t,e)=>!ma(t,e),contains:(t,e)=>t.includes(e),notContains:(t,e)=>!t.includes(e)},a=String(i.target[t]),l=String(Xi(o)?this.getComponent(o)[e]:o);return null==(r=s[n])?void 0:r.call(s,a,l)})),e(this,"execResult",(({assignment:t,target:e,targetProperty:n,value:o})=>{var i;const r={equals:t=>{var e;const i={value:()=>{t[n]=o},isNotVisible:()=>{t.parentElement.setAttribute("hidden",!0),t.required=!1},isVisible:()=>{t.parentElement.removeAttribute("hidden"),t.required=t._required}};null==(e=i[n])||e.call(i)}};if(Xi(e)){const n=this.getComponent(e);n&&void 0===n._required&&(n._required=n.required),null==(i=r[t])||i.call(r,n)}})),e(this,"getComponent",(t=>{const e=t.slice(t.indexOf(".")+1);return Yi(t)?this.external[e]:this.renderedForm.querySelector(`#f-${e}`)})),e(this,"getComponents",(t=>{const e=[],n=t.slice(t.indexOf(".")+1);return Yi(t)?e.push(this.external[n]):e.push(...this.renderedForm.querySelectorAll(`[name=f-${n}]`)),e}));const{renderContainer:o,external:i,elements:r}=(({editorContainer:t,renderContainer:e,...n})=>{const o=t=>"string"==typeof t?document.querySelector(t):t;return{...n,renderContainer:o(e),editorContainer:o(t)}})(t);this.container=o,this.form=n,this.external=i,this.dom=Dd,this.components=Object.create(null),this.elements=r}get processedData(){return Object.values(this.form.stages).map((t=>(t.children=this.processRows(t.id),t.className=I,Dd.render(t))))}};const $d=t=>{const[e]=[["input",t=>["textarea","text"].includes(t.type)],["change",t=>["select"].includes(t.tagName.toLowerCase())||["checkbox","radio"].includes(t.type)]].find((e=>e[1](t)))||[!1];return e};void 0!==window&&(window.FormeoEditor=jd,window.FormeoRenderer=zd);const Hd=jd,Vd=zd;export{Hd as F,Vd as a,o as g,j as t}; +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).formeo={})}(this,(function(t){"use strict";var e=Object.defineProperty,n=(t,n,o)=>((t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o)(t,"symbol"!=typeof n?n+"":n,o);const o={extension:".lang",location:"assets/lang/",langs:["en-US"],locale:"en-US",override:{}};class i{constructor(t=o){this.langs=Object.create(null),this.loaded=[],this.processConfig(t)}processConfig(t){const{location:e,...n}={...o,...t},i=e.replace(/\/?$/,"/");this.config={location:i,...n};const{override:r,preloaded:s={}}=this.config,a=Object.entries(this.langs).concat(Object.entries(r||s));this.langs=a.reduce(((t,[e,n])=>(t[e]=this.applyLanguage(e,n),t)),{}),this.locale=this.config.locale||this.config.langs[0]}init(t){return this.processConfig({...this.config,...t}),this.setCurrent(this.locale)}addLanguage(t,e={}){e="string"==typeof e?i.processFile(e):e,this.applyLanguage(t,e),this.config.langs.push("locale")}getValue(t,e=this.locale){var n;return(null==(n=this.langs[e])?void 0:n[t])||this.getFallbackValue(t)}getFallbackValue(t){const e=Object.values(this.langs).find((e=>e[t]));return null==e?void 0:e[t]}makeSafe(t){const e={"{":"\\{","}":"\\}","|":"\\|"};return t=t.replace(/[{}|]/g,(t=>e[t])),new RegExp(t,"g")}put(t,e){return this.current[t]=e,e}get(t,e){const n=this;let o=this.getValue(t);if(!o)return;const i=o.match(/\{[^}]+?\}/g);if(e&&i)if("object"==typeof e)for(const r of i){const t=r.substring(1,r.length-1);o=o.replace(n.makeSafe(r),e[t]||"")}else o=o.replace(/\{[^}]+?\}/g,e);return o}static processFile(t){return i.fromFile(t.replace(/\n\n/g,"\n"))}static fromFile(t){const e=t.split("\n"),n={};for(let o,i=0;i{const r=i.processFile(e);return n.applyLanguage(t,r),n.loaded.push(t),o(n.langs[t])})).catch((e=>{const i=n.applyLanguage(t);o(i)}))}))}applyLanguage(t,e={}){const n=this.config.override[t]||{},o=this.langs[t]||{};return this.langs[t]={...o,...e,...n},this.langs[t]}get getLangs(){return this.config.langs}async setCurrent(t="en-US"){return await this.loadLang(t),this.locale=t,this.current=this.langs[t],this.current}}const r=new i,s="formeo",a=[{name:"cssPreload",src:"//cdnjs.cloudflare.com/ajax/libs/loadCSS/2.0.1/cssrelpreload.min.js"},{name:"mutationObserver",src:"//cdn.jsdelivr.net/npm/mutationobserver-shim/dist/mutationobserver.min.js"},{name:"fetch",src:"https://unpkg.com/unfetch/polyfill"}],l="control-group",c=`${s}-stage`,d=`${s}-row`,h=`${s}-column`,u=`${s}-field`,p="custom-column-widths",m="column-preset",g="resizing-columns",f=new Map([[c,d],[d,h],[h,u]]),v=["external","stages","rows","columns","fields"],b=["stage","row","column","field"].reduce(((t,e)=>({...t,[e]:e})),{}),y=[{name:"controls",className:l},{name:"stage",className:c},{name:"row",className:d},{name:"column",className:h},{name:"field",className:u}],w={controls:l,stage:c,row:d,column:h,field:u},x=Object.entries(w).reduce(((t,[e,n])=>({...t,[n]:e})),{}),C=Object.values(w),S=new RegExp(`${C.join("|")}`,"g"),E=y.map((({name:t},e,n)=>{const{name:o}=n[e+1]||{};return o&&[t,o]})).filter(Boolean),O=E.slice().map((t=>t.slice().reverse())).reverse(),_=new Map(E),M=new Map(O.slice()),N=new Map([[{value:"100.0",label:"100%"}],[{value:"50.0,50.0",label:"50 | 50"},{value:"33.3,66.6",label:"33 | 66"},{value:"66.6,33.3",label:"66 | 33"}],[{value:"33.3,33.3,33.3",label:"33 | 33 | 33"},{value:"25.0,25.0,50.0",label:"25 | 25 | 50"},{value:"50.0,25.0,25.0",label:"50 | 25 | 25"},{value:"25.0,50.0,25.0",label:"25 | 50 | 25"}],[{value:"25.0,25.0,25.0,25.0",label:"25 | 25 | 25 | 25"}],[{value:"20.0,20.0,20.0,20.0,20.0",label:"20 | 20 | 20 | 20 | 20"}],[{value:"16.66,16.66,16.66,16.66,16.66,16.66",label:"16.66 | 16.66 | 16.66 | 16.66 | 16.66 | 16.66"}]].reduce(((t,e,n)=>(t.push([n,e]),t)),[])),A=[{type:"added",condition:(t,e)=>Boolean(void 0===t&&e)}],j=`${s}-formData`,k=`${s}-locale`,D=333,P=Math.round(166.5),T=Math.round(666),z="formeoSaved",L="formeoUpdated",$="formeoOnRender",H=["label","logical","source","thenTarget","sourceProperty","comparison","target","targetProperty","assignment","value"],V={value:"attrs.value",checked:"attrs.checked",isVisible:"config.isVisible",isNotVisible:"config.isNotVisible"},I={comparison:{equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},assignment:{equals:"="},logical:{and:"&&",or:"||"},property:V},F=/(\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b)/gi,B=/\bcol-\w+-\d+/g,R="f-i-";var W="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function q(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var U=function(){this.__data__=[],this.size=0};var X=function(t,e){return t===e||t!=t&&e!=e},G=X;var Y=function(t,e){for(var n=t.length;n--;)if(G(t[n][0],e))return n;return-1},Z=Y,J=Array.prototype.splice;var K=Y;var Q=Y;var tt=Y;var et=U,nt=function(t){var e=this.__data__,n=Z(e,t);return!(n<0)&&(n==e.length-1?e.pop():J.call(e,n,1),--this.size,!0)},ot=function(t){var e=this.__data__,n=K(e,t);return n<0?void 0:e[n][1]},it=function(t){return Q(this.__data__,t)>-1},rt=function(t,e){var n=this.__data__,o=tt(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};function st(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=9007199254740991},Tn=Pt,zn=Pn;var Ln=function(t){return null!=t&&zn(t.length)&&!Tn(t)},$n=Ln,Hn=Cn;var Vn=function(t){return Hn(t)&&$n(t)},In={exports:{}};var Fn=function(){return!1};!function(t,e){var n=ft,o=Fn,i=e&&!e.nodeType&&e,r=i&&t&&!t.nodeType&&t,s=r&&r.exports===i?n.Buffer:void 0,a=(s?s.isBuffer:void 0)||o;t.exports=a}(In,In.exports);var Bn=In.exports,Rn=Nt,Wn=gn,qn=Cn,Un=Function.prototype,Xn=Object.prototype,Gn=Un.toString,Yn=Xn.hasOwnProperty,Zn=Gn.call(Object);var Jn=function(t){if(!qn(t)||"[object Object]"!=Rn(t))return!1;var e=Wn(t);if(null===e)return!0;var n=Yn.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Gn.call(n)==Zn},Kn=Nt,Qn=Pn,to=Cn,eo={};eo["[object Float32Array]"]=eo["[object Float64Array]"]=eo["[object Int8Array]"]=eo["[object Int16Array]"]=eo["[object Int32Array]"]=eo["[object Uint8Array]"]=eo["[object Uint8ClampedArray]"]=eo["[object Uint16Array]"]=eo["[object Uint32Array]"]=!0,eo["[object Arguments]"]=eo["[object Array]"]=eo["[object ArrayBuffer]"]=eo["[object Boolean]"]=eo["[object DataView]"]=eo["[object Date]"]=eo["[object Error]"]=eo["[object Function]"]=eo["[object Map]"]=eo["[object Number]"]=eo["[object Object]"]=eo["[object RegExp]"]=eo["[object Set]"]=eo["[object String]"]=eo["[object WeakMap]"]=!1;var no=function(t){return to(t)&&Qn(t.length)&&!!eo[Kn(t)]};var oo=function(t){return function(e){return t(e)}},io={exports:{}};!function(t,e){var n=pt,o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,r=i&&i.exports===o&&n.process,s=function(){try{var t=i&&i.require&&i.require("util").types;return t||r&&r.binding&&r.binding("util")}catch(e){}}();t.exports=s}(io,io.exports);var ro=io.exports,so=no,ao=oo,lo=ro&&ro.isTypedArray,co=lo?ao(lo):so;var ho=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},uo=qe,po=X,mo=Object.prototype.hasOwnProperty;var go=function(t,e,n){var o=t[e];mo.call(t,e)&&po(o,n)&&(void 0!==n||e in t)||uo(t,e,n)},fo=go,vo=qe;var bo=function(t,e,n,o){var i=!n;n||(n={});for(var r=-1,s=e.length;++r-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}},vi=fi(mi),bi=li,yi=hi,wi=vi;var xi=X,Ci=Ln,Si=wo,Ei=At;var Oi=function(t,e){return wi(yi(t,e,bi),t+"")},_i=function(t,e,n){if(!Ei(n))return!1;var o=typeof e;return!!("number"==o?Ci(n)&&Si(e,n.length):"string"==o&&e in n)&&xi(n[e],t)};var Mi=ai;const Ni=q(function(t){return Oi((function(e,n){var o=-1,i=n.length,r=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(r=t.length>3&&"function"==typeof r?(i--,r):void 0,s&&_i(n[0],n[1],s)&&(r=i<3?void 0:r,i=1),e=Object(e);++ocrypto.randomUUID(),ji=(t="",e)=>{if(!e)return!1;const n=/[|\\{}()[\]^*$+?.]/g;let o="string"==typeof e?[e]:e;o=o.map((t=>"*"===t?"":t.replace(n,"\\$&")));let i=!0;return o.length&&(i=!new RegExp(o.join("|"),"i").exec(t)),i},ki=t=>{var e;const n=null==(e=t.className)?void 0:e.match(S);return n&&x[n[0]]},Di=t=>Array.from(new Set(t)),Pi=t=>{let e;if(t){const{attrs:n={}}=t;e=n.id||t.id||Ai(),t.id=e}else e=Ai();return e},Ti=(t,e,n=Object.create(null))=>Ni({},t,e,((t,e)=>{if(Array.isArray(t))return Array.isArray(e)?Di(n.mergeArray?t.concat(e):e):e})),zi=t=>{let e;if(null===t||!("object"==typeof t)||t instanceof Promise)return t;if(t instanceof Date)return e=new Date,e.setTime(t.getTime()),e;if(Array.isArray(t)){e=[];for(let n=0,o=t.length;nt/e*100,$i=t=>`${t.toString()}%`,Hi=Object.create(null,{get:{value:t=>{var e;const n=null==(e=window.sessionStorage)?void 0:e.getItem(t);try{return JSON.parse(n)}catch(o){return n}}},set:{value:(t,e)=>{var n;try{return null==(n=window.sessionStorage)?void 0:n.setItem(t,JSON.stringify(e))}catch(o){}}}}),Vi=t=>v.some((e=>new RegExp(`^${e}.`).test(t))),Ii=t=>t.startsWith("external");function Fi(t,e){let n=!1;return function(){if(!n){t(...arguments),n=!0;const o=setTimeout((()=>{n=!1,clearTimeout(o)}),e)}}}function Bi(t){return t}function Ri(){}var Wi=Nt,qi=Cn;var Ui=function(t){return"symbol"==typeof t||qi(t)&&"[object Symbol]"==Wi(t)},Xi=Dn,Gi=Ui,Yi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Zi=/^\w*$/;var Ji=function(t,e){if(Xi(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Gi(t))||(Zi.test(t)||!Yi.test(t)||null!=e&&t in Object(e))},Ki=je;function Qi(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var o=arguments,i=e?e.apply(this,o):o[0],r=n.cache;if(r.has(i))return r.get(i);var s=t.apply(this,o);return n.cache=r.set(i,s)||r,s};return n.cache=new(Qi.Cache||Ki),n}Qi.Cache=Ki;var tr=Qi;var er=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nr=/\\(\\)?/g,or=function(t){var e=tr(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(er,(function(t,n,o,i){e.push(o?i.replace(nr,"$1"):n||t)})),e}));var ir=function(t,e){for(var n=-1,o=null==t?0:t.length,i=Array(o);++n{const e={...t},n={string:()=>"",boolean:()=>!1,object:t=>jr(t)};for(const o of Object.keys(t)){const i=typeof t[o];n[i]&&(e[o]=n[i](t[o]))}return e},kr="a an and as at but by for for from in into near nor of on onto or the to with".split(" ").map((t=>`\\s${t}\\s`)),Dr=new RegExp(`(?!${kr.join("|")})\\w\\S*`,"g"),Pr=/\s+/g;function Tr(t){if("string"!=typeof t)return t;if(t.trim().match(Pr))return t;return t.replace(Dr,(t=>t.charAt(0).toUpperCase()+t.substring(1).replace(/[A-Z]/g,(t=>` ${t}`))))}const zr=(t,e="-")=>t.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,e),Lr=t=>Number.isInteger(Number(t)),$r=(t,e)=>{const n=e||t.parentElement;return Array.prototype.slice.call(n.childNodes).indexOf(t)},Hr=(t,e,n)=>{const o=n.split("||"),i=Di(e).map((e=>t.find((t=>{const n=o.find((e=>!!Nr(t,e)));return n&&Nr(t,n)===e})))).filter(Boolean).concat(t);return Di(i)},Vr=(t,e,n)=>{for(let o=0;o{const n=[];return Vr(t,((t,o)=>n.push(e(t,o)))),n},Fr={},Br=t=>t.replace(/\b\w/g,(t=>t.toUpperCase())),Rr=()=>-1!==window.navigator.userAgent.indexOf("MSIE "),Wr={capitalize:Br,safeAttrName:t=>{if(Fr[t])return Fr[t];const e=({className:"class"}[t]||t).replace(/^\d/,"").replace(/[^a-zA-Z0-9-:]/g,"");return Fr[t]=e,e},forEach:Vr,copyObj:t=>window.JSON.parse(window.JSON.stringify(t)),map:Ir,subtract:(t,e)=>e.filter((e=>!~t.indexOf(e))),indexOfNode:$r,isInt:Lr,get:Nr,orderObjectsBy:Hr,isIE:Rr},qr={getStyle:(t,e=!1)=>{let n;return window.getComputedStyle?n=window.getComputedStyle(t,null):t.currentStyle&&(n=t.currentStyle),e?n[e]:n},fadeOut:(t,e=250)=>{const n=1/(e/60);t.style.opacity=1,function e(){const o=Number(t.style.opacity)-n;o>0?(t.style.opacity=o,window.requestAnimationFrame(e)):t.remove()}()},slideDown:(t,e=250,n=!1)=>{t.style.display="block";const o=qr.getStyle(t),i=parseInt(o.height,10),r=i/(e/60);t.style.height="0px",function e(){const o=parseFloat(t.style.height),s=o+r;o{const o=qr.getStyle(t),i=parseInt(o.height),r=o.overflow;t.style.overflow="hidden",t.style.height=i+"px";const s=o.minHeight;t.style.minHeight="auto";const a=parseFloat(i/(e/60)).toFixed(2);!function e(){const o=parseInt(t.style.height,10)-a;o>0?(t.style.height=o+"px",window.requestAnimationFrame(e)):(t.style.overflow=r,t.style.display="none",t.style.minHeight=s,delete t.style.height,n&&n(t))}()},slideToggle:(t,e=250,n="none"===qr.getStyle(t,"display"))=>{n?qr.slideDown(t,e):qr.slideUp(t,e)}},Ur="no-transition",Xr={debug:!1,bubbles:!0,formeoLoaded:t=>{},onAdd:()=>{},onUpdate:t=>Yr.opts.debug&&void 0,onUpdateStage:t=>Yr.opts.debug&&void 0,onUpdateRow:t=>Yr.opts.debug&&void 0,onUpdateColumn:t=>Yr.opts.debug&&void 0,onUpdateField:t=>Yr.opts.debug&&void 0,onRender:t=>Yr.opts.debug&&void 0,onSave:t=>{},confirmClearAll:t=>{window.confirm(t.confirmationMessage)&&t.clearAllAction(t)}},Gr=({src:t,...e},n=L)=>{const o=new window.CustomEvent(n,{detail:e,bubbles:Yr.opts.debug||Yr.opts.bubbles});return o.data=(t||document).dispatchEvent(o),o},Yr={init:function(t){return this.opts={...Xr,...t},this},formeoSaved:t=>Gr(t,z),formeoUpdated:t=>Gr(t,L),formeoCleared:t=>Gr(t,"formeoCleared"),formeoOnRender:t=>Gr(t,$),formeoConditionUpdated:t=>Gr(t,"formeoConditionUpdated")},Zr=Fi((()=>{Yr.opts.onUpdate({timeStamp:window.performance.now(),type:L,detail:Ad.formData})}),P);let Jr;document.addEventListener(L,Zr),document.addEventListener("formeoUpdatedStage",(t=>{const{timeStamp:e,type:n,detail:o}=t;Yr.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedRow",(t=>{const{timeStamp:e,type:n,detail:o}=t;Yr.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedColumn",(t=>{const{timeStamp:e,type:n,detail:o}=t;Yr.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedField",(t=>{const{timeStamp:e,type:n,detail:o}=t;Yr.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener($,(t=>{const{timeStamp:e,type:n,detail:o}=t;Yr.opts.onRender({timeStamp:e,type:n,detail:o})})),document.addEventListener("confirmClearAll",(t=>{t={timeStamp:t.timeStamp,type:t.type,confirmationMessage:t.detail.confirmationMessage,clearAllAction:t.detail.clearAllAction,btnCoords:t.detail.btnCoords},Yr.opts.confirmClearAll(t)})),document.addEventListener(z,(({timeStamp:t,type:e,detail:{formData:n}})=>{const o={timeStamp:t,type:e,formData:n};Yr.opts.onSave(o)})),document.addEventListener("formeoLoaded",(t=>{Yr.opts.formeoLoaded(t.detail.formeo)})),window.addEventListener("resize",(function(){Jr=Jr||window.requestAnimationFrame((()=>{Jr=!1,Object.values(Ed.data).forEach((t=>{t.dom.classList.add(Ur),_d.dom.classList.add(Ur),_d.panels.nav.refresh(),t.refreshFieldPanels()}))}))}));var Kr=je,Qr=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},ts=function(t){return this.__data__.has(t)};function es(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Kr;++ea))return!1;var c=r.get(t),d=r.get(e);if(c&&d)return c==e&&d==t;var h=-1,u=!0,p=2&n?new ns:void 0;for(r.set(t,e),r.set(e,t);++hJSON.stringify(t,null,e))),n(this,"get",(t=>Nr(this.data,t))),n(this,"getChangeType",((t,e)=>{const n=A.find((({condition:n})=>n(t,e)))||{type:"unknown"};return n.desc="added"===n.type?`${t} to ${e}`:e,n})),n(this,"add",((t,e=Object.create(null))=>{const{id:n}=e,o=t||n||Pi();return this.set(o,e)})),n(this,"remove",(t=>{const e=t.split("."),n=e.pop(),o=this.get(e);return Array.isArray(o)?o.splice(Number(n),1):delete o[n],o})),n(this,"getData",(()=>Object.entries(this.data).reduce(((t,[e,n])=>(t[e]=(null==n?void 0:n.data)?n.getData():n,t)),{}))),n(this,"setCallbacks",{}),n(this,"configVal",Object.create(null)),this.name=t,this.data=e,this.dataPath=""}get size(){return Object.keys(this.data).length}get js(){return this.data}get json(){return this.data}set(t,e){const n=Nr(this.data,t);if(ga(n,e))return this.data;const o=Ar(this.data,t,e),i=Array.isArray(t)?t.join("."):t,r=Object.keys(this.setCallbacks).filter((t=>new RegExp(t).test(i))),s={newVal:e,oldVal:n,path:t};for(const a of r)for(const t of this.setCallbacks[a])t(s);if(!this.disableEvents){const i=this.getChangeType(n,e),r={entity:this,dataPath:this.dataPath.replace(/\.+$/,""),changePath:this.dataPath+t,value:e,data:o,change:`${i.type}: ${i.desc}`,src:this.dom};n&&(r.previousValue=n),Yr.formeoUpdated(r)}return o}addSetCallback(t,e){this.setCallbacks[t]?this.setCallbacks[t].push(e):this.setCallbacks[t]=[e]}removeSetCallback(t,e){this.setCallbacks[t]=this.setCallbacks[t].filter((t=>t!==e))}empty(){this.data=Object.create(null)}} +/**! + * Sortable 1.15.3 + * @author RubaXa + * @author owenm + * @license MIT + */function va(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function ba(t){for(var e=1;e=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Sa(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var Ea=Sa(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Oa=Sa(/Edge/i),_a=Sa(/firefox/i),Ma=Sa(/safari/i)&&!Sa(/chrome/i)&&!Sa(/android/i),Na=Sa(/iP(ad|od|hone)/i),Aa=Sa(/chrome/i)&&Sa(/android/i),ja={capture:!1,passive:!1};function ka(t,e,n){t.addEventListener(e,n,!Ea&&ja)}function Da(t,e,n){t.removeEventListener(e,n,!Ea&&ja)}function Pa(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(n){return!1}return!1}}function Ta(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function za(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&Pa(t,e):Pa(t,e))||o&&t===n)return t;if(t===n)break}while(t=Ta(t))}return null}var La,$a=/\s+/g;function Ha(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace($a," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace($a," ")}}function Va(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function Ia(t,e){var n="";if("string"==typeof t)n=t;else do{var o=Va(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Fa(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i=Ra(o)[n]))return o;if(o===Ba())break;o=Ya(o,!1)}return!1}function qa(t,e,n,o){for(var i=0,r=0,s=t.children;r2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,i=Ca(n,sl);rl.pluginEvent.bind(Ql)(t,e,ba({dragEl:cl,parentEl:dl,ghostEl:hl,rootEl:ul,nextEl:pl,lastDownEl:ml,cloneEl:gl,cloneHidden:fl,dragStarted:Al,putSortable:Cl,activeSortable:Ql.active,originalEvent:o,oldIndex:vl,oldDraggableIndex:yl,newIndex:bl,newDraggableIndex:wl,hideGhostForTarget:Yl,unhideGhostForTarget:Zl,cloneNowHidden:function(){fl=!0},cloneNowShown:function(){fl=!1},dispatchSortableEvent:function(t){ll({sortable:e,name:t,originalEvent:o})}},i))};function ll(t){!function(t){var e=t.sortable,n=t.rootEl,o=t.name,i=t.targetEl,r=t.cloneEl,s=t.toEl,a=t.fromEl,l=t.oldIndex,c=t.newIndex,d=t.oldDraggableIndex,h=t.newDraggableIndex,u=t.originalEvent,p=t.putSortable,m=t.extraEventProperties;if(e=e||n&&n[el]){var g,f=e.options,v="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||Ea||Oa?(g=document.createEvent("Event")).initEvent(o,!0,!0):g=new CustomEvent(o,{bubbles:!0,cancelable:!0}),g.to=s||n,g.from=a||n,g.item=i||n,g.clone=r,g.oldIndex=l,g.newIndex=c,g.oldDraggableIndex=d,g.newDraggableIndex=h,g.originalEvent=u,g.pullMode=p?p.lastPutMode:void 0;var b=ba(ba({},m),rl.getEventProperties(o,e));for(var y in b)g[y]=b[y];n&&n.dispatchEvent(g),f[v]&&f[v].call(e,g)}}(ba({putSortable:Cl,cloneEl:gl,targetEl:cl,rootEl:ul,oldIndex:vl,oldDraggableIndex:yl,newIndex:bl,newDraggableIndex:wl},t))}var cl,dl,hl,ul,pl,ml,gl,fl,vl,bl,yl,wl,xl,Cl,Sl,El,Ol,_l,Ml,Nl,Al,jl,kl,Dl,Pl,Tl=!1,zl=!1,Ll=[],$l=!1,Hl=!1,Vl=[],Il=!1,Fl=[],Bl="undefined"!=typeof document,Rl=Na,Wl=Oa||Ea?"cssFloat":"float",ql=Bl&&!Aa&&!Na&&"draggable"in document.createElement("div"),Ul=function(){if(Bl){if(Ea)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Xl=function(t,e){var n=Va(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=qa(t,0,e),r=qa(t,1,e),s=i&&Va(i),a=r&&Va(r),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+Ra(i).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Ra(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&s.float&&"none"!==s.float){var d="left"===s.float?"left":"right";return!r||"both"!==a.clear&&a.clear!==d?"horizontal":"vertical"}return i&&("block"===s.display||"flex"===s.display||"table"===s.display||"grid"===s.display||l>=o&&"none"===n[Wl]||r&&"none"===n[Wl]&&l+c>o)?"vertical":"horizontal"},Gl=function(t){function e(t,n){return function(o,i,r,s){var a=o.options.group.name&&i.options.group.name&&o.options.group.name===i.options.group.name;if(null==t&&(n||a))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(o,i,r,s),n)(o,i,r,s);var l=(n?o:i).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var n={},o=t.group;o&&"object"==ya(o)||(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n},Yl=function(){!Ul&&hl&&Va(hl,"display","none")},Zl=function(){!Ul&&hl&&Va(hl,"display","")};Bl&&!Aa&&document.addEventListener("click",(function(t){if(zl)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),zl=!1,!1}),!0);var Jl=function(t){if(cl){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,Ll.some((function(t){var e=t[el].options.emptyInsertThreshold;if(e&&!Ua(t)){var n=Ra(t),o=i>=n.left-e&&i<=n.right+e,a=r>=n.top-e&&r<=n.bottom+e;return o&&a?s=t:void 0}})),s);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[el]._onDragOver(n)}}var i,r,s},Kl=function(t){cl&&cl.parentNode[el]._isOutsideThisEl(t.target)};function Ql(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=xa({},e),t[el]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Xl(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Ql.supportPointer&&"PointerEvent"in window&&!Ma,emptyInsertThreshold:5};for(var o in rl.initializePlugins(this,t,n),n)!(o in e)&&(e[o]=n[o]);for(var i in Gl(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&ql,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?ka(t,"pointerdown",this._onTapStart):(ka(t,"mousedown",this._onTapStart),ka(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(ka(t,"dragover",this),ka(t,"dragenter",this)),Ll.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),xa(this,nl())}function tc(t,e,n,o,i,r,s,a){var l,c,d=t[el],h=d.options.onMove;return!window.CustomEvent||Ea||Oa?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=n,l.draggedRect=o,l.related=i||e,l.relatedRect=r||Ra(e),l.willInsertAfter=a,l.originalEvent=s,t.dispatchEvent(l),h&&(c=h.call(d,l,s)),c}function ec(t){t.draggable=!1}function nc(){Il=!1}function oc(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function ic(t){return setTimeout(t,0)}function rc(t){return clearTimeout(t)}Ql.prototype={constructor:Ql,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(jl=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,cl):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,i=o.preventOnFilter,r=t.type,s=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,a=(s||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,c=o.filter;if(function(t){Fl.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&Fl.push(o)}}(n),!cl&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!Ma||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=za(a,o.draggable,n,!1))&&a.animated||ml===a)){if(vl=Xa(a),yl=Xa(a,o.draggable),"function"==typeof c){if(c.call(this,t,a,this))return ll({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),al("filter",e,{evt:t}),void(i&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=za(l,o.trim(),n,!1))return ll({sortable:e,rootEl:o,name:"filter",targetEl:a,fromEl:n,toEl:n}),al("filter",e,{evt:t}),!0}))))return void(i&&t.cancelable&&t.preventDefault());o.handle&&!za(l,o.handle,n,!1)||this._prepareDragStart(t,s,a)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,s=i.options,a=r.ownerDocument;if(n&&!cl&&n.parentNode===r){var l=Ra(n);if(ul=r,dl=(cl=n).parentNode,pl=cl.nextSibling,ml=n,xl=s.group,Ql.dragged=cl,Sl={target:cl,clientX:(e||t).clientX,clientY:(e||t).clientY},Ml=Sl.clientX-l.left,Nl=Sl.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,cl.style["will-change"]="all",o=function(){al("delayEnded",i,{evt:t}),Ql.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!_a&&i.nativeDraggable&&(cl.draggable=!0),i._triggerDragStart(t,e),ll({sortable:i,name:"choose",originalEvent:t}),Ha(cl,s.chosenClass,!0))},s.ignore.split(",").forEach((function(t){Fa(cl,t.trim(),ec)})),ka(a,"dragover",Jl),ka(a,"mousemove",Jl),ka(a,"touchmove",Jl),ka(a,"mouseup",i._onDrop),ka(a,"touchend",i._onDrop),ka(a,"touchcancel",i._onDrop),_a&&this.nativeDraggable&&(this.options.touchStartThreshold=4,cl.draggable=!0),al("delayStart",this,{evt:t}),!s.delay||s.delayOnTouchOnly&&!e||this.nativeDraggable&&(Oa||Ea))o();else{if(Ql.eventCanceled)return void this._onDrop();ka(a,"mouseup",i._disableDelayedDrag),ka(a,"touchend",i._disableDelayedDrag),ka(a,"touchcancel",i._disableDelayedDrag),ka(a,"mousemove",i._delayedDragTouchMoveHandler),ka(a,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&ka(a,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,s.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){cl&&ec(cl),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;Da(t,"mouseup",this._disableDelayedDrag),Da(t,"touchend",this._disableDelayedDrag),Da(t,"touchcancel",this._disableDelayedDrag),Da(t,"mousemove",this._delayedDragTouchMoveHandler),Da(t,"touchmove",this._delayedDragTouchMoveHandler),Da(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?ka(document,"pointermove",this._onTouchMove):ka(document,e?"touchmove":"mousemove",this._onTouchMove):(ka(cl,"dragend",this),ka(ul,"dragstart",this._onDragStart));try{document.selection?ic((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(t,e){if(Tl=!1,ul&&cl){al("dragStarted",this,{evt:e}),this.nativeDraggable&&ka(document,"dragover",Kl);var n=this.options;!t&&Ha(cl,n.dragClass,!1),Ha(cl,n.ghostClass,!0),Ql.active=this,t&&this._appendGhost(),ll({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(El){this._lastX=El.clientX,this._lastY=El.clientY,Yl();for(var t=document.elementFromPoint(El.clientX,El.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(El.clientX,El.clientY))!==e;)e=t;if(cl.parentNode[el]._isOutsideThisEl(t),e)do{if(e[el]){if(e[el]._onDragOver({clientX:El.clientX,clientY:El.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=Ta(e));Zl()}},_onTouchMove:function(t){if(Sl){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=hl&&Ia(hl,!0),s=hl&&r&&r.a,a=hl&&r&&r.d,l=Rl&&Pl&&Ga(Pl),c=(i.clientX-Sl.clientX+o.x)/(s||1)+(l?l[0]-Vl[0]:0)/(s||1),d=(i.clientY-Sl.clientY+o.y)/(a||1)+(l?l[1]-Vl[1]:0)/(a||1);if(!Ql.active&&!Tl){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))i.right+r||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>i.bottom+r||t.clientX>o.right&&t.clientY>o.top}(t,i,this)&&!g.animated){if(g===cl)return k(!1);if(g&&r===t.target&&(s=g),s&&(n=Ra(s)),!1!==tc(ul,r,cl,e,s,n,t,!!s))return j(),g&&g.nextSibling?r.insertBefore(cl,g.nextSibling):r.appendChild(cl),dl=r,D(),k(!0)}else if(g&&function(t,e,n){var o=Ra(qa(n.el,0,n.options,!0)),i=tl(n.el,n.options,hl),r=10;return e?t.clientXd+c*r/2:lh-Dl)return-kl}else if(l>d+c*(1-i)/2&&lh-c*r/2))return l>d+c/2?1:-1;return 0}(t,s,n,i,x?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,Hl,jl===s),0!==v){var O=Xa(cl);do{O-=v,y=dl.children[O]}while(y&&("none"===Va(y,"display")||y===hl))}if(0===v||y===s)return k(!1);jl=s,kl=v;var _=s.nextElementSibling,M=!1,N=tc(ul,r,cl,e,s,n,t,M=1===v);if(!1!==N)return 1!==N&&-1!==N||(M=1===N),Il=!0,setTimeout(nc,30),j(),M&&!_?r.appendChild(cl):s.parentNode.insertBefore(cl,M?_:s),S&&Ka(S,0,E-S.scrollTop),dl=cl.parentNode,void 0===b||Hl||(Dl=Math.abs(b-Ra(s)[C])),D(),k(!0)}if(r.contains(cl))return k(!1)}return!1}function A(a,l){al(a,p,ba({evt:t,isOwner:d,axis:i?"vertical":"horizontal",revert:o,dragRect:e,targetRect:n,canSort:h,fromSortable:u,target:s,completed:k,onMove:function(n,o){return tc(ul,r,cl,e,n,Ra(n),t,o)},changed:D},l))}function j(){A("dragOverAnimationCapture"),p.captureAnimationState(),p!==u&&u.captureAnimationState()}function k(e){return A("dragOverCompleted",{insertion:e}),e&&(d?c._hideClone():c._showClone(p),p!==u&&(Ha(cl,Cl?Cl.options.ghostClass:c.options.ghostClass,!1),Ha(cl,a.ghostClass,!0)),Cl!==p&&p!==Ql.active?Cl=p:p===Ql.active&&Cl&&(Cl=null),u===p&&(p._ignoreWhileAnimating=s),p.animateAll((function(){A("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==u&&(u.animateAll(),u._ignoreWhileAnimating=null)),(s===cl&&!cl.animated||s===r&&!s.animated)&&(jl=null),a.dragoverBubble||t.rootEl||s===document||(cl.parentNode[el]._isOutsideThisEl(t.target),!e&&Jl(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),m=!0}function D(){bl=Xa(cl),wl=Xa(cl,a.draggable),ll({sortable:p,name:"change",toEl:r,newIndex:bl,newDraggableIndex:wl,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){Da(document,"mousemove",this._onTouchMove),Da(document,"touchmove",this._onTouchMove),Da(document,"pointermove",this._onTouchMove),Da(document,"dragover",Jl),Da(document,"mousemove",Jl),Da(document,"touchmove",Jl)},_offUpEvents:function(){var t=this.el.ownerDocument;Da(t,"mouseup",this._onDrop),Da(t,"touchend",this._onDrop),Da(t,"pointerup",this._onDrop),Da(t,"touchcancel",this._onDrop),Da(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;bl=Xa(cl),wl=Xa(cl,n.draggable),al("drop",this,{evt:t}),dl=cl&&cl.parentNode,bl=Xa(cl),wl=Xa(cl,n.draggable),Ql.eventCanceled||(Tl=!1,Hl=!1,$l=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),rc(this.cloneId),rc(this._dragStartId),this.nativeDraggable&&(Da(document,"drop",this),Da(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ma&&Va(document.body,"user-select",""),Va(cl,"transform",""),t&&(Al&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),hl&&hl.parentNode&&hl.parentNode.removeChild(hl),(ul===dl||Cl&&"clone"!==Cl.lastPutMode)&&gl&&gl.parentNode&&gl.parentNode.removeChild(gl),cl&&(this.nativeDraggable&&Da(cl,"dragend",this),ec(cl),cl.style["will-change"]="",Al&&!Tl&&Ha(cl,Cl?Cl.options.ghostClass:this.options.ghostClass,!1),Ha(cl,this.options.chosenClass,!1),ll({sortable:this,name:"unchoose",toEl:dl,newIndex:null,newDraggableIndex:null,originalEvent:t}),ul!==dl?(bl>=0&&(ll({rootEl:dl,name:"add",toEl:dl,fromEl:ul,originalEvent:t}),ll({sortable:this,name:"remove",toEl:dl,originalEvent:t}),ll({rootEl:dl,name:"sort",toEl:dl,fromEl:ul,originalEvent:t}),ll({sortable:this,name:"sort",toEl:dl,originalEvent:t})),Cl&&Cl.save()):bl!==vl&&bl>=0&&(ll({sortable:this,name:"update",toEl:dl,originalEvent:t}),ll({sortable:this,name:"sort",toEl:dl,originalEvent:t})),Ql.active&&(null!=bl&&-1!==bl||(bl=vl,wl=yl),ll({sortable:this,name:"end",toEl:dl,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){al("nulling",this),ul=cl=dl=hl=pl=gl=ml=fl=Sl=El=Al=bl=wl=vl=yl=jl=kl=Cl=xl=Ql.dragged=Ql.ghost=Ql.clone=Ql.active=null,Fl.forEach((function(t){t.checked=!0})),Fl.length=Ol=_l=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":cl&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,i=n.length,r=this.options;o{const e=window.prompt(t.message.attr);if(e&&t.isDisabled(e))return window.alert(r.get("attributeNotPermitted",e||"")),xc.add.attrs(t);let n;e&&(n=String(window.prompt(t.message.value,"")),t.addAction(e,n))},option:t=>{t.addAction()},condition:t=>{t.addAction(t)}},click:{btn:t=>{t.action()}},save:{form:Bi}},xc={init:function(t){const e=Object.keys(wc);return this.opts=e.reduce(((e,n)=>(e[n]={...wc[n],...t[n]},e)),t),this},add:{attrs:t=>xc.opts.add.attr(t),options:t=>xc.opts.add.option(t),conditions:t=>(t.template={if:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],then:[{target:"",targetProperty:"",assignment:"",value:""}]},xc.opts.add.condition(t))},click:{btn:t=>xc.opts.click.btn(t)},save:{form:t=>(xc.opts.sessionStorage&&Hi.set(j,t),Yr.formeoSaved({formData:t}),xc.opts.save.form(t))}},Cc=Object.freeze({type:"field",displayType:"slider"}),Sc=t=>({transform:`translateX(${t?`${t}px`:0})`});class Ec{constructor(t){n(this,"toggleTabbedLayout",(()=>{this.getPanelDisplay();const t=this.isTabbed;return this.panelsWrap.parentElement.classList.toggle("tabbed-panels",t),t&&this.panelNav.removeAttribute("style"),t})),n(this,"resizePanels",(()=>{this.toggleTabbedLayout();const t=this.panelsWrap.style,e=kd.getStyle(this.currentPanel,"height");return t.height=e,e})),this.opts=Ti(Cc,t),this.panelDisplay=this.opts.displayType,this.activePanelIndex=0,this.panelNav=this.createPanelNav();const e=this.createPanelsWrap();this.nav=this.navActions();const o=new window.ResizeObserver((([{contentRect:{width:t}}])=>{this.currentWidth!==t&&(this.toggleTabbedLayout(),this.currentWidth=t,this.nav.setTranslateX(this.activePanelIndex,!1))})),i=window.setTimeout((()=>{o.observe(e),window.clearTimeout(i)}),T)}getPanelDisplay(){const t=this.panelsWrap,e=Number.parseInt(kd.getStyle(t,"width"))>390?"tabbed":"slider",n="auto"===this.opts.displayType;return this.panelDisplay=n?e:this.opts.displayType||Cc.displayType,this.panelDisplay}createPanelsWrap(){const t=kd.create({className:"panels",content:this.opts.panels.map((({config:t,...e})=>e))});return"field"===this.opts.type&&this.sortableProperties(t),this.panelsWrap=t,this.panels=t.children,this.currentPanel=this.panels[this.activePanelIndex],t}sortableProperties(t){const e=t.getElementsByClassName("field-edit-group");return Wr.forEach(e,(t=>{t.fieldId=this.opts.id,t.isSortable&&Ql.create(t,{animation:150,group:{name:`edit-${t.editGroup}`,pull:!0,put:["properties"]},sort:!0,handle:".prop-order",onSort:t=>{this.propertySave(t.to),this.resizePanels()}})}))}createPanelNavLabels(){const t=this.opts.panels.map((t=>({tag:"h5",action:{click:t=>{const e=$r(t.target,t.target.parentElement);this.currentPanel=this.panels[e];const n=t.target.parentElement.childNodes;this.nav.refresh(e),kd.removeClasses(n,"active-tab"),t.target.classList.add("active-tab")}},content:t.config.label}))),e={className:"panel-labels",content:{content:t}},[n]=t;return n.className="active-tab",kd.create(e)}createPanelNav(){this.labels=this.createPanelNavLabels();const t={tag:"button",attrs:{className:"next-group",title:r.get("controlGroups.nextGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:t=>this.nav.nextGroup(t)},content:kd.icon("triangle-right")},e={tag:"button",attrs:{className:"prev-group",title:r.get("controlGroups.prevGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:t=>this.nav.prevGroup(t)},content:kd.icon("triangle-left")};return kd.create({tag:"nav",attrs:{className:"panel-nav"},content:[e,this.labels,t]})}get isTabbed(){return"tabbed"===this.panelDisplay}navActions(){const t={},e=this.currentPanel.parentElement,n=this.labels.firstChild,o=this.currentPanel.parentElement.childNodes;this.activePanelIndex=$r(this.currentPanel,e);let i={nav:0,panel:0},r={...i};t.groupChange=t=>{const e=n.children;return kd.removeClasses(o,"active-panel"),kd.removeClasses(e,"active-tab"),this.currentPanel=o[t],this.currentPanel.classList.add("active-panel"),e[t].classList.add("active-tab"),this.currentPanel};const s=({offset:t,reset:o,duration:i=P,animate:s=!this.isTabbed})=>{const a=[Sc(r.panel),Sc(t.panel)],l=[Sc(r.nav),Sc(this.isTabbed?0:t.nav)];if(o){const[t]=a,[e]=l;a.push(t),l.push(e)}const c={easing:"ease-in-out",duration:s?i:0,fill:"forwards"},d=e.animate(a,c);n.animate(l,c);const h=()=>{this.panelsWrap.style.height=kd.getStyle(this.currentPanel,"height"),d.removeEventListener("finish",h),o||(r=t)};d.addEventListener("finish",h)};return t.setTranslateX=(t=this.activePanelIndex,o=!0)=>{var r;r=t,i={nav:-n.offsetWidth*r,panel:-e.offsetWidth*r},s({offset:i,animate:o})},t.refresh=(e=this.activePanelIndex)=>{this.activePanelIndex!==e&&(this.activePanelIndex=e,t.groupChange(e)),t.setTranslateX(this.activePanelIndex),this.resizePanels()},t.nextGroup=()=>{const e=this.activePanelIndex+1;if(e!==o.length){const o=t.groupChange(e);i={nav:-n.offsetWidth*e,panel:-o.offsetLeft},s({offset:i}),this.activePanelIndex++}else i={nav:r.nav-8,panel:r.panel-8},s({offset:i,reset:!0});return this.currentPanel},t.prevGroup=()=>{if(0!==this.activePanelIndex){const e=this.activePanelIndex-1,o=t.groupChange(e);i={nav:-n.offsetWidth*e,panel:-o.offsetLeft},s({offset:i}),this.activePanelIndex--}else i={nav:8,panel:8},s({offset:i,reset:!0})},t}}const Oc="f-autocomplete",_c="highlight-component";let Mc,Nc=Date.now();const Ac=({name:t,id:e,...n})=>["config.label","attrs.id","meta.id"].reduce(((t,e)=>(t||(t=n.get(e)),t)),null)||"external"===t&&((...t)=>r.get(t.join("."))||Tr(t.join(" ")))(t,e);class jc{constructor(t,e,n){this.key=t,this.className=t.replace(/\./g,"-"),this.value=e,this.events=[],this.i18nKey=n,this.build()}build(){const t=t=>{const e=this.list,n=this.getActiveOption();let o=new Map([[38,()=>{const t=this.getPreviousOption(n);t&&this.selectOption(t)}],[40,()=>{const t=this.getNextOption(n);t&&this.selectOption(t)}],[13,()=>{n&&(this.selectOption(n),this.setValue(n),"none"===e.style.display?this.showList(n):this.hideList()),t.preventDefault()}],[27,()=>{this.hideList()}]]).get(t.keyCode);return o||(o=()=>!1),o()},e={focus:({target:e})=>{this.updateOptions(),e.parentElement.classList.add(`${this.className}-focused`);const n=kd.toggleElementsByStr(this.list.querySelectorAll("li"),e.value);e.addEventListener("keydown",t);const o=this.list.querySelector(".active-option")||n[0];this.showList(o)},blur:({target:e})=>{e.parentElement.classList.remove(`${this.className}-focused`),e.removeEventListener("keydown",t),this.hideList()},input:t=>{const e=kd.toggleElementsByStr(this.list.querySelectorAll("li"),t.target.value);if(0===t.target.value.length&&this.clearValue(),0===e.length)this.hideList();else{const t=this.getActiveOption()||e[0];this.showList(t)}this.hiddenField.value=t.target.value,this.value=t.target.value,this.runEvent("onChange",{target:this.hiddenField})}};return this.displayField=kd.create({tag:"input",autocomplete:"off",action:e,attrs:{type:"text",className:`${Oc}-display-field`,value:this.label||this.value,placeholder:r.get(`${this.i18nKey}.${this.key}.placeholder`)}}),this.hiddenField=kd.create({tag:"input",attrs:{type:"hidden",className:this.className,value:this.value}}),this.list=kd.create({tag:"ul",attrs:{className:`${Oc}-list`}}),this.dom=kd.create({children:[this.displayField,this.hiddenField,this.list],className:this.className,action:{onRender:()=>{const t=this.value&&Ad.getAddress(this.value);this.label=t&&Ac(t),this.label&&(this.displayField.value=this.label),this.updateOptions()}}}),this.dom}updateOptions(){const t=Date.now();t-Nc>T&&(kd.empty(this.list),this.generateOptions(),Nc=t);(Mc||this.generateOptions()).forEach((t=>this.list.appendChild(t)))}generateOptions(){const t=(t=>{const e=[],n=Ad.flatList();return Object.entries(n).map((([n,o])=>{const i=Ac(o);if(i){const r={tag:"span",content:` ${Tr(o.name)}`,className:"component-type"},s=`${o.name}.${i}`;e.push(s);const a=((t,e)=>t.reduce(((t,n)=>t+(n===e)),0))(e,s),l={tag:"span",content:a>1&&`(${a})`,className:"component-label-count"};return kd.makeOption([n,[`${i} `,l,r]],t)}})).filter(Boolean)})(),e=t=>{const e=`${Oc}-list-item`;return t.classList.contains(e)||(t=t.parentElement),t};return Mc=t.map((t=>{const n=t.value;let[o]=t.label;o=o.trim();const i={tag:"li",children:t.label,dataset:{value:n,label:o},className:`${Oc}-list-item`,action:{mousedown:({target:t})=>{t=e(t),this.setValue(t),this.selectOption(t),this.hideList()},mouseover:({target:t})=>{t=e(t),this.removeHighlight(),this.highlightComponent(t)}}};return kd.create(i)})),Mc}hideList(t=this.list){qr.slideUp(t,P),this.removeHighlight()}showList(t,e=this.list){this.selectOption(t),qr.slideDown(e,P)}getActiveOption(t=this.list){const e=t.getElementsByClassName("active-option")[0];return e&&"none"!==e.style.display?e:null}getPreviousOption(t){let e=t;do{e=e?e.previousSibling:null}while(null!=e&&"none"===e.style.display);return e}getNextOption(t){let e=t;do{e=e?e.nextSibling:null}while(null!=e&&"none"===e.style.display);return e}selectOption(t,e=this.list){const n=e.querySelectorAll("li");for(let o=0;o{n===t&&o(e)}))}}const kc=(t,e)=>{const n=(t=>{const e=Ii(t),n={"field.property":V,...I},o=e?(i=t,Ad.getAddress(i).getData()):n[t];var i;return Object.keys(o).reduce(((t,e)=>(t[e]=e,t)),{})})(t);return Object.entries(n).reduce(((n,[o,i])=>{if("id"!==o){const s={tag:"option",content:r.get(`${t}.${o}`)||o.toLowerCase(),attrs:{value:i}};e===i&&(s.attrs.selected=!0),n.push(kd.create(s))}return n}),[])},Dc=(t,e)=>{kd.empty(t),e.forEach((e=>t.add(e)))},Pc=({key:t,value:e,type:n="text",checked:o})=>{const i={tag:"input",attrs:{type:n,value:e,placeholder:r.get(`${t}.placeholder`)||Tr(t)},className:t.replace(/\./g,"-"),config:{}};return o&&(i.attrs.checked=!0),i},Tc=t=>{const e=r.get(t);if(e)return e;const n=t.split(".");return r.get(n[n.length-1])},zc={autocomplete:(t,e,n)=>new jc(t,e,n),string:(t,e)=>Pc({key:t,value:e}),boolean:(t,e)=>Pc({key:t,value:e,type:"selected"===t?"radio":"checkbox",checked:e}),number:(t,e)=>Pc({key:t,value:e,type:"number"}),array:(t,e=[])=>({tag:"select",attrs:{placeholder:Tc(`placeholder.${t}`)},className:t.replace(/\./g,"-"),options:e}),object:t=>Object.entries(t).map((([t,e])=>zc[kd.childType(e)](t,e)))},Lc=["selected","checked"],$c={boolean:(t,e)=>({click:({target:{checked:n}})=>{var o,i;"radio"===(null==(i=null==(o=e.data)?void 0:o.attrs)?void 0:i.type)&&e.set("options",e.data.options.map((t=>({...t,selected:!1})))),e.set(t,n),e.updatePreview()}}),string:(t,e)=>({input:({target:{value:n}})=>{e.set(t,n)}}),number:(t,e)=>({input:({target:{value:n}})=>{e.set(t,Number(n)),e.updatePreview()}}),array:(t,e)=>({change:({target:{value:n}})=>{e.set(t,n),e.updatePreview()}}),object:()=>({})};class Hc{constructor({key:t,data:e,index:o,field:i}){n(this,"generateConditionFields",((t,e)=>{const n={tag:"label",className:`condition-label ${t}-condition-label`,content:r.get(t)||t};return e.map(((e,o)=>{const i=[],r=Object.entries(e).map((([e,n])=>{const r=this.conditionInput(e,n,t,o);return r&&i.push([r.className,n.trim()].filter(Boolean).join("-")),r})).filter(Boolean),s=Hr(r,H.map((t=>`condition-${t}`)),"className||dom.className");return this.processConditionUIState(s),o||s.unshift(n),this.itemFieldGroups.push(s),{children:s,className:`f-condition-row ${t}-condition-row ${i.join(" ")}`}}))})),n(this,"processConditionUIState",(t=>{const e=e=>(e=e.split("|"),t.filter((t=>e.includes(t.className)))),n=t=>{t=Array.isArray(t)?t:[t];const e=setTimeout((()=>{t.forEach((t=>{t.dom&&(t=t.dom),t.style.display="none"})),clearTimeout(e)}),D)},o=t=>{t=Array.isArray(t)?t:[t];const e=setTimeout((()=>{t.forEach((t=>{t.dom&&(t=t.dom),t.removeAttribute("style")})),clearTimeout(e)}),D)},i=new Map([["condition-source",t=>{const i=e("condition-sourceProperty"),r=i[0],s=Ii(t.value)?t.value:"field.property",a=kc(s,r.value);return Dc(r,a),t.value?o(i):n(i)}],["condition-target",t=>{const i=e("condition-targetProperty");return Vi(t.value)&&t.value?o(i):n(i)}],["condition-sourceProperty",t=>{const i=e("condition-comparison|condition-targetProperty|condition-target"),r=t.value;return(t=>/^is|^has/.test(t))(r.substring(r.lastIndexOf(".")+1,r.length))?n(i):o(i)}]]);t.forEach((t=>{const e=i.get(t.className);e&&e(t)}))})),n(this,"conditionInput",((t,e,n,o)=>{const i=this.field,r=`${this.itemKey}.${n}.${o}`,s=`${this.field.id}.${r}`,a=`${i.name}s.${s}.${t}`,l=(t,e,n)=>{const o=kc(n||t,e),i=zc.array(`condition.${t}`);i.action={change:c,onRender:t=>c({target:t})};const r=kd.create(i);return Dc(r,o),r},c=({target:t})=>{const e=t.closest(".f-condition-row"),n=new RegExp(`${t.className}(?:\\S?)+`,"gm");e.className=e.className.replace(n,""),e.classList.add([t.className,t.value].filter(Boolean).join("-"));const o={dataPath:a,value:t.value,src:t};Yr.formeoUpdated(o),Ad.setAddress(a,t.value);const i=t.closest(".f-condition-row"),r=$r(i);this.processConditionUIState(this.itemFieldGroups[r])},d={comparison:t=>l("comparison",t),logical:t=>l("logical",t),source:(t,e="source")=>{const o=zc.autocomplete(`condition.${e}`,t,n);return Ad.setConditionMap(t,i),o.addEvent("onChange",(t=>{Ad.removeConditionMap(Ad.getAddress(a)),c(t),Ad.setConditionMap(t.target.value,i)})),o},sourceProperty:t=>l("sourceProperty",t,"field.property"),targetProperty:t=>l("targetProperty",t,"field.property"),target:t=>d.source(t,"target"),value:t=>{const e=zc.string("condition.value",t);return e.action={input:c},kd.create(e)},assignment:t=>l("assignment",t)};if(d[t])return d[t](e)})),this.itemValues=Hr(Object.entries(e),Lc,"0");const[s,a]=t.split(".");this.field=i,this.itemKey=t,this.itemIndex=o,this.panelName=s,this.isDisabled=i.isDisabledProp(a,s),this.isHidden=this.isDisabled&&i.config.panels[s].hideDisabled,this.isLocked=i.isLockedProp(a,s),this.dom=kd.create({tag:"li",className:[`field-${t.replace(/\./g,"-")}`,"prop-wrap",this.isHidden&&"hidden-property"],children:{className:"field-prop",children:[this.itemInputs,this.itemControls]}})}get itemInputs(){this.itemFieldGroups=[];return{className:`${this.panelName}-prop-inputs prop-inputs f-input-group`,children:this.itemValues.map((([t,e])=>{let n="conditions"===this.panelName?this.generateConditionFields(t,e):this.itemInput(t,e);return["selected","checked"].includes(t)&&(n={className:"f-addon",children:n}),n}))}}get itemControls(){if(this.isLocked){return{className:`${this.panelName}-prop-controls prop-controls`,content:[]}}const t={tag:"button",attrs:{type:"button",className:"prop-remove prop-control"},action:{click:()=>{qr.slideUp(this.dom,250,(t=>{this.field.remove(this.itemKey),kd.remove(t),this.field.resizePanelWrap()}))}},content:kd.icon("remove")};return{className:`${this.panelName}-prop-controls prop-controls`,content:[t]}}itemInput(t,e){const n=kd.childType(e)||"string",o={config:{},attrs:{},...zc[n](t,e)},i=this.itemKey.replace(/.\d+$/,(e=>`${e}.${t}`)),r=i.split(".").filter(Number.isNaN).join("."),[s,a]=[[...this.itemKey.split("."),t],[t]].map((t=>[this.field.id,...t].filter(Boolean).join("-")));return o.config={...o.config,label:"options"!==this.panelName&&Tc(r),labelAfter:!1},o.attrs={...o.attrs,name:"checkbox"===o.attrs.type?`${a}[]`:a,id:s,disabled:this.isDisabled,locked:this.isLocked},o.action={...$c[n](i,this.field)},o}}class Vc{constructor(t,e,o){n(this,"addAttribute",((t,e)=>{const n=zr(t),o=`attrs.${n}`;r.current[o]||r.put(o,Br(t)),"string"==typeof e&&["true","false"].includes(e)&&(e=JSON.parse(e)),this.field.set(`attrs.${t}`,e);const i=this.props.querySelector(`.field-attrs-${n}`),s=new Hc({key:o,data:{[n]:e},field:this.field});i?this.props.replaceChild(s.dom,i):this.props.appendChild(s.dom),this.field.resizePanelWrap()})),n(this,"addOption",(()=>{const t=this.field.data.meta.id,e=this.field.get("options"),n="select"===t?"option":t,o=r.get("newOptionLabel",{type:n})||"New Option",i=`options.${this.data.length}`,s={...e.length?jr(e[e.length-1]):{},label:o,value:zr(o)},a=new Hc({key:i,data:s,field:this.field,index:this.props.children.length});this.editPanelItems.push(a),this.props.appendChild(a.dom),this.field.set(i,s),this.field.resizePanelWrap()})),n(this,"addCondition",(t=>{const e=`conditions.${this.field.get("conditions").length}`,n=this.props.querySelector(`.field-${e.replace(".","-")}`),o=new Hc({key:e,data:t.template,field:this.field});n?this.props.replaceChild(o.dom,n):this.props.appendChild(o.dom),this.field.set(e,t.template),this.field.resizePanelWrap()})),this.type=kd.childType(t),this.data="object"===this.type?Object.entries(t):t,this.name=e,this.field=o,this.panelConfig=this.getPanelConfig(this.data)}getPanelConfig(t){return this.props=this.createProps(t),this.editButtons=this.createEditButtons(),{id:`${this.field.id}-${this.name}-panel`,config:{label:r.get(`panel.label.${this.name}`)},attrs:{className:`f-panel ${this.name}-panel`},children:[this.props,this.editButtons]}}createProps(t){this.editPanelItems=Array.from(t).map(((t,e)=>{const n="array"===this.type,o=[this.name,n?String(e):t[0]].join("."),i=n?t:{[t[0]]:t[1]};return new Hc({key:o,data:i,field:this.field})}));const e={tag:"ul",attrs:{className:["field-edit-group",`field-edit-${this.name}`]},editGroup:this.name,isSortable:"options"===this.name,content:this.editPanelItems};return kd.create(e)}createEditButtons(){const t=this,e=this.name,n=r.get(`panelEditButtons.${e}`),o={attrs:t.addAttribute,options:t.addOption,conditions:t.addCondition};return{className:"panel-action-buttons",content:[{...kd.btnTemplate({content:n,title:n}),className:`add-${e}`,action:{click:n=>{const i={btnCoords:kd.coords(n.target),addAction:o[e]};"attrs"===e&&(i.isDisabled=t.field.isDisabledProp,i.isLocked=t.field.isLockedProp,i.message={attr:r.get(`action.add.${e}.attr`),value:r.get(`action.add.${e}.value`)});const s=Tr(e),a=new window.CustomEvent(`onAdd${s}`,{detail:i});xc.add[e](i),document.dispatchEvent(a)}}}]}}}class Ic extends fa{constructor(t,e={},o){super(t,{...e,id:e.id||Pi()}),n(this,"mutationHandler",(t=>t.map((t=>{})))),n(this,"remove",(t=>{if(t){const e=t.split("."),n=e.pop(),o=this.get(e);return Array.isArray(o)?Lr(n)?o.splice(Number(n),1):this.set(e,o.filter((t=>t!==n))):delete o[n],o}if("stage"===this.name)return null;const e=this.parent,n=this.children;return Vr(n,(t=>t.remove())),this.dom.parentElement.removeChild(this.dom),((t,e)=>{const n=t.indexOf(e);-1!==n&&t.splice(n,1)})(Ad.getAddress(`${e.name}s.${e.id}.children`),this.id),e.children.length||e.emptyClass(),"row"===e.name&&e.autoColumnWidths(),Ad[`${this.name}s`].delete(this.id)})),n(this,"emptyClass",(()=>this.dom.classList.toggle("empty",!this.children.length))),n(this,"getComponentTag",(()=>kd.create({tag:"span",className:["component-tag",`${this.name}-tag`],children:[(this.isColumn||this.isField)&&kd.icon("component-corner",["bottom-left"]),kd.icon(`handle-${this.name}`),Tr(this.name),(this.isColumn||this.isRow)&&kd.icon("component-corner",["bottom-right"])].filter(Boolean)}))),n(this,"removeClasses",(t=>{const e={string:()=>this.dom.classList.remove(t),array:()=>t.map((t=>this.dom.classList.remove(t)))};return e.object=e.string,e[kd.childType(t)](this.dom)})),n(this,"loadChildren",((t=this.data.children)=>t.map((t=>this.addChild({id:t}))))),n(this,"saveChildOrder",(()=>{if(this.render)return;const t=this.children.map((({id:t})=>t));return this.set("children",t),t})),n(this,"onSort",(()=>this.saveChildOrder())),n(this,"onEnd",(({to:{parentElement:t},from:{parentElement:e}})=>{null==t||t.classList.remove(`hovering-${ki(t)}`),null==e||e.classList.remove(`hovering-${ki(e)}`)})),n(this,"runConditions",(()=>{const t=this.get("conditions");if(!(null==t?void 0:t.length))return null;return t.map((t=>{const e=this.processConditions(t.if),n=this.processResults(t.then);return e.map((t=>this.evaluateConditions(t)&&this.execResults(n)))}))})),n(this,"value",((t,e)=>{const n=t.split("."),o=this.getComponent(t),i=o&&n.slice(2,n.length).join(".");return[!o,!i,!V[i]].some(Boolean)?t:e?o.set(V[i],e):o.get(V[i])})),n(this,"getResult",(t=>({"=":(t,e,n)=>t.set(e,n)}[t]))),n(this,"processResults",(t=>t.map((({operator:t,target:e,value:n})=>{const o=this.getComponent(e);return{target:o,propertyPath:o&&e.split(".").slice(2,e.length).join("."),action:this.getResult(t),value:this.value(n)}})))),n(this,"execResults",(t=>{const e=t.map((t=>this.execResult(t)));return Promise.all(e)})),n(this,"execResult",(({target:t,action:e,value:n,propertyPath:o})=>new Promise(((o,i)=>{try{return o(e(t,n))}catch(r){return i(r)}})))),n(this,"cloneData",(()=>{const t={...zi(this.data),id:Pi()};return"field"!==this.name&&(t.children=[]),t})),n(this,"clone",((t=this.parent)=>{const e=t.addChild(this.cloneData(),this.index+1);return"field"!==this.name&&this.cloneChildren(e),e})),n(this,"createChildWrap",(t=>kd.create({tag:"ul",attrs:{className:"children"},children:t}))),this.id=this.data.id,this.name=t,this.config=Ad[`${this.name}s`].config,Ti(this.config,e.config),this.dataPath=`${this.name}s.${this.id}.`,this.observer=new MutationObserver(this.mutationHandler),this.render=o}observe(t){this.observer.disconnect(),this.observer.observe(t,{childList:!0})}get js(){return this.data}get json(){return this.data}empty(){const t=this.children.map((t=>t.remove()));return this.data.children=this.data.children.filter((e=>-1===t.indexOf(e))),this.dom.classList.add("empty"),t}getActionButtons(){const t=[`hovering-${this.name}`,"hovering"];return{className:[`${this.name}-actions`,"group-actions"],action:{mouseenter:({target:e})=>{Ad.stages.active.dom.classList.add(`active-hover-${this.name}`),this.dom.classList.add(...t)},mouseleave:({target:e})=>{this.dom.classList.remove(...t),Ad.stages.active.dom.classList.remove(`active-hover-${this.name}`),e.removeAttribute("style")}},children:[{...kd.btnTemplate({content:kd.icon(`handle-${this.name}`)}),className:["component-handle",`${this.name}-handle`]},{className:["action-btn-wrap",`${this.name}-action-btn-wrap`],children:this.buttons}]}}toggleEdit(t=!this.isEditing){this.isEditing=t;const e=this.dom,n="editing",o=`${n}-${this.name}`,i=this.dom.querySelector(`.${this.name}-edit`);qr.slideToggle(i,D,t),"field"===this.name&&(qr.slideToggle(this.preview,D,!t),e.parentElement.classList.toggle(`column-${o}`,t)),e.classList.toggle(n,t),e.classList.toggle(o,t)}get buttons(){if(this.actionButtons)return this.actionButtons;const t={handle:(t=`handle-${this.name}`)=>({...kd.btnTemplate({content:kd.icon(t)}),className:["component-handle"]}),move:(t="move")=>({...kd.btnTemplate({content:kd.icon(t)}),className:["item-move"],meta:{id:"move"}}),edit:(t="edit")=>({...kd.btnTemplate({content:kd.icon(t)}),className:["item-edit-toggle"],meta:{id:"edit"},action:{click:t=>{this.toggleEdit()}}}),remove:(t="remove")=>({...kd.btnTemplate({content:kd.icon(t)}),className:["item-remove"],meta:{id:"remove"},action:{click:(t,e)=>{qr.slideUp(this.dom,D,(()=>{if("column"===this.name){this.parent.autoColumnWidths(),this.remove()}else this.remove()}))}}}),clone:(t="copy")=>({...kd.btnTemplate({content:kd.icon(t)}),className:["item-clone"],meta:{id:"clone"},action:{click:()=>{this.clone(this.parent),"column"===this.name&&this.parent.autoColumnWidths()}}})},{buttons:e,disabled:n}=this.config.actionButtons,o=e.filter((t=>!n.includes(t))).map((e=>{var n;return(null==(n=t[e])?void 0:n.call(t))||e}));return this.actionButtons=o,this.actionButtons}get index(){return $r(this.dom)}get parentType(){return M.get(this.name)}get parent(){const t=this.parentType;if(!this.dom||!t)return null;const e=this.dom.closest(`.${w[t]}`);return e&&kd.asComponent(e)}get children(){if(!this.dom)return[];const t=this.domChildren,e=_.get(this.name);return Ir(t,(t=>Ad.getAddress(`${e}s.${t.id}`))).filter(Boolean)}get domChildren(){const t=this.dom.querySelector(".children");return t?t.children:[]}addChild(t={},e=this.domChildren.length){var n,o;let i=t;"object"!=typeof t&&(i={id:i});const r=this.dom.querySelector(".children"),{id:s=Pi()}=i,a=_.get(this.name);if(!a)return null;const l=`${a}s`,c=Ad.getAddress(`${l}.${s}`)||Ad[l].add(s,i);r.insertBefore(c.dom,r.children[e]),null==(o=null==(n=this.config.events)?void 0:n.onAddChild)||o.call(n,{parent:this,child:c});const d=c.get("children");return(null==d?void 0:d.length)&&c.loadChildren(d),this.removeClasses("empty"),this.saveChildOrder(),c}onAdd({from:t,to:e,item:n,newIndex:o}){var i;t.classList.contains(l)||(t=t.parentElement);const r=ki(t),s=ki(e.parentElement),a=new Map([[-2,()=>{const t=this.addChild({},o).addChild();return t.addChild.bind(t)}],[-1,()=>{const t=this.addChild({},o);return t.addChild.bind(t)}],[0,()=>this.addChild.bind(this)],[1,t=>{const e=$r(this.dom);return()=>this.parent.addChild(t,e+1)}],[2,t=>()=>this.parent.parent.addChild(t)]]),c={controls:()=>{const{controlData:t}=sd.get(n.id),{meta:{id:e}}=t,i=e.startsWith("layout-")?e.replace(/^layout-/,""):"field",r=Nr({stage:{row:0,column:-1,field:-2},row:{row:1,column:0,field:-1},column:{row:2,column:1,field:0},field:1},`${this.name}.${i}`),s=a.get(r)();kd.remove(n);return s(t,o)},row:()=>{const t=(a.get({stage:-1,row:0,column:1}[s])||Bi)();return null==t?void 0:t({id:n.id},o)},column:()=>{const t=(a.get({stage:-2,row:-1}[s])||Bi)();return null==t?void 0:t(n.id)}},d=null==(i=c[r])?void 0:i.call(c,n,o);return(()=>{this.saveChildOrder(),this.removeClasses("empty")})(),d}onRemove({from:{parentElement:t}}){return t.classList.contains(h)&&t.classList.remove("column-editing-field"),"stage"===this.name||this.children.length?(this.emptyClass(),this.saveChildOrder()):this.remove()}onRender(){const{events:t}=this.config;if(!t)return null;t.onRender&&kd.onRender(this.dom,t.onRender)}set config(t){const e=Nr(this.data,"meta.id"),n=[Nr(t,"all"),e&&Nr(t,e),Nr(t,this.id)].reduce(((t,e)=>e?Ti(t,e):t),this.configVal);this.configVal=n}get config(){return this.configVal}getComponent(t){const[e,n]=t.split("."),o=Ad[e];return n===this.id?this:null==o?void 0:o.get(n)}cloneChildren(t){for(const e of this.children)null==e||e.clone(t)}get isRow(){return this.name===b.row}get isColumn(){return this.name===b.column}get isField(){return this.name===b.field}}class Fc extends Ic{constructor(t=Object.create(null)){super("field",{conditions:[{if:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],then:[{target:"",targetProperty:"",assignment:"",value:""}]}],...t}),n(this,"updateConditionsPanel",(()=>{const t=setTimeout((()=>{const e=this.editPanels.find((({name:t})=>"conditions"===t));if(!e)return null;const n=e.createProps(),o=this.dom.querySelector(".field-edit-conditions");o.parentElement.replaceChild(n,o),clearTimeout(t)}),D)})),n(this,"updatePreview",Fi((()=>{if(!this.preview.parentElement)return null;this.updateLabel();const t=kd.create(this.fieldPreview(),!0);this.preview.parentElement.replaceChild(t,this.preview),this.preview=t}),D)),n(this,"isDisabledProp",((t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.disabled.concat(this.get(`config.disabled${Tr(e)}`)).includes(t)})),n(this,"isLockedProp",((t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.locked.concat(this.get(`config.locked${Tr(e)}`)).includes(t)})),this.label=kd.create(this.labelConfig),this.preview=kd.create({}),this.editPanels=[];const e=this.getActionButtons(),o=this.actionButtons.some((t=>{var e;return"edit"===(null==(e=t.meta)?void 0:e.id)}));let i={tag:"li",attrs:{className:u},id:this.id,children:[this.label,this.getComponentTag(),e,o&&this.fieldEdit,this.preview].filter(Boolean),panelNav:this.panelNav,dataset:{hoverTag:r.get("field")}};i=kd.create(i),this.observe(i),this.dom=i,this.isEditing=!1,this.onRender(i)}get labelConfig(){if(!!this.get("config.hideLabel"))return;const t=this.get("config.editorLabel")||this.get("config.label"),e=this.get("attrs.required"),n=this.config.label.disableHTML;return{className:"prev-label",children:[{...(()=>{const e={tag:"label",attrs:{}};return n?(e.tag="input",e.attrs.value=t,e):(e.attrs.contenteditable=!0,e.children=t,e)})(),action:{input:({target:{innerHTML:t,innerText:e,value:o}})=>{super.set("config.label",n?o:t);const i=Ad.getConditionMap(`fields.${this.id}`);if(i)return i.updateConditionSourceLabel(`${this.name}s.${this.id}`,n?o:e)}}},e&&kd.requiredMark()]}}updateConditionSourceLabel(t,e){const n=this.editPanels.find((({name:t})=>"conditions"===t));if(!n)return null;for(const{itemFieldGroups:o}of n.editPanelItems)for(const n of o){const o=n.find((e=>e.value===t));o&&(o.displayField.value=e)}}set(...t){const[e,n]=t,o=super.set(e,n);return this.updatePreview(),o}updateLabel(){if(!this.label)return null;const t=kd.create(this.labelConfig);this.label.parentElement.replaceChild(t,this.label),this.label=t}get fieldEdit(){this.editPanels=[];const t=["object","array"],e=["config","meta","action","events",...this.config.panels.disabled],n=Di([...this.config.panels.order,...Object.keys(this.data)]).filter((t=>!e.includes(t))),o={className:["field-edit","slide-toggle","formeo-panels-wrap"]};for(const s of n){const e=this.get(s),n=kd.childType(e);if(t.includes(n)){const t=new Vc(e,s,this);this.editPanels.push(t)}}const i={panels:this.editPanels.map((({panelConfig:t})=>t)),id:this.id,displayType:"auto"},r=this.editPanels.length;return r&&(this.panels=new Ec(i),o.className.push(`panel-count-${r}`),o.content=[this.panels.panelNav,this.panels.panelsWrap],this.panelNav=this.panels.nav,this.resizePanelWrap=this.panels.nav.refresh,o.action={onRender:()=>{if(this.resizePanelWrap(),!r){const t=this.dom,e=t.querySelector(".item-edit-toggle"),n=t.querySelector(".field-actions"),o=n.getElementsByTagName("button");n.style.maxWidth=o.length*o[0].clientWidth+"px",kd.remove(e)}}}),o}get defaultPreviewActions(){return{change:t=>{const{target:e}=t,{checked:n,type:o}=e;if(["checkbox","radio"].includes(o)){const t=+e.id.split("-").pop();"radio"===o&&this.set("options",this.get("options").map((t=>({...t,selected:!1}))));const i="checkbox"===o?"checked":"selected";this.set(`options.${t}.${i}`,n)}},click:t=>{"true"===t.target.contentEditable&&t.preventDefault()},input:t=>{["input","meter","progress","button"].includes(this.data.tag)&&super.set("attrs.value",t.target.value),t.target.contentEditable&&super.set("content",t.target.innerHTML)}}}fieldPreview(){var t;const e=zi(this.data),{action:n={}}=sd.get(e.meta.id);e.id=`prev-${this.id}`,e.action=n,(null==(t=this.data)?void 0:t.config.editableContent)&&(e.attrs={...e.attrs,contenteditable:!0});return{attrs:{className:"field-preview",style:this.isEditing&&"display: none;"},content:kd.create(e,!0),action:this.defaultPreviewActions}}}const Bc={js:new Set,css:new Set},Rc=(t,e)=>{t.removeEventListener("load",Rc),t.rel="stylesheet",e(t.src)},Wc=(t,e)=>{t.removeEventListener("load",Wc),e(t.src)},qc=t=>new Promise(((e,n)=>{if(Bc.js.has(t))return e(t);Bc.js.add(t);const o=kd.create({tag:"script",attrs:{type:"text/javascript",async:!0,src:`//${t.replace(/^https?:\/\//,"")}`},action:{load:()=>Wc(o,e),error:()=>n(new Error(`${t} failed to load.`))}});document.head.appendChild(o)})),Uc=t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>new Promise(((e,n)=>{if(Bc.css.has(t))return e(t);Bc.css.add(t);const o=kd.create({tag:"link",attrs:{rel:"preload",href:t,as:"style"},action:{load:()=>Rc(o,e),error:()=>n(new Error(`${(void 0).src} failed to load.`))}});document.head.appendChild(o)}))));return Promise.all(e)},Xc=t=>("string"==typeof t?Promise.resolve(t):t.text()).then((t=>{const e="formeo-sprite";let n=document.getElementById(e);return n||(n=kd.create({id:e,children:t,attrs:{hidden:!0,style:"display: none;"}}),document.body.insertBefore(n,document.body.childNodes[0])),n})),Gc=(t,e,n=Ri)=>new Promise(((o,i)=>fetch(t).then((t=>o(e?e(t):t))).catch((t=>i(new Error(n(t))))))),Yc={js:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>qc(t)));return Promise.all(e)},css:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>Uc(t)));return Promise.all(e)}},Zc=t=>{const e=Object.entries(t).map((([t,e])=>Yc[t](e)));return Promise.all(e)};class Jc{constructor({events:t={},dependencies:e={},controlAction:o,...i}){n(this,"controlCache",new Set),this.events=t,this.controlData=i,this.controlAction=o,this.dependencies=e,this.id=i.id||Pi()}get controlId(){var t;return null==(t=this.controlData.meta)?void 0:t.id}get dom(){const{meta:t,config:e}=this.controlData,n=this.i18n(e.label)||e.label,o={tag:"button",attrs:{type:"button"},content:[{tag:"span",className:"control-icon",children:kd.icon(t.icon)},n],action:{focus:({target:t})=>{const e=t.closest(`.${l}`);return e&&sd.panels.nav.refresh($r(e))},click:({target:t})=>{sd.addElement(t.parentElement.id)}}};return kd.create({tag:"li",id:this.id,className:["field-control",`${t.group}-control`,`${t.id}-control`],content:o,meta:t,action:this.controlAction})}promise(){return Zc(this.dependencies)}i18n(t,e){var n,o;const i=r.locale,s=null==(n=this.definition)?void 0:n.i18n,a=(null==s?void 0:s[i])||{};return((null==(o=a[t])?void 0:o.call(a))??a[t])||r.get(t,e)}}const Kc=[{config:{label:"row"},meta:{group:"layout",icon:"rows",id:"layout-row"}},{config:{label:"column"},meta:{group:"layout",icon:"columns",id:"layout-column"}}];const Qc=(t,e=3)=>Array.from({length:e},((t,e)=>e+1)).map((e=>{const n="checkbox"===t?"checked":"selected";return{label:r.get("labelCount",{label:Tr(t),count:e}),value:`${t}-${e}`,[n]:!e}}));const td=[class extends Jc{constructor(){super({tag:"button",attrs:{className:[{label:"grouped",value:"f-btn-group"},{label:"ungrouped",value:"f-field-group"}]},config:{label:r.get("controls.form.button"),hideLabel:!0},meta:{group:"common",icon:"button",id:"button"},options:[{label:r.get("button"),type:["button","submit","reset"].map(((t,e)=>({label:t,type:t}))),className:[{label:"default",value:"",selected:!0},{label:"primary",value:"primary"},{label:"danger",value:"error"},{label:"success",value:"success"},{label:"warning",value:"warning"}]}]})}},class extends Jc{constructor(){super({tag:"input",attrs:{type:"date",required:!1,className:""},config:{label:r.get("controls.form.input.date")},meta:{group:"common",icon:"calendar",id:"date-input"}})}},class extends Jc{constructor(){super({tag:"input",attrs:{type:"hidden",value:""},config:{label:r.get("hidden"),hideLabel:!0},meta:{group:"common",icon:"hidden",id:"hidden"}})}},class extends Jc{constructor(){super({tag:"input",attrs:{type:"number",required:!1,className:""},config:{label:r.get("number")},meta:{group:"common",icon:"hash",id:"number"}})}},class extends Jc{constructor(){super({tag:"textarea",config:{label:r.get("controls.form.textarea")},meta:{group:"common",icon:"textarea",id:"textarea"},attrs:{required:!1}})}},class extends Jc{constructor(){super({tag:"input",attrs:{required:!1,type:"text",className:""},config:{label:r.get("controls.form.input.text")},meta:{group:"common",icon:"text-input",id:"text-input"}})}},class extends Jc{constructor(){super({tag:"input",attrs:{type:"file",required:!1},config:{label:r.get("fileUpload")},meta:{group:"common",icon:"upload",id:"upload"}})}},class extends Jc{constructor(){super({tag:"select",config:{label:r.get("controls.form.select")},attrs:{required:!1,className:""},meta:{group:"common",icon:"select",id:"select"},options:Qc("option")})}},class extends Jc{constructor(){super({tag:"input",attrs:{type:"checkbox",required:!1},config:{label:r.get("controls.form.checkbox-group"),disabledAttrs:["type"]},meta:{group:"common",icon:"checkbox",id:"checkbox"},options:Qc("checkbox",1)})}},class extends Jc{constructor(){super({tag:"input",attrs:{type:"radio",required:!1},config:{label:r.get("controls.form.radio-group"),disabledAttrs:["type"]},meta:{group:"common",icon:"radio-group",id:"radio"},options:Qc("radio")})}}],ed=Array.from(Array(5).keys()).slice(1).map((t=>`h${t}`)),nd="controls.html.header";const od=[class extends Jc{constructor(){super({tag:ed[0],attrs:{tag:ed.map(((t,e)=>({label:t.toUpperCase(),value:t,selected:!e}))),className:""},config:{label:r.get(nd),hideLabel:!0,editableContent:!0},meta:{group:"html",icon:"header",id:"html.header"},content:r.get(nd),action:{onRender:t=>{},click:t=>{}}})}static get definition(){return{i18n:{"en-US":{header:"Custom English Header"}}}}get content(){return super.i18n(nd)}},class extends Jc{constructor(){super({tag:"p",attrs:{className:""},config:{label:r.get("controls.html.paragraph"),hideLabel:!0,editableContent:!0},meta:{group:"html",icon:"paragraph",id:"paragraph"},content:"Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment."})}},class extends Jc{constructor(){super({tag:"hr",config:{label:r.get("controls.html.divider"),hideLabel:!0},meta:{group:"html",icon:"divider",id:"divider"}})}},class extends Jc{constructor(t){super(Ti({tag:"textarea",config:{label:"WYSIWYG",editableContent:!0},meta:{group:"html",icon:"rich-text",id:"tinymce"},attrs:{required:!1},dependencies:{js:"cdnjs.cloudflare.com/ajax/libs/tinymce/4.9.11/tinymce.min.js"},action:{onRender:t=>{const e=`#${t.id}`;window.tinymce.remove(e),window.tinymce.init({selector:e})}},controlAction:{click:()=>{},onRender:()=>{}}},t))}}],id=Object.freeze({sortable:!0,elementOrder:{},groupOrder:[],groups:[{id:"layout",label:"controls.groups.layout",elementOrder:["row","column"]},{id:"common",label:"controls.groups.form",elementOrder:["button","checkbox"]},{id:"html",label:"controls.groups.html",elementOrder:["header","block-text"]}],disable:{groups:[],elements:[],formActions:[]},elements:[],container:null,panels:{displayType:"slider"}}),rd=[...td,...od,...Kc];const sd=new class{constructor(){n(this,"groupLabel",(t=>r.get(t)||t||"")),n(this,"addElement",(t=>{const e=Nr(this.get(t),"controlData"),{meta:{group:n,id:o}}=e,i={row:()=>Cd.active.addChild(),column:()=>i.row().addChild(),field:t=>i.column().addChild(t)};return"layout"!==n?i.field(e):i[o.replace("layout-","")]()})),n(this,"applyOptions",(async(t={})=>{const{container:e,elements:n,groupOrder:o,...i}=Ti(id,t);return this.container=e,this.groupOrder=Di(o.concat(["common","html","layout"])),this.options=i,Promise.all(this.registerControls([...rd,...n]))})),this.data=new Map,this.buttonActions={focus:({target:t})=>{const e=t.closest(`.${l}`);return e&&this.panels.nav.refresh($r(e))},click:({target:t})=>{this.addElement(t.parentElement.id)}}}async init(t,e=!1){return await this.applyOptions(t),this.buildDOM(e),this}registerControls(t){return this.controls=[],t.map((async t=>{let e;return e="function"==typeof t?new t:new Jc(t),this.add(e),this.controls.push(e.dom),e.promise()}))}groupElements(){let t=this.options.groups.slice(),e=this.controls.slice(),n=[];const o=[];return t=Hr(t,this.groupOrder,"id"),t=t.filter((t=>ji(t.id,this.options.disable.groups))),n=t.map((t=>{const n={tag:"ul",attrs:{className:l,id:`${t.id}-${l}`},config:{label:this.groupLabel(t.label)}};if(this.options.elementOrder[t.id]){const e=this.options.elementOrder[t.id],n=Di(e.concat(t.elementOrder));t.elementOrder=n}return e=Hr(e,t.elementOrder,"meta.id"),n.content=e.filter((e=>{const{controlData:n}=this.get(e.id),i=n.meta.id||"";let r=!0;return r=[ji(i,this.options.disable.elements),n.meta.group===t.id,!o.includes(n.meta.id)].every((t=>!0===t)),r&&o.push(i),r})),n})),n}add(t=Object.create(null)){const e=zi(t);return this.data.set(e.id,e),e.controlData.meta.id&&this.data.set(e.controlData.meta.id,e.controlData),e}get(t){return this.data.get(t)}formActions(){if(!0===this.options.disable.formActions)return null;const t={...kd.btnTemplate({content:[kd.icon("bin"),r.get("clear")],title:r.get("clearAll")}),className:["clear-form"],action:{click:t=>{Sd.size?(Yr.confirmClearAll=new window.CustomEvent("confirmClearAll",{detail:{confirmationMessage:r.get("confirmClearAll"),clearAllAction:()=>{Cd.clearAll().then((()=>{const e={src:t.target};Yr.formeoCleared(e)}))},btnCoords:kd.coords(t.target)}}),document.dispatchEvent(Yr.confirmClearAll)):window.alert(r.get("cannotClearFields"))}}},e={...kd.btnTemplate({content:[kd.icon("floppy-disk"),r.get("save")],title:r.get("save")}),className:["save-form"],action:{click:({target:t})=>{const{formData:e}=Ad,n={action:()=>{},coords:kd.coords(t),message:"",button:t};return xc.click.btn(n),xc.save.form(e)}}};return{className:"form-actions f-btn-group",content:Object.entries({clearBtn:t,saveBtn:e}).reduce(((t,[e,n])=>(this.options.disable.formActions.includes(e)||t.push(n),t)),[])}}buildDOM(t){const e=this.groupElements(),n=this.formActions(),{displayType:o}=this.options.panels;this.panels=new Ec({panels:e,type:"controls",displayType:o});const i=["control-groups","formeo-panels-wrap",`panel-count-${e.length}`],s=kd.create({className:i,content:[this.panels.panelNav,this.panels.panelsWrap]}),a=["formeo-controls"];t&&a.push("formeo-sticky");const l=kd.create({className:a,content:[s,n]}),c=l.getElementsByClassName("control-group");this.dom=l,this.groups=c;const[d]=c;this.currentGroup=d,this.actions={filter:t=>{const e=""!==t,n=this.controls;let o=s.querySelector(".filtered-term");if(kd.toggleElementsByStr(n,t),e){const e=r.get("controls.filteringTerm",t);l.classList.add("filtered"),o?o.textContent=e:(o=kd.create({tag:"h5",className:"filtered-term",content:e}),s.insertBefore(o,s.firstChild))}else o&&(l.classList.remove("filtered"),o.remove())},addElement:this.addElement,addGroup:t=>{}};for(let r=c.length-1;r>=0;r--){const t=`formeo-controls-${c[r]}`;this.options.sortable||window.localStorage.removeItem(t),Ql.create(c[r],{animation:150,forceFallback:!0,fallbackClass:"control-moving",fallbackOnBody:!0,group:{name:"controls",pull:"clone",put:!1},onStart:({item:t})=>{const{controlData:e}=this.get(t.id);this.options.ghostPreview&&(t.innerHTML="",t.appendChild(new Fc(e).preview))},onEnd:({from:t,item:e,clone:n})=>{t.contains(n)&&t.replaceChild(e,n)},sort:this.options.sortable,store:{get:()=>{const e=window.localStorage.getItem(t);return e?e.split("|"):[]},set:e=>{const n=e.toArray();window.localStorage.setItem(t,n.join("|"))}}})}return l}};class ad extends fa{constructor(){super(...arguments),n(this,"load",((t=Object.create(null))=>(this.empty(),"string"==typeof t&&(t=JSON.parse(t)),Object.entries(t).forEach((([t,e])=>this.add(t,e))),this.data))),n(this,"get",(t=>t?Nr(this.data,t):this.add())),n(this,"add",((t,e=Object.create(null))=>{const n=t||Pi(),o=this.Component({...e,id:n});return this.set(n,o),this.active=o,o})),n(this,"remove",(t=>(Array.isArray(t)?t.forEach((t=>{this.get(t).remove()})):this.get(t).remove(),this.data))),n(this,"delete",(t=>(delete this.data[t],t))),n(this,"clearAll",((t=!0)=>{const e=Object.values(this.data).map((e=>e.empty(t)));return Promise.all(e)})),n(this,"conditionMap",new Map)}set config(t){this.configVal=Ti(this.configVal,zi(t))}get config(){return this.configVal}}class ld extends Ic{constructor(t,e){super("stage",{...Object.freeze({children:[]}),...t},e);const n=this.createChildWrap();this.dom=kd.create({attrs:{className:[c,"empty"],id:this.id},children:n}),Ql.create(n,{animation:150,fallbackClass:"row-moving",forceFallback:!0,group:{name:"stage",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onAdd:this.onAdd.bind(this),onRemove:this.onRemove.bind(this),onStart:()=>{cd.active=this},onSort:this.onSort.bind(this),draggable:`.${d}`,handle:".item-move"})}empty(t=!0){return new Promise((e=>{t?(this.dom.classList.add("removing-all-fields"),qr.slideUp(this.dom,D,(()=>{e(super.empty(t)),this.dom.classList.remove("removing-all-fields"),qr.slideDown(this.dom,D)}))):e(super.empty())}))}onAdd(...t){const e=super.onAdd(...t);e&&"column"===e.name&&e.parent.autoColumnWidths()}}const cd=new class extends ad{constructor(t){super("stages",t)}Component(t){return new ld(t)}};class dd extends Ic{constructor(t){super("row",{...Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[d]}),...t}),n(this,"autoColumnWidths",(()=>{const t=this.children;if(!t.length)return;const e=Number.parseFloat((100/t.length).toFixed(1))/1;for(const n of t){n.removeClasses(B);const t=n.dom,o=$i(e);n.set("config.width",o),t.style.width=o,t.dataset.colWidth=o;const i=setTimeout((()=>{clearTimeout(i),n.refreshFieldPanels()}),P);document.dispatchEvent(Yr.columnResized)}this.updateColumnPreset()})),n(this,"updateColumnPreset",(()=>{this.columnPresetControl.innerHTML="";const t=this.getColumnPresetOptions.map((({label:t,...e})=>kd.create({tag:"option",content:t,attrs:e})));this.columnPresetControl.append(...t)})),n(this,"setColumnWidths",(t=>{"string"==typeof t&&(t=t.split(",")),this.children.forEach(((e,n)=>{e.setWidth(`${t[n]}%`),e.refreshFieldPanels()}))}));const e=this.createChildWrap();this.dom=kd.create({tag:"li",className:[d,"empty"],dataset:{hoverTag:r.get("row"),editingHoverTag:r.get("editing.row")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),this.editWindow,e]}),Ql.create(e,{animation:150,fallbackClass:"column-moving",forceFallback:!0,group:{name:"row",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onRemove:this.onRemove.bind(this),onEnd:this.onEnd.bind(this),onAdd:this.onAdd.bind(this),onSort:this.onSort.bind(this),draggable:`.${h}`,handle:".item-move"})}get editWindow(){const t={tag:"input",id:`${this.id}-fieldset`,attrs:{type:"checkbox",checked:this.get("config.fieldset"),ariaLabel:r.get("row.settings.fieldsetWrap.aria")},action:{click:({target:{checked:t}})=>{this.set("config.fieldset",Boolean(t))}},config:{label:r.get("row.settings.fieldsetWrap")}},e={tag:"input",id:`${this.id}-inputGroup`,attrs:{type:"checkbox",checked:this.get("config.inputGroup"),ariaLabel:r.get("row.settings.inputGroup.aria")},action:{click:({target:{checked:t}})=>this.set("config.inputGroup",t)},config:{label:r.get("row.makeInputGroup"),description:r.get("row.makeInputGroupDesc")}},n={className:"input-group",content:{tag:"input",attrs:{type:"text",ariaLabel:"Legend for fieldset",value:this.get("config.legend"),placeholder:"Legend"},action:{input:({target:{value:t}})=>this.set("config.legend",t)},className:""}},o=kd.formGroup([t,n]),i={tag:"label",content:r.get("defineColumnWidths"),className:"col-sm-4 form-control-label"};this.columnPresetControl=kd.create(this.columnPresetControlConfig);const s={className:"col-sm-8",content:this.columnPresetControl,action:{onRender:()=>{this.updateColumnPreset()}}},a=[e,"hr",o,"hr",kd.formGroup([i,s],"row")];return kd.create({className:`${this.name}-edit group-config`,action:{onRender:t=>{const e=a.map((t=>kd.create(t)));t.append(...e)}}})}onAdd(...t){super.onAdd(...t),this.autoColumnWidths()}onRemove(...t){super.onRemove(...t),this.autoColumnWidths()}get getColumnPresetOptions(){const t=this.children,e=N.get(t.length-1)||[],n=t.map((t=>{const e=t.get("config.width")||"";return Number(e.replace("%","")).toFixed(1)})).join(",");if(e.length){const t=e.slice();return!t.find((t=>t.value===n))&&t.push({value:n,label:n.replace(/,/g," | "),className:p}),t.map((t=>{const e={...t};return e.selected=t.value===n,e}))}return[]}get columnPresetControlConfig(){return{tag:"select",attrs:{ariaLabel:r.get("defineColumnLayout"),className:m},action:{change:({target:t})=>{const{value:e}=t;this.setColumnWidths(e)}},options:this.getColumnPresetOptions}}}const hd={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}};const ud=new class extends ad{constructor(t){super("rows",t),this.config={all:hd}}Component(t){return new dd(t)}};class pd{constructor(){this.onMove=this.onMove.bind(this),this.onStop=this.onStop.bind(this),this.cleanup=this.cleanup.bind(this)}getRowWidth(t){const e=t.querySelector(".children");if(!e)return 0;const n=e.children.length,o=kd.getStyle(e,"gap")||"0px",i=parseFloat(o,10)||0;return this.totalGapWidth=i*(n-1),e.offsetWidth-this.totalGapWidth}validateResizeTarget(t,e){return t&&e&&t.offsetWidth&&e.offsetWidth}onStart(t){if(t.preventDefault(),this.resized=!1,0!==t.button)return;const e=t.target.parentElement,n=e.nextSibling||e.previousSibling,o=e.closest(`.${d}`);if(this.validateResizeTarget(e,n))if(this.startX="touchstart"===t.type?t.touches[0].clientX:t.clientX,o.classList.add(g),this.columnPreset=o.querySelector(`.${m}`),this.originalColumnClass=e.className,this.originalSiblingClass=n.className,e.className=e.className.replace(B,""),n.className=n.className.replace(B,""),this.colStartWidth=e.offsetWidth,this.sibStartWidth=n.offsetWidth,this.rowWidth=this.getRowWidth(o),this.rowWidth<=0)this.cleanup();else{this.column=e,this.sibling=n,this.row=o;try{window.addEventListener("pointermove",this.onMove,!1),window.addEventListener("pointerup",this.onStop,!1)}catch(i){this.cleanup()}}else this.cleanup()}calculateNewWidths(t){const e=this.colStartWidth+t-this.startX,n=this.sibStartWidth-t+this.startX,o=parseFloat(Li(e,this.rowWidth)),i=parseFloat(Li(n,this.rowWidth));return o<10||i<10?null:{colWidth:$i(o.toFixed(1)),siblingColWidth:$i(i.toFixed(1))}}onMove(t){t.preventDefault();const{column:e,sibling:n}=this,o="touchmove"===t.type?t.touches[0].clientX:t.clientX,i=this.calculateNewWidths(o);if(!i)return;const{colWidth:r,siblingColWidth:s}=i;e.dataset.colWidth=r,n.dataset.colWidth=s,e.style.width=r,n.style.width=s,this.resized=!0}onStop(){const{column:t,sibling:e}=this;window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop),this.resized&&(this.setCustomWidthValue(),Ad.setAddress(`columns.${t.id}.config.width`,t.dataset.colWidth),Ad.setAddress(`columns.${e.id}.config.width`,e.dataset.colWidth),this.row.classList.remove(g),this.resized=!1,this.cleanup())}cleanup(){this.column&&this.originalColumnClass&&(this.column.className=this.originalColumnClass),this.sibling&&this.originalSiblingClass&&(this.sibling.className=this.originalSiblingClass),this.row&&this.row.classList.remove(g),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const t=this.columnPreset;let e=t.querySelector(`.${p}`);const n=this.row.querySelector(".children").children,o=Ir(n,(t=>Li(t.clientWidth,this.rowWidth).toFixed(1))),i=o.join(","),r=o.join(" | ");return e||(e=kd.create({tag:"option",attrs:{className:p,value:i,selected:!0},content:r}),t.append(e)),e.value=i,e.textContent=r,i}}const md=t=>({className:"resize-x-handle",action:{pointerdown:t.onStart.bind(t)},content:[kd.icon("triangle-down"),kd.icon("triangle-up")]}),gd=()=>({className:"column-edit group-config"});class fd extends Ic{constructor(t){super("column",{...Object.freeze({config:{width:"100%"},children:[],className:[h]}),...t}),n(this,"refreshFieldPanels",(()=>{this.children.forEach((t=>t.panels.nav.refresh()))})),n(this,"setWidth",(t=>(this.dom.dataset.colWidth=t,this.dom.style.width=t,this.set("config.width",t))));const e=this.createChildWrap();this.dom=kd.create({tag:"li",className:[h,"empty"],dataset:{hoverTag:r.get("column")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),gd(),md(new pd),e]}),this.processConfig(this.dom),Yr.columnResized=new window.CustomEvent("columnResized",{detail:{column:this.dom,instance:this}}),Ql.create(e,{animation:150,fallbackClass:"field-moving",forceFallback:!0,group:{name:"column",pull:!0,put:["column","controls"]},sort:!0,disabled:!1,onEnd:this.onEnd.bind(this),onAdd:this.onAdd.bind(this),onSort:this.onSort.bind(this),onRemove:this.onRemove.bind(this),onMove:t=>{t.from!==t.to&&t.from.classList.remove("hovering-column")},draggable:`.${u}`,handle:".item-move"})}processConfig(t){const e=Wr.get(this.data,"config.width");e&&(t.dataset.colWidth=e,t.style.width=e)}}const vd={actionButtons:{buttons:["clone","move","remove"],disabled:[]}};const bd=new class extends ad{constructor(t){super("columns",t),this.config={all:vd}}Component(t){return new fd(t)}},yd={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}};const wd=new class extends ad{constructor(t){super("fields",t),n(this,"get",(t=>{let e=t&&Nr(this.data,t);if(!e){const n=sd.get(t);n&&(e=this.add(null,n.controlData))}return e})),this.config={all:yd}}Component(t){return new Fc(t)}};const xd=new class extends ad{constructor(t){super("externals",t)}Component(t){return new Ic("external",t)}},Cd=cd,Sd=ud,Ed=bd,Od=wd,_d=sd,Md=xd,Nd={id:Pi()};const Ad=new class extends fa{constructor(t){super("components"),n(this,"sessionFormData",(()=>{var t;if(null==(t=this.opts)?void 0:t.sessionStorage)return Hi.get(j)})),n(this,"load",((t,e=this.opts||Object.create(null))=>{let n=t;this.empty(),"string"==typeof t&&(n=JSON.parse(t)),this.opts=e;const{stages:o={[Pi()]:{}},rows:i,columns:r,fields:s,id:a=Pi()}={...this.sessionFormData(),...n};this.set("id",a),this.add("stages",Cd.load(o)),this.add("rows",Sd.load(i)),this.add("columns",Ed.load(r)),this.add("fields",Od.load(s)),this.add("externals",Md.load(e.external));for(const l of Object.values(this.get("stages")))l.loadChildren();return this.data})),this.opts=t,this.data=Nd,this.disableEvents=!0,this.stages=Cd,this.rows=Sd,this.columns=Ed,this.fields=Od,this.controls=_d,this.externals=Md}flatList(t=this.data,e=Object.create(null)){return Object.entries(t).reduce(((t,[e,n])=>{if("object"==typeof n)for(const[o,i]of Object.entries(n))t[`${e}.${o}`]=i;return t}),e)}get json(){return window.JSON.stringify(this.formData)}get formData(){return{id:this.get("id"),stages:cd.getData(),rows:ud.getData(),columns:bd.getData(),fields:wd.getData()}}set config(t){const{stages:e,rows:n,columns:o,fields:i}=t;Cd.config=e,Sd.config=n,Ed.config=o,Od.config=i}setAddress(t,e){const[n,o,...i]=Array.isArray(t)?t:t.split("."),r=this[n.replace(/s?$/,"s")].get(o);return null==r||r.set(i,e),r}getAddress(t){if(!Vi(t))return;const[e,n,...o]=Array.isArray(t)?t:t.split("."),i=this[e.replace(/s?$/,"s")].get(n);return o.length?i.get(o):i}getConditionMap(t){if(Vi(t)){const e=t.split(".");return e.every((t=>Boolean(t)))&&this[e[0]].conditionMap.get(e[1])}}setConditionMap(t,e){if(Vi(t)){const n=t.split(".");return n.every((t=>Boolean(t)))&&this[n[0]].conditionMap.set(n[1],e)}}removeConditionMap(t){if(Vi(t)){const e=t.split(".");return e.every((t=>Boolean(t)))&&this[e[0]].conditionMap.delete(e[1])}}},jd={glyphicons:t=>``,"font-awesome":t=>{const[e,n]=t.split(" ");return``},fontello:t=>`${t}`};const kd=new class{constructor(){n(this,"render",(t=>(t.id=`f-${t.id||Pi()}`,this.create(t)))),n(this,"create",((t,e=!1)=>{let n=t;if(!n)return;n=this.processTagName(n);const o=this;let i;const{tag:r}=n,s=["children","content"];let a;const l={attrs:{},className:[Wr.get(n,"config.inputWrap")||"f-field-group"],children:[],config:{}};let c=document.createElement(r);const d={string:t=>{c.innerHTML+=t},object:t=>t&&c.appendChild(o.create(t,e)),node:t=>c.appendChild(t),component:t=>c.appendChild(t.dom),array:t=>{for(const e of t)i=o.childType(e),d[i](e)},function:t=>{t=t(),i=o.childType(t),d[i](t)},undefined:()=>null,boolean:()=>null};if(s.push("tag"),n.className){const{className:t}=n;n.attrs=Object.assign({},n.attrs,{className:t}),delete n.className}if(n.options){let{options:t}=n;if(t=this.processOptions(t,n,e),!this.holdsContent(c)||"button"===r)return Wr.forEach(t,(t=>{l.children.push(o.create(t,e))})),n.attrs.className&&(l.className=n.attrs.className),l.config=Object.assign({},n.config),this.create(l,e);d.array.call(this,t),delete n.content,s.push("options")}if("OPTION"===c.tagName){const t=setTimeout((()=>{c.selected=!1,clearTimeout(t)}),0)}if(n.attrs&&(o.processAttrs(n,c,e),s.push("attrs")),n.config){if(n.config.label&&(n.config.label&&"button"!==r||["radio","checkbox"].includes(Wr.get(n,"attrs.type")))&&!e){const t=o.label(n);if(!n.config.hideLabel){const e=[...o.labelAfter(n)?[c,t]:[t,c]];l.children.push(e)}}s.push("config")}if(n.content||n.children){const t=n.content||n.children;i=o.childType(t),d[i],d[i].call(this,t)}if(n.dataset){for(const t in n.dataset)Object.hasOwn(n.dataset,t)&&(c.dataset[t]="function"==typeof n.dataset[t]?n.dataset[t]():n.dataset[t]);s.push("dataset")}n.action&&(this.actionHandler(c,n.action),s.push("action"));const h=Wr.subtract(s,Object.keys(n));for(a=h.length-1;a>=0;a--)c[h[a]]=n[h[a]];return l.children.length&&(c=this.create(l)),c})),n(this,"onRender",((t,e)=>{t.parentElement?e(t):window.requestAnimationFrame((()=>this.onRender(t,e)))})),n(this,"toggleElementsByStr",((t,e)=>{const n=[];return kd.elementsContainText(t,e,((t,e)=>{e?(t.style.display="block",n.push(t)):t.style.display="none"})),n})),n(this,"elementsContainText",((t,e,n)=>{const o=[];return Vr(t,(t=>{const i=-1!==t.textContent.toLowerCase().indexOf(e.toLowerCase());null==n||n(t,i),i&&o.push(t)})),o})),n(this,"generateOption",(({type:t="option",label:e,value:n,i:o=0,selected:i})=>({tag:"option"===t?"option":"input",attrs:{type:t,value:n||`${t}-${o}`,["option"===t?"selected":"checked"]:i||!o},config:{label:e||r.get("labelCount",{label:r.get("option"),count:o})}}))),n(this,"makeOption",(([t,e],n,o)=>{const i={value:t,label:r.get(`${o}.${e}`)||e};return t===n&&(i.selected=!0),i})),n(this,"requiredMark",(()=>({tag:"span",className:"text-error",children:"*"}))),n(this,"removeEmpty",(t=>{const e=t.parentElement,n=ki(t),o=e.getElementsByClassName(`formeo-${n}`);if(this.remove(t),!o.length){if(!this.isStage(e))return this.removeEmpty(e);this.emptyClass(e)}})),n(this,"btnTemplate",(({title:t="",...e})=>({tag:"button",attrs:{type:"button",title:t},...e}))),n(this,"isControls",(t=>ki(t)===l)),n(this,"isStage",(t=>ki(t)===c)),n(this,"isRow",(t=>ki(t)===d)),n(this,"isColumn",(t=>ki(t)===h)),n(this,"isField",(t=>ki(t)===u)),n(this,"asComponent",(t=>Ad[`${ki(t)}s`].get(t.id))),this.options=Object.create(null),this.styleSheet=(()=>{const t=document.createElement("style");return t.setAttribute("media","screen"),t.setAttribute("type","text/css"),t.appendChild(document.createTextNode("")),document.head.appendChild(t),t.sheet})()}set setOptions(t){this.options=Ti(Object.assign({},this.options,t))}processTagName(t){let e;if("string"==typeof t&&(e=t,t={tag:e}),t.attrs){const{tag:n,...o}=t.attrs;if(n)if("string"==typeof n)e=n;else{e=(n.find((t=>!0===t.selected))||n[0]).value}t.attrs=o}return t.tag=e||t.tag||"div",t}actionHandler(t,e){const n={onRender:kd.onRender,render:kd.onRender},o=["focus","blur"];return Object.entries(e).map((([e,i])=>(Array.isArray(i)?i:[i]).map((i=>{const r=n[e]||(t=>(e,n)=>e.addEventListener(t,n,o.includes(t)))(e);return r(t,i)}))))}get icons(){if(this.iconSymbols)return this.iconSymbols;const t=document.querySelectorAll("#formeo-sprite svg symbol");return this.iconSymbols=Array.from(t).reduce(((t,e)=>{var n;return t[e.id.replace(R,"")]=kd.create({tag:"svg",attrs:{className:`svg-icon ${n=e.id}`},children:[{tag:"use",attrs:{"xmlns:xlink":"http://www.w3.org/1999/xlink","xlink:href":`#${n}`}}]}),t}),{}),this.iconSymbols}icon(t=null,e=[]){var n;if(!t)return;const o=this.icons[t];if(o){const t=o.cloneNode(!0);return t.classList.add(...e),t.outerHTML}return(null==(n=jd[kd.options.iconFont])?void 0:n.call(jd,t))||t}processAttrs(t,e,n){const{attrs:o={}}=t;n||!o.name&&this.isInput(t.tag)&&e.setAttribute("name",Pi(t));for(const i of Object.keys(o)){const t=Wr.safeAttrName(i);let n=o[i]||"";if(Array.isArray(n))if("object"==typeof n[0]){const t=n.filter((t=>!0===t.selected));n=t.length?t[0].value:n[0].value}else n=n.join(" ");if(n)if("OPTION"===e.tagName&&"selected"===t){const o=setTimeout((()=>{e.setAttribute(t,n),clearTimeout(o)}),0)}else e.setAttribute(t,n)}}processOptions(t,e,n){const{action:o,attrs:i}=e,r=i.type||e.tag,s=i.id||e.id;return t.map(((t,i)=>{var a;const{label:l,...c}=t,d=()=>{const a={tag:"input",attrs:{name:s,type:r,value:t.value||"",id:`${s}-${i}`,...c},action:o},l={tag:"label",attrs:{for:`${s}-${i}`},config:{inputWrap:"form-check"},children:t.label},d={children:[a,l],className:[`f-${r}`]};return e.attrs.className&&(e.config.inputWrap=e.attrs.className),e.config.inline&&d.className.push(`f-${r}-inline`),t.selected&&(a.attrs.checked=!0),n&&(l.attrs.contenteditable=!0),d},h={select:()=>({tag:"option",attrs:t,children:t.label}),button:t=>{const{type:n,label:o,className:i,id:r}=t;return{...e,attrs:{type:n},className:i,id:r||Pi(),options:void 0,children:o,action:e.action}},checkbox:d,radio:d};return null==(a=h[r])?void 0:a.call(h,t)}))}holdsContent(t){return-1!==t.outerHTML.indexOf("/")}isBlockInput(t){return!this.isInput(t)&&this.holdsContent(t)}isInput(t){return"string"!=typeof t&&(t=t.tagName),-1!==["input","textarea","select"].indexOf(t)}parsedHtml(t){const e=document.createElement("textarea");return e.innerHTML=t,e.textContent}labelAfter(t){const e=Wr.get(t,"attrs.type"),n=Wr.get(t,"config.labelAfter");return void 0!==n?n:"checkbox"===e||"radio"===e}label(t,e){const n=Wr.get(t,"attrs.required");let{config:{label:o=""}}=t;const{id:i,attrs:r}=t;"function"==typeof o&&(o=o());const s={tag:"label",attrs:{for:i||(null==r?void 0:r.id)},className:[],children:[o,n&&this.requiredMark()],action:{}};return e&&(delete s.attrs.for,s.attrs.contenteditable=!0,s.fMap=e),s}childType(t){return void 0===t?t:[["array",t=>Array.isArray(t)],["node",t=>t instanceof window.Node||t instanceof window.HTMLElement],["component",()=>null==t?void 0:t.dom],[typeof t,()=>!0]].find((e=>e[1](t)))[0]}getStyle(t,e=!1){let n;return window.getComputedStyle?n=window.getComputedStyle(t,null):t.currentStyle&&(n=t.currentStyle),e?n[e]:n}getElement(t){return{node:()=>t,object:()=>document.getElementById(t.id),string:()=>document.getElementById(t)}[this.childType(t)]()}empty(t){for(;t.firstChild;)this.remove(t.firstChild);return t}remove(t){const e=ki(t);return e?Ad.remove(`${e}s.${t.id}`):t.parentElement.removeChild(t)}removeClasses(t,e){const n={string:t=>t.classList.remove(e),array:t=>{for(const n of e)t.classList.remove(n)}};n.object=n.string,Wr.forEach(t,n[this.childType(e)])}addClasses(t,e){const n={string:t=>t.classList.add(e),array:t=>{for(const n of e)t.classList.add(n)}};Wr.forEach(t,n[this.childType(e)])}formGroup(t,e=""){return{className:["f-field-group",e],children:t}}coords(t){const e=t.getBoundingClientRect(),n=document.body.getBoundingClientRect();return{pageX:e.left+e.width/2,pageY:e.top-n.top-e.height/2}}clearStage(t){t.classList.add("removing-all-fields");qr.slideUp(t,600,(()=>{kd.empty(t),t.classList.remove("removing-all-fields"),kd.emptyClass(t),qr.slideDown(t,300)}))}toggleSortable(t,e){const n=ki(t);if(!n)return;const o=ki(t.parentElement),i=kd[n].get(t.id).sortable;e||(e=!i.option("disabled")),i.option("disabled",e),o&&["rows","columns","stages"].includes(o)&&this.toggleSortable(t.parentElement,e)}emptyClass(t){const e=t.getElementsByClassName(f.get(t.classList.item(0)));t.classList.toggle("empty",!e.length)}};r.addLanguage("en-US",void 0);const Dd={get editor(){return{stickyControls:!1,allowEdit:!0,dataType:"json",debug:!1,sessionStorage:!1,editorContainer:null,external:{},svgSprite:null,iconFont:null,config:{},events:{},actions:{},controls:{},polyfills:Rr(),i18n:{location:"https://draggable.github.io/formeo/assets/lang/"}}}};let Pd=class{constructor({formData:t,...e},n){const o=Ti(Dd.editor,e),{actions:i,events:r,debug:s,config:a,editorContainer:l,...c}=o;l&&(this.editorContainer="string"==typeof l?document.querySelector(l):l),this.opts=c,kd.setOptions=c,Ad.config=a,this.userFormData=n||t,this.Components=Ad,this.dom=kd,Yr.init({debug:s,...r}),xc.init({debug:s,sessionStorage:c.sessionStorage,...i}),this.loadResources().then((()=>{c.allowEdit&&this.init()}))}get formData(){return this.Components.formData}set formData(t={}){this.load({...this.userFormData,...t},this.opts)}get json(){return this.Components.json}loadResources(){var t;const e=[];return this.opts.polyfills&&(t=>{const e=Array.isArray(t)?a.filter((({name:e})=>-1!==t.indexOf(e))):a;Promise.all(e.map((({src:t})=>qc(t))))})(this.opts.polyfills),this.opts.style&&e.push(Uc(this.opts.style)),this.opts.svgSprite?e.push(Gc(this.opts.svgSprite,Xc,(()=>Gc("https://draggable.github.io/formeo/assets/img/formeo-sprite.svg",Xc)))):e.push(Xc('image/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xmlimage/svg+xml')),e.push(r.init({...this.opts.i18n,locale:null==(t=window.sessionStorage)?void 0:t.getItem(k)})),Promise.all(e)}init(){sd.init(this.opts.controls,this.opts.stickyControls).then((t=>{this.controls=t,this.load(this.userFormData,this.opts),this.formId=Ad.get("id"),this.i18n={setLang:t=>{var e;null==(e=window.sessionStorage)||e.setItem(k,t);r.setCurrent(t).then((()=>{this.init()}),console.error)}},this.render()}))}load(t=this.userFormData,e=this.opts){return this.Components.load(t,e)}render(){if(!this.controls)return window.requestAnimationFrame((()=>this.render()));if(this.stages=Object.values(Ad.get("stages")),this.opts.controlOnLeft)for(const e of this.stages)e.dom.style.order=1;const t={attrs:{className:"formeo formeo-editor",id:this.formId},content:[this.stages.map((({dom:t})=>t))]};r.current.dir&&(t.attrs.dir=r.current.dir,kd.dir=r.current.dir),this.editor=kd.create(t);(this.controls.container||this.editor).appendChild(this.controls.dom),this.editorContainer&&(kd.empty(this.editorContainer),this.editorContainer.appendChild(this.editor)),Yr.formeoLoaded=new window.CustomEvent("formeoLoaded",{detail:{formeo:this}}),document.dispatchEvent(Yr.formeoLoaded)}};const Td=t=>{const e=t.match(F);return(null==e?void 0:e[0])||t},zd=t=>t.replace(F,Pi());let Ld=class{constructor(t,e={}){n(this,"render",((t=this.form)=>{this.form=t;const e=document.getElementsByClassName("formeo-render").length,n={id:this.form.id,className:`formeo-render formeo formeo-rendered-${e}`,children:this.processedData};this.renderedForm=kd.render(n),this.applyConditions();const o=this.container.querySelector(".formeo-render");o?o.replaceWith(this.renderedForm):this.container.appendChild(this.renderedForm)})),n(this,"orderChildren",((t,e)=>e.reduce(((e,n)=>(e.push(this.form[t][n]),e)),[]))),n(this,"prefixId",(t=>"f-"+t)),n(this,"processColumn",(({id:t,...e})=>({...e,id:this.prefixId(t),children:this.processFields(e.children),style:`width: ${e.config.width||"100%"}`}))),n(this,"processRows",(t=>this.orderChildren("rows",this.form.stages[t].children).reduce(((t,e)=>(e&&t.push(this.processRow(e)),t)),[]))),n(this,"cacheComponent",(t=>(this.components[Td(t.id)]=t,t))),n(this,"processRow",((t,e="row")=>{const{config:n,id:o}=t,i=[`formeo-${e}-wrap`],r={...t,children:this.processColumns(t.id),id:this.prefixId(o)};this.cacheComponent(r);const s=[{condition:n.legend,result:()=>({tag:n.fieldset?"legend":"h3",children:n.legend})},{condition:!0,result:()=>r},{condition:n.inputGroup,result:()=>this.addButton(o)}].reduce(((t,{condition:e,result:n})=>(e&&t.push(n()),t)),[]);return n.inputGroup&&i.push("f-input-group-wrap"),{tag:n.fieldset?"fieldset":"div",id:Pi(),className:i,children:s}})),n(this,"cloneComponentData",(t=>{const{children:e=[],id:n,...o}=this.components[t];return Object.assign({},o,{id:zd(n),children:e.length&&e.map((({id:t})=>this.cloneComponentData(Td(t))))})})),n(this,"addButton",(t=>kd.render({tag:"button",attrs:{className:"add-input-group btn pull-right",type:"button"},children:"Add +",action:{click:e=>{const n=e.target.parentElement,o=kd.render(this.cloneComponentData(t));n.insertBefore(o,n.lastChild),o.appendChild(kd.render(kd.btnTemplate({className:"remove-input-group",children:kd.icon("remove"),action:{mouseover:({target:t})=>t.parentElement.classList.add("will-remove"),mouseleave:({target:t})=>t.parentElement.classList.remove("will-remove"),click:({target:t})=>t.parentElement.remove()}})))}}}))),n(this,"processColumns",(t=>this.orderChildren("columns",this.form.rows[t].children).map((t=>this.cacheComponent(this.processColumn(t)))))),n(this,"processFieldsOrig",(t=>this.orderChildren("fields",t).map((({id:t,...e})=>this.cacheComponent(Object.assign({},e,{id:this.prefixId(t)})))))),n(this,"processFields",(t=>this.orderChildren("fields",t).map((({id:t,...e})=>{const{action:n={},dependencies:o={}}=this.elements[e.meta.id]||{};o&&Zc(o);const i=Ti({action:n},e);return this.cacheComponent({...i,id:this.prefixId(t)})})))),n(this,"applyConditions",(()=>{Object.values(this.components).forEach((({conditions:t})=>{t&&t.forEach(((t,e)=>{const{if:n,then:o}=t;n.forEach((t=>{const{source:e,...n}=t;if(Vi(e)){this.getComponents(e).forEach((t=>{const e=$d(t);e&&t.addEventListener(e,(t=>this.evaluateCondition(n,t)&&o.forEach((e=>this.execResult(e,t)))),!1);const i={target:t};this.evaluateCondition(n,i)&&o.forEach((t=>this.execResult(t,i)))}))}}))}))}))})),n(this,"evaluateCondition",(({sourceProperty:t,targetProperty:e,comparison:n,target:o},i)=>{var r;const s={equals:ga,notEquals:(t,e)=>!ga(t,e),contains:(t,e)=>t.includes(e),notContains:(t,e)=>!t.includes(e)},a=String(i.target[t]),l=String(Vi(o)?this.getComponent(o)[e]:o);return null==(r=s[n])?void 0:r.call(s,a,l)})),n(this,"execResult",(({assignment:t,target:e,targetProperty:n,value:o})=>{var i;const r={equals:t=>{var e;const i={value:()=>{t[n]=o},isNotVisible:()=>{t.parentElement.setAttribute("hidden",!0),t.required=!1},isVisible:()=>{t.parentElement.removeAttribute("hidden"),t.required=t._required}};null==(e=i[n])||e.call(i)}};if(Vi(e)){const n=this.getComponent(e);n&&void 0===n._required&&(n._required=n.required),null==(i=r[t])||i.call(r,n)}})),n(this,"getComponent",(t=>{const e=t.slice(t.indexOf(".")+1);return Ii(t)?this.external[e]:this.renderedForm.querySelector(`#f-${e}`)})),n(this,"getComponents",(t=>{const e=[],n=t.slice(t.indexOf(".")+1);return Ii(t)?e.push(this.external[n]):e.push(...this.renderedForm.querySelectorAll(`[name=f-${n}]`)),e}));const{renderContainer:o,external:i,elements:r}=(({editorContainer:t,renderContainer:e,...n})=>{const o=t=>"string"==typeof t?document.querySelector(t):t;return{...n,renderContainer:o(e),editorContainer:o(t)}})(t);this.container=o,this.form=e,this.external=i,this.dom=kd,this.components=Object.create(null),this.elements=r}get processedData(){return Object.values(this.form.stages).map((t=>(t.children=this.processRows(t.id),t.className=c,kd.render(t))))}};const $d=t=>{const[e]=[["input",t=>["textarea","text"].includes(t.type)],["change",t=>["select"].includes(t.tagName.toLowerCase())||["checkbox","radio"].includes(t.type)]].find((e=>e[1](t)))||[!1];return e};void 0!==window&&(window.FormeoEditor=Pd,window.FormeoRenderer=Ld);const Hd=Pd,Vd=Ld;t.FormeoEditor=Hd,t.FormeoRenderer=Vd,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})})); diff --git a/assets/js/formeo.min.js.gz b/assets/js/formeo.min.js.gz index 9a8e66b6..76a7f3c7 100644 Binary files a/assets/js/formeo.min.js.gz and b/assets/js/formeo.min.js.gz differ diff --git a/index.html b/index.html index 6521f1ed..6905cd0f 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -Formeo | Drag & Drop Form Creation

Rendered Form

\ No newline at end of file +Formeo | Drag & Drop Form Creation

Rendered Form

\ No newline at end of file