formeo 4.1.4 → 4.2.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/js/demo.min.js +62 -62
- package/dist/demo/assets/js/demo.min.js.gz +0 -0
- package/dist/demo/assets/js/formeo.cjs.js +130 -29
- package/dist/demo/assets/js/formeo.es.js +130 -29
- package/dist/demo/assets/js/formeo.min.cjs.js +2 -2
- package/dist/demo/assets/js/formeo.min.es.js +3 -3
- package/dist/demo/assets/js/formeo.min.js +130 -29
- package/dist/demo/assets/js/formeo.min.umd.js +2 -2
- package/dist/demo/assets/js/formeo.umd.js +130 -29
- package/dist/demo/assets/js/index.min.js +1 -1
- package/dist/demo/assets/js/index.min2.js +1 -1
- package/dist/demo/assets/js/index.min3.js +1 -1
- package/dist/demo/assets/js/mode-json.min.js +1 -1
- package/dist/demo/assets/js/mode-json.min.js.gz +0 -0
- package/dist/demo/assets/js/theme-github_light_default.min.js +1 -1
- package/dist/demo/index.html +1 -1
- package/dist/formeo.cjs.js +130 -29
- package/dist/formeo.css +1 -1
- package/dist/formeo.es.js +130 -29
- package/dist/formeo.min.cjs.js +2 -2
- package/dist/formeo.min.css +1 -1
- package/dist/formeo.min.es.js +3 -3
- package/dist/formeo.min.js +130 -29
- package/dist/formeo.min.umd.js +2 -2
- package/dist/formeo.umd.js +130 -29
- package/package.json +2 -2
package/dist/formeo.min.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
formeo - https://formeo.io
|
|
4
|
-
Version: 4.1.
|
|
4
|
+
Version: 4.1.4
|
|
5
5
|
Author: Draggable https://draggable.io
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).formeo={})}(this,(function(t){"use strict";const e={extension:".lang",location:"assets/lang/",langs:["en-US"],locale:"en-US",override:{}};class n{constructor(t=e){this.langs=Object.create(null),this.loaded=[],this.processConfig(t)}processConfig(t){const{location:n,...o}={...e,...t},i=n.replace(/\/?$/,"/");this.config={location:i,...o};const{override:r,preloaded:s={}}=this.config,a=Object.entries(this.langs).concat(Object.entries(r||s));this.langs=a.reduce(((t,[e,n])=>(t[e]=this.applyLanguage(e,n),t)),{}),this.locale=this.config.locale||this.config.langs[0]}init(t){return this.processConfig({...this.config,...t}),this.setCurrent(this.locale)}addLanguage(t,e={}){e="string"==typeof e?n.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 n.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 o=this;return new Promise((function(i,r){if(-1!==o.loaded.indexOf(t)&&e)return o.applyLanguage(o.langs[t]),i(o.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}}([o.config.location,t,o.config.extension].join("")).then((e=>{const r=n.processFile(e);return o.applyLanguage(t,r),o.loaded.push(t),i(o.langs[t])})).catch((e=>{const n=o.applyLanguage(t);i(n)}))}))}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 o=new n;!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 i=Object.defineProperty,r=(t,e,n)=>((t,e,n)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n)(t,"symbol"!=typeof e?e+"":e,n);const s="_3x4ZIcu-",a="JIt36hCJ",l={triggerName:"tooltip"};class c{constructor(t=l){r(this,"triggerName"),r(this,"tooltip"),r(this,"activeTriggerType",null),r(this,"spacing",12),r(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()})),r(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")}})),r(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()})),r(this,"handleResize",(()=>{this.isVisible()&&this.hide()})),r(this,"handleScroll",(()=>{this.isVisible()&&this.hide()})),this.triggerName=`data-${t.triggerName}`,this.tooltip=document.createElement("div"),this.tooltip.className=`d-tooltip ${s}`,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(a)}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(s)||"none"===getComputedStyle(t).pointerEvents)return!1})).length}show(t,e){this.tooltip.innerHTML=e??"",this.tooltip.classList.add(a);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(a),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=c);const d="formeo",u="4.1.3";var h,p,f,m,g,v,b,y,w,C,E,x,S,O,_,A,T,N,P,j,D,k,L,$,I,M,R,W,F,B,z,U,q,V,H,X,Y,G,Z,J,K,Q,tt,et,nt,ot,it,rt,st,at,lt,ct,dt,ut,ht,pt,ft,mt,gt,vt,bt,yt,wt,Ct,Et,xt,St,Ot,_t,At,Tt,Nt,Pt,jt,Dt,kt,Lt,$t,It,Mt,Rt,Wt,Ft,Bt,zt,Ut,qt,Vt,Ht,Xt,Yt,Gt,Zt,Jt,Kt,Qt,te,ee,ne="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function oe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ie(){if(m)return f;return m=1,f=function(t,e){return t===e||t!=t&&e!=e}}function re(){if(v)return g;v=1;var t=ie();return g=function(e,n){for(var o=e.length;o--;)if(t(e[o][0],n))return o;return-1}}function se(){if(A)return _;A=1;var t=p?h:(p=1,h=function(){this.__data__=[],this.size=0}),e=function(){if(y)return b;y=1;var t=re(),e=Array.prototype.splice;return b=function(n){var o=this.__data__,i=t(o,n);return!(i<0||(i==o.length-1?o.pop():e.call(o,i,1),--this.size,0))}}(),n=function(){if(C)return w;C=1;var t=re();return w=function(e){var n=this.__data__,o=t(n,e);return o<0?void 0:n[o][1]}}(),o=function(){if(x)return E;x=1;var t=re();return E=function(e){return t(this.__data__,e)>-1}}(),i=function(){if(O)return S;O=1;var t=re();return S=function(e,n){var o=this.__data__,i=t(o,e);return i<0?(++this.size,o.push([e,n])):o[i][1]=n,this}}();function r(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])}}return r.prototype.clear=t,r.prototype.delete=e,r.prototype.get=n,r.prototype.has=o,r.prototype.set=i,_=r}function ae(){if(M)return I;M=1;var t="object"==typeof ne&&ne&&ne.Object===Object&≠return I=t}function le(){if(W)return R;W=1;var t=ae(),e="object"==typeof self&&self&&self.Object===Object&&self,n=t||e||Function("return this")();return R=n}function ce(){if(B)return F;B=1;var t=le().Symbol;return F=t}function de(){if(X)return H;X=1;var t=ce(),e=function(){if(U)return z;U=1;var t=ce(),e=Object.prototype,n=e.hasOwnProperty,o=e.toString,i=t?t.toStringTag:void 0;return z=function(t){var e=n.call(t,i),r=t[i];try{t[i]=void 0;var s=!0}catch(l){}var a=o.call(t);return s&&(e?t[i]=r:delete t[i]),a}}(),n=function(){if(V)return q;V=1;var t=Object.prototype.toString;return q=function(e){return t.call(e)}}(),o=t?t.toStringTag:void 0;return H=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":o&&o in Object(t)?e(t):n(t)}}function ue(){if(G)return Y;return G=1,Y=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}}function he(){if(J)return Z;J=1;var t=de(),e=ue();return Z=function(n){if(!e(n))return!1;var o=t(n);return"[object Function]"==o||"[object GeneratorFunction]"==o||"[object AsyncFunction]"==o||"[object Proxy]"==o}}function pe(){if(et)return tt;et=1;var t,e=function(){if(Q)return K;Q=1;var t=le()["__core-js_shared__"];return K=t}(),n=(t=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||""))?"Symbol(src)_1."+t:"";return tt=function(t){return!!n&&n in t}}function fe(){if(ot)return nt;ot=1;var t=Function.prototype.toString;return nt=function(e){if(null!=e){try{return t.call(e)}catch(n){}try{return e+""}catch(n){}}return""}}function me(){if(ct)return lt;ct=1;var t=function(){if(rt)return it;rt=1;var t=he(),e=pe(),n=ue(),o=fe(),i=/^\[object .+?Constructor\]$/,r=Function.prototype,s=Object.prototype,a=r.toString,l=s.hasOwnProperty,c=RegExp("^"+a.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return it=function(r){return!(!n(r)||e(r))&&(t(r)?c:i).test(o(r))}}(),e=at?st:(at=1,st=function(t,e){return null==t?void 0:t[e]});return lt=function(n,o){var i=e(n,o);return t(i)?i:void 0}}function ge(){if(ut)return dt;ut=1;var t=me()(le(),"Map");return dt=t}function ve(){if(pt)return ht;pt=1;var t=me()(Object,"create");return ht=t}function be(){if(Ot)return St;Ot=1;var t=function(){if(mt)return ft;mt=1;var t=ve();return ft=function(){this.__data__=t?t(null):{},this.size=0}}(),e=vt?gt:(vt=1,gt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}),n=function(){if(yt)return bt;yt=1;var t=ve(),e=Object.prototype.hasOwnProperty;return bt=function(n){var o=this.__data__;if(t){var i=o[n];return"__lodash_hash_undefined__"===i?void 0:i}return e.call(o,n)?o[n]:void 0}}(),o=function(){if(Ct)return wt;Ct=1;var t=ve(),e=Object.prototype.hasOwnProperty;return wt=function(n){var o=this.__data__;return t?void 0!==o[n]:e.call(o,n)}}(),i=function(){if(xt)return Et;xt=1;var t=ve();return Et=function(e,n){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=t&&void 0===n?"__lodash_hash_undefined__":n,this}}();function r(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])}}return r.prototype.clear=t,r.prototype.delete=e,r.prototype.get=n,r.prototype.has=o,r.prototype.set=i,St=r}function ye(){if(jt)return Pt;jt=1;var t=Nt?Tt:(Nt=1,Tt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t});return Pt=function(e,n){var o=e.__data__;return t(n)?o["string"==typeof n?"string":"hash"]:o.map}}function we(){if(Bt)return Ft;Bt=1;var t=function(){if(At)return _t;At=1;var t=be(),e=se(),n=ge();return _t=function(){this.size=0,this.__data__={hash:new t,map:new(n||e),string:new t}}}(),e=function(){if(kt)return Dt;kt=1;var t=ye();return Dt=function(e){var n=t(this,e).delete(e);return this.size-=n?1:0,n}}(),n=function(){if($t)return Lt;$t=1;var t=ye();return Lt=function(e){return t(this,e).get(e)}}(),o=function(){if(Mt)return It;Mt=1;var t=ye();return It=function(e){return t(this,e).has(e)}}(),i=function(){if(Wt)return Rt;Wt=1;var t=ye();return Rt=function(e,n){var o=t(this,e),i=o.size;return o.set(e,n),this.size+=o.size==i?0:1,this}}();function r(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])}}return r.prototype.clear=t,r.prototype.delete=e,r.prototype.get=n,r.prototype.has=o,r.prototype.set=i,Ft=r}function Ce(){if(Vt)return qt;Vt=1;var t=se(),e=function(){if(N)return T;N=1;var t=se();return T=function(){this.__data__=new t,this.size=0}}(),n=j?P:(j=1,P=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}),o=k?D:(k=1,D=function(t){return this.__data__.get(t)}),i=$?L:($=1,L=function(t){return this.__data__.has(t)}),r=function(){if(Ut)return zt;Ut=1;var t=se(),e=ge(),n=we();return zt=function(o,i){var r=this.__data__;if(r instanceof t){var s=r.__data__;if(!e||s.length<199)return s.push([o,i]),this.size=++r.size,this;r=this.__data__=new n(s)}return r.set(o,i),this.size=r.size,this}}();function s(e){var n=this.__data__=new t(e);this.size=n.size}return s.prototype.clear=e,s.prototype.delete=n,s.prototype.get=o,s.prototype.has=i,s.prototype.set=r,qt=s}function Ee(){if(Xt)return Ht;Xt=1;var t=me(),e=function(){try{var e=t(Object,"defineProperty");return e({},"",{}),e}catch(n){}}();return Ht=e}function xe(){if(Gt)return Yt;Gt=1;var t=Ee();return Yt=function(e,n,o){"__proto__"==n&&t?t(e,n,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[n]=o}}function Se(){if(Jt)return Zt;Jt=1;var t=xe(),e=ie();return Zt=function(n,o,i){(void 0!==i&&!e(n[o],i)||void 0===i&&!(o in n))&&t(n,o,i)}}function Oe(){if(ee)return te;ee=1;var t=(Qt?Kt:(Qt=1,Kt=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}}))();return te=t}var _e,Ae,Te,Ne,Pe,je,De,ke,Le,$e,Ie,Me,Re,We,Fe,Be,ze,Ue,qe,Ve,He,Xe,Ye,Ge,Ze,Je,Ke,Qe,tn,en,nn,on,rn,sn={exports:{}};function an(){if(Te)return Ae;Te=1;var t=le().Uint8Array;return Ae=t}function ln(){if(De)return je;De=1;var t=function(){if(Pe)return Ne;Pe=1;var t=an();return Ne=function(e){var n=new e.constructor(e.byteLength);return new t(n).set(new t(e)),n}}();return je=function(e,n){var o=n?t(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}}function cn(){if(Re)return Me;return Re=1,Me=function(t,e){return function(n){return t(e(n))}}}function dn(){if(Fe)return We;Fe=1;var t=cn()(Object.getPrototypeOf,Object);return We=t}function un(){if(ze)return Be;ze=1;var t=Object.prototype;return Be=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}}function hn(){if(qe)return Ue;qe=1;var t=function(){if(Ie)return $e;Ie=1;var t=ue(),e=Object.create;return $e=function(){function n(){}return function(o){if(!t(o))return{};if(e)return e(o);n.prototype=o;var i=new n;return n.prototype=void 0,i}}()}(),e=dn(),n=un();return Ue=function(o){return"function"!=typeof o.constructor||n(o)?{}:t(e(o))}}function pn(){if(He)return Ve;return He=1,Ve=function(t){return null!=t&&"object"==typeof t}}function fn(){if(Ze)return Ge;Ze=1;var t=function(){if(Ye)return Xe;Ye=1;var t=de(),e=pn();return Xe=function(n){return e(n)&&"[object Arguments]"==t(n)}}(),e=pn(),n=Object.prototype,o=n.hasOwnProperty,i=n.propertyIsEnumerable,r=t(function(){return arguments}())?t:function(t){return e(t)&&o.call(t,"callee")&&!i.call(t,"callee")};return Ge=r}function mn(){if(Ke)return Je;Ke=1;var t=Array.isArray;return Je=t}function gn(){if(tn)return Qe;tn=1;return Qe=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}}function vn(){if(nn)return en;nn=1;var t=he(),e=gn();return en=function(n){return null!=n&&e(n.length)&&!t(n)}}var bn,yn,wn,Cn,En,xn,Sn,On,_n,An={exports:{}};function Tn(){return wn||(wn=1,t=An,e=An.exports,n=le(),o=yn?bn:(yn=1,bn=function(){return!1}),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),An.exports;var t,e,n,o,i,r,s,a}var Nn,Pn,jn,Dn,kn,Ln,$n,In,Mn,Rn,Wn,Fn,Bn,zn,Un,qn,Vn,Hn,Xn,Yn,Gn,Zn,Jn,Kn,Qn,to,eo,no,oo,io,ro,so,ao,lo,co,uo,ho,po,fo,mo,go,vo,bo,yo,wo,Co,Eo,xo,So,Oo={exports:{}};function _o(){if(jn)return Pn;jn=1;var t=function(){if(Sn)return xn;Sn=1;var t=de(),e=gn(),n=pn(),o={};return o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,xn=function(i){return n(i)&&e(i.length)&&!!o[t(i)]}}(),e=_n?On:(_n=1,On=function(t){return function(e){return t(e)}}),n=function(){return Nn||(Nn=1,t=Oo,e=Oo.exports,n=ae(),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,r=i&&i.exports===o&&n.process,s=function(){try{return i&&i.require&&i.require("util").types||r&&r.binding&&r.binding("util")}catch(t){}}(),t.exports=s),Oo.exports;var t,e,n,o,i,r,s}(),o=n&&n.isTypedArray,i=o?e(o):t;return Pn=i}function Ao(){if(kn)return Dn;return kn=1,Dn=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}}function To(){if($n)return Ln;$n=1;var t=xe(),e=ie(),n=Object.prototype.hasOwnProperty;return Ln=function(o,i,r){var s=o[i];n.call(o,i)&&e(s,r)&&(void 0!==r||i in o)||t(o,i,r)}}function No(){if(Bn)return Fn;Bn=1;var t=/^(?:0|[1-9]\d*)$/;return Fn=function(e,n){var o=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==o||"symbol"!=o&&t.test(e))&&e>-1&&e%1==0&&e<n}}function Po(){if(Un)return zn;Un=1;var t=Wn?Rn:(Wn=1,Rn=function(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o}),e=fn(),n=mn(),o=Tn(),i=No(),r=_o(),s=Object.prototype.hasOwnProperty;return zn=function(a,l){var c=n(a),d=!c&&e(a),u=!c&&!d&&o(a),h=!c&&!d&&!u&&r(a),p=c||d||u||h,f=p?t(a.length,String):[],m=f.length;for(var g in a)!l&&!s.call(a,g)||p&&("length"==g||u&&("offset"==g||"parent"==g)||h&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||i(g,m))||f.push(g);return f}}function jo(){if(Xn)return Hn;Xn=1;var t=ue(),e=un(),n=Vn?qn:(Vn=1,qn=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}),o=Object.prototype.hasOwnProperty;return Hn=function(i){if(!t(i))return n(i);var r=e(i),s=[];for(var a in i)("constructor"!=a||!r&&o.call(i,a))&&s.push(a);return s}}function Do(){if(Gn)return Yn;Gn=1;var t=Po(),e=jo(),n=vn();return Yn=function(o){return n(o)?t(o,!0):e(o)}}function ko(){if(Jn)return Zn;Jn=1;var t=function(){if(Mn)return In;Mn=1;var t=To(),e=xe();return In=function(n,o,i,r){var s=!i;i||(i={});for(var a=-1,l=o.length;++a<l;){var c=o[a],d=r?r(i[c],n[c],c,i,n):void 0;void 0===d&&(d=n[c]),s?e(i,c,d):t(i,c,d)}return i}}(),e=Do();return Zn=function(n){return t(n,e(n))}}function Lo(){if(Qn)return Kn;Qn=1;var t,e,n,o,i,r,s,a=Se(),l=(_e||(_e=1,t=sn,e=sn.exports,n=le(),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,r=i&&i.exports===o?n.Buffer:void 0,s=r?r.allocUnsafe:void 0,t.exports=function(t,e){if(e)return t.slice();var n=t.length,o=s?s(n):new t.constructor(n);return t.copy(o),o}),sn.exports),c=ln(),d=Le?ke:(Le=1,ke=function(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}),u=hn(),h=fn(),p=mn(),f=function(){if(rn)return on;rn=1;var t=vn(),e=pn();return on=function(n){return e(n)&&t(n)}}(),m=Tn(),g=he(),v=ue(),b=function(){if(En)return Cn;En=1;var t=de(),e=dn(),n=pn(),o=Function.prototype,i=Object.prototype,r=o.toString,s=i.hasOwnProperty,a=r.call(Object);return Cn=function(o){if(!n(o)||"[object Object]"!=t(o))return!1;var i=e(o);if(null===i)return!0;var l=s.call(i,"constructor")&&i.constructor;return"function"==typeof l&&l instanceof l&&r.call(l)==a}}(),y=_o(),w=Ao(),C=ko();return Kn=function(t,e,n,o,i,r,s){var E=w(t,n),x=w(e,n),S=s.get(x);if(S)a(t,n,S);else{var O=r?r(E,x,n+"",t,e,s):void 0,_=void 0===O;if(_){var A=p(x),T=!A&&m(x),N=!A&&!T&&y(x);O=x,A||T||N?p(E)?O=E:f(E)?O=d(E):T?(_=!1,O=l(x,!0)):N?(_=!1,O=c(x,!0)):O=[]:b(x)||h(x)?(O=E,h(E)?O=C(E):v(E)&&!g(E)||(O=u(x))):_=!1}_&&(s.set(x,O),i(O,x,o,r,s),s.delete(x)),a(t,n,O)}}}function $o(){if(oo)return no;return oo=1,no=function(t){return t}}function Io(){if(ao)return so;ao=1;var t=ro?io:(ro=1,io=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)}),e=Math.max;return so=function(n,o,i){return o=e(void 0===o?n.length-1:o,0),function(){for(var r=arguments,s=-1,a=e(r.length-o,0),l=Array(a);++s<a;)l[s]=r[o+s];s=-1;for(var c=Array(o+1);++s<o;)c[s]=r[s];return c[o]=i(l),t(n,this,c)}},so}function Mo(){if(ho)return uo;ho=1;var t=co?lo:(co=1,lo=function(t){return function(){return t}}),e=Ee(),n=$o();return uo=e?function(n,o){return e(n,"toString",{configurable:!0,enumerable:!1,value:t(o),writable:!0})}:n}function Ro(){if(go)return mo;go=1;var t=Mo(),e=function(){if(fo)return po;fo=1;var t=Date.now;return po=function(e){var n=0,o=0;return function(){var i=t(),r=16-(i-o);if(o=i,r>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}},po}(),n=e(t);return mo=n}function Wo(){if(Eo)return Co;Eo=1;var t=function(){if(bo)return vo;bo=1;var t=$o(),e=Io(),n=Ro();return vo=function(o,i){return n(e(o,i,t),o+"")}}(),e=function(){if(wo)return yo;wo=1;var t=ie(),e=vn(),n=No(),o=ue();return yo=function(i,r,s){if(!o(s))return!1;var a=typeof r;return!!("number"==a?e(s)&&n(r,s.length):"string"==a&&r in s)&&t(s[r],i)}}();return Co=function(n){return t((function(t,o){var i=-1,r=o.length,s=r>1?o[r-1]:void 0,a=r>2?o[2]:void 0;for(s=n.length>3&&"function"==typeof s?(r--,s):void 0,a&&e(o[0],o[1],a)&&(s=r<3?void 0:s,r=1),t=Object(t);++i<r;){var l=o[i];l&&n(t,l,i,s)}return t}))}}const Fo=oe(function(){if(So)return xo;So=1;var t=function(){if(eo)return to;eo=1;var t=Ce(),e=Se(),n=Oe(),o=Lo(),i=ue(),r=Do(),s=Ao();return to=function a(l,c,d,u,h){l!==c&&n(c,(function(n,r){if(h||(h=new t),i(n))o(l,c,r,d,a,u,h);else{var p=u?u(s(l,r),n,r+"",l,c,h):void 0;void 0===p&&(p=n),e(l,r,p)}}),r)},to}(),e=Wo()((function(e,n,o,i){t(e,n,o,i)}));return xo=e}()),Bo=()=>crypto.randomUUID().slice(0,8).slice(0,8),zo=(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},Uo=t=>{const e=t.className?.match($i);return e&&ki[e[0]]},qo=t=>Array.from(new Set(t)),Vo=t=>t?.attrs?.id||t?.id||Bo(),Ho=(t,e)=>Fo({},t,e,((t,e)=>Array.isArray(t)?null!=e?qo(t.concat(e)):e:Array.isArray(e)?null!=t?qo(e.concat(t)):e:void 0)),Xo=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]=Xo(t[n]);return e}if(t instanceof Object){e={};for(const n in t)Object.hasOwn(t,n)&&(e[n]=Xo(t[n]));return e}throw new Error("Unable to copy Object, type not supported.")},Yo=(t,e)=>t/e*100,Go=t=>`${t.toString()}%`,Zo=Object.create(null,{get:{value:t=>{const e=window.sessionStorage?.getItem(t);try{return JSON.parse(e)}catch(n){return e}}},set:{value:(t,e)=>{try{return window.sessionStorage?.setItem(t,JSON.stringify(e))}catch(n){}}}}),Jo=t=>/^(stage|row|column|field)s./.test(t);function Ko(t,e=Hi){let n;return function(...o){n&&clearTimeout(n),n=setTimeout((()=>t.apply(this,o)),e)}}function Qo(t){return t}function ti(){}function ei(t=Object.create(null)){if("string"==typeof t)try{return JSON.parse(t)}catch(e){return Object.create(null)}return t}const ni=t=>t?Xo(ei(t)):dr();function oi(t,e,n,o={}){if(!e||!t[n][e])return o;o[`${n}.${e}`]=t[n][e];const i=Fi.get(n);if(i){const r=t[n][e].data?.children||[];for(const e of r)oi(t,e,i,o)}return o}const ii=d,ri=u,si=ii,ai="formeo-sprite",li=[{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"}],ci=`../../lib/icons/${ai}.svg`,di=ci,ui="undefined"!=typeof process&&"development"===process.env?.NODE_ENV||!1?di:`https://cdn.jsdelivr.net/npm/formeo@${ri}/dist/${ai}.svg`,hi=`https://draggable.github.io/formeo/assets/img/${ai}.svg`,pi=`https://cdn.jsdelivr.net/npm/formeo@${ri}/dist/formeo.min.css`,fi="f-panel",mi="control-group",gi=`${si}-stage`,vi=`${si}-row`,bi=`${si}-column`,yi=`${si}-field`,wi="custom-column-widths",Ci="column-preset",Ei="resizing-columns",xi=new Map([[gi,vi],[vi,bi],[bi,yi]]),Si=["stage","row","column","field"],Oi=Si.map((t=>`${t}s`));new Map(Oi.map(((t,e)=>[t,Si[e]])));const _i=new RegExp(`^${Oi.join("|")}.`),Ai=[...Si],Ti=[...Oi],Ni=new Map(Ti.map(((t,e)=>[t,Ai[e]]))),Pi=Ai.reduce(((t,e)=>(t[e]=e,t)),{}),ji=[{name:"controls",className:mi},{name:"stage",className:gi},{name:"row",className:vi},{name:"column",className:bi},{name:"field",className:yi}],Di={controls:mi,stage:gi,row:vi,column:bi,field:yi},ki=Object.entries(Di).reduce(((t,[e,n])=>(t[n]=e,t)),{}),Li=Object.values(Di),$i=new RegExp(`${Li.join("|")}`,"g"),{childTypeMapVals:Ii,childTypeIndexMapVals:Mi}=ji.reduce(((t,{name:e},n,o)=>{const{name:i}=o[n+1]||{};return i&&(t.childTypeMapVals.push([e,i]),t.childTypeIndexMapVals.push([`${e}s`,`${i}s`])),t}),{childTypeMapVals:[],childTypeIndexMapVals:[]}),Ri=Ii.slice().map((t=>t.slice().reverse())).reverse(),Wi=new Map(Ii),Fi=new Map(Mi),Bi=new Map(Ri.slice()),zi=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)),[])),Ui=`${ii}-formData`,qi=`${ii}-locale`,Vi=333,Hi=Math.round(166.5),Xi=Math.round(666),Yi="formeoSaved",Gi="formeoUpdated",Zi="formeoOnRender",Ji={equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},Ki={equals:"="},Qi=["logical","source","sourceProperty","comparison","target","targetProperty","assignment","value"],tr=["isChecked","isNotChecked"],er=["isVisible","isNotVisible"],nr=["value"],or={comparison:Ji,assignment:Ki,logical:{and:"&&",or:"||"}},ir="if",rr="then",sr=()=>({[ir]:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],[rr]:[{target:"",targetProperty:"",assignment:"",value:""}]}),ar=/(\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b)|(\b[0-9a-f]{8}\b)/g,lr=/\bcol-\w+-\d+/g,cr="f-i-",dr=()=>({id:Vo(),stages:{[Vo()]:{}},rows:{},columns:{},fields:{}}),ur=["selected","checked"],hr=ur.toReversed(),pr="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`)),fr=new RegExp(`(?!${pr.join("|")})\\w\\S*`,"g"),mr=/\s+/g;function gr(t){if("string"!=typeof t)return t;if(t.trim().match(mr))return t;return t.replace(fr,(t=>t.charAt(0).toUpperCase()+t.substring(1).replace(/[A-Z]/g,(t=>` ${t}`))))}const vr=(t,e="-")=>t.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,e),br=t=>{if(Array.isArray(t))return t;const e=/[.[\]]/g,n=[];let o=0,i=e.exec(t);for(;null!==i;)n.push(t.slice(o,i.index)),o=i.index+i[0].length,i=e.exec(t);return o<t.length&&n.push(t.slice(o)),n.filter(Boolean)},yr=(t,e="-")=>br(t).join(e);var wr,Cr,Er,xr,Sr,Or,_r,Ar,Tr,Nr,Pr,jr,Dr,kr,Lr,$r,Ir,Mr,Rr,Wr,Fr,Br,zr,Ur;function qr(){if(Cr)return wr;Cr=1;var t=de(),e=pn();return wr=function(n){return"symbol"==typeof n||e(n)&&"[object Symbol]"==t(n)}}function Vr(){if(Ar)return _r;Ar=1;var t=function(){if(Or)return Sr;Or=1;var t=we();function e(n,o){if("function"!=typeof n||null!=o&&"function"!=typeof o)throw new TypeError("Expected a function");var i=function(){var t=arguments,e=o?o.apply(this,t):t[0],r=i.cache;if(r.has(e))return r.get(e);var s=n.apply(this,t);return i.cache=r.set(e,s)||r,s};return i.cache=new(e.Cache||t),i}return e.Cache=t,Sr=e}();return _r=function(e){var n=t(e,(function(t){return 500===o.size&&o.clear(),t})),o=n.cache;return n}}function Hr(){if(kr)return Dr;kr=1;var t=ce(),e=jr?Pr:(jr=1,Pr=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}),n=mn(),o=qr(),i=t?t.prototype:void 0,r=i?i.toString:void 0;return Dr=function t(i){if("string"==typeof i)return i;if(n(i))return e(i,t)+"";if(o(i))return r?r.call(i):"";var s=i+"";return"0"==s&&1/i==-1/0?"-0":s},Dr}function Xr(){if(Mr)return Ir;Mr=1;var t=mn(),e=function(){if(xr)return Er;xr=1;var t=mn(),e=qr(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;return Er=function(i,r){if(t(i))return!1;var s=typeof i;return!("number"!=s&&"symbol"!=s&&"boolean"!=s&&null!=i&&!e(i))||o.test(i)||!n.test(i)||null!=r&&i in Object(r)}}(),n=function(){if(Nr)return Tr;Nr=1;var t=Vr(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,o=t((function(t){var o=[];return 46===t.charCodeAt(0)&&o.push(""),t.replace(e,(function(t,e,i,r){o.push(i?r.replace(n,"$1"):e||t)})),o}));return Tr=o}(),o=function(){if($r)return Lr;$r=1;var t=Hr();return Lr=function(e){return null==e?"":t(e)}}();return Ir=function(i,r){return t(i)?i:e(i,r)?[i]:n(o(i))}}function Yr(){if(Wr)return Rr;Wr=1;var t=qr();return Rr=function(e){if("string"==typeof e||t(e))return e;var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}}const Gr=oe(function(){if(Ur)return zr;Ur=1;var t=function(){if(Br)return Fr;Br=1;var t=Xr(),e=Yr();return Fr=function(n,o){for(var i=0,r=(o=t(o,n)).length;null!=n&&i<r;)n=n[e(o[i++])];return i&&i==r?n:void 0}}();return zr=function(e,n,o){var i=null==e?void 0:t(e,n);return void 0===i?o:i}}());var Zr,Jr,Kr,Qr;var ts=function(){if(Qr)return Kr;Qr=1;var t=function(){if(Jr)return Zr;Jr=1;var t=To(),e=Xr(),n=No(),o=ue(),i=Yr();return Zr=function(r,s,a,l){if(!o(r))return r;for(var c=-1,d=(s=e(s,r)).length,u=d-1,h=r;null!=h&&++c<d;){var p=i(s[c]),f=a;if("__proto__"===p||"constructor"===p||"prototype"===p)return r;if(c!=u){var m=h[p];void 0===(f=l?l(m,p,h):void 0)&&(f=o(m)?m:n(s[c+1])?[]:{})}t(h,p,f),h=h[p]}return r}}();return Kr=function(e,n,o){return null==e?e:t(e,n,o)}}();const es=Gr,ns=oe(ts);function os(...t){return t.flat().reduce(((t,e)=>(t[e]=e,t)),{})}var is,rs,ss,as,ls,cs,ds,us,hs,ps,fs,ms,gs,vs,bs,ys,ws,Cs,Es,xs,Ss,Os,_s,As,Ts,Ns,Ps,js,Ds,ks,Ls,$s,Is,Ms,Rs,Ws,Fs,Bs,zs,Us,qs,Vs,Hs,Xs,Ys,Gs,Zs,Js,Ks,Qs,ta,ea,na,oa;function ia(){if(cs)return ls;cs=1;var t=we(),e=rs?is:(rs=1,is=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}),n=as?ss:(as=1,ss=function(t){return this.__data__.has(t)});function o(e){var n=-1,o=null==e?0:e.length;for(this.__data__=new t;++n<o;)this.add(e[n])}return o.prototype.add=o.prototype.push=e,o.prototype.has=n,ls=o}function ra(){if(ms)return fs;ms=1;var t=ia(),e=us?ds:(us=1,ds=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}),n=ps?hs:(ps=1,hs=function(t,e){return t.has(e)});return fs=function(o,i,r,s,a,l){var c=1&r,d=o.length,u=i.length;if(d!=u&&!(c&&u>d))return!1;var h=l.get(o),p=l.get(i);if(h&&p)return h==i&&p==o;var f=-1,m=!0,g=2&r?new t:void 0;for(l.set(o,i),l.set(i,o);++f<d;){var v=o[f],b=i[f];if(s)var y=c?s(b,v,f,i,o,l):s(v,b,f,o,i,l);if(void 0!==y){if(y)continue;m=!1;break}if(g){if(!e(i,(function(t,e){if(!n(g,e)&&(v===t||a(v,t,r,s,l)))return g.push(e)}))){m=!1;break}}else if(v!==b&&!a(v,b,r,s,l)){m=!1;break}}return l.delete(o),l.delete(i),m}}function sa(){if(Cs)return ws;Cs=1;var t=ce(),e=an(),n=ie(),o=ra(),i=vs?gs:(vs=1,gs=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,o){n[++e]=[o,t]})),n}),r=ys?bs:(ys=1,bs=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}),s=t?t.prototype:void 0,a=s?s.valueOf:void 0;return ws=function(t,s,l,c,d,u,h){switch(l){case"[object DataView]":if(t.byteLength!=s.byteLength||t.byteOffset!=s.byteOffset)return!1;t=t.buffer,s=s.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=s.byteLength||!u(new e(t),new e(s)));case"[object Boolean]":case"[object Date]":case"[object Number]":return n(+t,+s);case"[object Error]":return t.name==s.name&&t.message==s.message;case"[object RegExp]":case"[object String]":return t==s+"";case"[object Map]":var p=i;case"[object Set]":var f=1&c;if(p||(p=r),t.size!=s.size&&!f)return!1;var m=h.get(t);if(m)return m==s;c|=2,h.set(t,s);var g=o(p(t),p(s),c,d,u,h);return h.delete(t),g;case"[object Symbol]":if(a)return a.call(t)==a.call(s)}return!1}}function aa(){if(Os)return Ss;Os=1;var t=xs?Es:(xs=1,Es=function(t,e){for(var n=-1,o=e.length,i=t.length;++n<o;)t[i+n]=e[n];return t}),e=mn();return Ss=function(n,o,i){var r=o(n);return e(n)?r:t(r,i(n))}}function la(){if(js)return Ps;js=1;var t=As?_s:(As=1,_s=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}),e=Ns?Ts:(Ns=1,Ts=function(){return[]}),n=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols;return Ps=o?function(e){return null==e?[]:(e=Object(e),t(o(e),(function(t){return n.call(e,t)})))}:e}function ca(){if($s)return Ls;$s=1;var t=un(),e=function(){if(ks)return Ds;ks=1;var t=cn()(Object.keys,Object);return Ds=t}(),n=Object.prototype.hasOwnProperty;return Ls=function(o){if(!t(o))return e(o);var i=[];for(var r in Object(o))n.call(o,r)&&"constructor"!=r&&i.push(r);return i}}function da(){if(Ws)return Rs;Ws=1;var t=aa(),e=la(),n=function(){if(Ms)return Is;Ms=1;var t=Po(),e=ca(),n=vn();return Is=function(o){return n(o)?t(o):e(o)}}();return Rs=function(o){return t(o,n,e)}}function ua(){if(Js)return Zs;Js=1;var t=function(){if(Us)return zs;Us=1;var t=me()(le(),"DataView");return zs=t}(),e=ge(),n=function(){if(Vs)return qs;Vs=1;var t=me()(le(),"Promise");return qs=t}(),o=function(){if(Xs)return Hs;Xs=1;var t=me()(le(),"Set");return Hs=t}(),i=function(){if(Gs)return Ys;Gs=1;var t=me()(le(),"WeakMap");return Ys=t}(),r=de(),s=fe(),a="[object Map]",l="[object Promise]",c="[object Set]",d="[object WeakMap]",u="[object DataView]",h=s(t),p=s(e),f=s(n),m=s(o),g=s(i),v=r;return(t&&v(new t(new ArrayBuffer(1)))!=u||e&&v(new e)!=a||n&&v(n.resolve())!=l||o&&v(new o)!=c||i&&v(new i)!=d)&&(v=function(t){var e=r(t),n="[object Object]"==e?t.constructor:void 0,o=n?s(n):"";if(o)switch(o){case h:return u;case p:return a;case f:return l;case m:return c;case g:return d}return e}),Zs=v}function ha(){if(Qs)return Ks;Qs=1;var t=Ce(),e=ra(),n=sa(),o=function(){if(Bs)return Fs;Bs=1;var t=da(),e=Object.prototype.hasOwnProperty;return Fs=function(n,o,i,r,s,a){var l=1&i,c=t(n),d=c.length;if(d!=t(o).length&&!l)return!1;for(var u=d;u--;){var h=c[u];if(!(l?h in o:e.call(o,h)))return!1}var p=a.get(n),f=a.get(o);if(p&&f)return p==o&&f==n;var m=!0;a.set(n,o),a.set(o,n);for(var g=l;++u<d;){var v=n[h=c[u]],b=o[h];if(r)var y=l?r(b,v,h,o,n,a):r(v,b,h,n,o,a);if(!(void 0===y?v===b||s(v,b,i,r,a):y)){m=!1;break}g||(g="constructor"==h)}if(m&&!g){var w=n.constructor,C=o.constructor;w==C||!("constructor"in n)||!("constructor"in o)||"function"==typeof w&&w instanceof w&&"function"==typeof C&&C instanceof C||(m=!1)}return a.delete(n),a.delete(o),m}}(),i=ua(),r=mn(),s=Tn(),a=_o(),l="[object Arguments]",c="[object Array]",d="[object Object]",u=Object.prototype.hasOwnProperty;return Ks=function(h,p,f,m,g,v){var b=r(h),y=r(p),w=b?c:i(h),C=y?c:i(p),E=(w=w==l?d:w)==d,x=(C=C==l?d:C)==d,S=w==C;if(S&&s(h)){if(!s(p))return!1;b=!0,E=!1}if(S&&!E)return v||(v=new t),b||a(h)?e(h,p,f,m,g,v):n(h,p,w,f,m,g,v);if(!(1&f)){var O=E&&u.call(h,"__wrapped__"),_=x&&u.call(p,"__wrapped__");if(O||_){var A=O?h.value():h,T=_?p.value():p;return v||(v=new t),g(A,T,f,m,v)}}return!!S&&(v||(v=new t),o(h,p,f,m,g,v))}}const pa=oe(function(){if(oa)return na;oa=1;var t=function(){if(ea)return ta;ea=1;var t=ha(),e=pn();return ta=function n(o,i,r,s,a){return o===i||(null==o||null==i||!e(o)&&!e(i)?o!=o&&i!=i:t(o,i,r,s,n,a))},ta}();return na=function(e,n){return t(e,n)}}()),fa=(t,e)=>void 0===t?"added":void 0===e?"removed":pa(t,e)?"unchanged":"changed";class ma{constructor(t,e=Object.create(null)){this.name=t,this.data=e,this.dataPath=""}get size(){return Object.keys(this.data).length}get js(){return this.data}get json(){return this.data}toJSON=(t,e)=>JSON.stringify(t,null,e);get=t=>es(this.data,t);set(t,e){const n=es(this.data,t),o=ns(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={entity:this,dataPath:this.dataPath.replace(/\.+$/,""),changePath:this.dataPath+t,value:e,data:o,changeType:fa(n,e),src:this.dom};n&&(i.previousValue=n),hu.formeoUpdated(i)}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))}add=(t,e=Object.create(null))=>{const{id:n}=e,o=t||n||Vo();return this.set(o,e)};remove=t=>{const e=br(t),n=e.pop(),o=this.get(e);return Array.isArray(o)?o.splice(Number(n),1):o&&delete o[n],o};empty(){this.data=Object.create(null)}getData=()=>Object.entries(this.data).reduce(((t,[e,n])=>(t[e]=n?.data?n.getData():n,t)),{});setCallbacks={};configVal=Object.create(null)}class ga extends ma{load=t=>{const e=ei(t);this.empty();for(const[n,o]of Object.entries(e))this.add(n,o);return this.data};get=t=>t?es(this.data,t):this.add();add=(t,e=Object.create(null))=>{const n=t||Vo(),o=this.Component({...e,id:n});return this.data[n]=o,this.active=o,o};remove=t=>{if(Array.isArray(t))for(const e of t)this.get(e).remove();else this.get(t).remove();return this.data};delete=t=>(delete this.data[t],t);clearAll=(t=!0)=>{const e=Object.values(this.data).map((e=>e.empty(t)));return Promise.all(e)};set config(t){this.configVal=Ho(this.configVal,Xo(t))}get config(){return this.configVal}conditionMap=new Map}function va(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function ba(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?va(Object(n),!0).forEach((function(e){wa(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):va(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ya(t){return(ya="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 wa(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ca(){return Ca=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},Ca.apply(this,arguments)}function Ea(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 xa(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var Sa=xa(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Oa=xa(/Edge/i),_a=xa(/firefox/i),Aa=xa(/safari/i)&&!xa(/chrome/i)&&!xa(/android/i),Ta=xa(/iP(ad|od|hone)/i),Na=xa(/chrome/i)&&xa(/android/i),Pa={capture:!1,passive:!1};function ja(t,e,n){t.addEventListener(e,n,!Sa&&Pa)}function Da(t,e,n){t.removeEventListener(e,n,!Sa&&Pa)}function ka(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 La(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function $a(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&ka(t,e):ka(t,e))||o&&t===n)return t;if(t===n)break}while(t=La(t))}return null}var Ia,Ma=/\s+/g;function Ra(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(Ma," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(Ma," ")}}function Wa(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 Fa(t,e){var n="";if("string"==typeof t)n=t;else do{var o=Wa(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 Ba(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 za(){var t=document.scrollingElement;return t||document.documentElement}function Ua(t,e,n,o,i){if(t.getBoundingClientRect||t===window){var r,s,a,l,c,d,u;if(t!==window&&t.parentNode&&t!==za()?(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,!Sa))do{if(i&&i.getBoundingClientRect&&("none"!==Wa(i,"transform")||n&&"static"!==Wa(i,"position"))){var h=i.getBoundingClientRect();s-=h.top+parseInt(Wa(i,"border-top-width")),a-=h.left+parseInt(Wa(i,"border-left-width")),l=s+r.height,c=a+r.width;break}}while(i=i.parentNode);if(o&&t!==window){var p=Fa(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 qa(t,e,n){for(var o=Ga(t,!0),i=Ua(t)[e];o;){if(!(i>=Ua(o)[n]))return o;if(o===za())break;o=Ga(o,!1)}return!1}function Va(t,e,n,o){for(var i=0,r=0,s=t.children;r<s.length;){if("none"!==s[r].style.display&&s[r]!==Ql.ghost&&(o||s[r]!==Ql.dragged)&&$a(s[r],n.draggable,t,!1)){if(i===e)return s[r];i++}r++}return null}function Ha(t,e){for(var n=t.lastElementChild;n&&(n===Ql.ghost||"none"===Wa(n,"display")||e&&!ka(n,e));)n=n.previousElementSibling;return n||null}function Xa(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===Ql.clone||e&&!ka(t,e)||n++;return n}function Ya(t){var e=0,n=0,o=za();if(t)do{var i=Fa(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 Ga(t,e){if(!t||!t.getBoundingClientRect)return za();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=Wa(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 za();if(o||e)return n;o=!0}}}while(n=n.parentNode);return za()}function Za(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 Ja(t,e){return function(){if(!Ia){var n=arguments;1===n.length?t.call(this,n[0]):t.apply(this,n),Ia=setTimeout((function(){Ia=void 0}),e)}}}function Ka(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function Qa(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 tl(t,e,n){var o={};return Array.from(t.children).forEach((function(i){var r,s,a,l;if($a(i,e.draggable,t,!1)&&!i.animated&&i!==n){var c=Ua(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 el="Sortable"+(new Date).getTime();function nl(){var t,e=[];return{captureAnimationState:function(){(e=[],this.options.animation)&&[].slice.call(this.el.children).forEach((function(t){if("none"!==Wa(t,"display")&&t!==Ql.ghost){e.push({target:t,rect:Ua(t)});var n=ba({},e[e.length-1].rect);if(t.thisAnimationDuration){var o=Fa(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=Ua(n),l=n.prevFromRect,c=n.prevToRect,d=t.rect,u=Fa(n,!0);u&&(a.top-=u.f,a.left-=u.e),n.toRect=a,n.thisAnimationDuration&&Za(l,a)&&!Za(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)),Za(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){Wa(t,"transition",""),Wa(t,"transform","");var i=Fa(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,Wa(t,"transform","translate3d("+a+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),Wa(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),Wa(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){Wa(t,"transition",""),Wa(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),o)}}}}var ol=[],il={initializeByDefault:!0},rl={mount:function(t){for(var e in il)il.hasOwnProperty(e)&&!(e in t)&&(t[e]=il[e]);ol.forEach((function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")})),ol.push(t)},pluginEvent:function(t,e,n){var o=this;this.eventCanceled=!1,n.cancel=function(){o.eventCanceled=!0};var i=t+"Global";ol.forEach((function(o){e[o.pluginName]&&(e[o.pluginName][i]&&e[o.pluginName][i](ba({sortable:e},n)),e.options[o.pluginName]&&e[o.pluginName][t]&&e[o.pluginName][t](ba({sortable:e},n)))}))},initializePlugins:function(t,e,n,o){for(var i in ol.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,Ca(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 ol.forEach((function(o){"function"==typeof o.eventProperties&&Ca(n,o.eventProperties.call(e[o.pluginName],t))})),n},modifyOption:function(t,e,n){var o;return ol.forEach((function(i){t[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[e]&&(o=i.optionListeners[e].call(t[i.pluginName],n))})),o}};var sl=["evt"],al=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,i=Ea(n,sl);rl.pluginEvent.bind(Ql)(t,e,ba({dragEl:cl,parentEl:dl,ghostEl:ul,rootEl:hl,nextEl:pl,lastDownEl:fl,cloneEl:ml,cloneHidden:gl,dragStarted:Nl,putSortable:El,activeSortable:Ql.active,originalEvent:o,oldIndex:vl,oldDraggableIndex:yl,newIndex:bl,newDraggableIndex:wl,hideGhostForTarget:Gl,unhideGhostForTarget:Zl,cloneNowHidden:function(){gl=!0},cloneNowShown:function(){gl=!1},dispatchSortableEvent:function(t){ll({sortable:e,name:t,originalEvent:o})}},i))};function ll(t){!function(t){var e=t.sortable,n=t.rootEl,o=t.name,i=t.targetEl,r=t.cloneEl,s=t.toEl,a=t.fromEl,l=t.oldIndex,c=t.newIndex,d=t.oldDraggableIndex,u=t.newDraggableIndex,h=t.originalEvent,p=t.putSortable,f=t.extraEventProperties;if(e=e||n&&n[el]){var m,g=e.options,v="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||Sa||Oa?(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=ba(ba({},f),rl.getEventProperties(o,e));for(var y in b)m[y]=b[y];n&&n.dispatchEvent(m),g[v]&&g[v].call(e,m)}}(ba({putSortable:El,cloneEl:ml,targetEl:cl,rootEl:hl,oldIndex:vl,oldDraggableIndex:yl,newIndex:bl,newDraggableIndex:wl},t))}var cl,dl,ul,hl,pl,fl,ml,gl,vl,bl,yl,wl,Cl,El,xl,Sl,Ol,_l,Al,Tl,Nl,Pl,jl,Dl,kl,Ll=!1,$l=!1,Il=[],Ml=!1,Rl=!1,Wl=[],Fl=!1,Bl=[],zl="undefined"!=typeof document,Ul=Ta,ql=Oa||Sa?"cssFloat":"float",Vl=zl&&!Na&&!Ta&&"draggable"in document.createElement("div"),Hl=function(){if(zl){if(Sa)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Xl=function(t,e){var n=Wa(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=Va(t,0,e),r=Va(t,1,e),s=i&&Wa(i),a=r&&Wa(r),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+Ua(i).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Ua(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[ql]||r&&"none"===n[ql]&&l+c>o)?"vertical":"horizontal"},Yl=function(t){function e(t,n){return function(o,i,r,s){var a=o.options.group.name&&i.options.group.name&&o.options.group.name===i.options.group.name;if(null==t&&(n||a))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(o,i,r,s),n)(o,i,r,s);var l=(n?o:i).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var n={},o=t.group;o&&"object"==ya(o)||(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n},Gl=function(){!Hl&&ul&&Wa(ul,"display","none")},Zl=function(){!Hl&&ul&&Wa(ul,"display","")};zl&&!Na&&document.addEventListener("click",(function(t){if($l)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),$l=!1,!1}),!0);var Jl=function(t){if(cl){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,Il.some((function(t){var e=t[el].options.emptyInsertThreshold;if(e&&!Ha(t)){var n=Ua(t),o=i>=n.left-e&&i<=n.right+e,a=r>=n.top-e&&r<=n.bottom+e;return o&&a?s=t:void 0}})),s);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[el]._onDragOver(n)}}var i,r,s},Kl=function(t){cl&&cl.parentNode[el]._isOutsideThisEl(t.target)};function Ql(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=Ca({},e),t[el]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Xl(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Ql.supportPointer&&"PointerEvent"in window&&!Aa,emptyInsertThreshold:5};for(var o in rl.initializePlugins(this,t,n),n)!(o in e)&&(e[o]=n[o]);for(var i in Yl(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&Vl,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?ja(t,"pointerdown",this._onTapStart):(ja(t,"mousedown",this._onTapStart),ja(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(ja(t,"dragover",this),ja(t,"dragenter",this)),Il.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Ca(this,nl())}function tc(t,e,n,o,i,r,s,a){var l,c,d=t[el],u=d.options.onMove;return!window.CustomEvent||Sa||Oa?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=n,l.draggedRect=o,l.related=i||e,l.relatedRect=r||Ua(e),l.willInsertAfter=a,l.originalEvent=s,t.dispatchEvent(l),u&&(c=u.call(d,l,s)),c}function ec(t){t.draggable=!1}function nc(){Fl=!1}function oc(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function ic(t){return setTimeout(t,0)}function rc(t){return clearTimeout(t)}Ql.prototype={constructor:Ql,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(Pl=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,cl):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,i=o.preventOnFilter,r=t.type,s=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,a=(s||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,c=o.filter;if(function(t){Bl.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&Bl.push(o)}}(n),!cl&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!Aa||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=$a(a,o.draggable,n,!1))&&a.animated||fl===a)){if(vl=Xa(a),yl=Xa(a,o.draggable),"function"==typeof c){if(c.call(this,t,a,this))return ll({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),al("filter",e,{evt:t}),void(i&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=$a(l,o.trim(),n,!1))return ll({sortable:e,rootEl:o,name:"filter",targetEl:a,fromEl:n,toEl:n}),al("filter",e,{evt:t}),!0}))))return void(i&&t.cancelable&&t.preventDefault());o.handle&&!$a(l,o.handle,n,!1)||this._prepareDragStart(t,s,a)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,s=i.options,a=r.ownerDocument;if(n&&!cl&&n.parentNode===r){var l=Ua(n);if(hl=r,dl=(cl=n).parentNode,pl=cl.nextSibling,fl=n,Cl=s.group,Ql.dragged=cl,xl={target:cl,clientX:(e||t).clientX,clientY:(e||t).clientY},Al=xl.clientX-l.left,Tl=xl.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,cl.style["will-change"]="all",o=function(){al("delayEnded",i,{evt:t}),Ql.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!_a&&i.nativeDraggable&&(cl.draggable=!0),i._triggerDragStart(t,e),ll({sortable:i,name:"choose",originalEvent:t}),Ra(cl,s.chosenClass,!0))},s.ignore.split(",").forEach((function(t){Ba(cl,t.trim(),ec)})),ja(a,"dragover",Jl),ja(a,"mousemove",Jl),ja(a,"touchmove",Jl),ja(a,"mouseup",i._onDrop),ja(a,"touchend",i._onDrop),ja(a,"touchcancel",i._onDrop),_a&&this.nativeDraggable&&(this.options.touchStartThreshold=4,cl.draggable=!0),al("delayStart",this,{evt:t}),!s.delay||s.delayOnTouchOnly&&!e||this.nativeDraggable&&(Oa||Sa))o();else{if(Ql.eventCanceled)return void this._onDrop();ja(a,"mouseup",i._disableDelayedDrag),ja(a,"touchend",i._disableDelayedDrag),ja(a,"touchcancel",i._disableDelayedDrag),ja(a,"mousemove",i._delayedDragTouchMoveHandler),ja(a,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&ja(a,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,s.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){cl&&ec(cl),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;Da(t,"mouseup",this._disableDelayedDrag),Da(t,"touchend",this._disableDelayedDrag),Da(t,"touchcancel",this._disableDelayedDrag),Da(t,"mousemove",this._delayedDragTouchMoveHandler),Da(t,"touchmove",this._delayedDragTouchMoveHandler),Da(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?ja(document,"pointermove",this._onTouchMove):ja(document,e?"touchmove":"mousemove",this._onTouchMove):(ja(cl,"dragend",this),ja(hl,"dragstart",this._onDragStart));try{document.selection?ic((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(t,e){if(Ll=!1,hl&&cl){al("dragStarted",this,{evt:e}),this.nativeDraggable&&ja(document,"dragover",Kl);var n=this.options;!t&&Ra(cl,n.dragClass,!1),Ra(cl,n.ghostClass,!0),Ql.active=this,t&&this._appendGhost(),ll({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Sl){this._lastX=Sl.clientX,this._lastY=Sl.clientY,Gl();for(var t=document.elementFromPoint(Sl.clientX,Sl.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Sl.clientX,Sl.clientY))!==e;)e=t;if(cl.parentNode[el]._isOutsideThisEl(t),e)do{if(e[el]){if(e[el]._onDragOver({clientX:Sl.clientX,clientY:Sl.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=La(e));Zl()}},_onTouchMove:function(t){if(xl){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=ul&&Fa(ul,!0),s=ul&&r&&r.a,a=ul&&r&&r.d,l=Ul&&kl&&Ya(kl),c=(i.clientX-xl.clientX+o.x)/(s||1)+(l?l[0]-Wl[0]:0)/(s||1),d=(i.clientY-xl.clientY+o.y)/(a||1)+(l?l[1]-Wl[1]:0)/(a||1);if(!Ql.active&&!Ll){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(ul){r?(r.e+=c-(Ol||0),r.f+=d-(_l||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,")");Wa(ul,"webkitTransform",u),Wa(ul,"mozTransform",u),Wa(ul,"msTransform",u),Wa(ul,"transform",u),Ol=c,_l=d,Sl=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!ul){var t=this.options.fallbackOnBody?document.body:hl,e=Ua(cl,!0,Ul,!0,t),n=this.options;if(Ul){for(kl=t;"static"===Wa(kl,"position")&&"none"===Wa(kl,"transform")&&kl!==document;)kl=kl.parentNode;kl!==document.body&&kl!==document.documentElement?(kl===document&&(kl=za()),e.top+=kl.scrollTop,e.left+=kl.scrollLeft):kl=za(),Wl=Ya(kl)}Ra(ul=cl.cloneNode(!0),n.ghostClass,!1),Ra(ul,n.fallbackClass,!0),Ra(ul,n.dragClass,!0),Wa(ul,"transition",""),Wa(ul,"transform",""),Wa(ul,"box-sizing","border-box"),Wa(ul,"margin",0),Wa(ul,"top",e.top),Wa(ul,"left",e.left),Wa(ul,"width",e.width),Wa(ul,"height",e.height),Wa(ul,"opacity","0.8"),Wa(ul,"position",Ul?"absolute":"fixed"),Wa(ul,"zIndex","100000"),Wa(ul,"pointerEvents","none"),Ql.ghost=ul,t.appendChild(ul),Wa(ul,"transform-origin",Al/parseInt(ul.style.width)*100+"% "+Tl/parseInt(ul.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,o=t.dataTransfer,i=n.options;al("dragStart",this,{evt:t}),Ql.eventCanceled?this._onDrop():(al("setupClone",this),Ql.eventCanceled||((ml=Qa(cl)).removeAttribute("id"),ml.draggable=!1,ml.style["will-change"]="",this._hideClone(),Ra(ml,this.options.chosenClass,!1),Ql.clone=ml),n.cloneId=ic((function(){al("clone",n),Ql.eventCanceled||(n.options.removeCloneOnHide||hl.insertBefore(ml,cl),n._hideClone(),ll({sortable:n,name:"clone"}))})),!e&&Ra(cl,i.dragClass,!0),e?($l=!0,n._loopId=setInterval(n._emulateDragOver,50)):(Da(document,"mouseup",n._onDrop),Da(document,"touchend",n._onDrop),Da(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(n,o,cl)),ja(document,"drop",n),Wa(cl,"transform","translateZ(0)")),Ll=!0,n._dragStartId=ic(n._dragStarted.bind(n,e,t)),ja(document,"selectstart",n),Nl=!0,Aa&&Wa(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=Ql.active,d=Cl===l,u=a.sort,h=El||c,p=this,f=!1;if(!Fl){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),s=$a(s,a.draggable,r,!0),N("dragOver"),Ql.eventCanceled)return f;if(cl.contains(t.target)||s.animated&&s.animatingX&&s.animatingY||p._ignoreWhileAnimating===s)return j(!1);if($l=!1,c&&!a.disabled&&(d?u||(o=dl!==hl):El===this||(this.lastPutMode=Cl.checkPull(this,c,cl,t))&&l.checkPut(this,c,cl,t))){if(i="vertical"===this._getDirection(t,s),e=Ua(cl),N("dragOverValid"),Ql.eventCanceled)return f;if(o)return dl=hl,P(),this._hideClone(),N("revert"),Ql.eventCanceled||(pl?hl.insertBefore(cl,pl):hl.appendChild(cl)),j(!0);var m=Ha(r,a.draggable);if(!m||function(t,e,n){var o=Ua(Ha(n.el,n.options.draggable)),i=tl(n.el,n.options,ul),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===cl)return j(!1);if(m&&r===t.target&&(s=m),s&&(n=Ua(s)),!1!==tc(hl,r,cl,e,s,n,t,!!s))return P(),m&&m.nextSibling?r.insertBefore(cl,m.nextSibling):r.appendChild(cl),dl=r,D(),j(!0)}else if(m&&function(t,e,n){var o=Ua(Va(n.el,0,n.options,!0)),i=tl(n.el,n.options,ul),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=Va(r,0,a,!0);if(g===cl)return j(!1);if(n=Ua(s=g),!1!==tc(hl,r,cl,e,s,n,t,!1))return P(),r.insertBefore(cl,g),dl=r,D(),j(!0)}else if(s.parentNode===r){n=Ua(s);var v,b,y,w=cl.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}(cl.animated&&cl.toRect||e,s.animated&&s.toRect||n,i),E=i?"top":"left",x=qa(s,"top","top")||qa(cl,"top","top"),S=x?x.scrollTop:void 0;if(Pl!==s&&(b=n[E],Ml=!1,Rl=!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&&Dl<c*i){if(!Ml&&(1===jl?l>d+c*r/2:l<u-c*r/2)&&(Ml=!0),Ml)h=!0;else if(1===jl?l<d+Dl:l>u-Dl)return-jl}else if(l>d+c*(1-i)/2&&l<u-c*(1-i)/2)return function(t){return Xa(cl)<Xa(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,Rl,Pl===s),0!==v){var O=Xa(cl);do{O-=v,y=dl.children[O]}while(y&&("none"===Wa(y,"display")||y===ul))}if(0===v||y===s)return j(!1);Pl=s,jl=v;var _=s.nextElementSibling,A=!1,T=tc(hl,r,cl,e,s,n,t,A=1===v);if(!1!==T)return 1!==T&&-1!==T||(A=1===T),Fl=!0,setTimeout(nc,30),P(),A&&!_?r.appendChild(cl):s.parentNode.insertBefore(cl,A?_:s),x&&Ka(x,0,S-x.scrollTop),dl=cl.parentNode,void 0===b||Rl||(Dl=Math.abs(b-Ua(s)[E])),D(),j(!0)}if(r.contains(cl))return j(!1)}return!1}function N(a,l){al(a,p,ba({evt:t,isOwner:d,axis:i?"vertical":"horizontal",revert:o,dragRect:e,targetRect:n,canSort:u,fromSortable:h,target:s,completed:j,onMove:function(n,o){return tc(hl,r,cl,e,n,Ua(n),t,o)},changed:D},l))}function P(){N("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function j(e){return N("dragOverCompleted",{insertion:e}),e&&(d?c._hideClone():c._showClone(p),p!==h&&(Ra(cl,El?El.options.ghostClass:c.options.ghostClass,!1),Ra(cl,a.ghostClass,!0)),El!==p&&p!==Ql.active?El=p:p===Ql.active&&El&&(El=null),h===p&&(p._ignoreWhileAnimating=s),p.animateAll((function(){N("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(s===cl&&!cl.animated||s===r&&!s.animated)&&(Pl=null),a.dragoverBubble||t.rootEl||s===document||(cl.parentNode[el]._isOutsideThisEl(t.target),!e&&Jl(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),f=!0}function D(){bl=Xa(cl),wl=Xa(cl,a.draggable),ll({sortable:p,name:"change",toEl:r,newIndex:bl,newDraggableIndex:wl,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){Da(document,"mousemove",this._onTouchMove),Da(document,"touchmove",this._onTouchMove),Da(document,"pointermove",this._onTouchMove),Da(document,"dragover",Jl),Da(document,"mousemove",Jl),Da(document,"touchmove",Jl)},_offUpEvents:function(){var t=this.el.ownerDocument;Da(t,"mouseup",this._onDrop),Da(t,"touchend",this._onDrop),Da(t,"pointerup",this._onDrop),Da(t,"touchcancel",this._onDrop),Da(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;bl=Xa(cl),wl=Xa(cl,n.draggable),al("drop",this,{evt:t}),dl=cl&&cl.parentNode,bl=Xa(cl),wl=Xa(cl,n.draggable),Ql.eventCanceled||(Ll=!1,Rl=!1,Ml=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),rc(this.cloneId),rc(this._dragStartId),this.nativeDraggable&&(Da(document,"drop",this),Da(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Aa&&Wa(document.body,"user-select",""),Wa(cl,"transform",""),t&&(Nl&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),ul&&ul.parentNode&&ul.parentNode.removeChild(ul),(hl===dl||El&&"clone"!==El.lastPutMode)&&ml&&ml.parentNode&&ml.parentNode.removeChild(ml),cl&&(this.nativeDraggable&&Da(cl,"dragend",this),ec(cl),cl.style["will-change"]="",Nl&&!Ll&&Ra(cl,El?El.options.ghostClass:this.options.ghostClass,!1),Ra(cl,this.options.chosenClass,!1),ll({sortable:this,name:"unchoose",toEl:dl,newIndex:null,newDraggableIndex:null,originalEvent:t}),hl!==dl?(bl>=0&&(ll({rootEl:dl,name:"add",toEl:dl,fromEl:hl,originalEvent:t}),ll({sortable:this,name:"remove",toEl:dl,originalEvent:t}),ll({rootEl:dl,name:"sort",toEl:dl,fromEl:hl,originalEvent:t}),ll({sortable:this,name:"sort",toEl:dl,originalEvent:t})),El&&El.save()):bl!==vl&&bl>=0&&(ll({sortable:this,name:"update",toEl:dl,originalEvent:t}),ll({sortable:this,name:"sort",toEl:dl,originalEvent:t})),Ql.active&&(null!=bl&&-1!==bl||(bl=vl,wl=yl),ll({sortable:this,name:"end",toEl:dl,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){al("nulling",this),hl=cl=dl=ul=pl=ml=fl=gl=xl=Sl=Nl=bl=wl=vl=yl=Pl=jl=El=Cl=Ql.dragged=Ql.ghost=Ql.clone=Ql.active=null,Bl.forEach((function(t){t.checked=!0})),Bl.length=Ol=_l=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":cl&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,i=n.length,r=this.options;o<i;o++)$a(t=n[o],r.draggable,this.el,!1)&&e.push(t.getAttribute(r.dataIdAttr)||oc(t));return e},sort:function(t,e){var n={},o=this.el;this.toArray().forEach((function(t,e){var i=o.children[e];$a(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 $a(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=rl.modifyOption(this,t,e);n[t]=void 0!==o?o:e,"group"===t&&Yl(n)},destroy:function(){al("destroy",this);var t=this.el;t[el]=null,Da(t,"mousedown",this._onTapStart),Da(t,"touchstart",this._onTapStart),Da(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(Da(t,"dragover",this),Da(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),(function(t){t.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),Il.splice(Il.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!gl){if(al("hideClone",this),Ql.eventCanceled)return;Wa(ml,"display","none"),this.options.removeCloneOnHide&&ml.parentNode&&ml.parentNode.removeChild(ml),gl=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(gl){if(al("showClone",this),Ql.eventCanceled)return;cl.parentNode!=hl||this.options.group.revertClone?pl?hl.insertBefore(ml,pl):hl.appendChild(ml):hl.insertBefore(ml,cl),this.options.group.revertClone&&this.animate(cl,ml),Wa(ml,"display",""),gl=!1}}else this._hideClone()}},zl&&ja(document,"touchmove",(function(t){(Ql.active||Ll)&&t.cancelable&&t.preventDefault()})),Ql.utils={on:ja,off:Da,css:Wa,find:Ba,is:function(t,e){return!!$a(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:Ja,closest:$a,toggleClass:Ra,clone:Qa,index:Xa,nextTick:ic,cancelNextTick:rc,detectDirection:Xl,getChild:Va,expando:el},Ql.get=function(t){return t[el]},Ql.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&&(Ql.utils=ba(ba({},Ql.utils),t.utils)),rl.mount(t)}))},Ql.create=function(t,e){return new Ql(t,e)},Ql.version="1.15.3";var sc,ac,lc,cc,dc,uc,hc=[],pc=!1;function fc(){hc.forEach((function(t){clearInterval(t.pid)})),hc=[]}function mc(){clearInterval(uc)}var gc=Ja((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=za(),d=!1;ac!==n&&(ac=n,fc(),sc=e.scroll,i=e.scrollFn,!0===sc&&(sc=Ga(n,!0)));var u=0,h=sc;do{var p=h,f=Ua(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=Wa(p),_=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 T=C&&(Math.abs(b-r)<=a&&_+y<x)-(Math.abs(v-r)<=a&&!!_),N=E&&(Math.abs(g-s)<=a&&A+w<S)-(Math.abs(m-s)<=a&&!!A);if(!hc[u])for(var P=0;P<=u;P++)hc[P]||(hc[P]={});hc[u].vx==T&&hc[u].vy==N&&hc[u].el===p||(hc[u].el=p,hc[u].vx=T,hc[u].vy=N,clearInterval(hc[u].pid),0==T&&0==N||(d=!0,hc[u].pid=setInterval(function(){o&&0===this.layer&&Ql.active._onTouchMove(dc);var e=hc[this.layer].vy?hc[this.layer].vy*l:0,n=hc[this.layer].vx?hc[this.layer].vx*l:0;"function"==typeof i&&"continue"!==i.call(Ql.dragged.parentNode[el],n,e,t,dc,hc[this.layer].el)||Ka(hc[this.layer].el,n,e)}.bind({layer:u}),24))),u++}while(e.bubbleScroll&&h!==c&&(h=Ga(h,!1)));pc=d}}),30),vc=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 bc(){}function yc(){}bc.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=Va(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:vc},Ca(bc,{pluginName:"revertOnSpill"}),yc.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable||this.sortable;n.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),n.animateAll()},drop:vc},Ca(yc,{pluginName:"removeOnSpill"}),Ql.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?ja(document,"dragover",this._handleAutoScroll):this.options.supportPointer?ja(document,"pointermove",this._handleFallbackAutoScroll):e.touches?ja(document,"touchmove",this._handleFallbackAutoScroll):ja(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?Da(document,"dragover",this._handleAutoScroll):(Da(document,"pointermove",this._handleFallbackAutoScroll),Da(document,"touchmove",this._handleFallbackAutoScroll),Da(document,"mousemove",this._handleFallbackAutoScroll)),mc(),fc(),clearTimeout(Ia),Ia=void 0},nulling:function(){dc=ac=sc=pc=uc=lc=cc=null,hc.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(dc=t,e||this.options.forceAutoScrollFallback||Oa||Sa||Aa){gc(t,this.options,r,e);var s=Ga(r,!0);!pc||uc&&o===lc&&i===cc||(uc&&mc(),uc=setInterval((function(){var r=Ga(document.elementFromPoint(o,i),!0);r!==s&&(s=r,fc()),gc(t,n.options,r,e)}),10),lc=o,cc=i)}else{if(!this.options.bubbleScroll||Ga(r,!0)===za())return void fc();gc(t,this.options,Ga(r,!1),!1)}}},Ca(t,{pluginName:"scroll",initializeByDefault:!0})}),Ql.mount(yc,bc);const wc={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=wc.getStyle(t),i=Number.parseInt(o.height,10),r=i/(e/60);t.style.height="0px",function e(){const o=Number.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=wc.getStyle(t),i=Number.parseInt(o.height,10),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=Number.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"===wc.getStyle(t,"display"))=>{n?wc.slideDown(t,e):wc.slideUp(t,e)}},Cc=t=>Number.isInteger(Number(t)),Ec=t=>{let e=0,n=t;for(;n?.previousElementSibling;)n=n.previousElementSibling,e++;return e},xc=(t,e,n)=>{const o=n.split("||"),i=qo(e).map((e=>t.find((t=>{const n=o.find((e=>!!es(t,e)));return n&&es(t,n)===e})))).filter(Boolean).concat(t);return qo(i)},Sc=(t,e,n)=>{for(let o=0;o<t.length;o++)e.call(n,t[o],o)},Oc=(t,e)=>{const n=[];return Sc(t,((t,o)=>n.push(e(t,o)))),n},_c={},Ac=t=>{if(_c[t])return _c[t];const e=({className:"class"}[t]||t).replace(/^\d+/,"").replace(/[^a-zA-Z0-9-:]/g,"");return _c[t]=e,e},Tc=t=>t.replace(/\b\w/g,(t=>t.toUpperCase())),Nc=()=>-1!==window.navigator.userAgent.indexOf("MSIE "),Pc={capitalize:Tc,safeAttrName:Ac,forEach:Sc,copyObj:t=>window.JSON.parse(window.JSON.stringify(t)),map:Oc,subtract:(t,e)=>e.filter((e=>!~t.indexOf(e))),indexOfNode:Ec,isInt:Cc,get:es,orderObjectsBy:xc,isIE:Nc},jc={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="${cr}${t}">${t}</i>`},Dc=new Set(["input","textarea","select"]),kc=(t={})=>{let e=t?.attrs?.name||t?.name;if(e)return e;const n=Vo(t);let o=t.config?.label||t.attrs?.label||t?.label;return o&&("object"==typeof o&&(o=Lc.create(o).textContent),/^<.+>.+<.+>$/gim.test(o)&&(o=(t=>{const e=document.createElement("div");return e.innerHTML=t,e.textContent||e.innerText||""})(o)),e=`${n}-${vr(((t,e,n="…")=>{if(t.length<=e)return t;const o=t.slice(0,e),i=o.lastIndexOf(" ");let r=`${i>0?o.slice(0,i):o}`;return n&&(r+=n),r})(o,24,null))}`),e||n};const Lc=new class{constructor(t=Object.create(null)){this.options=t}set setOptions(t){this.options=Ho(this.options,t)}processElemArg(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}render=t=>(t.id=`f-${t.id||Vo()}`,this.create(t));create=(t,e=!1)=>{if(!t)return;if(this.isDOMElement(t))return t;const n=this,o=["children","content"],{className:i,options:r,dataset:s,...a}=this.processElemArg(t);let l;o.push("tag");const{tag:c}=a;let d;const u={attrs:{},className:[Pc.get(a,"config.inputWrap")],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=Ho(a.attrs,{className:i})),r){const t=this.processOptions(r,a,e);if(!this.holdsContent(h)||"button"===c)return Pc.forEach(t,(t=>{u.children.push(n.create(t,e))})),a.attrs.className&&(u.className=a.attrs.className),u.id=a.id,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(Pc.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=Pc.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};onRender=(t,e,n=333)=>{const o=Date.now(),i=()=>{!t.parentElement&&Date.now()-o<n?window.requestAnimationFrame(i):t.parentElement&&e(t)};i()};actionHandler(t,e){const n={onRender:Lc.onRender,render:Lc.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(`#${ai} svg symbol`);return this.iconSymbols=Array.from(t).reduce(((t,e)=>{var n;return t[e.id.replace(cr,"")]={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){if(!t)return;const n=`${t}?${new URLSearchParams(e).toString()}`;if(this.cachedIcons?.[n])return this.cachedIcons[n];const o=this.icons[t];if(o){if(e){const t=Ho(o,e);return this.cachedIcons[n]=Lc.create(t).outerHTML,this.cachedIcons[n]}return this.cachedIcons[n]=Lc.create(o).outerHTML,this.cachedIcons[n]}return jc[Lc.options.iconFont]?.(t)||t}processAttrs(t,e,n){const{attrs:o={}}=t;if(!n&&!o.name&&null!==o.name&&this.isInput(t.tag)){const n=kc(t);n&&e.setAttribute("name",n)}for(const i of Object.keys(o)){const t=Pc.safeAttrName(i),n=this.processAttrValue(o[i]);!1!==n&&e.setAttribute(t,n)}}processAttrValue(t){if("function"==typeof t)return t();if("boolean"==typeof t)return t?"":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}toggleElementsByStr=(t,e)=>{const n=[];return Lc.elementsContainText(t,e,((t,e)=>{e?(t.style.display="block",n.push(t)):t.style.display="none"})),n};elementsContainText=(t,e,n)=>{const o=[];return Sc(t,(t=>{const i=-1!==t.textContent.toLowerCase().indexOf(e.toLowerCase());n?.(t,i),i&&o.push(t)})),o};generateOption=({type:t="option",label:e,value:n,i:i=0,selected:r})=>({tag:"option"===t?"option":"input",attrs:{type:t,value:n||`${t}-${i}`,["option"===t?"selected":"checked"]:r||!i},config:{label:e||o.get("labelCount",{label:o.get("option"),count:i})}});processOptions(t,e,n){const{action:o,attrs:i={}}=e,r=i.type||e.tag,s=i.id||e.id;return t.map(((t,a)=>{const{label:l,value:c,...d}=t,u=()=>{const u={tag:"input",attrs:{name:s,type:r,value:c||"",id:`${s}-${a}`,...d},action:o},h={tag:"label",attrs:{for:`${s}-${a}`},children:l},p={children:[u,h],className:[`f-${r}`]};return i.className&&(e.config.inputWrap=i.className),e.config.inline&&p.className.push(`f-${r}-inline`),t.selected&&(u.attrs.checked=!0),n&&(h.attrs.contenteditable=!0),p},h={select:()=>{const e=t.attrs||t,n={attrs:e,...t,...e},{label:o,checked:i,selected:r,attrs:s}=n;return{tag:"option",attrs:{...s,selected:!(!i&&!r)},children:o}},button:t=>{const{type:n,label:o,className:i,id:r}=t;return{...e,attrs:{type:n},className:i,id:r||Vo(),options:void 0,children:o,action:e.action}},checkbox:u,radio:u};return h[r]?.(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),Dc.has(e)}parsedHtml(t){const e=document.createElement("textarea");return e.innerHTML=t,e.textContent}labelAfter(t){const e=Pc.get(t,"attrs.type"),n=Pc.get(t,"config.labelAfter");return void 0!==n?n:"checkbox"===e||"radio"===e}requiredMark=()=>({tag:"span",className:"text-error",children:"*"});label(t,e){const n=Pc.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||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",()=>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}removeEmpty=t=>{const e=t.parentElement,n=Uo(t),o=e.getElementsByClassName(`formeo-${n}`);if(this.remove(t),!o.length)return this.isStage(e)?this.emptyClass(e):this.removeEmpty(e)};remove(t){const e=Uo(t);return e?au.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,Pc.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)}};Pc.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");wc.slideUp(t,600,(()=>{Lc.empty(t),t.classList.remove("removing-all-fields"),Lc.emptyClass(t),wc.slideDown(t,300)}))}toggleSortable(t,e){let n=e;const o=Uo(t);if(!o)return;const i=Uo(t.parentElement),r=Lc[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(xi.get(t.classList.item(0)));t.classList.toggle("empty",!e.length)}btnTemplate=({title:t="",...e})=>({tag:"button",attrs:{type:"button",title:t},...e});isControls=t=>Uo(t)===mi;isStage=t=>Uo(t)===gi;isRow=t=>Uo(t)===vi;isColumn=t=>Uo(t)===bi;isField=t=>Uo(t)===yi;asComponent=t=>au[`${Uo(t)}s`].get(t.id);isDOMElement(t){return t instanceof window.Element||t instanceof window.HTMLElement||!(!t||"object"!=typeof t||1!==t.nodeType||"string"!=typeof t.nodeName)}},$c="f-autocomplete",Ic=`${$c}-display-field`,Mc=`${$c}-list`,Rc="highlight-component",Wc=`${Mc}-item`,Fc=["config.label","config.controlId"],Bc=[...Fc,"config.legend","name"],zc=t=>Fc.reduce(((e,n)=>e||t.get(n)),null),Uc=t=>Bc.reduce(((e,n)=>e||t.get(n)),null)||gr(t.name),qc=new Map([["condition.source",zc],["if.condition.source",zc],["if.condition.target",zc],["then.condition.target",Uc],["condition.target",Uc]]),Vc=({id:t,...e},n)=>{const{name:o,label:i}=e;if(!o)return i;return qc.get(n)(e)},Hc=t=>(t.classList.contains(Wc)||(t=t.parentElement),t),Xc=({value:t,textLabel:e,htmlLabel:n,componentType:o,depth:i=0},r)=>{const s={tag:"li",children:n,dataset:{value:t,label:e},className:[Wc,`${Wc}-depth-${i}`,`component-type-${o}`],action:{mousedown:({target:t})=>{t=Hc(t),r.setValue(t),r.selectOption(t),r.hideList()},mouseover:({target:t})=>{t=Hc(t),r.removeHighlight(),r.highlightComponent(t)},mouseleave:({target:t})=>{t=Hc(t),r.removeHighlight()}}};return Lc.create(s)},Yc=t=>{const e=t.value,n=[],o=au.flatList(),i=Object.entries(o).reduce(((o,[i,r])=>{const s=Vc(r,t.key);if(s){const a=r.name,l={tag:"span",content:` ${gr(a)}`,className:"component-type"},c=`${a}.${s}`;n.push(c);const d=((t,e)=>{const n=t.reduce(((t,n)=>t+(n===e)),0);return n>1?`(${n})`:""})(n,c),u=[`${s} `,{tag:"span",content:d,className:"component-label-count"},l],h=[s,d].join(" ").trim();if(r.isCheckable){const e=((t,e)=>{const n=t.data.options.map(((n,o)=>{const i=`${t.address}.options[${o}]`,r=n.label,s=n.label;return Xc({value:i,textLabel:r,htmlLabel:s,componentType:"option",depth:1},e)}));return Lc.create({tag:"ul",attrs:{className:[Mc,"options-list"]},children:n})})(r,t);u.push(e)}const p=(({selectedId:t,...e})=>(e.value===t&&(e.selected=!0),e))({value:i,textLabel:h,htmlLabel:u,componentType:a,selectedId:e});o.push(Xc(p,t))}return o}),[]);return i};class Gc{lastCache=Date.now();optionsCache=null;constructor({key:t,value:e,className:n,onChange:o=ti}){this.key=t,this.className=[n||this.key.replace(/\./g,"-")].flat(),this.value=e,this.onChange=o||ti,this.events=[],this.build()}createProxy(){return new Proxy(this,{get(t,e){if(e in t)return t[e];if(e in t.dom){const n=t.dom[e];return"function"==typeof n?n.bind(t.dom):n}},set:(t,e,n)=>(e in t?t[e]=n:t.dom[e]=n,!0)})}get isAddress(){return Jo(this.value)}get valueComponent(){return Jo(this.value)&&au.getAddress(this.value)}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(`${$c}-focused`);const n=Lc.toggleElementsByStr(this.list.querySelectorAll(`.${Wc}-depth-0`),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(`${$c}-focused`),e.removeEventListener("keydown",t),this.hideList()},input:t=>{const{value:e}=t.target,n=Lc.toggleElementsByStr(this.list.querySelectorAll("li"),e);if(0===e.length&&this.clearValue(),0===n.length)this.hideList();else{const t=this.getActiveOption()||n[0];this.showList(t)}this.setValue({dataset:{label:e,value:e}})}};return this.displayField=Lc.create({tag:"input",autocomplete:"off",action:e,attrs:{type:"text",className:Ic,value:this.label||this.value,placeholder:o.get(`${this.key}.placeholder`)}}),this.hiddenField=Lc.create({tag:"input",attrs:{type:"hidden",className:$c,value:this.value}}),this.list=Lc.create({tag:"ul",attrs:{className:Mc}}),this.clearButton=Lc.create({tag:"span",content:Lc.icon("remove"),className:"clear-button hidden",action:{click:()=>this.clearValue()}}),this.dom=Lc.create({children:[this.displayField,this.clearButton,this.hiddenField],className:[$c,this.className].flat(),action:{onRender:t=>{this.stage=t.closest(".formeo-stage"),this.value&&(this.displayField.value=this.label),this.clearButton.classList.toggle("hidden",!this.value.length)}}}),this.dom}get label(){if(!Jo(this.value))return this.value;const t=this.value&&au.getAddress(this.value);return t&&Vc(t,`${this.key}`)||this.value}updateOptions(){let t=this.optionsCache;const e=Date.now();(e-this.lastCache>5*Xi||!t)&&(Lc.empty(this.list),t=this.generateOptions(),this.lastCache=e),this.list.children.length||this.list.append(...t)}generateOptions(){return this.optionsCache=Yc(this),this.optionsCache}setListPosition(){const{offsetHeight:t,offsetWidth:e}=this.displayField,n=this.displayField.closest(".formeo-stage").getBoundingClientRect(),o=this.displayField.getBoundingClientRect(),i={position:"absolute",top:o.y+t-n.y+"px",left:o.x+window.scrollX-n.x+2+"px",width:`${e}px`};Object.assign(this.list.style,i)}showList(t,e=this.list){this.stage.contains(this.list)||this.stage.appendChild(this.list),this.setListPosition(),this.selectOption(t),wc.slideDown(e,Hi)}hideList(t=this.list){wc.slideUp(t,Hi),this.removeHighlight(),this.stage.contains(this.list)&&this.stage.removeChild(this.list)}getActiveOption(t=this.list){const e=t.querySelector(".active-option");return"none"!==e?.style.display?e:null}getPreviousOption(t){let e=t;do{e=e?e.previousSibling:null}while(null!=e&&"none"===e.style.display);return e}getNextOption(t){let e=t;do{e=e?e.nextSibling:null}while(null!=e&&"none"===e.style.display);return e}selectOption(t,e=this.list){const n=e.querySelectorAll("li");for(const o of n){const{dataset:{value:t}}=o;if(o.classList.remove("active-option"),Jo(t)){const e=au.getAddress(t);e?.dom?.classList.remove(Rc)}}t&&(t.classList.add("active-option"),this.highlightComponent(t))}removeHighlight(){const t=document.getElementsByClassName(Rc);for(const e of t)e.classList.remove(Rc)}highlightComponent(t){const{dataset:{value:e}}=t;if(Jo(e)){const{componentAddress:t,isOptionAddress:n,optionIndex:o}=br(e).reduce(((t,e)=>"options"===e?(t.isOptionAddress=!0,t):t.isOptionAddress?(t.optionIndex=+e,t):(t.componentAddress.push(e),t)),{componentAddress:[],optionIndex:null,isOptionAddress:!1}),i=au.getAddress(t);if(i?.dom&&(i.dom.classList.add(Rc),n)){const t=i.dom.querySelectorAll(".field-preview .f-checkbox, .field-preview .f-radio");t[o]?.classList.add(Rc)}}}clearValue(){this.selectOption(null),this.setValue({dataset:{label:"",value:""}}),this.displayField.focus()}setValue(t){const{label:e,value:n}=t.dataset;this.displayField.value=e,this.hiddenField.value=n,this.value=n,this.clearButton.classList.toggle("hidden",!n.length),this.onChange?.({target:this.hiddenField})}}function Zc({key:t,value:e,type:n="text",checked:i}){const r={tag:"input",attrs:{type:n,value:e,placeholder:o.get(`${t}.placeholder`)||gr(t)},className:[t.replace(/\./g,"-")],config:{}};return i&&(r.attrs.checked=!0),r}function Jc(t){const e=o.get(t);if(e)return e;const n=t.split(".");return o.get(n[n.length-1])}const Kc={autocomplete:(...t)=>new Gc(...t).createProxy(),string:({key:t,value:e})=>Zc({key:t,value:e}),boolean:({key:t,value:e})=>Zc({key:t,value:e,type:"selected"===t?"radio":"checkbox",checked:!!e}),number:({key:t,value:e})=>Zc({key:t,value:e,type:"number"}),array:({key:t,value:e})=>({tag:"select",attrs:{placeholder:Jc(`placeholder.${t}`)},className:[t.replace(/\./g,"-")],options:e}),object:t=>Object.entries(t).map((([t,e])=>Kc[Lc.childType(e)]({key:t,value:e})))},Qc={boolean:(t,e)=>({click:({target:n})=>{if("radio"===n.type){const t=e.data.options.map((t=>({...t,selected:!1})));e.set("options",t)}e.set(t,n.checked),e.updatePreview()}}),string:(t,e)=>({input:({target:{value:n}})=>{e.set(t,n),e.debouncedUpdatePreview()}}),number:(t,e)=>({input:({target:{value:n}})=>{e.set(t,Number(n)),e.debouncedUpdatePreview()}}),array:(t,e)=>({change:({target:{value:n}})=>{e.set(t,n),e.debouncedUpdatePreview()}}),object:()=>({})},td="hidden-property",ed=/\.options\[\d+\]$/,nd={"if-sourceProperty":os(nr,tr,er),"if-targetProperty":os(nr),"then-targetProperty":os(nr,tr,er),...Object.entries(or).reduce(((t,[e,n])=>(t[`if-${e}`]=n,t[`then-${e}`]=n,t)),{})},od={assignment:rd,comparison:rd,logical:rd,source:({key:t,value:e,onChange:n,conditionType:o})=>Kc.autocomplete({key:`${o}.condition.${t}`,value:e,onChange:n,className:`condition-${t}`}),sourceProperty:rd,targetProperty:rd,target:t=>od.source(t),value:({key:t,value:e,onChange:n},o)=>{const i=Kc.string({key:`condition.${t}`,value:e});return i.action={input:n},i}};function id({key:t,value:e,conditionType:n}){const i=nd[`${n}-${t}`];return Object.entries(i||{}).map((([n,i])=>function({fieldName:t,fieldValue:e,key:n,optionValue:i}){return{label:o.get(`${t}.${n}`)||gr(n).toLowerCase(),value:i,selected:i===e}}({fieldName:t,fieldValue:e,key:n,optionValue:i})))}function rd({key:t,value:e,onChange:n,conditionType:o}){const i=id({key:t,value:e,conditionType:o}),r=Kc.array({key:`condition.${t}`,value:i});return r.action={change:n},r}const sd={sourceProperty:t=>{const e=t.get("source"),n=t.get("sourceProperty"),o=!!e.value,i=!!e.value.match(ed);return dd(i,n),!o},comparison:t=>{const e=t.get("source"),n=t.get("sourceProperty"),o=!!e.value,i=!!e.value.match(ed);return!o||i||"value"!==n.value},assignment:t=>{const e=t.get("target"),n=t.get("targetProperty");return!!!e.value||n.value.startsWith("is")},targetProperty:t=>{const e=t.get("target"),n=t.get("targetProperty"),o=!!e.value.match(ed);return dd(o,n),i=e.value,!_i.test(i);var i},target:t=>{const e=t.get("source"),n=t.get("sourceProperty");return!(!n||!!e?.value)||n&&"value"!==n?.value},value:t=>{const e=t.get("target"),n=t.get("targetProperty");return void 0!==n&&(!(!e||e.value)||(o=t.get("comparison"),!!o?.classList.contains(td)||(n.value===ld||n.value.startsWith("is"))));var o}},ad=t=>{for(const[e,n]of t){const o=!!sd[e]?.(t)||!1;n.classList.toggle(td,o)}},ld="isChecked",cd=t=>t.value.endsWith("Checked"),dd=(t,e)=>{if(t&&cd(e))return null;const n=Array.from(e.querySelectorAll("option")),o=[];for(const i of n){const e=cd(i),n=t?!e:e;n&&o.push(i.value),i.classList.toggle("hidden-option",n)}o.includes(e.value)&&(e.value=t?ld:n.find((t=>!cd(t)))?.value||e.value)};class ud{constructor({conditionValues:t,conditionType:e,conditionCount:n,index:o},i){this.values=new Map(function(t,e=Qi){return e.reduce(((e,n)=>(void 0!==t[n]&&e.push([n,t[n]]),e)),[])}(t)),this.conditionType=e,this.parent=i,this.baseAddress=`${i.address}.${e}`,this.fields=new Map,this.conditionCount=n,this.index=o,this.dom=this.generateDom()}setConditionIndex(t){this.index=t}get address(){return`${this.baseAddress}[${this.index}]`}destroy(){const t=au.getAddress(this.baseAddress);t.splice(this.index,1),au.setAddress(this.baseAddress,t),wc.slideUp(this.dom,Hi,(()=>{this.dom.remove()}))}label(){return this.index?null:{tag:"label",className:`condition-label ${this.conditionType}-condition-label`,content:o.get(`condition.type.${this.conditionType}`)}}generateDom(){const t=[];for(const[n,o]of this.values){const e=t=>this.onChangeCondition({key:n,target:t.target}),i={key:n,value:o,conditionType:this.conditionType,onChange:e},r=od[n](i,this.values),s=r.dom||Lc.create(r);this.fields.set(n,r.dom?r:s),t.push(s)}const e={children:[this.label(),...t,...this.generateConditionTypeActionButtons()],className:`f-condition-row ${this.conditionType}-condition-row display-none`,action:{onRender:t=>{this.processUiState()}}};return Lc.create(e)}generateConditionTypeActionButtons(){const t=[],e="manage-condition-type",n=t=>`${t}-condition-type`,i=Lc.btnTemplate({title:o.get(`remove${this.conditionType}Condition`),className:[e,n("remove")],content:Lc.icon("minus"),action:{click:()=>this.destroy(),mouseover:t=>{this.dom.classList.add("to-remove")},mouseout:t=>{this.dom.classList.remove("to-remove")}}});t.push(i);const r=Lc.btnTemplate({title:o.get(`add${this.conditionType}Condition`),className:[e,n("add")],content:Lc.icon("plus"),action:{click:()=>{const t=this.parent.addConditionType(this.conditionType),e={changedProperty:null,dataPath:t.address,value:t.value,src:t.dom};this.updateDataDebounced(e)}}});return t.push(r),t}get value(){return Array.from(this.fields).reduce(((t,[e,n])=>(t[e]=n.value,t)),{})}processUiState(){ad(this.fields),this.dom.classList.remove("display-none")}updateDataDebounced=Ko((t=>{hu.formeoUpdated(t),au.setAddress(t.dataPath,t.value)}));onChangeCondition=({key:t,target:e})=>{const n={changedProperty:t,dataPath:this.address,value:this.value,src:e};ad(this.fields),this.updateDataDebounced(n)}}const hd=new Map([["attrs",({itemKey:t})=>t],["options",({itemKey:t,key:e})=>`${t}.${e}`]]),pd=(t,e)=>{if("select"===e.controlId){const n=e.editPanels.get("options"),[o,i]=t?ur:hr,r=n.data.map((({[o]:t,...e})=>({[i]:t,...e})));n.setData(r)}},fd=new Map([["attrs-multiple",t=>({change:({target:e})=>{"select"===t.field.controlId&&pd(e.checked,t.field)}})]]);class md{constructor({key:t,index:e,field:n,panel:o,data:i}){this.field=n,this.itemKey=t,this.itemIndex=e,this.panel=o,this.panelName=o.name,this.isDisabled=n.isDisabledProp(t,this.panelName),this.isHidden=this.isDisabled&&n.config.panels[this.panelName].hideDisabled,this.isLocked=n.isLockedProp(t,this.panelName),this.address=`${n.indexName}.${n.id}.${t}`,this.itemSlug=yr(t),this.conditionTypeWrap=new Map,void 0!==i&&void 0===this.field.get(this.itemKey)&&this.field.set(this.itemKey,i);const r=[`field-${this.itemSlug}`,"prop-wrap"];this.isHidden&&r.push("hidden-property"),this.dom=Lc.create({tag:"li",className:r,children:{className:"component-prop",children:[this.itemInputs(),this.itemControls]}})}get itemValues(){const t=this.field.get(this.itemKey);return t?.constructor===Object?xc(Object.entries(t),ur,"0"):[[this.itemKey,t]]}findOrCreateConditionTypeWrap(t){let e=this.conditionTypeWrap.get(t);return e||(e=Lc.create({className:`type-conditions-wrap ${t}-conditions-wrap`}),this.conditionTypeWrap.set(t,e),e)}itemInputs(){const t=Lc.create({className:`${this.panelName}-prop-inputs prop-inputs f-input-group`,children:this.itemValues.map((([t,e])=>"conditions"===this.panelName?this.generateConditionFields(t,e):this.itemInput(t,e)))});return this.inputs&&this.inputs.replaceWith(t),this.inputs=t,t}addConditionType=(t,e)=>{const n=this.findOrCreateConditionTypeWrap(t);let o=e;if(!o){const[e]=sr()[t],i=n.children.length;"if"===t&&(e.logical="||"),o={conditionValues:e,conditionCount:i,index:i}}const i=new ud({conditionType:t,...o},this);return n.appendChild(i.dom),i};removeConditionType=(t,e)=>{const n=this.conditionTypeWrap.get(t),o=n.children[e];o.destroy(),n.removeChild(o.dom)};generateConditionFields=(t,e)=>(this.conditions=new Map,e.forEach(((n,o)=>{const i=this.addConditionType(t,{index:o,conditionCount:e.length,conditionValues:n});this.conditions.set(o,i)})),this.findOrCreateConditionTypeWrap(t));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:()=>{wc.slideUp(this.dom,Vi,(t=>{this.field.remove(this.itemKey),t.remove(),this.panel.updateProps()}))},mouseover:t=>{this.dom.classList.add("to-remove")},mouseout:t=>{this.dom.classList.remove("to-remove")}},content:Lc.icon("remove")};return{className:`${this.panelName}-prop-controls prop-controls`,content:[t]}}itemInput(t,e){const n=Lc.childType(e)||"string",o=hd.get(this.panelName)?.({itemKey:this.itemKey,key:t})||this.itemKey,i=o.split(".").filter(Number.isNaN).join(".")||t,r=Kc[n]({key:t,value:e}),s=`${this.field.shortId}-${yr(o).replace(/-\d+-(selected)/g,"-$1")}`,a={label:"options"!==this.panelName&&(Jc(i)||gr(i)),labelAfter:!1},l={name:"checkbox"===r.attrs.type?`${s}[]`:s};l.disabled=this.isDisabled,l.locked=this.isLocked;const c=fd.get(this.itemSlug)?.(this),d=function(t,e={}){const n={...t};for(const o in e)Object.hasOwn(e,o)&&(Object.hasOwn(n,o)?Array.isArray(n[o])?n[o].push(e[o]):n[o]=[n[o],e[o]]:n[o]=e[o]);return n}(Qc[n](o,this.field),c||{}),u=Ho(Kc[n]({key:t,value:e}),{action:d,attrs:l,config:a});return ur.includes(t)?{className:"f-addon",children:u}:u}}const gd={multiple:(t,e)=>{pd(!!t,e)}};class vd{constructor(t,e,n){this.type=Lc.childType(t),this.name=e,this.component=n,this.panelConfig=this.getPanelConfig(this.data)}get data(){const t=this.component.get(this.name);return"object"===this.type?Object.entries(t):t}getPanelConfig(t){return this.props=this.createProps(t),this.editButtons=this.createEditButtons(),{config:{label:o.get(`panel.label.${this.name}`)},attrs:{className:`${fi} ${this.name}-panel`},children:[this.props,this.editButtons]}}createProps(t=this.data){this.editPanelItems=Array.from(t).map(((t,e)=>{const n="array"===this.type,o=n?`[${e}]`:`.${t[0]}`,i=n?t:{[t[0]]:t[1]};return new md({key:`${this.name}${o}`,data:i,field:this.component,index:e,panel:this})}));const e={tag:"ul",attrs:{className:["edit-group",`${this.component.name}-edit-group`,`${this.component.name}-edit-${this.name}`]},editGroup:this.name,isSortable:"options"===this.name,content:this.editPanelItems};return Lc.create(e)}updateProps(){const t=this.createProps();this.props.replaceWith(t),this.props=t}createEditButtons(){const t=this.name,e=o.get(`panelEditButtons.${t}`),n={attrs:this.addAttribute,options:this.addOption,conditions:this.addCondition},i=[];if("conditions"===t){o.current.clearAll||o.put("clearAll","Clear All");const e={...Lc.btnTemplate({content:[Lc.icon("bin"),o.get("clearAll")],title:o.get("clearAll")}),className:`clear-all-${t}`,action:{click:()=>{this.clearAllItems()}}};i.push(e)}const r={...Lc.btnTemplate({content:e,title:e}),className:`add-${t}`,action:{click:e=>{const i={btnCoords:Lc.coords(e.target),addAction:n[t]};"attrs"===t&&(i.isDisabled=this.component.isDisabledProp,i.isLocked=this.component.isLockedProp,i.message={attr:o.get(`action.add.${t}.attr`),value:o.get(`action.add.${t}.value`)});const r=gr(t),s=new window.CustomEvent(`onAdd${r}`,{detail:i});gu.add[t](i),document.dispatchEvent(s)}}};i.push(r);return{className:"panel-action-buttons",content:i}}addAttribute=(t,e)=>{let n=e;const i=Ac(t),r=`attrs.${i}`;o.current[r]||o.put(r,Tc(t)),"string"==typeof n&&["true","false"].includes(n)&&(n=JSON.parse(n)),this.component.set(`attrs.${t}`,n),gd[i]?.(n,this.component);const s=this.props.querySelector(`.${this.component.name}-attrs-${i}`),a=new md({key:r,data:{[i]:n},field:this.component,panel:this});s?s.replaceWith(a.dom):this.props.appendChild(a.dom),this.component.resizePanelWrap()};addOption=()=>{const t=this.component.data.config.controlId,e=this.component.get("options"),n="select"===t?"option":t,i=o.get("newOptionLabel",{type:n})||"New Option",r=`${this.name}[${this.data.length}]`,s=e[e.length-1],a={...e.length?s:{},label:i};"button"!==t&&(a.value=vr(i));const l=new md({key:r,data:a,field:this.component,index:this.props.children.length,panel:this});this.editPanelItems.push(l),this.props.appendChild(l.dom),this.component.debouncedUpdatePreview(),this.component.resizePanelWrap()};addCondition=t=>{const e=`conditions[${this.component.get("conditions").length}]`,n=new md({key:e,data:t.template,field:this.component,panel:this});this.props.appendChild(n.dom),this.component.set(e,t.template),this.component.resizePanelWrap()};clearAllItems=()=>{const t="array"===this.type?[]:{},e={type:this.name,removeAction:()=>{this.component.set(this.name,t),this.updateProps()}};gu.remove[this.name](e);const n=gr(this.name),o=new window.CustomEvent(`onRemove${n}`,{detail:e});document.dispatchEvent(o)};setData(t){this.data=t,this.component.set(this.name,t),this.updateProps()}}const bd=Object.freeze({type:"field",displayType:"slider"}),yd=t=>({transform:`translateX(${t?`${t}px`:0})`});class wd{constructor(t){this.opts=Ho(bd,t),this.panelDisplay=this.opts.displayType,this.activePanelIndex=0,this.panelNav=this.createPanelNav();const e=this.createPanelsWrap();this.nav=this.navActions(),this.nav.groupChange(this.activePanelIndex);const n=new window.ResizeObserver((([{contentRect:{width:t}}])=>{this.currentWidth!==t&&(this.toggleTabbedLayout(),this.currentWidth=t,this.nav.setTranslateX(this.activePanelIndex,!1))})),o=window.setTimeout((()=>{n.observe(e),window.clearTimeout(o)}),Xi)}getPanelDisplay(){const t=this.panelsWrap,e=Number.parseInt(Lc.getStyle(t,"width"),10)>390?"tabbed":"slider",n="auto"===this.opts.displayType;return this.panelDisplay=n?e:this.opts.displayType||bd.displayType,this.panelDisplay}toggleTabbedLayout=()=>{this.getPanelDisplay();const t=this.isTabbed;return this.panelsWrap.parentElement?.classList.toggle("tabbed-panels",t),t&&this.panelNav.removeAttribute("style"),t};resizePanels=()=>{this.toggleTabbedLayout()};createPanelsWrap(){const t=Lc.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 Pc.forEach(e,(t=>{t.fieldId=this.opts.id,t.isSortable&&Ql.create(t,{animation:150,group:{name:`edit-${t.editGroup}`,pull:!0,put:["properties"]},sort:!0,handle:".prop-order",onSort:t=>{this.propertySave(t.to),this.resizePanels()}})}))}createPanelNavLabels(){const t=this.opts.panels.map((t=>({tag:"h5",action:{click:t=>{const e=Ec(t.target);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",Lc.create(e)}createPanelNav(){this.labels=this.createPanelNavLabels();const t={tag:"button",attrs:{className:"next-group",title:o.get("controlGroups.nextGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:t=>this.nav.nextGroup(t)},content:Lc.icon("triangle-right")},e={tag:"button",attrs:{className:"prev-group",title:o.get("controlGroups.prevGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:t=>this.nav.prevGroup(t)},content:Lc.icon("triangle-left")};return Lc.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=Ec(this.currentPanel);let r={nav:0,panel:0},s={...r};t.groupChange=t=>(this.activePanelIndex=t,this.currentPanel=i[t],Lc.removeClasses(i,"active-panel"),Lc.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=Hi,animate:r=!this.isTabbed})=>{const a=[yd(s.panel),yd(t.panel)],l=[yd(s.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:r?i:0,fill:"forwards"},d=e.animate(a,c);n.animate(l,c);const u=()=>{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}}let Cd=null;const Ed=os(nr);class xd extends ma{constructor(t,e={}){const n={...e,id:e.id||Vo()};super(t,n),this.id=n.id,this.shortId=this.id.slice(0,this.id.indexOf("-")),this.name=t,this.indexName=`${t}s`,this.config=au[`${this.name}s`].config,Ho(this.config,n.config),this.address=`${this.name}s.${this.id}`,this.dataPath=`${this.address}.`,this.editPanels=new Map,this.eventListeners=new Map,this.initEventHandlers()}initEventHandlers(){this.config.events&&Object.entries(this.config.events).forEach((([t,e])=>{this.addEventListener(t,e)}))}addEventListener(t,e){this.eventListeners.has(t)||this.eventListeners.set(t,[]),this.eventListeners.get(t).push(e)}removeEventListener(t,e){if(!this.eventListeners?.has(t))return;const n=this.eventListeners.get(t),o=n.indexOf(e);o>-1&&n.splice(o,1)}dispatchComponentEvent(t,e={}){const n={component:this,type:t,timestamp:Date.now(),...e};return this.eventListeners?.has(t)&&this.eventListeners.get(t).forEach((t=>{try{"function"==typeof t&&t(n)}catch(e){}})),n}set(t,e){const n=this.get(t),o=super.set(t,e);return n!==e&&this.dom&&this.dispatchComponentEvent("onUpdate",{path:t,oldValue:n,newValue:e}),o}get js(){return this.data}get json(){return this.data}remove=t=>{if(t){const e=br(t),n=e.pop(),o=this.get(e);return Array.isArray(o)?Cc(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 this.dispatchComponentEvent("onRemove",{path:t,parent:e,children:[...n]}),Sc(n,(t=>t.remove())),this.dom.parentElement.removeChild(this.dom),((t,e)=>{const n=t.indexOf(e);-1!==n&&t.splice(n,1)})(au.getAddress(`${e.name}s.${e.id}.children`),this.id),e.children.length||e.emptyClass(),"row"===e.name&&e.autoColumnWidths(),au[`${this.name}s`].delete(this.id)};empty(){const t=this.children.map((t=>(t.remove(),t)));return this.dom.classList.add("empty"),t}emptyClass=()=>this.dom.classList.toggle("empty",!this.children.length);getActionButtons(){const t=[`hovering-${this.name}`,"hovering"];return{className:[`${this.name}-actions`,"group-actions"],action:{mouseenter:()=>{au.stages.active.dom.classList.add(`active-hover-${this.name}`),this.dom.classList.add(...t)},mouseleave:({target:e})=>{this.dom.classList.remove(...t),au.stages.active.dom.classList.remove(`active-hover-${this.name}`),e.removeAttribute("style")}},children:[{...Lc.btnTemplate({content:Lc.icon(`handle-${this.name}`)}),className:["component-handle",`${this.name}-handle`]},{className:["action-btn-wrap",`${this.name}-action-btn-wrap`],children:this.buttons}]}}getComponentTag=()=>Lc.create({tag:"span",className:["component-tag",`${this.name}-tag`],children:[(this.isColumn||this.isField)&&Lc.icon("component-corner",{className:"bottom-left"}),Lc.icon(`handle-${this.name}`),gr(this.name),(this.isColumn||this.isRow)&&Lc.icon("component-corner",{className:"bottom-right"})].filter(Boolean)});toggleEdit(t=!this.isEditing){this.isEditing=t;const e=this.dom,n="editing",o=`${n}-${this.name}`,i=this.dom.querySelector(`.${this.name}-edit`);wc.slideToggle(i,Vi,t),"field"===this.name&&(wc.slideToggle(this.preview,Vi,!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}`)=>({...Lc.btnTemplate({content:Lc.icon(t)}),className:["component-handle"]}),move:(t="move")=>({...Lc.btnTemplate({content:Lc.icon(t)}),className:["item-move"],meta:{id:"move"}}),edit:(t="edit")=>({...Lc.btnTemplate({content:Lc.icon(t)}),className:["edit-toggle"],meta:{id:"edit"},action:{click:()=>{this.toggleEdit()}}}),remove:(t="remove")=>({...Lc.btnTemplate({content:Lc.icon(t)}),className:["item-remove"],meta:{id:"remove"},action:{click:()=>{wc.slideUp(this.dom,Vi,(()=>{if("column"===this.name){this.parent.autoColumnWidths(),this.remove()}else this.remove()}))}}}),clone:(t="copy")=>({...Lc.btnTemplate({content:Lc.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=>t[e]?.()||e));return this.actionButtons=o,this.actionButtons}get index(){return Ec(this.dom)}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[Lc.childType(t)](this.dom)};get parentType(){return Bi.get(this.name)}get parent(){const t=this.parentType;if(!this.dom||!t)return null;const e=this.dom.closest(`.${Di[t]}`);return e&&Lc.asComponent(e)}get children(){if(!this.dom)return[];const t=this.domChildren,e=Wi.get(this.name);return Oc(t,(t=>au.getAddress(`${e}s.${t.id}`))).filter(Boolean)}loadChildren=(t=this.data.children)=>t.map((t=>this.addChild({id:t})));get domChildren(){const t=this.dom.querySelector(".children");return t?t.children:[]}addChild(t={},e=this.domChildren.length){let n=t;"object"!=typeof t&&(n={id:n});const o=this.dom.querySelector(".children"),{id:i=Vo()}=n,r=Wi.get(this.name);if(!r)return null;const s=`${r}s`,a=au.getAddress(`${s}.${i}`)||au[s].add(i,n);e>=o.children.length?o.appendChild(a.dom):o.children[e].before(a.dom),this.dispatchComponentEvent("onAddChild",{parent:this,target:a,child:a,index:e}),a.dispatchComponentEvent("onAdd",{parent:this,target:a,index:e,addedVia:"addChild"}),this.config.events?.onAddChild?.({parent:this,child:a});const l=a.get("children");return l?.length&&a.loadChildren(l),this.removeClasses("empty"),this.saveChildOrder(),a}saveChildOrder=()=>{if(this.render)return;const t=this.children.map((({id:t})=>t));return this.set("children",t),t};onAdd({from:t,to:e,item:n,newIndex:o}){t.classList.contains(mi)||(t=t.parentElement);const i=Uo(t),r=Uo(e.parentElement),s=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=Ec(this.dom);return()=>this.parent.addChild(t,e+1)}],[2,t=>()=>this.parent.parent.addChild(t)]]),a={controls:async()=>{if(!Cd){const{default:t}=await Promise.resolve().then((()=>Gd));Cd=t}const{controlData:{meta:{id:t},...e}}=Cd.get(n.id);ns(e,"config.controlId",t);const i=t.startsWith("layout-")?t.replace(/^layout-/,""):"field",r=es({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}`),a=s.get(r)();Lc.remove(n);return a(e,o)},row:()=>{const t=(s.get({stage:-1,row:0,column:1}[r])||Qo)();return t?.({id:n.id},o)},column:()=>{const t=(s.get({stage:-2,row:-1}[r])||Qo)();return t?.(n.id)}},l=a[i]?.(n,o);return this.dispatchComponentEvent("onAdd",{from:t,to:e,item:n,newIndex:o,fromType:i,toType:r,addedComponent:l,addedVia:"dragDrop"}),(()=>{this.saveChildOrder(),this.removeClasses("empty")})(),l}onSort=()=>this.saveChildOrder();onRemove({from:{parentElement:t}}){return t.classList.contains(bi)&&t.classList.remove("column-editing-field"),"stage"===this.name||this.children.length?(this.emptyClass(),this.saveChildOrder()):this.remove()}onEnd=({to:{parentElement:t},from:{parentElement:e}})=>{t?.classList.remove(`hovering-${Uo(t)}`),e?.classList.remove(`hovering-${Uo(e)}`)};onRender(){this.dispatchComponentEvent("onRender",{dom:this.dom});const{events:t}=this.config;if(!t)return null;t.onRender&&Lc.onRender(this.dom,t.onRender)}set config(t){const e=es(t,"all"),n=es(this.data,"config.controlId"),o=[e,n&&es(t,n),es(t,this.id)].reduce(((t,e)=>e?Ho(t,e):t),this.configVal);this.configVal=o}get config(){return this.configVal}runConditions=()=>{const t=this.get("conditions");if(!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)))}))};getComponent(t){const[e,n]=t.split("."),o=au[e];return n===this.id?this:o?.get(n)}value=(t,e)=>{const n=t.split("."),o=this.getComponent(t),i=o&&n.slice(2,n.length).join(".");return[!o,!i,!Ed[i]].some(Boolean)?t:e?o.set(Ed[i],e):o.get(Ed[i])};getResult=t=>({"=":(t,e,n)=>t.set(e,n)}[t]);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)}}));execResults=t=>{const e=t.map((t=>this.execResult(t)));return Promise.all(e)};execResult=({target:t,action:e,value:n,_propertyPath:o})=>new Promise(((o,i)=>{try{return o(e(t,n))}catch(r){return i(r)}}));cloneData=()=>{const t={...Xo(this.data),id:Vo()};return"field"!==this.name&&(t.children=[]),t};clone=(t=this.parent)=>{const e=t.addChild(this.cloneData(),this.index+1);return"field"!==this.name&&this.cloneChildren(e),this.dispatchComponentEvent("onClone",{original:this,clone:e,parent:t}),e};cloneChildren(t){for(const e of this.children)e?.clone(t)}createChildWrap=t=>Lc.create({tag:"ul",attrs:{className:"children"},children:t});get isRow(){return this.name===Pi.row}get isColumn(){return this.name===Pi.column}get isField(){return this.name===Pi.field}isDisabledProp=(t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.disabled.concat(this.get("config.disabled")).includes(t)};isLockedProp=(t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.locked.concat(this.get("config.locked")).includes(t)};get editWindow(){const t={className:["component-edit",`${this.name}-edit`,"slide-toggle","formeo-panels-wrap"]},e=this.editPanels.size;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.querySelector(".edit-toggle"),e=this.dom.querySelector(`.${this.name}-actions`),n=e.getElementsByTagName("button");e.style.maxWidth=n.length*n[0].clientWidth+"px",Lc.remove(t)}else this.resizePanelWrap()}},Lc.create(t)}updateEditPanels=()=>{if(!this.config)return null;const t=["object","array"],e=qo([...this.config.panels.order,...Object.keys(this.data)]),n=["children","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=Lc.childType(e);if(t.includes(n)){const t=new vd(e,r,this);this.editPanels.set(t.name,t)}}const i={panels:Array.from(this.editPanels.values()).map((({panelConfig:t})=>t)),id:this.id,displayType:"auto"};this.panels=new wd(i),this.dom&&(this.dom.querySelector(".panel-nav").replaceWith(this.panels.panelNav),this.dom.querySelector(".panels").replaceWith(this.panels.panelsWrap))}}class Sd{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=Lc.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(`.${vi}`);if(this.validateResizeTarget(e,n))if(this.startX="touchstart"===t.type?t.touches[0].clientX:t.clientX,o.classList.add(Ei),this.columnPreset=o.querySelector(`.${Ci}`),this.originalColumnClass=e.className,this.originalSiblingClass=n.className,e.className=e.className.replace(lr,""),n.className=n.className.replace(lr,""),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(Yo(e,this.rowWidth)),i=parseFloat(Yo(n,this.rowWidth));return o<10||i<10?null:{colWidth:Go(o.toFixed(1)),siblingColWidth:Go(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(),au.setAddress(`columns.${t.id}.config.width`,t.dataset.colWidth),au.setAddress(`columns.${e.id}.config.width`,e.dataset.colWidth),this.row.classList.remove(Ei),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(Ei),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const t=this.columnPreset;let e=t.querySelector(`.${wi}`);const n=this.row.querySelector(".children").children,o=Oc(n,(t=>Yo(t.clientWidth,this.rowWidth).toFixed(1))),i=o.join(","),r=o.join(" | ");return e||(e=Lc.create({tag:"option",attrs:{className:wi,value:i,selected:!0},content:r}),t.append(e)),e.value=i,e.textContent=r,i}}const Od=t=>({className:"resize-x-handle",action:{pointerdown:t.onStart.bind(t)},content:[Lc.icon("triangle-down"),Lc.icon("triangle-up")]}),_d=()=>({className:"column-edit group-config"});class Ad extends xd{constructor(t){super("column",{...Object.freeze({config:{width:"100%"},children:[],className:[bi]}),...t});const e=this.createChildWrap();this.dom=Lc.create({tag:"li",className:[bi,"empty"],dataset:{hoverTag:o.get("column")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),_d(),Od(new Sd),e]}),this.processConfig(),hu.columnResized=new window.CustomEvent("columnResized",{detail:{column:this.dom,instance:this}}),Ql.create(e,{animation:150,fallbackClass:"field-moving",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:`.${yi}`,handle:".item-move"})}processConfig(){const t=Pc.get(this.data,"config.width");t&&this.setDomWidth(t)}refreshFieldPanels=()=>{for(const t of this.children)t.panels.nav.refresh()};setDomWidth=t=>{this.dom.dataset.colWidth=t,this.dom.style.width=t};setWidth=t=>(this.setDomWidth(t),this.set("config.width",t))}const Td={actionButtons:{buttons:["clone","move","remove"],disabled:[]}};const Nd=new class extends ga{constructor(t){super("columns",t),this.config={all:Td}}Component(t){return new Ad(t)}};class Pd extends xd{constructor(t){super("row",{...Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[vi]}),...t});const e=this.createChildWrap();this.dom=Lc.create({tag:"li",className:[vi,"empty"],dataset:{hoverTag:o.get("row"),editingHoverTag:o.get("editing.row")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),this.editWindow,e]}),Ql.create(e,{animation:150,fallbackClass:"column-moving",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:`.${bi}`,handle:".item-move"})}get editWindow(){const t={tag:"input",id:`${this.id}-fieldset`,attrs:{type:"checkbox",checked:this.get("config.fieldset"),ariaLabel:o.get("row.settings.fieldsetWrap.aria")},action:{click:({target:{checked:t}})=>{this.set("config.fieldset",Boolean(t))}},config:{label:o.get("row.settings.fieldsetWrap")}},e={tag:"input",id:`${this.id}-inputGroup`,attrs:{type:"checkbox",checked:this.get("config.inputGroup"),ariaLabel:o.get("row.settings.inputGroup.aria")},action:{click:({target:{checked:t}})=>this.set("config.inputGroup",t)},config:{label:o.get("row.makeInputGroup"),description:o.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:""}},i=Lc.formGroup([t,n]),r={tag:"label",content:o.get("defineColumnWidths"),className:"col-sm-4 form-control-label"};this.columnPresetControl=Lc.create(this.columnPresetControlConfig);const s={className:"col-sm-8",content:this.columnPresetControl,action:{onRender:()=>{this.updateColumnPreset()}}},a=[e,"hr",i,"hr",Lc.formGroup([r,s],"row")];return Lc.create({className:`${this.name}-edit group-config`,action:{onRender:t=>{const e=a.map((t=>Lc.create(t)));t.append(...e)}}})}onAdd(...t){super.onAdd(...t),this.autoColumnWidths()}onRemove(...t){super.onRemove(...t),this.autoColumnWidths()}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(lr);const t=n.dom,o=Go(e);n.set("config.width",o),t.style.width=o,t.dataset.colWidth=o;const i=setTimeout((()=>{clearTimeout(i),n.refreshFieldPanels()}),Hi);document.dispatchEvent(hu.columnResized)}this.updateColumnPreset()};updateColumnPreset=()=>{this.columnPresetControl.innerHTML="";const t=this.getColumnPresetOptions.map((({label:t,...e})=>Lc.create({tag:"option",content:t,attrs:e})));this.columnPresetControl.append(...t)};setColumnWidths=t=>{"string"==typeof t&&(t=t.split(",")),this.children.forEach(((e,n)=>{e.setWidth(`${t[n]}%`),e.refreshFieldPanels()}))};get getColumnPresetOptions(){const t=this.children,e=zi.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:wi}),t.map((t=>{const e={...t};return e.selected=t.value===n,e}))}return[]}get columnPresetControlConfig(){return{tag:"select",attrs:{ariaLabel:o.get("defineColumnLayout"),className:Ci},action:{change:({target:t})=>{const{value:e}=t;this.setColumnWidths(e)}},options:this.getColumnPresetOptions}}}const jd={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}};const Dd=new class extends ga{constructor(t){super("rows",t),this.config={all:jd}}Component(t){return new Pd(t)}};class kd extends xd{constructor(t){super("stage",{conditions:[sr()],children:[],...t}),this.updateEditPanels(),this.debouncedUpdateEditPanels=Ko(this.updateEditPanels),o.get("Untitled Form"),o.get("Untitled Form"),o.get("Form Title"),o.get("Form novalidate"),o.get("Tags");const e=this.createChildWrap();this.dom=Lc.create({attrs:{className:[gi,"empty"],id:this.id},children:[this.getComponentTag(),this.getActionButtons(),this.editWindow,e]}),Ql.create(e,{animation:150,fallbackClass:"row-moving",group:{name:"stage",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onAdd:this.onAdd.bind(this),onRemove:this.onRemove.bind(this),onStart:()=>{Ld.active=this},onSort:this.onSort.bind(this),draggable:`.${vi}`,handle:".item-move"})}empty(t=!0){return new Promise((e=>{t?(this.dom.classList.add("removing-all-fields"),wc.slideUp(this.dom,Vi,(()=>{e(super.empty(t)),this.dom.classList.remove("removing-all-fields"),wc.slideDown(this.dom,Vi)}))):e(super.empty())}))}onAdd(...t){const e=super.onAdd(...t);e&&"column"===e.name&&e.parent.autoColumnWidths()}}const Ld=new class extends ga{constructor(t){super("stages",t),this.config={all:{actionButtons:{buttons:["edit"],disabled:[]},panels:{disabled:[],order:["attrs","options","conditions"]}}}}Component(t){return new kd(t)}},$d={js:new Set,css:new Set},Id=(t,e,n=ti)=>new Promise((o=>fetch(t).then((t=>{if(!t.ok)return o(n(t));o(e?e(t):t)})).catch((t=>n(t))))),Md=(t,e)=>{t.removeEventListener("load",Md),e(t.src)},Rd=(t,e)=>{t.removeEventListener("load",Rd),e(t.src)},Wd=t=>new Promise(((e,n)=>{if($d.js.has(t))return e(t);$d.js.add(t);const o=Lc.create({tag:"script",attrs:{type:"text/javascript",async:!0,src:t},action:{load:()=>Rd(o,e),error:()=>n(new Error(`${t} failed to load.`))}});document.head.appendChild(o)})),Fd=t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>new Promise(((e,n)=>{if($d.css.has(t))return e(t);$d.css.add(t);const o=Lc.create({tag:"link",attrs:{rel:"stylesheet",href:t},action:{load:()=>Md(o,e),error:()=>n(new Error(`${(void 0).src} failed to load.`))}});document.head.appendChild(o)}))));return Promise.all(e)},Bd=async(t=ui)=>{if(document.getElementById(ai))return;const e=async t=>(t=>{let e=document.getElementById(ai);return e||(e=Lc.create({id:ai,children:t,attrs:{hidden:!0,style:"display: none;"}}),document.body.insertBefore(e,document.body.childNodes[0])),e})(await t.text());return Id(t,e,(()=>Id(hi,e)))},zd={js:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>Wd(t)));return Promise.all(e)},css:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>Fd(t)));return Promise.all(e)}},Ud=t=>{const e=Object.entries(t).map((([t,e])=>zd[t](e)));return Promise.all(e)},qd=()=>{const t=document.getElementById(ai);return"hidden"===window.getComputedStyle(t).visibility};class Vd{controlCache=new Set;constructor({events:t={},dependencies:e={},controlAction:n,...o}){this.events=t,this.controlData=o,this.controlAction=n,this.dependencies=e,this.id=o.id||Vo()}get controlId(){return this.controlData.meta?.id||this.controlData.config?.controlId}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:Lc.icon(t.icon)},{tag:"span",className:"control-label",content:n}],action:{focus:({target:t})=>{const e=t.closest(`.${mi}`);return e&&Yd.panels.nav.refresh(Ec(e))},click:({target:t})=>{const e=t.closest(".field-control")?.id;e&&Yd.addElement(e)}}};return Lc.create({tag:"li",id:this.id,className:["field-control",`${t.group}-control`,`${t.id}-control`],content:o,meta:t,action:this.controlAction})}promise(){return Ud(this.dependencies)}i18n(t,e){const n=o.locale,i=this.definition?.i18n,r=i?.[n]||{};return(r[t]?.()??r[t])||o.get(t,e)}}const Hd=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"}});let Xd=class{constructor(){this.data=new Map,this.buttonActions={focus:({target:t})=>{const e=t.closest(`.${mi}`);return e&&this.panels.nav.refresh(Ec(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((t=>{const e="function"==typeof t?new t:new Vd(t);return this.add(e),this.controls.push(e.dom),e.promise()}))}groupLabel=t=>o.get(t)||t||"";groupElements(){let t=this.options.groups.slice(),e=this.controls.slice(),n=[];const o=[];return t=xc(t,this.groupOrder,"id"),t=t.filter((t=>zo(t.id,this.options.disable.groups))),n=t.map((t=>{const n={tag:"ul",attrs:{className:[mi,fi],id:`${t.id}-${mi}`},config:{label:this.groupLabel(t.label)}};if(this.options.elementOrder[t.id]){const e=this.options.elementOrder[t.id],n=qo(e.concat(t.elementOrder));t.elementOrder=n}return e=xc(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=[zo(i,this.options.disable.elements),n.meta.group===t.id,!o.includes(i)].every((t=>!0===t)),r&&o.push(i),r})),n})),n}add(t=Object.create(null)){const e=Xo(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 Xo(this.data.get(t))}formActions(){if(!0===this.options.disable.formActions)return null;const t={...Lc.btnTemplate({content:[Lc.icon("bin"),o.get("clear")],title:o.get("clearAll")}),className:["clear-form"],action:{click:t=>{Dd.size?(hu.confirmClearAll=new window.CustomEvent("confirmClearAll",{detail:{confirmationMessage:o.get("confirmClearAll"),clearAllAction:()=>{Ld.clearAll().then((()=>{const e={src:t.target};hu.formeoCleared(e)}))},btnCoords:Lc.coords(t.target)}}),document.dispatchEvent(hu.confirmClearAll)):window.alert(o.get("cannotClearFields"))}}},e={...Lc.btnTemplate({content:[Lc.icon("floppy-disk"),o.get("save")],title:o.get("save")}),className:["save-form"],action:{click:async({target:t})=>{const{default:e}=await Promise.resolve().then((()=>lu)),{formData:n}=e,o={action:()=>{},coords:Lc.coords(t),message:"",button:t};return gu.click.btn(o),gu.save.form(n)}}};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:i}=this.options.panels;this.panels=new wd({panels:e,type:"controls",displayType:i});const r=["control-groups","formeo-panels-wrap",`panel-count-${e.length}`],s=Lc.create({className:r,content:[this.panels.panelNav,this.panels.panelsWrap]}),a=["formeo-controls"];t&&a.push("formeo-sticky");const l=Lc.create({className:a,content:[s,n]}),c=l.getElementsByClassName("control-group");this.dom=l,this.groups=c;const[d]=c;this.currentGroup=d,this.actions={filter:t=>{const e=""!==t,n=this.controls;let i=s.querySelector(".filtered-term");if(Lc.toggleElementsByStr(n,t),e){const e=o.get("controls.filteringTerm",t);l.classList.add("filtered"),i?i.textContent=e:(i=Lc.create({tag:"h5",className:"filtered-term",content:e}),s.insertBefore(i,s.firstChild))}else i&&(l.classList.remove("filtered"),i.remove())},addElement:this.addElement,addGroup:t=>{}};for(let o=c.length-1;o>=0;o--){const t=`formeo-controls-${c[o]}`;this.options.sortable||window.localStorage.removeItem(t),Ql.create(c[o],{animation:150,forceFallback:!0,fallbackClass:"control-moving",fallbackOnBody:!0,group:{name:"controls",pull:"clone",put:!1},onStart:async({item:t})=>{const{controlData:e}=this.get(t.id);if(this.options.ghostPreview){const{default:n}=await Promise.resolve().then((()=>Qd));t.innerHTML="",t.appendChild(new n(e).preview)}},onEnd:({from:t,item:e,clone:n})=>{t.contains(n)&&t.replaceChild(e,n)},sort:this.options.sortable,store:{get:()=>{const e=window.localStorage.getItem(t);return e?e.split("|"):[]},set:e=>{const n=e.toArray();window.localStorage.setItem(t,n.join("|"))}}})}return l}layoutTypes={row:()=>Ld.active.addChild(),column:()=>this.layoutTypes.row().addChild(),field:t=>this.layoutTypes.column().addChild(t)};addElement=t=>{const{meta:{group:e,id:n},...o}=es(this.get(t),"controlData");return ns(o,"config.controlId",n),"layout"===e?this.layoutTypes[n.replace("layout-","")]():this.layoutTypes.field(o)};applyOptions=async(t={})=>{const{container:e,elements:n,groupOrder:o,...i}=Ho(Hd,t);this.container=e,this.groupOrder=qo(o.concat(["common","html","layout"])),this.options=i;const[r,s,a]=await Promise.all([Promise.resolve().then((()=>Lu)),Promise.resolve().then((()=>Ru)),Promise.resolve().then((()=>zu))]),l=[r.default,s.default,a.default].flat();return Promise.all(this.registerControls([...l,...n]))}};const Yd=new Xd,Gd=Object.freeze(Object.defineProperty({__proto__:null,Controls:Xd,default:Yd},Symbol.toStringTag,{value:"Module"})),Zd=new Set(["checkbox","radio"]),Jd=new Set(["radio","checkbox","select-one","select-multiple"]);class Kd extends xd{constructor(t=Object.create(null)){super("field",{...t}),this.debouncedUpdateEditPanels=Ko(this.updateEditPanels),this.debouncedUpdatePreview=Ko(this.updatePreview),this.label=Lc.create(this.labelConfig),this.preview=this.fieldPreview(),this.controlId=this.get("config.controlId")||this.get("meta.id");const e=this.getActionButtons(),n=this.actionButtons.some((t=>"edit"===t.meta?.id));this.updateEditPanels();const i=Lc.create({tag:"li",attrs:{className:yi},id:this.id,children:[this.label,this.getComponentTag(),e,n&&this.editWindow,this.preview].filter(Boolean),panelNav:this.panelNav,dataset:{hoverTag:o.get("field")}});this.dom=i,this.isEditing=!1}get labelConfig(){if(!!this.get("config.hideLabel"))return null;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}})=>{super.set("config.label",n?e:t)}}},e&&Lc.requiredMark()]}}setData=(t,e)=>super.set(t,e);set(t,e){const n=this.setData(t,e);return this.debouncedUpdatePreview(),n}updateLabel(){if(!this.label)return null;const t=Lc.create(this.labelConfig);this.label.replaceWith(t),this.label=t}updatePreview=()=>{this.updateLabel();const t=this.fieldPreview();this.preview.replaceWith(t),this.preview=t};get defaultPreviewActions(){return{change:t=>{const{target:e}=t,{type:n}=e;if(Jd.has(n)){const t=this.preview.querySelectorAll(":checked"),e=this.get("options"),n=void 0!==e?.[0]?.selected?"selected":"checked",o=e.reduce(((t,e)=>(t[e.value]=e,t[e.value][n]=!1,t)),{});for(const i of t)o[i.value][n]=i.value===o[i.value].value;return super.set("options",Object.values(o)),this.debouncedUpdateEditPanels()}},click:t=>{"true"===t.target.contentEditable&&t.preventDefault()},input:({target:t})=>{if(["input","meter","progress","button"].includes(t.tagName.toLowerCase()))return super.set("attrs.value",t.value),this.debouncedUpdateEditPanels();if(t.contentEditable&&!t.type?.startsWith("select-")){const e=t.parentElement.classList;if(e.contains("f-checkbox")||e.contains("f-radio")){const e=t.parentElement,n=Ec(e);return this.setData(`options[${n}].label`,t.innerHTML),this.debouncedUpdateEditPanels()}this.setData("content",t.innerHTML||t.value)}}}}fieldPreview(){const{action:t={},...e}=Xo(this.data);e.id=`prev-${this.id}`,e.action=Object.entries(t).reduce(((t,[e,n])=>(t[e]=n.bind(this),t)),{}),this.data?.config.editableContent&&(e.attrs={...e.attrs,contenteditable:!0});const n={attrs:{className:"field-preview",style:this.isEditing&&"display: none;"},content:Lc.create(e,!0),action:this.defaultPreviewActions};return Lc.create(n,!0)}get isCheckable(){return Zd.has(this.get("config.controlId"))}}const Qd=Object.freeze(Object.defineProperty({__proto__:null,default:Kd},Symbol.toStringTag,{value:"Module"}));const tu=new class extends ga{constructor(t){super("fields",t),this.config={all:{actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}}}}Component(t){return new Kd(t)}get=t=>{let e=t&&es(this.data,t);if(!e){const n=Yd.get(t);n&&(e=this.add(null,n.controlData))}return e};getData=()=>Object.entries(this.data).reduce(((t,[e,n])=>{const{conditions:o,...i}=n?.getData()||n;if(o?.length){let t=!0;if(1===o.length){const[e]=o;t=Boolean(e.if[0].source)}t&&(i.conditions=o)}return t[e]=i,t}),{});load=(t=Object.create(null))=>{const e=ei(t);this.empty();for(const[n,o]of Object.entries(e)){const{meta:t,...e}=o;t?.id&&ns(e,"config.controlId",t?.id),this.add(n,e)}return this.data}},eu=Ld,nu=Dd,ou=Nd,iu=tu,ru=Yd;class su extends ma{constructor(){super("components"),this.disableEvents=!0,this.stages=eu,this.rows=nu,this.columns=ou,this.fields=iu,this.controls=ru}load=(t,e)=>{this.empty();const n=((t,e=!1)=>t?Xo(ei(t)):e&&Zo.get(Ui)||dr())(t,e.sessionStorage);this.opts=e,this.set("id",n.id),this.add("stages",eu.load(n.stages)),this.add("rows",nu.load(n.rows)),this.add("columns",ou.load(n.columns)),this.add("fields",iu.load(n.fields));for(const o of Object.values(this.get("stages")))o.loadChildren();return this.data};flatList(){const t={};for(const e of Object.keys(this.data.stages))oi(this.data,e,"stages",t);return t}getChildData=({type:t,id:e})=>{const n=this.get(t,e);if(n)return n.getData()};get json(){return window.JSON.stringify({$schema:`https://cdn.jsdelivr.net/npm/formeo@${ri}/dist/formData_schema.json`,...this.formData})}get formData(){return{id:this.get("id"),stages:Ld.getData(),rows:Dd.getData(),columns:Nd.getData(),fields:tu.getData()}}set config(t){const{stages:e,rows:n,columns:o,fields:i}=t;eu.config=e,nu.config=n,ou.config=o,iu.config=i}getIndex(t){return this[t]||this[Ni.get(t)]}setAddress(t,e){if(!Jo(t))return;const[n,o,...i]=Array.isArray(t)?t:br(t),r=this.getIndex(n).get(o);return r?.set(i,e),r}getAddress(t){if(!Jo(t))return;const[e,n,...o]=Array.isArray(t)?t:br(t),i=this.getIndex(e).get(n);return!o.length||i?o.length?i.get(o):i:void 0}}const au=new su,lu=Object.freeze(Object.defineProperty({__proto__:null,Columns:ou,Components:su,Controls:ru,Fields:iu,Rows:nu,Stages:eu,default:au},Symbol.toStringTag,{value:"Module"})),cu="no-transition",du={debug:!1,bubbles:!0,formeoLoaded:t=>{},onAdd:()=>{},onChange:(...t)=>du.onUpdate(...t),onUpdate:t=>hu.opts?.debug&&void 0,onUpdateStage:t=>hu.opts?.debug&&void 0,onUpdateRow:t=>hu.opts?.debug&&void 0,onUpdateColumn:t=>hu.opts?.debug&&void 0,onUpdateField:t=>hu.opts?.debug&&void 0,onRender:t=>hu.opts?.debug&&void 0,onSave:t=>{},confirmClearAll:t=>{window.confirm(t.confirmationMessage)&&t.clearAllAction(t)}},uu=({src:t,...e},n=Gi)=>{const o=new window.CustomEvent(n,{detail:e,bubbles:hu.opts?.debug||hu.opts?.bubbles});return o.data=(t||document).dispatchEvent(o),o},hu={init:function(t){return this.opts={...du,...t},this},formeoSaved:t=>uu(t,Yi),formeoUpdated:t=>uu(t,Gi),formeoCleared:t=>uu(t,"formeoCleared"),formeoOnRender:t=>uu(t,Zi),formeoConditionUpdated:t=>uu(t,"formeoConditionUpdated")},pu=function(t,e=Xi){let n=0;return function(...o){const i=Date.now();i-n>=e&&(n=i,t.apply(this,o))}}((()=>{hu.opts.onUpdate({timeStamp:window.performance.now(),type:Gi,detail:au.formData})}),Hi);let fu;document.addEventListener(Gi,pu),document.addEventListener("formeoUpdatedStage",(t=>{const{timeStamp:e,type:n,detail:o}=t;hu.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedRow",(t=>{const{timeStamp:e,type:n,detail:o}=t;hu.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedColumn",(t=>{const{timeStamp:e,type:n,detail:o}=t;hu.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener("formeoUpdatedField",(t=>{const{timeStamp:e,type:n,detail:o}=t;hu.opts.onUpdate({timeStamp:e,type:n,detail:o})})),document.addEventListener(Zi,(t=>{const{timeStamp:e,type:n,detail:o}=t;hu.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},hu.opts.confirmClearAll(t)})),document.addEventListener(Yi,(({timeStamp:t,type:e,detail:{formData:n}})=>{const o={timeStamp:t,type:e,formData:n};hu.opts.onSave(o)})),document.addEventListener("formeoLoaded",(t=>{hu.opts.formeoLoaded(t.detail.formeo)})),window.addEventListener("resize",(function(){fu=fu||window.requestAnimationFrame((()=>{fu=!1;for(const t of Object.values(ou.data))t.dom.classList.add(cu),ru.dom.classList.add(cu),ru.panels.nav.refresh(),t.refreshFieldPanels()}))}));const mu={add:{attr:t=>{const e=window.prompt(t.message.attr);if(e&&t.isDisabled(e))return window.alert(o.get("attributeNotPermitted",e||"")),gu.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)}},remove:{attrs:t=>{t.removeAction()},options:t=>{t.removeAction()},conditions:t=>{t.removeAction()}},click:{btn:t=>{t.action()}},save:{form:Qo}},gu={init:function(t){const e=Object.keys(mu);return this.opts=e.reduce(((e,n)=>(e[n]={...mu[n],...t[n]},e)),t),this},add:{attrs:t=>gu.opts.add.attr(t),options:t=>gu.opts.add.option(t),conditions:t=>(t.template=t.template||sr(),gu.opts.add.condition(t))},remove:{attrs:t=>gu.opts.remove.attrs(t),options:t=>gu.opts.remove.options(t),conditions:t=>gu.opts.remove.conditions(t)},click:{btn:t=>gu.opts.click.btn(t)},save:{form:t=>(gu.opts.sessionStorage&&Zo.set(Ui,t),hu.formeoSaved({formData:t}),gu.opts.save.form(t))}};o.addLanguage("en-US",void 0);const vu={get editor(){return{stickyControls:!1,allowEdit:!0,dataType:"json",debug:!1,sessionStorage:!1,editorContainer:null,svgSprite:ui,style:pi,iconFont:null,config:{},events:{},actions:{},controls:{},polyfills:Nc(),i18n:{location:"https://draggable.github.io/formeo/assets/lang/"},onLoad:()=>{}}}};let bu=class{constructor({formData:t,...e},n){const o=Ho(vu.editor,e),{actions:i,events:r,debug:s,config:a,editorContainer:l,...d}=o;l&&(this.editorContainer="string"==typeof l?document.querySelector(l):l),this.opts=d,Lc.setOptions=d,au.config=a,this.userFormData=n||t,this.Components=au,this.dom=Lc,hu.init({debug:s,...r}),gu.init({debug:s,sessionStorage:d.sessionStorage,...i}),this.tooltip=new c,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",this.loadResources.bind(this)):this.loadResources()}get formData(){return this.Components.formData}set formData(t={}){this.userFormData=ni(t),this.load(this.userFormData,this.opts)}get json(){return this.Components.json}clear(){this.userFormData=dr(),this.Components.load(this.userFormData,this.opts),this.render()}async loadResources(){document.removeEventListener("DOMContentLoaded",this.loadResources);const t=[];this.opts.polyfills&&(t=>{const e=Array.isArray(t)?li.filter((({name:e})=>-1!==t.indexOf(e))):li;Promise.all(e.map((({src:t})=>Wd(t))))})(this.opts.polyfills),await Bd(this.opts.svgSprite),t.push((async t=>{if(!qd()&&(await Fd(t),!qd()))return await Fd("https://draggable.github.io/formeo/assets/css/formeo.min.css")})(this.opts.style)),t.push(o.init({...this.opts.i18n,locale:window.sessionStorage?.getItem(qi)}));const e=await Promise.all(t);return this.opts.allowEdit&&this.init(),e}init(){return Yd.init(this.opts.controls,this.opts.stickyControls).then((t=>{this.controls=t,this.load(this.userFormData,this.opts),this.formId=au.get("id"),this.i18n={setLang:t=>{window.sessionStorage?.setItem(qi,t);o.setCurrent(t).then((()=>{this.init()}),console.error)}},this.opts.onLoad?.(this)}))}load(t=this.userFormData,e=this.opts){this.Components.load(t,e),this.render()}render(){if(!this.controls)return window.requestAnimationFrame((()=>this.render()));if(this.stages=Object.values(au.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))]};o.current.dir&&(t.attrs.dir=o.current.dir,Lc.dir=o.current.dir),this.editor=Lc.create(t);(this.controls.container||this.editor).appendChild(this.controls.dom),this.editorContainer&&(Lc.empty(this.editorContainer),this.editorContainer.appendChild(this.editor)),hu.formeoLoaded=new window.CustomEvent("formeoLoaded",{detail:{formeo:this}}),document.dispatchEvent(hu.formeoLoaded)}};const yu="f-",wu=t=>"string"==typeof t?document.querySelector(t):t,Cu=t=>{const e=t.match(ar);return e?.[0]||t``},Eu=t=>{if(!t)return!1;if(t.hasAttribute("hidden")||t.parentElement.hasAttribute("hidden"))return!1;const e=window.getComputedStyle(t);return!("none"===e.display||"hidden"===e.visibility||"0"===e.opacity)},xu={isChecked:t=>t.checked,isNotChecked:t=>!t.checked,value:t=>t.value,isVisible:t=>Eu(t),isNotVisible:t=>!Eu(t)},Su={equals:pa,notEquals:(t,e)=>!pa(t,e),contains:(t,e)=>t.includes(e),notContains:(t,e)=>!t.includes(e)},Ou=Object.entries(Ji).reduce(((t,[e,n])=>(t[n]=Su[e],t[e]=Su[e],t)),{}),_u={equals:(t,{targetProperty:e,value:n})=>{t[`_${e}`]=t[e],t[e]=n}},Au=Object.entries(Ki).reduce(((t,[e,n])=>(t[n]=_u[e],t[e]=_u[e],t)),{}),Tu={isChecked:t=>{t.checked=!0},isNotChecked:t=>{t.checked=!1},value:(t,{assignment:e,...n})=>{const o=Au[e]?.(t,n),i=new Event("input",{bubbles:!0});return t.dispatchEvent(i),o},isNotVisible:t=>{void 0===t?._required&&(t._required=t.required),t.parentElement.setAttribute("hidden",!0),t.required=!1},isVisible:t=>{t.parentElement.removeAttribute("hidden"),t.required=t._required}};let Nu=class{constructor(t,e){const{renderContainer:n,elements:o,formData:i}=(({editorContainer:t,renderContainer:e,formData:n,...o})=>({elements:{},...o,renderContainer:wu(e),editorContainer:wu(t),formData:ni(n)}))(t);this.container=n,this.form=ni(e||i),this.dom=Lc,this.components=Object.create(null),this.elements=o}get formData(){return this.form}set formData(t){this.form=ni(t)}get userData(){const t=new FormData(this.renderedForm),e={};for(const[n,o]of t.entries())e[n]?Array.isArray(e[n])?e[n].push(o):e[n]=[e[n],o]:e[n]=o;return e}set userData(t={}){const e=this.container.querySelector("form");for(const n of Object.keys(t)){const o=e.elements[n];if(o.length&&"checkbox"===o[0].type){const e=Array.isArray(t[n])?t[n]:[t[n]];for(const t of o)t.checked=e.includes(t.value)}else if(o.length&&"radio"===o[0].type)for(const e of o)e.checked=e.value===t[n];else o.type&&(o.value=t[n])}}render(t=this.form){const e=this.getRenderedForm(t),n=this.container.querySelector(".formeo-render");n?n.replaceWith(e):this.container.appendChild(e)}getRenderedForm(t=this.form){this.form=ni(t);const e=document.getElementsByClassName("formeo-render").length,n={tag:"form",id:this.form.id,className:`formeo-render formeo formeo-rendered-${e}`,children:this.processedData};return this.renderedForm=Lc.render(n),this.applyConditions(),this.renderedForm}get html(){return(this.renderedForm||this.getRenderedForm()).outerHTML}orderChildren=(t,e)=>e.reduce(((e,n)=>(e.push(this.form[t][n]),e)),[]);prefixId=t=>yu+t;processColumn=({id:t,...e})=>({...e,id:this.prefixId(t),children:this.processFields(e.children),style:`width: ${e.config.width||"100%"}`});processRows=t=>this.orderChildren("rows",this.form.stages[t].children).reduce(((t,e)=>(e&&t.push(this.processRow(e)),t)),[]);cacheComponent=t=>(this.components[Cu(t.id)]=t,t);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(`${yu}input-group-wrap`),{tag:n.fieldset?"fieldset":"div",className:i,children:s}};cloneComponentData=t=>{const{children:e=[],id:n,...o}=this.components[t];return{...o,id:Vo(n),children:e?.length&&e.map((({id:t})=>this.cloneComponentData(Cu(t))))}};addButton=t=>({tag:"button",attrs:{className:"add-input-group btn pull-right",type:"button"},children:"Add +",action:{click:e=>{const n=e.target.parentElement,o=Lc.create(this.cloneComponentData(t));n.insertBefore(o,n.lastChild);const i=Lc.create(Lc.btnTemplate({className:"remove-input-group",children:Lc.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()}}));o.appendChild(i)}}});processColumns=t=>this.orderChildren("columns",this.form.rows[t].children).map((t=>this.cacheComponent(this.processColumn(t))));processFields=t=>this.orderChildren("fields",t).map((({id:t,...e})=>{const n=e.config?.controlId||e.meta?.id,{action:o={},dependencies:i={}}=this.elements[n]||{};i&&Ud(i);const r=Ho({action:o},e);return this.cacheComponent({...r,id:this.prefixId(t)})}));get processedData(){return Object.values(this.form.stages).map((t=>(t.children=this.processRows(t.id),t.className=gi,this.components[Cu(t.id)]=t,t)))}handleComponentCondition=(t,e,n)=>{if(t.length){for(const o of t)this.handleComponentCondition(o,e,n);return}const o=Pu(t);o&&t.addEventListener(o,(t=>{if(this.evaluateCondition(e,t))for(const e of n)this.execResult(e,t)}),!1);const i={target:t};if(this.evaluateCondition(e,i))for(const r of n)this.execResult(r,i)};applyConditions=()=>{for(const{conditions:t}of Object.values(this.components))if(t)for(const e of t){const{if:t,then:n}=e;for(const e of t){const{source:t,target:o}=e;if(Jo(t)){const{component:o,options:i}=this.getComponent(t),r=i||o;this.handleComponentCondition(r,e,n)}if(Jo(o)){const{component:t,options:i}=this.getComponent(o),r=i||t;this.handleComponentCondition(r,e,n)}}}};evaluateCondition=({source:t,sourceProperty:e,targetProperty:n,comparison:o,target:i})=>{const r=this.getComponentProperty(t,e);if("boolean"==typeof r)return r;const s=String(Jo(i)?this.getComponentProperty(i,n):i);return Ou[o]?.(r,s)};execResult=({target:t,targetProperty:e,assignment:n,value:o})=>{if(Jo(t)){const{component:i,option:r}=this.getComponent(t),s=r||i;Tu[e]?.(s,{targetProperty:e,assignment:n,value:o})}};getComponentProperty=(t,e)=>{const{component:n,option:o}=this.getComponent(t),i=o||n;return xu[e]?.(i)||i[e]};getComponent=t=>{const e={component:null};if(!Jo(t))return null;const[,n,o,i]=br(t),r=this.renderedForm.querySelector(`#${yu}${n}`);if(!r)return e;if(e.component=r,o){const t=r.querySelectorAll("input"),n=t[i];return e.options=t,e.option=n,e}return e};getComponents=t=>{const e=[],n=t.slice(t.indexOf(".")+1);return e.push(...this.renderedForm.querySelectorAll(`[name=f-${n}]`)),e}};const Pu=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=bu,window.FormeoRenderer=Nu);const ju=bu,Du=Nu,ku=[{config:{label:"row"},meta:{group:"layout",icon:"rows",id:"layout-row"}},{config:{label:"column"},meta:{group:"layout",icon:"columns",id:"layout-column"}}],Lu=Object.freeze(Object.defineProperty({__proto__:null,default:ku},Symbol.toStringTag,{value:"Module"})),$u=["button","submit","reset"].map((t=>({label:t,value:t})));$u[0].selected=!0;const Iu=({type:t,isMultiple:e=!1,count:n=3})=>Array.from({length:n},((t,e)=>e+1)).map((n=>{const i="checkbox"===t||e?"checked":"selected";return{label:o.get("labelCount",{label:gr(t),count:n}),value:`${t}-${n}`,[i]:!n}}));const Mu=[class extends Vd{constructor(t={}){const e={tag:"button",attrs:{className:[{label:"grouped",value:"f-btn-group"},{label:"ungrouped",value:"f-field-group"}]},config:{label:o.get("controls.form.button"),hideLabel:!0},meta:{group:"common",icon:"button",id:"button"},options:[{label:o.get("button"),type:$u,className:[{label:"default",value:"",selected:!0},{label:"primary",value:"primary"},{label:"danger",value:"error"},{label:"success",value:"success"},{label:"warning",value:"warning"}]}]};super(Ho(e,t))}},class extends Vd{constructor(){super({tag:"input",attrs:{type:"date",required:!1,className:""},config:{label:o.get("controls.form.input.date")},meta:{group:"common",icon:"calendar",id:"date-input"}})}},class extends Vd{constructor(){super({tag:"input",attrs:{type:"hidden",value:""},config:{label:o.get("hidden"),hideLabel:!0},meta:{group:"common",icon:"hidden",id:"hidden"}})}},class extends Vd{constructor(){super({tag:"input",attrs:{type:"number",required:!1,className:""},config:{label:o.get("number")},meta:{group:"common",icon:"hash",id:"number"}})}},class extends Vd{constructor(){super({tag:"textarea",config:{label:o.get("controls.form.textarea")},meta:{group:"common",icon:"textarea",id:"textarea"},attrs:{required:!1}})}},class extends Vd{constructor(){super({tag:"input",attrs:{required:!1,type:"text",className:""},config:{label:o.get("controls.form.input.text")},meta:{group:"common",icon:"text-input",id:"text-input"}})}},class extends Vd{constructor(){super({tag:"input",attrs:{type:"file",required:!1},config:{label:o.get("fileUpload")},meta:{group:"common",icon:"upload",id:"upload"}})}},class extends Vd{constructor(t={}){const e={tag:"select",config:{label:o.get("controls.form.select")},attrs:{required:!1,className:"",multiple:!1},meta:{group:"common",icon:"select",id:"select"},options:Iu({type:"option",isMultiple:t.attrs?.multiple})};super(Ho(e,t))}},class extends Vd{constructor(){super({tag:"input",attrs:{type:"checkbox",required:!1},config:{label:o.get("controls.form.checkbox-group"),disabledAttrs:["type"]},meta:{group:"common",icon:"checkbox",id:"checkbox"},options:Iu({type:"checkbox",count:1})})}},class extends Vd{constructor(){super({tag:"input",attrs:{type:"radio",required:!1},config:{label:o.get("controls.form.radio-group"),disabled:["attrs.type"]},meta:{group:"common",icon:"radio-group",id:"radio"},options:Iu({type:"radio"})})}}],Ru=Object.freeze(Object.defineProperty({__proto__:null,default:Mu},Symbol.toStringTag,{value:"Module"})),Wu=Array.from(Array(5).keys()).slice(1).map((t=>`h${t}`)),Fu="controls.html.header";const Bu=[class extends Vd{constructor(){super({tag:Wu[0],attrs:{tag:Wu.map(((t,e)=>({label:t.toUpperCase(),value:t,selected:!e}))),className:""},config:{label:o.get(Fu),hideLabel:!0,editableContent:!0},meta:{group:"html",icon:"header",id:"html.header"},content:o.get(Fu),action:{}})}static get definition(){return{i18n:{"en-US":{header:"Custom English Header"}}}}get content(){return super.i18n(Fu)}},class extends Vd{constructor(){super({tag:"p",attrs:{className:""},config:{label:o.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 Vd{constructor(){super({tag:"hr",config:{label:o.get("controls.html.divider"),hideLabel:!0},meta:{group:"html",icon:"divider",id:"divider"}})}},class extends Vd{constructor(t){super(Ho({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))}}],zu=Object.freeze(Object.defineProperty({__proto__:null,default:Bu},Symbol.toStringTag,{value:"Module"}));t.FormeoEditor=ju,t.FormeoRenderer=Du,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
|
|
8
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).formeo={})}(this,(function(t){"use strict";const e={extension:".lang",location:"assets/lang/",langs:["en-US"],locale:"en-US",override:{}};class n{constructor(t=e){this.langs=Object.create(null),this.loaded=[],this.processConfig(t)}processConfig(t){const{location:n,...o}={...e,...t},i=n.replace(/\/?$/,"/");this.config={location:i,...o};const{override:r,preloaded:s={}}=this.config,a=Object.entries(this.langs).concat(Object.entries(r||s));this.langs=a.reduce(((t,[e,n])=>(t[e]=this.applyLanguage(e,n),t)),{}),this.locale=this.config.locale||this.config.langs[0]}init(t){return this.processConfig({...this.config,...t}),this.setCurrent(this.locale)}addLanguage(t,e={}){e="string"==typeof e?n.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 n.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 o=this;return new Promise((function(i,r){if(-1!==o.loaded.indexOf(t)&&e)return o.applyLanguage(o.langs[t]),i(o.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}}([o.config.location,t,o.config.extension].join("")).then((e=>{const r=n.processFile(e);return o.applyLanguage(t,r),o.loaded.push(t),i(o.langs[t])})).catch((e=>{const n=o.applyLanguage(t);i(n)}))}))}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 o=new n;!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 i=Object.defineProperty,r=(t,e,n)=>((t,e,n)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n)(t,"symbol"!=typeof e?e+"":e,n);const s="_3x4ZIcu-",a="JIt36hCJ",l={triggerName:"tooltip"};class c{constructor(t=l){r(this,"triggerName"),r(this,"tooltip"),r(this,"activeTriggerType",null),r(this,"spacing",12),r(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()})),r(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")}})),r(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()})),r(this,"handleResize",(()=>{this.isVisible()&&this.hide()})),r(this,"handleScroll",(()=>{this.isVisible()&&this.hide()})),this.triggerName=`data-${t.triggerName}`,this.tooltip=document.createElement("div"),this.tooltip.className=`d-tooltip ${s}`,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(a)}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(s)||"none"===getComputedStyle(t).pointerEvents)return!1})).length}show(t,e){this.tooltip.innerHTML=e??"",this.tooltip.classList.add(a);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(a),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=c);const d="formeo",u="4.1.4";var h,p,f,m,g,v,b,y,w,C,E,S,x,O,_,A,T,N,P,j,D,k,L,$,I,M,R,F,W,B,z,U,q,V,H,X,Y,G,Z,J,K,Q,tt,et,nt,ot,it,rt,st,at,lt,ct,dt,ut,ht,pt,ft,mt,gt,vt,bt,yt,wt,Ct,Et,St,xt,Ot,_t,At,Tt,Nt,Pt,jt,Dt,kt,Lt,$t,It,Mt,Rt,Ft,Wt,Bt,zt,Ut,qt,Vt,Ht,Xt,Yt,Gt,Zt,Jt,Kt,Qt,te,ee,ne="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function oe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ie(){if(m)return f;return m=1,f=function(t,e){return t===e||t!=t&&e!=e}}function re(){if(v)return g;v=1;var t=ie();return g=function(e,n){for(var o=e.length;o--;)if(t(e[o][0],n))return o;return-1}}function se(){if(A)return _;A=1;var t=p?h:(p=1,h=function(){this.__data__=[],this.size=0}),e=function(){if(y)return b;y=1;var t=re(),e=Array.prototype.splice;return b=function(n){var o=this.__data__,i=t(o,n);return!(i<0||(i==o.length-1?o.pop():e.call(o,i,1),--this.size,0))}}(),n=function(){if(C)return w;C=1;var t=re();return w=function(e){var n=this.__data__,o=t(n,e);return o<0?void 0:n[o][1]}}(),o=function(){if(S)return E;S=1;var t=re();return E=function(e){return t(this.__data__,e)>-1}}(),i=function(){if(O)return x;O=1;var t=re();return x=function(e,n){var o=this.__data__,i=t(o,e);return i<0?(++this.size,o.push([e,n])):o[i][1]=n,this}}();function r(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])}}return r.prototype.clear=t,r.prototype.delete=e,r.prototype.get=n,r.prototype.has=o,r.prototype.set=i,_=r}function ae(){if(M)return I;M=1;var t="object"==typeof ne&&ne&&ne.Object===Object&≠return I=t}function le(){if(F)return R;F=1;var t=ae(),e="object"==typeof self&&self&&self.Object===Object&&self,n=t||e||Function("return this")();return R=n}function ce(){if(B)return W;B=1;var t=le().Symbol;return W=t}function de(){if(X)return H;X=1;var t=ce(),e=function(){if(U)return z;U=1;var t=ce(),e=Object.prototype,n=e.hasOwnProperty,o=e.toString,i=t?t.toStringTag:void 0;return z=function(t){var e=n.call(t,i),r=t[i];try{t[i]=void 0;var s=!0}catch(l){}var a=o.call(t);return s&&(e?t[i]=r:delete t[i]),a}}(),n=function(){if(V)return q;V=1;var t=Object.prototype.toString;return q=function(e){return t.call(e)}}(),o=t?t.toStringTag:void 0;return H=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":o&&o in Object(t)?e(t):n(t)}}function ue(){if(G)return Y;return G=1,Y=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}}function he(){if(J)return Z;J=1;var t=de(),e=ue();return Z=function(n){if(!e(n))return!1;var o=t(n);return"[object Function]"==o||"[object GeneratorFunction]"==o||"[object AsyncFunction]"==o||"[object Proxy]"==o}}function pe(){if(et)return tt;et=1;var t,e=function(){if(Q)return K;Q=1;var t=le()["__core-js_shared__"];return K=t}(),n=(t=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||""))?"Symbol(src)_1."+t:"";return tt=function(t){return!!n&&n in t}}function fe(){if(ot)return nt;ot=1;var t=Function.prototype.toString;return nt=function(e){if(null!=e){try{return t.call(e)}catch(n){}try{return e+""}catch(n){}}return""}}function me(){if(ct)return lt;ct=1;var t=function(){if(rt)return it;rt=1;var t=he(),e=pe(),n=ue(),o=fe(),i=/^\[object .+?Constructor\]$/,r=Function.prototype,s=Object.prototype,a=r.toString,l=s.hasOwnProperty,c=RegExp("^"+a.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return it=function(r){return!(!n(r)||e(r))&&(t(r)?c:i).test(o(r))}}(),e=at?st:(at=1,st=function(t,e){return null==t?void 0:t[e]});return lt=function(n,o){var i=e(n,o);return t(i)?i:void 0}}function ge(){if(ut)return dt;ut=1;var t=me()(le(),"Map");return dt=t}function ve(){if(pt)return ht;pt=1;var t=me()(Object,"create");return ht=t}function be(){if(Ot)return xt;Ot=1;var t=function(){if(mt)return ft;mt=1;var t=ve();return ft=function(){this.__data__=t?t(null):{},this.size=0}}(),e=vt?gt:(vt=1,gt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}),n=function(){if(yt)return bt;yt=1;var t=ve(),e=Object.prototype.hasOwnProperty;return bt=function(n){var o=this.__data__;if(t){var i=o[n];return"__lodash_hash_undefined__"===i?void 0:i}return e.call(o,n)?o[n]:void 0}}(),o=function(){if(Ct)return wt;Ct=1;var t=ve(),e=Object.prototype.hasOwnProperty;return wt=function(n){var o=this.__data__;return t?void 0!==o[n]:e.call(o,n)}}(),i=function(){if(St)return Et;St=1;var t=ve();return Et=function(e,n){var o=this.__data__;return this.size+=this.has(e)?0:1,o[e]=t&&void 0===n?"__lodash_hash_undefined__":n,this}}();function r(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])}}return r.prototype.clear=t,r.prototype.delete=e,r.prototype.get=n,r.prototype.has=o,r.prototype.set=i,xt=r}function ye(){if(jt)return Pt;jt=1;var t=Nt?Tt:(Nt=1,Tt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t});return Pt=function(e,n){var o=e.__data__;return t(n)?o["string"==typeof n?"string":"hash"]:o.map}}function we(){if(Bt)return Wt;Bt=1;var t=function(){if(At)return _t;At=1;var t=be(),e=se(),n=ge();return _t=function(){this.size=0,this.__data__={hash:new t,map:new(n||e),string:new t}}}(),e=function(){if(kt)return Dt;kt=1;var t=ye();return Dt=function(e){var n=t(this,e).delete(e);return this.size-=n?1:0,n}}(),n=function(){if($t)return Lt;$t=1;var t=ye();return Lt=function(e){return t(this,e).get(e)}}(),o=function(){if(Mt)return It;Mt=1;var t=ye();return It=function(e){return t(this,e).has(e)}}(),i=function(){if(Ft)return Rt;Ft=1;var t=ye();return Rt=function(e,n){var o=t(this,e),i=o.size;return o.set(e,n),this.size+=o.size==i?0:1,this}}();function r(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])}}return r.prototype.clear=t,r.prototype.delete=e,r.prototype.get=n,r.prototype.has=o,r.prototype.set=i,Wt=r}function Ce(){if(Vt)return qt;Vt=1;var t=se(),e=function(){if(N)return T;N=1;var t=se();return T=function(){this.__data__=new t,this.size=0}}(),n=j?P:(j=1,P=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}),o=k?D:(k=1,D=function(t){return this.__data__.get(t)}),i=$?L:($=1,L=function(t){return this.__data__.has(t)}),r=function(){if(Ut)return zt;Ut=1;var t=se(),e=ge(),n=we();return zt=function(o,i){var r=this.__data__;if(r instanceof t){var s=r.__data__;if(!e||s.length<199)return s.push([o,i]),this.size=++r.size,this;r=this.__data__=new n(s)}return r.set(o,i),this.size=r.size,this}}();function s(e){var n=this.__data__=new t(e);this.size=n.size}return s.prototype.clear=e,s.prototype.delete=n,s.prototype.get=o,s.prototype.has=i,s.prototype.set=r,qt=s}function Ee(){if(Xt)return Ht;Xt=1;var t=me(),e=function(){try{var e=t(Object,"defineProperty");return e({},"",{}),e}catch(n){}}();return Ht=e}function Se(){if(Gt)return Yt;Gt=1;var t=Ee();return Yt=function(e,n,o){"__proto__"==n&&t?t(e,n,{configurable:!0,enumerable:!0,value:o,writable:!0}):e[n]=o}}function xe(){if(Jt)return Zt;Jt=1;var t=Se(),e=ie();return Zt=function(n,o,i){(void 0!==i&&!e(n[o],i)||void 0===i&&!(o in n))&&t(n,o,i)}}function Oe(){if(ee)return te;ee=1;var t=(Qt?Kt:(Qt=1,Kt=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}}))();return te=t}var _e,Ae,Te,Ne,Pe,je,De,ke,Le,$e,Ie,Me,Re,Fe,We,Be,ze,Ue,qe,Ve,He,Xe,Ye,Ge,Ze,Je,Ke,Qe,tn,en,nn,on,rn,sn={exports:{}};function an(){if(Te)return Ae;Te=1;var t=le().Uint8Array;return Ae=t}function ln(){if(De)return je;De=1;var t=function(){if(Pe)return Ne;Pe=1;var t=an();return Ne=function(e){var n=new e.constructor(e.byteLength);return new t(n).set(new t(e)),n}}();return je=function(e,n){var o=n?t(e.buffer):e.buffer;return new e.constructor(o,e.byteOffset,e.length)}}function cn(){if(Re)return Me;return Re=1,Me=function(t,e){return function(n){return t(e(n))}}}function dn(){if(We)return Fe;We=1;var t=cn()(Object.getPrototypeOf,Object);return Fe=t}function un(){if(ze)return Be;ze=1;var t=Object.prototype;return Be=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}}function hn(){if(qe)return Ue;qe=1;var t=function(){if(Ie)return $e;Ie=1;var t=ue(),e=Object.create;return $e=function(){function n(){}return function(o){if(!t(o))return{};if(e)return e(o);n.prototype=o;var i=new n;return n.prototype=void 0,i}}()}(),e=dn(),n=un();return Ue=function(o){return"function"!=typeof o.constructor||n(o)?{}:t(e(o))}}function pn(){if(He)return Ve;return He=1,Ve=function(t){return null!=t&&"object"==typeof t}}function fn(){if(Ze)return Ge;Ze=1;var t=function(){if(Ye)return Xe;Ye=1;var t=de(),e=pn();return Xe=function(n){return e(n)&&"[object Arguments]"==t(n)}}(),e=pn(),n=Object.prototype,o=n.hasOwnProperty,i=n.propertyIsEnumerable,r=t(function(){return arguments}())?t:function(t){return e(t)&&o.call(t,"callee")&&!i.call(t,"callee")};return Ge=r}function mn(){if(Ke)return Je;Ke=1;var t=Array.isArray;return Je=t}function gn(){if(tn)return Qe;tn=1;return Qe=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}}function vn(){if(nn)return en;nn=1;var t=he(),e=gn();return en=function(n){return null!=n&&e(n.length)&&!t(n)}}var bn,yn,wn,Cn,En,Sn,xn,On,_n,An={exports:{}};function Tn(){return wn||(wn=1,t=An,e=An.exports,n=le(),o=yn?bn:(yn=1,bn=function(){return!1}),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),An.exports;var t,e,n,o,i,r,s,a}var Nn,Pn,jn,Dn,kn,Ln,$n,In,Mn,Rn,Fn,Wn,Bn,zn,Un,qn,Vn,Hn,Xn,Yn,Gn,Zn,Jn,Kn,Qn,to,eo,no,oo,io,ro,so,ao,lo,co,uo,ho,po,fo,mo,go,vo,bo,yo,wo,Co,Eo,So,xo,Oo={exports:{}};function _o(){if(jn)return Pn;jn=1;var t=function(){if(xn)return Sn;xn=1;var t=de(),e=gn(),n=pn(),o={};return o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,Sn=function(i){return n(i)&&e(i.length)&&!!o[t(i)]}}(),e=_n?On:(_n=1,On=function(t){return function(e){return t(e)}}),n=function(){return Nn||(Nn=1,t=Oo,e=Oo.exports,n=ae(),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,r=i&&i.exports===o&&n.process,s=function(){try{return i&&i.require&&i.require("util").types||r&&r.binding&&r.binding("util")}catch(t){}}(),t.exports=s),Oo.exports;var t,e,n,o,i,r,s}(),o=n&&n.isTypedArray,i=o?e(o):t;return Pn=i}function Ao(){if(kn)return Dn;return kn=1,Dn=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}}function To(){if($n)return Ln;$n=1;var t=Se(),e=ie(),n=Object.prototype.hasOwnProperty;return Ln=function(o,i,r){var s=o[i];n.call(o,i)&&e(s,r)&&(void 0!==r||i in o)||t(o,i,r)}}function No(){if(Bn)return Wn;Bn=1;var t=/^(?:0|[1-9]\d*)$/;return Wn=function(e,n){var o=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==o||"symbol"!=o&&t.test(e))&&e>-1&&e%1==0&&e<n}}function Po(){if(Un)return zn;Un=1;var t=Fn?Rn:(Fn=1,Rn=function(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o}),e=fn(),n=mn(),o=Tn(),i=No(),r=_o(),s=Object.prototype.hasOwnProperty;return zn=function(a,l){var c=n(a),d=!c&&e(a),u=!c&&!d&&o(a),h=!c&&!d&&!u&&r(a),p=c||d||u||h,f=p?t(a.length,String):[],m=f.length;for(var g in a)!l&&!s.call(a,g)||p&&("length"==g||u&&("offset"==g||"parent"==g)||h&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||i(g,m))||f.push(g);return f}}function jo(){if(Xn)return Hn;Xn=1;var t=ue(),e=un(),n=Vn?qn:(Vn=1,qn=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}),o=Object.prototype.hasOwnProperty;return Hn=function(i){if(!t(i))return n(i);var r=e(i),s=[];for(var a in i)("constructor"!=a||!r&&o.call(i,a))&&s.push(a);return s}}function Do(){if(Gn)return Yn;Gn=1;var t=Po(),e=jo(),n=vn();return Yn=function(o){return n(o)?t(o,!0):e(o)}}function ko(){if(Jn)return Zn;Jn=1;var t=function(){if(Mn)return In;Mn=1;var t=To(),e=Se();return In=function(n,o,i,r){var s=!i;i||(i={});for(var a=-1,l=o.length;++a<l;){var c=o[a],d=r?r(i[c],n[c],c,i,n):void 0;void 0===d&&(d=n[c]),s?e(i,c,d):t(i,c,d)}return i}}(),e=Do();return Zn=function(n){return t(n,e(n))}}function Lo(){if(Qn)return Kn;Qn=1;var t,e,n,o,i,r,s,a=xe(),l=(_e||(_e=1,t=sn,e=sn.exports,n=le(),o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,r=i&&i.exports===o?n.Buffer:void 0,s=r?r.allocUnsafe:void 0,t.exports=function(t,e){if(e)return t.slice();var n=t.length,o=s?s(n):new t.constructor(n);return t.copy(o),o}),sn.exports),c=ln(),d=Le?ke:(Le=1,ke=function(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}),u=hn(),h=fn(),p=mn(),f=function(){if(rn)return on;rn=1;var t=vn(),e=pn();return on=function(n){return e(n)&&t(n)}}(),m=Tn(),g=he(),v=ue(),b=function(){if(En)return Cn;En=1;var t=de(),e=dn(),n=pn(),o=Function.prototype,i=Object.prototype,r=o.toString,s=i.hasOwnProperty,a=r.call(Object);return Cn=function(o){if(!n(o)||"[object Object]"!=t(o))return!1;var i=e(o);if(null===i)return!0;var l=s.call(i,"constructor")&&i.constructor;return"function"==typeof l&&l instanceof l&&r.call(l)==a}}(),y=_o(),w=Ao(),C=ko();return Kn=function(t,e,n,o,i,r,s){var E=w(t,n),S=w(e,n),x=s.get(S);if(x)a(t,n,x);else{var O=r?r(E,S,n+"",t,e,s):void 0,_=void 0===O;if(_){var A=p(S),T=!A&&m(S),N=!A&&!T&&y(S);O=S,A||T||N?p(E)?O=E:f(E)?O=d(E):T?(_=!1,O=l(S,!0)):N?(_=!1,O=c(S,!0)):O=[]:b(S)||h(S)?(O=E,h(E)?O=C(E):v(E)&&!g(E)||(O=u(S))):_=!1}_&&(s.set(S,O),i(O,S,o,r,s),s.delete(S)),a(t,n,O)}}}function $o(){if(oo)return no;return oo=1,no=function(t){return t}}function Io(){if(ao)return so;ao=1;var t=ro?io:(ro=1,io=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)}),e=Math.max;return so=function(n,o,i){return o=e(void 0===o?n.length-1:o,0),function(){for(var r=arguments,s=-1,a=e(r.length-o,0),l=Array(a);++s<a;)l[s]=r[o+s];s=-1;for(var c=Array(o+1);++s<o;)c[s]=r[s];return c[o]=i(l),t(n,this,c)}},so}function Mo(){if(ho)return uo;ho=1;var t=co?lo:(co=1,lo=function(t){return function(){return t}}),e=Ee(),n=$o();return uo=e?function(n,o){return e(n,"toString",{configurable:!0,enumerable:!1,value:t(o),writable:!0})}:n}function Ro(){if(go)return mo;go=1;var t=Mo(),e=function(){if(fo)return po;fo=1;var t=Date.now;return po=function(e){var n=0,o=0;return function(){var i=t(),r=16-(i-o);if(o=i,r>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}},po}(),n=e(t);return mo=n}function Fo(){if(Eo)return Co;Eo=1;var t=function(){if(bo)return vo;bo=1;var t=$o(),e=Io(),n=Ro();return vo=function(o,i){return n(e(o,i,t),o+"")}}(),e=function(){if(wo)return yo;wo=1;var t=ie(),e=vn(),n=No(),o=ue();return yo=function(i,r,s){if(!o(s))return!1;var a=typeof r;return!!("number"==a?e(s)&&n(r,s.length):"string"==a&&r in s)&&t(s[r],i)}}();return Co=function(n){return t((function(t,o){var i=-1,r=o.length,s=r>1?o[r-1]:void 0,a=r>2?o[2]:void 0;for(s=n.length>3&&"function"==typeof s?(r--,s):void 0,a&&e(o[0],o[1],a)&&(s=r<3?void 0:s,r=1),t=Object(t);++i<r;){var l=o[i];l&&n(t,l,i,s)}return t}))}}const Wo=oe(function(){if(xo)return So;xo=1;var t=function(){if(eo)return to;eo=1;var t=Ce(),e=xe(),n=Oe(),o=Lo(),i=ue(),r=Do(),s=Ao();return to=function a(l,c,d,u,h){l!==c&&n(c,(function(n,r){if(h||(h=new t),i(n))o(l,c,r,d,a,u,h);else{var p=u?u(s(l,r),n,r+"",l,c,h):void 0;void 0===p&&(p=n),e(l,r,p)}}),r)},to}(),e=Fo()((function(e,n,o,i){t(e,n,o,i)}));return So=e}()),Bo=()=>crypto.randomUUID().slice(0,8).slice(0,8),zo=(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},Uo=t=>{const e=t.className?.match($i);return e&&ki[e[0]]},qo=t=>Array.from(new Set(t)),Vo=t=>t?.attrs?.id||t?.id||Bo(),Ho=(t,e)=>Wo({},t,e,((t,e)=>Array.isArray(t)?null!=e?qo(t.concat(e)):e:Array.isArray(e)?null!=t?qo(e.concat(t)):e:void 0)),Xo=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]=Xo(t[n]);return e}if(t instanceof Object){e={};for(const n in t)Object.hasOwn(t,n)&&(e[n]=Xo(t[n]));return e}throw new Error("Unable to copy Object, type not supported.")},Yo=(t,e)=>t/e*100,Go=t=>`${t.toString()}%`,Zo=Object.create(null,{get:{value:t=>{const e=window.sessionStorage?.getItem(t);try{return JSON.parse(e)}catch(n){return e}}},set:{value:(t,e)=>{try{return window.sessionStorage?.setItem(t,JSON.stringify(e))}catch(n){}}}}),Jo=t=>/^(stage|row|column|field)s./.test(t);function Ko(t,e=Hi){let n;return function(...o){n&&clearTimeout(n),n=setTimeout((()=>t.apply(this,o)),e)}}function Qo(t){return t}function ti(){}function ei(t=Object.create(null)){if("string"==typeof t)try{return JSON.parse(t)}catch(e){return Object.create(null)}return t}const ni=t=>t?Xo(ei(t)):wr();function oi(t,e,n,o={}){if(!e||!t[n][e])return o;o[`${n}.${e}`]=t[n][e];const i=Wi.get(n);if(i){const r=t[n][e].data?.children||[];for(const e of r)oi(t,e,i,o)}return o}const ii=d,ri=u,si=ii,ai="formeo-sprite",li=[{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"}],ci=`../../lib/icons/${ai}.svg`,di=ci,ui="undefined"!=typeof process&&"development"===process.env?.NODE_ENV||!1?di:`https://cdn.jsdelivr.net/npm/formeo@${ri}/dist/${ai}.svg`,hi=`https://draggable.github.io/formeo/assets/img/${ai}.svg`,pi=`https://cdn.jsdelivr.net/npm/formeo@${ri}/dist/formeo.min.css`,fi="f-panel",mi="control-group",gi=`${si}-stage`,vi=`${si}-row`,bi=`${si}-column`,yi=`${si}-field`,wi="custom-column-widths",Ci="column-preset",Ei="resizing-columns",Si=new Map([[gi,vi],[vi,bi],[bi,yi]]),xi=["stage","row","column","field"],Oi=xi.map((t=>`${t}s`));new Map(Oi.map(((t,e)=>[t,xi[e]])));const _i=new RegExp(`^${Oi.join("|")}.`),Ai=[...xi],Ti=[...Oi],Ni=new Map(Ti.map(((t,e)=>[t,Ai[e]]))),Pi=Ai.reduce(((t,e)=>(t[e]=e,t)),{}),ji=[{name:"controls",className:mi},{name:"stage",className:gi},{name:"row",className:vi},{name:"column",className:bi},{name:"field",className:yi}],Di={controls:mi,stage:gi,row:vi,column:bi,field:yi},ki=Object.entries(Di).reduce(((t,[e,n])=>(t[n]=e,t)),{}),Li=Object.values(Di),$i=new RegExp(`${Li.join("|")}`,"g"),{childTypeMapVals:Ii,childTypeIndexMapVals:Mi}=ji.reduce(((t,{name:e},n,o)=>{const{name:i}=o[n+1]||{};return i&&(t.childTypeMapVals.push([e,i]),t.childTypeIndexMapVals.push([`${e}s`,`${i}s`])),t}),{childTypeMapVals:[],childTypeIndexMapVals:[]}),Ri=Ii.slice().map((t=>t.slice().reverse())).reverse(),Fi=new Map(Ii),Wi=new Map(Mi),Bi=new Map(Ri.slice()),zi=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)),[])),Ui=`${ii}-formData`,qi=`${ii}-locale`,Vi=333,Hi=Math.round(166.5),Xi=Math.round(666),Yi="formeoSaved",Gi="formeoUpdated",Zi="formeoUpdatedStage",Ji="formeoUpdatedRow",Ki="formeoUpdatedColumn",Qi="formeoUpdatedField",tr="formeoOnRender",er="formeoAddedRow",nr="formeoAddedColumn",or="formeoAddedField",ir="formeoRemovedRow",rr="formeoRemovedColumn",sr="formeoRemovedField",ar={equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},lr={equals:"="},cr=["logical","source","sourceProperty","comparison","target","targetProperty","assignment","value"],dr=["isChecked","isNotChecked"],ur=["isVisible","isNotVisible"],hr=["value"],pr={comparison:ar,assignment:lr,logical:{and:"&&",or:"||"}},fr="if",mr="then",gr=()=>({[fr]:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],[mr]:[{target:"",targetProperty:"",assignment:"",value:""}]}),vr=/(\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b)|(\b[0-9a-f]{8}\b)/g,br=/\bcol-\w+-\d+/g,yr="f-i-",wr=()=>({id:Vo(),stages:{[Vo()]:{}},rows:{},columns:{},fields:{}}),Cr=["selected","checked"],Er=Cr.toReversed(),Sr="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`)),xr=new RegExp(`(?!${Sr.join("|")})\\w\\S*`,"g"),Or=/\s+/g;function _r(t){if("string"!=typeof t)return t;if(t.trim().match(Or))return t;return t.replace(xr,(t=>t.charAt(0).toUpperCase()+t.substring(1).replace(/[A-Z]/g,(t=>` ${t}`))))}const Ar=(t,e="-")=>t.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,e),Tr=t=>{if(Array.isArray(t))return t;const e=/[.[\]]/g,n=[];let o=0,i=e.exec(t);for(;null!==i;)n.push(t.slice(o,i.index)),o=i.index+i[0].length,i=e.exec(t);return o<t.length&&n.push(t.slice(o)),n.filter(Boolean)},Nr=(t,e="-")=>Tr(t).join(e);var Pr,jr,Dr,kr,Lr,$r,Ir,Mr,Rr,Fr,Wr,Br,zr,Ur,qr,Vr,Hr,Xr,Yr,Gr,Zr,Jr,Kr,Qr;function ts(){if(jr)return Pr;jr=1;var t=de(),e=pn();return Pr=function(n){return"symbol"==typeof n||e(n)&&"[object Symbol]"==t(n)}}function es(){if(Mr)return Ir;Mr=1;var t=function(){if($r)return Lr;$r=1;var t=we();function e(n,o){if("function"!=typeof n||null!=o&&"function"!=typeof o)throw new TypeError("Expected a function");var i=function(){var t=arguments,e=o?o.apply(this,t):t[0],r=i.cache;if(r.has(e))return r.get(e);var s=n.apply(this,t);return i.cache=r.set(e,s)||r,s};return i.cache=new(e.Cache||t),i}return e.Cache=t,Lr=e}();return Ir=function(e){var n=t(e,(function(t){return 500===o.size&&o.clear(),t})),o=n.cache;return n}}function ns(){if(Ur)return zr;Ur=1;var t=ce(),e=Br?Wr:(Br=1,Wr=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}),n=mn(),o=ts(),i=t?t.prototype:void 0,r=i?i.toString:void 0;return zr=function t(i){if("string"==typeof i)return i;if(n(i))return e(i,t)+"";if(o(i))return r?r.call(i):"";var s=i+"";return"0"==s&&1/i==-1/0?"-0":s},zr}function os(){if(Xr)return Hr;Xr=1;var t=mn(),e=function(){if(kr)return Dr;kr=1;var t=mn(),e=ts(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;return Dr=function(i,r){if(t(i))return!1;var s=typeof i;return!("number"!=s&&"symbol"!=s&&"boolean"!=s&&null!=i&&!e(i))||o.test(i)||!n.test(i)||null!=r&&i in Object(r)}}(),n=function(){if(Fr)return Rr;Fr=1;var t=es(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,o=t((function(t){var o=[];return 46===t.charCodeAt(0)&&o.push(""),t.replace(e,(function(t,e,i,r){o.push(i?r.replace(n,"$1"):e||t)})),o}));return Rr=o}(),o=function(){if(Vr)return qr;Vr=1;var t=ns();return qr=function(e){return null==e?"":t(e)}}();return Hr=function(i,r){return t(i)?i:e(i,r)?[i]:n(o(i))}}function is(){if(Gr)return Yr;Gr=1;var t=ts();return Yr=function(e){if("string"==typeof e||t(e))return e;var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}}const rs=oe(function(){if(Qr)return Kr;Qr=1;var t=function(){if(Jr)return Zr;Jr=1;var t=os(),e=is();return Zr=function(n,o){for(var i=0,r=(o=t(o,n)).length;null!=n&&i<r;)n=n[e(o[i++])];return i&&i==r?n:void 0}}();return Kr=function(e,n,o){var i=null==e?void 0:t(e,n);return void 0===i?o:i}}());var ss,as,ls,cs;var ds=function(){if(cs)return ls;cs=1;var t=function(){if(as)return ss;as=1;var t=To(),e=os(),n=No(),o=ue(),i=is();return ss=function(r,s,a,l){if(!o(r))return r;for(var c=-1,d=(s=e(s,r)).length,u=d-1,h=r;null!=h&&++c<d;){var p=i(s[c]),f=a;if("__proto__"===p||"constructor"===p||"prototype"===p)return r;if(c!=u){var m=h[p];void 0===(f=l?l(m,p,h):void 0)&&(f=o(m)?m:n(s[c+1])?[]:{})}t(h,p,f),h=h[p]}return r}}();return ls=function(e,n,o){return null==e?e:t(e,n,o)}}();const us=rs,hs=oe(ds);function ps(...t){return t.flat().reduce(((t,e)=>(t[e]=e,t)),{})}var fs,ms,gs,vs,bs,ys,ws,Cs,Es,Ss,xs,Os,_s,As,Ts,Ns,Ps,js,Ds,ks,Ls,$s,Is,Ms,Rs,Fs,Ws,Bs,zs,Us,qs,Vs,Hs,Xs,Ys,Gs,Zs,Js,Ks,Qs,ta,ea,na,oa,ia,ra,sa,aa,la,ca,da,ua,ha,pa;function fa(){if(ys)return bs;ys=1;var t=we(),e=ms?fs:(ms=1,fs=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}),n=vs?gs:(vs=1,gs=function(t){return this.__data__.has(t)});function o(e){var n=-1,o=null==e?0:e.length;for(this.__data__=new t;++n<o;)this.add(e[n])}return o.prototype.add=o.prototype.push=e,o.prototype.has=n,bs=o}function ma(){if(Os)return xs;Os=1;var t=fa(),e=Cs?ws:(Cs=1,ws=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}),n=Ss?Es:(Ss=1,Es=function(t,e){return t.has(e)});return xs=function(o,i,r,s,a,l){var c=1&r,d=o.length,u=i.length;if(d!=u&&!(c&&u>d))return!1;var h=l.get(o),p=l.get(i);if(h&&p)return h==i&&p==o;var f=-1,m=!0,g=2&r?new t:void 0;for(l.set(o,i),l.set(i,o);++f<d;){var v=o[f],b=i[f];if(s)var y=c?s(b,v,f,i,o,l):s(v,b,f,o,i,l);if(void 0!==y){if(y)continue;m=!1;break}if(g){if(!e(i,(function(t,e){if(!n(g,e)&&(v===t||a(v,t,r,s,l)))return g.push(e)}))){m=!1;break}}else if(v!==b&&!a(v,b,r,s,l)){m=!1;break}}return l.delete(o),l.delete(i),m}}function ga(){if(js)return Ps;js=1;var t=ce(),e=an(),n=ie(),o=ma(),i=As?_s:(As=1,_s=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,o){n[++e]=[o,t]})),n}),r=Ns?Ts:(Ns=1,Ts=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}),s=t?t.prototype:void 0,a=s?s.valueOf:void 0;return Ps=function(t,s,l,c,d,u,h){switch(l){case"[object DataView]":if(t.byteLength!=s.byteLength||t.byteOffset!=s.byteOffset)return!1;t=t.buffer,s=s.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=s.byteLength||!u(new e(t),new e(s)));case"[object Boolean]":case"[object Date]":case"[object Number]":return n(+t,+s);case"[object Error]":return t.name==s.name&&t.message==s.message;case"[object RegExp]":case"[object String]":return t==s+"";case"[object Map]":var p=i;case"[object Set]":var f=1&c;if(p||(p=r),t.size!=s.size&&!f)return!1;var m=h.get(t);if(m)return m==s;c|=2,h.set(t,s);var g=o(p(t),p(s),c,d,u,h);return h.delete(t),g;case"[object Symbol]":if(a)return a.call(t)==a.call(s)}return!1}}function va(){if($s)return Ls;$s=1;var t=ks?Ds:(ks=1,Ds=function(t,e){for(var n=-1,o=e.length,i=t.length;++n<o;)t[i+n]=e[n];return t}),e=mn();return Ls=function(n,o,i){var r=o(n);return e(n)?r:t(r,i(n))}}function ba(){if(Bs)return Ws;Bs=1;var t=Ms?Is:(Ms=1,Is=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}),e=Fs?Rs:(Fs=1,Rs=function(){return[]}),n=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols;return Ws=o?function(e){return null==e?[]:(e=Object(e),t(o(e),(function(t){return n.call(e,t)})))}:e}function ya(){if(Vs)return qs;Vs=1;var t=un(),e=function(){if(Us)return zs;Us=1;var t=cn()(Object.keys,Object);return zs=t}(),n=Object.prototype.hasOwnProperty;return qs=function(o){if(!t(o))return e(o);var i=[];for(var r in Object(o))n.call(o,r)&&"constructor"!=r&&i.push(r);return i}}function wa(){if(Gs)return Ys;Gs=1;var t=va(),e=ba(),n=function(){if(Xs)return Hs;Xs=1;var t=Po(),e=ya(),n=vn();return Hs=function(o){return n(o)?t(o):e(o)}}();return Ys=function(o){return t(o,n,e)}}function Ca(){if(aa)return sa;aa=1;var t=function(){if(Qs)return Ks;Qs=1;var t=me()(le(),"DataView");return Ks=t}(),e=ge(),n=function(){if(ea)return ta;ea=1;var t=me()(le(),"Promise");return ta=t}(),o=function(){if(oa)return na;oa=1;var t=me()(le(),"Set");return na=t}(),i=function(){if(ra)return ia;ra=1;var t=me()(le(),"WeakMap");return ia=t}(),r=de(),s=fe(),a="[object Map]",l="[object Promise]",c="[object Set]",d="[object WeakMap]",u="[object DataView]",h=s(t),p=s(e),f=s(n),m=s(o),g=s(i),v=r;return(t&&v(new t(new ArrayBuffer(1)))!=u||e&&v(new e)!=a||n&&v(n.resolve())!=l||o&&v(new o)!=c||i&&v(new i)!=d)&&(v=function(t){var e=r(t),n="[object Object]"==e?t.constructor:void 0,o=n?s(n):"";if(o)switch(o){case h:return u;case p:return a;case f:return l;case m:return c;case g:return d}return e}),sa=v}function Ea(){if(ca)return la;ca=1;var t=Ce(),e=ma(),n=ga(),o=function(){if(Js)return Zs;Js=1;var t=wa(),e=Object.prototype.hasOwnProperty;return Zs=function(n,o,i,r,s,a){var l=1&i,c=t(n),d=c.length;if(d!=t(o).length&&!l)return!1;for(var u=d;u--;){var h=c[u];if(!(l?h in o:e.call(o,h)))return!1}var p=a.get(n),f=a.get(o);if(p&&f)return p==o&&f==n;var m=!0;a.set(n,o),a.set(o,n);for(var g=l;++u<d;){var v=n[h=c[u]],b=o[h];if(r)var y=l?r(b,v,h,o,n,a):r(v,b,h,n,o,a);if(!(void 0===y?v===b||s(v,b,i,r,a):y)){m=!1;break}g||(g="constructor"==h)}if(m&&!g){var w=n.constructor,C=o.constructor;w==C||!("constructor"in n)||!("constructor"in o)||"function"==typeof w&&w instanceof w&&"function"==typeof C&&C instanceof C||(m=!1)}return a.delete(n),a.delete(o),m}}(),i=Ca(),r=mn(),s=Tn(),a=_o(),l="[object Arguments]",c="[object Array]",d="[object Object]",u=Object.prototype.hasOwnProperty;return la=function(h,p,f,m,g,v){var b=r(h),y=r(p),w=b?c:i(h),C=y?c:i(p),E=(w=w==l?d:w)==d,S=(C=C==l?d:C)==d,x=w==C;if(x&&s(h)){if(!s(p))return!1;b=!0,E=!1}if(x&&!E)return v||(v=new t),b||a(h)?e(h,p,f,m,g,v):n(h,p,w,f,m,g,v);if(!(1&f)){var O=E&&u.call(h,"__wrapped__"),_=S&&u.call(p,"__wrapped__");if(O||_){var A=O?h.value():h,T=_?p.value():p;return v||(v=new t),g(A,T,f,m,v)}}return!!x&&(v||(v=new t),o(h,p,f,m,g,v))}}const Sa=oe(function(){if(pa)return ha;pa=1;var t=function(){if(ua)return da;ua=1;var t=Ea(),e=pn();return da=function n(o,i,r,s,a){return o===i||(null==o||null==i||!e(o)&&!e(i)?o!=o&&i!=i:t(o,i,r,s,n,a))},da}();return ha=function(e,n){return t(e,n)}}()),xa=(t,e)=>void 0===t?"added":void 0===e?"removed":Sa(t,e)?"unchanged":"changed";class Oa{constructor(t,e=Object.create(null)){this.name=t,this.data=e,this.dataPath=""}get size(){return Object.keys(this.data).length}get js(){return this.data}get json(){return this.data}toJSON=(t,e)=>JSON.stringify(t,null,e);get=t=>us(this.data,t);set(t,e){const n=us(this.data,t),o=hs(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={entity:this,dataPath:this.dataPath.replace(/\.+$/,""),changePath:this.dataPath+t,value:e,data:o,changeType:xa(n,e),src:this.dom};if(n&&(i.previousValue=n),Eu.formeoUpdated(i),this.name){const t={stage:Zi,row:Ji,column:Ki,field:Qi}[this.name];t&&Eu.formeoUpdated(i,t)}}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))}add=(t,e=Object.create(null))=>{const{id:n}=e,o=t||n||Vo();return this.set(o,e)};remove=t=>{const e=Tr(t),n=e.pop(),o=this.get(e);return Array.isArray(o)?o.splice(Number(n),1):o&&delete o[n],o};empty(){this.data=Object.create(null)}getData=()=>Object.entries(this.data).reduce(((t,[e,n])=>(t[e]=n?.data?n.getData():n,t)),{});setCallbacks={};configVal=Object.create(null)}class _a extends Oa{load=t=>{const e=ei(t);this.empty();for(const[n,o]of Object.entries(e))this.add(n,o);return this.data};get=t=>t?us(this.data,t):this.add();add=(t,e=Object.create(null))=>{const n=t||Vo(),o=this.Component({...e,id:n});this.data[n]=o,this.active=o;const i={row:er,column:nr,field:or}[this.name];return i&&Eu.formeoUpdated({entity:o,componentId:n,componentType:this.name,data:o.data},i),o};remove=t=>{if(Array.isArray(t))for(const e of t)this.get(e).remove();else this.get(t).remove();return this.data};delete=t=>(delete this.data[t],t);clearAll=(t=!0)=>{const e=Object.values(this.data).map((e=>e.empty(t)));return Promise.all(e)};set config(t){this.configVal=Ho(this.configVal,Xo(t))}get config(){return this.configVal}conditionMap=new Map}function Aa(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 Ta(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Aa(Object(n),!0).forEach((function(e){Pa(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Aa(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Na(t){return(Na="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 Pa(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ja(){return ja=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},ja.apply(this,arguments)}function Da(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 ka(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var La=ka(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),$a=ka(/Edge/i),Ia=ka(/firefox/i),Ma=ka(/safari/i)&&!ka(/chrome/i)&&!ka(/android/i),Ra=ka(/iP(ad|od|hone)/i),Fa=ka(/chrome/i)&&ka(/android/i),Wa={capture:!1,passive:!1};function Ba(t,e,n){t.addEventListener(e,n,!La&&Wa)}function za(t,e,n){t.removeEventListener(e,n,!La&&Wa)}function Ua(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 qa(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function Va(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&Ua(t,e):Ua(t,e))||o&&t===n)return t;if(t===n)break}while(t=qa(t))}return null}var Ha,Xa=/\s+/g;function Ya(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(Xa," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(Xa," ")}}function Ga(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 Za(t,e){var n="";if("string"==typeof t)n=t;else do{var o=Ga(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 Ja(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 Ka(){var t=document.scrollingElement;return t||document.documentElement}function Qa(t,e,n,o,i){if(t.getBoundingClientRect||t===window){var r,s,a,l,c,d,u;if(t!==window&&t.parentNode&&t!==Ka()?(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,!La))do{if(i&&i.getBoundingClientRect&&("none"!==Ga(i,"transform")||n&&"static"!==Ga(i,"position"))){var h=i.getBoundingClientRect();s-=h.top+parseInt(Ga(i,"border-top-width")),a-=h.left+parseInt(Ga(i,"border-left-width")),l=s+r.height,c=a+r.width;break}}while(i=i.parentNode);if(o&&t!==window){var p=Za(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 tl(t,e,n){for(var o=rl(t,!0),i=Qa(t)[e];o;){if(!(i>=Qa(o)[n]))return o;if(o===Ka())break;o=rl(o,!1)}return!1}function el(t,e,n,o){for(var i=0,r=0,s=t.children;r<s.length;){if("none"!==s[r].style.display&&s[r]!==cc.ghost&&(o||s[r]!==cc.dragged)&&Va(s[r],n.draggable,t,!1)){if(i===e)return s[r];i++}r++}return null}function nl(t,e){for(var n=t.lastElementChild;n&&(n===cc.ghost||"none"===Ga(n,"display")||e&&!Ua(n,e));)n=n.previousElementSibling;return n||null}function ol(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===cc.clone||e&&!Ua(t,e)||n++;return n}function il(t){var e=0,n=0,o=Ka();if(t)do{var i=Za(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 rl(t,e){if(!t||!t.getBoundingClientRect)return Ka();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=Ga(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 Ka();if(o||e)return n;o=!0}}}while(n=n.parentNode);return Ka()}function sl(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 al(t,e){return function(){if(!Ha){var n=arguments;1===n.length?t.call(this,n[0]):t.apply(this,n),Ha=setTimeout((function(){Ha=void 0}),e)}}}function ll(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function cl(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 dl(t,e,n){var o={};return Array.from(t.children).forEach((function(i){var r,s,a,l;if(Va(i,e.draggable,t,!1)&&!i.animated&&i!==n){var c=Qa(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 ul="Sortable"+(new Date).getTime();function hl(){var t,e=[];return{captureAnimationState:function(){(e=[],this.options.animation)&&[].slice.call(this.el.children).forEach((function(t){if("none"!==Ga(t,"display")&&t!==cc.ghost){e.push({target:t,rect:Qa(t)});var n=Ta({},e[e.length-1].rect);if(t.thisAnimationDuration){var o=Za(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=Qa(n),l=n.prevFromRect,c=n.prevToRect,d=t.rect,u=Za(n,!0);u&&(a.top-=u.f,a.left-=u.e),n.toRect=a,n.thisAnimationDuration&&sl(l,a)&&!sl(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)),sl(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){Ga(t,"transition",""),Ga(t,"transform","");var i=Za(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,Ga(t,"transform","translate3d("+a+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),Ga(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),Ga(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){Ga(t,"transition",""),Ga(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),o)}}}}var pl=[],fl={initializeByDefault:!0},ml={mount:function(t){for(var e in fl)fl.hasOwnProperty(e)&&!(e in t)&&(t[e]=fl[e]);pl.forEach((function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")})),pl.push(t)},pluginEvent:function(t,e,n){var o=this;this.eventCanceled=!1,n.cancel=function(){o.eventCanceled=!0};var i=t+"Global";pl.forEach((function(o){e[o.pluginName]&&(e[o.pluginName][i]&&e[o.pluginName][i](Ta({sortable:e},n)),e.options[o.pluginName]&&e[o.pluginName][t]&&e[o.pluginName][t](Ta({sortable:e},n)))}))},initializePlugins:function(t,e,n,o){for(var i in pl.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,ja(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 pl.forEach((function(o){"function"==typeof o.eventProperties&&ja(n,o.eventProperties.call(e[o.pluginName],t))})),n},modifyOption:function(t,e,n){var o;return pl.forEach((function(i){t[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[e]&&(o=i.optionListeners[e].call(t[i.pluginName],n))})),o}};var gl=["evt"],vl=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,i=Da(n,gl);ml.pluginEvent.bind(cc)(t,e,Ta({dragEl:yl,parentEl:wl,ghostEl:Cl,rootEl:El,nextEl:Sl,lastDownEl:xl,cloneEl:Ol,cloneHidden:_l,dragStarted:Fl,putSortable:Dl,activeSortable:cc.active,originalEvent:o,oldIndex:Al,oldDraggableIndex:Nl,newIndex:Tl,newDraggableIndex:Pl,hideGhostForTarget:rc,unhideGhostForTarget:sc,cloneNowHidden:function(){_l=!0},cloneNowShown:function(){_l=!1},dispatchSortableEvent:function(t){bl({sortable:e,name:t,originalEvent:o})}},i))};function bl(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[ul]){var m,g=e.options,v="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||La||$a?(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=Ta(Ta({},f),ml.getEventProperties(o,e));for(var y in b)m[y]=b[y];n&&n.dispatchEvent(m),g[v]&&g[v].call(e,m)}}(Ta({putSortable:Dl,cloneEl:Ol,targetEl:yl,rootEl:El,oldIndex:Al,oldDraggableIndex:Nl,newIndex:Tl,newDraggableIndex:Pl},t))}var yl,wl,Cl,El,Sl,xl,Ol,_l,Al,Tl,Nl,Pl,jl,Dl,kl,Ll,$l,Il,Ml,Rl,Fl,Wl,Bl,zl,Ul,ql=!1,Vl=!1,Hl=[],Xl=!1,Yl=!1,Gl=[],Zl=!1,Jl=[],Kl="undefined"!=typeof document,Ql=Ra,tc=$a||La?"cssFloat":"float",ec=Kl&&!Fa&&!Ra&&"draggable"in document.createElement("div"),nc=function(){if(Kl){if(La)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),oc=function(t,e){var n=Ga(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=el(t,0,e),r=el(t,1,e),s=i&&Ga(i),a=r&&Ga(r),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+Qa(i).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Qa(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[tc]||r&&"none"===n[tc]&&l+c>o)?"vertical":"horizontal"},ic=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"==Na(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},rc=function(){!nc&&Cl&&Ga(Cl,"display","none")},sc=function(){!nc&&Cl&&Ga(Cl,"display","")};Kl&&!Fa&&document.addEventListener("click",(function(t){if(Vl)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Vl=!1,!1}),!0);var ac=function(t){if(yl){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,Hl.some((function(t){var e=t[ul].options.emptyInsertThreshold;if(e&&!nl(t)){var n=Qa(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[ul]._onDragOver(n)}}var i,r,s},lc=function(t){yl&&yl.parentNode[ul]._isOutsideThisEl(t.target)};function cc(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=ja({},e),t[ul]=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 oc(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!==cc.supportPointer&&"PointerEvent"in window&&!Ma,emptyInsertThreshold:5};for(var o in ml.initializePlugins(this,t,n),n)!(o in e)&&(e[o]=n[o]);for(var i in ic(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&ec,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Ba(t,"pointerdown",this._onTapStart):(Ba(t,"mousedown",this._onTapStart),Ba(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Ba(t,"dragover",this),Ba(t,"dragenter",this)),Hl.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),ja(this,hl())}function dc(t,e,n,o,i,r,s,a){var l,c,d=t[ul],u=d.options.onMove;return!window.CustomEvent||La||$a?(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||Qa(e),l.willInsertAfter=a,l.originalEvent=s,t.dispatchEvent(l),u&&(c=u.call(d,l,s)),c}function uc(t){t.draggable=!1}function hc(){Zl=!1}function pc(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 fc(t){return setTimeout(t,0)}function mc(t){return clearTimeout(t)}cc.prototype={constructor:cc,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(Wl=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,yl):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){Jl.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&Jl.push(o)}}(n),!yl&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!Ma||!a||"SELECT"!==a.tagName.toUpperCase())&&!((a=Va(a,o.draggable,n,!1))&&a.animated||xl===a)){if(Al=ol(a),Nl=ol(a,o.draggable),"function"==typeof c){if(c.call(this,t,a,this))return bl({sortable:e,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),vl("filter",e,{evt:t}),void(i&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=Va(l,o.trim(),n,!1))return bl({sortable:e,rootEl:o,name:"filter",targetEl:a,fromEl:n,toEl:n}),vl("filter",e,{evt:t}),!0}))))return void(i&&t.cancelable&&t.preventDefault());o.handle&&!Va(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&&!yl&&n.parentNode===r){var l=Qa(n);if(El=r,wl=(yl=n).parentNode,Sl=yl.nextSibling,xl=n,jl=s.group,cc.dragged=yl,kl={target:yl,clientX:(e||t).clientX,clientY:(e||t).clientY},Ml=kl.clientX-l.left,Rl=kl.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,yl.style["will-change"]="all",o=function(){vl("delayEnded",i,{evt:t}),cc.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!Ia&&i.nativeDraggable&&(yl.draggable=!0),i._triggerDragStart(t,e),bl({sortable:i,name:"choose",originalEvent:t}),Ya(yl,s.chosenClass,!0))},s.ignore.split(",").forEach((function(t){Ja(yl,t.trim(),uc)})),Ba(a,"dragover",ac),Ba(a,"mousemove",ac),Ba(a,"touchmove",ac),Ba(a,"mouseup",i._onDrop),Ba(a,"touchend",i._onDrop),Ba(a,"touchcancel",i._onDrop),Ia&&this.nativeDraggable&&(this.options.touchStartThreshold=4,yl.draggable=!0),vl("delayStart",this,{evt:t}),!s.delay||s.delayOnTouchOnly&&!e||this.nativeDraggable&&($a||La))o();else{if(cc.eventCanceled)return void this._onDrop();Ba(a,"mouseup",i._disableDelayedDrag),Ba(a,"touchend",i._disableDelayedDrag),Ba(a,"touchcancel",i._disableDelayedDrag),Ba(a,"mousemove",i._delayedDragTouchMoveHandler),Ba(a,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&Ba(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(){yl&&uc(yl),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;za(t,"mouseup",this._disableDelayedDrag),za(t,"touchend",this._disableDelayedDrag),za(t,"touchcancel",this._disableDelayedDrag),za(t,"mousemove",this._delayedDragTouchMoveHandler),za(t,"touchmove",this._delayedDragTouchMoveHandler),za(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?Ba(document,"pointermove",this._onTouchMove):Ba(document,e?"touchmove":"mousemove",this._onTouchMove):(Ba(yl,"dragend",this),Ba(El,"dragstart",this._onDragStart));try{document.selection?fc((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(t,e){if(ql=!1,El&&yl){vl("dragStarted",this,{evt:e}),this.nativeDraggable&&Ba(document,"dragover",lc);var n=this.options;!t&&Ya(yl,n.dragClass,!1),Ya(yl,n.ghostClass,!0),cc.active=this,t&&this._appendGhost(),bl({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(Ll){this._lastX=Ll.clientX,this._lastY=Ll.clientY,rc();for(var t=document.elementFromPoint(Ll.clientX,Ll.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Ll.clientX,Ll.clientY))!==e;)e=t;if(yl.parentNode[ul]._isOutsideThisEl(t),e)do{if(e[ul]){if(e[ul]._onDragOver({clientX:Ll.clientX,clientY:Ll.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=qa(e));sc()}},_onTouchMove:function(t){if(kl){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=Cl&&Za(Cl,!0),s=Cl&&r&&r.a,a=Cl&&r&&r.d,l=Ql&&Ul&&il(Ul),c=(i.clientX-kl.clientX+o.x)/(s||1)+(l?l[0]-Gl[0]:0)/(s||1),d=(i.clientY-kl.clientY+o.y)/(a||1)+(l?l[1]-Gl[1]:0)/(a||1);if(!cc.active&&!ql){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(Cl){r?(r.e+=c-($l||0),r.f+=d-(Il||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,")");Ga(Cl,"webkitTransform",u),Ga(Cl,"mozTransform",u),Ga(Cl,"msTransform",u),Ga(Cl,"transform",u),$l=c,Il=d,Ll=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Cl){var t=this.options.fallbackOnBody?document.body:El,e=Qa(yl,!0,Ql,!0,t),n=this.options;if(Ql){for(Ul=t;"static"===Ga(Ul,"position")&&"none"===Ga(Ul,"transform")&&Ul!==document;)Ul=Ul.parentNode;Ul!==document.body&&Ul!==document.documentElement?(Ul===document&&(Ul=Ka()),e.top+=Ul.scrollTop,e.left+=Ul.scrollLeft):Ul=Ka(),Gl=il(Ul)}Ya(Cl=yl.cloneNode(!0),n.ghostClass,!1),Ya(Cl,n.fallbackClass,!0),Ya(Cl,n.dragClass,!0),Ga(Cl,"transition",""),Ga(Cl,"transform",""),Ga(Cl,"box-sizing","border-box"),Ga(Cl,"margin",0),Ga(Cl,"top",e.top),Ga(Cl,"left",e.left),Ga(Cl,"width",e.width),Ga(Cl,"height",e.height),Ga(Cl,"opacity","0.8"),Ga(Cl,"position",Ql?"absolute":"fixed"),Ga(Cl,"zIndex","100000"),Ga(Cl,"pointerEvents","none"),cc.ghost=Cl,t.appendChild(Cl),Ga(Cl,"transform-origin",Ml/parseInt(Cl.style.width)*100+"% "+Rl/parseInt(Cl.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,o=t.dataTransfer,i=n.options;vl("dragStart",this,{evt:t}),cc.eventCanceled?this._onDrop():(vl("setupClone",this),cc.eventCanceled||((Ol=cl(yl)).removeAttribute("id"),Ol.draggable=!1,Ol.style["will-change"]="",this._hideClone(),Ya(Ol,this.options.chosenClass,!1),cc.clone=Ol),n.cloneId=fc((function(){vl("clone",n),cc.eventCanceled||(n.options.removeCloneOnHide||El.insertBefore(Ol,yl),n._hideClone(),bl({sortable:n,name:"clone"}))})),!e&&Ya(yl,i.dragClass,!0),e?(Vl=!0,n._loopId=setInterval(n._emulateDragOver,50)):(za(document,"mouseup",n._onDrop),za(document,"touchend",n._onDrop),za(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(n,o,yl)),Ba(document,"drop",n),Ga(yl,"transform","translateZ(0)")),ql=!0,n._dragStartId=fc(n._dragStarted.bind(n,e,t)),Ba(document,"selectstart",n),Fl=!0,Ma&&Ga(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=cc.active,d=jl===l,u=a.sort,h=Dl||c,p=this,f=!1;if(!Zl){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),s=Va(s,a.draggable,r,!0),N("dragOver"),cc.eventCanceled)return f;if(yl.contains(t.target)||s.animated&&s.animatingX&&s.animatingY||p._ignoreWhileAnimating===s)return j(!1);if(Vl=!1,c&&!a.disabled&&(d?u||(o=wl!==El):Dl===this||(this.lastPutMode=jl.checkPull(this,c,yl,t))&&l.checkPut(this,c,yl,t))){if(i="vertical"===this._getDirection(t,s),e=Qa(yl),N("dragOverValid"),cc.eventCanceled)return f;if(o)return wl=El,P(),this._hideClone(),N("revert"),cc.eventCanceled||(Sl?El.insertBefore(yl,Sl):El.appendChild(yl)),j(!0);var m=nl(r,a.draggable);if(!m||function(t,e,n){var o=Qa(nl(n.el,n.options.draggable)),i=dl(n.el,n.options,Cl),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===yl)return j(!1);if(m&&r===t.target&&(s=m),s&&(n=Qa(s)),!1!==dc(El,r,yl,e,s,n,t,!!s))return P(),m&&m.nextSibling?r.insertBefore(yl,m.nextSibling):r.appendChild(yl),wl=r,D(),j(!0)}else if(m&&function(t,e,n){var o=Qa(el(n.el,0,n.options,!0)),i=dl(n.el,n.options,Cl),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=el(r,0,a,!0);if(g===yl)return j(!1);if(n=Qa(s=g),!1!==dc(El,r,yl,e,s,n,t,!1))return P(),r.insertBefore(yl,g),wl=r,D(),j(!0)}else if(s.parentNode===r){n=Qa(s);var v,b,y,w=yl.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}(yl.animated&&yl.toRect||e,s.animated&&s.toRect||n,i),E=i?"top":"left",S=tl(s,"top","top")||tl(yl,"top","top"),x=S?S.scrollTop:void 0;if(Wl!==s&&(b=n[E],Xl=!1,Yl=!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&&zl<c*i){if(!Xl&&(1===Bl?l>d+c*r/2:l<u-c*r/2)&&(Xl=!0),Xl)h=!0;else if(1===Bl?l<d+zl:l>u-zl)return-Bl}else if(l>d+c*(1-i)/2&&l<u-c*(1-i)/2)return function(t){return ol(yl)<ol(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,Yl,Wl===s),0!==v){var O=ol(yl);do{O-=v,y=wl.children[O]}while(y&&("none"===Ga(y,"display")||y===Cl))}if(0===v||y===s)return j(!1);Wl=s,Bl=v;var _=s.nextElementSibling,A=!1,T=dc(El,r,yl,e,s,n,t,A=1===v);if(!1!==T)return 1!==T&&-1!==T||(A=1===T),Zl=!0,setTimeout(hc,30),P(),A&&!_?r.appendChild(yl):s.parentNode.insertBefore(yl,A?_:s),S&&ll(S,0,x-S.scrollTop),wl=yl.parentNode,void 0===b||Yl||(zl=Math.abs(b-Qa(s)[E])),D(),j(!0)}if(r.contains(yl))return j(!1)}return!1}function N(a,l){vl(a,p,Ta({evt:t,isOwner:d,axis:i?"vertical":"horizontal",revert:o,dragRect:e,targetRect:n,canSort:u,fromSortable:h,target:s,completed:j,onMove:function(n,o){return dc(El,r,yl,e,n,Qa(n),t,o)},changed:D},l))}function P(){N("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function j(e){return N("dragOverCompleted",{insertion:e}),e&&(d?c._hideClone():c._showClone(p),p!==h&&(Ya(yl,Dl?Dl.options.ghostClass:c.options.ghostClass,!1),Ya(yl,a.ghostClass,!0)),Dl!==p&&p!==cc.active?Dl=p:p===cc.active&&Dl&&(Dl=null),h===p&&(p._ignoreWhileAnimating=s),p.animateAll((function(){N("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(s===yl&&!yl.animated||s===r&&!s.animated)&&(Wl=null),a.dragoverBubble||t.rootEl||s===document||(yl.parentNode[ul]._isOutsideThisEl(t.target),!e&&ac(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),f=!0}function D(){Tl=ol(yl),Pl=ol(yl,a.draggable),bl({sortable:p,name:"change",toEl:r,newIndex:Tl,newDraggableIndex:Pl,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){za(document,"mousemove",this._onTouchMove),za(document,"touchmove",this._onTouchMove),za(document,"pointermove",this._onTouchMove),za(document,"dragover",ac),za(document,"mousemove",ac),za(document,"touchmove",ac)},_offUpEvents:function(){var t=this.el.ownerDocument;za(t,"mouseup",this._onDrop),za(t,"touchend",this._onDrop),za(t,"pointerup",this._onDrop),za(t,"touchcancel",this._onDrop),za(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;Tl=ol(yl),Pl=ol(yl,n.draggable),vl("drop",this,{evt:t}),wl=yl&&yl.parentNode,Tl=ol(yl),Pl=ol(yl,n.draggable),cc.eventCanceled||(ql=!1,Yl=!1,Xl=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),mc(this.cloneId),mc(this._dragStartId),this.nativeDraggable&&(za(document,"drop",this),za(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Ma&&Ga(document.body,"user-select",""),Ga(yl,"transform",""),t&&(Fl&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),Cl&&Cl.parentNode&&Cl.parentNode.removeChild(Cl),(El===wl||Dl&&"clone"!==Dl.lastPutMode)&&Ol&&Ol.parentNode&&Ol.parentNode.removeChild(Ol),yl&&(this.nativeDraggable&&za(yl,"dragend",this),uc(yl),yl.style["will-change"]="",Fl&&!ql&&Ya(yl,Dl?Dl.options.ghostClass:this.options.ghostClass,!1),Ya(yl,this.options.chosenClass,!1),bl({sortable:this,name:"unchoose",toEl:wl,newIndex:null,newDraggableIndex:null,originalEvent:t}),El!==wl?(Tl>=0&&(bl({rootEl:wl,name:"add",toEl:wl,fromEl:El,originalEvent:t}),bl({sortable:this,name:"remove",toEl:wl,originalEvent:t}),bl({rootEl:wl,name:"sort",toEl:wl,fromEl:El,originalEvent:t}),bl({sortable:this,name:"sort",toEl:wl,originalEvent:t})),Dl&&Dl.save()):Tl!==Al&&Tl>=0&&(bl({sortable:this,name:"update",toEl:wl,originalEvent:t}),bl({sortable:this,name:"sort",toEl:wl,originalEvent:t})),cc.active&&(null!=Tl&&-1!==Tl||(Tl=Al,Pl=Nl),bl({sortable:this,name:"end",toEl:wl,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){vl("nulling",this),El=yl=wl=Cl=Sl=Ol=xl=_l=kl=Ll=Fl=Tl=Pl=Al=Nl=Wl=Bl=Dl=jl=cc.dragged=cc.ghost=cc.clone=cc.active=null,Jl.forEach((function(t){t.checked=!0})),Jl.length=$l=Il=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":yl&&(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++)Va(t=n[o],r.draggable,this.el,!1)&&e.push(t.getAttribute(r.dataIdAttr)||pc(t));return e},sort:function(t,e){var n={},o=this.el;this.toArray().forEach((function(t,e){var i=o.children[e];Va(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 Va(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=ml.modifyOption(this,t,e);n[t]=void 0!==o?o:e,"group"===t&&ic(n)},destroy:function(){vl("destroy",this);var t=this.el;t[ul]=null,za(t,"mousedown",this._onTapStart),za(t,"touchstart",this._onTapStart),za(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(za(t,"dragover",this),za(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),(function(t){t.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),Hl.splice(Hl.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!_l){if(vl("hideClone",this),cc.eventCanceled)return;Ga(Ol,"display","none"),this.options.removeCloneOnHide&&Ol.parentNode&&Ol.parentNode.removeChild(Ol),_l=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(_l){if(vl("showClone",this),cc.eventCanceled)return;yl.parentNode!=El||this.options.group.revertClone?Sl?El.insertBefore(Ol,Sl):El.appendChild(Ol):El.insertBefore(Ol,yl),this.options.group.revertClone&&this.animate(yl,Ol),Ga(Ol,"display",""),_l=!1}}else this._hideClone()}},Kl&&Ba(document,"touchmove",(function(t){(cc.active||ql)&&t.cancelable&&t.preventDefault()})),cc.utils={on:Ba,off:za,css:Ga,find:Ja,is:function(t,e){return!!Va(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:al,closest:Va,toggleClass:Ya,clone:cl,index:ol,nextTick:fc,cancelNextTick:mc,detectDirection:oc,getChild:el,expando:ul},cc.get=function(t){return t[ul]},cc.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&&(cc.utils=Ta(Ta({},cc.utils),t.utils)),ml.mount(t)}))},cc.create=function(t,e){return new cc(t,e)},cc.version="1.15.3";var gc,vc,bc,yc,wc,Cc,Ec=[],Sc=!1;function xc(){Ec.forEach((function(t){clearInterval(t.pid)})),Ec=[]}function Oc(){clearInterval(Cc)}var _c=al((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=Ka(),d=!1;vc!==n&&(vc=n,xc(),gc=e.scroll,i=e.scrollFn,!0===gc&&(gc=rl(n,!0)));var u=0,h=gc;do{var p=h,f=Qa(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,S=p.scrollWidth,x=p.scrollHeight,O=Ga(p),_=p.scrollLeft,A=p.scrollTop;p===c?(C=y<S&&("auto"===O.overflowX||"scroll"===O.overflowX||"visible"===O.overflowX),E=w<x&&("auto"===O.overflowY||"scroll"===O.overflowY||"visible"===O.overflowY)):(C=y<S&&("auto"===O.overflowX||"scroll"===O.overflowX),E=w<x&&("auto"===O.overflowY||"scroll"===O.overflowY));var T=C&&(Math.abs(b-r)<=a&&_+y<S)-(Math.abs(v-r)<=a&&!!_),N=E&&(Math.abs(g-s)<=a&&A+w<x)-(Math.abs(m-s)<=a&&!!A);if(!Ec[u])for(var P=0;P<=u;P++)Ec[P]||(Ec[P]={});Ec[u].vx==T&&Ec[u].vy==N&&Ec[u].el===p||(Ec[u].el=p,Ec[u].vx=T,Ec[u].vy=N,clearInterval(Ec[u].pid),0==T&&0==N||(d=!0,Ec[u].pid=setInterval(function(){o&&0===this.layer&&cc.active._onTouchMove(wc);var e=Ec[this.layer].vy?Ec[this.layer].vy*l:0,n=Ec[this.layer].vx?Ec[this.layer].vx*l:0;"function"==typeof i&&"continue"!==i.call(cc.dragged.parentNode[ul],n,e,t,wc,Ec[this.layer].el)||ll(Ec[this.layer].el,n,e)}.bind({layer:u}),24))),u++}while(e.bubbleScroll&&h!==c&&(h=rl(h,!1)));Sc=d}}),30),Ac=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 Tc(){}function Nc(){}Tc.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=el(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:Ac},ja(Tc,{pluginName:"revertOnSpill"}),Nc.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable||this.sortable;n.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),n.animateAll()},drop:Ac},ja(Nc,{pluginName:"removeOnSpill"}),cc.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?Ba(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Ba(document,"pointermove",this._handleFallbackAutoScroll):e.touches?Ba(document,"touchmove",this._handleFallbackAutoScroll):Ba(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?za(document,"dragover",this._handleAutoScroll):(za(document,"pointermove",this._handleFallbackAutoScroll),za(document,"touchmove",this._handleFallbackAutoScroll),za(document,"mousemove",this._handleFallbackAutoScroll)),Oc(),xc(),clearTimeout(Ha),Ha=void 0},nulling:function(){wc=vc=gc=Sc=Cc=bc=yc=null,Ec.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(wc=t,e||this.options.forceAutoScrollFallback||$a||La||Ma){_c(t,this.options,r,e);var s=rl(r,!0);!Sc||Cc&&o===bc&&i===yc||(Cc&&Oc(),Cc=setInterval((function(){var r=rl(document.elementFromPoint(o,i),!0);r!==s&&(s=r,xc()),_c(t,n.options,r,e)}),10),bc=o,yc=i)}else{if(!this.options.bubbleScroll||rl(r,!0)===Ka())return void xc();_c(t,this.options,rl(r,!1),!1)}}},ja(t,{pluginName:"scroll",initializeByDefault:!0})}),cc.mount(Nc,Tc);const Pc={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=Pc.getStyle(t),i=Number.parseInt(o.height,10),r=i/(e/60);t.style.height="0px",function e(){const o=Number.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=Pc.getStyle(t),i=Number.parseInt(o.height,10),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=Number.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"===Pc.getStyle(t,"display"))=>{n?Pc.slideDown(t,e):Pc.slideUp(t,e)}},jc=t=>Number.isInteger(Number(t)),Dc=t=>{let e=0,n=t;for(;n?.previousElementSibling;)n=n.previousElementSibling,e++;return e},kc=(t,e,n)=>{const o=n.split("||"),i=qo(e).map((e=>t.find((t=>{const n=o.find((e=>!!us(t,e)));return n&&us(t,n)===e})))).filter(Boolean).concat(t);return qo(i)},Lc=(t,e,n)=>{for(let o=0;o<t.length;o++)e.call(n,t[o],o)},$c=(t,e)=>{const n=[];return Lc(t,((t,o)=>n.push(e(t,o)))),n},Ic={},Mc=t=>{if(Ic[t])return Ic[t];const e=({className:"class"}[t]||t).replace(/^\d+/,"").replace(/[^a-zA-Z0-9-:]/g,"");return Ic[t]=e,e},Rc=t=>t.replace(/\b\w/g,(t=>t.toUpperCase())),Fc=()=>-1!==window.navigator.userAgent.indexOf("MSIE "),Wc={capitalize:Rc,safeAttrName:Mc,forEach:Lc,copyObj:t=>window.JSON.parse(window.JSON.stringify(t)),map:$c,subtract:(t,e)=>e.filter((e=>!~t.indexOf(e))),indexOfNode:Dc,isInt:jc,get:us,orderObjectsBy:kc,isIE:Fc},Bc={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="${yr}${t}">${t}</i>`},zc=new Set(["input","textarea","select"]),Uc=(t={})=>{let e=t?.attrs?.name||t?.name;if(e)return e;const n=Vo(t);let o=t.config?.label||t.attrs?.label||t?.label;return o&&("object"==typeof o&&(o=qc.create(o).textContent),/^<.+>.+<.+>$/gim.test(o)&&(o=(t=>{const e=document.createElement("div");return e.innerHTML=t,e.textContent||e.innerText||""})(o)),e=`${n}-${Ar(((t,e,n="…")=>{if(t.length<=e)return t;const o=t.slice(0,e),i=o.lastIndexOf(" ");let r=`${i>0?o.slice(0,i):o}`;return n&&(r+=n),r})(o,24,null))}`),e||n};const qc=new class{constructor(t=Object.create(null)){this.options=t}set setOptions(t){this.options=Ho(this.options,t)}processElemArg(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}render=t=>(t.id=`f-${t.id||Vo()}`,this.create(t));create=(t,e=!1)=>{if(!t)return;if(this.isDOMElement(t))return t;const n=this,o=["children","content"],{className:i,options:r,dataset:s,...a}=this.processElemArg(t);let l;o.push("tag");const{tag:c}=a;let d;const u={attrs:{},className:[Wc.get(a,"config.inputWrap")],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=Ho(a.attrs,{className:i})),r){const t=this.processOptions(r,a,e);if(!this.holdsContent(h)||"button"===c)return Wc.forEach(t,(t=>{u.children.push(n.create(t,e))})),a.attrs.className&&(u.className=a.attrs.className),u.id=a.id,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(Wc.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=Wc.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};onRender=(t,e,n=333)=>{const o=Date.now(),i=()=>{!t.parentElement&&Date.now()-o<n?window.requestAnimationFrame(i):t.parentElement&&e(t)};i()};actionHandler(t,e){const n={onRender:qc.onRender,render:qc.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(`#${ai} svg symbol`);return this.iconSymbols=Array.from(t).reduce(((t,e)=>{var n;return t[e.id.replace(yr,"")]={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){if(!t)return;const n=`${t}?${new URLSearchParams(e).toString()}`;if(this.cachedIcons?.[n])return this.cachedIcons[n];const o=this.icons[t];if(o){if(e){const t=Ho(o,e);return this.cachedIcons[n]=qc.create(t).outerHTML,this.cachedIcons[n]}return this.cachedIcons[n]=qc.create(o).outerHTML,this.cachedIcons[n]}return Bc[qc.options.iconFont]?.(t)||t}processAttrs(t,e,n){const{attrs:o={}}=t;if(!n&&!o.name&&null!==o.name&&this.isInput(t.tag)){const n=Uc(t);n&&e.setAttribute("name",n)}for(const i of Object.keys(o)){const t=Wc.safeAttrName(i),n=this.processAttrValue(o[i]);!1!==n&&e.setAttribute(t,n)}}processAttrValue(t){if("function"==typeof t)return t();if("boolean"==typeof t)return t?"":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}toggleElementsByStr=(t,e)=>{const n=[];return qc.elementsContainText(t,e,((t,e)=>{e?(t.style.display="block",n.push(t)):t.style.display="none"})),n};elementsContainText=(t,e,n)=>{const o=[];return Lc(t,(t=>{const i=-1!==t.textContent.toLowerCase().indexOf(e.toLowerCase());n?.(t,i),i&&o.push(t)})),o};generateOption=({type:t="option",label:e,value:n,i:i=0,selected:r})=>({tag:"option"===t?"option":"input",attrs:{type:t,value:n||`${t}-${i}`,["option"===t?"selected":"checked"]:r||!i},config:{label:e||o.get("labelCount",{label:o.get("option"),count:i})}});processOptions(t,e,n){const{action:o,attrs:i={}}=e,r=i.type||e.tag,s=i.id||e.id;return t.map(((t,a)=>{const{label:l,value:c,...d}=t,u=()=>{const u={tag:"input",attrs:{name:s,type:r,value:c||"",id:`${s}-${a}`,...d},action:o},h={tag:"label",attrs:{for:`${s}-${a}`},children:l},p={children:[u,h],className:[`f-${r}`]};return i.className&&(e.config.inputWrap=i.className),e.config.inline&&p.className.push(`f-${r}-inline`),t.selected&&(u.attrs.checked=!0),n&&(h.attrs.contenteditable=!0),p},h={select:()=>{const e=t.attrs||t,n={attrs:e,...t,...e},{label:o,checked:i,selected:r,attrs:s}=n;return{tag:"option",attrs:{...s,selected:!(!i&&!r)},children:o}},button:t=>{const{type:n,label:o,className:i,id:r}=t;return{...e,attrs:{type:n},className:i,id:r||Vo(),options:void 0,children:o,action:e.action}},checkbox:u,radio:u};return h[r]?.(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),zc.has(e)}parsedHtml(t){const e=document.createElement("textarea");return e.innerHTML=t,e.textContent}labelAfter(t){const e=Wc.get(t,"attrs.type"),n=Wc.get(t,"config.labelAfter");return void 0!==n?n:"checkbox"===e||"radio"===e}requiredMark=()=>({tag:"span",className:"text-error",children:"*"});label(t,e){const n=Wc.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||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",()=>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}removeEmpty=t=>{const e=t.parentElement,n=Uo(t),o=e.getElementsByClassName(`formeo-${n}`);if(this.remove(t),!o.length)return this.isStage(e)?this.emptyClass(e):this.removeEmpty(e)};remove(t){const e=Uo(t);return e?vu.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,Wc.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)}};Wc.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");Pc.slideUp(t,600,(()=>{qc.empty(t),t.classList.remove("removing-all-fields"),qc.emptyClass(t),Pc.slideDown(t,300)}))}toggleSortable(t,e){let n=e;const o=Uo(t);if(!o)return;const i=Uo(t.parentElement),r=qc[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(Si.get(t.classList.item(0)));t.classList.toggle("empty",!e.length)}btnTemplate=({title:t="",...e})=>({tag:"button",attrs:{type:"button",title:t},...e});isControls=t=>Uo(t)===mi;isStage=t=>Uo(t)===gi;isRow=t=>Uo(t)===vi;isColumn=t=>Uo(t)===bi;isField=t=>Uo(t)===yi;asComponent=t=>vu[`${Uo(t)}s`].get(t.id);isDOMElement(t){return t instanceof window.Element||t instanceof window.HTMLElement||!(!t||"object"!=typeof t||1!==t.nodeType||"string"!=typeof t.nodeName)}},Vc="f-autocomplete",Hc=`${Vc}-display-field`,Xc=`${Vc}-list`,Yc="highlight-component",Gc=`${Xc}-item`,Zc=["config.label","config.controlId"],Jc=[...Zc,"config.legend","name"],Kc=t=>Zc.reduce(((e,n)=>e||t.get(n)),null),Qc=t=>Jc.reduce(((e,n)=>e||t.get(n)),null)||_r(t.name),td=new Map([["condition.source",Kc],["if.condition.source",Kc],["if.condition.target",Kc],["then.condition.target",Qc],["condition.target",Qc]]),ed=({id:t,...e},n)=>{const{name:o,label:i}=e;if(!o)return i;return td.get(n)(e)},nd=t=>(t.classList.contains(Gc)||(t=t.parentElement),t),od=({value:t,textLabel:e,htmlLabel:n,componentType:o,depth:i=0},r)=>{const s={tag:"li",children:n,dataset:{value:t,label:e},className:[Gc,`${Gc}-depth-${i}`,`component-type-${o}`],action:{mousedown:({target:t})=>{t=nd(t),r.setValue(t),r.selectOption(t),r.hideList()},mouseover:({target:t})=>{t=nd(t),r.removeHighlight(),r.highlightComponent(t)},mouseleave:({target:t})=>{t=nd(t),r.removeHighlight()}}};return qc.create(s)},id=t=>{const e=t.value,n=[],o=vu.flatList(),i=Object.entries(o).reduce(((o,[i,r])=>{const s=ed(r,t.key);if(s){const a=r.name,l={tag:"span",content:` ${_r(a)}`,className:"component-type"},c=`${a}.${s}`;n.push(c);const d=((t,e)=>{const n=t.reduce(((t,n)=>t+(n===e)),0);return n>1?`(${n})`:""})(n,c),u=[`${s} `,{tag:"span",content:d,className:"component-label-count"},l],h=[s,d].join(" ").trim();if(r.isCheckable){const e=((t,e)=>{const n=t.data.options.map(((n,o)=>{const i=`${t.address}.options[${o}]`,r=n.label,s=n.label;return od({value:i,textLabel:r,htmlLabel:s,componentType:"option",depth:1},e)}));return qc.create({tag:"ul",attrs:{className:[Xc,"options-list"]},children:n})})(r,t);u.push(e)}const p=(({selectedId:t,...e})=>(e.value===t&&(e.selected=!0),e))({value:i,textLabel:h,htmlLabel:u,componentType:a,selectedId:e});o.push(od(p,t))}return o}),[]);return i};class rd{lastCache=Date.now();optionsCache=null;constructor({key:t,value:e,className:n,onChange:o=ti}){this.key=t,this.className=[n||this.key.replace(/\./g,"-")].flat(),this.value=e,this.onChange=o||ti,this.events=[],this.build()}createProxy(){return new Proxy(this,{get(t,e){if(e in t)return t[e];if(e in t.dom){const n=t.dom[e];return"function"==typeof n?n.bind(t.dom):n}},set:(t,e,n)=>(e in t?t[e]=n:t.dom[e]=n,!0)})}get isAddress(){return Jo(this.value)}get valueComponent(){return Jo(this.value)&&vu.getAddress(this.value)}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(`${Vc}-focused`);const n=qc.toggleElementsByStr(this.list.querySelectorAll(`.${Gc}-depth-0`),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(`${Vc}-focused`),e.removeEventListener("keydown",t),this.hideList()},input:t=>{const{value:e}=t.target,n=qc.toggleElementsByStr(this.list.querySelectorAll("li"),e);if(0===e.length&&this.clearValue(),0===n.length)this.hideList();else{const t=this.getActiveOption()||n[0];this.showList(t)}this.setValue({dataset:{label:e,value:e}})}};return this.displayField=qc.create({tag:"input",autocomplete:"off",action:e,attrs:{type:"text",className:Hc,value:this.label||this.value,placeholder:o.get(`${this.key}.placeholder`)}}),this.hiddenField=qc.create({tag:"input",attrs:{type:"hidden",className:Vc,value:this.value}}),this.list=qc.create({tag:"ul",attrs:{className:Xc}}),this.clearButton=qc.create({tag:"span",content:qc.icon("remove"),className:"clear-button hidden",action:{click:()=>this.clearValue()}}),this.dom=qc.create({children:[this.displayField,this.clearButton,this.hiddenField],className:[Vc,this.className].flat(),action:{onRender:t=>{this.stage=t.closest(".formeo-stage"),this.value&&(this.displayField.value=this.label),this.clearButton.classList.toggle("hidden",!this.value.length)}}}),this.dom}get label(){if(!Jo(this.value))return this.value;const t=this.value&&vu.getAddress(this.value);return t&&ed(t,`${this.key}`)||this.value}updateOptions(){let t=this.optionsCache;const e=Date.now();(e-this.lastCache>5*Xi||!t)&&(qc.empty(this.list),t=this.generateOptions(),this.lastCache=e),this.list.children.length||this.list.append(...t)}generateOptions(){return this.optionsCache=id(this),this.optionsCache}setListPosition(){const{offsetHeight:t,offsetWidth:e}=this.displayField,n=this.displayField.closest(".formeo-stage").getBoundingClientRect(),o=this.displayField.getBoundingClientRect(),i={position:"absolute",top:o.y+t-n.y+"px",left:o.x+window.scrollX-n.x+2+"px",width:`${e}px`};Object.assign(this.list.style,i)}showList(t,e=this.list){this.stage.contains(this.list)||this.stage.appendChild(this.list),this.setListPosition(),this.selectOption(t),Pc.slideDown(e,Hi)}hideList(t=this.list){Pc.slideUp(t,Hi),this.removeHighlight(),this.stage.contains(this.list)&&this.stage.removeChild(this.list)}getActiveOption(t=this.list){const e=t.querySelector(".active-option");return"none"!==e?.style.display?e:null}getPreviousOption(t){let e=t;do{e=e?e.previousSibling:null}while(null!=e&&"none"===e.style.display);return e}getNextOption(t){let e=t;do{e=e?e.nextSibling:null}while(null!=e&&"none"===e.style.display);return e}selectOption(t,e=this.list){const n=e.querySelectorAll("li");for(const o of n){const{dataset:{value:t}}=o;if(o.classList.remove("active-option"),Jo(t)){const e=vu.getAddress(t);e?.dom?.classList.remove(Yc)}}t&&(t.classList.add("active-option"),this.highlightComponent(t))}removeHighlight(){const t=document.getElementsByClassName(Yc);for(const e of t)e.classList.remove(Yc)}highlightComponent(t){const{dataset:{value:e}}=t;if(Jo(e)){const{componentAddress:t,isOptionAddress:n,optionIndex:o}=Tr(e).reduce(((t,e)=>"options"===e?(t.isOptionAddress=!0,t):t.isOptionAddress?(t.optionIndex=+e,t):(t.componentAddress.push(e),t)),{componentAddress:[],optionIndex:null,isOptionAddress:!1}),i=vu.getAddress(t);if(i?.dom&&(i.dom.classList.add(Yc),n)){const t=i.dom.querySelectorAll(".field-preview .f-checkbox, .field-preview .f-radio");t[o]?.classList.add(Yc)}}}clearValue(){this.selectOption(null),this.setValue({dataset:{label:"",value:""}}),this.displayField.focus()}setValue(t){const{label:e,value:n}=t.dataset;this.displayField.value=e,this.hiddenField.value=n,this.value=n,this.clearButton.classList.toggle("hidden",!n.length),this.onChange?.({target:this.hiddenField})}}function sd({key:t,value:e,type:n="text",checked:i}){const r={tag:"input",attrs:{type:n,value:e,placeholder:o.get(`${t}.placeholder`)||_r(t)},className:[t.replace(/\./g,"-")],config:{}};return i&&(r.attrs.checked=!0),r}function ad(t){const e=o.get(t);if(e)return e;const n=t.split(".");return o.get(n[n.length-1])}const ld={autocomplete:(...t)=>new rd(...t).createProxy(),string:({key:t,value:e})=>sd({key:t,value:e}),boolean:({key:t,value:e})=>sd({key:t,value:e,type:"selected"===t?"radio":"checkbox",checked:!!e}),number:({key:t,value:e})=>sd({key:t,value:e,type:"number"}),array:({key:t,value:e})=>({tag:"select",attrs:{placeholder:ad(`placeholder.${t}`)},className:[t.replace(/\./g,"-")],options:e}),object:t=>Object.entries(t).map((([t,e])=>ld[qc.childType(e)]({key:t,value:e})))},cd={boolean:(t,e)=>({click:({target:n})=>{if("radio"===n.type){const t=e.data.options.map((t=>({...t,selected:!1})));e.set("options",t)}e.set(t,n.checked),e.updatePreview()}}),string:(t,e)=>({input:({target:{value:n}})=>{e.set(t,n),e.debouncedUpdatePreview()}}),number:(t,e)=>({input:({target:{value:n}})=>{e.set(t,Number(n)),e.debouncedUpdatePreview()}}),array:(t,e)=>({change:({target:{value:n}})=>{e.set(t,n),e.debouncedUpdatePreview()}}),object:()=>({})},dd="hidden-property",ud=/\.options\[\d+\]$/,hd={"if-sourceProperty":ps(hr,dr,ur),"if-targetProperty":ps(hr),"then-targetProperty":ps(hr,dr,ur),...Object.entries(pr).reduce(((t,[e,n])=>(t[`if-${e}`]=n,t[`then-${e}`]=n,t)),{})},pd={assignment:md,comparison:md,logical:md,source:({key:t,value:e,onChange:n,conditionType:o})=>ld.autocomplete({key:`${o}.condition.${t}`,value:e,onChange:n,className:`condition-${t}`}),sourceProperty:md,targetProperty:md,target:t=>pd.source(t),value:({key:t,value:e,onChange:n},o)=>{const i=ld.string({key:`condition.${t}`,value:e});return i.action={input:n},i}};function fd({key:t,value:e,conditionType:n}){const i=hd[`${n}-${t}`];return Object.entries(i||{}).map((([n,i])=>function({fieldName:t,fieldValue:e,key:n,optionValue:i}){return{label:o.get(`${t}.${n}`)||_r(n).toLowerCase(),value:i,selected:i===e}}({fieldName:t,fieldValue:e,key:n,optionValue:i})))}function md({key:t,value:e,onChange:n,conditionType:o}){const i=fd({key:t,value:e,conditionType:o}),r=ld.array({key:`condition.${t}`,value:i});return r.action={change:n},r}const gd={sourceProperty:t=>{const e=t.get("source"),n=t.get("sourceProperty"),o=!!e.value,i=!!e.value.match(ud);return wd(i,n),!o},comparison:t=>{const e=t.get("source"),n=t.get("sourceProperty"),o=!!e.value,i=!!e.value.match(ud);return!o||i||"value"!==n.value},assignment:t=>{const e=t.get("target"),n=t.get("targetProperty");return!!!e.value||n.value.startsWith("is")},targetProperty:t=>{const e=t.get("target"),n=t.get("targetProperty"),o=!!e.value.match(ud);return wd(o,n),i=e.value,!_i.test(i);var i},target:t=>{const e=t.get("source"),n=t.get("sourceProperty");return!(!n||!!e?.value)||n&&"value"!==n?.value},value:t=>{const e=t.get("target"),n=t.get("targetProperty");return void 0!==n&&(!(!e||e.value)||(o=t.get("comparison"),!!o?.classList.contains(dd)||(n.value===bd||n.value.startsWith("is"))));var o}},vd=t=>{for(const[e,n]of t){const o=!!gd[e]?.(t)||!1;n.classList.toggle(dd,o)}},bd="isChecked",yd=t=>t.value.endsWith("Checked"),wd=(t,e)=>{if(t&&yd(e))return null;const n=Array.from(e.querySelectorAll("option")),o=[];for(const i of n){const e=yd(i),n=t?!e:e;n&&o.push(i.value),i.classList.toggle("hidden-option",n)}o.includes(e.value)&&(e.value=t?bd:n.find((t=>!yd(t)))?.value||e.value)};class Cd{constructor({conditionValues:t,conditionType:e,conditionCount:n,index:o},i){this.values=new Map(function(t,e=cr){return e.reduce(((e,n)=>(void 0!==t[n]&&e.push([n,t[n]]),e)),[])}(t)),this.conditionType=e,this.parent=i,this.baseAddress=`${i.address}.${e}`,this.fields=new Map,this.conditionCount=n,this.index=o,this.dom=this.generateDom()}setConditionIndex(t){this.index=t}get address(){return`${this.baseAddress}[${this.index}]`}destroy(){const t=vu.getAddress(this.baseAddress);t.splice(this.index,1),vu.setAddress(this.baseAddress,t),Pc.slideUp(this.dom,Hi,(()=>{this.dom.remove()}))}label(){return this.index?null:{tag:"label",className:`condition-label ${this.conditionType}-condition-label`,content:o.get(`condition.type.${this.conditionType}`)}}generateDom(){const t=[];for(const[n,o]of this.values){const e=t=>this.onChangeCondition({key:n,target:t.target}),i={key:n,value:o,conditionType:this.conditionType,onChange:e},r=pd[n](i,this.values),s=r.dom||qc.create(r);this.fields.set(n,r.dom?r:s),t.push(s)}const e={children:[this.label(),...t,...this.generateConditionTypeActionButtons()],className:`f-condition-row ${this.conditionType}-condition-row display-none`,action:{onRender:t=>{this.processUiState()}}};return qc.create(e)}generateConditionTypeActionButtons(){const t=[],e="manage-condition-type",n=t=>`${t}-condition-type`,i=qc.btnTemplate({title:o.get(`remove${this.conditionType}Condition`),className:[e,n("remove")],content:qc.icon("minus"),action:{click:()=>this.destroy(),mouseover:t=>{this.dom.classList.add("to-remove")},mouseout:t=>{this.dom.classList.remove("to-remove")}}});t.push(i);const r=qc.btnTemplate({title:o.get(`add${this.conditionType}Condition`),className:[e,n("add")],content:qc.icon("plus"),action:{click:()=>{const t=this.parent.addConditionType(this.conditionType),e={changedProperty:null,dataPath:t.address,value:t.value,src:t.dom};this.updateDataDebounced(e)}}});return t.push(r),t}get value(){return Array.from(this.fields).reduce(((t,[e,n])=>(t[e]=n.value,t)),{})}processUiState(){vd(this.fields),this.dom.classList.remove("display-none")}updateDataDebounced=Ko((t=>{Eu.formeoUpdated(t),vu.setAddress(t.dataPath,t.value)}));onChangeCondition=({key:t,target:e})=>{const n={changedProperty:t,dataPath:this.address,value:this.value,src:e};vd(this.fields),this.updateDataDebounced(n)}}const Ed=new Map([["attrs",({itemKey:t})=>t],["options",({itemKey:t,key:e})=>`${t}.${e}`]]),Sd=(t,e)=>{if("select"===e.controlId){const n=e.editPanels.get("options"),[o,i]=t?Cr:Er,r=n.data.map((({[o]:t,...e})=>({[i]:t,...e})));n.setData(r)}},xd=new Map([["attrs-multiple",t=>({change:({target:e})=>{"select"===t.field.controlId&&Sd(e.checked,t.field)}})]]);class Od{constructor({key:t,index:e,field:n,panel:o,data:i}){this.field=n,this.itemKey=t,this.itemIndex=e,this.panel=o,this.panelName=o.name,this.isDisabled=n.isDisabledProp(t,this.panelName),this.isHidden=this.isDisabled&&n.config.panels[this.panelName].hideDisabled,this.isLocked=n.isLockedProp(t,this.panelName),this.address=`${n.indexName}.${n.id}.${t}`,this.itemSlug=Nr(t),this.conditionTypeWrap=new Map,void 0!==i&&void 0===this.field.get(this.itemKey)&&this.field.set(this.itemKey,i);const r=[`field-${this.itemSlug}`,"prop-wrap"];this.isHidden&&r.push("hidden-property"),this.dom=qc.create({tag:"li",className:r,children:{className:"component-prop",children:[this.itemInputs(),this.itemControls]}})}get itemValues(){const t=this.field.get(this.itemKey);return t?.constructor===Object?kc(Object.entries(t),Cr,"0"):[[this.itemKey,t]]}findOrCreateConditionTypeWrap(t){let e=this.conditionTypeWrap.get(t);return e||(e=qc.create({className:`type-conditions-wrap ${t}-conditions-wrap`}),this.conditionTypeWrap.set(t,e),e)}itemInputs(){const t=qc.create({className:`${this.panelName}-prop-inputs prop-inputs f-input-group`,children:this.itemValues.map((([t,e])=>"conditions"===this.panelName?this.generateConditionFields(t,e):this.itemInput(t,e)))});return this.inputs&&this.inputs.replaceWith(t),this.inputs=t,t}addConditionType=(t,e)=>{const n=this.findOrCreateConditionTypeWrap(t);let o=e;if(!o){const[e]=gr()[t],i=n.children.length;"if"===t&&(e.logical="||"),o={conditionValues:e,conditionCount:i,index:i}}const i=new Cd({conditionType:t,...o},this);return n.appendChild(i.dom),i};removeConditionType=(t,e)=>{const n=this.conditionTypeWrap.get(t),o=n.children[e];o.destroy(),n.removeChild(o.dom)};generateConditionFields=(t,e)=>(this.conditions=new Map,e.forEach(((n,o)=>{const i=this.addConditionType(t,{index:o,conditionCount:e.length,conditionValues:n});this.conditions.set(o,i)})),this.findOrCreateConditionTypeWrap(t));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:()=>{Pc.slideUp(this.dom,Vi,(t=>{this.field.remove(this.itemKey),t.remove(),this.panel.updateProps()}))},mouseover:t=>{this.dom.classList.add("to-remove")},mouseout:t=>{this.dom.classList.remove("to-remove")}},content:qc.icon("remove")};return{className:`${this.panelName}-prop-controls prop-controls`,content:[t]}}itemInput(t,e){const n=qc.childType(e)||"string",o=Ed.get(this.panelName)?.({itemKey:this.itemKey,key:t})||this.itemKey,i=o.split(".").filter(Number.isNaN).join(".")||t,r=ld[n]({key:t,value:e}),s=`${this.field.shortId}-${Nr(o).replace(/-\d+-(selected)/g,"-$1")}`,a={label:"options"!==this.panelName&&(ad(i)||_r(i)),labelAfter:!1},l={name:"checkbox"===r.attrs.type?`${s}[]`:s};l.disabled=this.isDisabled,l.locked=this.isLocked;const c=xd.get(this.itemSlug)?.(this),d=function(t,e={}){const n={...t};for(const o in e)Object.hasOwn(e,o)&&(Object.hasOwn(n,o)?Array.isArray(n[o])?n[o].push(e[o]):n[o]=[n[o],e[o]]:n[o]=e[o]);return n}(cd[n](o,this.field),c||{}),u=Ho(ld[n]({key:t,value:e}),{action:d,attrs:l,config:a});return Cr.includes(t)?{className:"f-addon",children:u}:u}}const _d={multiple:(t,e)=>{Sd(!!t,e)}};class Ad{constructor(t,e,n){this.type=qc.childType(t),this.name=e,this.component=n,this.panelConfig=this.getPanelConfig(this.data)}get data(){const t=this.component.get(this.name);return"object"===this.type?Object.entries(t):t}getPanelConfig(t){return this.props=this.createProps(t),this.editButtons=this.createEditButtons(),{config:{label:o.get(`panel.label.${this.name}`)},attrs:{className:`${fi} ${this.name}-panel`},children:[this.props,this.editButtons]}}createProps(t=this.data){this.editPanelItems=Array.from(t).map(((t,e)=>{const n="array"===this.type,o=n?`[${e}]`:`.${t[0]}`,i=n?t:{[t[0]]:t[1]};return new Od({key:`${this.name}${o}`,data:i,field:this.component,index:e,panel:this})}));const e={tag:"ul",attrs:{className:["edit-group",`${this.component.name}-edit-group`,`${this.component.name}-edit-${this.name}`]},editGroup:this.name,isSortable:"options"===this.name,content:this.editPanelItems};return qc.create(e)}updateProps(){const t=this.createProps();this.props.replaceWith(t),this.props=t}createEditButtons(){const t=this.name,e=o.get(`panelEditButtons.${t}`),n={attrs:this.addAttribute,options:this.addOption,conditions:this.addCondition},i=[];if("conditions"===t){o.current&&!o.current.clearAll&&o.put("clearAll","Clear All");const e={...qc.btnTemplate({content:[qc.icon("bin"),o.get("clearAll")],title:o.get("clearAll")}),className:`clear-all-${t}`,action:{click:()=>{this.clearAllItems()}}};i.push(e)}const r={...qc.btnTemplate({content:e,title:e}),className:`add-${t}`,action:{click:e=>{const i={btnCoords:qc.coords(e.target),addAction:n[t]};"attrs"===t&&(i.isDisabled=this.component.isDisabledProp,i.isLocked=this.component.isLockedProp,i.message={attr:o.get(`action.add.${t}.attr`),value:o.get(`action.add.${t}.value`)});const r=_r(t),s=new window.CustomEvent(`onAdd${r}`,{detail:i});_u.add[t](i),document.dispatchEvent(s)}}};i.push(r);return{className:"panel-action-buttons",content:i}}addAttribute=(t,e)=>{let n=e;const i=Mc(t),r=`attrs.${i}`;o.current[r]||o.put(r,Rc(t)),"string"==typeof n&&["true","false"].includes(n)&&(n=JSON.parse(n)),this.component.set(`attrs.${t}`,n),_d[i]?.(n,this.component);const s=this.props.querySelector(`.${this.component.name}-attrs-${i}`),a=new Od({key:r,data:{[i]:n},field:this.component,panel:this});s?s.replaceWith(a.dom):this.props.appendChild(a.dom),this.component.resizePanelWrap()};addOption=()=>{const t=this.component.data.config.controlId,e=this.component.get("options"),n="select"===t?"option":t,i=o.get("newOptionLabel",{type:n})||"New Option",r=`${this.name}[${this.data.length}]`,s=e[e.length-1],a={...e.length?s:{},label:i};"button"!==t&&(a.value=Ar(i));const l=new Od({key:r,data:a,field:this.component,index:this.props.children.length,panel:this});this.editPanelItems.push(l),this.props.appendChild(l.dom),this.component.debouncedUpdatePreview(),this.component.resizePanelWrap()};addCondition=t=>{const e=`conditions[${this.component.get("conditions").length}]`,n=new Od({key:e,data:t.template,field:this.component,panel:this});this.props.appendChild(n.dom),this.component.set(e,t.template),this.component.resizePanelWrap()};clearAllItems=()=>{const t="array"===this.type?[]:{},e={type:this.name,removeAction:()=>{this.component.set(this.name,t),this.updateProps()}};_u.remove[this.name](e);const n=_r(this.name),o=new window.CustomEvent(`onRemove${n}`,{detail:e});document.dispatchEvent(o)};setData(t){this.data=t,this.component.set(this.name,t),this.updateProps()}}const Td=Object.freeze({type:"field",displayType:"slider"}),Nd=t=>({transform:`translateX(${t?`${t}px`:0})`});class Pd{constructor(t){this.opts=Ho(Td,t),this.panelDisplay=this.opts.displayType,this.activePanelIndex=0,this.panelNav=this.createPanelNav();const e=this.createPanelsWrap();this.nav=this.navActions(),this.nav.groupChange(this.activePanelIndex);const n=new window.ResizeObserver((([{contentRect:{width:t}}])=>{this.currentWidth!==t&&(this.toggleTabbedLayout(),this.currentWidth=t,this.nav.setTranslateX(this.activePanelIndex,!1))})),o=window.setTimeout((()=>{n.observe(e),window.clearTimeout(o)}),Xi)}getPanelDisplay(){const t=this.panelsWrap,e=Number.parseInt(qc.getStyle(t,"width"),10)>390?"tabbed":"slider",n="auto"===this.opts.displayType;return this.panelDisplay=n?e:this.opts.displayType||Td.displayType,this.panelDisplay}toggleTabbedLayout=()=>{this.getPanelDisplay();const t=this.isTabbed;return this.panelsWrap.parentElement?.classList.toggle("tabbed-panels",t),t&&this.panelNav.removeAttribute("style"),t};resizePanels=()=>{this.toggleTabbedLayout()};createPanelsWrap(){const t=qc.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 Wc.forEach(e,(t=>{t.fieldId=this.opts.id,t.isSortable&&cc.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=Dc(t.target);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",qc.create(e)}createPanelNav(){this.labels=this.createPanelNavLabels();const t={tag:"button",attrs:{className:"next-group",title:o.get("controlGroups.nextGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:t=>this.nav.nextGroup(t)},content:qc.icon("triangle-right")},e={tag:"button",attrs:{className:"prev-group",title:o.get("controlGroups.prevGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:t=>this.nav.prevGroup(t)},content:qc.icon("triangle-left")};return qc.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=Dc(this.currentPanel);let r={nav:0,panel:0},s={...r};t.groupChange=t=>(this.activePanelIndex=t,this.currentPanel=i[t],qc.removeClasses(i,"active-panel"),qc.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=Hi,animate:r=!this.isTabbed})=>{const a=[Nd(s.panel),Nd(t.panel)],l=[Nd(s.nav),Nd(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=()=>{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}}let jd=null;const Dd=ps(hr);class kd extends Oa{constructor(t,e={}){const n={...e,id:e.id||Vo()};super(t,n),this.id=n.id,this.shortId=this.id.slice(0,this.id.indexOf("-")),this.name=t,this.indexName=`${t}s`,this.config=vu[`${this.name}s`].config,Ho(this.config,n.config),this.address=`${this.name}s.${this.id}`,this.dataPath=`${this.address}.`,this.editPanels=new Map,this.eventListeners=new Map,this.initEventHandlers()}initEventHandlers(){this.config.events&&Object.entries(this.config.events).forEach((([t,e])=>{this.addEventListener(t,e)}))}addEventListener(t,e){this.eventListeners.has(t)||this.eventListeners.set(t,[]),this.eventListeners.get(t).push(e)}removeEventListener(t,e){if(!this.eventListeners?.has(t))return;const n=this.eventListeners.get(t),o=n.indexOf(e);o>-1&&n.splice(o,1)}dispatchComponentEvent(t,e={}){const n={component:this,target:this,type:t,timestamp:Date.now(),...e};return this.eventListeners?.has(t)&&this.eventListeners.get(t).forEach((t=>{try{"function"==typeof t&&t(n)}catch(e){}})),n}set(t,e){const n=this.get(t),o=super.set(t,e);return n!==e&&this.dom&&this.dispatchComponentEvent("onUpdate",{path:t,oldValue:n,newValue:e}),o}get js(){return this.data}get json(){return this.data}remove=t=>{if(t){const e=Tr(t),n=e.pop(),o=this.get(e);return Array.isArray(o)?jc(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;this.dispatchComponentEvent("onRemove",{path:t,parent:e,children:[...n]}),Lc(n,(t=>t.remove())),this.dom.parentElement.removeChild(this.dom),((t,e)=>{const n=t.indexOf(e);-1!==n&&t.splice(n,1)})(vu.getAddress(`${e.name}s.${e.id}.children`),this.id),e.children.length||e.emptyClass(),"row"===e.name&&e.autoColumnWidths();const o={row:ir,column:rr,field:sr}[this.name];return o&&Eu.formeoUpdated({componentId:this.id,componentType:this.name,parent:e},o),vu[`${this.name}s`].delete(this.id)};empty(){const t=this.children.map((t=>(t.remove(),t)));return this.dom.classList.add("empty"),t}emptyClass=()=>this.dom.classList.toggle("empty",!this.children.length);getActionButtons(){const t=[`hovering-${this.name}`,"hovering"];return{className:[`${this.name}-actions`,"group-actions"],action:{mouseenter:()=>{vu.stages.active.dom.classList.add(`active-hover-${this.name}`),this.dom.classList.add(...t)},mouseleave:({target:e})=>{this.dom.classList.remove(...t),vu.stages.active.dom.classList.remove(`active-hover-${this.name}`),e.removeAttribute("style")}},children:[{...qc.btnTemplate({content:qc.icon(`handle-${this.name}`)}),className:["component-handle",`${this.name}-handle`]},{className:["action-btn-wrap",`${this.name}-action-btn-wrap`],children:this.buttons}]}}getComponentTag=()=>qc.create({tag:"span",className:["component-tag",`${this.name}-tag`],children:[(this.isColumn||this.isField)&&qc.icon("component-corner",{className:"bottom-left"}),qc.icon(`handle-${this.name}`),_r(this.name),(this.isColumn||this.isRow)&&qc.icon("component-corner",{className:"bottom-right"})].filter(Boolean)});toggleEdit(t=!this.isEditing){this.isEditing=t;const e=this.dom,n="editing",o=`${n}-${this.name}`,i=this.dom.querySelector(`.${this.name}-edit`);Pc.slideToggle(i,Vi,t),"field"===this.name&&(Pc.slideToggle(this.preview,Vi,!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}`)=>({...qc.btnTemplate({content:qc.icon(t)}),className:["component-handle"]}),move:(t="move")=>({...qc.btnTemplate({content:qc.icon(t)}),className:["item-move"],meta:{id:"move"}}),edit:(t="edit")=>({...qc.btnTemplate({content:qc.icon(t)}),className:["edit-toggle"],meta:{id:"edit"},action:{click:()=>{this.toggleEdit()}}}),remove:(t="remove")=>({...qc.btnTemplate({content:qc.icon(t)}),className:["item-remove"],meta:{id:"remove"},action:{click:()=>{Pc.slideUp(this.dom,Vi,(()=>{if("column"===this.name){this.parent.autoColumnWidths(),this.remove()}else this.remove()}))}}}),clone:(t="copy")=>({...qc.btnTemplate({content:qc.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=>t[e]?.()||e));return this.actionButtons=o,this.actionButtons}get index(){return Dc(this.dom)}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[qc.childType(t)](this.dom)};get parentType(){return Bi.get(this.name)}get parent(){const t=this.parentType;if(!this.dom||!t)return null;const e=this.dom.closest(`.${Di[t]}`);return e&&qc.asComponent(e)}get children(){if(!this.dom)return[];const t=this.domChildren,e=Fi.get(this.name);return $c(t,(t=>vu.getAddress(`${e}s.${t.id}`))).filter(Boolean)}loadChildren=(t=this.data.children)=>t.map((t=>this.addChild({id:t})));get domChildren(){const t=this.dom.querySelector(".children");return t?t.children:[]}addChild(t={},e=this.domChildren.length){let n=t;"object"!=typeof t&&(n={id:n});const o=this.dom.querySelector(".children"),{id:i=Vo()}=n,r=Fi.get(this.name);if(!r)return null;const s=`${r}s`,a=vu.getAddress(`${s}.${i}`)||vu[s].add(i,n);e>=o.children.length?o.appendChild(a.dom):o.children[e].before(a.dom),this.dispatchComponentEvent("onAddChild",{parent:this,target:a,child:a,index:e}),a.dispatchComponentEvent("onAdd",{parent:this,target:a,index:e,addedVia:"addChild"}),this.config.events?.onAddChild?.({parent:this,child:a});const l=a.get("children");return l?.length&&a.loadChildren(l),this.removeClasses("empty"),this.saveChildOrder(),a}saveChildOrder=()=>{if(this.render)return;const t=this.children.map((({id:t})=>t));return this.set("children",t),t};onAdd({from:t,to:e,item:n,newIndex:o}){t.classList.contains(mi)||(t=t.parentElement);const i=Uo(t),r=Uo(e.parentElement),s=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=Dc(this.dom);return()=>this.parent.addChild(t,e+1)}],[2,t=>()=>this.parent.parent.addChild(t)]]),a={controls:async()=>{if(!jd){const{default:t}=await Promise.resolve().then((()=>ru));jd=t}const{controlData:{meta:{id:t},...e}}=jd.get(n.id);hs(e,"config.controlId",t);const i=t.startsWith("layout-")?t.replace(/^layout-/,""):"field",r=us({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}`),a=s.get(r)();qc.remove(n);return a(e,o)},row:()=>{const t=(s.get({stage:-1,row:0,column:1}[r])||Qo)();return t?.({id:n.id},o)},column:()=>{const t=(s.get({stage:-2,row:-1}[r])||Qo)();return t?.(n.id)}},l=a[i]?.(n,o);return this.dispatchComponentEvent("onAdd",{from:t,to:e,item:n,newIndex:o,fromType:i,toType:r,addedComponent:l,addedVia:"dragDrop"}),(()=>{this.saveChildOrder(),this.removeClasses("empty")})(),l}onSort=()=>this.saveChildOrder();onRemove({from:{parentElement:t}}){return t.classList.contains(bi)&&t.classList.remove("column-editing-field"),"stage"===this.name||this.children.length?(this.emptyClass(),this.saveChildOrder()):this.remove()}onEnd=({to:{parentElement:t},from:{parentElement:e}})=>{t?.classList.remove(`hovering-${Uo(t)}`),e?.classList.remove(`hovering-${Uo(e)}`)};onRender(){this.dispatchComponentEvent("onRender",{dom:this.dom});const{events:t}=this.config;if(!t)return null;t.onRender&&qc.onRender(this.dom,t.onRender)}set config(t){const e=us(t,"all"),n=us(this.data,"config.controlId"),o=[e,n&&us(t,n),us(t,this.id)].reduce(((t,e)=>e?Ho(t,e):t),this.configVal);this.configVal=o}get config(){return this.configVal}runConditions=()=>{const t=this.get("conditions");if(!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)))}))};getComponent(t){const[e,n]=t.split("."),o=vu[e];return n===this.id?this:o?.get(n)}value=(t,e)=>{const n=t.split("."),o=this.getComponent(t),i=o&&n.slice(2,n.length).join(".");return[!o,!i,!Dd[i]].some(Boolean)?t:e?o.set(Dd[i],e):o.get(Dd[i])};getResult=t=>({"=":(t,e,n)=>t.set(e,n)}[t]);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)}}));execResults=t=>{const e=t.map((t=>this.execResult(t)));return Promise.all(e)};execResult=({target:t,action:e,value:n,_propertyPath:o})=>new Promise(((o,i)=>{try{return o(e(t,n))}catch(r){return i(r)}}));cloneData=()=>{const t={...Xo(this.data),id:Vo()};return"field"!==this.name&&(t.children=[]),t};clone=(t=this.parent)=>{const e=t.addChild(this.cloneData(),this.index+1);return"field"!==this.name&&this.cloneChildren(e),this.dispatchComponentEvent("onClone",{original:this,clone:e,parent:t}),e};cloneChildren(t){for(const e of this.children)e?.clone(t)}createChildWrap=t=>qc.create({tag:"ul",attrs:{className:"children"},children:t});get isRow(){return this.name===Pi.row}get isColumn(){return this.name===Pi.column}get isField(){return this.name===Pi.field}isDisabledProp=(t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.disabled.concat(this.get("config.disabled")).includes(t)};isLockedProp=(t,e="attrs")=>{const n=this.config.panels[e];if(!n)return!1;return n.locked.concat(this.get("config.locked")).includes(t)};get editWindow(){const t={className:["component-edit",`${this.name}-edit`,"slide-toggle","formeo-panels-wrap"]},e=this.editPanels.size;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.querySelector(".edit-toggle"),e=this.dom.querySelector(`.${this.name}-actions`),n=e.getElementsByTagName("button");e.style.maxWidth=n.length*n[0].clientWidth+"px",qc.remove(t)}else this.resizePanelWrap()}},qc.create(t)}updateEditPanels=()=>{if(!this.config)return null;const t=["object","array"],e=qo([...this.config.panels.order,...Object.keys(this.data)]),n=["children","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=qc.childType(e);if(t.includes(n)){const t=new Ad(e,r,this);this.editPanels.set(t.name,t)}}const i={panels:Array.from(this.editPanels.values()).map((({panelConfig:t})=>t)),id:this.id,displayType:"auto"};this.panels=new Pd(i),this.dom&&(this.dom.querySelector(".panel-nav").replaceWith(this.panels.panelNav),this.dom.querySelector(".panels").replaceWith(this.panels.panelsWrap))}}class Ld{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=qc.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(`.${vi}`);if(this.validateResizeTarget(e,n))if(this.startX="touchstart"===t.type?t.touches[0].clientX:t.clientX,o.classList.add(Ei),this.columnPreset=o.querySelector(`.${Ci}`),this.originalColumnClass=e.className,this.originalSiblingClass=n.className,e.className=e.className.replace(br,""),n.className=n.className.replace(br,""),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(Yo(e,this.rowWidth)),i=parseFloat(Yo(n,this.rowWidth));return o<10||i<10?null:{colWidth:Go(o.toFixed(1)),siblingColWidth:Go(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(),vu.setAddress(`columns.${t.id}.config.width`,t.dataset.colWidth),vu.setAddress(`columns.${e.id}.config.width`,e.dataset.colWidth),this.row.classList.remove(Ei),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(Ei),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const t=this.columnPreset;let e=t.querySelector(`.${wi}`);const n=this.row.querySelector(".children").children,o=$c(n,(t=>Yo(t.clientWidth,this.rowWidth).toFixed(1))),i=o.join(","),r=o.join(" | ");return e||(e=qc.create({tag:"option",attrs:{className:wi,value:i,selected:!0},content:r}),t.append(e)),e.value=i,e.textContent=r,i}}const $d=t=>({className:"resize-x-handle",action:{pointerdown:t.onStart.bind(t)},content:[qc.icon("triangle-down"),qc.icon("triangle-up")]}),Id=()=>({className:"column-edit group-config"});class Md extends kd{constructor(t){super("column",{...Object.freeze({config:{width:"100%"},children:[],className:[bi]}),...t});const e=this.createChildWrap();this.dom=qc.create({tag:"li",className:[bi,"empty"],dataset:{hoverTag:o.get("column")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),Id(),$d(new Ld),e]}),this.processConfig(),Eu.columnResized=new window.CustomEvent("columnResized",{detail:{column:this.dom,instance:this}}),cc.create(e,{animation:150,fallbackClass:"field-moving",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:`.${yi}`,handle:".item-move"})}processConfig(){const t=Wc.get(this.data,"config.width");t&&this.setDomWidth(t)}refreshFieldPanels=()=>{for(const t of this.children)t.panels.nav.refresh()};setDomWidth=t=>{this.dom.dataset.colWidth=t,this.dom.style.width=t};setWidth=t=>(this.setDomWidth(t),this.set("config.width",t))}const Rd={actionButtons:{buttons:["clone","move","remove"],disabled:[]}};const Fd=new class extends _a{constructor(t){super("columns",t),this.config={all:Rd}}Component(t){return new Md(t)}};class Wd extends kd{constructor(t){super("row",{...Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[vi]}),...t});const e=this.createChildWrap();this.dom=qc.create({tag:"li",className:[vi,"empty"],dataset:{hoverTag:o.get("row"),editingHoverTag:o.get("editing.row")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),this.editWindow,e]}),cc.create(e,{animation:150,fallbackClass:"column-moving",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:`.${bi}`,handle:".item-move"})}get editWindow(){const t={tag:"input",id:`${this.id}-fieldset`,attrs:{type:"checkbox",checked:this.get("config.fieldset"),ariaLabel:o.get("row.settings.fieldsetWrap.aria")},action:{click:({target:{checked:t}})=>{this.set("config.fieldset",Boolean(t))}},config:{label:o.get("row.settings.fieldsetWrap")}},e={tag:"input",id:`${this.id}-inputGroup`,attrs:{type:"checkbox",checked:this.get("config.inputGroup"),ariaLabel:o.get("row.settings.inputGroup.aria")},action:{click:({target:{checked:t}})=>this.set("config.inputGroup",t)},config:{label:o.get("row.makeInputGroup"),description:o.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:""}},i=qc.formGroup([t,n]),r={tag:"label",content:o.get("defineColumnWidths"),className:"col-sm-4 form-control-label"};this.columnPresetControl=qc.create(this.columnPresetControlConfig);const s={className:"col-sm-8",content:this.columnPresetControl,action:{onRender:()=>{this.updateColumnPreset()}}},a=[e,"hr",i,"hr",qc.formGroup([r,s],"row")];return qc.create({className:`${this.name}-edit group-config`,action:{onRender:t=>{const e=a.map((t=>qc.create(t)));t.append(...e)}}})}onAdd(...t){super.onAdd(...t),this.autoColumnWidths()}onRemove(...t){super.onRemove(...t),this.autoColumnWidths()}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(br);const t=n.dom,o=Go(e);n.set("config.width",o),t.style.width=o,t.dataset.colWidth=o;const i=setTimeout((()=>{clearTimeout(i),n.refreshFieldPanels()}),Hi);document.dispatchEvent(Eu.columnResized)}this.updateColumnPreset()};updateColumnPreset=()=>{this.columnPresetControl.innerHTML="";const t=this.getColumnPresetOptions.map((({label:t,...e})=>qc.create({tag:"option",content:t,attrs:e})));this.columnPresetControl.append(...t)};setColumnWidths=t=>{"string"==typeof t&&(t=t.split(",")),this.children.forEach(((e,n)=>{e.setWidth(`${t[n]}%`),e.refreshFieldPanels()}))};get getColumnPresetOptions(){const t=this.children,e=zi.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:wi}),t.map((t=>{const e={...t};return e.selected=t.value===n,e}))}return[]}get columnPresetControlConfig(){return{tag:"select",attrs:{ariaLabel:o.get("defineColumnLayout"),className:Ci},action:{change:({target:t})=>{const{value:e}=t;this.setColumnWidths(e)}},options:this.getColumnPresetOptions}}}const Bd={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}};const zd=new class extends _a{constructor(t){super("rows",t),this.config={all:Bd}}Component(t){return new Wd(t)}};class Ud extends kd{constructor(t){super("stage",{conditions:[gr()],children:[],...t}),this.updateEditPanels(),this.debouncedUpdateEditPanels=Ko(this.updateEditPanels),o.get("Untitled Form"),o.get("Untitled Form"),o.get("Form Title"),o.get("Form novalidate"),o.get("Tags");const e=this.createChildWrap();this.dom=qc.create({attrs:{className:[gi,"empty"],id:this.id},children:[this.getComponentTag(),this.getActionButtons(),this.editWindow,e]}),cc.create(e,{animation:150,fallbackClass:"row-moving",group:{name:"stage",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onAdd:this.onAdd.bind(this),onRemove:this.onRemove.bind(this),onStart:()=>{qd.active=this},onSort:this.onSort.bind(this),draggable:`.${vi}`,handle:".item-move"})}empty(t=!0){return new Promise((e=>{t?(this.dom.classList.add("removing-all-fields"),Pc.slideUp(this.dom,Vi,(()=>{e(super.empty(t)),this.dom.classList.remove("removing-all-fields"),Pc.slideDown(this.dom,Vi)}))):e(super.empty())}))}onAdd(...t){const e=super.onAdd(...t);"column"===e?.name&&e.parent.autoColumnWidths()}}const qd=new class extends _a{constructor(t){super("stages",t),this.config={all:{actionButtons:{buttons:["edit"],disabled:[]},panels:{disabled:[],order:["attrs","options","conditions"]}}}}Component(t){return new Ud(t)}},Vd={js:new Set,css:new Set},Hd=(t,e,n=ti)=>new Promise((o=>fetch(t).then((t=>{if(!t.ok)return o(n(t));o(e?e(t):t)})).catch((t=>n(t))))),Xd=(t,e)=>{t.removeEventListener("load",Xd),e(t.src)},Yd=(t,e)=>{t.removeEventListener("load",Yd),e(t.src)},Gd=t=>new Promise(((e,n)=>{if(Vd.js.has(t))return e(t);Vd.js.add(t);const o=qc.create({tag:"script",attrs:{type:"text/javascript",async:!0,src:t},action:{load:()=>Yd(o,e),error:()=>n(new Error(`${t} failed to load.`))}});document.head.appendChild(o)})),Zd=t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>new Promise(((e,n)=>{if(Vd.css.has(t))return e(t);Vd.css.add(t);const o=qc.create({tag:"link",attrs:{rel:"stylesheet",href:t},action:{load:()=>Xd(o,e),error:()=>n(new Error(`${(void 0).src} failed to load.`))}});document.head.appendChild(o)}))));return Promise.all(e)},Jd=async(t=ui)=>{if(document.getElementById(ai))return;const e=async t=>(t=>{let e=document.getElementById(ai);return e||(e=qc.create({id:ai,children:t,attrs:{hidden:!0,style:"display: none;"}}),document.body.insertBefore(e,document.body.childNodes[0])),e})(await t.text());return Hd(t,e,(()=>Hd(hi,e)))},Kd={js:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>Gd(t)));return Promise.all(e)},css:t=>{const e=(t=Array.isArray(t)?t:[t]).map((t=>Zd(t)));return Promise.all(e)}},Qd=t=>{const e=Object.entries(t).map((([t,e])=>Kd[t](e)));return Promise.all(e)},tu=()=>{const t=document.getElementById(ai);return"hidden"===window.getComputedStyle(t).visibility};class eu{controlCache=new Set;constructor({events:t={},dependencies:e={},controlAction:n,...o}){this.events=t,this.controlData=o,this.controlAction=n,this.dependencies=e,this.id=o.id||Vo()}get controlId(){return this.controlData.meta?.id||this.controlData.config?.controlId}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:qc.icon(t.icon)},{tag:"span",className:"control-label",content:n}],action:{focus:({target:t})=>{const e=t.closest(`.${mi}`);return e&&iu.panels.nav.refresh(Dc(e))},click:({target:t})=>{const e=t.closest(".field-control")?.id;e&&iu.addElement(e)}}};return qc.create({tag:"li",id:this.id,className:["field-control",`${t.group}-control`,`${t.id}-control`],content:o,meta:t,action:this.controlAction})}promise(){return Qd(this.dependencies)}i18n(t,e){const n=o.locale,i=this.definition?.i18n,r=i?.[n]||{};return(r[t]?.()??r[t])||o.get(t,e)}}const nu=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"}});let ou=class{constructor(){this.data=new Map,this.buttonActions={focus:({target:t})=>{const e=t.closest(`.${mi}`);return e&&this.panels.nav.refresh(Dc(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((t=>{const e="function"==typeof t?new t:new eu(t);return this.add(e),this.controls.push(e.dom),e.promise()}))}groupLabel=t=>o.get(t)||t||"";groupElements(){let t=this.options.groups.slice(),e=this.controls.slice(),n=[];const o=[];return t=kc(t,this.groupOrder,"id"),t=t.filter((t=>zo(t.id,this.options.disable.groups))),n=t.map((t=>{const n={tag:"ul",attrs:{className:[mi,fi],id:`${t.id}-${mi}`},config:{label:this.groupLabel(t.label)}};if(this.options.elementOrder[t.id]){const e=this.options.elementOrder[t.id],n=qo(e.concat(t.elementOrder));t.elementOrder=n}return e=kc(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=[zo(i,this.options.disable.elements),n.meta.group===t.id,!o.includes(i)].every((t=>!0===t)),r&&o.push(i),r})),n})),n}add(t=Object.create(null)){const e=Xo(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 Xo(this.data.get(t))}formActions(){if(!0===this.options.disable.formActions)return null;const t={...qc.btnTemplate({content:[qc.icon("bin"),o.get("clear")],title:o.get("clearAll")}),className:["clear-form"],action:{click:t=>{zd.size?(Eu.confirmClearAll=new window.CustomEvent("confirmClearAll",{detail:{confirmationMessage:o.get("confirmClearAll"),clearAllAction:()=>{qd.clearAll().then((()=>{const e={src:t.target};Eu.formeoCleared(e)}))},btnCoords:qc.coords(t.target)}}),document.dispatchEvent(Eu.confirmClearAll)):window.alert(o.get("cannotClearFields"))}}},e={...qc.btnTemplate({content:[qc.icon("floppy-disk"),o.get("save")],title:o.get("save")}),className:["save-form"],action:{click:async({target:t})=>{const{default:e}=await Promise.resolve().then((()=>bu)),{formData:n}=e,o={action:()=>{},coords:qc.coords(t),message:"",button:t};return _u.click.btn(o),_u.save.form(n)}}};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:i}=this.options.panels;this.panels=new Pd({panels:e,type:"controls",displayType:i});const r=["control-groups","formeo-panels-wrap",`panel-count-${e.length}`],s=qc.create({className:r,content:[this.panels.panelNav,this.panels.panelsWrap]}),a=["formeo-controls"];t&&a.push("formeo-sticky");const l=qc.create({className:a,content:[s,n]}),c=l.getElementsByClassName("control-group");this.dom=l,this.groups=c;const[d]=c;this.currentGroup=d,this.actions={filter:t=>{const e=""!==t,n=this.controls;let i=s.querySelector(".filtered-term");if(qc.toggleElementsByStr(n,t),e){const e=o.get("controls.filteringTerm",t);l.classList.add("filtered"),i?i.textContent=e:(i=qc.create({tag:"h5",className:"filtered-term",content:e}),s.insertBefore(i,s.firstChild))}else i&&(l.classList.remove("filtered"),i.remove())},addElement:this.addElement,addGroup:t=>{}};for(let o=c.length-1;o>=0;o--){const t=`formeo-controls-${c[o]}`;this.options.sortable||window.localStorage.removeItem(t),cc.create(c[o],{animation:150,forceFallback:!0,fallbackClass:"control-moving",fallbackOnBody:!0,group:{name:"controls",pull:"clone",put:!1},onStart:async({item:t})=>{const{controlData:e}=this.get(t.id);if(this.options.ghostPreview){const{default:n}=await Promise.resolve().then((()=>cu));t.innerHTML="",t.appendChild(new n(e).preview)}},onEnd:({from:t,item:e,clone:n})=>{t.contains(n)&&t.replaceChild(e,n)},sort:this.options.sortable,store:{get:()=>{const e=window.localStorage.getItem(t);return e?e.split("|"):[]},set:e=>{const n=e.toArray();window.localStorage.setItem(t,n.join("|"))}}})}return l}layoutTypes={row:()=>qd.active.addChild(),column:()=>this.layoutTypes.row().addChild(),field:t=>this.layoutTypes.column().addChild(t)};addElement=t=>{const{meta:{group:e,id:n},...o}=us(this.get(t),"controlData");return hs(o,"config.controlId",n),"layout"===e?this.layoutTypes[n.replace("layout-","")]():this.layoutTypes.field(o)};applyOptions=async(t={})=>{const{container:e,elements:n,groupOrder:o,...i}=Ho(nu,t);this.container=e,this.groupOrder=qo(o.concat(["common","html","layout"])),this.options=i;const[r,s,a]=await Promise.all([Promise.resolve().then((()=>qu)),Promise.resolve().then((()=>Yu)),Promise.resolve().then((()=>Ku))]),l=[r.default,s.default,a.default].flat();return Promise.all(this.registerControls([...l,...n]))}};const iu=new ou,ru=Object.freeze(Object.defineProperty({__proto__:null,Controls:ou,default:iu},Symbol.toStringTag,{value:"Module"})),su=new Set(["checkbox","radio"]),au=new Set(["radio","checkbox","select-one","select-multiple"]);class lu extends kd{constructor(t=Object.create(null)){super("field",{...t}),this.debouncedUpdateEditPanels=Ko(this.updateEditPanels),this.debouncedUpdatePreview=Ko(this.updatePreview),this.label=qc.create(this.labelConfig),this.preview=this.fieldPreview(),this.controlId=this.get("config.controlId")||this.get("meta.id");const e=this.getActionButtons(),n=this.actionButtons.some((t=>"edit"===t.meta?.id));this.updateEditPanels();const i=qc.create({tag:"li",attrs:{className:yi},id:this.id,children:[this.label,this.getComponentTag(),e,n&&this.editWindow,this.preview].filter(Boolean),panelNav:this.panelNav,dataset:{hoverTag:o.get("field")}});this.dom=i,this.isEditing=!1}get labelConfig(){if(!!this.get("config.hideLabel"))return null;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}})=>{super.set("config.label",n?e:t)}}},e&&qc.requiredMark()]}}setData=(t,e)=>super.set(t,e);set(t,e){const n=this.setData(t,e);return this.debouncedUpdatePreview(),n}updateLabel(){if(!this.label)return null;const t=qc.create(this.labelConfig);this.label.replaceWith(t),this.label=t}updatePreview=()=>{this.updateLabel();const t=this.fieldPreview();this.preview.replaceWith(t),this.preview=t};get defaultPreviewActions(){return{change:t=>{const{target:e}=t,{type:n}=e;if(au.has(n)){const t=this.preview.querySelectorAll(":checked"),e=this.get("options"),n=void 0!==e?.[0]?.selected?"selected":"checked",o=e.reduce(((t,e)=>(t[e.value]=e,t[e.value][n]=!1,t)),{});for(const i of t)o[i.value][n]=i.value===o[i.value].value;return super.set("options",Object.values(o)),this.debouncedUpdateEditPanels()}},click:t=>{"true"===t.target.contentEditable&&t.preventDefault()},input:({target:t})=>{if(["input","meter","progress","button"].includes(t.tagName.toLowerCase()))return super.set("attrs.value",t.value),this.debouncedUpdateEditPanels();if(t.contentEditable&&!t.type?.startsWith("select-")){const e=t.parentElement.classList;if(e.contains("f-checkbox")||e.contains("f-radio")){const e=t.parentElement,n=Dc(e);return this.setData(`options[${n}].label`,t.innerHTML),this.debouncedUpdateEditPanels()}this.setData("content",t.innerHTML||t.value)}}}}fieldPreview(){const{action:t={},...e}=Xo(this.data);e.id=`prev-${this.id}`,e.action=Object.entries(t).reduce(((t,[e,n])=>(t[e]=n.bind(this),t)),{}),this.data?.config.editableContent&&(e.attrs={...e.attrs,contenteditable:!0});const n={attrs:{className:"field-preview",style:this.isEditing&&"display: none;"},content:qc.create(e,!0),action:this.defaultPreviewActions};return qc.create(n,!0)}get isCheckable(){return su.has(this.get("config.controlId"))}}const cu=Object.freeze(Object.defineProperty({__proto__:null,default:lu},Symbol.toStringTag,{value:"Module"}));const du=new class extends _a{constructor(t){super("fields",t),this.config={all:{actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}}}}Component(t){return new lu(t)}get=t=>{let e=t&&us(this.data,t);if(!e){const n=iu.get(t);n&&(e=this.add(null,n.controlData))}return e};getData=()=>Object.entries(this.data).reduce(((t,[e,n])=>{const{conditions:o,...i}=n?.getData()||n;if(o?.length){let t=!0;if(1===o.length){const[e]=o;t=Boolean(e.if[0].source)}t&&(i.conditions=o)}return t[e]=i,t}),{});load=(t=Object.create(null))=>{const e=ei(t);this.empty();for(const[n,o]of Object.entries(e)){const{meta:t,...e}=o;t?.id&&hs(e,"config.controlId",t?.id),this.add(n,e)}return this.data}},uu=qd,hu=zd,pu=Fd,fu=du,mu=iu;class gu extends Oa{constructor(){super("components"),this.disableEvents=!0,this.stages=uu,this.rows=hu,this.columns=pu,this.fields=fu,this.controls=mu}load=(t,e)=>{this.empty();const n=((t,e=!1)=>t?Xo(ei(t)):e&&Zo.get(Ui)||wr())(t,e.sessionStorage);this.opts=e,this.set("id",n.id),this.add("stages",uu.load(n.stages)),this.add("rows",hu.load(n.rows)),this.add("columns",pu.load(n.columns)),this.add("fields",fu.load(n.fields));for(const o of Object.values(this.get("stages")))o.loadChildren();return this.data};flatList(){const t={};for(const e of Object.keys(this.data.stages))oi(this.data,e,"stages",t);return t}getChildData=({type:t,id:e})=>{const n=this.get(t,e);if(n)return n.getData()};get json(){return window.JSON.stringify({$schema:`https://cdn.jsdelivr.net/npm/formeo@${ri}/dist/formData_schema.json`,...this.formData})}get formData(){return{id:this.get("id"),stages:qd.getData(),rows:zd.getData(),columns:Fd.getData(),fields:du.getData()}}set config(t){const{stages:e,rows:n,columns:o,fields:i}=t;uu.config=e,hu.config=n,pu.config=o,fu.config=i}getIndex(t){return this[t]||this[Ni.get(t)]}setAddress(t,e){if(!Jo(t))return;const[n,o,...i]=Array.isArray(t)?t:Tr(t),r=this.getIndex(n).get(o);return r?.set(i,e),r}getAddress(t){if(!Jo(t))return;const[e,n,...o]=Array.isArray(t)?t:Tr(t),i=this.getIndex(e).get(n);return!o.length||i?o.length?i.get(o):i:void 0}}const vu=new gu,bu=Object.freeze(Object.defineProperty({__proto__:null,Columns:pu,Components:gu,Controls:mu,Fields:fu,Rows:hu,Stages:uu,default:vu},Symbol.toStringTag,{value:"Module"})),yu="no-transition",wu={debug:!1,bubbles:!0,formeoLoaded:t=>{},onAdd:()=>{},onChange:t=>Eu.opts?.debug&&void 0,onUpdate:t=>Eu.opts?.debug&&void 0,onUpdateStage:t=>Eu.opts?.debug&&void 0,onUpdateRow:t=>Eu.opts?.debug&&void 0,onUpdateColumn:t=>Eu.opts?.debug&&void 0,onUpdateField:t=>Eu.opts?.debug&&void 0,onAddRow:t=>Eu.opts?.debug&&void 0,onAddColumn:t=>Eu.opts?.debug&&void 0,onAddField:t=>Eu.opts?.debug&&void 0,onRemoveRow:t=>Eu.opts?.debug&&void 0,onRemoveColumn:t=>Eu.opts?.debug&&void 0,onRemoveField:t=>Eu.opts?.debug&&void 0,onRender:t=>Eu.opts?.debug&&void 0,onSave:t=>{},confirmClearAll:t=>{window.confirm(t.confirmationMessage)&&t.clearAllAction(t)}},Cu=({src:t,...e},n=Gi)=>{const o=new window.CustomEvent(n,{detail:e,bubbles:Eu.opts?.debug||Eu.opts?.bubbles});if(o.data=(t||document).dispatchEvent(o),n===Gi){const n=new window.CustomEvent("formeoChanged",{detail:e,bubbles:Eu.opts?.debug||Eu.opts?.bubbles});(t||document).dispatchEvent(n)}return o},Eu={init:function(t){return this.opts={...wu,...t},this},formeoSaved:t=>Cu(t,Yi),formeoUpdated:(t,e)=>Cu(t,e||Gi),formeoCleared:t=>Cu(t,"formeoCleared"),formeoOnRender:t=>Cu(t,tr),formeoConditionUpdated:t=>Cu(t,"formeoConditionUpdated"),formeoAddedRow:t=>Cu(t,er),formeoAddedColumn:t=>Cu(t,nr),formeoAddedField:t=>Cu(t,or),formeoRemovedRow:t=>Cu(t,ir),formeoRemovedColumn:t=>Cu(t,rr),formeoRemovedField:t=>Cu(t,sr)},Su=function(t,e=Xi){let n=0;return function(...o){const i=Date.now();i-n>=e&&(n=i,t.apply(this,o))}}((()=>{const t={timeStamp:window.performance.now(),type:Gi,detail:vu.formData};Eu.opts.onUpdate(t),Eu.opts.onChange!==Eu.opts.onUpdate&&Eu.opts.onChange(t)}),Hi);let xu;document.addEventListener(Gi,Su),document.addEventListener(Zi,(t=>{const{timeStamp:e,type:n,detail:o}=t,i={timeStamp:e,type:n,detail:o};Eu.opts.onUpdate(i),Eu.opts.onUpdateStage(i)})),document.addEventListener(Ji,(t=>{const{timeStamp:e,type:n,detail:o}=t,i={timeStamp:e,type:n,detail:o};Eu.opts.onUpdate(i),Eu.opts.onUpdateRow(i)})),document.addEventListener(Ki,(t=>{const{timeStamp:e,type:n,detail:o}=t,i={timeStamp:e,type:n,detail:o};Eu.opts.onUpdate(i),Eu.opts.onUpdateColumn(i)})),document.addEventListener(Qi,(t=>{const{timeStamp:e,type:n,detail:o}=t,i={timeStamp:e,type:n,detail:o};Eu.opts.onUpdate(i),Eu.opts.onUpdateField(i)})),document.addEventListener(er,(t=>{const{timeStamp:e,type:n,detail:o}=t,i={timeStamp:e,type:n,detail:o};Eu.opts.onAddRow(i)})),document.addEventListener(nr,(t=>{const{timeStamp:e,type:n,detail:o}=t,i={timeStamp:e,type:n,detail:o};Eu.opts.onAddColumn(i)})),document.addEventListener(or,(t=>{const{timeStamp:e,type:n,detail:o}=t,i={timeStamp:e,type:n,detail:o};Eu.opts.onAddField(i)})),document.addEventListener(ir,(t=>{const{timeStamp:e,type:n,detail:o}=t,i={timeStamp:e,type:n,detail:o};Eu.opts.onRemoveRow(i)})),document.addEventListener(rr,(t=>{const{timeStamp:e,type:n,detail:o}=t,i={timeStamp:e,type:n,detail:o};Eu.opts.onRemoveColumn(i)})),document.addEventListener(sr,(t=>{const{timeStamp:e,type:n,detail:o}=t,i={timeStamp:e,type:n,detail:o};Eu.opts.onRemoveField(i)})),document.addEventListener(tr,(t=>{const{timeStamp:e,type:n,detail:o}=t;Eu.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},Eu.opts.confirmClearAll(t)})),document.addEventListener(Yi,(({timeStamp:t,type:e,detail:{formData:n}})=>{const o={timeStamp:t,type:e,formData:n};Eu.opts.onSave(o)})),document.addEventListener("formeoLoaded",(t=>{Eu.opts.formeoLoaded(t.detail.formeo)})),window.addEventListener("resize",(function(){xu=xu||window.requestAnimationFrame((()=>{xu=!1;for(const t of Object.values(pu.data))t.dom.classList.add(yu),mu.dom.classList.add(yu),mu.panels.nav.refresh(),t.refreshFieldPanels()}))}));const Ou={add:{attr:t=>{const e=window.prompt(t.message.attr);if(e&&t.isDisabled(e))return window.alert(o.get("attributeNotPermitted",e||"")),_u.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)}},remove:{attrs:t=>{t.removeAction()},options:t=>{t.removeAction()},conditions:t=>{t.removeAction()}},click:{btn:t=>{t.action()}},save:{form:Qo}},_u={init:function(t){const e=Object.keys(Ou);return this.opts=e.reduce(((e,n)=>(e[n]={...Ou[n],...t[n]},e)),t),this},add:{attrs:t=>_u.opts.add.attr(t),options:t=>_u.opts.add.option(t),conditions:t=>(t.template=t.template||gr(),_u.opts.add.condition(t))},remove:{attrs:t=>_u.opts.remove.attrs(t),options:t=>_u.opts.remove.options(t),conditions:t=>_u.opts.remove.conditions(t)},click:{btn:t=>_u.opts.click.btn(t)},save:{form:t=>(_u.opts.sessionStorage&&Zo.set(Ui,t),Eu.formeoSaved({formData:t}),_u.opts.save.form(t))}};o.addLanguage("en-US",void 0);const Au={get editor(){return{stickyControls:!1,allowEdit:!0,dataType:"json",debug:!1,sessionStorage:!1,editorContainer:null,svgSprite:ui,style:pi,iconFont:null,config:{},events:{},actions:{},controls:{},polyfills:Fc(),i18n:{location:"https://draggable.github.io/formeo/assets/lang/"},onLoad:()=>{}}}};let Tu=class{constructor({formData:t,...e},n){const o=Ho(Au.editor,e),{actions:i,events:r,debug:s,config:a,editorContainer:l,...d}=o;l&&(this.editorContainer="string"==typeof l?document.querySelector(l):l),this.opts=d,qc.setOptions=d,vu.config=a,this.userFormData=n||t,this.Components=vu,this.dom=qc,Eu.init({debug:s,...r}),_u.init({debug:s,sessionStorage:d.sessionStorage,...i}),this.tooltip=new c,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",this.loadResources.bind(this)):this.loadResources()}get formData(){return this.Components.formData}set formData(t={}){this.userFormData=ni(t),this.load(this.userFormData,this.opts)}loadData(t={}){this.formData=t}get json(){return this.Components.json}clear(){this.userFormData=wr(),this.Components.load(this.userFormData,this.opts),this.render()}async loadResources(){document.removeEventListener("DOMContentLoaded",this.loadResources);const t=[];this.opts.polyfills&&(t=>{const e=Array.isArray(t)?li.filter((({name:e})=>-1!==t.indexOf(e))):li;Promise.all(e.map((({src:t})=>Gd(t))))})(this.opts.polyfills),await Jd(this.opts.svgSprite),t.push((async t=>{if(!tu()&&(await Zd(t),!tu()))return await Zd("https://draggable.github.io/formeo/assets/css/formeo.min.css")})(this.opts.style)),t.push(o.init({...this.opts.i18n,locale:window.sessionStorage?.getItem(qi)}));const e=await Promise.all(t);return this.opts.allowEdit&&this.init(),e}init(){return iu.init(this.opts.controls,this.opts.stickyControls).then((t=>{this.controls=t,this.load(this.userFormData,this.opts),this.formId=vu.get("id"),this.i18n={setLang:t=>{window.sessionStorage?.setItem(qi,t);o.setCurrent(t).then((()=>{this.init()}),console.error)}},this.opts.onLoad?.(this)}))}load(t=this.userFormData,e=this.opts){this.Components.load(t,e),this.render()}render(){if(!this.controls)return window.requestAnimationFrame((()=>this.render()));if(this.stages=Object.values(vu.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))]};o.current.dir&&(t.attrs.dir=o.current.dir,qc.dir=o.current.dir),this.editor=qc.create(t);(this.controls.container||this.editor).appendChild(this.controls.dom),this.editorContainer&&(qc.empty(this.editorContainer),this.editorContainer.appendChild(this.editor)),Eu.formeoLoaded=new window.CustomEvent("formeoLoaded",{detail:{formeo:this}}),document.dispatchEvent(Eu.formeoLoaded)}};const Nu="f-",Pu=t=>"string"==typeof t?document.querySelector(t):t,ju=t=>{const e=t.match(vr);return e?.[0]||t``},Du=t=>{if(!t)return!1;if(t.hasAttribute("hidden")||t.parentElement.hasAttribute("hidden"))return!1;const e=window.getComputedStyle(t);return!("none"===e.display||"hidden"===e.visibility||"0"===e.opacity)},ku={isChecked:t=>t.checked,isNotChecked:t=>!t.checked,value:t=>t.value,isVisible:t=>Du(t),isNotVisible:t=>!Du(t)},Lu={equals:Sa,notEquals:(t,e)=>!Sa(t,e),contains:(t,e)=>t.includes(e),notContains:(t,e)=>!t.includes(e)},$u=Object.entries(ar).reduce(((t,[e,n])=>(t[n]=Lu[e],t[e]=Lu[e],t)),{}),Iu={equals:(t,{targetProperty:e,value:n})=>{t[`_${e}`]=t[e],t[e]=n}},Mu=Object.entries(lr).reduce(((t,[e,n])=>(t[n]=Iu[e],t[e]=Iu[e],t)),{}),Ru={isChecked:t=>{t.checked=!0},isNotChecked:t=>{t.checked=!1},value:(t,{assignment:e,...n})=>{const o=Mu[e]?.(t,n),i=new Event("input",{bubbles:!0});return t.dispatchEvent(i),o},isNotVisible:t=>{void 0===t?._required&&(t._required=t.required),t.parentElement.setAttribute("hidden",!0),t.required=!1},isVisible:t=>{t.parentElement.removeAttribute("hidden"),t.required=t._required}};let Fu=class{constructor(t,e){const{renderContainer:n,elements:o,formData:i}=(({editorContainer:t,renderContainer:e,formData:n,...o})=>({elements:{},...o,renderContainer:Pu(e),editorContainer:Pu(t),formData:ni(n)}))(t);this.container=n,this.form=ni(e||i),this.dom=qc,this.components=Object.create(null),this.elements=o}get formData(){return this.form}set formData(t){this.form=ni(t)}get userData(){const t=new FormData(this.renderedForm),e={};for(const[n,o]of t.entries())e[n]?Array.isArray(e[n])?e[n].push(o):e[n]=[e[n],o]:e[n]=o;return e}set userData(t={}){const e=this.container.querySelector("form");for(const n of Object.keys(t)){const o=e.elements[n];if(o.length&&"checkbox"===o[0].type){const e=Array.isArray(t[n])?t[n]:[t[n]];for(const t of o)t.checked=e.includes(t.value)}else if(o.length&&"radio"===o[0].type)for(const e of o)e.checked=e.value===t[n];else o.type&&(o.value=t[n])}}render(t=this.form){const e=this.getRenderedForm(t),n=this.container.querySelector(".formeo-render");n?n.replaceWith(e):this.container.appendChild(e)}getRenderedForm(t=this.form){this.form=ni(t);const e=document.getElementsByClassName("formeo-render").length,n={tag:"form",id:this.form.id,className:`formeo-render formeo formeo-rendered-${e}`,children:this.processedData};return this.renderedForm=qc.render(n),this.applyConditions(),this.renderedForm}get html(){return(this.renderedForm||this.getRenderedForm()).outerHTML}orderChildren=(t,e)=>e.reduce(((e,n)=>(e.push(this.form[t][n]),e)),[]);prefixId=t=>Nu+t;processColumn=({id:t,...e})=>({...e,id:this.prefixId(t),children:this.processFields(e.children),style:`width: ${e.config.width||"100%"}`});processRows=t=>this.orderChildren("rows",this.form.stages[t].children).reduce(((t,e)=>(e&&t.push(this.processRow(e)),t)),[]);cacheComponent=t=>(this.components[ju(t.id)]=t,t);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(`${Nu}input-group-wrap`),{tag:n.fieldset?"fieldset":"div",className:i,children:s}};cloneComponentData=t=>{const{children:e=[],id:n,...o}=this.components[t];return{...o,id:Vo(n),children:e?.length&&e.map((({id:t})=>this.cloneComponentData(ju(t))))}};addButton=t=>({tag:"button",attrs:{className:"add-input-group btn pull-right",type:"button"},children:"Add +",action:{click:e=>{const n=e.target.parentElement,o=qc.create(this.cloneComponentData(t));n.insertBefore(o,n.lastChild);const i=qc.create(qc.btnTemplate({className:"remove-input-group",children:qc.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()}}));o.appendChild(i)}}});processColumns=t=>this.orderChildren("columns",this.form.rows[t].children).map((t=>this.cacheComponent(this.processColumn(t))));processFields=t=>this.orderChildren("fields",t).map((({id:t,...e})=>{const n=e.config?.controlId||e.meta?.id,{action:o={},dependencies:i={}}=this.elements[n]||{};i&&Qd(i);const r=Ho({action:o},e);return this.cacheComponent({...r,id:this.prefixId(t)})}));get processedData(){return Object.values(this.form.stages).map((t=>(t.children=this.processRows(t.id),t.className=gi,this.components[ju(t.id)]=t,t)))}handleComponentCondition=(t,e,n)=>{if(t.length){for(const o of t)this.handleComponentCondition(o,e,n);return}const o=Wu(t);o&&t.addEventListener(o,(t=>{if(this.evaluateCondition(e,t))for(const e of n)this.execResult(e,t)}),!1);const i={target:t};if(this.evaluateCondition(e,i))for(const r of n)this.execResult(r,i)};applyConditions=()=>{for(const{conditions:t}of Object.values(this.components))if(t)for(const e of t){const{if:t,then:n}=e;for(const e of t){const{source:t,target:o}=e;if(Jo(t)){const{component:o,options:i}=this.getComponent(t),r=i||o;this.handleComponentCondition(r,e,n)}if(Jo(o)){const{component:t,options:i}=this.getComponent(o),r=i||t;this.handleComponentCondition(r,e,n)}}}};evaluateCondition=({source:t,sourceProperty:e,targetProperty:n,comparison:o,target:i})=>{const r=this.getComponentProperty(t,e);if("boolean"==typeof r)return r;const s=String(Jo(i)?this.getComponentProperty(i,n):i);return $u[o]?.(r,s)};execResult=({target:t,targetProperty:e,assignment:n,value:o})=>{if(Jo(t)){const{component:i,option:r}=this.getComponent(t),s=r||i;Ru[e]?.(s,{targetProperty:e,assignment:n,value:o})}};getComponentProperty=(t,e)=>{const{component:n,option:o}=this.getComponent(t),i=o||n;return ku[e]?.(i)||i[e]};getComponent=t=>{const e={component:null};if(!Jo(t))return null;const[,n,o,i]=Tr(t),r=this.renderedForm.querySelector(`#${Nu}${n}`);if(!r)return e;if(e.component=r,o){const t=r.querySelectorAll("input"),n=t[i];return e.options=t,e.option=n,e}return e};getComponents=t=>{const e=[],n=t.slice(t.indexOf(".")+1);return e.push(...this.renderedForm.querySelectorAll(`[name=f-${n}]`)),e}};const Wu=t=>{const[e]=[["input",t=>["textarea","text"].includes(t.type)],["change",t=>["select"].includes(t.tagName.toLowerCase())||["checkbox","radio"].includes(t.type)]].find((e=>e[1](t)))||[!1];return e};void 0!==window&&(window.FormeoEditor=Tu,window.FormeoRenderer=Fu);const Bu=Tu,zu=Fu,Uu=[{config:{label:"row"},meta:{group:"layout",icon:"rows",id:"layout-row"}},{config:{label:"column"},meta:{group:"layout",icon:"columns",id:"layout-column"}}],qu=Object.freeze(Object.defineProperty({__proto__:null,default:Uu},Symbol.toStringTag,{value:"Module"})),Vu=["button","submit","reset"].map((t=>({label:t,value:t})));Vu[0].selected=!0;const Hu=({type:t,isMultiple:e=!1,count:n=3})=>Array.from({length:n},((t,e)=>e+1)).map((n=>{const i="checkbox"===t||e?"checked":"selected";return{label:o.get("labelCount",{label:_r(t),count:n}),value:`${t}-${n}`,[i]:!n}}));const Xu=[class extends eu{constructor(t={}){const e={tag:"button",attrs:{className:[{label:"grouped",value:"f-btn-group"},{label:"ungrouped",value:"f-field-group"}]},config:{label:o.get("controls.form.button"),hideLabel:!0},meta:{group:"common",icon:"button",id:"button"},options:[{label:o.get("button"),type:Vu,className:[{label:"default",value:"",selected:!0},{label:"primary",value:"primary"},{label:"danger",value:"error"},{label:"success",value:"success"},{label:"warning",value:"warning"}]}]};super(Ho(e,t))}},class extends eu{constructor(){super({tag:"input",attrs:{type:"date",required:!1,className:""},config:{label:o.get("controls.form.input.date")},meta:{group:"common",icon:"calendar",id:"date-input"}})}},class extends eu{constructor(){super({tag:"input",attrs:{type:"hidden",value:""},config:{label:o.get("hidden"),hideLabel:!0},meta:{group:"common",icon:"hidden",id:"hidden"}})}},class extends eu{constructor(){super({tag:"input",attrs:{type:"number",required:!1,className:""},config:{label:o.get("number")},meta:{group:"common",icon:"hash",id:"number"}})}},class extends eu{constructor(){super({tag:"textarea",config:{label:o.get("controls.form.textarea")},meta:{group:"common",icon:"textarea",id:"textarea"},attrs:{required:!1}})}},class extends eu{constructor(){super({tag:"input",attrs:{required:!1,type:"text",className:""},config:{label:o.get("controls.form.input.text")},meta:{group:"common",icon:"text-input",id:"text-input"}})}},class extends eu{constructor(){super({tag:"input",attrs:{type:"file",required:!1},config:{label:o.get("fileUpload")},meta:{group:"common",icon:"upload",id:"upload"}})}},class extends eu{constructor(t={}){const e={tag:"select",config:{label:o.get("controls.form.select")},attrs:{required:!1,className:"",multiple:!1},meta:{group:"common",icon:"select",id:"select"},options:Hu({type:"option",isMultiple:t.attrs?.multiple})};super(Ho(e,t))}},class extends eu{constructor(){super({tag:"input",attrs:{type:"checkbox",required:!1},config:{label:o.get("controls.form.checkbox-group"),disabledAttrs:["type"]},meta:{group:"common",icon:"checkbox",id:"checkbox"},options:Hu({type:"checkbox",count:1})})}},class extends eu{constructor(){super({tag:"input",attrs:{type:"radio",required:!1},config:{label:o.get("controls.form.radio-group"),disabled:["attrs.type"]},meta:{group:"common",icon:"radio-group",id:"radio"},options:Hu({type:"radio"})})}}],Yu=Object.freeze(Object.defineProperty({__proto__:null,default:Xu},Symbol.toStringTag,{value:"Module"})),Gu=Array.from(Array(5).keys()).slice(1).map((t=>`h${t}`)),Zu="controls.html.header";const Ju=[class extends eu{constructor(){super({tag:Gu[0],attrs:{tag:Gu.map(((t,e)=>({label:t.toUpperCase(),value:t,selected:!e}))),className:""},config:{label:o.get(Zu),hideLabel:!0,editableContent:!0},meta:{group:"html",icon:"header",id:"html.header"},content:o.get(Zu),action:{}})}static get definition(){return{i18n:{"en-US":{header:"Custom English Header"}}}}get content(){return super.i18n(Zu)}},class extends eu{constructor(){super({tag:"p",attrs:{className:""},config:{label:o.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 eu{constructor(){super({tag:"hr",config:{label:o.get("controls.html.divider"),hideLabel:!0},meta:{group:"html",icon:"divider",id:"divider"}})}},class extends eu{constructor(t){super(Ho({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))}}],Ku=Object.freeze(Object.defineProperty({__proto__:null,default:Ju},Symbol.toStringTag,{value:"Module"}));t.FormeoEditor=Bu,t.FormeoRenderer=zu,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
|