formeo 2.3.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/demo/assets/css/demo.min.css +1 -1
- package/dist/demo/assets/css/demo.min.css.gz +0 -0
- package/dist/demo/assets/css/formeo.min.css +1 -1
- package/dist/demo/assets/css/formeo.min.css.gz +0 -0
- package/dist/demo/assets/js/demo.min.js +2 -2
- package/dist/demo/assets/js/demo.min.js.gz +0 -0
- package/dist/demo/assets/js/formeo.min.js +3 -3
- package/dist/demo/assets/js/formeo.min.js.gz +0 -0
- package/dist/demo/index.html +1 -1
- package/dist/formData_schema.json +359 -0
- package/dist/formeo.cjs.js +3 -3
- package/dist/formeo.es.js +76 -53
- package/dist/formeo.min.css +1 -1
- package/dist/formeo.min.js +3 -3
- package/dist/formeo.umd.js +3 -3
- package/package.json +9 -5
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
formeo - https://formeo.io
|
|
4
|
-
Version: 2.
|
|
4
|
+
Version: 2.3.1
|
|
5
5
|
Author: Draggable https://draggable.io
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
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:{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]);++i<r;)n=e(n,t[i],i,t);return n};var d=function(t){return function(e){return null==t?void 0:t[e]}}({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),u="object"==typeof a&&a&&a.Object===Object&&a,h=u,p="object"==typeof self&&self&&self.Object===Object&&self,f=h||p||Function("return this")(),m=f.Symbol;var g=function(t,e){for(var n=-1,o=null==t?0:t.length,i=Array(o);++n<o;)i[n]=e(t[n],n,t);return i},v=Array.isArray,b=m,y=Object.prototype,w=y.hasOwnProperty,C=y.toString,x=b?b.toStringTag:void 0;var E=function(t){var e=w.call(t,x),n=t[x];try{t[x]=void 0;var o=!0}catch(r){}var i=C.call(t);return o&&(e?t[x]=n:delete t[x]),i},S=Object.prototype.toString;var O=E,N=function(t){return S.call(t)},A=m?m.toStringTag:void 0;var _=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":A&&A in Object(t)?O(t):N(t)};var T=function(t){return null!=t&&"object"==typeof t},j=_,P=T;var L=function(t){return"symbol"==typeof t||P(t)&&"[object Symbol]"==j(t)},D=g,k=v,$=L,I=m?m.prototype:void 0,R=I?I.toString:void 0;var M=function t(e){if("string"==typeof e)return e;if(k(e))return D(e,t)+"";if($(e))return R?R.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n},F=M;var B=function(t){return null==t?"":F(t)},W=d,z=B,U=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,q=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var H=function(t){return(t=z(t))&&t.replace(U,W).replace(q,"")},G=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var V=function(t){return t.match(G)||[]},X=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var Y=function(t){return X.test(t)},Z="\\ud800-\\udfff",J="\\u2700-\\u27bf",K="a-z\\xdf-\\xf6\\xf8-\\xff",Q="A-Z\\xc0-\\xd6\\xd8-\\xde",tt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",et="["+tt+"]",nt="\\d+",ot="["+J+"]",it="["+K+"]",rt="[^"+Z+tt+nt+J+K+Q+"]",st="(?:\\ud83c[\\udde6-\\uddff]){2}",at="[\\ud800-\\udbff][\\udc00-\\udfff]",lt="["+Q+"]",ct="(?:"+it+"|"+rt+")",dt="(?:"+lt+"|"+rt+")",ut="(?:['’](?:d|ll|m|re|s|t|ve))?",ht="(?:['’](?:D|LL|M|RE|S|T|VE))?",pt="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",ft="[\\ufe0e\\ufe0f]?",mt=ft+pt+("(?:\\u200d(?:"+["[^"+Z+"]",st,at].join("|")+")"+ft+pt+")*"),gt="(?:"+[ot,st,at].join("|")+")"+mt,vt=RegExp([lt+"?"+it+"+"+ut+"(?="+[et,lt,"$"].join("|")+")",dt+"+"+ht+"(?="+[et,lt+ct,"$"].join("|")+")",lt+"?"+ct+"+"+ut,lt+"+"+ht,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",nt,gt].join("|"),"g");var bt=V,yt=Y,wt=B,Ct=function(t){return t.match(vt)||[]};var xt=c,Et=H,St=function(t,e,n){return t=wt(t),void 0===(e=n?void 0:e)?yt(t)?Ct(t):bt(t):t.match(e)||[]},Ot=RegExp("['’]","g");var Nt=function(t){return function(e){return xt(St(Et(e).replace(Ot,"")),t,"")}};var At=function(t,e,n){var o=-1,i=t.length;e<0&&(e=-e>i?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<i;)r[o]=t[o+e];return r};var _t=function(t,e,n){var o=t.length;return n=void 0===n?o:n,!e&&n>=o?t:At(t,e,n)},Tt=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var jt=function(t){return Tt.test(t)};var Pt=function(t){return t.split("")},Lt="\\ud800-\\udfff",Dt="["+Lt+"]",kt="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",$t="\\ud83c[\\udffb-\\udfff]",It="[^"+Lt+"]",Rt="(?:\\ud83c[\\udde6-\\uddff]){2}",Mt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="(?:"+kt+"|"+$t+")"+"?",Bt="[\\ufe0e\\ufe0f]?",Wt=Bt+Ft+("(?:\\u200d(?:"+[It,Rt,Mt].join("|")+")"+Bt+Ft+")*"),zt="(?:"+[It+kt+"?",kt,Rt,Mt,Dt].join("|")+")",Ut=RegExp($t+"(?="+$t+")|"+zt+Wt,"g");var qt=Pt,Ht=jt,Gt=function(t){return t.match(Ut)||[]};var Vt=_t,Xt=jt,Yt=function(t){return Ht(t)?Gt(t):qt(t)},Zt=B;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?Vt(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<e.length;i++){o=/^(.+?) *?= *?([^\n]+)/.exec(e[i]),o&&(n[o[1]]=o[2].replace(/(^\s+|\s+$)/g,""))}return n}loadLang(t,e=!0){const n=this;return new Promise((function(o,i){if(-1!==n.loaded.indexOf(t)&&e)return n.applyLanguage(n.langs[t]),o(n.langs[t]);return async function(t){try{const e=await fetch(t);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const n=t.endsWith(".lang")?"text":"json";return await e[n]()}catch(e){throw e}}([n.config.location,t,n.config.extension].join("")).then((e=>{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;!function(){try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode('._3x4ZIcu-{position:absolute;background:#1f2937;color:#fff;padding:.75rem;border-radius:.375rem;max-width:200px;z-index:50;visibility:hidden;opacity:0;transition:opacity .2s;pointer-events:none;left:0;top:0}._3x4ZIcu-.JIt36hCJ{visibility:visible;opacity:1;pointer-events:all}._3x4ZIcu-:before{content:"";position:absolute;width:0;height:0;border:6px solid transparent}._3x4ZIcu-[data-position=top]:before{border-top-color:#1f2937;bottom:-12px;left:50%;transform:translate(-50%)}._3x4ZIcu-[data-position=bottom]:before{border-bottom-color:#1f2937;top:-12px;left:50%;transform:translate(-50%)}._3x4ZIcu-[data-position=left]:before{border-left-color:#1f2937;right:-12px;top:50%;transform:translateY(-50%)}._3x4ZIcu-[data-position=right]:before{border-right-color:#1f2937;left:-12px;top:50%;transform:translateY(-50%)}._3x4ZIcu-[data-position=top-left]:before{border-top-color:#1f2937;bottom:-12px;left:12px;transform:none}._3x4ZIcu-[data-position=top-right]:before{border-top-color:#1f2937;bottom:-12px;right:12px;left:auto;transform:none}._3x4ZIcu-[data-position=bottom-left]:before{border-bottom-color:#1f2937;top:-12px;left:12px;transform:none}._3x4ZIcu-[data-position=bottom-right]:before{border-bottom-color:#1f2937;top:-12px;right:12px;left:auto;transform:none}')),document.head.appendChild(t)}}catch(e){}}();var ie=Object.defineProperty,re=(t,e,n)=>((t,e,n)=>e in t?ie(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n)(t,"symbol"!=typeof e?e+"":e,n);const se="_3x4ZIcu-",ae="JIt36hCJ",le={triggerName:"tooltip"};class ce{constructor(t=le){re(this,"triggerName"),re(this,"tooltip"),re(this,"activeTriggerType",null),re(this,"spacing",12),re(this,"handleClick",(t=>{const e=this.triggerName,n=t.target.closest(`[${e}][${e}-type="click"]`);if(n)if(this.isVisible())this.hide();else{const t=n.getAttribute(`${e}`);this.show(n,t),this.activeTriggerType="click"}else this.hide()})),re(this,"handleMouseOver",(t=>{const e=this.triggerName,n=t.target.closest(`[${e}]`);if("click"!==this.activeTriggerType&&"click"!==(null==n?void 0:n.getAttribute(`${e}-type`))){const t=null==n?void 0:n.getAttribute(`${e}`);t&&(this.show(n,t),this.activeTriggerType="hover")}})),re(this,"handleMouseOut",(t=>{const e=this.triggerName,n=t.target.closest(`[${e}]`);"click"!==this.activeTriggerType&&"click"!==(null==n?void 0:n.getAttribute(`${e}-type`))&&this.hide()})),re(this,"handleResize",(()=>{this.isVisible()&&this.hide()})),re(this,"handleScroll",(()=>{this.isVisible()&&this.hide()})),this.triggerName=`data-${t.triggerName}`,this.tooltip=document.createElement("div"),this.tooltip.className=`d-tooltip ${se}`,document.body.appendChild(this.tooltip),this.setupEventListeners()}setupEventListeners(){document.addEventListener("mouseover",this.handleMouseOver),document.addEventListener("mouseout",this.handleMouseOut),document.addEventListener("click",this.handleClick),window.addEventListener("resize",this.handleResize),window.addEventListener("scroll",this.handleScroll,!0)}isVisible(){return this.tooltip.classList.contains(ae)}calculatePosition(t){const e=t.getBoundingClientRect(),n=this.tooltip.getBoundingClientRect(),o=[{name:"top",x:e.left+(e.width-n.width)/2,y:e.top-n.height-this.spacing},{name:"bottom",x:e.left+(e.width-n.width)/2,y:e.bottom+this.spacing},{name:"left",x:e.left-n.width-this.spacing,y:e.top+(e.height-n.height)/2},{name:"right",x:e.right+this.spacing,y:e.top+(e.height-n.height)/2},{name:"top-left",x:e.left,y:e.top-n.height-this.spacing},{name:"top-right",x:e.right-n.width,y:e.top-n.height-this.spacing},{name:"bottom-left",x:e.left,y:e.bottom+this.spacing},{name:"bottom-right",x:e.right-n.width,y:e.bottom+this.spacing}];return o.find((t=>this.fitsInViewport(t,n)))||o[0]}fitsInViewport(t,e){if(!(t.x>=0&&t.y>=0&&t.x+e.width<=window.innerWidth&&t.y+e.height<=window.innerHeight))return!1;return 0===[[t.x,t.y],[t.x+e.width,t.y],[t.x,t.y+e.height],[t.x+e.width,t.y+e.height],[t.x+e.width/2,t.y+e.height/2]].flatMap((([t,e])=>Array.from(document.elementsFromPoint(t,e)))).filter((t=>{if(this.tooltip.contains(t)||t===this.tooltip||t.classList.contains(se)||"none"===getComputedStyle(t).pointerEvents)return!1})).length}show(t,e){this.tooltip.innerHTML=e??"",this.tooltip.classList.add(ae);const n=this.calculatePosition(t);this.tooltip.style.left=`${n.x}px`,this.tooltip.style.top=`${n.y}px`,this.tooltip.dataset.position=n.name}hide(){this.tooltip.classList.remove(ae),this.activeTriggerType=null}destroy(){document.removeEventListener("mouseover",this.handleMouseOver),document.removeEventListener("mouseout",this.handleMouseOut),document.removeEventListener("click",this.handleClick),window.removeEventListener("resize",this.handleResize),window.removeEventListener("scroll",this.handleScroll,!0),this.tooltip.remove()}}void 0!==window&&(window.SmartTooltip=ce);const de="2.2.2",ue="formeo",he="formeo-sprite",pe=[{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"}],fe=`https://cdn.jsdelivr.net/npm/formeo@${de}/dist/${he}.svg`,me=`https://draggable.github.io/formeo/assets/img/${he}.svg`,ge=`https://cdn.jsdelivr.net/npm/formeo@${de}/dist/formeo.min.css`,ve="control-group",be=`${ue}-stage`,ye=`${ue}-row`,we=`${ue}-column`,Ce=`${ue}-field`,xe="custom-column-widths",Ee="column-preset",Se="resizing-columns",Oe=new Map([[be,ye],[ye,we],[we,Ce]]),Ne=["external","stages","rows","columns","fields"],Ae=["stage","row","column","field"].reduce(((t,e)=>({...t,[e]:e})),{}),_e=[{name:"controls",className:ve},{name:"stage",className:be},{name:"row",className:ye},{name:"column",className:we},{name:"field",className:Ce}],Te={controls:ve,stage:be,row:ye,column:we,field:Ce},je=Object.entries(Te).reduce(((t,[e,n])=>({...t,[n]:e})),{}),Pe=Object.values(Te),Le=new RegExp(`${Pe.join("|")}`,"g"),De=_e.map((({name:t},e,n)=>{const{name:o}=n[e+1]||{};return o&&[t,o]})).filter(Boolean),ke=De.slice().map((t=>t.slice().reverse())).reverse(),$e=new Map(De),Ie=new Map(ke.slice()),Re=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)),[])),Me=[{type:"added",condition:(t,e)=>Boolean(void 0===t&&e)}],Fe=`${ue}-formData`,Be=`${ue}-locale`,We=333,ze=Math.round(166.5),Ue=Math.round(666),qe="formeoSaved",He="formeoUpdated",Ge="formeoOnRender",Ve=["label","logical","source","thenTarget","sourceProperty","comparison","target","targetProperty","assignment","value"],Xe={value:"attrs.value",checked:"attrs.checked",isVisible:"config.isVisible",isNotVisible:"config.isNotVisible"},Ye={comparison:{equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},assignment:{equals:"="},logical:{and:"&&",or:"||"},property:Xe},Ze=/(\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,Je=/\bcol-\w+-\d+/g,Ke="f-i-";var Qe=function(){this.__data__=[],this.size=0};var tn=function(t,e){return t===e||t!=t&&e!=e},en=tn;var nn=function(t,e){for(var n=t.length;n--;)if(en(t[n][0],e))return n;return-1},on=nn,rn=Array.prototype.splice;var sn=nn;var an=nn;var ln=nn;var cn=Qe,dn=function(t){var e=this.__data__,n=on(e,t);return!(n<0)&&(n==e.length-1?e.pop():rn.call(e,n,1),--this.size,!0)},un=function(t){var e=this.__data__,n=sn(e,t);return n<0?void 0:e[n][1]},hn=function(t){return an(this.__data__,t)>-1},pn=function(t,e){var n=this.__data__,o=ln(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};function fn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}fn.prototype.clear=cn,fn.prototype.delete=dn,fn.prototype.get=un,fn.prototype.has=hn,fn.prototype.set=pn;var mn=fn,gn=mn;var vn=function(){this.__data__=new gn,this.size=0};var bn=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n};var yn=function(t){return this.__data__.get(t)};var wn=function(t){return this.__data__.has(t)};var Cn=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},xn=_,En=Cn;var Sn,On=function(t){if(!En(t))return!1;var e=xn(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},Nn=f["__core-js_shared__"],An=(Sn=/[^.]+$/.exec(Nn&&Nn.keys&&Nn.keys.IE_PROTO||""))?"Symbol(src)_1."+Sn:"";var _n=function(t){return!!An&&An in t},Tn=Function.prototype.toString;var jn=function(t){if(null!=t){try{return Tn.call(t)}catch(e){}try{return t+""}catch(e){}}return""},Pn=On,Ln=_n,Dn=Cn,kn=jn,$n=/^\[object .+?Constructor\]$/,In=Function.prototype,Rn=Object.prototype,Mn=In.toString,Fn=Rn.hasOwnProperty,Bn=RegExp("^"+Mn.call(Fn).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Wn=function(t){return!(!Dn(t)||Ln(t))&&(Pn(t)?Bn:$n).test(kn(t))},zn=function(t,e){return null==t?void 0:t[e]};var Un=function(t,e){var n=zn(t,e);return Wn(n)?n:void 0},qn=Un(f,"Map"),Hn=Un(Object,"create"),Gn=Hn;var Vn=function(){this.__data__=Gn?Gn(null):{},this.size=0};var Xn=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Yn=Hn,Zn=Object.prototype.hasOwnProperty;var Jn=function(t){var e=this.__data__;if(Yn){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Zn.call(e,t)?e[t]:void 0},Kn=Hn,Qn=Object.prototype.hasOwnProperty;var to=Hn;var eo=Vn,no=Xn,oo=Jn,io=function(t){var e=this.__data__;return Kn?void 0!==e[t]:Qn.call(e,t)},ro=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=to&&void 0===e?"__lodash_hash_undefined__":e,this};function so(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}so.prototype.clear=eo,so.prototype.delete=no,so.prototype.get=oo,so.prototype.has=io,so.prototype.set=ro;var ao=so,lo=mn,co=qn;var uo=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var ho=function(t,e){var n=t.__data__;return uo(e)?n["string"==typeof e?"string":"hash"]:n.map},po=ho;var fo=ho;var mo=ho;var go=ho;var vo=function(){this.size=0,this.__data__={hash:new ao,map:new(co||lo),string:new ao}},bo=function(t){var e=po(this,t).delete(t);return this.size-=e?1:0,e},yo=function(t){return fo(this,t).get(t)},wo=function(t){return mo(this,t).has(t)},Co=function(t,e){var n=go(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this};function xo(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}xo.prototype.clear=vo,xo.prototype.delete=bo,xo.prototype.get=yo,xo.prototype.has=wo,xo.prototype.set=Co;var Eo=xo,So=mn,Oo=qn,No=Eo;var Ao=mn,_o=vn,To=bn,jo=yn,Po=wn,Lo=function(t,e){var n=this.__data__;if(n instanceof So){var o=n.__data__;if(!Oo||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new No(o)}return n.set(t,e),this.size=n.size,this};function Do(t){var e=this.__data__=new Ao(t);this.size=e.size}Do.prototype.clear=_o,Do.prototype.delete=To,Do.prototype.get=jo,Do.prototype.has=Po,Do.prototype.set=Lo;var ko=Do,$o=Un,Io=function(){try{var t=$o(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),Ro=Io;var Mo=function(t,e,n){"__proto__"==e&&Ro?Ro(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},Fo=Mo,Bo=tn;var Wo=function(t,e,n){(void 0!==n&&!Bo(t[e],n)||void 0===n&&!(e in t))&&Fo(t,e,n)};var zo,Uo,qo,Ho,Go,Vo,Xo,Yo=function(t){return function(e,n,o){for(var i=-1,r=Object(e),s=o(e),a=s.length;a--;){var l=s[t?a:++i];if(!1===n(r[l],l,r))break}return e}}(),Zo={exports:{}};zo=Zo,qo=f,Ho=(Uo=Zo.exports)&&!Uo.nodeType&&Uo,Go=Ho&&zo&&!zo.nodeType&&zo,Vo=Go&&Go.exports===Ho?qo.Buffer:void 0,Xo=Vo?Vo.allocUnsafe:void 0,zo.exports=function(t,e){if(e)return t.slice();var n=t.length,o=Xo?Xo(n):new t.constructor(n);return t.copy(o),o};var Jo=Zo.exports,Ko=f.Uint8Array,Qo=Ko;var ti=function(t){var e=new t.constructor(t.byteLength);return new Qo(e).set(new Qo(t)),e};var ei=function(t,e){var n=e?ti(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)};var ni=function(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e},oi=Cn,ii=Object.create,ri=function(){function t(){}return function(e){if(!oi(e))return{};if(ii)return ii(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();var si=function(t,e){return function(n){return t(e(n))}},ai=si(Object.getPrototypeOf,Object),li=Object.prototype;var ci=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||li)},di=ri,ui=ai,hi=ci;var pi=function(t){return"function"!=typeof t.constructor||hi(t)?{}:di(ui(t))},fi=_,mi=T;var gi=function(t){return mi(t)&&"[object Arguments]"==fi(t)},vi=T,bi=Object.prototype,yi=bi.hasOwnProperty,wi=bi.propertyIsEnumerable,Ci=gi(function(){return arguments}())?gi:function(t){return vi(t)&&yi.call(t,"callee")&&!wi.call(t,"callee")};var xi=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},Ei=On,Si=xi;var Oi=function(t){return null!=t&&Si(t.length)&&!Ei(t)},Ni=Oi,Ai=T;var _i=function(t){return Ai(t)&&Ni(t)},Ti={exports:{}};var ji=function(){return!1};!function(t,e){var n=f,o=ji,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}(Ti,Ti.exports);var Pi=Ti.exports,Li=_,Di=ai,ki=T,$i=Function.prototype,Ii=Object.prototype,Ri=$i.toString,Mi=Ii.hasOwnProperty,Fi=Ri.call(Object);var Bi=function(t){if(!ki(t)||"[object Object]"!=Li(t))return!1;var e=Di(t);if(null===e)return!0;var n=Mi.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Ri.call(n)==Fi},Wi=_,zi=xi,Ui=T,qi={};qi["[object Float32Array]"]=qi["[object Float64Array]"]=qi["[object Int8Array]"]=qi["[object Int16Array]"]=qi["[object Int32Array]"]=qi["[object Uint8Array]"]=qi["[object Uint8ClampedArray]"]=qi["[object Uint16Array]"]=qi["[object Uint32Array]"]=!0,qi["[object Arguments]"]=qi["[object Array]"]=qi["[object ArrayBuffer]"]=qi["[object Boolean]"]=qi["[object DataView]"]=qi["[object Date]"]=qi["[object Error]"]=qi["[object Function]"]=qi["[object Map]"]=qi["[object Number]"]=qi["[object Object]"]=qi["[object RegExp]"]=qi["[object Set]"]=qi["[object String]"]=qi["[object WeakMap]"]=!1;var Hi=function(t){return Ui(t)&&zi(t.length)&&!!qi[Wi(t)]};var Gi=function(t){return function(e){return t(e)}},Vi={exports:{}};!function(t,e){var n=u,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}(Vi,Vi.exports);var Xi=Vi.exports,Yi=Hi,Zi=Gi,Ji=Xi&&Xi.isTypedArray,Ki=Ji?Zi(Ji):Yi;var Qi=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},tr=Mo,er=tn,nr=Object.prototype.hasOwnProperty;var or=function(t,e,n){var o=t[e];nr.call(t,e)&&er(o,n)&&(void 0!==n||e in t)||tr(t,e,n)},ir=or,rr=Mo;var sr=function(t,e,n,o){var i=!n;n||(n={});for(var r=-1,s=e.length;++r<s;){var a=e[r],l=o?o(n[a],t[a],a,n,t):void 0;void 0===l&&(l=t[a]),i?rr(n,a,l):ir(n,a,l)}return n};var ar=/^(?:0|[1-9]\d*)$/;var lr=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&ar.test(t))&&t>-1&&t%1==0&&t<e},cr=function(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o},dr=Ci,ur=v,hr=Pi,pr=lr,fr=Ki,mr=Object.prototype.hasOwnProperty;var gr=function(t,e){var n=ur(t),o=!n&&dr(t),i=!n&&!o&&hr(t),r=!n&&!o&&!i&&fr(t),s=n||o||i||r,a=s?cr(t.length,String):[],l=a.length;for(var c in t)!e&&!mr.call(t,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||pr(c,l))||a.push(c);return a};var vr=Cn,br=ci,yr=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e},wr=Object.prototype.hasOwnProperty;var Cr=gr,xr=function(t){if(!vr(t))return yr(t);var e=br(t),n=[];for(var o in t)("constructor"!=o||!e&&wr.call(t,o))&&n.push(o);return n},Er=Oi;var Sr=function(t){return Er(t)?Cr(t,!0):xr(t)},Or=sr,Nr=Sr;var Ar=Wo,_r=Jo,Tr=ei,jr=ni,Pr=pi,Lr=Ci,Dr=v,kr=_i,$r=Pi,Ir=On,Rr=Cn,Mr=Bi,Fr=Ki,Br=Qi,Wr=function(t){return Or(t,Nr(t))};var zr=ko,Ur=Wo,qr=Yo,Hr=function(t,e,n,o,i,r,s){var a=Br(t,n),l=Br(e,n),c=s.get(l);if(c)Ar(t,n,c);else{var d=r?r(a,l,n+"",t,e,s):void 0,u=void 0===d;if(u){var h=Dr(l),p=!h&&$r(l),f=!h&&!p&&Fr(l);d=l,h||p||f?Dr(a)?d=a:kr(a)?d=jr(a):p?(u=!1,d=_r(l,!0)):f?(u=!1,d=Tr(l,!0)):d=[]:Mr(l)||Lr(l)?(d=a,Lr(a)?d=Wr(a):Rr(a)&&!Ir(a)||(d=Pr(l))):u=!1}u&&(s.set(l,d),i(d,l,o,r,s),s.delete(l)),Ar(t,n,d)}},Gr=Cn,Vr=Sr,Xr=Qi;var Yr=function t(e,n,o,i,r){e!==n&&qr(n,(function(s,a){if(r||(r=new zr),Gr(s))Hr(e,n,a,o,t,i,r);else{var l=i?i(Xr(e,a),s,a+"",e,n,r):void 0;void 0===l&&(l=s),Ur(e,a,l)}}),Vr)};var Zr=function(t){return t};var Jr=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)},Kr=Math.max;var Qr=function(t,e,n){return e=Kr(void 0===e?t.length-1:e,0),function(){for(var o=arguments,i=-1,r=Kr(o.length-e,0),s=Array(r);++i<r;)s[i]=o[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=o[i];return a[e]=n(s),Jr(t,this,a)}};var ts=function(t){return function(){return t}},es=Io,ns=es?function(t,e){return es(t,"toString",{configurable:!0,enumerable:!1,value:ts(e),writable:!0})}:Zr,os=Date.now;var is=function(t){var e=0,n=0;return function(){var o=os(),i=16-(o-n);if(n=o,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(ns),rs=Zr,ss=Qr,as=is;var ls=tn,cs=Oi,ds=lr,us=Cn;var hs=function(t,e){return as(ss(t,e,rs),t+"")},ps=function(t,e,n){if(!us(n))return!1;var o=typeof e;return!!("number"==o?cs(n)&&ds(e,n.length):"string"==o&&e in n)&&ls(n[e],t)};var fs=Yr;const ms=l(function(t){return hs((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&&ps(n[0],n[1],s)&&(r=i<3?void 0:r,i=1),e=Object(e);++o<i;){var a=n[o];a&&t(e,a,o,r)}return e}))}((function(t,e,n,o){fs(t,e,n,o)}))),gs=()=>crypto.randomUUID(),vs=(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},bs=t=>{var e;const n=null==(e=t.className)?void 0:e.match(Le);return n&&je[n[0]]},ys=t=>Array.from(new Set(t)),ws=t=>{let e;if(t){const{attrs:n={}}=t;e=n.id||t.id||gs(),t.id=e}else e=gs();return e},Cs=(t,e)=>ms({},t,e,((t,e)=>Array.isArray(t)?null!=e?ys(t.concat(e)):e:Array.isArray(e)?null!=t?ys(e.concat(t)):e:void 0)),xs=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;n<o;n++)e[n]=xs(t[n]);return e}if(t instanceof Object){e={};for(const n in t)Object.hasOwn(t,n)&&(e[n]=xs(t[n]));return e}throw new Error("Unable to copy Object, type not supported.")},Es=(t,e)=>t/e*100,Ss=t=>`${t.toString()}%`,Os=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){}}}}),Ns=t=>Ne.some((e=>new RegExp(`^${e}.`).test(t))),As=t=>t.startsWith("external");function _s(t,e=Ue){let n=0;return function(...o){const i=Date.now();i-n>=e&&(n=i,t.apply(this,o))}}function Ts(t){return t}function js(){}var Ps=v,Ls=L,Ds=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ks=/^\w*$/;var $s=function(t,e){if(Ps(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Ls(t))||(ks.test(t)||!Ds.test(t)||null!=e&&t in Object(e))},Is=Eo;function Rs(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(Rs.Cache||Is),n}Rs.Cache=Is;var Ms=Rs;var Fs=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Bs=/\\(\\)?/g,Ws=function(t){var e=Ms(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(Fs,(function(t,n,o,i){e.push(o?i.replace(Bs,"$1"):n||t)})),e})),zs=v,Us=$s,qs=Ws,Hs=B;var Gs=function(t,e){return zs(t)?t:Us(t,e)?[t]:qs(Hs(t))},Vs=L;var Xs=function(t){if("string"==typeof t||Vs(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e},Ys=or,Zs=Gs,Js=lr,Ks=Cn,Qs=Xs;var ta=function(t,e,n,o){if(!Ks(t))return t;for(var i=-1,r=(e=Zs(e,t)).length,s=r-1,a=t;null!=a&&++i<r;){var l=Qs(e[i]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(i!=s){var d=a[l];void 0===(c=o?o(d,l,a):void 0)&&(c=Ks(d)?d:Js(e[i+1])?[]:{})}Ys(a,l,c),a=a[l]}return t};const ea=l((function(t,e,n){return null==t?t:ta(t,e,n)}));var na=Gs,oa=Xs;var ia=function(t,e){for(var n=0,o=(e=na(e,t)).length;null!=t&&n<o;)t=t[oa(e[n++])];return n&&n==o?t:void 0};const ra=l((function(t,e,n){var o=null==t?void 0:ia(t,e);return void 0===o?n:o})),sa=ea,aa=t=>{const e={...t},n={string:()=>"",boolean:()=>!1,object:t=>aa(t)};for(const o of Object.keys(t)){const i=typeof t[o];n[i]&&(e[o]=n[i](t[o]))}return e},la=t=>Number.isInteger(Number(t)),ca=(t,e)=>{const n=e||t.parentElement;return Array.prototype.slice.call(n.childNodes).indexOf(t)},da=(t,e,n)=>{const o=n.split("||"),i=ys(e).map((e=>t.find((t=>{const n=o.find((e=>!!ra(t,e)));return n&&ra(t,n)===e})))).filter(Boolean).concat(t);return ys(i)},ua=(t,e,n)=>{for(let o=0;o<t.length;o++)e.call(n,t[o],o)},ha=(t,e)=>{const n=[];return ua(t,((t,o)=>n.push(e(t,o)))),n},pa={},fa=t=>t.replace(/\b\w/g,(t=>t.toUpperCase())),ma=()=>-1!==window.navigator.userAgent.indexOf("MSIE "),ga={capitalize:fa,safeAttrName:t=>{if(pa[t])return pa[t];const e=({className:"class"}[t]||t).replace(/^\d+/,"").replace(/[^a-zA-Z0-9-:]/g,"");return pa[t]=e,e},forEach:ua,copyObj:t=>window.JSON.parse(window.JSON.stringify(t)),map:ha,subtract:(t,e)=>e.filter((e=>!~t.indexOf(e))),indexOfNode:ca,isInt:la,get:ra,orderObjectsBy:da,isIE:ma},va={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=va.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<i?(t.style.height=s+"px",window.requestAnimationFrame(e)):(t.style.height="auto",n&&n(t))}()},slideUp:(t,e=250,n=!1)=>{const o=va.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"===va.getStyle(t,"display"))=>{n?va.slideDown(t,e):va.slideUp(t,e)}},ba="no-transition",ya={debug:!1,bubbles:!0,formeoLoaded:t=>{},onAdd:()=>{},onUpdate:t=>{var e;return(null==(e=Ca.opts)?void 0:e.debug)&&void 0},onUpdateStage:t=>{var e;return(null==(e=Ca.opts)?void 0:e.debug)&&void 0},onUpdateRow:t=>{var e;return(null==(e=Ca.opts)?void 0:e.debug)&&void 0},onUpdateColumn:t=>{var e;return(null==(e=Ca.opts)?void 0:e.debug)&&void 0},onUpdateField:t=>{var e;return(null==(e=Ca.opts)?void 0:e.debug)&&void 0},onRender:t=>{var e;return(null==(e=Ca.opts)?void 0:e.debug)&&void 0},onSave:t=>{},confirmClearAll:t=>{window.confirm(t.confirmationMessage)&&t.clearAllAction(t)}},wa=({src:t,...e},n=He)=>{var o,i;const r=new window.CustomEvent(n,{detail:e,bubbles:(null==(o=Ca.opts)?void 0:o.debug)||(null==(i=Ca.opts)?void 0:i.bubbles)});return r.data=(t||document).dispatchEvent(r),r},Ca={init:function(t){return this.opts={...ya,...t},this},formeoSaved:t=>wa(t,qe),formeoUpdated:t=>wa(t,He),formeoCleared:t=>wa(t,"formeoCleared"),formeoOnRender:t=>wa(t,Ge),formeoConditionUpdated:t=>wa(t,"formeoConditionUpdated")},xa=_s((()=>{Ca.opts.onUpdate({timeStamp:window.performance.now(),type:He,detail:ah.formData})}),ze);let Ea;document.addEventListener(He,xa),document.addEventListener("formeoUpdatedStage",(t=>{const{timeStamp:e,type:n,detail:o}=t;Ca.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedRow",(t=>{const{timeStamp:e,type:n,detail:o}=t;Ca.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedColumn",(t=>{const{timeStamp:e,type:n,detail:o}=t;Ca.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedField",(t=>{const{timeStamp:e,type:n,detail:o}=t;Ca.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener(Ge,(t=>{const{timeStamp:e,type:n,detail:o}=t;Ca.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},Ca.opts.confirmClearAll(t)})),document.addEventListener(qe,(({timeStamp:t,type:e,detail:{formData:n}})=>{const o={timeStamp:t,type:e,formData:n};Ca.opts.onSave(o)})),document.addEventListener("formeoLoaded",(t=>{Ca.opts.formeoLoaded(t.detail.formeo)})),window.addEventListener("resize",(function(){Ea=Ea||window.requestAnimationFrame((()=>{Ea=!1;for(const t of Object.values(nh.data))t.dom.classList.add(ba),ih.dom.classList.add(ba),ih.panels.nav.refresh(),t.refreshFieldPanels()}))}));var Sa=Eo,Oa=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Na=function(t){return this.__data__.has(t)};function Aa(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Sa;++e<n;)this.add(t[e])}Aa.prototype.add=Aa.prototype.push=Oa,Aa.prototype.has=Na;var _a=Aa,Ta=function(t,e){for(var n=-1,o=null==t?0:t.length;++n<o;)if(e(t[n],n,t))return!0;return!1},ja=function(t,e){return t.has(e)};var Pa=function(t,e,n,o,i,r){var s=1&n,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var c=r.get(t),d=r.get(e);if(c&&d)return c==e&&d==t;var u=-1,h=!0,p=2&n?new _a:void 0;for(r.set(t,e),r.set(e,t);++u<a;){var f=t[u],m=e[u];if(o)var g=s?o(m,f,u,e,t,r):o(f,m,u,t,e,r);if(void 0!==g){if(g)continue;h=!1;break}if(p){if(!Ta(e,(function(t,e){if(!ja(p,e)&&(f===t||i(f,t,n,o,r)))return p.push(e)}))){h=!1;break}}else if(f!==m&&!i(f,m,n,o,r)){h=!1;break}}return r.delete(t),r.delete(e),h};var La=Ko,Da=tn,ka=Pa,$a=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,o){n[++e]=[o,t]})),n},Ia=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n},Ra=m?m.prototype:void 0,Ma=Ra?Ra.valueOf:void 0;var Fa=function(t,e,n,o,i,r,s){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!r(new La(t),new La(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Da(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=$a;case"[object Set]":var l=1&o;if(a||(a=Ia),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;o|=2,s.set(t,e);var d=ka(a(t),a(e),o,i,r,s);return s.delete(t),d;case"[object Symbol]":if(Ma)return Ma.call(t)==Ma.call(e)}return!1};var Ba=function(t,e){for(var n=-1,o=e.length,i=t.length;++n<o;)t[i+n]=e[n];return t},Wa=v;var za=function(t,e,n){var o=e(t);return Wa(t)?o:Ba(o,n(t))};var Ua=function(t,e){for(var n=-1,o=null==t?0:t.length,i=0,r=[];++n<o;){var s=t[n];e(s,n,t)&&(r[i++]=s)}return r},qa=function(){return[]},Ha=Object.prototype.propertyIsEnumerable,Ga=Object.getOwnPropertySymbols,Va=Ga?function(t){return null==t?[]:(t=Object(t),Ua(Ga(t),(function(e){return Ha.call(t,e)})))}:qa,Xa=si(Object.keys,Object),Ya=ci,Za=Xa,Ja=Object.prototype.hasOwnProperty;var Ka=gr,Qa=function(t){if(!Ya(t))return Za(t);var e=[];for(var n in Object(t))Ja.call(t,n)&&"constructor"!=n&&e.push(n);return e},tl=Oi;var el=za,nl=Va,ol=function(t){return tl(t)?Ka(t):Qa(t)};var il=function(t){return el(t,ol,nl)},rl=Object.prototype.hasOwnProperty;var sl=function(t,e,n,o,i,r){var s=1&n,a=il(t),l=a.length;if(l!=il(e).length&&!s)return!1;for(var c=l;c--;){var d=a[c];if(!(s?d in e:rl.call(e,d)))return!1}var u=r.get(t),h=r.get(e);if(u&&h)return u==e&&h==t;var p=!0;r.set(t,e),r.set(e,t);for(var f=s;++c<l;){var m=t[d=a[c]],g=e[d];if(o)var v=s?o(g,m,d,e,t,r):o(m,g,d,t,e,r);if(!(void 0===v?m===g||i(m,g,n,o,r):v)){p=!1;break}f||(f="constructor"==d)}if(p&&!f){var b=t.constructor,y=e.constructor;b==y||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof y&&y instanceof y||(p=!1)}return r.delete(t),r.delete(e),p},al=Un(f,"DataView"),ll=qn,cl=Un(f,"Promise"),dl=Un(f,"Set"),ul=Un(f,"WeakMap"),hl=_,pl=jn,fl="[object Map]",ml="[object Promise]",gl="[object Set]",vl="[object WeakMap]",bl="[object DataView]",yl=pl(al),wl=pl(ll),Cl=pl(cl),xl=pl(dl),El=pl(ul),Sl=hl;(al&&Sl(new al(new ArrayBuffer(1)))!=bl||ll&&Sl(new ll)!=fl||cl&&Sl(cl.resolve())!=ml||dl&&Sl(new dl)!=gl||ul&&Sl(new ul)!=vl)&&(Sl=function(t){var e=hl(t),n="[object Object]"==e?t.constructor:void 0,o=n?pl(n):"";if(o)switch(o){case yl:return bl;case wl:return fl;case Cl:return ml;case xl:return gl;case El:return vl}return e});var Ol=ko,Nl=Pa,Al=Fa,_l=sl,Tl=Sl,jl=v,Pl=Pi,Ll=Ki,Dl="[object Arguments]",kl="[object Array]",$l="[object Object]",Il=Object.prototype.hasOwnProperty;var Rl=function(t,e,n,o,i,r){var s=jl(t),a=jl(e),l=s?kl:Tl(t),c=a?kl:Tl(e),d=(l=l==Dl?$l:l)==$l,u=(c=c==Dl?$l:c)==$l,h=l==c;if(h&&Pl(t)){if(!Pl(e))return!1;s=!0,d=!1}if(h&&!d)return r||(r=new Ol),s||Ll(t)?Nl(t,e,n,o,i,r):Al(t,e,l,n,o,i,r);if(!(1&n)){var p=d&&Il.call(t,"__wrapped__"),f=u&&Il.call(e,"__wrapped__");if(p||f){var m=p?t.value():t,g=f?e.value():e;return r||(r=new Ol),i(m,g,n,o,r)}}return!!h&&(r||(r=new Ol),_l(t,e,n,o,i,r))},Ml=T;var Fl=function t(e,n,o,i,r){return e===n||(null==e||null==n||!Ml(e)&&!Ml(n)?e!=e&&n!=n:Rl(e,n,o,i,t,r))},Bl=Fl;const Wl=l((function(t,e){return Bl(t,e)}));class zl{constructor(t,n=Object.create(null)){e(this,"toJSON",((t,e)=>JSON.stringify(t,null,e))),e(this,"get",(t=>ra(this.data,t))),e(this,"getChangeType",((t,e)=>{const n=Me.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||ws();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=ra(this.data,t);if(Wl(n,e))return this.data;const o=sa(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),Ca.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 Ul(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 ql(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ul(Object(n),!0).forEach((function(e){Gl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ul(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Hl(t){return(Hl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Vl(){return Vl=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Vl.apply(this,arguments)}function Xl(t,e){if(null==t)return{};var n,o,i=function(t,e){if(null==t)return{};var n,o,i={},r=Object.keys(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Yl(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var Zl=Yl(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Jl=Yl(/Edge/i),Kl=Yl(/firefox/i),Ql=Yl(/safari/i)&&!Yl(/chrome/i)&&!Yl(/android/i),tc=Yl(/iP(ad|od|hone)/i),ec=Yl(/chrome/i)&&Yl(/android/i),nc={capture:!1,passive:!1};function oc(t,e,n){t.addEventListener(e,n,!Zl&&nc)}function ic(t,e,n){t.removeEventListener(e,n,!Zl&&nc)}function rc(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 sc(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function ac(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&rc(t,e):rc(t,e))||o&&t===n)return t;if(t===n)break}while(t=sc(t))}return null}var lc,cc=/\s+/g;function dc(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(cc," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(cc," ")}}function uc(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 hc(t,e){var n="";if("string"==typeof t)n=t;else do{var o=uc(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 pc(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function fc(){var t=document.scrollingElement;return t||document.documentElement}function mc(t,e,n,o,i){if(t.getBoundingClientRect||t===window){var r,s,a,l,c,d,u;if(t!==window&&t.parentNode&&t!==fc()?(s=(r=t.getBoundingClientRect()).top,a=r.left,l=r.bottom,c=r.right,d=r.height,u=r.width):(s=0,a=0,l=window.innerHeight,c=window.innerWidth,d=window.innerHeight,u=window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!Zl))do{if(i&&i.getBoundingClientRect&&("none"!==uc(i,"transform")||n&&"static"!==uc(i,"position"))){var h=i.getBoundingClientRect();s-=h.top+parseInt(uc(i,"border-top-width")),a-=h.left+parseInt(uc(i,"border-left-width")),l=s+r.height,c=a+r.width;break}}while(i=i.parentNode);if(o&&t!==window){var p=hc(i||t),f=p&&p.a,m=p&&p.d;p&&(l=(s/=m)+(d/=m),c=(a/=f)+(u/=f))}return{top:s,left:a,bottom:l,right:c,width:u,height:d}}}function gc(t,e,n){for(var o=Cc(t,!0),i=mc(t)[e];o;){if(!(i>=mc(o)[n]))return o;if(o===fc())break;o=Cc(o,!1)}return!1}function vc(t,e,n,o){for(var i=0,r=0,s=t.children;r<s.length;){if("none"!==s[r].style.display&&s[r]!==Od.ghost&&(o||s[r]!==Od.dragged)&&ac(s[r],n.draggable,t,!1)){if(i===e)return s[r];i++}r++}return null}function bc(t,e){for(var n=t.lastElementChild;n&&(n===Od.ghost||"none"===uc(n,"display")||e&&!rc(n,e));)n=n.previousElementSibling;return n||null}function yc(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===Od.clone||e&&!rc(t,e)||n++;return n}function wc(t){var e=0,n=0,o=fc();if(t)do{var i=hc(t),r=i.a,s=i.d;e+=t.scrollLeft*r,n+=t.scrollTop*s}while(t!==o&&(t=t.parentNode));return[e,n]}function Cc(t,e){if(!t||!t.getBoundingClientRect)return fc();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=uc(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return fc();if(o||e)return n;o=!0}}}while(n=n.parentNode);return fc()}function xc(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function Ec(t,e){return function(){if(!lc){var n=arguments;1===n.length?t.call(this,n[0]):t.apply(this,n),lc=setTimeout((function(){lc=void 0}),e)}}}function Sc(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function Oc(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function Nc(t,e,n){var o={};return Array.from(t.children).forEach((function(i){var r,s,a,l;if(ac(i,e.draggable,t,!1)&&!i.animated&&i!==n){var c=mc(i);o.left=Math.min(null!==(r=o.left)&&void 0!==r?r:1/0,c.left),o.top=Math.min(null!==(s=o.top)&&void 0!==s?s:1/0,c.top),o.right=Math.max(null!==(a=o.right)&&void 0!==a?a:-1/0,c.right),o.bottom=Math.max(null!==(l=o.bottom)&&void 0!==l?l:-1/0,c.bottom)}})),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var Ac="Sortable"+(new Date).getTime();function _c(){var t,e=[];return{captureAnimationState:function(){(e=[],this.options.animation)&&[].slice.call(this.el.children).forEach((function(t){if("none"!==uc(t,"display")&&t!==Od.ghost){e.push({target:t,rect:mc(t)});var n=ql({},e[e.length-1].rect);if(t.thisAnimationDuration){var o=hc(t,!0);o&&(n.top-=o.f,n.left-=o.e)}t.fromRect=n}}))},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n);return-1}(e,{target:t}),1)},animateAll:function(n){var o=this;if(!this.options.animation)return clearTimeout(t),void("function"==typeof n&&n());var i=!1,r=0;e.forEach((function(t){var e=0,n=t.target,s=n.fromRect,a=mc(n),l=n.prevFromRect,c=n.prevToRect,d=t.rect,u=hc(n,!0);u&&(a.top-=u.f,a.left-=u.e),n.toRect=a,n.thisAnimationDuration&&xc(l,a)&&!xc(s,a)&&(d.top-a.top)/(d.left-a.left)==(s.top-a.top)/(s.left-a.left)&&(e=function(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}(d,l,c,o.options)),xc(a,s)||(n.prevFromRect=s,n.prevToRect=a,e||(e=o.options.animation),o.animate(n,d,a,e)),e&&(i=!0,r=Math.max(r,e),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout((function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null}),e),n.thisAnimationDuration=e)})),clearTimeout(t),i?t=setTimeout((function(){"function"==typeof n&&n()}),r):"function"==typeof n&&n(),e=[]},animate:function(t,e,n,o){if(o){uc(t,"transition",""),uc(t,"transform","");var i=hc(this.el),r=i&&i.a,s=i&&i.d,a=(e.left-n.left)/(r||1),l=(e.top-n.top)/(s||1);t.animatingX=!!a,t.animatingY=!!l,uc(t,"transform","translate3d("+a+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),uc(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),uc(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){uc(t,"transition",""),uc(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),o)}}}}var Tc=[],jc={initializeByDefault:!0},Pc={mount:function(t){for(var e in jc)jc.hasOwnProperty(e)&&!(e in t)&&(t[e]=jc[e]);Tc.forEach((function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")})),Tc.push(t)},pluginEvent:function(t,e,n){var o=this;this.eventCanceled=!1,n.cancel=function(){o.eventCanceled=!0};var i=t+"Global";Tc.forEach((function(o){e[o.pluginName]&&(e[o.pluginName][i]&&e[o.pluginName][i](ql({sortable:e},n)),e.options[o.pluginName]&&e[o.pluginName][t]&&e[o.pluginName][t](ql({sortable:e},n)))}))},initializePlugins:function(t,e,n,o){for(var i in Tc.forEach((function(o){var i=o.pluginName;if(t.options[i]||o.initializeByDefault){var r=new o(t,e,t.options);r.sortable=t,r.options=t.options,t[i]=r,Vl(n,r.defaults)}})),t.options)if(t.options.hasOwnProperty(i)){var r=this.modifyOption(t,i,t.options[i]);void 0!==r&&(t.options[i]=r)}},getEventProperties:function(t,e){var n={};return Tc.forEach((function(o){"function"==typeof o.eventProperties&&Vl(n,o.eventProperties.call(e[o.pluginName],t))})),n},modifyOption:function(t,e,n){var o;return Tc.forEach((function(i){t[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[e]&&(o=i.optionListeners[e].call(t[i.pluginName],n))})),o}};var Lc=["evt"],Dc=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,i=Xl(n,Lc);Pc.pluginEvent.bind(Od)(t,e,ql({dragEl:$c,parentEl:Ic,ghostEl:Rc,rootEl:Mc,nextEl:Fc,lastDownEl:Bc,cloneEl:Wc,cloneHidden:zc,dragStarted:ed,putSortable:Xc,activeSortable:Od.active,originalEvent:o,oldIndex:Uc,oldDraggableIndex:Hc,newIndex:qc,newDraggableIndex:Gc,hideGhostForTarget:Cd,unhideGhostForTarget:xd,cloneNowHidden:function(){zc=!0},cloneNowShown:function(){zc=!1},dispatchSortableEvent:function(t){kc({sortable:e,name:t,originalEvent:o})}},i))};function kc(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,u=t.newDraggableIndex,h=t.originalEvent,p=t.putSortable,f=t.extraEventProperties;if(e=e||n&&n[Ac]){var m,g=e.options,v="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||Zl||Jl?(m=document.createEvent("Event")).initEvent(o,!0,!0):m=new CustomEvent(o,{bubbles:!0,cancelable:!0}),m.to=s||n,m.from=a||n,m.item=i||n,m.clone=r,m.oldIndex=l,m.newIndex=c,m.oldDraggableIndex=d,m.newDraggableIndex=u,m.originalEvent=h,m.pullMode=p?p.lastPutMode:void 0;var b=ql(ql({},f),Pc.getEventProperties(o,e));for(var y in b)m[y]=b[y];n&&n.dispatchEvent(m),g[v]&&g[v].call(e,m)}}(ql({putSortable:Xc,cloneEl:Wc,targetEl:$c,rootEl:Mc,oldIndex:Uc,oldDraggableIndex:Hc,newIndex:qc,newDraggableIndex:Gc},t))}var $c,Ic,Rc,Mc,Fc,Bc,Wc,zc,Uc,qc,Hc,Gc,Vc,Xc,Yc,Zc,Jc,Kc,Qc,td,ed,nd,od,id,rd,sd=!1,ad=!1,ld=[],cd=!1,dd=!1,ud=[],hd=!1,pd=[],fd="undefined"!=typeof document,md=tc,gd=Jl||Zl?"cssFloat":"float",vd=fd&&!ec&&!tc&&"draggable"in document.createElement("div"),bd=function(){if(fd){if(Zl)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),yd=function(t,e){var n=uc(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=vc(t,0,e),r=vc(t,1,e),s=i&&uc(i),a=r&&uc(r),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+mc(i).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+mc(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[gd]||r&&"none"===n[gd]&&l+c>o)?"vertical":"horizontal"},wd=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},Cd=function(){!bd&&Rc&&uc(Rc,"display","none")},xd=function(){!bd&&Rc&&uc(Rc,"display","")};fd&&!ec&&document.addEventListener("click",(function(t){if(ad)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),ad=!1,!1}),!0);var Ed=function(t){if($c){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,ld.some((function(t){var e=t[Ac].options.emptyInsertThreshold;if(e&&!bc(t)){var n=mc(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[Ac]._onDragOver(n)}}var i,r,s},Sd=function(t){$c&&$c.parentNode[Ac]._isOutsideThisEl(t.target)};function Od(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=Vl({},e),t[Ac]=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 yd(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!==Od.supportPointer&&"PointerEvent"in window&&!Ql,emptyInsertThreshold:5};for(var o in Pc.initializePlugins(this,t,n),n)!(o in e)&&(e[o]=n[o]);for(var i in wd(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&vd,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?oc(t,"pointerdown",this._onTapStart):(oc(t,"mousedown",this._onTapStart),oc(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(oc(t,"dragover",this),oc(t,"dragenter",this)),ld.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Vl(this,_c())}function Nd(t,e,n,o,i,r,s,a){var l,c,d=t[Ac],u=d.options.onMove;return!window.CustomEvent||Zl||Jl?(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||mc(e),l.willInsertAfter=a,l.originalEvent=s,t.dispatchEvent(l),u&&(c=u.call(d,l,s)),c}function Ad(t){t.draggable=!1}function _d(){hd=!1}function Td(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 jd(t){return setTimeout(t,0)}function Pd(t){return clearTimeout(t)}Od.prototype={constructor:Od,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(nd=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){pd.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&pd.push(o)}}(n),!$c&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!Ql||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=ac(a,o.draggable,n,!1))&&a.animated||Bc===a)){if(Uc=yc(a),Hc=yc(a,o.draggable),"function"==typeof c){if(c.call(this,t,a,this))return kc({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),Dc("filter",e,{evt:t}),void(i&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=ac(l,o.trim(),n,!1))return kc({sortable:e,rootEl:o,name:"filter",targetEl:a,fromEl:n,toEl:n}),Dc("filter",e,{evt:t}),!0}))))return void(i&&t.cancelable&&t.preventDefault());o.handle&&!ac(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=mc(n);if(Mc=r,Ic=($c=n).parentNode,Fc=$c.nextSibling,Bc=n,Vc=s.group,Od.dragged=$c,Yc={target:$c,clientX:(e||t).clientX,clientY:(e||t).clientY},Qc=Yc.clientX-l.left,td=Yc.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,$c.style["will-change"]="all",o=function(){Dc("delayEnded",i,{evt:t}),Od.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!Kl&&i.nativeDraggable&&($c.draggable=!0),i._triggerDragStart(t,e),kc({sortable:i,name:"choose",originalEvent:t}),dc($c,s.chosenClass,!0))},s.ignore.split(",").forEach((function(t){pc($c,t.trim(),Ad)})),oc(a,"dragover",Ed),oc(a,"mousemove",Ed),oc(a,"touchmove",Ed),oc(a,"mouseup",i._onDrop),oc(a,"touchend",i._onDrop),oc(a,"touchcancel",i._onDrop),Kl&&this.nativeDraggable&&(this.options.touchStartThreshold=4,$c.draggable=!0),Dc("delayStart",this,{evt:t}),!s.delay||s.delayOnTouchOnly&&!e||this.nativeDraggable&&(Jl||Zl))o();else{if(Od.eventCanceled)return void this._onDrop();oc(a,"mouseup",i._disableDelayedDrag),oc(a,"touchend",i._disableDelayedDrag),oc(a,"touchcancel",i._disableDelayedDrag),oc(a,"mousemove",i._delayedDragTouchMoveHandler),oc(a,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&oc(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&&Ad($c),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;ic(t,"mouseup",this._disableDelayedDrag),ic(t,"touchend",this._disableDelayedDrag),ic(t,"touchcancel",this._disableDelayedDrag),ic(t,"mousemove",this._delayedDragTouchMoveHandler),ic(t,"touchmove",this._delayedDragTouchMoveHandler),ic(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?oc(document,"pointermove",this._onTouchMove):oc(document,e?"touchmove":"mousemove",this._onTouchMove):(oc($c,"dragend",this),oc(Mc,"dragstart",this._onDragStart));try{document.selection?jd((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(t,e){if(sd=!1,Mc&&$c){Dc("dragStarted",this,{evt:e}),this.nativeDraggable&&oc(document,"dragover",Sd);var n=this.options;!t&&dc($c,n.dragClass,!1),dc($c,n.ghostClass,!0),Od.active=this,t&&this._appendGhost(),kc({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Zc){this._lastX=Zc.clientX,this._lastY=Zc.clientY,Cd();for(var t=document.elementFromPoint(Zc.clientX,Zc.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Zc.clientX,Zc.clientY))!==e;)e=t;if($c.parentNode[Ac]._isOutsideThisEl(t),e)do{if(e[Ac]){if(e[Ac]._onDragOver({clientX:Zc.clientX,clientY:Zc.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=sc(e));xd()}},_onTouchMove:function(t){if(Yc){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=Rc&&hc(Rc,!0),s=Rc&&r&&r.a,a=Rc&&r&&r.d,l=md&&rd&&wc(rd),c=(i.clientX-Yc.clientX+o.x)/(s||1)+(l?l[0]-ud[0]:0)/(s||1),d=(i.clientY-Yc.clientY+o.y)/(a||1)+(l?l[1]-ud[1]:0)/(a||1);if(!Od.active&&!sd){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(Rc){r?(r.e+=c-(Jc||0),r.f+=d-(Kc||0)):r={a:1,b:0,c:0,d:1,e:c,f:d};var u="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");uc(Rc,"webkitTransform",u),uc(Rc,"mozTransform",u),uc(Rc,"msTransform",u),uc(Rc,"transform",u),Jc=c,Kc=d,Zc=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Rc){var t=this.options.fallbackOnBody?document.body:Mc,e=mc($c,!0,md,!0,t),n=this.options;if(md){for(rd=t;"static"===uc(rd,"position")&&"none"===uc(rd,"transform")&&rd!==document;)rd=rd.parentNode;rd!==document.body&&rd!==document.documentElement?(rd===document&&(rd=fc()),e.top+=rd.scrollTop,e.left+=rd.scrollLeft):rd=fc(),ud=wc(rd)}dc(Rc=$c.cloneNode(!0),n.ghostClass,!1),dc(Rc,n.fallbackClass,!0),dc(Rc,n.dragClass,!0),uc(Rc,"transition",""),uc(Rc,"transform",""),uc(Rc,"box-sizing","border-box"),uc(Rc,"margin",0),uc(Rc,"top",e.top),uc(Rc,"left",e.left),uc(Rc,"width",e.width),uc(Rc,"height",e.height),uc(Rc,"opacity","0.8"),uc(Rc,"position",md?"absolute":"fixed"),uc(Rc,"zIndex","100000"),uc(Rc,"pointerEvents","none"),Od.ghost=Rc,t.appendChild(Rc),uc(Rc,"transform-origin",Qc/parseInt(Rc.style.width)*100+"% "+td/parseInt(Rc.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,o=t.dataTransfer,i=n.options;Dc("dragStart",this,{evt:t}),Od.eventCanceled?this._onDrop():(Dc("setupClone",this),Od.eventCanceled||((Wc=Oc($c)).removeAttribute("id"),Wc.draggable=!1,Wc.style["will-change"]="",this._hideClone(),dc(Wc,this.options.chosenClass,!1),Od.clone=Wc),n.cloneId=jd((function(){Dc("clone",n),Od.eventCanceled||(n.options.removeCloneOnHide||Mc.insertBefore(Wc,$c),n._hideClone(),kc({sortable:n,name:"clone"}))})),!e&&dc($c,i.dragClass,!0),e?(ad=!0,n._loopId=setInterval(n._emulateDragOver,50)):(ic(document,"mouseup",n._onDrop),ic(document,"touchend",n._onDrop),ic(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(n,o,$c)),oc(document,"drop",n),uc($c,"transform","translateZ(0)")),sd=!0,n._dragStartId=jd(n._dragStarted.bind(n,e,t)),oc(document,"selectstart",n),ed=!0,Ql&&uc(document.body,"user-select","none"))},_onDragOver:function(t){var e,n,o,i,r=this.el,s=t.target,a=this.options,l=a.group,c=Od.active,d=Vc===l,u=a.sort,h=Xc||c,p=this,f=!1;if(!hd){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),s=ac(s,a.draggable,r,!0),T("dragOver"),Od.eventCanceled)return f;if($c.contains(t.target)||s.animated&&s.animatingX&&s.animatingY||p._ignoreWhileAnimating===s)return P(!1);if(ad=!1,c&&!a.disabled&&(d?u||(o=Ic!==Mc):Xc===this||(this.lastPutMode=Vc.checkPull(this,c,$c,t))&&l.checkPut(this,c,$c,t))){if(i="vertical"===this._getDirection(t,s),e=mc($c),T("dragOverValid"),Od.eventCanceled)return f;if(o)return Ic=Mc,j(),this._hideClone(),T("revert"),Od.eventCanceled||(Fc?Mc.insertBefore($c,Fc):Mc.appendChild($c)),P(!0);var m=bc(r,a.draggable);if(!m||function(t,e,n){var o=mc(bc(n.el,n.options.draggable)),i=Nc(n.el,n.options,Rc),r=10;return e?t.clientX>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)&&!m.animated){if(m===$c)return P(!1);if(m&&r===t.target&&(s=m),s&&(n=mc(s)),!1!==Nd(Mc,r,$c,e,s,n,t,!!s))return j(),m&&m.nextSibling?r.insertBefore($c,m.nextSibling):r.appendChild($c),Ic=r,L(),P(!0)}else if(m&&function(t,e,n){var o=mc(vc(n.el,0,n.options,!0)),i=Nc(n.el,n.options,Rc),r=10;return e?t.clientX<i.left-r||t.clientY<o.top&&t.clientX<o.right:t.clientY<i.top-r||t.clientY<o.bottom&&t.clientX<o.left}(t,i,this)){var g=vc(r,0,a,!0);if(g===$c)return P(!1);if(n=mc(s=g),!1!==Nd(Mc,r,$c,e,s,n,t,!1))return j(),r.insertBefore($c,g),Ic=r,L(),P(!0)}else if(s.parentNode===r){n=mc(s);var v,b,y,w=$c.parentNode!==r,C=!function(t,e,n){var o=n?t.left:t.top,i=n?t.right:t.bottom,r=n?t.width:t.height,s=n?e.left:e.top,a=n?e.right:e.bottom,l=n?e.width:e.height;return o===s||i===a||o+r/2===s+l/2}($c.animated&&$c.toRect||e,s.animated&&s.toRect||n,i),x=i?"top":"left",E=gc(s,"top","top")||gc($c,"top","top"),S=E?E.scrollTop:void 0;if(nd!==s&&(b=n[x],cd=!1,dd=!C&&a.invertSwap||w),v=function(t,e,n,o,i,r,s,a){var l=o?t.clientY:t.clientX,c=o?n.height:n.width,d=o?n.top:n.left,u=o?n.bottom:n.right,h=!1;if(!s)if(a&&id<c*i){if(!cd&&(1===od?l>d+c*r/2:l<u-c*r/2)&&(cd=!0),cd)h=!0;else if(1===od?l<d+id:l>u-id)return-od}else if(l>d+c*(1-i)/2&&l<u-c*(1-i)/2)return function(t){return yc($c)<yc(t)?1:-1}(e);if((h=h||s)&&(l<d+c*r/2||l>u-c*r/2))return l>d+c/2?1:-1;return 0}(t,s,n,i,C?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,dd,nd===s),0!==v){var O=yc($c);do{O-=v,y=Ic.children[O]}while(y&&("none"===uc(y,"display")||y===Rc))}if(0===v||y===s)return P(!1);nd=s,od=v;var N=s.nextElementSibling,A=!1,_=Nd(Mc,r,$c,e,s,n,t,A=1===v);if(!1!==_)return 1!==_&&-1!==_||(A=1===_),hd=!0,setTimeout(_d,30),j(),A&&!N?r.appendChild($c):s.parentNode.insertBefore($c,A?N:s),E&&Sc(E,0,S-E.scrollTop),Ic=$c.parentNode,void 0===b||dd||(id=Math.abs(b-mc(s)[x])),L(),P(!0)}if(r.contains($c))return P(!1)}return!1}function T(a,l){Dc(a,p,ql({evt:t,isOwner:d,axis:i?"vertical":"horizontal",revert:o,dragRect:e,targetRect:n,canSort:u,fromSortable:h,target:s,completed:P,onMove:function(n,o){return Nd(Mc,r,$c,e,n,mc(n),t,o)},changed:L},l))}function j(){T("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function P(e){return T("dragOverCompleted",{insertion:e}),e&&(d?c._hideClone():c._showClone(p),p!==h&&(dc($c,Xc?Xc.options.ghostClass:c.options.ghostClass,!1),dc($c,a.ghostClass,!0)),Xc!==p&&p!==Od.active?Xc=p:p===Od.active&&Xc&&(Xc=null),h===p&&(p._ignoreWhileAnimating=s),p.animateAll((function(){T("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(s===$c&&!$c.animated||s===r&&!s.animated)&&(nd=null),a.dragoverBubble||t.rootEl||s===document||($c.parentNode[Ac]._isOutsideThisEl(t.target),!e&&Ed(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),f=!0}function L(){qc=yc($c),Gc=yc($c,a.draggable),kc({sortable:p,name:"change",toEl:r,newIndex:qc,newDraggableIndex:Gc,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){ic(document,"mousemove",this._onTouchMove),ic(document,"touchmove",this._onTouchMove),ic(document,"pointermove",this._onTouchMove),ic(document,"dragover",Ed),ic(document,"mousemove",Ed),ic(document,"touchmove",Ed)},_offUpEvents:function(){var t=this.el.ownerDocument;ic(t,"mouseup",this._onDrop),ic(t,"touchend",this._onDrop),ic(t,"pointerup",this._onDrop),ic(t,"touchcancel",this._onDrop),ic(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;qc=yc($c),Gc=yc($c,n.draggable),Dc("drop",this,{evt:t}),Ic=$c&&$c.parentNode,qc=yc($c),Gc=yc($c,n.draggable),Od.eventCanceled||(sd=!1,dd=!1,cd=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Pd(this.cloneId),Pd(this._dragStartId),this.nativeDraggable&&(ic(document,"drop",this),ic(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ql&&uc(document.body,"user-select",""),uc($c,"transform",""),t&&(ed&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),Rc&&Rc.parentNode&&Rc.parentNode.removeChild(Rc),(Mc===Ic||Xc&&"clone"!==Xc.lastPutMode)&&Wc&&Wc.parentNode&&Wc.parentNode.removeChild(Wc),$c&&(this.nativeDraggable&&ic($c,"dragend",this),Ad($c),$c.style["will-change"]="",ed&&!sd&&dc($c,Xc?Xc.options.ghostClass:this.options.ghostClass,!1),dc($c,this.options.chosenClass,!1),kc({sortable:this,name:"unchoose",toEl:Ic,newIndex:null,newDraggableIndex:null,originalEvent:t}),Mc!==Ic?(qc>=0&&(kc({rootEl:Ic,name:"add",toEl:Ic,fromEl:Mc,originalEvent:t}),kc({sortable:this,name:"remove",toEl:Ic,originalEvent:t}),kc({rootEl:Ic,name:"sort",toEl:Ic,fromEl:Mc,originalEvent:t}),kc({sortable:this,name:"sort",toEl:Ic,originalEvent:t})),Xc&&Xc.save()):qc!==Uc&&qc>=0&&(kc({sortable:this,name:"update",toEl:Ic,originalEvent:t}),kc({sortable:this,name:"sort",toEl:Ic,originalEvent:t})),Od.active&&(null!=qc&&-1!==qc||(qc=Uc,Gc=Hc),kc({sortable:this,name:"end",toEl:Ic,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){Dc("nulling",this),Mc=$c=Ic=Rc=Fc=Wc=Bc=zc=Yc=Zc=ed=qc=Gc=Uc=Hc=nd=od=Xc=Vc=Od.dragged=Od.ghost=Od.clone=Od.active=null,pd.forEach((function(t){t.checked=!0})),pd.length=Jc=Kc=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<i;o++)ac(t=n[o],r.draggable,this.el,!1)&&e.push(t.getAttribute(r.dataIdAttr)||Td(t));return e},sort:function(t,e){var n={},o=this.el;this.toArray().forEach((function(t,e){var i=o.children[e];ac(i,this.options.draggable,o,!1)&&(n[t]=i)}),this),e&&this.captureAnimationState(),t.forEach((function(t){n[t]&&(o.removeChild(n[t]),o.appendChild(n[t]))})),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return ac(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(void 0===e)return n[t];var o=Pc.modifyOption(this,t,e);n[t]=void 0!==o?o:e,"group"===t&&wd(n)},destroy:function(){Dc("destroy",this);var t=this.el;t[Ac]=null,ic(t,"mousedown",this._onTapStart),ic(t,"touchstart",this._onTapStart),ic(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(ic(t,"dragover",this),ic(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),(function(t){t.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),ld.splice(ld.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!zc){if(Dc("hideClone",this),Od.eventCanceled)return;uc(Wc,"display","none"),this.options.removeCloneOnHide&&Wc.parentNode&&Wc.parentNode.removeChild(Wc),zc=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(zc){if(Dc("showClone",this),Od.eventCanceled)return;$c.parentNode!=Mc||this.options.group.revertClone?Fc?Mc.insertBefore(Wc,Fc):Mc.appendChild(Wc):Mc.insertBefore(Wc,$c),this.options.group.revertClone&&this.animate($c,Wc),uc(Wc,"display",""),zc=!1}}else this._hideClone()}},fd&&oc(document,"touchmove",(function(t){(Od.active||sd)&&t.cancelable&&t.preventDefault()})),Od.utils={on:oc,off:ic,css:uc,find:pc,is:function(t,e){return!!ac(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},throttle:Ec,closest:ac,toggleClass:dc,clone:Oc,index:yc,nextTick:jd,cancelNextTick:Pd,detectDirection:yd,getChild:vc,expando:Ac},Od.get=function(t){return t[Ac]},Od.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach((function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(Od.utils=ql(ql({},Od.utils),t.utils)),Pc.mount(t)}))},Od.create=function(t,e){return new Od(t,e)},Od.version="1.15.3";var Ld,Dd,kd,$d,Id,Rd,Md=[],Fd=!1;function Bd(){Md.forEach((function(t){clearInterval(t.pid)})),Md=[]}function Wd(){clearInterval(Rd)}var zd=Ec((function(t,e,n,o){if(e.scroll){var i,r=(t.touches?t.touches[0]:t).clientX,s=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,l=e.scrollSpeed,c=fc(),d=!1;Dd!==n&&(Dd=n,Bd(),Ld=e.scroll,i=e.scrollFn,!0===Ld&&(Ld=Cc(n,!0)));var u=0,h=Ld;do{var p=h,f=mc(p),m=f.top,g=f.bottom,v=f.left,b=f.right,y=f.width,w=f.height,C=void 0,x=void 0,E=p.scrollWidth,S=p.scrollHeight,O=uc(p),N=p.scrollLeft,A=p.scrollTop;p===c?(C=y<E&&("auto"===O.overflowX||"scroll"===O.overflowX||"visible"===O.overflowX),x=w<S&&("auto"===O.overflowY||"scroll"===O.overflowY||"visible"===O.overflowY)):(C=y<E&&("auto"===O.overflowX||"scroll"===O.overflowX),x=w<S&&("auto"===O.overflowY||"scroll"===O.overflowY));var _=C&&(Math.abs(b-r)<=a&&N+y<E)-(Math.abs(v-r)<=a&&!!N),T=x&&(Math.abs(g-s)<=a&&A+w<S)-(Math.abs(m-s)<=a&&!!A);if(!Md[u])for(var j=0;j<=u;j++)Md[j]||(Md[j]={});Md[u].vx==_&&Md[u].vy==T&&Md[u].el===p||(Md[u].el=p,Md[u].vx=_,Md[u].vy=T,clearInterval(Md[u].pid),0==_&&0==T||(d=!0,Md[u].pid=setInterval(function(){o&&0===this.layer&&Od.active._onTouchMove(Id);var e=Md[this.layer].vy?Md[this.layer].vy*l:0,n=Md[this.layer].vx?Md[this.layer].vx*l:0;"function"==typeof i&&"continue"!==i.call(Od.dragged.parentNode[Ac],n,e,t,Id,Md[this.layer].el)||Sc(Md[this.layer].el,n,e)}.bind({layer:u}),24))),u++}while(e.bubbleScroll&&h!==c&&(h=Cc(h,!1)));Fd=d}}),30),Ud=function(t){var e=t.originalEvent,n=t.putSortable,o=t.dragEl,i=t.activeSortable,r=t.dispatchSortableEvent,s=t.hideGhostForTarget,a=t.unhideGhostForTarget;if(e){var l=n||i;s();var c=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,d=document.elementFromPoint(c.clientX,c.clientY);a(),l&&!l.el.contains(d)&&(r("spill"),this.onSpill({dragEl:o,putSortable:n}))}};function qd(){}function Hd(){}qd.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var o=vc(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(e,o):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:Ud},Vl(qd,{pluginName:"revertOnSpill"}),Hd.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable||this.sortable;n.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),n.animateAll()},drop:Ud},Vl(Hd,{pluginName:"removeOnSpill"}),Od.mount(new function(){function t(){for(var t in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){var e=t.originalEvent;this.sortable.nativeDraggable?oc(document,"dragover",this._handleAutoScroll):this.options.supportPointer?oc(document,"pointermove",this._handleFallbackAutoScroll):e.touches?oc(document,"touchmove",this._handleFallbackAutoScroll):oc(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?ic(document,"dragover",this._handleAutoScroll):(ic(document,"pointermove",this._handleFallbackAutoScroll),ic(document,"touchmove",this._handleFallbackAutoScroll),ic(document,"mousemove",this._handleFallbackAutoScroll)),Wd(),Bd(),clearTimeout(lc),lc=void 0},nulling:function(){Id=Dd=Ld=Fd=Rd=kd=$d=null,Md.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,e){var n=this,o=(t.touches?t.touches[0]:t).clientX,i=(t.touches?t.touches[0]:t).clientY,r=document.elementFromPoint(o,i);if(Id=t,e||this.options.forceAutoScrollFallback||Jl||Zl||Ql){zd(t,this.options,r,e);var s=Cc(r,!0);!Fd||Rd&&o===kd&&i===$d||(Rd&&Wd(),Rd=setInterval((function(){var r=Cc(document.elementFromPoint(o,i),!0);r!==s&&(s=r,Bd()),zd(t,n.options,r,e)}),10),kd=o,$d=i)}else{if(!this.options.bubbleScroll||Cc(r,!0)===fc())return void Bd();zd(t,this.options,Cc(r,!1),!1)}}},Vl(t,{pluginName:"scroll",initializeByDefault:!0})}),Od.mount(Hd,qd);const Gd={add:{attr:t=>{const e=window.prompt(t.message.attr);if(e&&t.isDisabled(e))return window.alert(oe.get("attributeNotPermitted",e||"")),Vd.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:Ts}},Vd={init:function(t){const e=Object.keys(Gd);return this.opts=e.reduce(((e,n)=>(e[n]={...Gd[n],...t[n]},e)),t),this},add:{attrs:t=>Vd.opts.add.attr(t),options:t=>Vd.opts.add.option(t),conditions:t=>(t.template={if:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],then:[{target:"",targetProperty:"",assignment:"",value:""}]},Vd.opts.add.condition(t))},click:{btn:t=>Vd.opts.click.btn(t)},save:{form:t=>(Vd.opts.sessionStorage&&Os.set(Fe,t),Ca.formeoSaved({formData:t}),Vd.opts.save.form(t))}},Xd=Object.freeze({type:"field",displayType:"slider"}),Yd=t=>({transform:`translateX(${t?`${t}px`:0})`});class Zd{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=dh.getStyle(this.currentPanel,"height");return t.height=e,e})),this.opts=Cs(Xd,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)}),Ue)}getPanelDisplay(){const t=this.panelsWrap,e=Number.parseInt(dh.getStyle(t,"width"))>390?"tabbed":"slider",n="auto"===this.opts.displayType;return this.panelDisplay=n?e:this.opts.displayType||Xd.displayType,this.panelDisplay}createPanelsWrap(){const t=dh.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 ga.forEach(e,(t=>{t.fieldId=this.opts.id,t.isSortable&&Od.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=ca(t.target,t.target.parentElement);this.currentPanel=this.panels[e];const n=t.target.parentElement.childNodes;this.nav.refresh(e),dh.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",dh.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:dh.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:dh.icon("triangle-left")};return dh.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=ca(this.currentPanel,e);let i={nav:0,panel:0},r={...i};t.groupChange=t=>{const e=n.children;return dh.removeClasses(o,"active-panel"),dh.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=ze,animate:s=!this.isTabbed})=>{const a=[Yd(r.panel),Yd(t.panel)],l=[Yd(r.nav),Yd(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 u=()=>{this.panelsWrap.style.height=dh.getStyle(this.currentPanel,"height"),d.removeEventListener("finish",u),o||(r=t)};d.addEventListener("finish",u)};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 Jd="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`)),Kd=new RegExp(`(?!${Jd.join("|")})\\w\\S*`,"g"),Qd=/\s+/g;function tu(t){if("string"!=typeof t)return t;if(t.trim().match(Qd))return t;return t.replace(Kd,(t=>t.charAt(0).toUpperCase()+t.substring(1).replace(/[A-Z]/g,(t=>` ${t}`))))}const eu=(t,e="-")=>t.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,e),nu="f-autocomplete",ou="highlight-component";let iu,ru=Date.now();const su=({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("."))||tu(t.join(" ")))(t,e);class au{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=dh.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=dh.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)}const n=t.target.value.trim();this.hiddenField.value=n,this.value=n}};return this.displayField=dh.create({tag:"input",autocomplete:"off",action:e,attrs:{type:"text",className:`${nu}-display-field`,value:this.label||this.value,placeholder:oe.get(`${this.i18nKey}.${this.key}.placeholder`)}}),this.hiddenField=dh.create({tag:"input",attrs:{type:"hidden",className:this.className,value:this.value}}),this.list=dh.create({tag:"ul",attrs:{className:`${nu}-list`}}),this.dom=dh.create({children:[this.displayField,this.hiddenField,this.list],className:this.className,action:{onRender:()=>{const t=this.value&&ah.getAddress(this.value);this.label=t&&su(t),this.label&&(this.displayField.value=this.label),this.updateOptions()}}}),this.dom}updateOptions(){const t=Date.now();t-ru>Ue&&(dh.empty(this.list),this.generateOptions(),ru=t);const e=iu||this.generateOptions();for(const n of e)this.list.appendChild(n)}generateOptions(){const t=(t=>{const e=[],n=ah.flatList(),o=Object.entries(n).map((([n,o])=>{const i=su(o);if(i){const r={tag:"span",content:` ${tu(o.name)}`,className:"component-type"},s=`${o.name}.${i}`;e.push(s);const a=((t,e)=>{const n=t.reduce(((t,n)=>t+(n===e)),0);return n>1?`(${n})`:""})(e,s),l=[`${i} `,{tag:"span",content:a,className:"component-label-count"},r];return(({id:t,textLabel:e,htmlLabel:n,selectedId:o})=>{const i={value:t,textLabel:e,htmlLabel:n};return t===o&&(i.selected=!0),i})({id:n,textLabel:[i,a].join(" ").trim(),htmlLabel:l,selectedId:t})}}));return o.filter(Boolean)})(),e=t=>{const e=`${nu}-list-item`;return t.classList.contains(e)||(t=t.parentElement),t};return iu=t.map((t=>{const{value:n,textLabel:o,htmlLabel:i}=t,r={tag:"li",children:i,dataset:{value:n,label:o},className:`${nu}-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 dh.create(r)})),iu}hideList(t=this.list){va.slideUp(t,ze),this.removeHighlight()}showList(t,e=this.list){this.selectOption(t),va.slideDown(e,ze)}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){var n;const o=e.querySelectorAll("li");for(const i of o){const{dataset:{value:t}}=i;if(i.classList.remove("active-option"),t){null==(n=ah.getAddress(t).dom)||n.classList.remove(ou)}}t&&(t.classList.add("active-option"),this.highlightComponent(t))}removeHighlight(){const t=document.getElementsByClassName(ou);for(const e of t)e.classList.remove(ou)}highlightComponent(t){var e;const{dataset:{value:n}}=t;if(n){null==(e=ah.getAddress(n).dom)||e.classList.add(ou)}}clearValue(){this.selectOption(null),this.displayField.value="",this.hiddenField.value="",this.value="",this.runEvent("onChange",{target:this.hiddenField})}setValue(t){const{label:e,value:n}=t.dataset;this.displayField.value=e,this.hiddenField.value=n,this.value=n,this.runEvent("onChange",{target:this.hiddenField})}addEvent(t,e){this.events.push([t,e])}runEvent(t,e){for(const[n,o]of this.events)n===t&&o(e)}}const lu=(t,e)=>{const n=(t=>{const e=As(t),n={"field.property":Xe,...Ye},o=e?(i=t,ah.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(dh.create(r))}return n}),[])},cu=(t,e)=>{dh.empty(t);for(const n of e)t.add(n)},du=({key:t,value:e,type:n="text",checked:o})=>{const i={tag:"input",attrs:{type:n,value:e,placeholder:oe.get(`${t}.placeholder`)||tu(t)},className:t.replace(/\./g,"-"),config:{}};return o&&(i.attrs.checked=!0),i},uu=t=>{const e=oe.get(t);if(e)return e;const n=t.split(".");return oe.get(n[n.length-1])},hu={autocomplete:(t,e,n)=>new au(t,e,n),string:(t,e)=>du({key:t,value:e}),boolean:(t,e)=>du({key:t,value:e,type:"selected"===t?"radio":"checkbox",checked:e}),number:(t,e)=>du({key:t,value:e,type:"number"}),array:(t,e=[])=>({tag:"select",attrs:{placeholder:uu(`placeholder.${t}`)},className:t.replace(/\./g,"-"),options:e}),object:t=>Object.entries(t).map((([t,e])=>hu[dh.childType(e)](t,e)))},pu=["selected","checked"],fu={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)}}),string:(t,e)=>({input:({target:{value:n}})=>{e.set(t,n)}}),number:(t,e)=>({input:({target:{value:n}})=>{e.set(t,Number(n))}}),array:(t,e)=>({change:({target:{value:n}})=>{e.set(t,n)}}),object:()=>({})};class mu{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=da(r,Ve.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)}),We)},o=t=>{t=Array.isArray(t)?t:[t];const e=setTimeout((()=>{t.forEach((t=>{t.dom&&(t=t.dom),t.removeAttribute("style")})),clearTimeout(e)}),We)},i=new Map([["condition-source",t=>{const i=e("condition-sourceProperty"),r=i[0],s=As(t.value)?t.value:"field.property",a=lu(s,r.value);return cu(r,a),t.value?o(i):n(i)}],["condition-target",t=>{const i=e("condition-targetProperty");return Ns(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)}]]);for(const r of t){const t=i.get(r.className);t&&t(r)}})),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=lu(n||t,e),i=hu.array(`condition.${t}`);i.action={change:c,onRender:t=>c({target:t})};const r=dh.create(i);return cu(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};Ca.formeoUpdated(o),ah.setAddress(a,t.value);const i=t.closest(".f-condition-row"),r=ca(i);this.processConditionUIState(this.itemFieldGroups[r])},d={comparison:t=>l("comparison",t),logical:t=>l("logical",t),source:(t,e="source")=>{const o=hu.autocomplete(`condition.${e}`,t,n);return ah.setConditionMap(t,i),o.addEvent("onChange",(t=>{ah.removeConditionMap(ah.getAddress(a)),c(t),ah.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=hu.string("condition.value",t);return e.action={input:c},dh.create(e)},assignment:t=>l("assignment",t)};if(d[t])return d[t](e)})),this.itemValues=da(Object.entries(n),pu,"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=dh.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:()=>{va.slideUp(this.dom,250,(t=>{this.field.remove(this.itemKey),dh.remove(t),this.field.resizePanelWrap()}))}},content:dh.icon("remove")};return{className:`${this.panelName}-prop-controls prop-controls`,content:[t]}}itemInput(t,e){const n=dh.childType(e)||"string",o={config:{},attrs:{},...hu[n](t,e)},i=this.itemKey.replace(/.\d+$/,(e=>`${e}.${t}`)),r=i.split(".").filter(Number.isNaN).join(".")||t,[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&&(uu(r)||tu(r)),labelAfter:!1},o.attrs={...o.attrs,name:"checkbox"===o.attrs.type?`${a}[]`:a,id:s,disabled:this.isDisabled,locked:this.isLocked},o.action={...fu[n](i,this.field)},o}}class gu{constructor(t,n,o){e(this,"addAttribute",((t,e)=>{const n=eu(t),o=`attrs.${n}`;oe.current[o]||oe.put(o,fa(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 mu({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?aa(e[e.length-1]):{},label:o,value:eu(o)},s=new mu({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 mu({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=dh.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 mu({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 dh.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:[{...dh.btnTemplate({content:n,title:n}),className:`add-${e}`,action:{click:n=>{const i={btnCoords:dh.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=tu(e),s=new window.CustomEvent(`onAdd${r}`,{detail:i});Vd.add[e](i),document.dispatchEvent(s)}}}]}}}class vu extends zl{constructor(t,n={},o){super(t,{...n,id:n.id||ws()}),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)?la(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 ua(n,(t=>t.remove())),this.dom.parentElement.removeChild(this.dom),((t,e)=>{const n=t.indexOf(e);-1!==n&&t.splice(n,1)})(ah.getAddress(`${e.name}s.${e.id}.children`),this.id),e.children.length||e.emptyClass(),"row"===e.name&&e.autoColumnWidths(),ah[`${this.name}s`].delete(this.id)})),e(this,"emptyClass",(()=>this.dom.classList.toggle("empty",!this.children.length))),e(this,"getComponentTag",(()=>dh.create({tag:"span",className:["component-tag",`${this.name}-tag`],children:[(this.isColumn||this.isField)&&dh.icon("component-corner",{className:"bottom-left"}),dh.icon(`handle-${this.name}`),tu(this.name),(this.isColumn||this.isRow)&&dh.icon("component-corner",{className:"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[dh.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-${bs(t)}`),null==e||e.classList.remove(`hovering-${bs(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,!Xe[i]].some(Boolean)?t:e?o.set(Xe[i],e):o.get(Xe[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={...xs(this.data),id:ws()};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=>dh.create({tag:"ul",attrs:{className:"children"},children:t}))),this.id=this.data.id,this.name=t,this.config=ah[`${this.name}s`].config,Cs(this.config,n.config),this.dataPath=`${this.name}s.${this.id}.`,this.observer=new window.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:()=>{ah.stages.active.dom.classList.add(`active-hover-${this.name}`),this.dom.classList.add(...t)},mouseleave:({target:e})=>{this.dom.classList.remove(...t),ah.stages.active.dom.classList.remove(`active-hover-${this.name}`),e.removeAttribute("style")}},children:[{...dh.btnTemplate({content:dh.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`);va.slideToggle(i,We,t),"field"===this.name&&(va.slideToggle(this.preview,We,!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}`)=>({...dh.btnTemplate({content:dh.icon(t)}),className:["component-handle"]}),move:(t="move")=>({...dh.btnTemplate({content:dh.icon(t)}),className:["item-move"],meta:{id:"move"}}),edit:(t="edit")=>({...dh.btnTemplate({content:dh.icon(t)}),className:["item-edit-toggle"],meta:{id:"edit"},action:{click:t=>{this.toggleEdit()}}}),remove:(t="remove")=>({...dh.btnTemplate({content:dh.icon(t)}),className:["item-remove"],meta:{id:"remove"},action:{click:(t,e)=>{va.slideUp(this.dom,We,(()=>{if("column"===this.name){this.parent.autoColumnWidths(),this.remove()}else this.remove()}))}}}),clone:(t="copy")=>({...dh.btnTemplate({content:dh.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 ca(this.dom)}get parentType(){return Ie.get(this.name)}get parent(){const t=this.parentType;if(!this.dom||!t)return null;const e=this.dom.closest(`.${Te[t]}`);return e&&dh.asComponent(e)}get children(){if(!this.dom)return[];const t=this.domChildren,e=$e.get(this.name);return ha(t,(t=>ah.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=ws()}=i,a=$e.get(this.name);if(!a)return null;const l=`${a}s`,c=ah.getAddress(`${l}.${s}`)||ah[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(ve)||(t=t.parentElement);const r=bs(t),s=bs(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=ca(this.dom);return()=>this.parent.addChild(t,e+1)}],[2,t=>()=>this.parent.parent.addChild(t)]]),l={controls:()=>{const{controlData:t}=Mu.get(n.id),{meta:{id:e}}=t,i=e.startsWith("layout-")?e.replace(/^layout-/,""):"field",r=ra({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)();dh.remove(n);return s(t,o)},row:()=>{const t=(a.get({stage:-1,row:0,column:1}[s])||Ts)();return null==t?void 0:t({id:n.id},o)},column:()=>{const t=(a.get({stage:-2,row:-1}[s])||Ts)();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(we)&&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&&dh.onRender(this.dom,t.onRender)}set config(t){const e=ra(this.data,"meta.id"),n=[ra(t,"all"),e&&ra(t,e),ra(t,this.id)].reduce(((t,e)=>e?Cs(t,e):t),this.configVal);this.configVal=n}get config(){return this.configVal}getComponent(t){const[e,n]=t.split("."),o=ah[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===Ae.row}get isColumn(){return this.name===Ae.column}get isField(){return this.name===Ae.field}}class bu extends vu{constructor(t=Object.create(null)){super("field",{conditions:[{if:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],then:[{target:"",targetProperty:"",assignment:"",value:""}]}],...t}),e(this,"updateConditionsPanel",_s((()=>{const t=this.editPanels.find((({name:t})=>"conditions"===t));if(!t)return null;const e=t.createProps(),n=this.dom.querySelector(".field-edit-conditions");n.parentElement.replaceChild(e,n)}),We)),e(this,"updatePreview",(()=>{if(!this.preview.parentElement)return null;this.updateLabel();const t=dh.create(this.fieldPreview(),!0);this.preview.parentElement.replaceChild(t,this.preview),this.preview=t})),e(this,"updateEditPanels",(()=>{this.editPanels=[];const t=["object","array"],e=ys([...this.config.panels.order,...Object.keys(this.data)]),n=["config","meta","action","events",...this.config.panels.disabled],o=e.filter((t=>!n.includes(t)));for(const r of o){const e=this.get(r),n=dh.childType(e);if(t.includes(n)){const t=new gu(e,r,this);this.editPanels.push(t)}}const i={panels:this.editPanels.map((({panelConfig:t})=>t)),id:this.id,displayType:"auto"};this.panels=new Zd(i),this.dom&&(this.dom.querySelector(".panel-nav").replaceWith(this.panels.panelNav),this.dom.querySelector(".panels").replaceWith(this.panels.panelsWrap))})),e(this,"toggleCheckedOptions",((t,e)=>{const n=this.get("options").map(((n,o)=>{const i=o===t;return"radio"===e?n.selected=i:n.checked=i?!n.checked:n.checked,n}));this.set("options",n)})),e(this,"isDisabledProp",((t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.disabled.concat(this.get(`config.disabled${tu(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${tu(e)}`)).includes(t)})),this.debouncedUpdateEditPanels=function(t,e=333){let n;return function(...o){n&&clearTimeout(n),n=setTimeout((()=>t.apply(this,o)),e)}}(this.updateEditPanels),this.label=dh.create(this.labelConfig),this.preview=dh.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:Ce},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=dh.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=ah.getConditionMap(`fields.${this.id}`);if(i)return i.updateConditionSourceLabel(`${this.name}s.${this.id}`,n?o:e)}}},e&&dh.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=dh.create(this.labelConfig);this.label.parentElement.replaceChild(t,this.label),this.label=t}get fieldEdit(){const t={className:["field-edit","slide-toggle","formeo-panels-wrap"]};this.updateEditPanels();const e=this.editPanels.length;return e&&(t.className.push(`panel-count-${e}`),t.content=[this.panels.panelNav,this.panels.panelsWrap],this.panelNav=this.panels.nav,this.resizePanelWrap=this.panels.nav.refresh),t.action={onRender:()=>{if(0===e){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",dh.remove(e)}else this.resizePanelWrap()}},dh.create(t)}get defaultPreviewActions(){return{change:t=>{const{target:e}=t,{type:n}=e;if(["checkbox","radio"].includes(n)){const t=+e.id.split("-").pop();this.toggleCheckedOptions(t,n),this.debouncedUpdateEditPanels()}},click:t=>{"true"===t.target.contentEditable&&t.preventDefault()},input:t=>{if(["input","meter","progress","button"].includes(t.target.tagName.toLowerCase()))return super.set("attrs.value",t.target.value),this.debouncedUpdateEditPanels();if(t.target.contentEditable){const e=t.target.parentElement.classList;if(e.contains("f-checkbox")||e.contains("f-radio")){const e=t.target.parentElement,n=e.parentElement,o=ca(e,n);return super.set(`options[${o}].label`,t.target.innerHTML),this.debouncedUpdateEditPanels()}super.set("content",t.target.innerHTML)}}}}fieldPreview(){var t;const e=xs(this.data),{action:n={}}=Mu.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:dh.create(e,!0),action:this.defaultPreviewActions}}}const yu={js:new Set,css:new Set},wu=(t,e,n=js)=>new Promise((o=>fetch(t).then((t=>{if(!t.ok)return o(n(t));o(e?e(t):t)})).catch((t=>n(t))))),Cu=(t,e)=>{t.removeEventListener("load",Cu),e(t.src)},xu=(t,e)=>{t.removeEventListener("load",xu),e(t.src)},Eu=t=>new Promise(((e,n)=>{if(yu.js.has(t))return e(t);yu.js.add(t);const o=dh.create({tag:"script",attrs:{type:"text/javascript",async:!0,src:t},action:{load:()=>xu(o,e),error:()=>n(new Error(`${t} failed to load.`))}});document.head.appendChild(o)})),Su=t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>new Promise(((e,n)=>{if(yu.css.has(t))return e(t);yu.css.add(t);const o=dh.create({tag:"link",attrs:{rel:"stylesheet",href:t},action:{load:()=>Cu(o,e),error:()=>n(new Error(`${(void 0).src} failed to load.`))}});document.head.appendChild(o)}))));return Promise.all(e)},Ou=async(t=fe)=>{if(document.getElementById(he))return;const e=async t=>(t=>{let e=document.getElementById(he);return e||(e=dh.create({id:he,children:t,attrs:{hidden:!0,style:"display: none;"}}),document.body.insertBefore(e,document.body.childNodes[0])),e})(await t.text());return wu(t,e,(()=>wu(me,e)))},Nu={js:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>Eu(t)));return Promise.all(e)},css:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>Su(t)));return Promise.all(e)}},Au=t=>{const e=Object.entries(t).map((([t,e])=>Nu[t](e)));return Promise.all(e)},_u=()=>{const t=document.getElementById(he);return"hidden"===window.getComputedStyle(t).visibility};class Tu{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||ws()}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:dh.icon(t.icon)},n],action:{focus:({target:t})=>{const e=t.closest(`.${ve}`);return e&&Mu.panels.nav.refresh(ca(e))},click:({target:t})=>{Mu.addElement(t.parentElement.id)}}};return dh.create({tag:"li",id:this.id,className:["field-control",`${t.group}-control`,`${t.id}-control`],content:o,meta:t,action:this.controlAction})}promise(){return Au(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 ju=[{config:{label:"row"},meta:{group:"layout",icon:"rows",id:"layout-row"}},{config:{label:"column"},meta:{group:"layout",icon:"columns",id:"layout-column"}}];const Pu=(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:tu(t),count:e}),value:`${t}-${e}`,[n]:!e}}));const Lu=[class extends Tu{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 Tu{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 Tu{constructor(){super({tag:"input",attrs:{type:"hidden",value:""},config:{label:oe.get("hidden"),hideLabel:!0},meta:{group:"common",icon:"hidden",id:"hidden"}})}},class extends Tu{constructor(){super({tag:"input",attrs:{type:"number",required:!1,className:""},config:{label:oe.get("number")},meta:{group:"common",icon:"hash",id:"number"}})}},class extends Tu{constructor(){super({tag:"textarea",config:{label:oe.get("controls.form.textarea")},meta:{group:"common",icon:"textarea",id:"textarea"},attrs:{required:!1}})}},class extends Tu{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 Tu{constructor(){super({tag:"input",attrs:{type:"file",required:!1},config:{label:oe.get("fileUpload")},meta:{group:"common",icon:"upload",id:"upload"}})}},class extends Tu{constructor(){super({tag:"select",config:{label:oe.get("controls.form.select")},attrs:{required:!1,className:""},meta:{group:"common",icon:"select",id:"select"},options:Pu("option")})}},class extends Tu{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:Pu("checkbox",1)})}},class extends Tu{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:Pu("radio")})}}],Du=Array.from(Array(5).keys()).slice(1).map((t=>`h${t}`)),ku="controls.html.header";const $u=[class extends Tu{constructor(){super({tag:Du[0],attrs:{tag:Du.map(((t,e)=>({label:t.toUpperCase(),value:t,selected:!e}))),className:""},config:{label:oe.get(ku),hideLabel:!0,editableContent:!0},meta:{group:"html",icon:"header",id:"html.header"},content:oe.get(ku),action:{}})}static get definition(){return{i18n:{"en-US":{header:"Custom English Header"}}}}get content(){return super.i18n(ku)}},class extends Tu{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 Tu{constructor(){super({tag:"hr",config:{label:oe.get("controls.html.divider"),hideLabel:!0},meta:{group:"html",icon:"divider",id:"divider"}})}},class extends Tu{constructor(t){super(Cs({tag:"textarea",config:{label:"WYSIWYG",editableContent:!0},meta:{group:"html",icon:"rich-text",id:"tinymce"},attrs:{required:!1},dependencies:{js:"https://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))}}],Iu=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"}}),Ru=[...Lu,...$u,...ju];const Mu=new class{constructor(){e(this,"groupLabel",(t=>oe.get(t)||t||"")),e(this,"addElement",(t=>{const e=ra(this.get(t),"controlData"),{meta:{group:n,id:o}}=e,i={row:()=>th.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}=Cs(Iu,t);return this.container=e,this.groupOrder=ys(o.concat(["common","html","layout"])),this.options=i,Promise.all(this.registerControls([...Ru,...n]))})),this.data=new Map,this.buttonActions={focus:({target:t})=>{const e=t.closest(`.${ve}`);return e&&this.panels.nav.refresh(ca(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 Tu(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=da(t,this.groupOrder,"id"),t=t.filter((t=>vs(t.id,this.options.disable.groups))),n=t.map((t=>{const n={tag:"ul",attrs:{className:ve,id:`${t.id}-${ve}`},config:{label:this.groupLabel(t.label)}};if(this.options.elementOrder[t.id]){const e=this.options.elementOrder[t.id],n=ys(e.concat(t.elementOrder));t.elementOrder=n}return e=da(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=[vs(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=xs(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 xs(this.data.get(t))}formActions(){if(!0===this.options.disable.formActions)return null;const t={...dh.btnTemplate({content:[dh.icon("bin"),oe.get("clear")],title:oe.get("clearAll")}),className:["clear-form"],action:{click:t=>{eh.size?(Ca.confirmClearAll=new window.CustomEvent("confirmClearAll",{detail:{confirmationMessage:oe.get("confirmClearAll"),clearAllAction:()=>{th.clearAll().then((()=>{const e={src:t.target};Ca.formeoCleared(e)}))},btnCoords:dh.coords(t.target)}}),document.dispatchEvent(Ca.confirmClearAll)):window.alert(oe.get("cannotClearFields"))}}},e={...dh.btnTemplate({content:[dh.icon("floppy-disk"),oe.get("save")],title:oe.get("save")}),className:["save-form"],action:{click:({target:t})=>{const{formData:e}=ah,n={action:()=>{},coords:dh.coords(t),message:"",button:t};return Vd.click.btn(n),Vd.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 Zd({panels:e,type:"controls",displayType:o});const i=["control-groups","formeo-panels-wrap",`panel-count-${e.length}`],r=dh.create({className:i,content:[this.panels.panelNav,this.panels.panelsWrap]}),s=["formeo-controls"];t&&s.push("formeo-sticky");const a=dh.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(dh.toggleElementsByStr(n,t),e){const e=oe.get("controls.filteringTerm",t);a.classList.add("filtered"),o?o.textContent=e:(o=dh.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),Od.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 bu(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 Fu 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?ra(this.data,t):this.add())),e(this,"add",((t,e=Object.create(null))=>{const n=t||ws(),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=Cs(this.configVal,xs(t))}get config(){return this.configVal}}class Bu extends vu{constructor(t,e){super("stage",{...Object.freeze({children:[]}),...t},e);const n=this.createChildWrap();this.dom=dh.create({attrs:{className:[be,"empty"],id:this.id},children:n}),Od.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:()=>{Wu.active=this},onSort:this.onSort.bind(this),draggable:`.${ye}`,handle:".item-move"})}empty(t=!0){return new Promise((e=>{t?(this.dom.classList.add("removing-all-fields"),va.slideUp(this.dom,We,(()=>{e(super.empty(t)),this.dom.classList.remove("removing-all-fields"),va.slideDown(this.dom,We)}))):e(super.empty())}))}onAdd(...t){const e=super.onAdd(...t);e&&"column"===e.name&&e.parent.autoColumnWidths()}}const Wu=new class extends Fu{constructor(t){super("stages",t)}Component(t){return new Bu(t)}};class zu extends vu{constructor(t){super("row",{...Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[ye]}),...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(Je);const t=n.dom,o=Ss(e);n.set("config.width",o),t.style.width=o,t.dataset.colWidth=o;const i=setTimeout((()=>{clearTimeout(i),n.refreshFieldPanels()}),ze);document.dispatchEvent(Ca.columnResized)}this.updateColumnPreset()})),e(this,"updateColumnPreset",(()=>{this.columnPresetControl.innerHTML="";const t=this.getColumnPresetOptions.map((({label:t,...e})=>dh.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=dh.create({tag:"li",className:[ye,"empty"],dataset:{hoverTag:oe.get("row"),editingHoverTag:oe.get("editing.row")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),this.editWindow,n]}),Od.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:`.${we}`,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:"Title"},config:{label:{children:["Row Title",{tag:"span",content:" ⓘ",dataset:{tooltip:"Row title will be used as the legend for the fieldset"}}]}},action:{input:({target:{value:t}})=>this.set("config.legend",t)},className:""}},o=dh.formGroup([t,n]),i={tag:"label",content:oe.get("defineColumnWidths"),className:"col-sm-4 form-control-label"};this.columnPresetControl=dh.create(this.columnPresetControlConfig);const r={className:"col-sm-8",content:this.columnPresetControl,action:{onRender:()=>{this.updateColumnPreset()}}},s=[e,"hr",o,"hr",dh.formGroup([i,r],"row")];return dh.create({className:`${this.name}-edit group-config`,action:{onRender:t=>{const e=s.map((t=>dh.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=Re.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:xe}),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:Ee},action:{change:({target:t})=>{const{value:e}=t;this.setColumnWidths(e)}},options:this.getColumnPresetOptions}}}const Uu={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}};const qu=new class extends Fu{constructor(t){super("rows",t),this.config={all:Uu}}Component(t){return new zu(t)}};class Hu{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=dh.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(`.${ye}`);if(this.validateResizeTarget(e,n))if(this.startX="touchstart"===t.type?t.touches[0].clientX:t.clientX,o.classList.add(Se),this.columnPreset=o.querySelector(`.${Ee}`),this.originalColumnClass=e.className,this.originalSiblingClass=n.className,e.className=e.className.replace(Je,""),n.className=n.className.replace(Je,""),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(Es(e,this.rowWidth)),i=parseFloat(Es(n,this.rowWidth));return o<10||i<10?null:{colWidth:Ss(o.toFixed(1)),siblingColWidth:Ss(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(),ah.setAddress(`columns.${t.id}.config.width`,t.dataset.colWidth),ah.setAddress(`columns.${e.id}.config.width`,e.dataset.colWidth),this.row.classList.remove(Se),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(Se),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const t=this.columnPreset;let e=t.querySelector(`.${xe}`);const n=this.row.querySelector(".children").children,o=ha(n,(t=>Es(t.clientWidth,this.rowWidth).toFixed(1))),i=o.join(","),r=o.join(" | ");return e||(e=dh.create({tag:"option",attrs:{className:xe,value:i,selected:!0},content:r}),t.append(e)),e.value=i,e.textContent=r,i}}const Gu=t=>({className:"resize-x-handle",action:{pointerdown:t.onStart.bind(t)},content:[dh.icon("triangle-down"),dh.icon("triangle-up")]}),Vu=()=>({className:"column-edit group-config"});class Xu extends vu{constructor(t){super("column",{...Object.freeze({config:{width:"100%"},children:[],className:[we]}),...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=dh.create({tag:"li",className:[we,"empty"],dataset:{hoverTag:oe.get("column")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),Vu(),Gu(new Hu),n]}),this.processConfig(this.dom),Ca.columnResized=new window.CustomEvent("columnResized",{detail:{column:this.dom,instance:this}}),Od.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:`.${Ce}`,handle:".item-move"})}processConfig(t){const e=ga.get(this.data,"config.width");e&&(t.dataset.colWidth=e,t.style.width=e)}}const Yu={actionButtons:{buttons:["clone","move","remove"],disabled:[]}};const Zu=new class extends Fu{constructor(t){super("columns",t),this.config={all:Yu}}Component(t){return new Xu(t)}},Ju={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}};const Ku=new class extends Fu{constructor(t){super("fields",t),e(this,"get",(t=>{let e=t&&ra(this.data,t);if(!e){const n=Mu.get(t);n&&(e=this.add(null,n.controlData))}return e})),this.config={all:Ju}}Component(t){return new bu(t)}};const Qu=new class extends Fu{constructor(t){super("externals",t)}Component(t){return new vu("external",t)}},th=Wu,eh=qu,nh=Zu,oh=Ku,ih=Mu,rh=Qu,sh={id:ws()};const ah=new class extends zl{constructor(t){super("components"),e(this,"sessionFormData",(()=>{var t;if(null==(t=this.opts)?void 0:t.sessionStorage)return Os.get(Fe)})),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={[ws()]:{}},rows:i,columns:r,fields:s,id:a=ws()}={...this.sessionFormData(),...n};this.set("id",a),this.add("stages",th.load(o)),this.add("rows",eh.load(i)),this.add("columns",nh.load(r)),this.add("fields",oh.load(s)),this.add("externals",rh.load(e.external));for(const l of Object.values(this.get("stages")))l.loadChildren();return this.data})),this.opts=t,this.data=sh,this.disableEvents=!0,this.stages=th,this.rows=eh,this.columns=nh,this.fields=oh,this.controls=ih,this.externals=rh}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:Wu.getData(),rows:qu.getData(),columns:Zu.getData(),fields:Ku.getData()}}set config(t){const{stages:e,rows:n,columns:o,fields:i}=t;th.config=e,eh.config=n,nh.config=o,oh.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(!Ns(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(Ns(t)){const e=t.split(".");return e.every((t=>Boolean(t)))&&this[e[0]].conditionMap.get(e[1])}}setConditionMap(t,e){if(Ns(t)){const n=t.split(".");return n.every((t=>Boolean(t)))&&this[n[0]].conditionMap.set(n[1],e)}}removeConditionMap(t){if(Ns(t)){const e=t.split(".");return e.every((t=>Boolean(t)))&&this[e[0]].conditionMap.delete(e[1])}}},lh={glyphicons:t=>`<span class="glyphicon glyphicon-${t}" aria-hidden="true"></span>`,"font-awesome":t=>{const[e,n]=t.split(" ");return`<i class="${e} fa-${n}"></i>`},fontello:t=>`<i class="${Ke}${t}">${t}</i>`},ch=new Set(["input","textarea","select"]);const dh=new class{constructor(t=Object.create(null)){e(this,"render",(t=>(t.id=`f-${t.id||ws()}`,this.create(t)))),e(this,"create",((t,e=!1)=>{if(!t)return;const n=this,o=["children","content"],{className:i,options:r,dataset:s,...a}=this.processTagName(t);let l;o.push("tag");const{tag:c}=a;let d;const u={attrs:{},className:[ga.get(a,"config.inputWrap")||"f-field-group"],children:[],config:{}};let h=document.createElement(c);const p={string:t=>{h.innerHTML+=t},object:t=>t&&h.appendChild(n.create(t,e)),node:t=>h.appendChild(t),component:t=>h.appendChild(t.dom),array:t=>{for(const e of t)l=n.childType(e),p[l](e)},function:t=>{t=t(),l=n.childType(t),p[l](t)},undefined:()=>null,boolean:()=>null};if(i&&(a.attrs=Cs(a.attrs,{className:i})),r){const t=this.processOptions(r,a,e);if(!this.holdsContent(h)||"button"===c)return ga.forEach(t,(t=>{u.children.push(n.create(t,e))})),a.attrs.className&&(u.className=a.attrs.className),u.config={...a.config},this.create(u,e);p.array.call(this,t),a.content=void 0,o.push("options")}if(a.attrs&&(n.processAttrs(a,h,e),o.push("attrs")),a.config){if(a.config.label&&(a.config.label&&"button"!==c||["radio","checkbox"].includes(ga.get(a,"attrs.type")))&&!e){const t=n.label(a);if(!a.config.hideLabel){const e=[t,h];n.labelAfter(a)&&e.reverse(),u.children.push(e)}}o.push("config")}if(a.content||a.children){const t=a.content||a.children;l=n.childType(t),p[l],p[l].call(this,t)}if(s){for(const t in s)Object.hasOwn(s,t)&&(h.dataset[t]="function"==typeof s[t]?s[t]():s[t]);o.push("dataset")}a.action&&(this.actionHandler(h,a.action),o.push("action"));const f=ga.subtract(o,Object.keys(a));for(d=f.length-1;d>=0;d--)h[f[d]]=a[f[d]];return u.children.length&&(h=this.create(u)),h})),e(this,"onRender",((t,e)=>{t.parentElement?e(t):window.requestAnimationFrame((()=>this.onRender(t,e)))})),e(this,"toggleElementsByStr",((t,e)=>{const n=[];return dh.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 ua(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,"requiredMark",(()=>({tag:"span",className:"text-error",children:"*"}))),e(this,"removeEmpty",(t=>{const e=t.parentElement,n=bs(t),o=e.getElementsByClassName(`formeo-${n}`);if(this.remove(t),!o.length)return this.isStage(e)?this.emptyClass(e):this.removeEmpty(e)})),e(this,"btnTemplate",(({title:t="",...e})=>({tag:"button",attrs:{type:"button",title:t},...e}))),e(this,"isControls",(t=>bs(t)===ve)),e(this,"isStage",(t=>bs(t)===be)),e(this,"isRow",(t=>bs(t)===ye)),e(this,"isColumn",(t=>bs(t)===we)),e(this,"isField",(t=>bs(t)===Ce)),e(this,"asComponent",(t=>ah[`${bs(t)}s`].get(t.id))),this.options=t}set setOptions(t){this.options=Cs(this.options,t)}processTagName(t){let e,n=t;if("string"==typeof n)return e=n,n={tag:e},n;if(n.attrs){const{tag:t,...o}=n.attrs;if(t)if("string"==typeof t)e=t;else{e=(t.find((t=>!0===t.selected))||t[0]).value}n.attrs=o}return n.tag=e||n.tag||"div",n}actionHandler(t,e){const n={onRender:dh.onRender,render:dh.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(`#${he} svg symbol`);return this.iconSymbols=Array.from(t).reduce(((t,e)=>{var n;return t[e.id.replace(Ke,"")]={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.cachedIcons={},this.iconSymbols}icon(t,e){var n,o;if(!t)return;const i=`${t}?${new URLSearchParams(e).toString()}`;if(null==(n=this.cachedIcons)?void 0:n[i])return this.cachedIcons[i];const r=this.icons[t];if(r){if(e){const t=Cs(r,e);return this.cachedIcons[i]=dh.create(t).outerHTML,this.cachedIcons[i]}return this.cachedIcons[i]=dh.create(r).outerHTML,this.cachedIcons[i]}return(null==(o=lh[dh.options.iconFont])?void 0:o.call(lh,t))||t}processAttrs(t,e,n){const{attrs:o={}}=t;n||o.name||!this.isInput(t.tag)||e.setAttribute("name",ws(t));for(const i of Object.keys(o)){const t=ga.safeAttrName(i),n=this.processAttrValue(o[i]);n&&e.setAttribute(t,!0===n?"":n)}}processAttrValue(t){let e=t||"";if(Array.isArray(e))if("object"==typeof e[0]){const t=e.filter((t=>!0===t.selected));e=t.length?t[0].value:e[0].value}else e=e.join(" ");return e}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},u={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||ws(),options:void 0,children:o,action:e.action}},checkbox:d,radio:d};return null==(a=u[r])?void 0:a.call(u,t)}))}holdsContent(t){return-1!==t.outerHTML.indexOf("/")}isBlockInput(t){return!this.isInput(t)&&this.holdsContent(t)}isInput(t){let e=t;return"string"!=typeof e&&(e=e.tagName),ch.has(e)}parsedHtml(t){const e=document.createElement("textarea");return e.innerHTML=t,e.textContent}labelAfter(t){const e=ga.get(t,"attrs.type"),n=ga.get(t,"config.labelAfter");return void 0!==n?n:"checkbox"===e||"radio"===e}label(t,e){const n=ga.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&&(s.attrs.for=void 0,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=bs(t);return e?ah.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,ga.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)}};ga.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");va.slideUp(t,600,(()=>{dh.empty(t),t.classList.remove("removing-all-fields"),dh.emptyClass(t),va.slideDown(t,300)}))}toggleSortable(t,e){let n=e;const o=bs(t);if(!o)return;const i=bs(t.parentElement),r=dh[o].get(t.id).sortable;n||(n=!r.option("disabled")),r.option("disabled",n),i&&["rows","columns","stages"].includes(i)&&this.toggleSortable(t.parentElement,n)}emptyClass(t){const e=t.getElementsByClassName(Oe.get(t.classList.item(0)));t.classList.toggle("empty",!e.length)}};const uh={"en-US":"English",dir:"ltr","af-ZA":"Afrikaans (South Africa)","ar-TN":"Arabic (Tunisia)","cs-CZ":"Czech (Czechia)","de-DE":"German (Germany)","es-ES":"European Spanish","fa-IR":"Persian (Iran)","fi-FI":"Finnish (Finland)","fr-FR":"French (France)","hu-HU":"Hungarian (Hungary)","it-IT":"Italian (Italy)","ja-JP":"Japanese (Japan)","nb-NO":"Norwegian Bokmål (Norway)","pl-PL":"Polish (Poland)","pt-BR":"Brazilian Portuguese","pt-PT":"European Portuguese","ro-RO":"Romanian (Romania)","ru-RU":"Russian (Russia)","th-TH":"Thai (Thailand)","tr-TR":"Turkish (Türkiye)","zh-CN":"Chinese (China)","zh-HK":"Chinese (Hong Kong SAR China)","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",and:"and",attribute:"Attribute",attributeNotPermitted:'Attribute "{attribute}" is not permitted, please choose another.',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",cannotClearFields:"There are no fields to clear",checkbox:"Checkbox",checkboxes:"Checkboxes",class:"Class",clear:"Clear",clearAllMessage:"Are you sure you want to clear all fields?",close:"Close",column:"Column","condition.target.placeholder":"target","condition.value.placeholder":"value",confirmClearAll:"Are you sure you want to remove all fields?",content:"Content",control:"Control","controlGroups.nextGroup":"Next Group","controlGroups.prevGroup":"Previous Group","controls.filteringTerm":'Filtering "{term}"',"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",copy:"Copy To Clipboard",danger:"Danger",defineColumnLayout:"Define a column layout",defineColumnWidths:"Define column widths",description:"Help Text",descriptionField:"Description","editing.row":"Editing Row",editorTitle:"Form Elements",field:"Field","field.property.invalid":"not valid","field.property.isNotVisible":"is not visible","field.property.isVisible":"is visible","field.property.label":"label","field.property.valid":"valid","field.property.value":"value",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","if.condition.source.placeholder":"source","if.condition.target.placeholder":"target / value",info:"Info","input.date":"Date","input.text":"Text",label:"Label",labelCount:"{label} {count}",labelEmpty:"Field Label cannot be empty","lang.af":"Afrikaans","lang.ar":"Arabic","lang.cs":"Czech","lang.de":"German","lang.en":"English","lang.es":"Spanish","lang.fa":"Persian","lang.fi":"Finnish","lang.fr":"French","lang.hu":"Hungarian","lang.it":"Italian","lang.ja":"Japanese","lang.nb":"Norwegian Bokmål","lang.pl":"Polish","lang.pt":"Portuguese","lang.ro":"Romanian","lang.ru":"Russian","lang.th":"Thai","lang.tr":"Turkish","lang.zh":"Chinese",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",newOptionLabel:"New {type}",no:"No",number:"Number",off:"Off",on:"On","operator.contains":"contains","operator.equals":"equals","operator.notContains":"not contains","operator.notEquals":"not equal","operator.notVisible":"not visible","operator.visible":"visible",option:"Option",optional:"optional",optionEmpty:"Option value required",optionLabel:"Option {count}",options:"Options",or:"or",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.conditions":"+ Condition","panelEditButtons.options":"+ Option",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",removeMessage:"Remove Element",removeType:"Remove {type}",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",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","then.condition.target.placeholder":"target",toggle:"Toggle",ungrouped:"Un-Grouped",warning:"Warning",yes:"Yes"};oe.addLanguage("en-US",uh);const hh={get editor(){return{stickyControls:!1,allowEdit:!0,dataType:"json",debug:!1,sessionStorage:!1,editorContainer:null,external:{},svgSprite:fe,style:ge,iconFont:null,config:{},events:{},actions:{},controls:{},polyfills:ma(),i18n:{location:"https://draggable.github.io/formeo/assets/lang/"}}}};let ph=class{constructor({formData:t,...e},n){const o=Cs(hh.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,dh.setOptions=c,ah.config=a,this.userFormData=n||t,this.Components=ah,this.dom=dh,Ca.init({debug:s,...r}),Vd.init({debug:s,sessionStorage:c.sessionStorage,...i}),this.tooltip=new ce,document.addEventListener("DOMContentLoaded",this.loadResources.bind(this))}get formData(){return this.Components.formData}set formData(t={}){this.load({...this.userFormData,...t},this.opts)}get json(){return this.Components.json}async loadResources(){var t;document.removeEventListener("DOMContentLoaded",this.loadResources);const e=[];this.opts.polyfills&&(t=>{const e=Array.isArray(t)?pe.filter((({name:e})=>-1!==t.indexOf(e))):pe;Promise.all(e.map((({src:t})=>Eu(t))))})(this.opts.polyfills),await Ou(this.opts.svgSprite),e.push((async t=>{if(!_u()&&(await Su(t),!_u()))return await Su("https://draggable.github.io/formeo/assets/css/formeo.min.css")})(this.opts.style)),e.push(oe.init({...this.opts.i18n,locale:null==(t=window.sessionStorage)?void 0:t.getItem(Be)}));const n=await Promise.all(e);return this.opts.allowEdit&&this.init(),n}init(){Mu.init(this.opts.controls,this.opts.stickyControls).then((t=>{this.controls=t,this.load(this.userFormData,this.opts),this.formId=ah.get("id"),this.i18n={setLang:t=>{var e;null==(e=window.sessionStorage)||e.setItem(Be,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(ah.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,dh.dir=oe.current.dir),this.editor=dh.create(t);(this.controls.container||this.editor).appendChild(this.controls.dom),this.editorContainer&&(dh.empty(this.editorContainer),this.editorContainer.appendChild(this.editor)),Ca.formeoLoaded=new window.CustomEvent("formeoLoaded",{detail:{formeo:this}}),document.dispatchEvent(Ca.formeoLoaded)}};const fh=t=>{const e=t.match(Ze);return(null==e?void 0:e[0])||t},mh=t=>t.replace(Ze,ws());let gh=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=dh.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[fh(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:ws(),className:i,children:s}})),e(this,"cloneComponentData",(t=>{const{children:e=[],id:n,...o}=this.components[t];return Object.assign({},o,{id:mh(n),children:e.length&&e.map((({id:t})=>this.cloneComponentData(fh(t))))})})),e(this,"addButton",(t=>dh.render({tag:"button",attrs:{className:"add-input-group btn pull-right",type:"button"},children:"Add +",action:{click:e=>{const n=e.target.parentElement,o=dh.render(this.cloneComponentData(t));n.insertBefore(o,n.lastChild),o.appendChild(dh.render(dh.btnTemplate({className:"remove-input-group",children:dh.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&&Au(o);const i=Cs({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(Ns(e)){this.getComponents(e).forEach((t=>{const e=vh(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:Wl,notEquals:(t,e)=>!Wl(t,e),contains:(t,e)=>t.includes(e),notContains:(t,e)=>!t.includes(e)},a=String(i.target[t]),l=String(Ns(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(Ns(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 As(t)?this.external[e]:this.renderedForm.querySelector(`#f-${e}`)})),e(this,"getComponents",(t=>{const e=[],n=t.slice(t.indexOf(".")+1);return As(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=dh,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=be,dh.render(t))))}};const vh=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=ph,window.FormeoRenderer=gh);const bh=gh,yh=new ph(r);((t,e)=>{const n=((t,e)=>({renderForm:()=>{te.style.display="block",e.render(t.formData)},logJSON:()=>{},viewData:()=>{for(const[e,n]of Object.entries(t.formData));},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}))})(yh,new bh(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)})(yh);
|
|
8
|
+
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:{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]);++i<r;)n=e(n,t[i],i,t);return n};var d=function(t){return function(e){return null==t?void 0:t[e]}}({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),u="object"==typeof a&&a&&a.Object===Object&&a,h=u,p="object"==typeof self&&self&&self.Object===Object&&self,f=h||p||Function("return this")(),m=f.Symbol;var g=function(t,e){for(var n=-1,o=null==t?0:t.length,i=Array(o);++n<o;)i[n]=e(t[n],n,t);return i},v=Array.isArray,b=m,y=Object.prototype,w=y.hasOwnProperty,C=y.toString,E=b?b.toStringTag:void 0;var x=function(t){var e=w.call(t,E),n=t[E];try{t[E]=void 0;var o=!0}catch(r){}var i=C.call(t);return o&&(e?t[E]=n:delete t[E]),i},S=Object.prototype.toString;var O=x,N=function(t){return S.call(t)},A=m?m.toStringTag:void 0;var _=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":A&&A in Object(t)?O(t):N(t)};var T=function(t){return null!=t&&"object"==typeof t},j=_,P=T;var L=function(t){return"symbol"==typeof t||P(t)&&"[object Symbol]"==j(t)},D=g,k=v,$=L,I=m?m.prototype:void 0,R=I?I.toString:void 0;var M=function t(e){if("string"==typeof e)return e;if(k(e))return D(e,t)+"";if($(e))return R?R.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n},F=M;var W=function(t){return null==t?"":F(t)},B=d,z=W,U=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,q=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var H=function(t){return(t=z(t))&&t.replace(U,B).replace(q,"")},G=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var V=function(t){return t.match(G)||[]},X=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var Y=function(t){return X.test(t)},Z="\\ud800-\\udfff",J="\\u2700-\\u27bf",K="a-z\\xdf-\\xf6\\xf8-\\xff",Q="A-Z\\xc0-\\xd6\\xd8-\\xde",tt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",et="["+tt+"]",nt="\\d+",ot="["+J+"]",it="["+K+"]",rt="[^"+Z+tt+nt+J+K+Q+"]",st="(?:\\ud83c[\\udde6-\\uddff]){2}",at="[\\ud800-\\udbff][\\udc00-\\udfff]",lt="["+Q+"]",ct="(?:"+it+"|"+rt+")",dt="(?:"+lt+"|"+rt+")",ut="(?:['’](?:d|ll|m|re|s|t|ve))?",ht="(?:['’](?:D|LL|M|RE|S|T|VE))?",pt="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",ft="[\\ufe0e\\ufe0f]?",mt=ft+pt+("(?:\\u200d(?:"+["[^"+Z+"]",st,at].join("|")+")"+ft+pt+")*"),gt="(?:"+[ot,st,at].join("|")+")"+mt,vt=RegExp([lt+"?"+it+"+"+ut+"(?="+[et,lt,"$"].join("|")+")",dt+"+"+ht+"(?="+[et,lt+ct,"$"].join("|")+")",lt+"?"+ct+"+"+ut,lt+"+"+ht,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",nt,gt].join("|"),"g");var bt=V,yt=Y,wt=W,Ct=function(t){return t.match(vt)||[]};var Et=c,xt=H,St=function(t,e,n){return t=wt(t),void 0===(e=n?void 0:e)?yt(t)?Ct(t):bt(t):t.match(e)||[]},Ot=RegExp("['’]","g");var Nt=function(t){return function(e){return Et(St(xt(e).replace(Ot,"")),t,"")}};var At=function(t,e,n){var o=-1,i=t.length;e<0&&(e=-e>i?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<i;)r[o]=t[o+e];return r};var _t=function(t,e,n){var o=t.length;return n=void 0===n?o:n,!e&&n>=o?t:At(t,e,n)},Tt=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var jt=function(t){return Tt.test(t)};var Pt=function(t){return t.split("")},Lt="\\ud800-\\udfff",Dt="["+Lt+"]",kt="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",$t="\\ud83c[\\udffb-\\udfff]",It="[^"+Lt+"]",Rt="(?:\\ud83c[\\udde6-\\uddff]){2}",Mt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="(?:"+kt+"|"+$t+")"+"?",Wt="[\\ufe0e\\ufe0f]?",Bt=Wt+Ft+("(?:\\u200d(?:"+[It,Rt,Mt].join("|")+")"+Wt+Ft+")*"),zt="(?:"+[It+kt+"?",kt,Rt,Mt,Dt].join("|")+")",Ut=RegExp($t+"(?="+$t+")|"+zt+Bt,"g");var qt=Pt,Ht=jt,Gt=function(t){return t.match(Ut)||[]};var Vt=_t,Xt=jt,Yt=function(t){return Ht(t)?Gt(t):qt(t)},Zt=W;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?Vt(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<e.length;i++){o=/^(.+?) *?= *?([^\n]+)/.exec(e[i]),o&&(n[o[1]]=o[2].replace(/(^\s+|\s+$)/g,""))}return n}loadLang(t,e=!0){const n=this;return new Promise((function(o,i){if(-1!==n.loaded.indexOf(t)&&e)return n.applyLanguage(n.langs[t]),o(n.langs[t]);return async function(t){try{const e=await fetch(t);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const n=t.endsWith(".lang")?"text":"json";return await e[n]()}catch(e){throw e}}([n.config.location,t,n.config.extension].join("")).then((e=>{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;!function(){try{if("undefined"!=typeof document){var t=document.createElement("style");t.appendChild(document.createTextNode('._3x4ZIcu-{position:absolute;background:#1f2937;color:#fff;padding:.75rem;border-radius:.375rem;max-width:200px;z-index:50;visibility:hidden;opacity:0;transition:opacity .2s;pointer-events:none;left:0;top:0}._3x4ZIcu-.JIt36hCJ{visibility:visible;opacity:1;pointer-events:all}._3x4ZIcu-:before{content:"";position:absolute;width:0;height:0;border:6px solid transparent}._3x4ZIcu-[data-position=top]:before{border-top-color:#1f2937;bottom:-12px;left:50%;transform:translate(-50%)}._3x4ZIcu-[data-position=bottom]:before{border-bottom-color:#1f2937;top:-12px;left:50%;transform:translate(-50%)}._3x4ZIcu-[data-position=left]:before{border-left-color:#1f2937;right:-12px;top:50%;transform:translateY(-50%)}._3x4ZIcu-[data-position=right]:before{border-right-color:#1f2937;left:-12px;top:50%;transform:translateY(-50%)}._3x4ZIcu-[data-position=top-left]:before{border-top-color:#1f2937;bottom:-12px;left:12px;transform:none}._3x4ZIcu-[data-position=top-right]:before{border-top-color:#1f2937;bottom:-12px;right:12px;left:auto;transform:none}._3x4ZIcu-[data-position=bottom-left]:before{border-bottom-color:#1f2937;top:-12px;left:12px;transform:none}._3x4ZIcu-[data-position=bottom-right]:before{border-bottom-color:#1f2937;top:-12px;right:12px;left:auto;transform:none}')),document.head.appendChild(t)}}catch(e){}}();var ie=Object.defineProperty,re=(t,e,n)=>((t,e,n)=>e in t?ie(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n)(t,"symbol"!=typeof e?e+"":e,n);const se="_3x4ZIcu-",ae="JIt36hCJ",le={triggerName:"tooltip"};class ce{constructor(t=le){re(this,"triggerName"),re(this,"tooltip"),re(this,"activeTriggerType",null),re(this,"spacing",12),re(this,"handleClick",(t=>{const e=this.triggerName,n=t.target.closest(`[${e}][${e}-type="click"]`);if(n)if(this.isVisible())this.hide();else{const t=n.getAttribute(`${e}`);this.show(n,t),this.activeTriggerType="click"}else this.hide()})),re(this,"handleMouseOver",(t=>{const e=this.triggerName,n=t.target.closest(`[${e}]`);if("click"!==this.activeTriggerType&&"click"!==(null==n?void 0:n.getAttribute(`${e}-type`))){const t=null==n?void 0:n.getAttribute(`${e}`);t&&(this.show(n,t),this.activeTriggerType="hover")}})),re(this,"handleMouseOut",(t=>{const e=this.triggerName,n=t.target.closest(`[${e}]`);"click"!==this.activeTriggerType&&"click"!==(null==n?void 0:n.getAttribute(`${e}-type`))&&this.hide()})),re(this,"handleResize",(()=>{this.isVisible()&&this.hide()})),re(this,"handleScroll",(()=>{this.isVisible()&&this.hide()})),this.triggerName=`data-${t.triggerName}`,this.tooltip=document.createElement("div"),this.tooltip.className=`d-tooltip ${se}`,document.body.appendChild(this.tooltip),this.setupEventListeners()}setupEventListeners(){document.addEventListener("mouseover",this.handleMouseOver),document.addEventListener("mouseout",this.handleMouseOut),document.addEventListener("touchstart",this.handleMouseOver),document.addEventListener("touchend",this.handleMouseOut),document.addEventListener("click",this.handleClick),window.addEventListener("resize",this.handleResize),window.addEventListener("scroll",this.handleScroll,!0)}isVisible(){return this.tooltip.classList.contains(ae)}calculatePosition(t){const e=t.getBoundingClientRect(),n=this.tooltip.getBoundingClientRect(),o=[{name:"top",x:e.left+(e.width-n.width)/2,y:e.top-n.height-this.spacing},{name:"bottom",x:e.left+(e.width-n.width)/2,y:e.bottom+this.spacing},{name:"left",x:e.left-n.width-this.spacing,y:e.top+(e.height-n.height)/2},{name:"right",x:e.right+this.spacing,y:e.top+(e.height-n.height)/2},{name:"top-left",x:e.left,y:e.top-n.height-this.spacing},{name:"top-right",x:e.right-n.width,y:e.top-n.height-this.spacing},{name:"bottom-left",x:e.left,y:e.bottom+this.spacing},{name:"bottom-right",x:e.right-n.width,y:e.bottom+this.spacing}];return o.find((t=>this.fitsInViewport(t,n)))||o[0]}fitsInViewport(t,e){if(!(t.x>=0&&t.y>=0&&t.x+e.width<=window.innerWidth&&t.y+e.height<=window.innerHeight))return!1;return 0===[[t.x,t.y],[t.x+e.width,t.y],[t.x,t.y+e.height],[t.x+e.width,t.y+e.height],[t.x+e.width/2,t.y+e.height/2]].flatMap((([t,e])=>Array.from(document.elementsFromPoint(t,e)))).filter((t=>{if(this.tooltip.contains(t)||t===this.tooltip||t.classList.contains(se)||"none"===getComputedStyle(t).pointerEvents)return!1})).length}show(t,e){this.tooltip.innerHTML=e??"",this.tooltip.classList.add(ae);const n=this.calculatePosition(t);this.tooltip.style.left=`${n.x}px`,this.tooltip.style.top=`${n.y}px`,this.tooltip.dataset.position=n.name}hide(){this.tooltip.classList.remove(ae),this.activeTriggerType=null}destroy(){document.removeEventListener("mouseover",this.handleMouseOver),document.removeEventListener("mouseout",this.handleMouseOut),document.removeEventListener("touchstart",this.handleMouseOver),document.removeEventListener("touchend",this.handleMouseOut),document.removeEventListener("click",this.handleClick),window.removeEventListener("resize",this.handleResize),window.removeEventListener("scroll",this.handleScroll,!0),this.tooltip.remove()}}void 0!==window&&(window.SmartTooltip=ce);const de="formeo",ue="2.3.1",he="formeo-sprite",pe=[{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"}],fe=`https://cdn.jsdelivr.net/npm/formeo@${ue}/dist/${he}.svg`,me=`https://draggable.github.io/formeo/assets/img/${he}.svg`,ge=`https://cdn.jsdelivr.net/npm/formeo@${ue}/dist/formeo.min.css`,ve="control-group",be=`${de}-stage`,ye=`${de}-row`,we=`${de}-column`,Ce=`${de}-field`,Ee="custom-column-widths",xe="column-preset",Se="resizing-columns",Oe=new Map([[be,ye],[ye,we],[we,Ce]]),Ne=["external","stages","rows","columns","fields"],Ae=["stage","row","column","field"].reduce(((t,e)=>({...t,[e]:e})),{}),_e=[{name:"controls",className:ve},{name:"stage",className:be},{name:"row",className:ye},{name:"column",className:we},{name:"field",className:Ce}],Te={controls:ve,stage:be,row:ye,column:we,field:Ce},je=Object.entries(Te).reduce(((t,[e,n])=>({...t,[n]:e})),{}),Pe=Object.values(Te),Le=new RegExp(`${Pe.join("|")}`,"g"),De=_e.map((({name:t},e,n)=>{const{name:o}=n[e+1]||{};return o&&[t,o]})).filter(Boolean),ke=De.slice().map((t=>t.slice().reverse())).reverse(),$e=new Map(De),Ie=new Map(ke.slice()),Re=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)),[])),Me=[{type:"added",condition:(t,e)=>Boolean(void 0===t&&e)}],Fe=`${de}-formData`,We=`${de}-locale`,Be=333,ze=Math.round(166.5),Ue=Math.round(666),qe="formeoSaved",He="formeoUpdated",Ge="formeoOnRender",Ve=["label","logical","source","thenTarget","sourceProperty","comparison","target","targetProperty","assignment","value"],Xe={value:"attrs.value",checked:"attrs.checked",isVisible:"config.isVisible",isNotVisible:"config.isNotVisible"},Ye={comparison:{equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},assignment:{equals:"="},logical:{and:"&&",or:"||"},property:Xe},Ze=/(\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,Je=/\bcol-\w+-\d+/g,Ke="f-i-";var Qe=function(){this.__data__=[],this.size=0};var tn=function(t,e){return t===e||t!=t&&e!=e},en=tn;var nn=function(t,e){for(var n=t.length;n--;)if(en(t[n][0],e))return n;return-1},on=nn,rn=Array.prototype.splice;var sn=nn;var an=nn;var ln=nn;var cn=Qe,dn=function(t){var e=this.__data__,n=on(e,t);return!(n<0)&&(n==e.length-1?e.pop():rn.call(e,n,1),--this.size,!0)},un=function(t){var e=this.__data__,n=sn(e,t);return n<0?void 0:e[n][1]},hn=function(t){return an(this.__data__,t)>-1},pn=function(t,e){var n=this.__data__,o=ln(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};function fn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}fn.prototype.clear=cn,fn.prototype.delete=dn,fn.prototype.get=un,fn.prototype.has=hn,fn.prototype.set=pn;var mn=fn,gn=mn;var vn=function(){this.__data__=new gn,this.size=0};var bn=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n};var yn=function(t){return this.__data__.get(t)};var wn=function(t){return this.__data__.has(t)};var Cn=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},En=_,xn=Cn;var Sn,On=function(t){if(!xn(t))return!1;var e=En(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},Nn=f["__core-js_shared__"],An=(Sn=/[^.]+$/.exec(Nn&&Nn.keys&&Nn.keys.IE_PROTO||""))?"Symbol(src)_1."+Sn:"";var _n=function(t){return!!An&&An in t},Tn=Function.prototype.toString;var jn=function(t){if(null!=t){try{return Tn.call(t)}catch(e){}try{return t+""}catch(e){}}return""},Pn=On,Ln=_n,Dn=Cn,kn=jn,$n=/^\[object .+?Constructor\]$/,In=Function.prototype,Rn=Object.prototype,Mn=In.toString,Fn=Rn.hasOwnProperty,Wn=RegExp("^"+Mn.call(Fn).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Bn=function(t){return!(!Dn(t)||Ln(t))&&(Pn(t)?Wn:$n).test(kn(t))},zn=function(t,e){return null==t?void 0:t[e]};var Un=function(t,e){var n=zn(t,e);return Bn(n)?n:void 0},qn=Un(f,"Map"),Hn=Un(Object,"create"),Gn=Hn;var Vn=function(){this.__data__=Gn?Gn(null):{},this.size=0};var Xn=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Yn=Hn,Zn=Object.prototype.hasOwnProperty;var Jn=function(t){var e=this.__data__;if(Yn){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Zn.call(e,t)?e[t]:void 0},Kn=Hn,Qn=Object.prototype.hasOwnProperty;var to=Hn;var eo=Vn,no=Xn,oo=Jn,io=function(t){var e=this.__data__;return Kn?void 0!==e[t]:Qn.call(e,t)},ro=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=to&&void 0===e?"__lodash_hash_undefined__":e,this};function so(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}so.prototype.clear=eo,so.prototype.delete=no,so.prototype.get=oo,so.prototype.has=io,so.prototype.set=ro;var ao=so,lo=mn,co=qn;var uo=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var ho=function(t,e){var n=t.__data__;return uo(e)?n["string"==typeof e?"string":"hash"]:n.map},po=ho;var fo=ho;var mo=ho;var go=ho;var vo=function(){this.size=0,this.__data__={hash:new ao,map:new(co||lo),string:new ao}},bo=function(t){var e=po(this,t).delete(t);return this.size-=e?1:0,e},yo=function(t){return fo(this,t).get(t)},wo=function(t){return mo(this,t).has(t)},Co=function(t,e){var n=go(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this};function Eo(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}Eo.prototype.clear=vo,Eo.prototype.delete=bo,Eo.prototype.get=yo,Eo.prototype.has=wo,Eo.prototype.set=Co;var xo=Eo,So=mn,Oo=qn,No=xo;var Ao=mn,_o=vn,To=bn,jo=yn,Po=wn,Lo=function(t,e){var n=this.__data__;if(n instanceof So){var o=n.__data__;if(!Oo||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new No(o)}return n.set(t,e),this.size=n.size,this};function Do(t){var e=this.__data__=new Ao(t);this.size=e.size}Do.prototype.clear=_o,Do.prototype.delete=To,Do.prototype.get=jo,Do.prototype.has=Po,Do.prototype.set=Lo;var ko=Do,$o=Un,Io=function(){try{var t=$o(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),Ro=Io;var Mo=function(t,e,n){"__proto__"==e&&Ro?Ro(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},Fo=Mo,Wo=tn;var Bo=function(t,e,n){(void 0!==n&&!Wo(t[e],n)||void 0===n&&!(e in t))&&Fo(t,e,n)};var zo,Uo,qo,Ho,Go,Vo,Xo,Yo=function(t){return function(e,n,o){for(var i=-1,r=Object(e),s=o(e),a=s.length;a--;){var l=s[t?a:++i];if(!1===n(r[l],l,r))break}return e}}(),Zo={exports:{}};zo=Zo,qo=f,Ho=(Uo=Zo.exports)&&!Uo.nodeType&&Uo,Go=Ho&&zo&&!zo.nodeType&&zo,Vo=Go&&Go.exports===Ho?qo.Buffer:void 0,Xo=Vo?Vo.allocUnsafe:void 0,zo.exports=function(t,e){if(e)return t.slice();var n=t.length,o=Xo?Xo(n):new t.constructor(n);return t.copy(o),o};var Jo=Zo.exports,Ko=f.Uint8Array,Qo=Ko;var ti=function(t){var e=new t.constructor(t.byteLength);return new Qo(e).set(new Qo(t)),e};var ei=function(t,e){var n=e?ti(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)};var ni=function(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e},oi=Cn,ii=Object.create,ri=function(){function t(){}return function(e){if(!oi(e))return{};if(ii)return ii(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();var si=function(t,e){return function(n){return t(e(n))}},ai=si(Object.getPrototypeOf,Object),li=Object.prototype;var ci=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||li)},di=ri,ui=ai,hi=ci;var pi=function(t){return"function"!=typeof t.constructor||hi(t)?{}:di(ui(t))},fi=_,mi=T;var gi=function(t){return mi(t)&&"[object Arguments]"==fi(t)},vi=T,bi=Object.prototype,yi=bi.hasOwnProperty,wi=bi.propertyIsEnumerable,Ci=gi(function(){return arguments}())?gi:function(t){return vi(t)&&yi.call(t,"callee")&&!wi.call(t,"callee")};var Ei=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},xi=On,Si=Ei;var Oi=function(t){return null!=t&&Si(t.length)&&!xi(t)},Ni=Oi,Ai=T;var _i=function(t){return Ai(t)&&Ni(t)},Ti={exports:{}};var ji=function(){return!1};!function(t,e){var n=f,o=ji,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}(Ti,Ti.exports);var Pi=Ti.exports,Li=_,Di=ai,ki=T,$i=Function.prototype,Ii=Object.prototype,Ri=$i.toString,Mi=Ii.hasOwnProperty,Fi=Ri.call(Object);var Wi=function(t){if(!ki(t)||"[object Object]"!=Li(t))return!1;var e=Di(t);if(null===e)return!0;var n=Mi.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Ri.call(n)==Fi},Bi=_,zi=Ei,Ui=T,qi={};qi["[object Float32Array]"]=qi["[object Float64Array]"]=qi["[object Int8Array]"]=qi["[object Int16Array]"]=qi["[object Int32Array]"]=qi["[object Uint8Array]"]=qi["[object Uint8ClampedArray]"]=qi["[object Uint16Array]"]=qi["[object Uint32Array]"]=!0,qi["[object Arguments]"]=qi["[object Array]"]=qi["[object ArrayBuffer]"]=qi["[object Boolean]"]=qi["[object DataView]"]=qi["[object Date]"]=qi["[object Error]"]=qi["[object Function]"]=qi["[object Map]"]=qi["[object Number]"]=qi["[object Object]"]=qi["[object RegExp]"]=qi["[object Set]"]=qi["[object String]"]=qi["[object WeakMap]"]=!1;var Hi=function(t){return Ui(t)&&zi(t.length)&&!!qi[Bi(t)]};var Gi=function(t){return function(e){return t(e)}},Vi={exports:{}};!function(t,e){var n=u,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}(Vi,Vi.exports);var Xi=Vi.exports,Yi=Hi,Zi=Gi,Ji=Xi&&Xi.isTypedArray,Ki=Ji?Zi(Ji):Yi;var Qi=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},tr=Mo,er=tn,nr=Object.prototype.hasOwnProperty;var or=function(t,e,n){var o=t[e];nr.call(t,e)&&er(o,n)&&(void 0!==n||e in t)||tr(t,e,n)},ir=or,rr=Mo;var sr=function(t,e,n,o){var i=!n;n||(n={});for(var r=-1,s=e.length;++r<s;){var a=e[r],l=o?o(n[a],t[a],a,n,t):void 0;void 0===l&&(l=t[a]),i?rr(n,a,l):ir(n,a,l)}return n};var ar=/^(?:0|[1-9]\d*)$/;var lr=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&ar.test(t))&&t>-1&&t%1==0&&t<e},cr=function(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o},dr=Ci,ur=v,hr=Pi,pr=lr,fr=Ki,mr=Object.prototype.hasOwnProperty;var gr=function(t,e){var n=ur(t),o=!n&&dr(t),i=!n&&!o&&hr(t),r=!n&&!o&&!i&&fr(t),s=n||o||i||r,a=s?cr(t.length,String):[],l=a.length;for(var c in t)!e&&!mr.call(t,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||pr(c,l))||a.push(c);return a};var vr=Cn,br=ci,yr=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e},wr=Object.prototype.hasOwnProperty;var Cr=gr,Er=function(t){if(!vr(t))return yr(t);var e=br(t),n=[];for(var o in t)("constructor"!=o||!e&&wr.call(t,o))&&n.push(o);return n},xr=Oi;var Sr=function(t){return xr(t)?Cr(t,!0):Er(t)},Or=sr,Nr=Sr;var Ar=Bo,_r=Jo,Tr=ei,jr=ni,Pr=pi,Lr=Ci,Dr=v,kr=_i,$r=Pi,Ir=On,Rr=Cn,Mr=Wi,Fr=Ki,Wr=Qi,Br=function(t){return Or(t,Nr(t))};var zr=ko,Ur=Bo,qr=Yo,Hr=function(t,e,n,o,i,r,s){var a=Wr(t,n),l=Wr(e,n),c=s.get(l);if(c)Ar(t,n,c);else{var d=r?r(a,l,n+"",t,e,s):void 0,u=void 0===d;if(u){var h=Dr(l),p=!h&&$r(l),f=!h&&!p&&Fr(l);d=l,h||p||f?Dr(a)?d=a:kr(a)?d=jr(a):p?(u=!1,d=_r(l,!0)):f?(u=!1,d=Tr(l,!0)):d=[]:Mr(l)||Lr(l)?(d=a,Lr(a)?d=Br(a):Rr(a)&&!Ir(a)||(d=Pr(l))):u=!1}u&&(s.set(l,d),i(d,l,o,r,s),s.delete(l)),Ar(t,n,d)}},Gr=Cn,Vr=Sr,Xr=Qi;var Yr=function t(e,n,o,i,r){e!==n&&qr(n,(function(s,a){if(r||(r=new zr),Gr(s))Hr(e,n,a,o,t,i,r);else{var l=i?i(Xr(e,a),s,a+"",e,n,r):void 0;void 0===l&&(l=s),Ur(e,a,l)}}),Vr)};var Zr=function(t){return t};var Jr=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)},Kr=Math.max;var Qr=function(t,e,n){return e=Kr(void 0===e?t.length-1:e,0),function(){for(var o=arguments,i=-1,r=Kr(o.length-e,0),s=Array(r);++i<r;)s[i]=o[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=o[i];return a[e]=n(s),Jr(t,this,a)}};var ts=function(t){return function(){return t}},es=Io,ns=es?function(t,e){return es(t,"toString",{configurable:!0,enumerable:!1,value:ts(e),writable:!0})}:Zr,os=Date.now;var is=function(t){var e=0,n=0;return function(){var o=os(),i=16-(o-n);if(n=o,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(ns),rs=Zr,ss=Qr,as=is;var ls=tn,cs=Oi,ds=lr,us=Cn;var hs=function(t,e){return as(ss(t,e,rs),t+"")},ps=function(t,e,n){if(!us(n))return!1;var o=typeof e;return!!("number"==o?cs(n)&&ds(e,n.length):"string"==o&&e in n)&&ls(n[e],t)};var fs=Yr;const ms=l(function(t){return hs((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&&ps(n[0],n[1],s)&&(r=i<3?void 0:r,i=1),e=Object(e);++o<i;){var a=n[o];a&&t(e,a,o,r)}return e}))}((function(t,e,n,o){fs(t,e,n,o)}))),gs=()=>crypto.randomUUID(),vs=(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},bs=t=>{var e;const n=null==(e=t.className)?void 0:e.match(Le);return n&&je[n[0]]},ys=t=>Array.from(new Set(t)),ws=t=>{let e;if(t){const{attrs:n={}}=t;e=n.id||t.id||gs(),t.id=e}else e=gs();return e},Cs=(t,e)=>ms({},t,e,((t,e)=>Array.isArray(t)?null!=e?ys(t.concat(e)):e:Array.isArray(e)?null!=t?ys(e.concat(t)):e:void 0)),Es=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;n<o;n++)e[n]=Es(t[n]);return e}if(t instanceof Object){e={};for(const n in t)Object.hasOwn(t,n)&&(e[n]=Es(t[n]));return e}throw new Error("Unable to copy Object, type not supported.")},xs=(t,e)=>t/e*100,Ss=t=>`${t.toString()}%`,Os=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){}}}}),Ns=t=>Ne.some((e=>new RegExp(`^${e}.`).test(t))),As=t=>t.startsWith("external");function _s(t,e=Ue){let n=0;return function(...o){const i=Date.now();i-n>=e&&(n=i,t.apply(this,o))}}function Ts(t){return t}function js(){}var Ps=v,Ls=L,Ds=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ks=/^\w*$/;var $s=function(t,e){if(Ps(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Ls(t))||(ks.test(t)||!Ds.test(t)||null!=e&&t in Object(e))},Is=xo;function Rs(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(Rs.Cache||Is),n}Rs.Cache=Is;var Ms=Rs;var Fs=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ws=/\\(\\)?/g,Bs=function(t){var e=Ms(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(Fs,(function(t,n,o,i){e.push(o?i.replace(Ws,"$1"):n||t)})),e})),zs=v,Us=$s,qs=Bs,Hs=W;var Gs=function(t,e){return zs(t)?t:Us(t,e)?[t]:qs(Hs(t))},Vs=L;var Xs=function(t){if("string"==typeof t||Vs(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e},Ys=or,Zs=Gs,Js=lr,Ks=Cn,Qs=Xs;var ta=function(t,e,n,o){if(!Ks(t))return t;for(var i=-1,r=(e=Zs(e,t)).length,s=r-1,a=t;null!=a&&++i<r;){var l=Qs(e[i]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(i!=s){var d=a[l];void 0===(c=o?o(d,l,a):void 0)&&(c=Ks(d)?d:Js(e[i+1])?[]:{})}Ys(a,l,c),a=a[l]}return t};const ea=l((function(t,e,n){return null==t?t:ta(t,e,n)}));var na=Gs,oa=Xs;var ia=function(t,e){for(var n=0,o=(e=na(e,t)).length;null!=t&&n<o;)t=t[oa(e[n++])];return n&&n==o?t:void 0};const ra=l((function(t,e,n){var o=null==t?void 0:ia(t,e);return void 0===o?n:o})),sa=ea,aa=t=>Number.isInteger(Number(t)),la=(t,e)=>{const n=e||t.parentElement;return Array.prototype.slice.call(n.childNodes).indexOf(t)},ca=(t,e,n)=>{const o=n.split("||"),i=ys(e).map((e=>t.find((t=>{const n=o.find((e=>!!ra(t,e)));return n&&ra(t,n)===e})))).filter(Boolean).concat(t);return ys(i)},da=(t,e,n)=>{for(let o=0;o<t.length;o++)e.call(n,t[o],o)},ua=(t,e)=>{const n=[];return da(t,((t,o)=>n.push(e(t,o)))),n},ha={},pa=t=>t.replace(/\b\w/g,(t=>t.toUpperCase())),fa=()=>-1!==window.navigator.userAgent.indexOf("MSIE "),ma={capitalize:pa,safeAttrName:t=>{if(ha[t])return ha[t];const e=({className:"class"}[t]||t).replace(/^\d+/,"").replace(/[^a-zA-Z0-9-:]/g,"");return ha[t]=e,e},forEach:da,copyObj:t=>window.JSON.parse(window.JSON.stringify(t)),map:ua,subtract:(t,e)=>e.filter((e=>!~t.indexOf(e))),indexOfNode:la,isInt:aa,get:ra,orderObjectsBy:ca,isIE:fa},ga={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=ga.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<i?(t.style.height=s+"px",window.requestAnimationFrame(e)):(t.style.height="auto",n&&n(t))}()},slideUp:(t,e=250,n=!1)=>{const o=ga.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"===ga.getStyle(t,"display"))=>{n?ga.slideDown(t,e):ga.slideUp(t,e)}},va="no-transition",ba={debug:!1,bubbles:!0,formeoLoaded:t=>{},onAdd:()=>{},onUpdate:t=>{var e;return(null==(e=wa.opts)?void 0:e.debug)&&void 0},onUpdateStage:t=>{var e;return(null==(e=wa.opts)?void 0:e.debug)&&void 0},onUpdateRow:t=>{var e;return(null==(e=wa.opts)?void 0:e.debug)&&void 0},onUpdateColumn:t=>{var e;return(null==(e=wa.opts)?void 0:e.debug)&&void 0},onUpdateField:t=>{var e;return(null==(e=wa.opts)?void 0:e.debug)&&void 0},onRender:t=>{var e;return(null==(e=wa.opts)?void 0:e.debug)&&void 0},onSave:t=>{},confirmClearAll:t=>{window.confirm(t.confirmationMessage)&&t.clearAllAction(t)}},ya=({src:t,...e},n=He)=>{var o,i;const r=new window.CustomEvent(n,{detail:e,bubbles:(null==(o=wa.opts)?void 0:o.debug)||(null==(i=wa.opts)?void 0:i.bubbles)});return r.data=(t||document).dispatchEvent(r),r},wa={init:function(t){return this.opts={...ba,...t},this},formeoSaved:t=>ya(t,qe),formeoUpdated:t=>ya(t,He),formeoCleared:t=>ya(t,"formeoCleared"),formeoOnRender:t=>ya(t,Ge),formeoConditionUpdated:t=>ya(t,"formeoConditionUpdated")},Ca=_s((()=>{wa.opts.onUpdate({timeStamp:window.performance.now(),type:He,detail:sh.formData})}),ze);let Ea;document.addEventListener(He,Ca),document.addEventListener("formeoUpdatedStage",(t=>{const{timeStamp:e,type:n,detail:o}=t;wa.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedRow",(t=>{const{timeStamp:e,type:n,detail:o}=t;wa.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedColumn",(t=>{const{timeStamp:e,type:n,detail:o}=t;wa.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedField",(t=>{const{timeStamp:e,type:n,detail:o}=t;wa.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener(Ge,(t=>{const{timeStamp:e,type:n,detail:o}=t;wa.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},wa.opts.confirmClearAll(t)})),document.addEventListener(qe,(({timeStamp:t,type:e,detail:{formData:n}})=>{const o={timeStamp:t,type:e,formData:n};wa.opts.onSave(o)})),document.addEventListener("formeoLoaded",(t=>{wa.opts.formeoLoaded(t.detail.formeo)})),window.addEventListener("resize",(function(){Ea=Ea||window.requestAnimationFrame((()=>{Ea=!1;for(const t of Object.values(eh.data))t.dom.classList.add(va),oh.dom.classList.add(va),oh.panels.nav.refresh(),t.refreshFieldPanels()}))}));var xa=xo,Sa=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Oa=function(t){return this.__data__.has(t)};function Na(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new xa;++e<n;)this.add(t[e])}Na.prototype.add=Na.prototype.push=Sa,Na.prototype.has=Oa;var Aa=Na,_a=function(t,e){for(var n=-1,o=null==t?0:t.length;++n<o;)if(e(t[n],n,t))return!0;return!1},Ta=function(t,e){return t.has(e)};var ja=function(t,e,n,o,i,r){var s=1&n,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var c=r.get(t),d=r.get(e);if(c&&d)return c==e&&d==t;var u=-1,h=!0,p=2&n?new Aa:void 0;for(r.set(t,e),r.set(e,t);++u<a;){var f=t[u],m=e[u];if(o)var g=s?o(m,f,u,e,t,r):o(f,m,u,t,e,r);if(void 0!==g){if(g)continue;h=!1;break}if(p){if(!_a(e,(function(t,e){if(!Ta(p,e)&&(f===t||i(f,t,n,o,r)))return p.push(e)}))){h=!1;break}}else if(f!==m&&!i(f,m,n,o,r)){h=!1;break}}return r.delete(t),r.delete(e),h};var Pa=Ko,La=tn,Da=ja,ka=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,o){n[++e]=[o,t]})),n},$a=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n},Ia=m?m.prototype:void 0,Ra=Ia?Ia.valueOf:void 0;var Ma=function(t,e,n,o,i,r,s){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!r(new Pa(t),new Pa(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return La(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var a=ka;case"[object Set]":var l=1&o;if(a||(a=$a),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;o|=2,s.set(t,e);var d=Da(a(t),a(e),o,i,r,s);return s.delete(t),d;case"[object Symbol]":if(Ra)return Ra.call(t)==Ra.call(e)}return!1};var Fa=function(t,e){for(var n=-1,o=e.length,i=t.length;++n<o;)t[i+n]=e[n];return t},Wa=v;var Ba=function(t,e,n){var o=e(t);return Wa(t)?o:Fa(o,n(t))};var za=function(t,e){for(var n=-1,o=null==t?0:t.length,i=0,r=[];++n<o;){var s=t[n];e(s,n,t)&&(r[i++]=s)}return r},Ua=function(){return[]},qa=Object.prototype.propertyIsEnumerable,Ha=Object.getOwnPropertySymbols,Ga=Ha?function(t){return null==t?[]:(t=Object(t),za(Ha(t),(function(e){return qa.call(t,e)})))}:Ua,Va=si(Object.keys,Object),Xa=ci,Ya=Va,Za=Object.prototype.hasOwnProperty;var Ja=gr,Ka=function(t){if(!Xa(t))return Ya(t);var e=[];for(var n in Object(t))Za.call(t,n)&&"constructor"!=n&&e.push(n);return e},Qa=Oi;var tl=Ba,el=Ga,nl=function(t){return Qa(t)?Ja(t):Ka(t)};var ol=function(t){return tl(t,nl,el)},il=Object.prototype.hasOwnProperty;var rl=function(t,e,n,o,i,r){var s=1&n,a=ol(t),l=a.length;if(l!=ol(e).length&&!s)return!1;for(var c=l;c--;){var d=a[c];if(!(s?d in e:il.call(e,d)))return!1}var u=r.get(t),h=r.get(e);if(u&&h)return u==e&&h==t;var p=!0;r.set(t,e),r.set(e,t);for(var f=s;++c<l;){var m=t[d=a[c]],g=e[d];if(o)var v=s?o(g,m,d,e,t,r):o(m,g,d,t,e,r);if(!(void 0===v?m===g||i(m,g,n,o,r):v)){p=!1;break}f||(f="constructor"==d)}if(p&&!f){var b=t.constructor,y=e.constructor;b==y||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof y&&y instanceof y||(p=!1)}return r.delete(t),r.delete(e),p},sl=Un(f,"DataView"),al=qn,ll=Un(f,"Promise"),cl=Un(f,"Set"),dl=Un(f,"WeakMap"),ul=_,hl=jn,pl="[object Map]",fl="[object Promise]",ml="[object Set]",gl="[object WeakMap]",vl="[object DataView]",bl=hl(sl),yl=hl(al),wl=hl(ll),Cl=hl(cl),El=hl(dl),xl=ul;(sl&&xl(new sl(new ArrayBuffer(1)))!=vl||al&&xl(new al)!=pl||ll&&xl(ll.resolve())!=fl||cl&&xl(new cl)!=ml||dl&&xl(new dl)!=gl)&&(xl=function(t){var e=ul(t),n="[object Object]"==e?t.constructor:void 0,o=n?hl(n):"";if(o)switch(o){case bl:return vl;case yl:return pl;case wl:return fl;case Cl:return ml;case El:return gl}return e});var Sl=ko,Ol=ja,Nl=Ma,Al=rl,_l=xl,Tl=v,jl=Pi,Pl=Ki,Ll="[object Arguments]",Dl="[object Array]",kl="[object Object]",$l=Object.prototype.hasOwnProperty;var Il=function(t,e,n,o,i,r){var s=Tl(t),a=Tl(e),l=s?Dl:_l(t),c=a?Dl:_l(e),d=(l=l==Ll?kl:l)==kl,u=(c=c==Ll?kl:c)==kl,h=l==c;if(h&&jl(t)){if(!jl(e))return!1;s=!0,d=!1}if(h&&!d)return r||(r=new Sl),s||Pl(t)?Ol(t,e,n,o,i,r):Nl(t,e,l,n,o,i,r);if(!(1&n)){var p=d&&$l.call(t,"__wrapped__"),f=u&&$l.call(e,"__wrapped__");if(p||f){var m=p?t.value():t,g=f?e.value():e;return r||(r=new Sl),i(m,g,n,o,r)}}return!!h&&(r||(r=new Sl),Al(t,e,n,o,i,r))},Rl=T;var Ml=function t(e,n,o,i,r){return e===n||(null==e||null==n||!Rl(e)&&!Rl(n)?e!=e&&n!=n:Il(e,n,o,i,t,r))},Fl=Ml;const Wl=l((function(t,e){return Fl(t,e)}));class Bl{constructor(t,n=Object.create(null)){e(this,"toJSON",((t,e)=>JSON.stringify(t,null,e))),e(this,"get",(t=>ra(this.data,t))),e(this,"getChangeType",((t,e)=>{const n=Me.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||ws();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=ra(this.data,t);if(Wl(n,e))return this.data;const o=sa(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),wa.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 zl(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 Ul(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?zl(Object(n),!0).forEach((function(e){Hl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ql(t){return(ql="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Hl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Gl(){return Gl=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Gl.apply(this,arguments)}function Vl(t,e){if(null==t)return{};var n,o,i=function(t,e){if(null==t)return{};var n,o,i={},r=Object.keys(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Xl(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var Yl=Xl(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Zl=Xl(/Edge/i),Jl=Xl(/firefox/i),Kl=Xl(/safari/i)&&!Xl(/chrome/i)&&!Xl(/android/i),Ql=Xl(/iP(ad|od|hone)/i),tc=Xl(/chrome/i)&&Xl(/android/i),ec={capture:!1,passive:!1};function nc(t,e,n){t.addEventListener(e,n,!Yl&&ec)}function oc(t,e,n){t.removeEventListener(e,n,!Yl&&ec)}function ic(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 rc(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function sc(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&ic(t,e):ic(t,e))||o&&t===n)return t;if(t===n)break}while(t=rc(t))}return null}var ac,lc=/\s+/g;function cc(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(lc," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(lc," ")}}function dc(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 uc(t,e){var n="";if("string"==typeof t)n=t;else do{var o=dc(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 hc(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function pc(){var t=document.scrollingElement;return t||document.documentElement}function fc(t,e,n,o,i){if(t.getBoundingClientRect||t===window){var r,s,a,l,c,d,u;if(t!==window&&t.parentNode&&t!==pc()?(s=(r=t.getBoundingClientRect()).top,a=r.left,l=r.bottom,c=r.right,d=r.height,u=r.width):(s=0,a=0,l=window.innerHeight,c=window.innerWidth,d=window.innerHeight,u=window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!Yl))do{if(i&&i.getBoundingClientRect&&("none"!==dc(i,"transform")||n&&"static"!==dc(i,"position"))){var h=i.getBoundingClientRect();s-=h.top+parseInt(dc(i,"border-top-width")),a-=h.left+parseInt(dc(i,"border-left-width")),l=s+r.height,c=a+r.width;break}}while(i=i.parentNode);if(o&&t!==window){var p=uc(i||t),f=p&&p.a,m=p&&p.d;p&&(l=(s/=m)+(d/=m),c=(a/=f)+(u/=f))}return{top:s,left:a,bottom:l,right:c,width:u,height:d}}}function mc(t,e,n){for(var o=wc(t,!0),i=fc(t)[e];o;){if(!(i>=fc(o)[n]))return o;if(o===pc())break;o=wc(o,!1)}return!1}function gc(t,e,n,o){for(var i=0,r=0,s=t.children;r<s.length;){if("none"!==s[r].style.display&&s[r]!==Sd.ghost&&(o||s[r]!==Sd.dragged)&&sc(s[r],n.draggable,t,!1)){if(i===e)return s[r];i++}r++}return null}function vc(t,e){for(var n=t.lastElementChild;n&&(n===Sd.ghost||"none"===dc(n,"display")||e&&!ic(n,e));)n=n.previousElementSibling;return n||null}function bc(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===Sd.clone||e&&!ic(t,e)||n++;return n}function yc(t){var e=0,n=0,o=pc();if(t)do{var i=uc(t),r=i.a,s=i.d;e+=t.scrollLeft*r,n+=t.scrollTop*s}while(t!==o&&(t=t.parentNode));return[e,n]}function wc(t,e){if(!t||!t.getBoundingClientRect)return pc();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=dc(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return pc();if(o||e)return n;o=!0}}}while(n=n.parentNode);return pc()}function Cc(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function Ec(t,e){return function(){if(!ac){var n=arguments;1===n.length?t.call(this,n[0]):t.apply(this,n),ac=setTimeout((function(){ac=void 0}),e)}}}function xc(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function Sc(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function Oc(t,e,n){var o={};return Array.from(t.children).forEach((function(i){var r,s,a,l;if(sc(i,e.draggable,t,!1)&&!i.animated&&i!==n){var c=fc(i);o.left=Math.min(null!==(r=o.left)&&void 0!==r?r:1/0,c.left),o.top=Math.min(null!==(s=o.top)&&void 0!==s?s:1/0,c.top),o.right=Math.max(null!==(a=o.right)&&void 0!==a?a:-1/0,c.right),o.bottom=Math.max(null!==(l=o.bottom)&&void 0!==l?l:-1/0,c.bottom)}})),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var Nc="Sortable"+(new Date).getTime();function Ac(){var t,e=[];return{captureAnimationState:function(){(e=[],this.options.animation)&&[].slice.call(this.el.children).forEach((function(t){if("none"!==dc(t,"display")&&t!==Sd.ghost){e.push({target:t,rect:fc(t)});var n=Ul({},e[e.length-1].rect);if(t.thisAnimationDuration){var o=uc(t,!0);o&&(n.top-=o.f,n.left-=o.e)}t.fromRect=n}}))},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n);return-1}(e,{target:t}),1)},animateAll:function(n){var o=this;if(!this.options.animation)return clearTimeout(t),void("function"==typeof n&&n());var i=!1,r=0;e.forEach((function(t){var e=0,n=t.target,s=n.fromRect,a=fc(n),l=n.prevFromRect,c=n.prevToRect,d=t.rect,u=uc(n,!0);u&&(a.top-=u.f,a.left-=u.e),n.toRect=a,n.thisAnimationDuration&&Cc(l,a)&&!Cc(s,a)&&(d.top-a.top)/(d.left-a.left)==(s.top-a.top)/(s.left-a.left)&&(e=function(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}(d,l,c,o.options)),Cc(a,s)||(n.prevFromRect=s,n.prevToRect=a,e||(e=o.options.animation),o.animate(n,d,a,e)),e&&(i=!0,r=Math.max(r,e),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout((function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null}),e),n.thisAnimationDuration=e)})),clearTimeout(t),i?t=setTimeout((function(){"function"==typeof n&&n()}),r):"function"==typeof n&&n(),e=[]},animate:function(t,e,n,o){if(o){dc(t,"transition",""),dc(t,"transform","");var i=uc(this.el),r=i&&i.a,s=i&&i.d,a=(e.left-n.left)/(r||1),l=(e.top-n.top)/(s||1);t.animatingX=!!a,t.animatingY=!!l,dc(t,"transform","translate3d("+a+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),dc(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),dc(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){dc(t,"transition",""),dc(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),o)}}}}var _c=[],Tc={initializeByDefault:!0},jc={mount:function(t){for(var e in Tc)Tc.hasOwnProperty(e)&&!(e in t)&&(t[e]=Tc[e]);_c.forEach((function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")})),_c.push(t)},pluginEvent:function(t,e,n){var o=this;this.eventCanceled=!1,n.cancel=function(){o.eventCanceled=!0};var i=t+"Global";_c.forEach((function(o){e[o.pluginName]&&(e[o.pluginName][i]&&e[o.pluginName][i](Ul({sortable:e},n)),e.options[o.pluginName]&&e[o.pluginName][t]&&e[o.pluginName][t](Ul({sortable:e},n)))}))},initializePlugins:function(t,e,n,o){for(var i in _c.forEach((function(o){var i=o.pluginName;if(t.options[i]||o.initializeByDefault){var r=new o(t,e,t.options);r.sortable=t,r.options=t.options,t[i]=r,Gl(n,r.defaults)}})),t.options)if(t.options.hasOwnProperty(i)){var r=this.modifyOption(t,i,t.options[i]);void 0!==r&&(t.options[i]=r)}},getEventProperties:function(t,e){var n={};return _c.forEach((function(o){"function"==typeof o.eventProperties&&Gl(n,o.eventProperties.call(e[o.pluginName],t))})),n},modifyOption:function(t,e,n){var o;return _c.forEach((function(i){t[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[e]&&(o=i.optionListeners[e].call(t[i.pluginName],n))})),o}};var Pc=["evt"],Lc=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,i=Vl(n,Pc);jc.pluginEvent.bind(Sd)(t,e,Ul({dragEl:kc,parentEl:$c,ghostEl:Ic,rootEl:Rc,nextEl:Mc,lastDownEl:Fc,cloneEl:Wc,cloneHidden:Bc,dragStarted:td,putSortable:Vc,activeSortable:Sd.active,originalEvent:o,oldIndex:zc,oldDraggableIndex:qc,newIndex:Uc,newDraggableIndex:Hc,hideGhostForTarget:wd,unhideGhostForTarget:Cd,cloneNowHidden:function(){Bc=!0},cloneNowShown:function(){Bc=!1},dispatchSortableEvent:function(t){Dc({sortable:e,name:t,originalEvent:o})}},i))};function Dc(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,u=t.newDraggableIndex,h=t.originalEvent,p=t.putSortable,f=t.extraEventProperties;if(e=e||n&&n[Nc]){var m,g=e.options,v="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||Yl||Zl?(m=document.createEvent("Event")).initEvent(o,!0,!0):m=new CustomEvent(o,{bubbles:!0,cancelable:!0}),m.to=s||n,m.from=a||n,m.item=i||n,m.clone=r,m.oldIndex=l,m.newIndex=c,m.oldDraggableIndex=d,m.newDraggableIndex=u,m.originalEvent=h,m.pullMode=p?p.lastPutMode:void 0;var b=Ul(Ul({},f),jc.getEventProperties(o,e));for(var y in b)m[y]=b[y];n&&n.dispatchEvent(m),g[v]&&g[v].call(e,m)}}(Ul({putSortable:Vc,cloneEl:Wc,targetEl:kc,rootEl:Rc,oldIndex:zc,oldDraggableIndex:qc,newIndex:Uc,newDraggableIndex:Hc},t))}var kc,$c,Ic,Rc,Mc,Fc,Wc,Bc,zc,Uc,qc,Hc,Gc,Vc,Xc,Yc,Zc,Jc,Kc,Qc,td,ed,nd,od,id,rd=!1,sd=!1,ad=[],ld=!1,cd=!1,dd=[],ud=!1,hd=[],pd="undefined"!=typeof document,fd=Ql,md=Zl||Yl?"cssFloat":"float",gd=pd&&!tc&&!Ql&&"draggable"in document.createElement("div"),vd=function(){if(pd){if(Yl)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),bd=function(t,e){var n=dc(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=gc(t,0,e),r=gc(t,1,e),s=i&&dc(i),a=r&&dc(r),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+fc(i).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+fc(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[md]||r&&"none"===n[md]&&l+c>o)?"vertical":"horizontal"},yd=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"==ql(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},wd=function(){!vd&&Ic&&dc(Ic,"display","none")},Cd=function(){!vd&&Ic&&dc(Ic,"display","")};pd&&!tc&&document.addEventListener("click",(function(t){if(sd)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),sd=!1,!1}),!0);var Ed=function(t){if(kc){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,ad.some((function(t){var e=t[Nc].options.emptyInsertThreshold;if(e&&!vc(t)){var n=fc(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[Nc]._onDragOver(n)}}var i,r,s},xd=function(t){kc&&kc.parentNode[Nc]._isOutsideThisEl(t.target)};function Sd(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=Gl({},e),t[Nc]=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 bd(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!==Sd.supportPointer&&"PointerEvent"in window&&!Kl,emptyInsertThreshold:5};for(var o in jc.initializePlugins(this,t,n),n)!(o in e)&&(e[o]=n[o]);for(var i in yd(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&gd,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?nc(t,"pointerdown",this._onTapStart):(nc(t,"mousedown",this._onTapStart),nc(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(nc(t,"dragover",this),nc(t,"dragenter",this)),ad.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Gl(this,Ac())}function Od(t,e,n,o,i,r,s,a){var l,c,d=t[Nc],u=d.options.onMove;return!window.CustomEvent||Yl||Zl?(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||fc(e),l.willInsertAfter=a,l.originalEvent=s,t.dispatchEvent(l),u&&(c=u.call(d,l,s)),c}function Nd(t){t.draggable=!1}function Ad(){ud=!1}function _d(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 Td(t){return setTimeout(t,0)}function jd(t){return clearTimeout(t)}Sd.prototype={constructor:Sd,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(ed=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,kc):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){hd.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&hd.push(o)}}(n),!kc&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!Kl||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=sc(a,o.draggable,n,!1))&&a.animated||Fc===a)){if(zc=bc(a),qc=bc(a,o.draggable),"function"==typeof c){if(c.call(this,t,a,this))return Dc({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),Lc("filter",e,{evt:t}),void(i&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=sc(l,o.trim(),n,!1))return Dc({sortable:e,rootEl:o,name:"filter",targetEl:a,fromEl:n,toEl:n}),Lc("filter",e,{evt:t}),!0}))))return void(i&&t.cancelable&&t.preventDefault());o.handle&&!sc(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&&!kc&&n.parentNode===r){var l=fc(n);if(Rc=r,$c=(kc=n).parentNode,Mc=kc.nextSibling,Fc=n,Gc=s.group,Sd.dragged=kc,Xc={target:kc,clientX:(e||t).clientX,clientY:(e||t).clientY},Kc=Xc.clientX-l.left,Qc=Xc.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,kc.style["will-change"]="all",o=function(){Lc("delayEnded",i,{evt:t}),Sd.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!Jl&&i.nativeDraggable&&(kc.draggable=!0),i._triggerDragStart(t,e),Dc({sortable:i,name:"choose",originalEvent:t}),cc(kc,s.chosenClass,!0))},s.ignore.split(",").forEach((function(t){hc(kc,t.trim(),Nd)})),nc(a,"dragover",Ed),nc(a,"mousemove",Ed),nc(a,"touchmove",Ed),nc(a,"mouseup",i._onDrop),nc(a,"touchend",i._onDrop),nc(a,"touchcancel",i._onDrop),Jl&&this.nativeDraggable&&(this.options.touchStartThreshold=4,kc.draggable=!0),Lc("delayStart",this,{evt:t}),!s.delay||s.delayOnTouchOnly&&!e||this.nativeDraggable&&(Zl||Yl))o();else{if(Sd.eventCanceled)return void this._onDrop();nc(a,"mouseup",i._disableDelayedDrag),nc(a,"touchend",i._disableDelayedDrag),nc(a,"touchcancel",i._disableDelayedDrag),nc(a,"mousemove",i._delayedDragTouchMoveHandler),nc(a,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&nc(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(){kc&&Nd(kc),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;oc(t,"mouseup",this._disableDelayedDrag),oc(t,"touchend",this._disableDelayedDrag),oc(t,"touchcancel",this._disableDelayedDrag),oc(t,"mousemove",this._delayedDragTouchMoveHandler),oc(t,"touchmove",this._delayedDragTouchMoveHandler),oc(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?nc(document,"pointermove",this._onTouchMove):nc(document,e?"touchmove":"mousemove",this._onTouchMove):(nc(kc,"dragend",this),nc(Rc,"dragstart",this._onDragStart));try{document.selection?Td((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(t,e){if(rd=!1,Rc&&kc){Lc("dragStarted",this,{evt:e}),this.nativeDraggable&&nc(document,"dragover",xd);var n=this.options;!t&&cc(kc,n.dragClass,!1),cc(kc,n.ghostClass,!0),Sd.active=this,t&&this._appendGhost(),Dc({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Yc){this._lastX=Yc.clientX,this._lastY=Yc.clientY,wd();for(var t=document.elementFromPoint(Yc.clientX,Yc.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Yc.clientX,Yc.clientY))!==e;)e=t;if(kc.parentNode[Nc]._isOutsideThisEl(t),e)do{if(e[Nc]){if(e[Nc]._onDragOver({clientX:Yc.clientX,clientY:Yc.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=rc(e));Cd()}},_onTouchMove:function(t){if(Xc){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=Ic&&uc(Ic,!0),s=Ic&&r&&r.a,a=Ic&&r&&r.d,l=fd&&id&&yc(id),c=(i.clientX-Xc.clientX+o.x)/(s||1)+(l?l[0]-dd[0]:0)/(s||1),d=(i.clientY-Xc.clientY+o.y)/(a||1)+(l?l[1]-dd[1]:0)/(a||1);if(!Sd.active&&!rd){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(Ic){r?(r.e+=c-(Zc||0),r.f+=d-(Jc||0)):r={a:1,b:0,c:0,d:1,e:c,f:d};var u="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");dc(Ic,"webkitTransform",u),dc(Ic,"mozTransform",u),dc(Ic,"msTransform",u),dc(Ic,"transform",u),Zc=c,Jc=d,Yc=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Ic){var t=this.options.fallbackOnBody?document.body:Rc,e=fc(kc,!0,fd,!0,t),n=this.options;if(fd){for(id=t;"static"===dc(id,"position")&&"none"===dc(id,"transform")&&id!==document;)id=id.parentNode;id!==document.body&&id!==document.documentElement?(id===document&&(id=pc()),e.top+=id.scrollTop,e.left+=id.scrollLeft):id=pc(),dd=yc(id)}cc(Ic=kc.cloneNode(!0),n.ghostClass,!1),cc(Ic,n.fallbackClass,!0),cc(Ic,n.dragClass,!0),dc(Ic,"transition",""),dc(Ic,"transform",""),dc(Ic,"box-sizing","border-box"),dc(Ic,"margin",0),dc(Ic,"top",e.top),dc(Ic,"left",e.left),dc(Ic,"width",e.width),dc(Ic,"height",e.height),dc(Ic,"opacity","0.8"),dc(Ic,"position",fd?"absolute":"fixed"),dc(Ic,"zIndex","100000"),dc(Ic,"pointerEvents","none"),Sd.ghost=Ic,t.appendChild(Ic),dc(Ic,"transform-origin",Kc/parseInt(Ic.style.width)*100+"% "+Qc/parseInt(Ic.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,o=t.dataTransfer,i=n.options;Lc("dragStart",this,{evt:t}),Sd.eventCanceled?this._onDrop():(Lc("setupClone",this),Sd.eventCanceled||((Wc=Sc(kc)).removeAttribute("id"),Wc.draggable=!1,Wc.style["will-change"]="",this._hideClone(),cc(Wc,this.options.chosenClass,!1),Sd.clone=Wc),n.cloneId=Td((function(){Lc("clone",n),Sd.eventCanceled||(n.options.removeCloneOnHide||Rc.insertBefore(Wc,kc),n._hideClone(),Dc({sortable:n,name:"clone"}))})),!e&&cc(kc,i.dragClass,!0),e?(sd=!0,n._loopId=setInterval(n._emulateDragOver,50)):(oc(document,"mouseup",n._onDrop),oc(document,"touchend",n._onDrop),oc(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(n,o,kc)),nc(document,"drop",n),dc(kc,"transform","translateZ(0)")),rd=!0,n._dragStartId=Td(n._dragStarted.bind(n,e,t)),nc(document,"selectstart",n),td=!0,Kl&&dc(document.body,"user-select","none"))},_onDragOver:function(t){var e,n,o,i,r=this.el,s=t.target,a=this.options,l=a.group,c=Sd.active,d=Gc===l,u=a.sort,h=Vc||c,p=this,f=!1;if(!ud){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),s=sc(s,a.draggable,r,!0),T("dragOver"),Sd.eventCanceled)return f;if(kc.contains(t.target)||s.animated&&s.animatingX&&s.animatingY||p._ignoreWhileAnimating===s)return P(!1);if(sd=!1,c&&!a.disabled&&(d?u||(o=$c!==Rc):Vc===this||(this.lastPutMode=Gc.checkPull(this,c,kc,t))&&l.checkPut(this,c,kc,t))){if(i="vertical"===this._getDirection(t,s),e=fc(kc),T("dragOverValid"),Sd.eventCanceled)return f;if(o)return $c=Rc,j(),this._hideClone(),T("revert"),Sd.eventCanceled||(Mc?Rc.insertBefore(kc,Mc):Rc.appendChild(kc)),P(!0);var m=vc(r,a.draggable);if(!m||function(t,e,n){var o=fc(vc(n.el,n.options.draggable)),i=Oc(n.el,n.options,Ic),r=10;return e?t.clientX>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)&&!m.animated){if(m===kc)return P(!1);if(m&&r===t.target&&(s=m),s&&(n=fc(s)),!1!==Od(Rc,r,kc,e,s,n,t,!!s))return j(),m&&m.nextSibling?r.insertBefore(kc,m.nextSibling):r.appendChild(kc),$c=r,L(),P(!0)}else if(m&&function(t,e,n){var o=fc(gc(n.el,0,n.options,!0)),i=Oc(n.el,n.options,Ic),r=10;return e?t.clientX<i.left-r||t.clientY<o.top&&t.clientX<o.right:t.clientY<i.top-r||t.clientY<o.bottom&&t.clientX<o.left}(t,i,this)){var g=gc(r,0,a,!0);if(g===kc)return P(!1);if(n=fc(s=g),!1!==Od(Rc,r,kc,e,s,n,t,!1))return j(),r.insertBefore(kc,g),$c=r,L(),P(!0)}else if(s.parentNode===r){n=fc(s);var v,b,y,w=kc.parentNode!==r,C=!function(t,e,n){var o=n?t.left:t.top,i=n?t.right:t.bottom,r=n?t.width:t.height,s=n?e.left:e.top,a=n?e.right:e.bottom,l=n?e.width:e.height;return o===s||i===a||o+r/2===s+l/2}(kc.animated&&kc.toRect||e,s.animated&&s.toRect||n,i),E=i?"top":"left",x=mc(s,"top","top")||mc(kc,"top","top"),S=x?x.scrollTop:void 0;if(ed!==s&&(b=n[E],ld=!1,cd=!C&&a.invertSwap||w),v=function(t,e,n,o,i,r,s,a){var l=o?t.clientY:t.clientX,c=o?n.height:n.width,d=o?n.top:n.left,u=o?n.bottom:n.right,h=!1;if(!s)if(a&&od<c*i){if(!ld&&(1===nd?l>d+c*r/2:l<u-c*r/2)&&(ld=!0),ld)h=!0;else if(1===nd?l<d+od:l>u-od)return-nd}else if(l>d+c*(1-i)/2&&l<u-c*(1-i)/2)return function(t){return bc(kc)<bc(t)?1:-1}(e);if((h=h||s)&&(l<d+c*r/2||l>u-c*r/2))return l>d+c/2?1:-1;return 0}(t,s,n,i,C?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,cd,ed===s),0!==v){var O=bc(kc);do{O-=v,y=$c.children[O]}while(y&&("none"===dc(y,"display")||y===Ic))}if(0===v||y===s)return P(!1);ed=s,nd=v;var N=s.nextElementSibling,A=!1,_=Od(Rc,r,kc,e,s,n,t,A=1===v);if(!1!==_)return 1!==_&&-1!==_||(A=1===_),ud=!0,setTimeout(Ad,30),j(),A&&!N?r.appendChild(kc):s.parentNode.insertBefore(kc,A?N:s),x&&xc(x,0,S-x.scrollTop),$c=kc.parentNode,void 0===b||cd||(od=Math.abs(b-fc(s)[E])),L(),P(!0)}if(r.contains(kc))return P(!1)}return!1}function T(a,l){Lc(a,p,Ul({evt:t,isOwner:d,axis:i?"vertical":"horizontal",revert:o,dragRect:e,targetRect:n,canSort:u,fromSortable:h,target:s,completed:P,onMove:function(n,o){return Od(Rc,r,kc,e,n,fc(n),t,o)},changed:L},l))}function j(){T("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function P(e){return T("dragOverCompleted",{insertion:e}),e&&(d?c._hideClone():c._showClone(p),p!==h&&(cc(kc,Vc?Vc.options.ghostClass:c.options.ghostClass,!1),cc(kc,a.ghostClass,!0)),Vc!==p&&p!==Sd.active?Vc=p:p===Sd.active&&Vc&&(Vc=null),h===p&&(p._ignoreWhileAnimating=s),p.animateAll((function(){T("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(s===kc&&!kc.animated||s===r&&!s.animated)&&(ed=null),a.dragoverBubble||t.rootEl||s===document||(kc.parentNode[Nc]._isOutsideThisEl(t.target),!e&&Ed(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),f=!0}function L(){Uc=bc(kc),Hc=bc(kc,a.draggable),Dc({sortable:p,name:"change",toEl:r,newIndex:Uc,newDraggableIndex:Hc,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){oc(document,"mousemove",this._onTouchMove),oc(document,"touchmove",this._onTouchMove),oc(document,"pointermove",this._onTouchMove),oc(document,"dragover",Ed),oc(document,"mousemove",Ed),oc(document,"touchmove",Ed)},_offUpEvents:function(){var t=this.el.ownerDocument;oc(t,"mouseup",this._onDrop),oc(t,"touchend",this._onDrop),oc(t,"pointerup",this._onDrop),oc(t,"touchcancel",this._onDrop),oc(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;Uc=bc(kc),Hc=bc(kc,n.draggable),Lc("drop",this,{evt:t}),$c=kc&&kc.parentNode,Uc=bc(kc),Hc=bc(kc,n.draggable),Sd.eventCanceled||(rd=!1,cd=!1,ld=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),jd(this.cloneId),jd(this._dragStartId),this.nativeDraggable&&(oc(document,"drop",this),oc(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Kl&&dc(document.body,"user-select",""),dc(kc,"transform",""),t&&(td&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),Ic&&Ic.parentNode&&Ic.parentNode.removeChild(Ic),(Rc===$c||Vc&&"clone"!==Vc.lastPutMode)&&Wc&&Wc.parentNode&&Wc.parentNode.removeChild(Wc),kc&&(this.nativeDraggable&&oc(kc,"dragend",this),Nd(kc),kc.style["will-change"]="",td&&!rd&&cc(kc,Vc?Vc.options.ghostClass:this.options.ghostClass,!1),cc(kc,this.options.chosenClass,!1),Dc({sortable:this,name:"unchoose",toEl:$c,newIndex:null,newDraggableIndex:null,originalEvent:t}),Rc!==$c?(Uc>=0&&(Dc({rootEl:$c,name:"add",toEl:$c,fromEl:Rc,originalEvent:t}),Dc({sortable:this,name:"remove",toEl:$c,originalEvent:t}),Dc({rootEl:$c,name:"sort",toEl:$c,fromEl:Rc,originalEvent:t}),Dc({sortable:this,name:"sort",toEl:$c,originalEvent:t})),Vc&&Vc.save()):Uc!==zc&&Uc>=0&&(Dc({sortable:this,name:"update",toEl:$c,originalEvent:t}),Dc({sortable:this,name:"sort",toEl:$c,originalEvent:t})),Sd.active&&(null!=Uc&&-1!==Uc||(Uc=zc,Hc=qc),Dc({sortable:this,name:"end",toEl:$c,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){Lc("nulling",this),Rc=kc=$c=Ic=Mc=Wc=Fc=Bc=Xc=Yc=td=Uc=Hc=zc=qc=ed=nd=Vc=Gc=Sd.dragged=Sd.ghost=Sd.clone=Sd.active=null,hd.forEach((function(t){t.checked=!0})),hd.length=Zc=Jc=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":kc&&(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<i;o++)sc(t=n[o],r.draggable,this.el,!1)&&e.push(t.getAttribute(r.dataIdAttr)||_d(t));return e},sort:function(t,e){var n={},o=this.el;this.toArray().forEach((function(t,e){var i=o.children[e];sc(i,this.options.draggable,o,!1)&&(n[t]=i)}),this),e&&this.captureAnimationState(),t.forEach((function(t){n[t]&&(o.removeChild(n[t]),o.appendChild(n[t]))})),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return sc(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(void 0===e)return n[t];var o=jc.modifyOption(this,t,e);n[t]=void 0!==o?o:e,"group"===t&&yd(n)},destroy:function(){Lc("destroy",this);var t=this.el;t[Nc]=null,oc(t,"mousedown",this._onTapStart),oc(t,"touchstart",this._onTapStart),oc(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(oc(t,"dragover",this),oc(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),(function(t){t.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),ad.splice(ad.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Bc){if(Lc("hideClone",this),Sd.eventCanceled)return;dc(Wc,"display","none"),this.options.removeCloneOnHide&&Wc.parentNode&&Wc.parentNode.removeChild(Wc),Bc=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(Bc){if(Lc("showClone",this),Sd.eventCanceled)return;kc.parentNode!=Rc||this.options.group.revertClone?Mc?Rc.insertBefore(Wc,Mc):Rc.appendChild(Wc):Rc.insertBefore(Wc,kc),this.options.group.revertClone&&this.animate(kc,Wc),dc(Wc,"display",""),Bc=!1}}else this._hideClone()}},pd&&nc(document,"touchmove",(function(t){(Sd.active||rd)&&t.cancelable&&t.preventDefault()})),Sd.utils={on:nc,off:oc,css:dc,find:hc,is:function(t,e){return!!sc(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},throttle:Ec,closest:sc,toggleClass:cc,clone:Sc,index:bc,nextTick:Td,cancelNextTick:jd,detectDirection:bd,getChild:gc,expando:Nc},Sd.get=function(t){return t[Nc]},Sd.mount=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e[0].constructor===Array&&(e=e[0]),e.forEach((function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(Sd.utils=Ul(Ul({},Sd.utils),t.utils)),jc.mount(t)}))},Sd.create=function(t,e){return new Sd(t,e)},Sd.version="1.15.3";var Pd,Ld,Dd,kd,$d,Id,Rd=[],Md=!1;function Fd(){Rd.forEach((function(t){clearInterval(t.pid)})),Rd=[]}function Wd(){clearInterval(Id)}var Bd=Ec((function(t,e,n,o){if(e.scroll){var i,r=(t.touches?t.touches[0]:t).clientX,s=(t.touches?t.touches[0]:t).clientY,a=e.scrollSensitivity,l=e.scrollSpeed,c=pc(),d=!1;Ld!==n&&(Ld=n,Fd(),Pd=e.scroll,i=e.scrollFn,!0===Pd&&(Pd=wc(n,!0)));var u=0,h=Pd;do{var p=h,f=fc(p),m=f.top,g=f.bottom,v=f.left,b=f.right,y=f.width,w=f.height,C=void 0,E=void 0,x=p.scrollWidth,S=p.scrollHeight,O=dc(p),N=p.scrollLeft,A=p.scrollTop;p===c?(C=y<x&&("auto"===O.overflowX||"scroll"===O.overflowX||"visible"===O.overflowX),E=w<S&&("auto"===O.overflowY||"scroll"===O.overflowY||"visible"===O.overflowY)):(C=y<x&&("auto"===O.overflowX||"scroll"===O.overflowX),E=w<S&&("auto"===O.overflowY||"scroll"===O.overflowY));var _=C&&(Math.abs(b-r)<=a&&N+y<x)-(Math.abs(v-r)<=a&&!!N),T=E&&(Math.abs(g-s)<=a&&A+w<S)-(Math.abs(m-s)<=a&&!!A);if(!Rd[u])for(var j=0;j<=u;j++)Rd[j]||(Rd[j]={});Rd[u].vx==_&&Rd[u].vy==T&&Rd[u].el===p||(Rd[u].el=p,Rd[u].vx=_,Rd[u].vy=T,clearInterval(Rd[u].pid),0==_&&0==T||(d=!0,Rd[u].pid=setInterval(function(){o&&0===this.layer&&Sd.active._onTouchMove($d);var e=Rd[this.layer].vy?Rd[this.layer].vy*l:0,n=Rd[this.layer].vx?Rd[this.layer].vx*l:0;"function"==typeof i&&"continue"!==i.call(Sd.dragged.parentNode[Nc],n,e,t,$d,Rd[this.layer].el)||xc(Rd[this.layer].el,n,e)}.bind({layer:u}),24))),u++}while(e.bubbleScroll&&h!==c&&(h=wc(h,!1)));Md=d}}),30),zd=function(t){var e=t.originalEvent,n=t.putSortable,o=t.dragEl,i=t.activeSortable,r=t.dispatchSortableEvent,s=t.hideGhostForTarget,a=t.unhideGhostForTarget;if(e){var l=n||i;s();var c=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,d=document.elementFromPoint(c.clientX,c.clientY);a(),l&&!l.el.contains(d)&&(r("spill"),this.onSpill({dragEl:o,putSortable:n}))}};function Ud(){}function qd(){}Ud.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var o=gc(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(e,o):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:zd},Gl(Ud,{pluginName:"revertOnSpill"}),qd.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable||this.sortable;n.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),n.animateAll()},drop:zd},Gl(qd,{pluginName:"removeOnSpill"}),Sd.mount(new function(){function t(){for(var t in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){var e=t.originalEvent;this.sortable.nativeDraggable?nc(document,"dragover",this._handleAutoScroll):this.options.supportPointer?nc(document,"pointermove",this._handleFallbackAutoScroll):e.touches?nc(document,"touchmove",this._handleFallbackAutoScroll):nc(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?oc(document,"dragover",this._handleAutoScroll):(oc(document,"pointermove",this._handleFallbackAutoScroll),oc(document,"touchmove",this._handleFallbackAutoScroll),oc(document,"mousemove",this._handleFallbackAutoScroll)),Wd(),Fd(),clearTimeout(ac),ac=void 0},nulling:function(){$d=Ld=Pd=Md=Id=Dd=kd=null,Rd.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,e){var n=this,o=(t.touches?t.touches[0]:t).clientX,i=(t.touches?t.touches[0]:t).clientY,r=document.elementFromPoint(o,i);if($d=t,e||this.options.forceAutoScrollFallback||Zl||Yl||Kl){Bd(t,this.options,r,e);var s=wc(r,!0);!Md||Id&&o===Dd&&i===kd||(Id&&Wd(),Id=setInterval((function(){var r=wc(document.elementFromPoint(o,i),!0);r!==s&&(s=r,Fd()),Bd(t,n.options,r,e)}),10),Dd=o,kd=i)}else{if(!this.options.bubbleScroll||wc(r,!0)===pc())return void Fd();Bd(t,this.options,wc(r,!1),!1)}}},Gl(t,{pluginName:"scroll",initializeByDefault:!0})}),Sd.mount(qd,Ud);const Hd={add:{attr:t=>{const e=window.prompt(t.message.attr);if(e&&t.isDisabled(e))return window.alert(oe.get("attributeNotPermitted",e||"")),Gd.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:Ts}},Gd={init:function(t){const e=Object.keys(Hd);return this.opts=e.reduce(((e,n)=>(e[n]={...Hd[n],...t[n]},e)),t),this},add:{attrs:t=>Gd.opts.add.attr(t),options:t=>Gd.opts.add.option(t),conditions:t=>(t.template={if:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],then:[{target:"",targetProperty:"",assignment:"",value:""}]},Gd.opts.add.condition(t))},click:{btn:t=>Gd.opts.click.btn(t)},save:{form:t=>(Gd.opts.sessionStorage&&Os.set(Fe,t),wa.formeoSaved({formData:t}),Gd.opts.save.form(t))}},Vd=Object.freeze({type:"field",displayType:"slider"}),Xd=t=>({transform:`translateX(${t?`${t}px`:0})`});class Yd{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=ch.getStyle(this.currentPanel,"height");return t.height=e,e})),this.opts=Cs(Vd,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)}),Ue)}getPanelDisplay(){const t=this.panelsWrap,e=Number.parseInt(ch.getStyle(t,"width"))>390?"tabbed":"slider",n="auto"===this.opts.displayType;return this.panelDisplay=n?e:this.opts.displayType||Vd.displayType,this.panelDisplay}createPanelsWrap(){const t=ch.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 ma.forEach(e,(t=>{t.fieldId=this.opts.id,t.isSortable&&Sd.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=la(t.target,t.target.parentElement);this.nav.setTranslateX(e,!1),this.nav.groupChange(e)}},content:t.config.label}))),e={className:"panel-labels",content:{content:t}},[n]=t;return n.className="active-tab",ch.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:ch.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:ch.icon("triangle-left")};return ch.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=n.children,i=this.currentPanel.parentElement.childNodes;this.activePanelIndex=la(this.currentPanel,e);let r={nav:0,panel:0},s={...r};t.groupChange=t=>(this.activePanelIndex=t,this.currentPanel=i[t],ch.removeClasses(i,"active-panel"),ch.removeClasses(o,"active-tab"),this.currentPanel.classList.add("active-panel"),o[t].classList.add("active-tab"),this.currentPanel);const a=({offset:t,reset:o,duration:i=ze,animate:r=!this.isTabbed})=>{const a=[Xd(s.panel),Xd(t.panel)],l=[Xd(s.nav),Xd(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:r?i:0,fill:"forwards"},d=e.animate(a,c);n.animate(l,c);const u=()=>{this.panelsWrap.style.height=ch.getStyle(this.currentPanel,"height"),d.removeEventListener("finish",u),o||(s=t)};d.addEventListener("finish",u)};return t.setTranslateX=(t=this.activePanelIndex,o=!0)=>{var i;i=t,r={nav:-n.offsetWidth*i,panel:-e.offsetWidth*i},a({offset:r,animate:o})},t.refresh=(e=this.activePanelIndex)=>{this.activePanelIndex!==e&&t.groupChange(e),t.setTranslateX(this.activePanelIndex,!1),this.resizePanels()},t.nextGroup=()=>{const e=this.activePanelIndex+1;if(e!==i.length){const o=i[e];r={nav:-n.offsetWidth*e,panel:-o.offsetLeft},a({offset:r}),t.groupChange(e)}else r={nav:s.nav-8,panel:s.panel-8},a({offset:r,reset:!0});return this.currentPanel},t.prevGroup=()=>{if(0!==this.activePanelIndex){const e=this.activePanelIndex-1,o=i[e];r={nav:-n.offsetWidth*e,panel:-o.offsetLeft},a({offset:r}),t.groupChange(e)}else r={nav:8,panel:8},a({offset:r,reset:!0})},t}}const Zd="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`)),Jd=new RegExp(`(?!${Zd.join("|")})\\w\\S*`,"g"),Kd=/\s+/g;function Qd(t){if("string"!=typeof t)return t;if(t.trim().match(Kd))return t;return t.replace(Jd,(t=>t.charAt(0).toUpperCase()+t.substring(1).replace(/[A-Z]/g,(t=>` ${t}`))))}const tu=(t,e="-")=>t.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,e),eu="f-autocomplete",nu="highlight-component";let ou,iu=Date.now();const ru=({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("."))||Qd(t.join(" ")))(t,e);class su{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=ch.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=ch.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)}const n=t.target.value.trim();this.hiddenField.value=n,this.value=n}};return this.displayField=ch.create({tag:"input",autocomplete:"off",action:e,attrs:{type:"text",className:`${eu}-display-field`,value:this.label||this.value,placeholder:oe.get(`${this.i18nKey}.${this.key}.placeholder`)}}),this.hiddenField=ch.create({tag:"input",attrs:{type:"hidden",className:this.className,value:this.value}}),this.list=ch.create({tag:"ul",attrs:{className:`${eu}-list`}}),this.dom=ch.create({children:[this.displayField,this.hiddenField,this.list],className:this.className,action:{onRender:()=>{const t=this.value&&sh.getAddress(this.value);this.label=t&&ru(t),this.label&&(this.displayField.value=this.label),this.updateOptions()}}}),this.dom}updateOptions(){const t=Date.now();t-iu>Ue&&(ch.empty(this.list),this.generateOptions(),iu=t);const e=ou||this.generateOptions();for(const n of e)this.list.appendChild(n)}generateOptions(){const t=(t=>{const e=[],n=sh.flatList(),o=Object.entries(n).map((([n,o])=>{const i=ru(o);if(i){const r={tag:"span",content:` ${Qd(o.name)}`,className:"component-type"},s=`${o.name}.${i}`;e.push(s);const a=((t,e)=>{const n=t.reduce(((t,n)=>t+(n===e)),0);return n>1?`(${n})`:""})(e,s),l=[`${i} `,{tag:"span",content:a,className:"component-label-count"},r];return(({id:t,textLabel:e,htmlLabel:n,selectedId:o})=>{const i={value:t,textLabel:e,htmlLabel:n};return t===o&&(i.selected=!0),i})({id:n,textLabel:[i,a].join(" ").trim(),htmlLabel:l,selectedId:t})}}));return o.filter(Boolean)})(),e=t=>{const e=`${eu}-list-item`;return t.classList.contains(e)||(t=t.parentElement),t};return ou=t.map((t=>{const{value:n,textLabel:o,htmlLabel:i}=t,r={tag:"li",children:i,dataset:{value:n,label:o},className:`${eu}-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 ch.create(r)})),ou}hideList(t=this.list){ga.slideUp(t,ze),this.removeHighlight()}showList(t,e=this.list){this.selectOption(t),ga.slideDown(e,ze)}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){var n;const o=e.querySelectorAll("li");for(const i of o){const{dataset:{value:t}}=i;if(i.classList.remove("active-option"),t){null==(n=sh.getAddress(t).dom)||n.classList.remove(nu)}}t&&(t.classList.add("active-option"),this.highlightComponent(t))}removeHighlight(){const t=document.getElementsByClassName(nu);for(const e of t)e.classList.remove(nu)}highlightComponent(t){var e;const{dataset:{value:n}}=t;if(n){null==(e=sh.getAddress(n).dom)||e.classList.add(nu)}}clearValue(){this.selectOption(null),this.displayField.value="",this.hiddenField.value="",this.value="",this.runEvent("onChange",{target:this.hiddenField})}setValue(t){const{label:e,value:n}=t.dataset;this.displayField.value=e,this.hiddenField.value=n,this.value=n,this.runEvent("onChange",{target:this.hiddenField})}addEvent(t,e){this.events.push([t,e])}runEvent(t,e){for(const[n,o]of this.events)n===t&&o(e)}}const au=(t,e)=>{const n=(t=>{const e=As(t),n={"field.property":Xe,...Ye},o=e?(i=t,sh.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(ch.create(r))}return n}),[])},lu=(t,e)=>{ch.empty(t);for(const n of e)t.add(n)},cu=({key:t,value:e,type:n="text",checked:o})=>{const i={tag:"input",attrs:{type:n,value:e,placeholder:oe.get(`${t}.placeholder`)||Qd(t)},className:t.replace(/\./g,"-"),config:{}};return o&&(i.attrs.checked=!0),i},du=t=>{const e=oe.get(t);if(e)return e;const n=t.split(".");return oe.get(n[n.length-1])},uu={autocomplete:(t,e,n)=>new su(t,e,n),string:(t,e)=>cu({key:t,value:e}),boolean:(t,e)=>cu({key:t,value:e,type:"selected"===t?"radio":"checkbox",checked:e}),number:(t,e)=>cu({key:t,value:e,type:"number"}),array:(t,e=[])=>({tag:"select",attrs:{placeholder:du(`placeholder.${t}`)},className:t.replace(/\./g,"-"),options:e}),object:t=>Object.entries(t).map((([t,e])=>uu[ch.childType(e)](t,e)))},hu=["selected","checked"],pu={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)}}),string:(t,e)=>({input:({target:{value:n}})=>{e.set(t,n)}}),number:(t,e)=>({input:({target:{value:n}})=>{e.set(t,Number(n))}}),array:(t,e)=>({change:({target:{value:n}})=>{e.set(t,n)}}),object:()=>({})};class fu{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=ca(r,Ve.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)}),Be)},o=t=>{t=Array.isArray(t)?t:[t];const e=setTimeout((()=>{t.forEach((t=>{t.dom&&(t=t.dom),t.removeAttribute("style")})),clearTimeout(e)}),Be)},i=new Map([["condition-source",t=>{const i=e("condition-sourceProperty"),r=i[0],s=As(t.value)?t.value:"field.property",a=au(s,r.value);return lu(r,a),t.value?o(i):n(i)}],["condition-target",t=>{const i=e("condition-targetProperty");return Ns(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)}]]);for(const r of t){const t=i.get(r.className);t&&t(r)}})),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=au(n||t,e),i=uu.array(`condition.${t}`);i.action={change:c,onRender:t=>c({target:t})};const r=ch.create(i);return lu(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};wa.formeoUpdated(o),sh.setAddress(a,t.value);const i=t.closest(".f-condition-row"),r=la(i);this.processConditionUIState(this.itemFieldGroups[r])},d={comparison:t=>l("comparison",t),logical:t=>l("logical",t),source:(t,e="source")=>{const o=uu.autocomplete(`condition.${e}`,t,n);return sh.setConditionMap(t,i),o.addEvent("onChange",(t=>{sh.removeConditionMap(sh.getAddress(a)),c(t),sh.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=uu.string("condition.value",t);return e.action={input:c},ch.create(e)},assignment:t=>l("assignment",t)};if(d[t])return d[t](e)})),this.itemValues=ca(Object.entries(n),hu,"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=ch.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:()=>{ga.slideUp(this.dom,250,(t=>{this.field.remove(this.itemKey),ch.remove(t),this.field.resizePanelWrap()}))}},content:ch.icon("remove")};return{className:`${this.panelName}-prop-controls prop-controls`,content:[t]}}itemInput(t,e){const n=ch.childType(e)||"string",o={config:{},attrs:{},...uu[n](t,e)},i=this.itemKey.replace(/.\d+$/,(e=>`${e}.${t}`)),r=i.split(".").filter(Number.isNaN).join(".")||t,[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&&(du(r)||Qd(r)),labelAfter:!1},o.attrs={...o.attrs,name:"checkbox"===o.attrs.type?`${a}[]`:a,id:s,disabled:this.isDisabled,locked:this.isLocked},o.action={...pu[n](i,this.field)},o}}class mu{constructor(t,n,o){e(this,"addAttribute",((t,e)=>{const n=tu(t),o=`attrs.${n}`;oe.current[o]||oe.put(o,pa(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 fu({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[e.length-1],s={...e.length?r:{},label:o};"button"!==t&&(s.value=tu(o));const a=new fu({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()})),e(this,"addCondition",(t=>{const e=`conditions.${this.field.get("conditions").length}`,n=this.props.querySelector(`.field-${e.replace(".","-")}`),o=new fu({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=ch.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 fu({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 ch.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:[{...ch.btnTemplate({content:n,title:n}),className:`add-${e}`,action:{click:n=>{const i={btnCoords:ch.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=Qd(e),s=new window.CustomEvent(`onAdd${r}`,{detail:i});Gd.add[e](i),document.dispatchEvent(s)}}}]}}}class gu extends Bl{constructor(t,n={},o){super(t,{...n,id:n.id||ws()}),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)?aa(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 da(n,(t=>t.remove())),this.dom.parentElement.removeChild(this.dom),((t,e)=>{const n=t.indexOf(e);-1!==n&&t.splice(n,1)})(sh.getAddress(`${e.name}s.${e.id}.children`),this.id),e.children.length||e.emptyClass(),"row"===e.name&&e.autoColumnWidths(),sh[`${this.name}s`].delete(this.id)})),e(this,"emptyClass",(()=>this.dom.classList.toggle("empty",!this.children.length))),e(this,"getComponentTag",(()=>ch.create({tag:"span",className:["component-tag",`${this.name}-tag`],children:[(this.isColumn||this.isField)&&ch.icon("component-corner",{className:"bottom-left"}),ch.icon(`handle-${this.name}`),Qd(this.name),(this.isColumn||this.isRow)&&ch.icon("component-corner",{className:"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[ch.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-${bs(t)}`),null==e||e.classList.remove(`hovering-${bs(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,!Xe[i]].some(Boolean)?t:e?o.set(Xe[i],e):o.get(Xe[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={...Es(this.data),id:ws()};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=>ch.create({tag:"ul",attrs:{className:"children"},children:t}))),this.id=this.data.id,this.name=t,this.config=sh[`${this.name}s`].config,Cs(this.config,n.config),this.dataPath=`${this.name}s.${this.id}.`,this.observer=new window.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:()=>{sh.stages.active.dom.classList.add(`active-hover-${this.name}`),this.dom.classList.add(...t)},mouseleave:({target:e})=>{this.dom.classList.remove(...t),sh.stages.active.dom.classList.remove(`active-hover-${this.name}`),e.removeAttribute("style")}},children:[{...ch.btnTemplate({content:ch.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`);ga.slideToggle(i,Be,t),"field"===this.name&&(ga.slideToggle(this.preview,Be,!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}`)=>({...ch.btnTemplate({content:ch.icon(t)}),className:["component-handle"]}),move:(t="move")=>({...ch.btnTemplate({content:ch.icon(t)}),className:["item-move"],meta:{id:"move"}}),edit:(t="edit")=>({...ch.btnTemplate({content:ch.icon(t)}),className:["item-edit-toggle"],meta:{id:"edit"},action:{click:t=>{this.toggleEdit()}}}),remove:(t="remove")=>({...ch.btnTemplate({content:ch.icon(t)}),className:["item-remove"],meta:{id:"remove"},action:{click:(t,e)=>{ga.slideUp(this.dom,Be,(()=>{if("column"===this.name){this.parent.autoColumnWidths(),this.remove()}else this.remove()}))}}}),clone:(t="copy")=>({...ch.btnTemplate({content:ch.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 la(this.dom)}get parentType(){return Ie.get(this.name)}get parent(){const t=this.parentType;if(!this.dom||!t)return null;const e=this.dom.closest(`.${Te[t]}`);return e&&ch.asComponent(e)}get children(){if(!this.dom)return[];const t=this.domChildren,e=$e.get(this.name);return ua(t,(t=>sh.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=ws()}=i,a=$e.get(this.name);if(!a)return null;const l=`${a}s`,c=sh.getAddress(`${l}.${s}`)||sh[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(ve)||(t=t.parentElement);const r=bs(t),s=bs(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=la(this.dom);return()=>this.parent.addChild(t,e+1)}],[2,t=>()=>this.parent.parent.addChild(t)]]),l={controls:()=>{const{controlData:t}=Ru.get(n.id),{meta:{id:e}}=t,i=e.startsWith("layout-")?e.replace(/^layout-/,""):"field",r=ra({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)();ch.remove(n);return s(t,o)},row:()=>{const t=(a.get({stage:-1,row:0,column:1}[s])||Ts)();return null==t?void 0:t({id:n.id},o)},column:()=>{const t=(a.get({stage:-2,row:-1}[s])||Ts)();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(we)&&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&&ch.onRender(this.dom,t.onRender)}set config(t){const e=ra(this.data,"meta.id"),n=[ra(t,"all"),e&&ra(t,e),ra(t,this.id)].reduce(((t,e)=>e?Cs(t,e):t),this.configVal);this.configVal=n}get config(){return this.configVal}getComponent(t){const[e,n]=t.split("."),o=sh[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===Ae.row}get isColumn(){return this.name===Ae.column}get isField(){return this.name===Ae.field}}class vu extends gu{constructor(t=Object.create(null)){super("field",{conditions:[{if:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],then:[{target:"",targetProperty:"",assignment:"",value:""}]}],...t}),e(this,"updateConditionsPanel",_s((()=>{const t=this.editPanels.find((({name:t})=>"conditions"===t));if(!t)return null;const e=t.createProps(),n=this.dom.querySelector(".field-edit-conditions");n.parentElement.replaceChild(e,n)}),Be)),e(this,"updatePreview",(()=>{if(!this.preview.parentElement)return null;this.updateLabel();const t=ch.create(this.fieldPreview(),!0);this.preview.parentElement.replaceChild(t,this.preview),this.preview=t})),e(this,"updateEditPanels",(()=>{this.editPanels=[];const t=["object","array"],e=ys([...this.config.panels.order,...Object.keys(this.data)]),n=["config","meta","action","events",...this.config.panels.disabled],o=e.filter((t=>!n.includes(t)));for(const r of o){const e=this.get(r),n=ch.childType(e);if(t.includes(n)){const t=new mu(e,r,this);this.editPanels.push(t)}}const i={panels:this.editPanels.map((({panelConfig:t})=>t)),id:this.id,displayType:"auto"};this.panels=new Yd(i),this.dom&&(this.dom.querySelector(".panel-nav").replaceWith(this.panels.panelNav),this.dom.querySelector(".panels").replaceWith(this.panels.panelsWrap))})),e(this,"toggleCheckedOptions",((t,e)=>{const n=this.get("options").map(((n,o)=>{const i=o===t;return"radio"===e?n.selected=i:n.checked=i?!n.checked:n.checked,n}));this.set("options",n)})),e(this,"isDisabledProp",((t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.disabled.concat(this.get(`config.disabled${Qd(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${Qd(e)}`)).includes(t)})),this.debouncedUpdateEditPanels=function(t,e=333){let n;return function(...o){n&&clearTimeout(n),n=setTimeout((()=>t.apply(this,o)),e)}}(this.updateEditPanels),this.label=ch.create(this.labelConfig),this.preview=ch.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:Ce},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=ch.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=sh.getConditionMap(`fields.${this.id}`);if(i)return i.updateConditionSourceLabel(`${this.name}s.${this.id}`,n?o:e)}}},e&&ch.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=ch.create(this.labelConfig);this.label.parentElement.replaceChild(t,this.label),this.label=t}get fieldEdit(){const t={className:["field-edit","slide-toggle","formeo-panels-wrap"]};this.updateEditPanels();const e=this.editPanels.length;return e&&(t.className.push(`panel-count-${e}`),t.content=[this.panels.panelNav,this.panels.panelsWrap],this.panelNav=this.panels.nav,this.resizePanelWrap=this.panels.nav.refresh),t.action={onRender:()=>{if(0===e){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",ch.remove(e)}else this.resizePanelWrap()}},ch.create(t)}get defaultPreviewActions(){return{change:t=>{const{target:e}=t,{type:n}=e;if(["checkbox","radio"].includes(n)){const t=+e.id.split("-").pop();this.toggleCheckedOptions(t,n),this.debouncedUpdateEditPanels()}},click:t=>{"true"===t.target.contentEditable&&t.preventDefault()},input:t=>{if(["input","meter","progress","button"].includes(t.target.tagName.toLowerCase()))return super.set("attrs.value",t.target.value),this.debouncedUpdateEditPanels();if(t.target.contentEditable){const e=t.target.parentElement.classList;if(e.contains("f-checkbox")||e.contains("f-radio")){const e=t.target.parentElement,n=e.parentElement,o=la(e,n);return super.set(`options[${o}].label`,t.target.innerHTML),this.debouncedUpdateEditPanels()}super.set("content",t.target.innerHTML)}}}}fieldPreview(){var t;const e=Es(this.data),{action:n={}}=Ru.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:ch.create(e,!0),action:this.defaultPreviewActions}}}const bu={js:new Set,css:new Set},yu=(t,e,n=js)=>new Promise((o=>fetch(t).then((t=>{if(!t.ok)return o(n(t));o(e?e(t):t)})).catch((t=>n(t))))),wu=(t,e)=>{t.removeEventListener("load",wu),e(t.src)},Cu=(t,e)=>{t.removeEventListener("load",Cu),e(t.src)},Eu=t=>new Promise(((e,n)=>{if(bu.js.has(t))return e(t);bu.js.add(t);const o=ch.create({tag:"script",attrs:{type:"text/javascript",async:!0,src:t},action:{load:()=>Cu(o,e),error:()=>n(new Error(`${t} failed to load.`))}});document.head.appendChild(o)})),xu=t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>new Promise(((e,n)=>{if(bu.css.has(t))return e(t);bu.css.add(t);const o=ch.create({tag:"link",attrs:{rel:"stylesheet",href:t},action:{load:()=>wu(o,e),error:()=>n(new Error(`${(void 0).src} failed to load.`))}});document.head.appendChild(o)}))));return Promise.all(e)},Su=async(t=fe)=>{if(document.getElementById(he))return;const e=async t=>(t=>{let e=document.getElementById(he);return e||(e=ch.create({id:he,children:t,attrs:{hidden:!0,style:"display: none;"}}),document.body.insertBefore(e,document.body.childNodes[0])),e})(await t.text());return yu(t,e,(()=>yu(me,e)))},Ou={js:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>Eu(t)));return Promise.all(e)},css:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>xu(t)));return Promise.all(e)}},Nu=t=>{const e=Object.entries(t).map((([t,e])=>Ou[t](e)));return Promise.all(e)},Au=()=>{const t=document.getElementById(he);return"hidden"===window.getComputedStyle(t).visibility};class _u{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||ws()}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:ch.icon(t.icon)},n],action:{focus:({target:t})=>{const e=t.closest(`.${ve}`);return e&&Ru.panels.nav.refresh(la(e))},click:({target:t})=>{Ru.addElement(t.parentElement.id)}}};return ch.create({tag:"li",id:this.id,className:["field-control",`${t.group}-control`,`${t.id}-control`],content:o,meta:t,action:this.controlAction})}promise(){return Nu(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 Tu=[{config:{label:"row"},meta:{group:"layout",icon:"rows",id:"layout-row"}},{config:{label:"column"},meta:{group:"layout",icon:"columns",id:"layout-column"}}];const ju=(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:Qd(t),count:e}),value:`${t}-${e}`,[n]:!e}}));const Pu=[class extends _u{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=>({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 _u{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 _u{constructor(){super({tag:"input",attrs:{type:"hidden",value:""},config:{label:oe.get("hidden"),hideLabel:!0},meta:{group:"common",icon:"hidden",id:"hidden"}})}},class extends _u{constructor(){super({tag:"input",attrs:{type:"number",required:!1,className:""},config:{label:oe.get("number")},meta:{group:"common",icon:"hash",id:"number"}})}},class extends _u{constructor(){super({tag:"textarea",config:{label:oe.get("controls.form.textarea")},meta:{group:"common",icon:"textarea",id:"textarea"},attrs:{required:!1}})}},class extends _u{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 _u{constructor(){super({tag:"input",attrs:{type:"file",required:!1},config:{label:oe.get("fileUpload")},meta:{group:"common",icon:"upload",id:"upload"}})}},class extends _u{constructor(){super({tag:"select",config:{label:oe.get("controls.form.select")},attrs:{required:!1,className:""},meta:{group:"common",icon:"select",id:"select"},options:ju("option")})}},class extends _u{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:ju("checkbox",1)})}},class extends _u{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:ju("radio")})}}],Lu=Array.from(Array(5).keys()).slice(1).map((t=>`h${t}`)),Du="controls.html.header";const ku=[class extends _u{constructor(){super({tag:Lu[0],attrs:{tag:Lu.map(((t,e)=>({label:t.toUpperCase(),value:t,selected:!e}))),className:""},config:{label:oe.get(Du),hideLabel:!0,editableContent:!0},meta:{group:"html",icon:"header",id:"html.header"},content:oe.get(Du),action:{}})}static get definition(){return{i18n:{"en-US":{header:"Custom English Header"}}}}get content(){return super.i18n(Du)}},class extends _u{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 _u{constructor(){super({tag:"hr",config:{label:oe.get("controls.html.divider"),hideLabel:!0},meta:{group:"html",icon:"divider",id:"divider"}})}},class extends _u{constructor(t){super(Cs({tag:"textarea",config:{label:"WYSIWYG",editableContent:!0},meta:{group:"html",icon:"rich-text",id:"tinymce"},attrs:{required:!1},dependencies:{js:"https://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))}}],$u=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"}}),Iu=[...Pu,...ku,...Tu];const Ru=new class{constructor(){e(this,"groupLabel",(t=>oe.get(t)||t||"")),e(this,"addElement",(t=>{const e=ra(this.get(t),"controlData"),{meta:{group:n,id:o}}=e,i={row:()=>Qu.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}=Cs($u,t);return this.container=e,this.groupOrder=ys(o.concat(["common","html","layout"])),this.options=i,Promise.all(this.registerControls([...Iu,...n]))})),this.data=new Map,this.buttonActions={focus:({target:t})=>{const e=t.closest(`.${ve}`);return e&&this.panels.nav.refresh(la(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 _u(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=ca(t,this.groupOrder,"id"),t=t.filter((t=>vs(t.id,this.options.disable.groups))),n=t.map((t=>{const n={tag:"ul",attrs:{className:ve,id:`${t.id}-${ve}`},config:{label:this.groupLabel(t.label)}};if(this.options.elementOrder[t.id]){const e=this.options.elementOrder[t.id],n=ys(e.concat(t.elementOrder));t.elementOrder=n}return e=ca(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=[vs(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=Es(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 Es(this.data.get(t))}formActions(){if(!0===this.options.disable.formActions)return null;const t={...ch.btnTemplate({content:[ch.icon("bin"),oe.get("clear")],title:oe.get("clearAll")}),className:["clear-form"],action:{click:t=>{th.size?(wa.confirmClearAll=new window.CustomEvent("confirmClearAll",{detail:{confirmationMessage:oe.get("confirmClearAll"),clearAllAction:()=>{Qu.clearAll().then((()=>{const e={src:t.target};wa.formeoCleared(e)}))},btnCoords:ch.coords(t.target)}}),document.dispatchEvent(wa.confirmClearAll)):window.alert(oe.get("cannotClearFields"))}}},e={...ch.btnTemplate({content:[ch.icon("floppy-disk"),oe.get("save")],title:oe.get("save")}),className:["save-form"],action:{click:({target:t})=>{const{formData:e}=sh,n={action:()=>{},coords:ch.coords(t),message:"",button:t};return Gd.click.btn(n),Gd.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 Yd({panels:e,type:"controls",displayType:o});const i=["control-groups","formeo-panels-wrap",`panel-count-${e.length}`],r=ch.create({className:i,content:[this.panels.panelNav,this.panels.panelsWrap]}),s=["formeo-controls"];t&&s.push("formeo-sticky");const a=ch.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(ch.toggleElementsByStr(n,t),e){const e=oe.get("controls.filteringTerm",t);a.classList.add("filtered"),o?o.textContent=e:(o=ch.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),Sd.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 vu(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 Mu extends Bl{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?ra(this.data,t):this.add())),e(this,"add",((t,e=Object.create(null))=>{const n=t||ws(),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=Cs(this.configVal,Es(t))}get config(){return this.configVal}}class Fu extends gu{constructor(t,e){super("stage",{...Object.freeze({children:[]}),...t},e);const n=this.createChildWrap();this.dom=ch.create({attrs:{className:[be,"empty"],id:this.id},children:n}),Sd.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:()=>{Wu.active=this},onSort:this.onSort.bind(this),draggable:`.${ye}`,handle:".item-move"})}empty(t=!0){return new Promise((e=>{t?(this.dom.classList.add("removing-all-fields"),ga.slideUp(this.dom,Be,(()=>{e(super.empty(t)),this.dom.classList.remove("removing-all-fields"),ga.slideDown(this.dom,Be)}))):e(super.empty())}))}onAdd(...t){const e=super.onAdd(...t);e&&"column"===e.name&&e.parent.autoColumnWidths()}}const Wu=new class extends Mu{constructor(t){super("stages",t)}Component(t){return new Fu(t)}};class Bu extends gu{constructor(t){super("row",{...Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[ye]}),...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(Je);const t=n.dom,o=Ss(e);n.set("config.width",o),t.style.width=o,t.dataset.colWidth=o;const i=setTimeout((()=>{clearTimeout(i),n.refreshFieldPanels()}),ze);document.dispatchEvent(wa.columnResized)}this.updateColumnPreset()})),e(this,"updateColumnPreset",(()=>{this.columnPresetControl.innerHTML="";const t=this.getColumnPresetOptions.map((({label:t,...e})=>ch.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=ch.create({tag:"li",className:[ye,"empty"],dataset:{hoverTag:oe.get("row"),editingHoverTag:oe.get("editing.row")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),this.editWindow,n]}),Sd.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:`.${we}`,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:"Title"},config:{label:{children:["Row Title",{tag:"span",content:" ⓘ",dataset:{tooltip:"Row title will be used as the legend for the fieldset"}}]}},action:{input:({target:{value:t}})=>this.set("config.legend",t)},className:""}},o=ch.formGroup([t,n]),i={tag:"label",content:oe.get("defineColumnWidths"),className:"col-sm-4 form-control-label"};this.columnPresetControl=ch.create(this.columnPresetControlConfig);const r={className:"col-sm-8",content:this.columnPresetControl,action:{onRender:()=>{this.updateColumnPreset()}}},s=[e,"hr",o,"hr",ch.formGroup([i,r],"row")];return ch.create({className:`${this.name}-edit group-config`,action:{onRender:t=>{const e=s.map((t=>ch.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=Re.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:Ee}),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:xe},action:{change:({target:t})=>{const{value:e}=t;this.setColumnWidths(e)}},options:this.getColumnPresetOptions}}}const zu={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}};const Uu=new class extends Mu{constructor(t){super("rows",t),this.config={all:zu}}Component(t){return new Bu(t)}};class qu{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=ch.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(`.${ye}`);if(this.validateResizeTarget(e,n))if(this.startX="touchstart"===t.type?t.touches[0].clientX:t.clientX,o.classList.add(Se),this.columnPreset=o.querySelector(`.${xe}`),this.originalColumnClass=e.className,this.originalSiblingClass=n.className,e.className=e.className.replace(Je,""),n.className=n.className.replace(Je,""),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(xs(e,this.rowWidth)),i=parseFloat(xs(n,this.rowWidth));return o<10||i<10?null:{colWidth:Ss(o.toFixed(1)),siblingColWidth:Ss(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(),sh.setAddress(`columns.${t.id}.config.width`,t.dataset.colWidth),sh.setAddress(`columns.${e.id}.config.width`,e.dataset.colWidth),this.row.classList.remove(Se),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(Se),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const t=this.columnPreset;let e=t.querySelector(`.${Ee}`);const n=this.row.querySelector(".children").children,o=ua(n,(t=>xs(t.clientWidth,this.rowWidth).toFixed(1))),i=o.join(","),r=o.join(" | ");return e||(e=ch.create({tag:"option",attrs:{className:Ee,value:i,selected:!0},content:r}),t.append(e)),e.value=i,e.textContent=r,i}}const Hu=t=>({className:"resize-x-handle",action:{pointerdown:t.onStart.bind(t)},content:[ch.icon("triangle-down"),ch.icon("triangle-up")]}),Gu=()=>({className:"column-edit group-config"});class Vu extends gu{constructor(t){super("column",{...Object.freeze({config:{width:"100%"},children:[],className:[we]}),...t}),e(this,"refreshFieldPanels",(()=>{for(const t of this.children)t.panels.nav.refresh()})),e(this,"setDomWidth",(t=>{this.dom.dataset.colWidth=t,this.dom.style.width=t})),e(this,"setWidth",(t=>(this.setDomWidth(t),this.set("config.width",t))));const n=this.createChildWrap();this.dom=ch.create({tag:"li",className:[we,"empty"],dataset:{hoverTag:oe.get("column")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),Gu(),Hu(new qu),n]}),this.processConfig(),wa.columnResized=new window.CustomEvent("columnResized",{detail:{column:this.dom,instance:this}}),Sd.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:`.${Ce}`,handle:".item-move"})}processConfig(){const t=ma.get(this.data,"config.width");t&&this.setDomWidth(t)}}const Xu={actionButtons:{buttons:["clone","move","remove"],disabled:[]}};const Yu=new class extends Mu{constructor(t){super("columns",t),this.config={all:Xu}}Component(t){return new Vu(t)}},Zu={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}};const Ju=new class extends Mu{constructor(t){super("fields",t),e(this,"get",(t=>{let e=t&&ra(this.data,t);if(!e){const n=Ru.get(t);n&&(e=this.add(null,n.controlData))}return e})),e(this,"getData",(()=>Object.entries(this.data).reduce(((t,[e,n])=>{const{conditions:o,...i}=(null==n?void 0:n.getData())||n;if(null==o?void 0:o.length){let t=!0;if(1===o.length){const[e]=o;t=Boolean(e.if[0].source&&e.then[0].target)}t&&(i.conditions=o)}return t[e]=i,t}),{}))),this.config={all:Zu}}Component(t){return new vu(t)}};const Ku=new class extends Mu{constructor(t){super("externals",t)}Component(t){return new gu("external",t)}},Qu=Wu,th=Uu,eh=Yu,nh=Ju,oh=Ru,ih=Ku,rh={id:ws()};const sh=new class extends Bl{constructor(t){super("components"),e(this,"sessionFormData",(()=>{var t;if(null==(t=this.opts)?void 0:t.sessionStorage)return Os.get(Fe)})),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={[ws()]:{}},rows:i,columns:r,fields:s,id:a=ws()}={...this.sessionFormData(),...n};this.set("id",a),this.add("stages",Qu.load(o)),this.add("rows",th.load(i)),this.add("columns",eh.load(r)),this.add("fields",nh.load(s)),this.add("externals",ih.load(e.external));for(const l of Object.values(this.get("stages")))l.loadChildren();return this.data})),this.opts=t,this.data=rh,this.disableEvents=!0,this.stages=Qu,this.rows=th,this.columns=eh,this.fields=nh,this.controls=oh,this.externals=ih}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({$schema:`https://cdn.jsdelivr.net/npm/formeo@${ue}/dist/formData_schema.json`,...this.formData})}get formData(){return{id:this.get("id"),stages:Wu.getData(),rows:Uu.getData(),columns:Yu.getData(),fields:Ju.getData()}}set config(t){const{stages:e,rows:n,columns:o,fields:i}=t;Qu.config=e,th.config=n,eh.config=o,nh.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(!Ns(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(Ns(t)){const e=t.split(".");return e.every((t=>Boolean(t)))&&this[e[0]].conditionMap.get(e[1])}}setConditionMap(t,e){if(Ns(t)){const n=t.split(".");return n.every((t=>Boolean(t)))&&this[n[0]].conditionMap.set(n[1],e)}}removeConditionMap(t){if(Ns(t)){const e=t.split(".");return e.every((t=>Boolean(t)))&&this[e[0]].conditionMap.delete(e[1])}}},ah={glyphicons:t=>`<span class="glyphicon glyphicon-${t}" aria-hidden="true"></span>`,"font-awesome":t=>{const[e,n]=t.split(" ");return`<i class="${e} fa-${n}"></i>`},fontello:t=>`<i class="${Ke}${t}">${t}</i>`},lh=new Set(["input","textarea","select"]);const ch=new class{constructor(t=Object.create(null)){e(this,"render",(t=>(t.id=`f-${t.id||ws()}`,this.create(t)))),e(this,"create",((t,e=!1)=>{if(!t)return;const n=this,o=["children","content"],{className:i,options:r,dataset:s,...a}=this.processTagName(t);let l;o.push("tag");const{tag:c}=a;let d;const u={attrs:{},className:[ma.get(a,"config.inputWrap")||"f-field-group"],children:[],config:{}};let h=document.createElement(c);const p={string:t=>{h.innerHTML+=t},object:t=>t&&h.appendChild(n.create(t,e)),node:t=>h.appendChild(t),component:t=>h.appendChild(t.dom),array:t=>{for(const e of t)l=n.childType(e),p[l](e)},function:t=>{t=t(),l=n.childType(t),p[l](t)},undefined:()=>null,boolean:()=>null};if(i&&(a.attrs=Cs(a.attrs,{className:i})),r){const t=this.processOptions(r,a,e);if(!this.holdsContent(h)||"button"===c)return ma.forEach(t,(t=>{u.children.push(n.create(t,e))})),a.attrs.className&&(u.className=a.attrs.className),u.config={...a.config},this.create(u,e);p.array.call(this,t),a.content=void 0,o.push("options")}if(a.attrs&&(n.processAttrs(a,h,e),o.push("attrs")),a.config){if(a.config.label&&(a.config.label&&"button"!==c||["radio","checkbox"].includes(ma.get(a,"attrs.type")))&&!e){const t=n.label(a);if(!a.config.hideLabel){const e=[t,h];n.labelAfter(a)&&e.reverse(),u.children.push(e)}}o.push("config")}if(a.content||a.children){const t=a.content||a.children;l=n.childType(t),p[l],p[l].call(this,t)}if(s){for(const t in s)Object.hasOwn(s,t)&&(h.dataset[t]="function"==typeof s[t]?s[t]():s[t]);o.push("dataset")}a.action&&(this.actionHandler(h,a.action),o.push("action"));const f=ma.subtract(o,Object.keys(a));for(d=f.length-1;d>=0;d--)h[f[d]]=a[f[d]];return u.children.length&&(h=this.create(u)),h})),e(this,"onRender",((t,e)=>{t.parentElement?e(t):window.requestAnimationFrame((()=>this.onRender(t,e)))})),e(this,"toggleElementsByStr",((t,e)=>{const n=[];return ch.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 da(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,"requiredMark",(()=>({tag:"span",className:"text-error",children:"*"}))),e(this,"removeEmpty",(t=>{const e=t.parentElement,n=bs(t),o=e.getElementsByClassName(`formeo-${n}`);if(this.remove(t),!o.length)return this.isStage(e)?this.emptyClass(e):this.removeEmpty(e)})),e(this,"btnTemplate",(({title:t="",...e})=>({tag:"button",attrs:{type:"button",title:t},...e}))),e(this,"isControls",(t=>bs(t)===ve)),e(this,"isStage",(t=>bs(t)===be)),e(this,"isRow",(t=>bs(t)===ye)),e(this,"isColumn",(t=>bs(t)===we)),e(this,"isField",(t=>bs(t)===Ce)),e(this,"asComponent",(t=>sh[`${bs(t)}s`].get(t.id))),this.options=t}set setOptions(t){this.options=Cs(this.options,t)}processTagName(t){let e,n=t;if("string"==typeof n)return e=n,n={tag:e},n;if(n.attrs){const{tag:t,...o}=n.attrs;if(t)if("string"==typeof t)e=t;else{e=(t.find((t=>!0===t.selected))||t[0]).value}n.attrs=o}return n.tag=e||n.tag||"div",n}actionHandler(t,e){const n={onRender:ch.onRender,render:ch.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(`#${he} svg symbol`);return this.iconSymbols=Array.from(t).reduce(((t,e)=>{var n;return t[e.id.replace(Ke,"")]={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.cachedIcons={},this.iconSymbols}icon(t,e){var n,o;if(!t)return;const i=`${t}?${new URLSearchParams(e).toString()}`;if(null==(n=this.cachedIcons)?void 0:n[i])return this.cachedIcons[i];const r=this.icons[t];if(r){if(e){const t=Cs(r,e);return this.cachedIcons[i]=ch.create(t).outerHTML,this.cachedIcons[i]}return this.cachedIcons[i]=ch.create(r).outerHTML,this.cachedIcons[i]}return(null==(o=ah[ch.options.iconFont])?void 0:o.call(ah,t))||t}processAttrs(t,e,n){const{attrs:o={}}=t;n||o.name||!this.isInput(t.tag)||e.setAttribute("name",ws(t));for(const i of Object.keys(o)){const t=ma.safeAttrName(i),n=this.processAttrValue(o[i]);n&&e.setAttribute(t,!0===n?"":n)}}processAttrValue(t){let e=t||"";if(Array.isArray(e))if("object"==typeof e[0]){const t=e.filter((t=>!0===t.selected));e=t.length?t[0].value:e[0].value}else e=e.join(" ");return e}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},u={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||ws(),options:void 0,children:o,action:e.action}},checkbox:d,radio:d};return null==(a=u[r])?void 0:a.call(u,t)}))}holdsContent(t){return-1!==t.outerHTML.indexOf("/")}isBlockInput(t){return!this.isInput(t)&&this.holdsContent(t)}isInput(t){let e=t;return"string"!=typeof e&&(e=e.tagName),lh.has(e)}parsedHtml(t){const e=document.createElement("textarea");return e.innerHTML=t,e.textContent}labelAfter(t){const e=ma.get(t,"attrs.type"),n=ma.get(t,"config.labelAfter");return void 0!==n?n:"checkbox"===e||"radio"===e}label(t,e){const n=ma.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&&(s.attrs.for=void 0,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=bs(t);return e?sh.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,ma.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)}};ma.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");ga.slideUp(t,600,(()=>{ch.empty(t),t.classList.remove("removing-all-fields"),ch.emptyClass(t),ga.slideDown(t,300)}))}toggleSortable(t,e){let n=e;const o=bs(t);if(!o)return;const i=bs(t.parentElement),r=ch[o].get(t.id).sortable;n||(n=!r.option("disabled")),r.option("disabled",n),i&&["rows","columns","stages"].includes(i)&&this.toggleSortable(t.parentElement,n)}emptyClass(t){const e=t.getElementsByClassName(Oe.get(t.classList.item(0)));t.classList.toggle("empty",!e.length)}};const dh={"en-US":"English",dir:"ltr","af-ZA":"Afrikaans (South Africa)","ar-TN":"Arabic (Tunisia)","cs-CZ":"Czech (Czechia)","de-DE":"German (Germany)","es-ES":"European Spanish","fa-IR":"Persian (Iran)","fi-FI":"Finnish (Finland)","fr-FR":"French (France)","hu-HU":"Hungarian (Hungary)","it-IT":"Italian (Italy)","ja-JP":"Japanese (Japan)","nb-NO":"Norwegian Bokmål (Norway)","pl-PL":"Polish (Poland)","pt-BR":"Brazilian Portuguese","pt-PT":"European Portuguese","ro-RO":"Romanian (Romania)","ru-RU":"Russian (Russia)","th-TH":"Thai (Thailand)","tr-TR":"Turkish (Türkiye)","zh-CN":"Chinese (China)","zh-HK":"Chinese (Hong Kong SAR China)","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",and:"and",attribute:"Attribute",attributeNotPermitted:'Attribute "{attribute}" is not permitted, please choose another.',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",cannotClearFields:"There are no fields to clear",checkbox:"Checkbox",checkboxes:"Checkboxes",class:"Class",clear:"Clear",clearAllMessage:"Are you sure you want to clear all fields?",close:"Close",column:"Column","condition.target.placeholder":"target","condition.value.placeholder":"value",confirmClearAll:"Are you sure you want to remove all fields?",content:"Content",control:"Control","controlGroups.nextGroup":"Next Group","controlGroups.prevGroup":"Previous Group","controls.filteringTerm":'Filtering "{term}"',"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",copy:"Copy To Clipboard",danger:"Danger",defineColumnLayout:"Define a column layout",defineColumnWidths:"Define column widths",description:"Help Text",descriptionField:"Description","editing.row":"Editing Row",editorTitle:"Form Elements",field:"Field","field.property.invalid":"not valid","field.property.isNotVisible":"is not visible","field.property.isVisible":"is visible","field.property.label":"label","field.property.valid":"valid","field.property.value":"value",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","if.condition.source.placeholder":"source","if.condition.target.placeholder":"target / value",info:"Info","input.date":"Date","input.text":"Text",label:"Label",labelCount:"{label} {count}",labelEmpty:"Field Label cannot be empty","lang.af":"Afrikaans","lang.ar":"Arabic","lang.cs":"Czech","lang.de":"German","lang.en":"English","lang.es":"Spanish","lang.fa":"Persian","lang.fi":"Finnish","lang.fr":"French","lang.hu":"Hungarian","lang.it":"Italian","lang.ja":"Japanese","lang.nb":"Norwegian Bokmål","lang.pl":"Polish","lang.pt":"Portuguese","lang.ro":"Romanian","lang.ru":"Russian","lang.th":"Thai","lang.tr":"Turkish","lang.zh":"Chinese",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",newOptionLabel:"New {type}",no:"No",number:"Number",off:"Off",on:"On","operator.contains":"contains","operator.equals":"equals","operator.notContains":"not contains","operator.notEquals":"not equal","operator.notVisible":"not visible","operator.visible":"visible",option:"Option",optional:"optional",optionEmpty:"Option value required",optionLabel:"Option {count}",options:"Options",or:"or",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.conditions":"+ Condition","panelEditButtons.options":"+ Option",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",removeMessage:"Remove Element",removeType:"Remove {type}",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",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","then.condition.target.placeholder":"target",toggle:"Toggle",ungrouped:"Un-Grouped",warning:"Warning",yes:"Yes"};oe.addLanguage("en-US",dh);const uh={get editor(){return{stickyControls:!1,allowEdit:!0,dataType:"json",debug:!1,sessionStorage:!1,editorContainer:null,external:{},svgSprite:fe,style:ge,iconFont:null,config:{},events:{},actions:{},controls:{},polyfills:fa(),i18n:{location:"https://draggable.github.io/formeo/assets/lang/"}}}};let hh=class{constructor({formData:t,...e},n){const o=Cs(uh.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,ch.setOptions=c,sh.config=a,this.userFormData=n||t,this.Components=sh,this.dom=ch,wa.init({debug:s,...r}),Gd.init({debug:s,sessionStorage:c.sessionStorage,...i}),this.tooltip=new ce,document.addEventListener("DOMContentLoaded",this.loadResources.bind(this))}get formData(){return this.Components.formData}set formData(t={}){this.load({...this.userFormData,...t},this.opts)}get json(){return this.Components.json}async loadResources(){var t;document.removeEventListener("DOMContentLoaded",this.loadResources);const e=[];this.opts.polyfills&&(t=>{const e=Array.isArray(t)?pe.filter((({name:e})=>-1!==t.indexOf(e))):pe;Promise.all(e.map((({src:t})=>Eu(t))))})(this.opts.polyfills),await Su(this.opts.svgSprite),e.push((async t=>{if(!Au()&&(await xu(t),!Au()))return await xu("https://draggable.github.io/formeo/assets/css/formeo.min.css")})(this.opts.style)),e.push(oe.init({...this.opts.i18n,locale:null==(t=window.sessionStorage)?void 0:t.getItem(We)}));const n=await Promise.all(e);return this.opts.allowEdit&&this.init(),n}init(){Ru.init(this.opts.controls,this.opts.stickyControls).then((t=>{this.controls=t,this.load(this.userFormData,this.opts),this.formId=sh.get("id"),this.i18n={setLang:t=>{var e;null==(e=window.sessionStorage)||e.setItem(We,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(sh.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,ch.dir=oe.current.dir),this.editor=ch.create(t);(this.controls.container||this.editor).appendChild(this.controls.dom),this.editorContainer&&(ch.empty(this.editorContainer),this.editorContainer.appendChild(this.editor)),wa.formeoLoaded=new window.CustomEvent("formeoLoaded",{detail:{formeo:this}}),document.dispatchEvent(wa.formeoLoaded)}};const ph=t=>{const e=t.match(Ze);return(null==e?void 0:e[0])||t},fh=t=>t.replace(Ze,ws());let mh=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=ch.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[ph(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:ws(),className:i,children:s}})),e(this,"cloneComponentData",(t=>{const{children:e=[],id:n,...o}=this.components[t];return Object.assign({},o,{id:fh(n),children:e.length&&e.map((({id:t})=>this.cloneComponentData(ph(t))))})})),e(this,"addButton",(t=>ch.render({tag:"button",attrs:{className:"add-input-group btn pull-right",type:"button"},children:"Add +",action:{click:e=>{const n=e.target.parentElement,o=ch.render(this.cloneComponentData(t));n.insertBefore(o,n.lastChild),o.appendChild(ch.render(ch.btnTemplate({className:"remove-input-group",children:ch.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&&Nu(o);const i=Cs({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(Ns(e)){this.getComponents(e).forEach((t=>{const e=gh(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:Wl,notEquals:(t,e)=>!Wl(t,e),contains:(t,e)=>t.includes(e),notContains:(t,e)=>!t.includes(e)},a=String(i.target[t]),l=String(Ns(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(Ns(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 As(t)?this.external[e]:this.renderedForm.querySelector(`#f-${e}`)})),e(this,"getComponents",(t=>{const e=[],n=t.slice(t.indexOf(".")+1);return As(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=ch,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=be,ch.render(t))))}};const gh=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=hh,window.FormeoRenderer=mh);const vh=mh,bh=new hh(r);((t,e)=>{const n=((t,e)=>({renderForm:()=>{te.style.display="block",e.render(t.formData)},logJSON:()=>{},viewData:()=>{for(const[e,n]of Object.entries(t.formData));},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}))})(bh,new vh(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)})(bh);
|