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.
@@ -1,13 +1,13 @@
1
1
 
2
2
  /**
3
3
  formeo - https://formeo.io
4
- Version: 4.1.3
4
+ Version: 4.1.4
5
5
  Author: Draggable https://draggable.io
6
6
  */
7
7
 
8
- (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const p of document.querySelectorAll('link[rel="modulepreload"]'))n(p);new MutationObserver(p=>{for(const d of p)if(d.type==="childList")for(const g of d.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&n(g)}).observe(document,{childList:!0,subtree:!0});function t(p){const d={};return p.integrity&&(d.integrity=p.integrity),p.referrerPolicy&&(d.referrerPolicy=p.referrerPolicy),p.crossOrigin==="use-credentials"?d.credentials="include":p.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function n(p){if(p.ep)return;p.ep=!0;const d=t(p);fetch(p.href,d)}})();async function nd(c){try{const e=await fetch(c);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const t=c.endsWith(".lang")?"text":"json";return await e[t]()}catch(e){throw console.error("There has been a problem with your fetch operation:",e),e}}const ra={extension:".lang",location:"assets/lang/",langs:["en-US"],locale:"en-US",override:{}};class Gt{constructor(e=ra){this.langs=Object.create(null),this.loaded=[],this.processConfig(e)}processConfig(e){const{location:t,...n}={...ra,...e},p=t.replace(/\/?$/,"/");this.config={location:p,...n};const{override:d,preloaded:g={}}=this.config,m=Object.entries(this.langs).concat(Object.entries(d||g));this.langs=m.reduce((l,[f,r])=>(l[f]=this.applyLanguage(f,r),l),{}),this.locale=this.config.locale||this.config.langs[0]}init(e){return this.processConfig({...this.config,...e}),this.setCurrent(this.locale)}addLanguage(e,t={}){t=typeof t=="string"?Gt.processFile(t):t,this.applyLanguage(e,t),this.config.langs.push("locale")}getValue(e,t=this.locale){var n;return((n=this.langs[t])==null?void 0:n[e])||this.getFallbackValue(e)}getFallbackValue(e){const t=Object.values(this.langs).find(n=>n[e]);return t?.[e]}makeSafe(e){const t={"{":"\\{","}":"\\}","|":"\\|"};return e=e.replace(/[{}|]/g,n=>t[n]),new RegExp(e,"g")}put(e,t){return this.current[e]=t,t}get(e,t){const n=this;let p=this.getValue(e);if(!p)return;const d=p.match(/\{[^}]+?\}/g);if(t&&d)if(typeof t=="object")for(const g of d){const m=g.substring(1,g.length-1);p=p.replace(n.makeSafe(g),t[m]||"")}else p=p.replace(/\{[^}]+?\}/g,t);return p}static processFile(e){return Gt.fromFile(e.replace(/\n\n/g,`
8
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const p of document.querySelectorAll('link[rel="modulepreload"]'))n(p);new MutationObserver(p=>{for(const d of p)if(d.type==="childList")for(const g of d.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&n(g)}).observe(document,{childList:!0,subtree:!0});function t(p){const d={};return p.integrity&&(d.integrity=p.integrity),p.referrerPolicy&&(d.referrerPolicy=p.referrerPolicy),p.crossOrigin==="use-credentials"?d.credentials="include":p.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function n(p){if(p.ep)return;p.ep=!0;const d=t(p);fetch(p.href,d)}})();async function hd(l){try{const e=await fetch(l);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);const t=l.endsWith(".lang")?"text":"json";return await e[t]()}catch(e){throw console.error("There has been a problem with your fetch operation:",e),e}}const ua={extension:".lang",location:"assets/lang/",langs:["en-US"],locale:"en-US",override:{}};class Gt{constructor(e=ua){this.langs=Object.create(null),this.loaded=[],this.processConfig(e)}processConfig(e){const{location:t,...n}={...ua,...e},p=t.replace(/\/?$/,"/");this.config={location:p,...n};const{override:d,preloaded:g={}}=this.config,m=Object.entries(this.langs).concat(Object.entries(d||g));this.langs=m.reduce((c,[f,r])=>(c[f]=this.applyLanguage(f,r),c),{}),this.locale=this.config.locale||this.config.langs[0]}init(e){return this.processConfig({...this.config,...e}),this.setCurrent(this.locale)}addLanguage(e,t={}){t=typeof t=="string"?Gt.processFile(t):t,this.applyLanguage(e,t),this.config.langs.push("locale")}getValue(e,t=this.locale){var n;return((n=this.langs[t])==null?void 0:n[e])||this.getFallbackValue(e)}getFallbackValue(e){const t=Object.values(this.langs).find(n=>n[e]);return t?.[e]}makeSafe(e){const t={"{":"\\{","}":"\\}","|":"\\|"};return e=e.replace(/[{}|]/g,n=>t[n]),new RegExp(e,"g")}put(e,t){return this.current[e]=t,t}get(e,t){const n=this;let p=this.getValue(e);if(!p)return;const d=p.match(/\{[^}]+?\}/g);if(t&&d)if(typeof t=="object")for(const g of d){const m=g.substring(1,g.length-1);p=p.replace(n.makeSafe(g),t[m]||"")}else p=p.replace(/\{[^}]+?\}/g,t);return p}static processFile(e){return Gt.fromFile(e.replace(/\n\n/g,`
9
9
  `))}static fromFile(e){const t=e.split(`
10
- `),n={};for(let p,d=0;d<t.length;d++)p=/^(.+?) *?= *?([^\n]+)/.exec(t[d]),p&&(n[p[1]]=p[2].replace(/(^\s+|\s+$)/g,""));return n}loadLang(e,t=!0){const n=this;return new Promise(function(p,d){if(n.loaded.indexOf(e)!==-1&&t)return n.applyLanguage(n.langs[e]),p(n.langs[e]);{const g=[n.config.location,e,n.config.extension].join("");return nd(g).then(m=>{const l=Gt.processFile(m);return n.applyLanguage(e,l),n.loaded.push(e),p(n.langs[e])}).catch(m=>{console.error(m);const l=n.applyLanguage(e);p(l)})}})}applyLanguage(e,t={}){const n=this.config.override[e]||{},p=this.langs[e]||{};return this.langs[e]={...p,...t,...n},this.langs[e]}get getLangs(){return this.config.langs}async setCurrent(e="en-US"){return await this.loadLang(e),this.locale=e,this.current=this.langs[e],this.current}}const Q=new Gt;(function(){try{if(typeof document<"u"){var c=document.createElement("style");c.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(c)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();var id=Object.defineProperty,rd=(c,e,t)=>e in c?id(c,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):c[e]=t,Ve=(c,e,t)=>rd(c,typeof e!="symbol"?e+"":e,t);const od="_3x4ZIcu-",sd="JIt36hCJ",Dt={tooltip:od,visible:sd},ad={triggerName:"tooltip"};class ku{constructor(e=ad){Ve(this,"triggerName"),Ve(this,"tooltip"),Ve(this,"activeTriggerType",null),Ve(this,"spacing",12),Ve(this,"handleClick",t=>{const n=this.triggerName,p=t.target.closest(`[${n}][${n}-type="click"]`);if(p)if(this.isVisible())this.hide();else{const d=p.getAttribute(`${n}`);this.show(p,d),this.activeTriggerType="click"}else this.hide()}),Ve(this,"handleMouseOver",t=>{const n=this.triggerName,p=t.target.closest(`[${n}]`);if(this.activeTriggerType!=="click"&&p?.getAttribute(`${n}-type`)!=="click"){const d=p?.getAttribute(`${n}`);d&&(this.show(p,d),this.activeTriggerType="hover")}}),Ve(this,"handleMouseOut",t=>{const n=this.triggerName,p=t.target.closest(`[${n}]`);this.activeTriggerType!=="click"&&p?.getAttribute(`${n}-type`)!=="click"&&this.hide()}),Ve(this,"handleResize",()=>{this.isVisible()&&this.hide()}),Ve(this,"handleScroll",()=>{this.isVisible()&&this.hide()}),this.triggerName=`data-${e.triggerName}`,this.tooltip=document.createElement("div"),this.tooltip.className=`d-tooltip ${Dt.tooltip}`,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(Dt.visible)}calculatePosition(e){const t=e.getBoundingClientRect(),n=this.tooltip.getBoundingClientRect(),p=[{name:"top",x:t.left+(t.width-n.width)/2,y:t.top-n.height-this.spacing},{name:"bottom",x:t.left+(t.width-n.width)/2,y:t.bottom+this.spacing},{name:"left",x:t.left-n.width-this.spacing,y:t.top+(t.height-n.height)/2},{name:"right",x:t.right+this.spacing,y:t.top+(t.height-n.height)/2},{name:"top-left",x:t.left,y:t.top-n.height-this.spacing},{name:"top-right",x:t.right-n.width,y:t.top-n.height-this.spacing},{name:"bottom-left",x:t.left,y:t.bottom+this.spacing},{name:"bottom-right",x:t.right-n.width,y:t.bottom+this.spacing}];return p.find(d=>this.fitsInViewport(d,n))||p[0]}fitsInViewport(e,t){return e.x>=0&&e.y>=0&&e.x+t.width<=window.innerWidth&&e.y+t.height<=window.innerHeight?[[e.x,e.y],[e.x+t.width,e.y],[e.x,e.y+t.height],[e.x+t.width,e.y+t.height],[e.x+t.width/2,e.y+t.height/2]].flatMap(([m,l])=>Array.from(document.elementsFromPoint(m,l))).filter(m=>{if(this.tooltip.contains(m)||m===this.tooltip||m.classList.contains(Dt.tooltip)||getComputedStyle(m).pointerEvents==="none")return!1}).length===0:!1}show(e,t){this.tooltip.innerHTML=t??"",this.tooltip.classList.add(Dt.visible);const n=this.calculatePosition(e);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(Dt.visible),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()}}window!==void 0&&(window.SmartTooltip=ku);const ld="formeo",cd="4.1.3",Iu={name:ld,version:cd};var sn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lt(c){return c&&c.__esModule&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c}var Jn,oa;function ud(){if(oa)return Jn;oa=1;function c(){this.__data__=[],this.size=0}return Jn=c,Jn}var ei,sa;function tn(){if(sa)return ei;sa=1;function c(e,t){return e===t||e!==e&&t!==t}return ei=c,ei}var ti,aa;function Dn(){if(aa)return ti;aa=1;var c=tn();function e(t,n){for(var p=t.length;p--;)if(c(t[p][0],n))return p;return-1}return ti=e,ti}var ni,la;function hd(){if(la)return ni;la=1;var c=Dn(),e=Array.prototype,t=e.splice;function n(p){var d=this.__data__,g=c(d,p);if(g<0)return!1;var m=d.length-1;return g==m?d.pop():t.call(d,g,1),--this.size,!0}return ni=n,ni}var ii,ca;function dd(){if(ca)return ii;ca=1;var c=Dn();function e(t){var n=this.__data__,p=c(n,t);return p<0?void 0:n[p][1]}return ii=e,ii}var ri,ua;function fd(){if(ua)return ri;ua=1;var c=Dn();function e(t){return c(this.__data__,t)>-1}return ri=e,ri}var oi,ha;function pd(){if(ha)return oi;ha=1;var c=Dn();function e(t,n){var p=this.__data__,d=c(p,t);return d<0?(++this.size,p.push([t,n])):p[d][1]=n,this}return oi=e,oi}var si,da;function Nn(){if(da)return si;da=1;var c=ud(),e=hd(),t=dd(),n=fd(),p=pd();function d(g){var m=-1,l=g==null?0:g.length;for(this.clear();++m<l;){var f=g[m];this.set(f[0],f[1])}}return d.prototype.clear=c,d.prototype.delete=e,d.prototype.get=t,d.prototype.has=n,d.prototype.set=p,si=d,si}var ai,fa;function gd(){if(fa)return ai;fa=1;var c=Nn();function e(){this.__data__=new c,this.size=0}return ai=e,ai}var li,pa;function md(){if(pa)return li;pa=1;function c(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}return li=c,li}var ci,ga;function vd(){if(ga)return ci;ga=1;function c(e){return this.__data__.get(e)}return ci=c,ci}var ui,ma;function yd(){if(ma)return ui;ma=1;function c(e){return this.__data__.has(e)}return ui=c,ui}var hi,va;function Ou(){if(va)return hi;va=1;var c=typeof sn=="object"&&sn&&sn.Object===Object&&sn;return hi=c,hi}var di,ya;function Ge(){if(ya)return di;ya=1;var c=Ou(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=c||e||Function("return this")();return di=t,di}var fi,ba;function Fn(){if(ba)return fi;ba=1;var c=Ge(),e=c.Symbol;return fi=e,fi}var pi,wa;function bd(){if(wa)return pi;wa=1;var c=Fn(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,p=c?c.toStringTag:void 0;function d(g){var m=t.call(g,p),l=g[p];try{g[p]=void 0;var f=!0}catch{}var r=n.call(g);return f&&(m?g[p]=l:delete g[p]),r}return pi=d,pi}var gi,Ca;function wd(){if(Ca)return gi;Ca=1;var c=Object.prototype,e=c.toString;function t(n){return e.call(n)}return gi=t,gi}var mi,Sa;function Rt(){if(Sa)return mi;Sa=1;var c=Fn(),e=bd(),t=wd(),n="[object Null]",p="[object Undefined]",d=c?c.toStringTag:void 0;function g(m){return m==null?m===void 0?p:n:d&&d in Object(m)?e(m):t(m)}return mi=g,mi}var vi,Aa;function lt(){if(Aa)return vi;Aa=1;function c(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return vi=c,vi}var yi,$a;function xs(){if($a)return yi;$a=1;var c=Rt(),e=lt(),t="[object AsyncFunction]",n="[object Function]",p="[object GeneratorFunction]",d="[object Proxy]";function g(m){if(!e(m))return!1;var l=c(m);return l==n||l==p||l==t||l==d}return yi=g,yi}var bi,Ea;function Cd(){if(Ea)return bi;Ea=1;var c=Ge(),e=c["__core-js_shared__"];return bi=e,bi}var wi,Ta;function Sd(){if(Ta)return wi;Ta=1;var c=Cd(),e=(function(){var n=/[^.]+$/.exec(c&&c.keys&&c.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function t(n){return!!e&&e in n}return wi=t,wi}var Ci,Ma;function Du(){if(Ma)return Ci;Ma=1;var c=Function.prototype,e=c.toString;function t(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return Ci=t,Ci}var Si,_a;function Ad(){if(_a)return Si;_a=1;var c=xs(),e=Sd(),t=lt(),n=Du(),p=/[\\^$.*+?()[\]{}|]/g,d=/^\[object .+?Constructor\]$/,g=Function.prototype,m=Object.prototype,l=g.toString,f=m.hasOwnProperty,r=RegExp("^"+l.call(f).replace(p,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function o(s){if(!t(s)||e(s))return!1;var a=c(s)?r:d;return a.test(n(s))}return Si=o,Si}var Ai,xa;function $d(){if(xa)return Ai;xa=1;function c(e,t){return e?.[t]}return Ai=c,Ai}var $i,La;function vt(){if(La)return $i;La=1;var c=Ad(),e=$d();function t(n,p){var d=e(n,p);return c(d)?d:void 0}return $i=t,$i}var Ei,Ra;function Ls(){if(Ra)return Ei;Ra=1;var c=vt(),e=Ge(),t=c(e,"Map");return Ei=t,Ei}var Ti,ka;function Pn(){if(ka)return Ti;ka=1;var c=vt(),e=c(Object,"create");return Ti=e,Ti}var Mi,Ia;function Ed(){if(Ia)return Mi;Ia=1;var c=Pn();function e(){this.__data__=c?c(null):{},this.size=0}return Mi=e,Mi}var _i,Oa;function Td(){if(Oa)return _i;Oa=1;function c(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return _i=c,_i}var xi,Da;function Md(){if(Da)return xi;Da=1;var c=Pn(),e="__lodash_hash_undefined__",t=Object.prototype,n=t.hasOwnProperty;function p(d){var g=this.__data__;if(c){var m=g[d];return m===e?void 0:m}return n.call(g,d)?g[d]:void 0}return xi=p,xi}var Li,Na;function _d(){if(Na)return Li;Na=1;var c=Pn(),e=Object.prototype,t=e.hasOwnProperty;function n(p){var d=this.__data__;return c?d[p]!==void 0:t.call(d,p)}return Li=n,Li}var Ri,Fa;function xd(){if(Fa)return Ri;Fa=1;var c=Pn(),e="__lodash_hash_undefined__";function t(n,p){var d=this.__data__;return this.size+=this.has(n)?0:1,d[n]=c&&p===void 0?e:p,this}return Ri=t,Ri}var ki,Pa;function Ld(){if(Pa)return ki;Pa=1;var c=Ed(),e=Td(),t=Md(),n=_d(),p=xd();function d(g){var m=-1,l=g==null?0:g.length;for(this.clear();++m<l;){var f=g[m];this.set(f[0],f[1])}}return d.prototype.clear=c,d.prototype.delete=e,d.prototype.get=t,d.prototype.has=n,d.prototype.set=p,ki=d,ki}var Ii,Wa;function Rd(){if(Wa)return Ii;Wa=1;var c=Ld(),e=Nn(),t=Ls();function n(){this.size=0,this.__data__={hash:new c,map:new(t||e),string:new c}}return Ii=n,Ii}var Oi,Ba;function kd(){if(Ba)return Oi;Ba=1;function c(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return Oi=c,Oi}var Di,Ha;function Wn(){if(Ha)return Di;Ha=1;var c=kd();function e(t,n){var p=t.__data__;return c(n)?p[typeof n=="string"?"string":"hash"]:p.map}return Di=e,Di}var Ni,za;function Id(){if(za)return Ni;za=1;var c=Wn();function e(t){var n=c(this,t).delete(t);return this.size-=n?1:0,n}return Ni=e,Ni}var Fi,ja;function Od(){if(ja)return Fi;ja=1;var c=Wn();function e(t){return c(this,t).get(t)}return Fi=e,Fi}var Pi,Ua;function Dd(){if(Ua)return Pi;Ua=1;var c=Wn();function e(t){return c(this,t).has(t)}return Pi=e,Pi}var Wi,Ga;function Nd(){if(Ga)return Wi;Ga=1;var c=Wn();function e(t,n){var p=c(this,t),d=p.size;return p.set(t,n),this.size+=p.size==d?0:1,this}return Wi=e,Wi}var Bi,Va;function Rs(){if(Va)return Bi;Va=1;var c=Rd(),e=Id(),t=Od(),n=Dd(),p=Nd();function d(g){var m=-1,l=g==null?0:g.length;for(this.clear();++m<l;){var f=g[m];this.set(f[0],f[1])}}return d.prototype.clear=c,d.prototype.delete=e,d.prototype.get=t,d.prototype.has=n,d.prototype.set=p,Bi=d,Bi}var Hi,Ka;function Fd(){if(Ka)return Hi;Ka=1;var c=Nn(),e=Ls(),t=Rs(),n=200;function p(d,g){var m=this.__data__;if(m instanceof c){var l=m.__data__;if(!e||l.length<n-1)return l.push([d,g]),this.size=++m.size,this;m=this.__data__=new t(l)}return m.set(d,g),this.size=m.size,this}return Hi=p,Hi}var zi,qa;function Nu(){if(qa)return zi;qa=1;var c=Nn(),e=gd(),t=md(),n=vd(),p=yd(),d=Fd();function g(m){var l=this.__data__=new c(m);this.size=l.size}return g.prototype.clear=e,g.prototype.delete=t,g.prototype.get=n,g.prototype.has=p,g.prototype.set=d,zi=g,zi}var ji,Ya;function Fu(){if(Ya)return ji;Ya=1;var c=vt(),e=(function(){try{var t=c(Object,"defineProperty");return t({},"",{}),t}catch{}})();return ji=e,ji}var Ui,Xa;function ks(){if(Xa)return Ui;Xa=1;var c=Fu();function e(t,n,p){n=="__proto__"&&c?c(t,n,{configurable:!0,enumerable:!0,value:p,writable:!0}):t[n]=p}return Ui=e,Ui}var Gi,Qa;function Pu(){if(Qa)return Gi;Qa=1;var c=ks(),e=tn();function t(n,p,d){(d!==void 0&&!e(n[p],d)||d===void 0&&!(p in n))&&c(n,p,d)}return Gi=t,Gi}var Vi,Za;function Pd(){if(Za)return Vi;Za=1;function c(e){return function(t,n,p){for(var d=-1,g=Object(t),m=p(t),l=m.length;l--;){var f=m[e?l:++d];if(n(g[f],f,g)===!1)break}return t}}return Vi=c,Vi}var Ki,Ja;function Wd(){if(Ja)return Ki;Ja=1;var c=Pd(),e=c();return Ki=e,Ki}var Wt={exports:{}};Wt.exports;var el;function Bd(){return el||(el=1,(function(c,e){var t=Ge(),n=e&&!e.nodeType&&e,p=n&&!0&&c&&!c.nodeType&&c,d=p&&p.exports===n,g=d?t.Buffer:void 0,m=g?g.allocUnsafe:void 0;function l(f,r){if(r)return f.slice();var o=f.length,s=m?m(o):new f.constructor(o);return f.copy(s),s}c.exports=l})(Wt,Wt.exports)),Wt.exports}var qi,tl;function Wu(){if(tl)return qi;tl=1;var c=Ge(),e=c.Uint8Array;return qi=e,qi}var Yi,nl;function Hd(){if(nl)return Yi;nl=1;var c=Wu();function e(t){var n=new t.constructor(t.byteLength);return new c(n).set(new c(t)),n}return Yi=e,Yi}var Xi,il;function zd(){if(il)return Xi;il=1;var c=Hd();function e(t,n){var p=n?c(t.buffer):t.buffer;return new t.constructor(p,t.byteOffset,t.length)}return Xi=e,Xi}var Qi,rl;function jd(){if(rl)return Qi;rl=1;function c(e,t){var n=-1,p=e.length;for(t||(t=Array(p));++n<p;)t[n]=e[n];return t}return Qi=c,Qi}var Zi,ol;function Ud(){if(ol)return Zi;ol=1;var c=lt(),e=Object.create,t=(function(){function n(){}return function(p){if(!c(p))return{};if(e)return e(p);n.prototype=p;var d=new n;return n.prototype=void 0,d}})();return Zi=t,Zi}var Ji,sl;function Bu(){if(sl)return Ji;sl=1;function c(e,t){return function(n){return e(t(n))}}return Ji=c,Ji}var er,al;function Hu(){if(al)return er;al=1;var c=Bu(),e=c(Object.getPrototypeOf,Object);return er=e,er}var tr,ll;function Is(){if(ll)return tr;ll=1;var c=Object.prototype;function e(t){var n=t&&t.constructor,p=typeof n=="function"&&n.prototype||c;return t===p}return tr=e,tr}var nr,cl;function Gd(){if(cl)return nr;cl=1;var c=Ud(),e=Hu(),t=Is();function n(p){return typeof p.constructor=="function"&&!t(p)?c(e(p)):{}}return nr=n,nr}var ir,ul;function yt(){if(ul)return ir;ul=1;function c(e){return e!=null&&typeof e=="object"}return ir=c,ir}var rr,hl;function Vd(){if(hl)return rr;hl=1;var c=Rt(),e=yt(),t="[object Arguments]";function n(p){return e(p)&&c(p)==t}return rr=n,rr}var or,dl;function zu(){if(dl)return or;dl=1;var c=Vd(),e=yt(),t=Object.prototype,n=t.hasOwnProperty,p=t.propertyIsEnumerable,d=c((function(){return arguments})())?c:function(g){return e(g)&&n.call(g,"callee")&&!p.call(g,"callee")};return or=d,or}var sr,fl;function bt(){if(fl)return sr;fl=1;var c=Array.isArray;return sr=c,sr}var ar,pl;function ju(){if(pl)return ar;pl=1;var c=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=c}return ar=e,ar}var lr,gl;function Bn(){if(gl)return lr;gl=1;var c=xs(),e=ju();function t(n){return n!=null&&e(n.length)&&!c(n)}return lr=t,lr}var cr,ml;function Kd(){if(ml)return cr;ml=1;var c=Bn(),e=yt();function t(n){return e(n)&&c(n)}return cr=t,cr}var Bt={exports:{}},ur,vl;function qd(){if(vl)return ur;vl=1;function c(){return!1}return ur=c,ur}Bt.exports;var yl;function Os(){return yl||(yl=1,(function(c,e){var t=Ge(),n=qd(),p=e&&!e.nodeType&&e,d=p&&!0&&c&&!c.nodeType&&c,g=d&&d.exports===p,m=g?t.Buffer:void 0,l=m?m.isBuffer:void 0,f=l||n;c.exports=f})(Bt,Bt.exports)),Bt.exports}var hr,bl;function Yd(){if(bl)return hr;bl=1;var c=Rt(),e=Hu(),t=yt(),n="[object Object]",p=Function.prototype,d=Object.prototype,g=p.toString,m=d.hasOwnProperty,l=g.call(Object);function f(r){if(!t(r)||c(r)!=n)return!1;var o=e(r);if(o===null)return!0;var s=m.call(o,"constructor")&&o.constructor;return typeof s=="function"&&s instanceof s&&g.call(s)==l}return hr=f,hr}var dr,wl;function Xd(){if(wl)return dr;wl=1;var c=Rt(),e=ju(),t=yt(),n="[object Arguments]",p="[object Array]",d="[object Boolean]",g="[object Date]",m="[object Error]",l="[object Function]",f="[object Map]",r="[object Number]",o="[object Object]",s="[object RegExp]",a="[object Set]",i="[object String]",u="[object WeakMap]",h="[object ArrayBuffer]",y="[object DataView]",b="[object Float32Array]",T="[object Float64Array]",$="[object Int8Array]",A="[object Int16Array]",S="[object Int32Array]",M="[object Uint8Array]",R="[object Uint8ClampedArray]",L="[object Uint16Array]",_="[object Uint32Array]",I={};I[b]=I[T]=I[$]=I[A]=I[S]=I[M]=I[R]=I[L]=I[_]=!0,I[n]=I[p]=I[h]=I[d]=I[y]=I[g]=I[m]=I[l]=I[f]=I[r]=I[o]=I[s]=I[a]=I[i]=I[u]=!1;function w(v){return t(v)&&e(v.length)&&!!I[c(v)]}return dr=w,dr}var fr,Cl;function Qd(){if(Cl)return fr;Cl=1;function c(e){return function(t){return e(t)}}return fr=c,fr}var Ht={exports:{}};Ht.exports;var Sl;function Zd(){return Sl||(Sl=1,(function(c,e){var t=Ou(),n=e&&!e.nodeType&&e,p=n&&!0&&c&&!c.nodeType&&c,d=p&&p.exports===n,g=d&&t.process,m=(function(){try{var l=p&&p.require&&p.require("util").types;return l||g&&g.binding&&g.binding("util")}catch{}})();c.exports=m})(Ht,Ht.exports)),Ht.exports}var pr,Al;function Ds(){if(Al)return pr;Al=1;var c=Xd(),e=Qd(),t=Zd(),n=t&&t.isTypedArray,p=n?e(n):c;return pr=p,pr}var gr,$l;function Uu(){if($l)return gr;$l=1;function c(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return gr=c,gr}var mr,El;function Gu(){if(El)return mr;El=1;var c=ks(),e=tn(),t=Object.prototype,n=t.hasOwnProperty;function p(d,g,m){var l=d[g];(!(n.call(d,g)&&e(l,m))||m===void 0&&!(g in d))&&c(d,g,m)}return mr=p,mr}var vr,Tl;function Jd(){if(Tl)return vr;Tl=1;var c=Gu(),e=ks();function t(n,p,d,g){var m=!d;d||(d={});for(var l=-1,f=p.length;++l<f;){var r=p[l],o=g?g(d[r],n[r],r,d,n):void 0;o===void 0&&(o=n[r]),m?e(d,r,o):c(d,r,o)}return d}return vr=t,vr}var yr,Ml;function ef(){if(Ml)return yr;Ml=1;function c(e,t){for(var n=-1,p=Array(e);++n<e;)p[n]=t(n);return p}return yr=c,yr}var br,_l;function Ns(){if(_l)return br;_l=1;var c=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(n,p){var d=typeof n;return p=p??c,!!p&&(d=="number"||d!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<p}return br=t,br}var wr,xl;function Vu(){if(xl)return wr;xl=1;var c=ef(),e=zu(),t=bt(),n=Os(),p=Ns(),d=Ds(),g=Object.prototype,m=g.hasOwnProperty;function l(f,r){var o=t(f),s=!o&&e(f),a=!o&&!s&&n(f),i=!o&&!s&&!a&&d(f),u=o||s||a||i,h=u?c(f.length,String):[],y=h.length;for(var b in f)(r||m.call(f,b))&&!(u&&(b=="length"||a&&(b=="offset"||b=="parent")||i&&(b=="buffer"||b=="byteLength"||b=="byteOffset")||p(b,y)))&&h.push(b);return h}return wr=l,wr}var Cr,Ll;function tf(){if(Ll)return Cr;Ll=1;function c(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}return Cr=c,Cr}var Sr,Rl;function nf(){if(Rl)return Sr;Rl=1;var c=lt(),e=Is(),t=tf(),n=Object.prototype,p=n.hasOwnProperty;function d(g){if(!c(g))return t(g);var m=e(g),l=[];for(var f in g)f=="constructor"&&(m||!p.call(g,f))||l.push(f);return l}return Sr=d,Sr}var Ar,kl;function Ku(){if(kl)return Ar;kl=1;var c=Vu(),e=nf(),t=Bn();function n(p){return t(p)?c(p,!0):e(p)}return Ar=n,Ar}var $r,Il;function rf(){if(Il)return $r;Il=1;var c=Jd(),e=Ku();function t(n){return c(n,e(n))}return $r=t,$r}var Er,Ol;function of(){if(Ol)return Er;Ol=1;var c=Pu(),e=Bd(),t=zd(),n=jd(),p=Gd(),d=zu(),g=bt(),m=Kd(),l=Os(),f=xs(),r=lt(),o=Yd(),s=Ds(),a=Uu(),i=rf();function u(h,y,b,T,$,A,S){var M=a(h,b),R=a(y,b),L=S.get(R);if(L){c(h,b,L);return}var _=A?A(M,R,b+"",h,y,S):void 0,I=_===void 0;if(I){var w=g(R),v=!w&&l(R),C=!w&&!v&&s(R);_=R,w||v||C?g(M)?_=M:m(M)?_=n(M):v?(I=!1,_=e(R,!0)):C?(I=!1,_=t(R,!0)):_=[]:o(R)||d(R)?(_=M,d(M)?_=i(M):(!r(M)||f(M))&&(_=p(R))):I=!1}I&&(S.set(R,_),$(_,R,T,A,S),S.delete(R)),c(h,b,_)}return Er=u,Er}var Tr,Dl;function sf(){if(Dl)return Tr;Dl=1;var c=Nu(),e=Pu(),t=Wd(),n=of(),p=lt(),d=Ku(),g=Uu();function m(l,f,r,o,s){l!==f&&t(f,function(a,i){if(s||(s=new c),p(a))n(l,f,i,r,m,o,s);else{var u=o?o(g(l,i),a,i+"",l,f,s):void 0;u===void 0&&(u=a),e(l,i,u)}},d)}return Tr=m,Tr}var Mr,Nl;function qu(){if(Nl)return Mr;Nl=1;function c(e){return e}return Mr=c,Mr}var _r,Fl;function af(){if(Fl)return _r;Fl=1;function c(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}return _r=c,_r}var xr,Pl;function lf(){if(Pl)return xr;Pl=1;var c=af(),e=Math.max;function t(n,p,d){return p=e(p===void 0?n.length-1:p,0),function(){for(var g=arguments,m=-1,l=e(g.length-p,0),f=Array(l);++m<l;)f[m]=g[p+m];m=-1;for(var r=Array(p+1);++m<p;)r[m]=g[m];return r[p]=d(f),c(n,this,r)}}return xr=t,xr}var Lr,Wl;function cf(){if(Wl)return Lr;Wl=1;function c(e){return function(){return e}}return Lr=c,Lr}var Rr,Bl;function uf(){if(Bl)return Rr;Bl=1;var c=cf(),e=Fu(),t=qu(),n=e?function(p,d){return e(p,"toString",{configurable:!0,enumerable:!1,value:c(d),writable:!0})}:t;return Rr=n,Rr}var kr,Hl;function hf(){if(Hl)return kr;Hl=1;var c=800,e=16,t=Date.now;function n(p){var d=0,g=0;return function(){var m=t(),l=e-(m-g);if(g=m,l>0){if(++d>=c)return arguments[0]}else d=0;return p.apply(void 0,arguments)}}return kr=n,kr}var Ir,zl;function df(){if(zl)return Ir;zl=1;var c=uf(),e=hf(),t=e(c);return Ir=t,Ir}var Or,jl;function ff(){if(jl)return Or;jl=1;var c=qu(),e=lf(),t=df();function n(p,d){return t(e(p,d,c),p+"")}return Or=n,Or}var Dr,Ul;function pf(){if(Ul)return Dr;Ul=1;var c=tn(),e=Bn(),t=Ns(),n=lt();function p(d,g,m){if(!n(m))return!1;var l=typeof g;return(l=="number"?e(m)&&t(g,m.length):l=="string"&&g in m)?c(m[g],d):!1}return Dr=p,Dr}var Nr,Gl;function gf(){if(Gl)return Nr;Gl=1;var c=ff(),e=pf();function t(n){return c(function(p,d){var g=-1,m=d.length,l=m>1?d[m-1]:void 0,f=m>2?d[2]:void 0;for(l=n.length>3&&typeof l=="function"?(m--,l):void 0,f&&e(d[0],d[1],f)&&(l=m<3?void 0:l,m=1),p=Object(p);++g<m;){var r=d[g];r&&n(p,r,g,l)}return p})}return Nr=t,Nr}var Fr,Vl;function mf(){if(Vl)return Fr;Vl=1;var c=sf(),e=gf(),t=e(function(n,p,d,g){c(n,p,d,g)});return Fr=t,Fr}var vf=mf();const yf=Lt(vf),bf=()=>crypto.randomUUID().slice(0,8),wf=()=>bf().slice(0,8),Kl=(c="",e)=>{if(!e)return console.warn("utils.match missing argument 2."),!1;const t=/[|\\{}()[\]^*$+?.]/g;let n=typeof e=="string"?[e]:e;n=n.map(d=>d==="*"?"":d.replace(t,"\\$&"));let p=!0;return n.length&&(p=!new RegExp(n.join("|"),"i").exec(c)),p},Cf=(c,e)=>{const t=c.indexOf(e);t!==-1&&c.splice(t,1)},Le=c=>{const e=c.className?.match(Of);return e&&kf[e[0]]},pt=c=>Array.from(new Set(c)),We=c=>c?.attrs?.id||c?.id||wf(),ze=(c,e)=>yf({},c,e,(n,p)=>{if(Array.isArray(n))return p!=null?pt(n.concat(p)):p;if(Array.isArray(p))return n!=null?pt(p.concat(n)):p}),Ye=c=>{let e;const t=c instanceof Promise;if(c===null||!(typeof c=="object")||t)return c;if(c instanceof Date)return e=new Date,e.setTime(c.getTime()),e;if(Array.isArray(c)){e=[];for(let p=0,d=c.length;p<d;p++)e[p]=Ye(c[p]);return e}if(c instanceof Object){e={};for(const p in c)Object.hasOwn(c,p)&&(e[p]=Ye(c[p]));return e}throw new Error("Unable to copy Object, type not supported.")},Pr=(c,e)=>c/e*100,ys=c=>`${c.toString()}%`,Yu=Object.create(null,{get:{value:c=>{const e=window.sessionStorage?.getItem(c);try{return JSON.parse(e)}catch{return e}}},set:{value:(c,e)=>{try{return window.sessionStorage?.setItem(c,JSON.stringify(e))}catch(t){console.error(t)}}}}),Pe=c=>/^(stage|row|column|field)s./.test(c),Sf=c=>_f.test(c);function Af(c,e=zs){let t=0;return function(...n){const p=Date.now();p-t>=e&&(t=p,c.apply(this,n))}}function An(c,e=gt){let t;return function(...n){t&&clearTimeout(t),t=setTimeout(()=>c.apply(this,n),e)}}function bs(c){return c}function ws(){}function Hn(c=Object.create(null)){if(typeof c=="string")try{return JSON.parse(c)}catch(e){return console.error("Invalid JSON string provided:",e),Object.create(null)}return c}const Vt=c=>c?Ye(Hn(c)):$n();function Xu(c,e,t,n={}){if(!e||!c[t][e])return n;const p=`${t}.${e}`;n[p]=c[t][e];const d=Ff.get(t);if(d){const g=c[t][e].data?.children||[];for(const m of g)Xu(c,m,d,n)}return n}const Fs=Iu.name,Ps=Iu.version,zn=Fs,ot="formeo-sprite",ql=[{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"}],Yl=`../../lib/icons/${ot}.svg`;typeof import.meta.resolve=="function"&&import.meta.resolve(Yl);const Qu=`https://cdn.jsdelivr.net/npm/formeo@${Ps}/dist/${ot}.svg`,$f=`https://draggable.github.io/formeo/assets/img/${ot}.svg`,Ef=`https://cdn.jsdelivr.net/npm/formeo@${Ps}/dist/formeo.min.css`,Tf="https://draggable.github.io/formeo/assets/css/formeo.min.css",Zu="f-panel",rt="control-group",kt=`${zn}-stage`,Xe=`${zn}-row`,Qe=`${zn}-column`,It=`${zn}-field`,Cs="custom-column-widths",Ju="column-preset",Wr="resizing-columns",Mf=new Map([[kt,Xe],[Xe,Qe],[Qe,It]]),Ws=["stage","row","column","field"],Bs=Ws.map(c=>`${c}s`);new Map(Bs.map((c,e)=>[c,Ws[e]]));const _f=new RegExp(`^${Bs.join("|")}.`),eh=[...Ws],xf=[...Bs],Lf=new Map(xf.map((c,e)=>[c,eh[e]])),Br=eh.reduce((c,e)=>(c[e]=e,c),{}),Rf=[{name:"controls",className:rt},{name:"stage",className:kt},{name:"row",className:Xe},{name:"column",className:Qe},{name:"field",className:It}],Hs={controls:rt,stage:kt,row:Xe,column:Qe,field:It},kf=Object.entries(Hs).reduce((c,[e,t])=>(c[t]=e,c),{}),If=Object.values(Hs),Of=new RegExp(`${If.join("|")}`,"g"),{childTypeMapVals:th,childTypeIndexMapVals:Df}=Rf.reduce((c,{name:e},t,n)=>{const{name:p}=n[t+1]||{};return p&&(c.childTypeMapVals.push([e,p]),c.childTypeIndexMapVals.push([`${e}s`,`${p}s`])),c},{childTypeMapVals:[],childTypeIndexMapVals:[]}),Nf=th.slice().map(c=>c.slice().reverse()).reverse(),Xl=new Map(th),Ff=new Map(Df),Pf=new Map(Nf.slice()),Wf=[[{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"}]],Bf=new Map(Wf.reduce((c,e,t)=>(c.push([t,e]),c),[])),nh=`${Fs}-formData`,Ql=`${Fs}-locale`,Ke=333,gt=Math.round(Ke/2),zs=Math.round(Ke*2),ih="formeoSaved",jn="formeoUpdated",Hf="formeoUpdatedStage",zf="formeoUpdatedRow",jf="formeoUpdatedColumn",Uf="formeoUpdatedField",Gf="formeoCleared",rh="formeoOnRender",Vf="formeoConditionUpdated",oh={equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},Kf={and:"&&",or:"||"},sh={equals:"="},qf=["logical","source","sourceProperty","comparison","target","targetProperty","assignment","value"],Zl=["isChecked","isNotChecked"],Jl=["isVisible","isNotVisible"],fn=["value"],Yf={comparison:oh,assignment:sh,logical:Kf},ah="if",Xf="then",js=()=>({[ah]:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],[Xf]:[{target:"",targetProperty:"",assignment:"",value:""}]}),Qf=/(\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,Ss=/\bcol-\w+-\d+/g,lh="f-i-",$n=()=>({id:We(),stages:{[We()]:{}},rows:{},columns:{},fields:{}}),En=["selected","checked"],Zf=En.toReversed(),Jf="a an and as at but by for for from in into near nor of on onto or the to with".split(" ").map(c=>`\\s${c}\\s`),ep=new RegExp(`(?!${Jf.join("|")})\\w\\S*`,"g"),tp=/\s+/g;function st(c){return typeof c!="string"||c.trim().match(tp)?c:c.replace(ep,t=>t.charAt(0).toUpperCase()+t.substring(1).replace(/[A-Z]/g,n=>` ${n}`))}const ch=(c,e="-")=>c.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,e),mt=c=>{if(Array.isArray(c))return c;const e=/[.[\]]/g,t=[];let n=0,p=e.exec(c);for(;p!==null;)t.push(c.slice(n,p.index)),n=p.index+p[0].length,p=e.exec(c);return n<c.length&&t.push(c.slice(n)),t.filter(Boolean)},ec=(c,e="-")=>mt(c).join(e),np=c=>{const e=document.createElement("div");return e.innerHTML=c,e.textContent||e.innerText||""},ip=(c,e,t="…")=>{if(c.length<=e)return c;const n=c.slice(0,e),p=n.lastIndexOf(" ");let d=`${p>0?n.slice(0,p):n}`;return t&&(d+=t),d};var Hr,tc;function Us(){if(tc)return Hr;tc=1;var c=Rt(),e=yt(),t="[object Symbol]";function n(p){return typeof p=="symbol"||e(p)&&c(p)==t}return Hr=n,Hr}var zr,nc;function rp(){if(nc)return zr;nc=1;var c=bt(),e=Us(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function p(d,g){if(c(d))return!1;var m=typeof d;return m=="number"||m=="symbol"||m=="boolean"||d==null||e(d)?!0:n.test(d)||!t.test(d)||g!=null&&d in Object(g)}return zr=p,zr}var jr,ic;function op(){if(ic)return jr;ic=1;var c=Rs(),e="Expected a function";function t(n,p){if(typeof n!="function"||p!=null&&typeof p!="function")throw new TypeError(e);var d=function(){var g=arguments,m=p?p.apply(this,g):g[0],l=d.cache;if(l.has(m))return l.get(m);var f=n.apply(this,g);return d.cache=l.set(m,f)||l,f};return d.cache=new(t.Cache||c),d}return t.Cache=c,jr=t,jr}var Ur,rc;function sp(){if(rc)return Ur;rc=1;var c=op(),e=500;function t(n){var p=c(n,function(g){return d.size===e&&d.clear(),g}),d=p.cache;return p}return Ur=t,Ur}var Gr,oc;function ap(){if(oc)return Gr;oc=1;var c=sp(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=c(function(p){var d=[];return p.charCodeAt(0)===46&&d.push(""),p.replace(e,function(g,m,l,f){d.push(l?f.replace(t,"$1"):m||g)}),d});return Gr=n,Gr}var Vr,sc;function lp(){if(sc)return Vr;sc=1;function c(e,t){for(var n=-1,p=e==null?0:e.length,d=Array(p);++n<p;)d[n]=t(e[n],n,e);return d}return Vr=c,Vr}var Kr,ac;function cp(){if(ac)return Kr;ac=1;var c=Fn(),e=lp(),t=bt(),n=Us(),p=c?c.prototype:void 0,d=p?p.toString:void 0;function g(m){if(typeof m=="string")return m;if(t(m))return e(m,g)+"";if(n(m))return d?d.call(m):"";var l=m+"";return l=="0"&&1/m==-1/0?"-0":l}return Kr=g,Kr}var qr,lc;function Un(){if(lc)return qr;lc=1;var c=cp();function e(t){return t==null?"":c(t)}return qr=e,qr}var Yr,cc;function uh(){if(cc)return Yr;cc=1;var c=bt(),e=rp(),t=ap(),n=Un();function p(d,g){return c(d)?d:e(d,g)?[d]:t(n(d))}return Yr=p,Yr}var Xr,uc;function hh(){if(uc)return Xr;uc=1;var c=Us();function e(t){if(typeof t=="string"||c(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return Xr=e,Xr}var Qr,hc;function up(){if(hc)return Qr;hc=1;var c=uh(),e=hh();function t(n,p){p=c(p,n);for(var d=0,g=p.length;n!=null&&d<g;)n=n[e(p[d++])];return d&&d==g?n:void 0}return Qr=t,Qr}var Zr,dc;function hp(){if(dc)return Zr;dc=1;var c=up();function e(t,n,p){var d=t==null?void 0:c(t,n);return d===void 0?p:d}return Zr=e,Zr}var dp=hp();const fp=Lt(dp);var Jr,fc;function pp(){if(fc)return Jr;fc=1;var c=Gu(),e=uh(),t=Ns(),n=lt(),p=hh();function d(g,m,l,f){if(!n(g))return g;m=e(m,g);for(var r=-1,o=m.length,s=o-1,a=g;a!=null&&++r<o;){var i=p(m[r]),u=l;if(i==="__proto__"||i==="constructor"||i==="prototype")return g;if(r!=s){var h=a[i];u=f?f(h,i,a):void 0,u===void 0&&(u=n(h)?h:t(m[r+1])?[]:{})}c(a,i,u),a=a[i]}return g}return Jr=d,Jr}var eo,pc;function gp(){if(pc)return eo;pc=1;var c=pp();function e(t,n,p){return t==null?t:c(t,n,p)}return eo=e,eo}var mp=gp();const vp=Lt(mp),De=fp,Gn=vp;function yp(c,e={}){const t={...c};for(const n in e)Object.hasOwn(e,n)&&(Object.hasOwn(t,n)?Array.isArray(t[n])?t[n].push(e[n]):t[n]=[t[n],e[n]]:t[n]=e[n]);return t}function pn(...c){return c.flat().reduce((e,t)=>(e[t]=t,e),{})}var to,gc;function bp(){if(gc)return to;gc=1;var c="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,c),this}return to=e,to}var no,mc;function wp(){if(mc)return no;mc=1;function c(e){return this.__data__.has(e)}return no=c,no}var io,vc;function Cp(){if(vc)return io;vc=1;var c=Rs(),e=bp(),t=wp();function n(p){var d=-1,g=p==null?0:p.length;for(this.__data__=new c;++d<g;)this.add(p[d])}return n.prototype.add=n.prototype.push=e,n.prototype.has=t,io=n,io}var ro,yc;function Sp(){if(yc)return ro;yc=1;function c(e,t){for(var n=-1,p=e==null?0:e.length;++n<p;)if(t(e[n],n,e))return!0;return!1}return ro=c,ro}var oo,bc;function Ap(){if(bc)return oo;bc=1;function c(e,t){return e.has(t)}return oo=c,oo}var so,wc;function dh(){if(wc)return so;wc=1;var c=Cp(),e=Sp(),t=Ap(),n=1,p=2;function d(g,m,l,f,r,o){var s=l&n,a=g.length,i=m.length;if(a!=i&&!(s&&i>a))return!1;var u=o.get(g),h=o.get(m);if(u&&h)return u==m&&h==g;var y=-1,b=!0,T=l&p?new c:void 0;for(o.set(g,m),o.set(m,g);++y<a;){var $=g[y],A=m[y];if(f)var S=s?f(A,$,y,m,g,o):f($,A,y,g,m,o);if(S!==void 0){if(S)continue;b=!1;break}if(T){if(!e(m,function(M,R){if(!t(T,R)&&($===M||r($,M,l,f,o)))return T.push(R)})){b=!1;break}}else if(!($===A||r($,A,l,f,o))){b=!1;break}}return o.delete(g),o.delete(m),b}return so=d,so}var ao,Cc;function $p(){if(Cc)return ao;Cc=1;function c(e){var t=-1,n=Array(e.size);return e.forEach(function(p,d){n[++t]=[d,p]}),n}return ao=c,ao}var lo,Sc;function Ep(){if(Sc)return lo;Sc=1;function c(e){var t=-1,n=Array(e.size);return e.forEach(function(p){n[++t]=p}),n}return lo=c,lo}var co,Ac;function Tp(){if(Ac)return co;Ac=1;var c=Fn(),e=Wu(),t=tn(),n=dh(),p=$p(),d=Ep(),g=1,m=2,l="[object Boolean]",f="[object Date]",r="[object Error]",o="[object Map]",s="[object Number]",a="[object RegExp]",i="[object Set]",u="[object String]",h="[object Symbol]",y="[object ArrayBuffer]",b="[object DataView]",T=c?c.prototype:void 0,$=T?T.valueOf:void 0;function A(S,M,R,L,_,I,w){switch(R){case b:if(S.byteLength!=M.byteLength||S.byteOffset!=M.byteOffset)return!1;S=S.buffer,M=M.buffer;case y:return!(S.byteLength!=M.byteLength||!I(new e(S),new e(M)));case l:case f:case s:return t(+S,+M);case r:return S.name==M.name&&S.message==M.message;case a:case u:return S==M+"";case o:var v=p;case i:var C=L&g;if(v||(v=d),S.size!=M.size&&!C)return!1;var E=w.get(S);if(E)return E==M;L|=m,w.set(S,M);var x=n(v(S),v(M),L,_,I,w);return w.delete(S),x;case h:if($)return $.call(S)==$.call(M)}return!1}return co=A,co}var uo,$c;function Mp(){if($c)return uo;$c=1;function c(e,t){for(var n=-1,p=t.length,d=e.length;++n<p;)e[d+n]=t[n];return e}return uo=c,uo}var ho,Ec;function _p(){if(Ec)return ho;Ec=1;var c=Mp(),e=bt();function t(n,p,d){var g=p(n);return e(n)?g:c(g,d(n))}return ho=t,ho}var fo,Tc;function xp(){if(Tc)return fo;Tc=1;function c(e,t){for(var n=-1,p=e==null?0:e.length,d=0,g=[];++n<p;){var m=e[n];t(m,n,e)&&(g[d++]=m)}return g}return fo=c,fo}var po,Mc;function Lp(){if(Mc)return po;Mc=1;function c(){return[]}return po=c,po}var go,_c;function Rp(){if(_c)return go;_c=1;var c=xp(),e=Lp(),t=Object.prototype,n=t.propertyIsEnumerable,p=Object.getOwnPropertySymbols,d=p?function(g){return g==null?[]:(g=Object(g),c(p(g),function(m){return n.call(g,m)}))}:e;return go=d,go}var mo,xc;function kp(){if(xc)return mo;xc=1;var c=Bu(),e=c(Object.keys,Object);return mo=e,mo}var vo,Lc;function Ip(){if(Lc)return vo;Lc=1;var c=Is(),e=kp(),t=Object.prototype,n=t.hasOwnProperty;function p(d){if(!c(d))return e(d);var g=[];for(var m in Object(d))n.call(d,m)&&m!="constructor"&&g.push(m);return g}return vo=p,vo}var yo,Rc;function Op(){if(Rc)return yo;Rc=1;var c=Vu(),e=Ip(),t=Bn();function n(p){return t(p)?c(p):e(p)}return yo=n,yo}var bo,kc;function Dp(){if(kc)return bo;kc=1;var c=_p(),e=Rp(),t=Op();function n(p){return c(p,t,e)}return bo=n,bo}var wo,Ic;function Np(){if(Ic)return wo;Ic=1;var c=Dp(),e=1,t=Object.prototype,n=t.hasOwnProperty;function p(d,g,m,l,f,r){var o=m&e,s=c(d),a=s.length,i=c(g),u=i.length;if(a!=u&&!o)return!1;for(var h=a;h--;){var y=s[h];if(!(o?y in g:n.call(g,y)))return!1}var b=r.get(d),T=r.get(g);if(b&&T)return b==g&&T==d;var $=!0;r.set(d,g),r.set(g,d);for(var A=o;++h<a;){y=s[h];var S=d[y],M=g[y];if(l)var R=o?l(M,S,y,g,d,r):l(S,M,y,d,g,r);if(!(R===void 0?S===M||f(S,M,m,l,r):R)){$=!1;break}A||(A=y=="constructor")}if($&&!A){var L=d.constructor,_=g.constructor;L!=_&&"constructor"in d&&"constructor"in g&&!(typeof L=="function"&&L instanceof L&&typeof _=="function"&&_ instanceof _)&&($=!1)}return r.delete(d),r.delete(g),$}return wo=p,wo}var Co,Oc;function Fp(){if(Oc)return Co;Oc=1;var c=vt(),e=Ge(),t=c(e,"DataView");return Co=t,Co}var So,Dc;function Pp(){if(Dc)return So;Dc=1;var c=vt(),e=Ge(),t=c(e,"Promise");return So=t,So}var Ao,Nc;function Wp(){if(Nc)return Ao;Nc=1;var c=vt(),e=Ge(),t=c(e,"Set");return Ao=t,Ao}var $o,Fc;function Bp(){if(Fc)return $o;Fc=1;var c=vt(),e=Ge(),t=c(e,"WeakMap");return $o=t,$o}var Eo,Pc;function Hp(){if(Pc)return Eo;Pc=1;var c=Fp(),e=Ls(),t=Pp(),n=Wp(),p=Bp(),d=Rt(),g=Du(),m="[object Map]",l="[object Object]",f="[object Promise]",r="[object Set]",o="[object WeakMap]",s="[object DataView]",a=g(c),i=g(e),u=g(t),h=g(n),y=g(p),b=d;return(c&&b(new c(new ArrayBuffer(1)))!=s||e&&b(new e)!=m||t&&b(t.resolve())!=f||n&&b(new n)!=r||p&&b(new p)!=o)&&(b=function(T){var $=d(T),A=$==l?T.constructor:void 0,S=A?g(A):"";if(S)switch(S){case a:return s;case i:return m;case u:return f;case h:return r;case y:return o}return $}),Eo=b,Eo}var To,Wc;function zp(){if(Wc)return To;Wc=1;var c=Nu(),e=dh(),t=Tp(),n=Np(),p=Hp(),d=bt(),g=Os(),m=Ds(),l=1,f="[object Arguments]",r="[object Array]",o="[object Object]",s=Object.prototype,a=s.hasOwnProperty;function i(u,h,y,b,T,$){var A=d(u),S=d(h),M=A?r:p(u),R=S?r:p(h);M=M==f?o:M,R=R==f?o:R;var L=M==o,_=R==o,I=M==R;if(I&&g(u)){if(!g(h))return!1;A=!0,L=!1}if(I&&!L)return $||($=new c),A||m(u)?e(u,h,y,b,T,$):t(u,h,M,y,b,T,$);if(!(y&l)){var w=L&&a.call(u,"__wrapped__"),v=_&&a.call(h,"__wrapped__");if(w||v){var C=w?u.value():u,E=v?h.value():h;return $||($=new c),T(C,E,y,b,$)}}return I?($||($=new c),n(u,h,y,b,T,$)):!1}return To=i,To}var Mo,Bc;function jp(){if(Bc)return Mo;Bc=1;var c=zp(),e=yt();function t(n,p,d,g,m){return n===p?!0:n==null||p==null||!e(n)&&!e(p)?n!==n&&p!==p:c(n,p,d,g,t,m)}return Mo=t,Mo}var _o,Hc;function Up(){if(Hc)return _o;Hc=1;var c=jp();function e(t,n){return c(t,n)}return _o=e,_o}var Gp=Up();const As=Lt(Gp),Vp=(c,e)=>c===void 0?"added":e===void 0?"removed":As(c,e)?"unchanged":"changed";class Gs{constructor(e,t=Object.create(null)){this.name=e,this.data=t,this.dataPath=""}get size(){return Object.keys(this.data).length}get js(){return this.data}get json(){return this.data}toJSON=(e,t)=>JSON.stringify(e,null,t);get=e=>De(this.data,e);set(e,t){const n=De(this.data,e),p=Gn(this.data,e,t),d=Array.isArray(e)?e.join("."):e,g=Object.keys(this.setCallbacks).filter(l=>new RegExp(l).test(d)),m={newVal:t,oldVal:n,path:e};for(const l of g)for(const f of this.setCallbacks[l])f(m);if(!this.disableEvents){const l={entity:this,dataPath:this.dataPath.replace(/\.+$/,""),changePath:this.dataPath+e,value:t,data:p,changeType:Vp(n,t),src:this.dom};n&&(l.previousValue=n),le.formeoUpdated(l)}return p}addSetCallback(e,t){this.setCallbacks[e]?this.setCallbacks[e].push(t):this.setCallbacks[e]=[t]}removeSetCallback(e,t){this.setCallbacks[e]=this.setCallbacks[e].filter(n=>n!==t)}add=(e,t=Object.create(null))=>{const{id:n}=t,p=e||n||We();return this.set(p,t)};remove=e=>{const t=mt(e),n=t.pop(),p=this.get(t);return Array.isArray(p)?p.splice(Number(n),1):p&&delete p[n],p};empty(){this.data=Object.create(null)}getData=()=>Object.entries(this.data).reduce((e,[t,n])=>(e[t]=n?.data?n.getData():n,e),{});setCallbacks={};configVal=Object.create(null)}class Vn extends Gs{load=e=>{const t=Hn(e);this.empty();for(const[n,p]of Object.entries(t))this.add(n,p);return this.data};get=e=>e?De(this.data,e):this.add();add=(e,t=Object.create(null))=>{const n=e||We(),p=this.Component({...t,id:n});return this.data[n]=p,this.active=p,p};remove=e=>{if(Array.isArray(e))for(const t of e)this.get(t).remove();else this.get(e).remove();return this.data};delete=e=>(delete this.data[e],e);clearAll=(e=!0)=>{const t=Object.values(this.data).map(n=>n.empty(e));return Promise.all(t)};set config(e){this.configVal=ze(this.configVal,Ye(e))}get config(){return this.configVal}conditionMap=new Map}function zc(c,e){var t=Object.keys(c);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(c);e&&(n=n.filter(function(p){return Object.getOwnPropertyDescriptor(c,p).enumerable})),t.push.apply(t,n)}return t}function Ue(c){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?zc(Object(t),!0).forEach(function(n){Kp(c,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(t)):zc(Object(t)).forEach(function(n){Object.defineProperty(c,n,Object.getOwnPropertyDescriptor(t,n))})}return c}function gn(c){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?gn=function(e){return typeof e}:gn=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gn(c)}function Kp(c,e,t){return e in c?Object.defineProperty(c,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):c[e]=t,c}function Ze(){return Ze=Object.assign||function(c){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},Ze.apply(this,arguments)}function qp(c,e){if(c==null)return{};var t={},n=Object.keys(c),p,d;for(d=0;d<n.length;d++)p=n[d],!(e.indexOf(p)>=0)&&(t[p]=c[p]);return t}function Yp(c,e){if(c==null)return{};var t=qp(c,e),n,p;if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(c);for(p=0;p<d.length;p++)n=d[p],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(c,n)&&(t[n]=c[n])}return t}var Xp="1.15.3";function qe(c){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(c)}var et=qe(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),nn=qe(/Edge/i),jc=qe(/firefox/i),Kt=qe(/safari/i)&&!qe(/chrome/i)&&!qe(/android/i),fh=qe(/iP(ad|od|hone)/i),ph=qe(/chrome/i)&&qe(/android/i),gh={capture:!1,passive:!1};function oe(c,e,t){c.addEventListener(e,t,!et&&gh)}function re(c,e,t){c.removeEventListener(e,t,!et&&gh)}function Tn(c,e){if(e){if(e[0]===">"&&(e=e.substring(1)),c)try{if(c.matches)return c.matches(e);if(c.msMatchesSelector)return c.msMatchesSelector(e);if(c.webkitMatchesSelector)return c.webkitMatchesSelector(e)}catch{return!1}return!1}}function mh(c){return c.host&&c!==document&&c.host.nodeType?c.host:c.parentNode}function He(c,e,t,n){if(c){t=t||document;do{if(e!=null&&(e[0]===">"?c.parentNode===t&&Tn(c,e):Tn(c,e))||n&&c===t)return c;if(c===t)break}while(c=mh(c))}return null}var Uc=/\s+/g;function Ie(c,e,t){if(c&&e)if(c.classList)c.classList[t?"add":"remove"](e);else{var n=(" "+c.className+" ").replace(Uc," ").replace(" "+e+" "," ");c.className=(n+(t?" "+e:"")).replace(Uc," ")}}function te(c,e,t){var n=c&&c.style;if(n){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(c,""):c.currentStyle&&(t=c.currentStyle),e===void 0?t:t[e];!(e in n)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),n[e]=t+(typeof t=="string"?"":"px")}}function Tt(c,e){var t="";if(typeof c=="string")t=c;else do{var n=te(c,"transform");n&&n!=="none"&&(t=n+" "+t)}while(!e&&(c=c.parentNode));var p=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return p&&new p(t)}function vh(c,e,t){if(c){var n=c.getElementsByTagName(e),p=0,d=n.length;if(t)for(;p<d;p++)t(n[p],p);return n}return[]}function je(){var c=document.scrollingElement;return c||document.documentElement}function we(c,e,t,n,p){if(!(!c.getBoundingClientRect&&c!==window)){var d,g,m,l,f,r,o;if(c!==window&&c.parentNode&&c!==je()?(d=c.getBoundingClientRect(),g=d.top,m=d.left,l=d.bottom,f=d.right,r=d.height,o=d.width):(g=0,m=0,l=window.innerHeight,f=window.innerWidth,r=window.innerHeight,o=window.innerWidth),(e||t)&&c!==window&&(p=p||c.parentNode,!et))do if(p&&p.getBoundingClientRect&&(te(p,"transform")!=="none"||t&&te(p,"position")!=="static")){var s=p.getBoundingClientRect();g-=s.top+parseInt(te(p,"border-top-width")),m-=s.left+parseInt(te(p,"border-left-width")),l=g+d.height,f=m+d.width;break}while(p=p.parentNode);if(n&&c!==window){var a=Tt(p||c),i=a&&a.a,u=a&&a.d;a&&(g/=u,m/=i,o/=i,r/=u,l=g+r,f=m+o)}return{top:g,left:m,bottom:l,right:f,width:o,height:r}}}function Gc(c,e,t){for(var n=it(c,!0),p=we(c)[e];n;){var d=we(n)[t],g=void 0;if(g=p>=d,!g)return n;if(n===je())break;n=it(n,!1)}return!1}function Mt(c,e,t,n){for(var p=0,d=0,g=c.children;d<g.length;){if(g[d].style.display!=="none"&&g[d]!==ee.ghost&&(n||g[d]!==ee.dragged)&&He(g[d],t.draggable,c,!1)){if(p===e)return g[d];p++}d++}return null}function Vs(c,e){for(var t=c.lastElementChild;t&&(t===ee.ghost||te(t,"display")==="none"||e&&!Tn(t,e));)t=t.previousElementSibling;return t||null}function Fe(c,e){var t=0;if(!c||!c.parentNode)return-1;for(;c=c.previousElementSibling;)c.nodeName.toUpperCase()!=="TEMPLATE"&&c!==ee.clone&&(!e||Tn(c,e))&&t++;return t}function Vc(c){var e=0,t=0,n=je();if(c)do{var p=Tt(c),d=p.a,g=p.d;e+=c.scrollLeft*d,t+=c.scrollTop*g}while(c!==n&&(c=c.parentNode));return[e,t]}function Qp(c,e){for(var t in c)if(c.hasOwnProperty(t)){for(var n in e)if(e.hasOwnProperty(n)&&e[n]===c[t][n])return Number(t)}return-1}function it(c,e){if(!c||!c.getBoundingClientRect)return je();var t=c,n=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var p=te(t);if(t.clientWidth<t.scrollWidth&&(p.overflowX=="auto"||p.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(p.overflowY=="auto"||p.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return je();if(n||e)return t;n=!0}}while(t=t.parentNode);return je()}function Zp(c,e){if(c&&e)for(var t in e)e.hasOwnProperty(t)&&(c[t]=e[t]);return c}function xo(c,e){return Math.round(c.top)===Math.round(e.top)&&Math.round(c.left)===Math.round(e.left)&&Math.round(c.height)===Math.round(e.height)&&Math.round(c.width)===Math.round(e.width)}var qt;function yh(c,e){return function(){if(!qt){var t=arguments,n=this;t.length===1?c.call(n,t[0]):c.apply(n,t),qt=setTimeout(function(){qt=void 0},e)}}}function Jp(){clearTimeout(qt),qt=void 0}function bh(c,e,t){c.scrollLeft+=e,c.scrollTop+=t}function wh(c){var e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(c).cloneNode(!0):t?t(c).clone(!0)[0]:c.cloneNode(!0)}function Ch(c,e,t){var n={};return Array.from(c.children).forEach(function(p){var d,g,m,l;if(!(!He(p,e.draggable,c,!1)||p.animated||p===t)){var f=we(p);n.left=Math.min((d=n.left)!==null&&d!==void 0?d:1/0,f.left),n.top=Math.min((g=n.top)!==null&&g!==void 0?g:1/0,f.top),n.right=Math.max((m=n.right)!==null&&m!==void 0?m:-1/0,f.right),n.bottom=Math.max((l=n.bottom)!==null&&l!==void 0?l:-1/0,f.bottom)}}),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var Re="Sortable"+new Date().getTime();function eg(){var c=[],e;return{captureAnimationState:function(){if(c=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(p){if(!(te(p,"display")==="none"||p===ee.ghost)){c.push({target:p,rect:we(p)});var d=Ue({},c[c.length-1].rect);if(p.thisAnimationDuration){var g=Tt(p,!0);g&&(d.top-=g.f,d.left-=g.e)}p.fromRect=d}})}},addAnimationState:function(n){c.push(n)},removeAnimationState:function(n){c.splice(Qp(c,{target:n}),1)},animateAll:function(n){var p=this;if(!this.options.animation){clearTimeout(e),typeof n=="function"&&n();return}var d=!1,g=0;c.forEach(function(m){var l=0,f=m.target,r=f.fromRect,o=we(f),s=f.prevFromRect,a=f.prevToRect,i=m.rect,u=Tt(f,!0);u&&(o.top-=u.f,o.left-=u.e),f.toRect=o,f.thisAnimationDuration&&xo(s,o)&&!xo(r,o)&&(i.top-o.top)/(i.left-o.left)===(r.top-o.top)/(r.left-o.left)&&(l=ng(i,s,a,p.options)),xo(o,r)||(f.prevFromRect=r,f.prevToRect=o,l||(l=p.options.animation),p.animate(f,i,o,l)),l&&(d=!0,g=Math.max(g,l),clearTimeout(f.animationResetTimer),f.animationResetTimer=setTimeout(function(){f.animationTime=0,f.prevFromRect=null,f.fromRect=null,f.prevToRect=null,f.thisAnimationDuration=null},l),f.thisAnimationDuration=l)}),clearTimeout(e),d?e=setTimeout(function(){typeof n=="function"&&n()},g):typeof n=="function"&&n(),c=[]},animate:function(n,p,d,g){if(g){te(n,"transition",""),te(n,"transform","");var m=Tt(this.el),l=m&&m.a,f=m&&m.d,r=(p.left-d.left)/(l||1),o=(p.top-d.top)/(f||1);n.animatingX=!!r,n.animatingY=!!o,te(n,"transform","translate3d("+r+"px,"+o+"px,0)"),this.forRepaintDummy=tg(n),te(n,"transition","transform "+g+"ms"+(this.options.easing?" "+this.options.easing:"")),te(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){te(n,"transition",""),te(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},g)}}}}function tg(c){return c.offsetWidth}function ng(c,e,t,n){return Math.sqrt(Math.pow(e.top-c.top,2)+Math.pow(e.left-c.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*n.animation}var wt=[],Lo={initializeByDefault:!0},rn={mount:function(e){for(var t in Lo)Lo.hasOwnProperty(t)&&!(t in e)&&(e[t]=Lo[t]);wt.forEach(function(n){if(n.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),wt.push(e)},pluginEvent:function(e,t,n){var p=this;this.eventCanceled=!1,n.cancel=function(){p.eventCanceled=!0};var d=e+"Global";wt.forEach(function(g){t[g.pluginName]&&(t[g.pluginName][d]&&t[g.pluginName][d](Ue({sortable:t},n)),t.options[g.pluginName]&&t[g.pluginName][e]&&t[g.pluginName][e](Ue({sortable:t},n)))})},initializePlugins:function(e,t,n,p){wt.forEach(function(m){var l=m.pluginName;if(!(!e.options[l]&&!m.initializeByDefault)){var f=new m(e,t,e.options);f.sortable=e,f.options=e.options,e[l]=f,Ze(n,f.defaults)}});for(var d in e.options)if(e.options.hasOwnProperty(d)){var g=this.modifyOption(e,d,e.options[d]);typeof g<"u"&&(e.options[d]=g)}},getEventProperties:function(e,t){var n={};return wt.forEach(function(p){typeof p.eventProperties=="function"&&Ze(n,p.eventProperties.call(t[p.pluginName],e))}),n},modifyOption:function(e,t,n){var p;return wt.forEach(function(d){e[d.pluginName]&&d.optionListeners&&typeof d.optionListeners[t]=="function"&&(p=d.optionListeners[t].call(e[d.pluginName],n))}),p}};function ig(c){var e=c.sortable,t=c.rootEl,n=c.name,p=c.targetEl,d=c.cloneEl,g=c.toEl,m=c.fromEl,l=c.oldIndex,f=c.newIndex,r=c.oldDraggableIndex,o=c.newDraggableIndex,s=c.originalEvent,a=c.putSortable,i=c.extraEventProperties;if(e=e||t&&t[Re],!!e){var u,h=e.options,y="on"+n.charAt(0).toUpperCase()+n.substr(1);window.CustomEvent&&!et&&!nn?u=new CustomEvent(n,{bubbles:!0,cancelable:!0}):(u=document.createEvent("Event"),u.initEvent(n,!0,!0)),u.to=g||t,u.from=m||t,u.item=p||t,u.clone=d,u.oldIndex=l,u.newIndex=f,u.oldDraggableIndex=r,u.newDraggableIndex=o,u.originalEvent=s,u.pullMode=a?a.lastPutMode:void 0;var b=Ue(Ue({},i),rn.getEventProperties(n,e));for(var T in b)u[T]=b[T];t&&t.dispatchEvent(u),h[y]&&h[y].call(e,u)}}var rg=["evt"],xe=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p=n.evt,d=Yp(n,rg);rn.pluginEvent.bind(ee)(e,t,Ue({dragEl:K,parentEl:ve,ghostEl:ne,rootEl:fe,nextEl:ft,lastDownEl:mn,cloneEl:pe,cloneHidden:nt,dragStarted:zt,putSortable:Se,activeSortable:ee.active,originalEvent:p,oldIndex:$t,oldDraggableIndex:Yt,newIndex:Oe,newDraggableIndex:tt,hideGhostForTarget:Eh,unhideGhostForTarget:Th,cloneNowHidden:function(){nt=!0},cloneNowShown:function(){nt=!1},dispatchSortableEvent:function(m){Ee({sortable:t,name:m,originalEvent:p})}},d))};function Ee(c){ig(Ue({putSortable:Se,cloneEl:pe,targetEl:K,rootEl:fe,oldIndex:$t,oldDraggableIndex:Yt,newIndex:Oe,newDraggableIndex:tt},c))}var K,ve,ne,fe,ft,mn,pe,nt,$t,Oe,Yt,tt,an,Se,St=!1,Mn=!1,_n=[],ht,Be,Ro,ko,Kc,qc,zt,Ct,Xt,Qt=!1,ln=!1,vn,Ae,Io=[],$s=!1,xn=[],Kn=typeof document<"u",cn=fh,Yc=nn||et?"cssFloat":"float",og=Kn&&!ph&&!fh&&"draggable"in document.createElement("div"),Sh=(function(){if(Kn){if(et)return!1;var c=document.createElement("x");return c.style.cssText="pointer-events:auto",c.style.pointerEvents==="auto"}})(),Ah=function(e,t){var n=te(e),p=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),d=Mt(e,0,t),g=Mt(e,1,t),m=d&&te(d),l=g&&te(g),f=m&&parseInt(m.marginLeft)+parseInt(m.marginRight)+we(d).width,r=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+we(g).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(d&&m.float&&m.float!=="none"){var o=m.float==="left"?"left":"right";return g&&(l.clear==="both"||l.clear===o)?"vertical":"horizontal"}return d&&(m.display==="block"||m.display==="flex"||m.display==="table"||m.display==="grid"||f>=p&&n[Yc]==="none"||g&&n[Yc]==="none"&&f+r>p)?"vertical":"horizontal"},sg=function(e,t,n){var p=n?e.left:e.top,d=n?e.right:e.bottom,g=n?e.width:e.height,m=n?t.left:t.top,l=n?t.right:t.bottom,f=n?t.width:t.height;return p===m||d===l||p+g/2===m+f/2},ag=function(e,t){var n;return _n.some(function(p){var d=p[Re].options.emptyInsertThreshold;if(!(!d||Vs(p))){var g=we(p),m=e>=g.left-d&&e<=g.right+d,l=t>=g.top-d&&t<=g.bottom+d;if(m&&l)return n=p}}),n},$h=function(e){function t(d,g){return function(m,l,f,r){var o=m.options.group.name&&l.options.group.name&&m.options.group.name===l.options.group.name;if(d==null&&(g||o))return!0;if(d==null||d===!1)return!1;if(g&&d==="clone")return d;if(typeof d=="function")return t(d(m,l,f,r),g)(m,l,f,r);var s=(g?m:l).options.group.name;return d===!0||typeof d=="string"&&d===s||d.join&&d.indexOf(s)>-1}}var n={},p=e.group;(!p||gn(p)!="object")&&(p={name:p}),n.name=p.name,n.checkPull=t(p.pull,!0),n.checkPut=t(p.put),n.revertClone=p.revertClone,e.group=n},Eh=function(){!Sh&&ne&&te(ne,"display","none")},Th=function(){!Sh&&ne&&te(ne,"display","")};Kn&&!ph&&document.addEventListener("click",function(c){if(Mn)return c.preventDefault(),c.stopPropagation&&c.stopPropagation(),c.stopImmediatePropagation&&c.stopImmediatePropagation(),Mn=!1,!1},!0);var dt=function(e){if(K){e=e.touches?e.touches[0]:e;var t=ag(e.clientX,e.clientY);if(t){var n={};for(var p in e)e.hasOwnProperty(p)&&(n[p]=e[p]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[Re]._onDragOver(n)}}},lg=function(e){K&&K.parentNode[Re]._isOutsideThisEl(e.target)};function ee(c,e){if(!(c&&c.nodeType&&c.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(c));this.el=c,this.options=e=Ze({},e),c[Re]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(c.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Ah(c,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(g,m){g.setData("Text",m.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:ee.supportPointer!==!1&&"PointerEvent"in window&&!Kt,emptyInsertThreshold:5};rn.initializePlugins(this,c,t);for(var n in t)!(n in e)&&(e[n]=t[n]);$h(e);for(var p in this)p.charAt(0)==="_"&&typeof this[p]=="function"&&(this[p]=this[p].bind(this));this.nativeDraggable=e.forceFallback?!1:og,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?oe(c,"pointerdown",this._onTapStart):(oe(c,"mousedown",this._onTapStart),oe(c,"touchstart",this._onTapStart)),this.nativeDraggable&&(oe(c,"dragover",this),oe(c,"dragenter",this)),_n.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Ze(this,eg())}ee.prototype={constructor:ee,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(Ct=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,K):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,p=this.options,d=p.preventOnFilter,g=e.type,m=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,l=(m||e).target,f=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,r=p.filter;if(mg(n),!K&&!(/mousedown|pointerdown/.test(g)&&e.button!==0||p.disabled)&&!f.isContentEditable&&!(!this.nativeDraggable&&Kt&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=He(l,p.draggable,n,!1),!(l&&l.animated)&&mn!==l)){if($t=Fe(l),Yt=Fe(l,p.draggable),typeof r=="function"){if(r.call(this,e,l,this)){Ee({sortable:t,rootEl:f,name:"filter",targetEl:l,toEl:n,fromEl:n}),xe("filter",t,{evt:e}),d&&e.cancelable&&e.preventDefault();return}}else if(r&&(r=r.split(",").some(function(o){if(o=He(f,o.trim(),n,!1),o)return Ee({sortable:t,rootEl:o,name:"filter",targetEl:l,fromEl:n,toEl:n}),xe("filter",t,{evt:e}),!0}),r)){d&&e.cancelable&&e.preventDefault();return}p.handle&&!He(f,p.handle,n,!1)||this._prepareDragStart(e,m,l)}}},_prepareDragStart:function(e,t,n){var p=this,d=p.el,g=p.options,m=d.ownerDocument,l;if(n&&!K&&n.parentNode===d){var f=we(n);if(fe=d,K=n,ve=K.parentNode,ft=K.nextSibling,mn=n,an=g.group,ee.dragged=K,ht={target:K,clientX:(t||e).clientX,clientY:(t||e).clientY},Kc=ht.clientX-f.left,qc=ht.clientY-f.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,K.style["will-change"]="all",l=function(){if(xe("delayEnded",p,{evt:e}),ee.eventCanceled){p._onDrop();return}p._disableDelayedDragEvents(),!jc&&p.nativeDraggable&&(K.draggable=!0),p._triggerDragStart(e,t),Ee({sortable:p,name:"choose",originalEvent:e}),Ie(K,g.chosenClass,!0)},g.ignore.split(",").forEach(function(r){vh(K,r.trim(),Oo)}),oe(m,"dragover",dt),oe(m,"mousemove",dt),oe(m,"touchmove",dt),oe(m,"mouseup",p._onDrop),oe(m,"touchend",p._onDrop),oe(m,"touchcancel",p._onDrop),jc&&this.nativeDraggable&&(this.options.touchStartThreshold=4,K.draggable=!0),xe("delayStart",this,{evt:e}),g.delay&&(!g.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(nn||et))){if(ee.eventCanceled){this._onDrop();return}oe(m,"mouseup",p._disableDelayedDrag),oe(m,"touchend",p._disableDelayedDrag),oe(m,"touchcancel",p._disableDelayedDrag),oe(m,"mousemove",p._delayedDragTouchMoveHandler),oe(m,"touchmove",p._delayedDragTouchMoveHandler),g.supportPointer&&oe(m,"pointermove",p._delayedDragTouchMoveHandler),p._dragStartTimer=setTimeout(l,g.delay)}else l()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){K&&Oo(K),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;re(e,"mouseup",this._disableDelayedDrag),re(e,"touchend",this._disableDelayedDrag),re(e,"touchcancel",this._disableDelayedDrag),re(e,"mousemove",this._delayedDragTouchMoveHandler),re(e,"touchmove",this._delayedDragTouchMoveHandler),re(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?oe(document,"pointermove",this._onTouchMove):t?oe(document,"touchmove",this._onTouchMove):oe(document,"mousemove",this._onTouchMove):(oe(K,"dragend",this),oe(fe,"dragstart",this._onDragStart));try{document.selection?yn(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(St=!1,fe&&K){xe("dragStarted",this,{evt:t}),this.nativeDraggable&&oe(document,"dragover",lg);var n=this.options;!e&&Ie(K,n.dragClass,!1),Ie(K,n.ghostClass,!0),ee.active=this,e&&this._appendGhost(),Ee({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(Be){this._lastX=Be.clientX,this._lastY=Be.clientY,Eh();for(var e=document.elementFromPoint(Be.clientX,Be.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Be.clientX,Be.clientY),e!==t);)t=e;if(K.parentNode[Re]._isOutsideThisEl(e),t)do{if(t[Re]){var n=void 0;if(n=t[Re]._onDragOver({clientX:Be.clientX,clientY:Be.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=mh(t));Th()}},_onTouchMove:function(e){if(ht){var t=this.options,n=t.fallbackTolerance,p=t.fallbackOffset,d=e.touches?e.touches[0]:e,g=ne&&Tt(ne,!0),m=ne&&g&&g.a,l=ne&&g&&g.d,f=cn&&Ae&&Vc(Ae),r=(d.clientX-ht.clientX+p.x)/(m||1)+(f?f[0]-Io[0]:0)/(m||1),o=(d.clientY-ht.clientY+p.y)/(l||1)+(f?f[1]-Io[1]:0)/(l||1);if(!ee.active&&!St){if(n&&Math.max(Math.abs(d.clientX-this._lastX),Math.abs(d.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(ne){g?(g.e+=r-(Ro||0),g.f+=o-(ko||0)):g={a:1,b:0,c:0,d:1,e:r,f:o};var s="matrix(".concat(g.a,",").concat(g.b,",").concat(g.c,",").concat(g.d,",").concat(g.e,",").concat(g.f,")");te(ne,"webkitTransform",s),te(ne,"mozTransform",s),te(ne,"msTransform",s),te(ne,"transform",s),Ro=r,ko=o,Be=d}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!ne){var e=this.options.fallbackOnBody?document.body:fe,t=we(K,!0,cn,!0,e),n=this.options;if(cn){for(Ae=e;te(Ae,"position")==="static"&&te(Ae,"transform")==="none"&&Ae!==document;)Ae=Ae.parentNode;Ae!==document.body&&Ae!==document.documentElement?(Ae===document&&(Ae=je()),t.top+=Ae.scrollTop,t.left+=Ae.scrollLeft):Ae=je(),Io=Vc(Ae)}ne=K.cloneNode(!0),Ie(ne,n.ghostClass,!1),Ie(ne,n.fallbackClass,!0),Ie(ne,n.dragClass,!0),te(ne,"transition",""),te(ne,"transform",""),te(ne,"box-sizing","border-box"),te(ne,"margin",0),te(ne,"top",t.top),te(ne,"left",t.left),te(ne,"width",t.width),te(ne,"height",t.height),te(ne,"opacity","0.8"),te(ne,"position",cn?"absolute":"fixed"),te(ne,"zIndex","100000"),te(ne,"pointerEvents","none"),ee.ghost=ne,e.appendChild(ne),te(ne,"transform-origin",Kc/parseInt(ne.style.width)*100+"% "+qc/parseInt(ne.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,p=e.dataTransfer,d=n.options;if(xe("dragStart",this,{evt:e}),ee.eventCanceled){this._onDrop();return}xe("setupClone",this),ee.eventCanceled||(pe=wh(K),pe.removeAttribute("id"),pe.draggable=!1,pe.style["will-change"]="",this._hideClone(),Ie(pe,this.options.chosenClass,!1),ee.clone=pe),n.cloneId=yn(function(){xe("clone",n),!ee.eventCanceled&&(n.options.removeCloneOnHide||fe.insertBefore(pe,K),n._hideClone(),Ee({sortable:n,name:"clone"}))}),!t&&Ie(K,d.dragClass,!0),t?(Mn=!0,n._loopId=setInterval(n._emulateDragOver,50)):(re(document,"mouseup",n._onDrop),re(document,"touchend",n._onDrop),re(document,"touchcancel",n._onDrop),p&&(p.effectAllowed="move",d.setData&&d.setData.call(n,p,K)),oe(document,"drop",n),te(K,"transform","translateZ(0)")),St=!0,n._dragStartId=yn(n._dragStarted.bind(n,t,e)),oe(document,"selectstart",n),zt=!0,Kt&&te(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,n=e.target,p,d,g,m=this.options,l=m.group,f=ee.active,r=an===l,o=m.sort,s=Se||f,a,i=this,u=!1;if($s)return;function h(O,D){xe(O,i,Ue({evt:e,isOwner:r,axis:a?"vertical":"horizontal",revert:g,dragRect:p,targetRect:d,canSort:o,fromSortable:s,target:n,completed:b,onMove:function(P,z){return un(fe,t,K,p,P,we(P),e,z)},changed:T},D))}function y(){h("dragOverAnimationCapture"),i.captureAnimationState(),i!==s&&s.captureAnimationState()}function b(O){return h("dragOverCompleted",{insertion:O}),O&&(r?f._hideClone():f._showClone(i),i!==s&&(Ie(K,Se?Se.options.ghostClass:f.options.ghostClass,!1),Ie(K,m.ghostClass,!0)),Se!==i&&i!==ee.active?Se=i:i===ee.active&&Se&&(Se=null),s===i&&(i._ignoreWhileAnimating=n),i.animateAll(function(){h("dragOverAnimationComplete"),i._ignoreWhileAnimating=null}),i!==s&&(s.animateAll(),s._ignoreWhileAnimating=null)),(n===K&&!K.animated||n===t&&!n.animated)&&(Ct=null),!m.dragoverBubble&&!e.rootEl&&n!==document&&(K.parentNode[Re]._isOutsideThisEl(e.target),!O&&dt(e)),!m.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),u=!0}function T(){Oe=Fe(K),tt=Fe(K,m.draggable),Ee({sortable:i,name:"change",toEl:t,newIndex:Oe,newDraggableIndex:tt,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=He(n,m.draggable,t,!0),h("dragOver"),ee.eventCanceled)return u;if(K.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||i._ignoreWhileAnimating===n)return b(!1);if(Mn=!1,f&&!m.disabled&&(r?o||(g=ve!==fe):Se===this||(this.lastPutMode=an.checkPull(this,f,K,e))&&l.checkPut(this,f,K,e))){if(a=this._getDirection(e,n)==="vertical",p=we(K),h("dragOverValid"),ee.eventCanceled)return u;if(g)return ve=fe,y(),this._hideClone(),h("revert"),ee.eventCanceled||(ft?fe.insertBefore(K,ft):fe.appendChild(K)),b(!0);var $=Vs(t,m.draggable);if(!$||dg(e,a,this)&&!$.animated){if($===K)return b(!1);if($&&t===e.target&&(n=$),n&&(d=we(n)),un(fe,t,K,p,n,d,e,!!n)!==!1)return y(),$&&$.nextSibling?t.insertBefore(K,$.nextSibling):t.appendChild(K),ve=t,T(),b(!0)}else if($&&hg(e,a,this)){var A=Mt(t,0,m,!0);if(A===K)return b(!1);if(n=A,d=we(n),un(fe,t,K,p,n,d,e,!1)!==!1)return y(),t.insertBefore(K,A),ve=t,T(),b(!0)}else if(n.parentNode===t){d=we(n);var S=0,M,R=K.parentNode!==t,L=!sg(K.animated&&K.toRect||p,n.animated&&n.toRect||d,a),_=a?"top":"left",I=Gc(n,"top","top")||Gc(K,"top","top"),w=I?I.scrollTop:void 0;Ct!==n&&(M=d[_],Qt=!1,ln=!L&&m.invertSwap||R),S=fg(e,n,d,a,L?1:m.swapThreshold,m.invertedSwapThreshold==null?m.swapThreshold:m.invertedSwapThreshold,ln,Ct===n);var v;if(S!==0){var C=Fe(K);do C-=S,v=ve.children[C];while(v&&(te(v,"display")==="none"||v===ne))}if(S===0||v===n)return b(!1);Ct=n,Xt=S;var E=n.nextElementSibling,x=!1;x=S===1;var k=un(fe,t,K,p,n,d,e,x);if(k!==!1)return(k===1||k===-1)&&(x=k===1),$s=!0,setTimeout(ug,30),y(),x&&!E?t.appendChild(K):n.parentNode.insertBefore(K,x?E:n),I&&bh(I,0,w-I.scrollTop),ve=K.parentNode,M!==void 0&&!ln&&(vn=Math.abs(M-we(n)[_])),T(),b(!0)}if(t.contains(K))return b(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){re(document,"mousemove",this._onTouchMove),re(document,"touchmove",this._onTouchMove),re(document,"pointermove",this._onTouchMove),re(document,"dragover",dt),re(document,"mousemove",dt),re(document,"touchmove",dt)},_offUpEvents:function(){var e=this.el.ownerDocument;re(e,"mouseup",this._onDrop),re(e,"touchend",this._onDrop),re(e,"pointerup",this._onDrop),re(e,"touchcancel",this._onDrop),re(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;if(Oe=Fe(K),tt=Fe(K,n.draggable),xe("drop",this,{evt:e}),ve=K&&K.parentNode,Oe=Fe(K),tt=Fe(K,n.draggable),ee.eventCanceled){this._nulling();return}St=!1,ln=!1,Qt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Es(this.cloneId),Es(this._dragStartId),this.nativeDraggable&&(re(document,"drop",this),re(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Kt&&te(document.body,"user-select",""),te(K,"transform",""),e&&(zt&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),ne&&ne.parentNode&&ne.parentNode.removeChild(ne),(fe===ve||Se&&Se.lastPutMode!=="clone")&&pe&&pe.parentNode&&pe.parentNode.removeChild(pe),K&&(this.nativeDraggable&&re(K,"dragend",this),Oo(K),K.style["will-change"]="",zt&&!St&&Ie(K,Se?Se.options.ghostClass:this.options.ghostClass,!1),Ie(K,this.options.chosenClass,!1),Ee({sortable:this,name:"unchoose",toEl:ve,newIndex:null,newDraggableIndex:null,originalEvent:e}),fe!==ve?(Oe>=0&&(Ee({rootEl:ve,name:"add",toEl:ve,fromEl:fe,originalEvent:e}),Ee({sortable:this,name:"remove",toEl:ve,originalEvent:e}),Ee({rootEl:ve,name:"sort",toEl:ve,fromEl:fe,originalEvent:e}),Ee({sortable:this,name:"sort",toEl:ve,originalEvent:e})),Se&&Se.save()):Oe!==$t&&Oe>=0&&(Ee({sortable:this,name:"update",toEl:ve,originalEvent:e}),Ee({sortable:this,name:"sort",toEl:ve,originalEvent:e})),ee.active&&((Oe==null||Oe===-1)&&(Oe=$t,tt=Yt),Ee({sortable:this,name:"end",toEl:ve,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){xe("nulling",this),fe=K=ve=ne=ft=pe=mn=nt=ht=Be=zt=Oe=tt=$t=Yt=Ct=Xt=Se=an=ee.dragged=ee.ghost=ee.clone=ee.active=null,xn.forEach(function(e){e.checked=!0}),xn.length=Ro=ko=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":K&&(this._onDragOver(e),cg(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,p=0,d=n.length,g=this.options;p<d;p++)t=n[p],He(t,g.draggable,this.el,!1)&&e.push(t.getAttribute(g.dataIdAttr)||gg(t));return e},sort:function(e,t){var n={},p=this.el;this.toArray().forEach(function(d,g){var m=p.children[g];He(m,this.options.draggable,p,!1)&&(n[d]=m)},this),t&&this.captureAnimationState(),e.forEach(function(d){n[d]&&(p.removeChild(n[d]),p.appendChild(n[d]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return He(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(t===void 0)return n[e];var p=rn.modifyOption(this,e,t);typeof p<"u"?n[e]=p:n[e]=t,e==="group"&&$h(n)},destroy:function(){xe("destroy",this);var e=this.el;e[Re]=null,re(e,"mousedown",this._onTapStart),re(e,"touchstart",this._onTapStart),re(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(re(e,"dragover",this),re(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),_n.splice(_n.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!nt){if(xe("hideClone",this),ee.eventCanceled)return;te(pe,"display","none"),this.options.removeCloneOnHide&&pe.parentNode&&pe.parentNode.removeChild(pe),nt=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(nt){if(xe("showClone",this),ee.eventCanceled)return;K.parentNode==fe&&!this.options.group.revertClone?fe.insertBefore(pe,K):ft?fe.insertBefore(pe,ft):fe.appendChild(pe),this.options.group.revertClone&&this.animate(K,pe),te(pe,"display",""),nt=!1}}};function cg(c){c.dataTransfer&&(c.dataTransfer.dropEffect="move"),c.cancelable&&c.preventDefault()}function un(c,e,t,n,p,d,g,m){var l,f=c[Re],r=f.options.onMove,o;return window.CustomEvent&&!et&&!nn?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=e,l.from=c,l.dragged=t,l.draggedRect=n,l.related=p||e,l.relatedRect=d||we(e),l.willInsertAfter=m,l.originalEvent=g,c.dispatchEvent(l),r&&(o=r.call(f,l,g)),o}function Oo(c){c.draggable=!1}function ug(){$s=!1}function hg(c,e,t){var n=we(Mt(t.el,0,t.options,!0)),p=Ch(t.el,t.options,ne),d=10;return e?c.clientX<p.left-d||c.clientY<n.top&&c.clientX<n.right:c.clientY<p.top-d||c.clientY<n.bottom&&c.clientX<n.left}function dg(c,e,t){var n=we(Vs(t.el,t.options.draggable)),p=Ch(t.el,t.options,ne),d=10;return e?c.clientX>p.right+d||c.clientY>n.bottom&&c.clientX>n.left:c.clientY>p.bottom+d||c.clientX>n.right&&c.clientY>n.top}function fg(c,e,t,n,p,d,g,m){var l=n?c.clientY:c.clientX,f=n?t.height:t.width,r=n?t.top:t.left,o=n?t.bottom:t.right,s=!1;if(!g){if(m&&vn<f*p){if(!Qt&&(Xt===1?l>r+f*d/2:l<o-f*d/2)&&(Qt=!0),Qt)s=!0;else if(Xt===1?l<r+vn:l>o-vn)return-Xt}else if(l>r+f*(1-p)/2&&l<o-f*(1-p)/2)return pg(e)}return s=s||g,s&&(l<r+f*d/2||l>o-f*d/2)?l>r+f/2?1:-1:0}function pg(c){return Fe(K)<Fe(c)?1:-1}function gg(c){for(var e=c.tagName+c.className+c.src+c.href+c.textContent,t=e.length,n=0;t--;)n+=e.charCodeAt(t);return n.toString(36)}function mg(c){xn.length=0;for(var e=c.getElementsByTagName("input"),t=e.length;t--;){var n=e[t];n.checked&&xn.push(n)}}function yn(c){return setTimeout(c,0)}function Es(c){return clearTimeout(c)}Kn&&oe(document,"touchmove",function(c){(ee.active||St)&&c.cancelable&&c.preventDefault()});ee.utils={on:oe,off:re,css:te,find:vh,is:function(e,t){return!!He(e,t,e,!1)},extend:Zp,throttle:yh,closest:He,toggleClass:Ie,clone:wh,index:Fe,nextTick:yn,cancelNextTick:Es,detectDirection:Ah,getChild:Mt,expando:Re};ee.get=function(c){return c[Re]};ee.mount=function(){for(var c=arguments.length,e=new Array(c),t=0;t<c;t++)e[t]=arguments[t];e[0].constructor===Array&&(e=e[0]),e.forEach(function(n){if(!n.prototype||!n.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));n.utils&&(ee.utils=Ue(Ue({},ee.utils),n.utils)),rn.mount(n)})};ee.create=function(c,e){return new ee(c,e)};ee.version=Xp;var be=[],jt,Ts,Ms=!1,Do,No,Ln,Ut;function vg(){function c(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return c.prototype={dragStarted:function(t){var n=t.originalEvent;this.sortable.nativeDraggable?oe(document,"dragover",this._handleAutoScroll):this.options.supportPointer?oe(document,"pointermove",this._handleFallbackAutoScroll):n.touches?oe(document,"touchmove",this._handleFallbackAutoScroll):oe(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var n=t.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?re(document,"dragover",this._handleAutoScroll):(re(document,"pointermove",this._handleFallbackAutoScroll),re(document,"touchmove",this._handleFallbackAutoScroll),re(document,"mousemove",this._handleFallbackAutoScroll)),Xc(),bn(),Jp()},nulling:function(){Ln=Ts=jt=Ms=Ut=Do=No=null,be.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,n){var p=this,d=(t.touches?t.touches[0]:t).clientX,g=(t.touches?t.touches[0]:t).clientY,m=document.elementFromPoint(d,g);if(Ln=t,n||this.options.forceAutoScrollFallback||nn||et||Kt){Fo(t,this.options,m,n);var l=it(m,!0);Ms&&(!Ut||d!==Do||g!==No)&&(Ut&&Xc(),Ut=setInterval(function(){var f=it(document.elementFromPoint(d,g),!0);f!==l&&(l=f,bn()),Fo(t,p.options,f,n)},10),Do=d,No=g)}else{if(!this.options.bubbleScroll||it(m,!0)===je()){bn();return}Fo(t,this.options,it(m,!1),!1)}}},Ze(c,{pluginName:"scroll",initializeByDefault:!0})}function bn(){be.forEach(function(c){clearInterval(c.pid)}),be=[]}function Xc(){clearInterval(Ut)}var Fo=yh(function(c,e,t,n){if(e.scroll){var p=(c.touches?c.touches[0]:c).clientX,d=(c.touches?c.touches[0]:c).clientY,g=e.scrollSensitivity,m=e.scrollSpeed,l=je(),f=!1,r;Ts!==t&&(Ts=t,bn(),jt=e.scroll,r=e.scrollFn,jt===!0&&(jt=it(t,!0)));var o=0,s=jt;do{var a=s,i=we(a),u=i.top,h=i.bottom,y=i.left,b=i.right,T=i.width,$=i.height,A=void 0,S=void 0,M=a.scrollWidth,R=a.scrollHeight,L=te(a),_=a.scrollLeft,I=a.scrollTop;a===l?(A=T<M&&(L.overflowX==="auto"||L.overflowX==="scroll"||L.overflowX==="visible"),S=$<R&&(L.overflowY==="auto"||L.overflowY==="scroll"||L.overflowY==="visible")):(A=T<M&&(L.overflowX==="auto"||L.overflowX==="scroll"),S=$<R&&(L.overflowY==="auto"||L.overflowY==="scroll"));var w=A&&(Math.abs(b-p)<=g&&_+T<M)-(Math.abs(y-p)<=g&&!!_),v=S&&(Math.abs(h-d)<=g&&I+$<R)-(Math.abs(u-d)<=g&&!!I);if(!be[o])for(var C=0;C<=o;C++)be[C]||(be[C]={});(be[o].vx!=w||be[o].vy!=v||be[o].el!==a)&&(be[o].el=a,be[o].vx=w,be[o].vy=v,clearInterval(be[o].pid),(w!=0||v!=0)&&(f=!0,be[o].pid=setInterval((function(){n&&this.layer===0&&ee.active._onTouchMove(Ln);var E=be[this.layer].vy?be[this.layer].vy*m:0,x=be[this.layer].vx?be[this.layer].vx*m:0;typeof r=="function"&&r.call(ee.dragged.parentNode[Re],x,E,c,Ln,be[this.layer].el)!=="continue"||bh(be[this.layer].el,x,E)}).bind({layer:o}),24))),o++}while(e.bubbleScroll&&s!==l&&(s=it(s,!1)));Ms=f}},30),Mh=function(e){var t=e.originalEvent,n=e.putSortable,p=e.dragEl,d=e.activeSortable,g=e.dispatchSortableEvent,m=e.hideGhostForTarget,l=e.unhideGhostForTarget;if(t){var f=n||d;m();var r=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,o=document.elementFromPoint(r.clientX,r.clientY);l(),f&&!f.el.contains(o)&&(g("spill"),this.onSpill({dragEl:p,putSortable:n}))}};function Ks(){}Ks.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var p=Mt(this.sortable.el,this.startIndex,this.options);p?this.sortable.el.insertBefore(t,p):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:Mh};Ze(Ks,{pluginName:"revertOnSpill"});function qs(){}qs.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable,p=n||this.sortable;p.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),p.animateAll()},drop:Mh};Ze(qs,{pluginName:"removeOnSpill"});ee.mount(new vg);ee.mount(qs,Ks);const $e={getStyle:(c,e=!1)=>{let t;return window.getComputedStyle?t=window.getComputedStyle(c,null):c.currentStyle&&(t=c.currentStyle),e?t[e]:t},fadeOut:(c,e=250)=>{const t=1/(e/60);c.style.opacity=1,(function n(){const p=Number(c.style.opacity)-t;p>0?(c.style.opacity=p,window.requestAnimationFrame(n)):c.remove()})()},slideDown:(c,e=250,t=!1)=>{c.style.display="block";const n=$e.getStyle(c),p=Number.parseInt(n.height,10),d=p/(e/60);c.style.height="0px",(function g(){const m=Number.parseFloat(c.style.height),l=m+d;m<p?(c.style.height=`${l}px`,window.requestAnimationFrame(g)):(c.style.height="auto",t&&t(c))})()},slideUp:(c,e=250,t=!1)=>{const n=$e.getStyle(c),p=Number.parseInt(n.height,10),d=n.overflow;c.style.overflow="hidden",c.style.height=`${p}px`;const g=n.minHeight;c.style.minHeight="auto";const m=parseFloat(p/(e/60)).toFixed(2);(function l(){const r=Number.parseInt(c.style.height,10)-m;r>0?(c.style.height=`${r}px`,window.requestAnimationFrame(l)):(c.style.overflow=d,c.style.display="none",c.style.minHeight=g,delete c.style.height,t&&t(c))})()},slideToggle:(c,e=250,t=$e.getStyle(c,"display")==="none")=>{t?$e.slideDown(c,e):$e.slideUp(c,e)}},_h=c=>Number.isInteger(Number(c)),at=c=>{let e=0,t=c;for(;t?.previousElementSibling;)t=t.previousElementSibling,e++;return e},Rn=(c,e,t)=>{const n=t.split("||"),d=pt(e).map(g=>c.find(m=>{const l=n.find(f=>!!De(m,f));return l&&De(m,l)===g})).filter(Boolean).concat(c);return pt(d)},qn=(c,e,t)=>{for(let n=0;n<c.length;n++)e.call(t,c[n],n)},Ys=(c,e)=>{const t=[];return qn(c,(n,p)=>t.push(e(n,p))),t},Po={},xh=c=>{const e={className:"class"};if(Po[c])return Po[c];const n=(e[c]||c).replace(/^\d+/,"").replace(/[^a-zA-Z0-9-:]/g,"");return Po[c]=n,n},Lh=c=>c.replace(/\b\w/g,e=>e.toUpperCase()),yg=c=>window.JSON.parse(window.JSON.stringify(c)),bg=(c,e)=>e.filter(t=>!~c.indexOf(t)),Rh=()=>window.navigator.userAgent.indexOf("MSIE ")!==-1,Ne={capitalize:Lh,safeAttrName:xh,forEach:qn,copyObj:yg,map:Ys,subtract:bg,indexOfNode:at,isInt:_h,get:De,orderObjectsBy:Rn,isIE:Rh},wg={glyphicons:c=>`<span class="glyphicon glyphicon-${c}" aria-hidden="true"></span>`,"font-awesome":c=>{const[e,t]=c.split(" ");return`<i class="${e} fa-${t}"></i>`},fontello:c=>`<i class="${lh}${c}">${c}</i>`},Cg=new Set(["input","textarea","select"]),Sg=(c={})=>{let e=c?.attrs?.name||c?.name;if(e)return e;const t=We(c);let n=c.config?.label||c.attrs?.label||c?.label;return n&&(typeof n=="object"&&(n=U.create(n).textContent),/^<.+>.+<.+>$/gim.test(n)&&(n=np(n)),e=`${t}-${ch(ip(n,24,null))}`),e||t};class Ag{constructor(e=Object.create(null)){this.options=e}set setOptions(e){this.options=ze(this.options,e)}processElemArg(e){let t=e,n;if(typeof t=="string")return n=t,t={tag:n},t;if(t.attrs){const{tag:p,...d}=t.attrs;p&&(typeof p=="string"?n=p:n=(p.find(m=>m.selected===!0)||p[0]).value),t.attrs=d}return t.tag=n||t.tag||"div",t}render=e=>(e.id=`f-${e.id||We()}`,this.create(e));create=(e,t=!1)=>{if(!e)return;if(this.isDOMElement(e))return e;const n=this,p=["children","content"],{className:d,options:g,dataset:m,...l}=this.processElemArg(e);p.push("tag");let f;const{tag:r}=l;let o;const s={attrs:{},className:[Ne.get(l,"config.inputWrap")],children:[],config:{}};let a=document.createElement(r);const i={string:h=>{a.innerHTML+=h},object:h=>h&&a.appendChild(n.create(h,t)),node:h=>a.appendChild(h),component:h=>a.appendChild(h.dom),array:h=>{for(const y of h)f=n.childType(y),i[f](y)},function:h=>{h=h(),f=n.childType(h),i[f](h)},undefined:()=>null,boolean:()=>null};if(d&&(l.attrs=ze(l.attrs,{className:d})),g){const h=this.processOptions(g,l,t);if(this.holdsContent(a)&&r!=="button")i.array.call(this,h),l.content=void 0;else return Ne.forEach(h,y=>{s.children.push(n.create(y,t))}),l.attrs.className&&(s.className=l.attrs.className),s.id=l.id,s.config={...l.config},this.create(s,t);p.push("options")}if(l.attrs&&(n.processAttrs(l,a,t),p.push("attrs")),l.config){if(l.config.label&&(l.config.label&&r!=="button"||["radio","checkbox"].includes(Ne.get(l,"attrs.type")))&&!t){const h=n.label(l);if(!l.config.hideLabel){const y=[h,a];n.labelAfter(l)&&y.reverse(),s.children.push(y)}}p.push("config")}if(l.content||l.children){const h=l.content||l.children;f=n.childType(h),i[f]||console.error(`childType: ${f} is not supported`),i[f].call(this,h)}if(m){for(const h in m)Object.hasOwn(m,h)&&(a.dataset[h]=typeof m[h]=="function"?m[h]():m[h]);p.push("dataset")}l.action&&(this.actionHandler(a,l.action),p.push("action"));const u=Ne.subtract(p,Object.keys(l));for(o=u.length-1;o>=0;o--)a[u[o]]=l[u[o]];return s.children.length&&(a=this.create(s)),a};onRender=(e,t,n=Ke)=>{const p=Date.now(),d=()=>{!e.parentElement&&Date.now()-p<n?window.requestAnimationFrame(d):e.parentElement&&t(e)};d()};actionHandler(e,t){const n={onRender:U.onRender,render:U.onRender},p=["focus","blur"],d=g=>(m,l)=>m.addEventListener(g,l,p.includes(g));return Object.entries(t).map(([g,m])=>(Array.isArray(m)?m:[m]).map(f=>(n[g]||d(g))(e,f)))}get icons(){if(this.iconSymbols)return this.iconSymbols;const e=document.querySelectorAll(`#${ot} svg symbol`),t=n=>({tag:"svg",attrs:{className:["svg-icon",n]},children:[{tag:"use",attrs:{"xmlns:xlink":"http://www.w3.org/1999/xlink","xlink:href":`#${n}`}}]});return this.iconSymbols=Array.from(e).reduce((n,p)=>{const d=p.id.replace(lh,"");return n[d]=t(p.id),n},{}),this.cachedIcons={},this.iconSymbols}icon(e,t){if(!e)return;const n=`${e}?${new URLSearchParams(t).toString()}`;if(this.cachedIcons?.[n])return this.cachedIcons[n];const p=this.icons[e];if(p){if(t){const d=ze(p,t);return this.cachedIcons[n]=U.create(d).outerHTML,this.cachedIcons[n]}return this.cachedIcons[n]=U.create(p).outerHTML,this.cachedIcons[n]}return wg[U.options.iconFont]?.(e)||e}processAttrs(e,t,n){const{attrs:p={}}=e;if(!n&&!p.name&&p.name!==null&&this.isInput(e.tag)){const d=Sg(e);d&&t.setAttribute("name",d)}for(const d of Object.keys(p)){const g=Ne.safeAttrName(d),m=this.processAttrValue(p[d]);m!==!1&&t.setAttribute(g,m)}}processAttrValue(e){if(typeof e=="function")return e();if(typeof e=="boolean")return e&&"";let t=e||"";if(Array.isArray(t))if(typeof t[0]=="object"){const n=t.filter(p=>p.selected===!0);t=n.length?n[0].value:t[0].value}else t=t.join(" ");return t}toggleElementsByStr=(e,t)=>{const n=[],p=(d,g)=>{g?(d.style.display="block",n.push(d)):d.style.display="none"};return U.elementsContainText(e,t,p),n};elementsContainText=(e,t,n)=>{const p=[];return qn(e,d=>{const m=d.textContent.toLowerCase().indexOf(t.toLowerCase())!==-1;n?.(d,m),m&&p.push(d)}),p};generateOption=({type:e="option",label:t,value:n,i:p=0,selected:d})=>({tag:e==="option"?"option":"input",attrs:{type:e,value:n||`${e}-${p}`,[e==="option"?"selected":"checked"]:d||!p},config:{label:t||Q.get("labelCount",{label:Q.get("option"),count:p})}});processOptions(e,t,n){const{action:p,attrs:d={}}=t,g=d.type||t.tag,m=d.id||t.id,l=(r,o)=>{const{label:s,value:a,...i}=r,u=()=>{const y={tag:"input",attrs:{name:m,type:g,value:a||"",id:`${m}-${o}`,...i},action:p},b={tag:"label",attrs:{for:`${m}-${o}`},children:s},T={children:[y,b],className:[`f-${g}`]};return d.className&&(t.config.inputWrap=d.className),t.config.inline&&T.className.push(`f-${g}-inline`),r.selected&&(y.attrs.checked=!0),n&&(b.attrs.contenteditable=!0),T};return{select:()=>{const y=r.attrs||r,b={attrs:y,...r,...y},{label:T,checked:$,selected:A,attrs:S}=b;return{tag:"option",attrs:{...S,selected:!!($||A)},children:T}},button:y=>{const{type:b,label:T,className:$,id:A}=y;return{...t,attrs:{type:b},className:$,id:A||We(),options:void 0,children:T,action:t.action}},checkbox:u,radio:u}[g]?.(r)};return e.map(l)}holdsContent(e){return e.outerHTML.indexOf("/")!==-1}isBlockInput(e){return!this.isInput(e)&&this.holdsContent(e)}isInput(e){let t=e;return typeof t!="string"&&(t=t.tagName),Cg.has(t)}parsedHtml(e){const t=document.createElement("textarea");return t.innerHTML=e,t.textContent}labelAfter(e){const t=Ne.get(e,"attrs.type"),n=Ne.get(e,"config.labelAfter");return n!==void 0?n:t==="checkbox"||t==="radio"}requiredMark=()=>({tag:"span",className:"text-error",children:"*"});label(e,t){const n=Ne.get(e,"attrs.required");let{config:{label:p=""}}=e;const{id:d,attrs:g}=e;typeof p=="function"&&(p=p());const m={tag:"label",attrs:{for:d||g?.id},className:[],children:[p,n&&this.requiredMark()],action:{}};return t&&(m.attrs.for=void 0,m.attrs.contenteditable=!0,m.fMap=t),m}childType(e){return e===void 0?e:[["array",t=>Array.isArray(t)],["node",t=>t instanceof window.Node||t instanceof window.HTMLElement],["component",()=>e?.dom],[typeof e,()=>!0]].find(t=>t[1](e))[0]}getStyle(e,t=!1){let n;return window.getComputedStyle?n=window.getComputedStyle(e,null):e.currentStyle&&(n=e.currentStyle),t?n[t]:n}getElement(e){const t={node:()=>e,object:()=>document.getElementById(e.id),string:()=>document.getElementById(e)},n=this.childType(e);return t[n]()}empty(e){for(;e.firstChild;)this.remove(e.firstChild);return e}removeEmpty=e=>{const t=e.parentElement,n=Le(e),p=t.getElementsByClassName(`formeo-${n}`);if(this.remove(e),!p.length)return this.isStage(t)?this.emptyClass(t):this.removeEmpty(t)};remove(e){const t=Le(e);return t?ce.remove(`${t}s.${e.id}`):e.parentElement.removeChild(e)}removeClasses(e,t){const n={string:p=>p.classList.remove(t),array:p=>{for(const d of t)p.classList.remove(d)}};n.object=n.string,Ne.forEach(e,n[this.childType(t)])}addClasses(e,t){const n={string:p=>p.classList.add(t),array:p=>{for(const d of t)p.classList.add(d)}};Ne.forEach(e,n[this.childType(t)])}formGroup(e,t=""){return{className:["f-field-group",t],children:e}}coords(e){const t=e.getBoundingClientRect(),n=document.body.getBoundingClientRect();return{pageX:t.left+t.width/2,pageY:t.top-n.top-t.height/2}}clearStage(e){e.classList.add("removing-all-fields");const t=()=>{U.empty(e),e.classList.remove("removing-all-fields"),U.emptyClass(e),$e.slideDown(e,300)};$e.slideUp(e,600,t)}toggleSortable(e,t){let n=t;const p=Le(e);if(!p)return;const d=Le(e.parentElement),g=U[p].get(e.id).sortable;n||(n=!g.option("disabled")),g.option("disabled",n),d&&["rows","columns","stages"].includes(d)&&this.toggleSortable(e.parentElement,n)}emptyClass(e){const t=e.getElementsByClassName(Mf.get(e.classList.item(0)));e.classList.toggle("empty",!t.length)}btnTemplate=({title:e="",...t})=>({tag:"button",attrs:{type:"button",title:e},...t});isControls=e=>Le(e)===rt;isStage=e=>Le(e)===kt;isRow=e=>Le(e)===Xe;isColumn=e=>Le(e)===Qe;isField=e=>Le(e)===It;asComponent=e=>ce[`${Le(e)}s`].get(e.id);isDOMElement(e){return e instanceof window.Element||e instanceof window.HTMLElement||!!(e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string")}}const U=new Ag,$g="modulepreload",Eg=function(c){return"/formeo/"+c},Qc={},At=function(e,t,n){let p=Promise.resolve();if(t&&t.length>0){let l=function(f){return Promise.all(f.map(r=>Promise.resolve(r).then(o=>({status:"fulfilled",value:o}),o=>({status:"rejected",reason:o}))))};document.getElementsByTagName("link");const g=document.querySelector("meta[property=csp-nonce]"),m=g?.nonce||g?.getAttribute("nonce");p=l(t.map(f=>{if(f=Eg(f),f in Qc)return;Qc[f]=!0;const r=f.endsWith(".css"),o=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${o}`))return;const s=document.createElement("link");if(s.rel=r?"stylesheet":$g,r||(s.as="script"),s.crossOrigin="",s.href=f,m&&s.setAttribute("nonce",m),document.head.appendChild(s),r)return new Promise((a,i)=>{s.addEventListener("load",a),s.addEventListener("error",()=>i(new Error(`Unable to preload CSS for ${f}`)))})}))}function d(g){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=g,window.dispatchEvent(m),!m.defaultPrevented)throw g}return p.then(g=>{for(const m of g||[])m.status==="rejected"&&d(m.reason);return e().catch(d)})},Et="f-autocomplete",Tg=`${Et}-display-field`,Xs=`${Et}-list`,Nt="highlight-component",kn=`${Xs}-item`,Mg=(c,e)=>{const t=c.reduce((n,p)=>n+(p===e),0);return t>1?`(${t})`:""},kh=["config.label","config.controlId"],_g=["config.legend","name"],xg=[...kh,..._g],Wo=c=>kh.reduce((e,t)=>e||c.get(t),null),Zc=c=>xg.reduce((e,t)=>e||c.get(t),null)||st(c.name),Lg=new Map([["condition.source",Wo],["if.condition.source",Wo],["if.condition.target",Wo],["then.condition.target",Zc],["condition.target",Zc]]),Ih=({id:c,...e},t)=>{const{name:n,label:p}=e;return n?Lg.get(t)(e):p},Rg=({selectedId:c,...e})=>(e.value===c&&(e.selected=!0),e),Bo=c=>(c.classList.contains(kn)||(c=c.parentElement),c),Oh=({value:c,textLabel:e,htmlLabel:t,componentType:n,depth:p=0},d)=>{const g={tag:"li",children:t,dataset:{value:c,label:e},className:[kn,`${kn}-depth-${p}`,`component-type-${n}`],action:{mousedown:({target:m})=>{m=Bo(m),d.setValue(m),d.selectOption(m),d.hideList()},mouseover:({target:m})=>{m=Bo(m),d.removeHighlight(),d.highlightComponent(m)},mouseleave:({target:m})=>{m=Bo(m),d.removeHighlight()}}};return U.create(g)},kg=(c,e)=>{const t=c.data.options.map((p,d)=>{const g=`${c.address}.options[${d}]`,m=p.label,l=p.label;return Oh({value:g,textLabel:m,htmlLabel:l,componentType:"option",depth:1},e)});return U.create({tag:"ul",attrs:{className:[Xs,"options-list"]},children:t})},Ig=c=>{const e=c.value,t=[],n=ce.flatList();return Object.entries(n).reduce((d,[g,m])=>{const l=Ih(m,c.key);if(l){const f=m.name,r={tag:"span",content:` ${st(f)}`,className:"component-type"},o=`${f}.${l}`;t.push(o);const s=Mg(t,o),a={tag:"span",content:s,className:"component-label-count"},i=[`${l} `,a,r],u=[l,s].join(" ").trim();if(m.isCheckable){const y=kg(m,c);i.push(y)}const h=Rg({value:g,textLabel:u,htmlLabel:i,componentType:f,selectedId:e});d.push(Oh(h,c))}return d},[])};class Og{lastCache=Date.now();optionsCache=null;constructor({key:e,value:t,className:n,onChange:p=ws}){this.key=e,this.className=[n||this.key.replace(/\./g,"-")].flat(),this.value=t,this.onChange=p||ws,this.events=[],this.build()}createProxy(){return new Proxy(this,{get(e,t){if(t in e)return e[t];if(t in e.dom){const n=e.dom[t];return typeof n=="function"?n.bind(e.dom):n}},set(e,t,n){return t in e?e[t]=n:e.dom[t]=n,!0}})}get isAddress(){return Pe(this.value)}get valueComponent(){return Pe(this.value)&&ce.getAddress(this.value)}build(){const e=n=>{const p=this.list,d=this.getActiveOption();let m=new Map([[38,()=>{const l=this.getPreviousOption(d);l&&this.selectOption(l)}],[40,()=>{const l=this.getNextOption(d);l&&this.selectOption(l)}],[13,()=>{d&&(this.selectOption(d),this.setValue(d),p.style.display==="none"?this.showList(d):this.hideList()),n.preventDefault()}],[27,()=>{this.hideList()}]]).get(n.keyCode);return m||(m=()=>!1),m()},t={focus:({target:n})=>{this.updateOptions(),n.parentElement.classList.add(`${Et}-focused`);const p=U.toggleElementsByStr(this.list.querySelectorAll(`.${kn}-depth-0`),n.value);n.addEventListener("keydown",e);const d=this.list.querySelector(".active-option")||p[0];this.showList(d)},blur:({target:n})=>{n.parentElement.classList.remove(`${Et}-focused`),n.removeEventListener("keydown",e),this.hideList()},input:n=>{const{value:p}=n.target,d=U.toggleElementsByStr(this.list.querySelectorAll("li"),p);if(p.length===0&&this.clearValue(),d.length===0)this.hideList();else{const g=this.getActiveOption()||d[0];this.showList(g)}this.setValue({dataset:{label:p,value:p}})}};return this.displayField=U.create({tag:"input",autocomplete:"off",action:t,attrs:{type:"text",className:Tg,value:this.label||this.value,placeholder:Q.get(`${this.key}.placeholder`)}}),this.hiddenField=U.create({tag:"input",attrs:{type:"hidden",className:Et,value:this.value}}),this.list=U.create({tag:"ul",attrs:{className:Xs}}),this.clearButton=U.create({tag:"span",content:U.icon("remove"),className:"clear-button hidden",action:{click:()=>this.clearValue()}}),this.dom=U.create({children:[this.displayField,this.clearButton,this.hiddenField],className:[Et,this.className].flat(),action:{onRender:n=>{this.stage=n.closest(".formeo-stage"),this.value&&(this.displayField.value=this.label),this.clearButton.classList.toggle("hidden",!this.value.length)}}}),this.dom}get label(){if(!Pe(this.value))return this.value;const e=this.value&&ce.getAddress(this.value);return e&&Ih(e,`${this.key}`)||this.value}updateOptions(){let e=this.optionsCache;const t=Date.now();(t-this.lastCache>zs*5||!e)&&(U.empty(this.list),e=this.generateOptions(),this.lastCache=t),this.list.children.length||this.list.append(...e)}generateOptions(){return this.optionsCache=Ig(this),this.optionsCache}setListPosition(){const{offsetHeight:e,offsetWidth:t}=this.displayField,n=this.displayField.closest(".formeo-stage").getBoundingClientRect(),p=this.displayField.getBoundingClientRect(),d={position:"absolute",top:`${p.y+e-n.y}px`,left:`${p.x+window.scrollX-n.x+2}px`,width:`${t}px`};Object.assign(this.list.style,d)}showList(e,t=this.list){this.stage.contains(this.list)||this.stage.appendChild(this.list),this.setListPosition(),this.selectOption(e),$e.slideDown(t,gt)}hideList(e=this.list){$e.slideUp(e,gt),this.removeHighlight(),this.stage.contains(this.list)&&this.stage.removeChild(this.list)}getActiveOption(e=this.list){const t=e.querySelector(".active-option");return t?.style.display!=="none"?t:null}getPreviousOption(e){let t=e;do t=t?t.previousSibling:null;while(t!=null&&t.style.display==="none");return t}getNextOption(e){let t=e;do t=t?t.nextSibling:null;while(t!=null&&t.style.display==="none");return t}selectOption(e,t=this.list){const n=t.querySelectorAll("li");for(const p of n){const{dataset:{value:d}}=p;p.classList.remove("active-option"),Pe(d)&&ce.getAddress(d)?.dom?.classList.remove(Nt)}e&&(e.classList.add("active-option"),this.highlightComponent(e))}removeHighlight(){const e=document.getElementsByClassName(Nt);for(const t of e)t.classList.remove(Nt)}highlightComponent(e){const{dataset:{value:t}}=e;if(Pe(t)){const{componentAddress:n,isOptionAddress:p,optionIndex:d}=mt(t).reduce((m,l)=>l==="options"?(m.isOptionAddress=!0,m):m.isOptionAddress?(m.optionIndex=+l,m):(m.componentAddress.push(l),m),{componentAddress:[],optionIndex:null,isOptionAddress:!1}),g=ce.getAddress(n);g?.dom&&(g.dom.classList.add(Nt),p&&g.dom.querySelectorAll(".field-preview .f-checkbox, .field-preview .f-radio")[d]?.classList.add(Nt))}}clearValue(){this.selectOption(null),this.setValue({dataset:{label:"",value:""}}),this.displayField.focus()}setValue(e){const{label:t,value:n}=e.dataset;this.displayField.value=t,this.hiddenField.value=n,this.value=n,this.clearButton.classList.toggle("hidden",!n.length),this.onChange?.({target:this.hiddenField})}}function Ho({key:c,value:e,type:t="text",checked:n}){const p={tag:"input",attrs:{type:t,value:e,placeholder:Q.get(`${c}.placeholder`)||st(c)},className:[c.replace(/\./g,"-")],config:{}};return n&&(p.attrs.checked=!0),p}function Dh(c){const e=Q.get(c);if(e)return e;const t=c.split(".");return Q.get(t[t.length-1])}const _t={autocomplete:(...c)=>new Og(...c).createProxy(),string:({key:c,value:e})=>Ho({key:c,value:e}),boolean:({key:c,value:e})=>Ho({key:c,value:e,type:c==="selected"?"radio":"checkbox",checked:!!e}),number:({key:c,value:e})=>Ho({key:c,value:e,type:"number"}),array:({key:c,value:e})=>({tag:"select",attrs:{placeholder:Dh(`placeholder.${c}`)},className:[c.replace(/\./g,"-")],options:e}),object:c=>Object.entries(c).map(([e,t])=>_t[U.childType(t)]({key:e,value:t}))},Dg={boolean:(c,e)=>({click:({target:t})=>{if(t.type==="radio"){const n=e.data.options.map(p=>({...p,selected:!1}));e.set("options",n)}e.set(c,t.checked),e.updatePreview()}}),string:(c,e)=>({input:({target:{value:t}})=>{e.set(c,t),e.debouncedUpdatePreview()}}),number:(c,e)=>({input:({target:{value:t}})=>{e.set(c,Number(t)),e.debouncedUpdatePreview()}}),array:(c,e)=>({change:({target:{value:t}})=>{e.set(c,t),e.debouncedUpdatePreview()}}),object:()=>({})},Nh="hidden-property",Ng="hidden-option",zo=/\.options\[\d+\]$/,Fg={"if-sourceProperty":pn(fn,Zl,Jl),"if-targetProperty":pn(fn),"then-targetProperty":pn(fn,Zl,Jl),...Object.entries(Yf).reduce((c,[e,t])=>(c[`if-${e}`]=t,c[`then-${e}`]=t,c),{})},Fh={assignment:Ft,comparison:Ft,logical:Ft,source:({key:c,value:e,onChange:t,conditionType:n})=>_t.autocomplete({key:`${n}.condition.${c}`,value:e,onChange:t,className:`condition-${c}`}),sourceProperty:Ft,targetProperty:Ft,target:c=>Fh.source(c),value:({key:c,value:e,onChange:t},n)=>{const p=_t.string({key:`condition.${c}`,value:e});return p.action={input:t},p}};function Pg({key:c,value:e,conditionType:t}){const n=`${t}-${c}`,p=Fg[n];return Object.entries(p||{}).map(([d,g])=>Wg({fieldName:c,fieldValue:e,key:d,optionValue:g}))}function Wg({fieldName:c,fieldValue:e,key:t,optionValue:n}){return{label:Q.get(`${c}.${t}`)||st(t).toLowerCase(),value:n,selected:n===e}}function Ft({key:c,value:e,onChange:t,conditionType:n}){const p=Pg({key:c,value:e,conditionType:n}),d=_t.array({key:`condition.${c}`,value:p});return d.action={change:t},d}const Bg=c=>!c?.classList.contains(Nh),Hg={sourceProperty:c=>{const e=c.get("source"),t=c.get("sourceProperty"),n=!!e.value,p=!!e.value.match(zo);return eu(p,t),!n},comparison:c=>{const e=c.get("source"),t=c.get("sourceProperty"),n=!!e.value,p=!!e.value.match(zo);return!n||p||t.value!=="value"},assignment:c=>{const e=c.get("target"),t=c.get("targetProperty");return!!!e.value||t.value.startsWith("is")},targetProperty:c=>{const e=c.get("target"),t=c.get("targetProperty"),n=!!e.value.match(zo);return eu(n,t),!Sf(e.value)},target:c=>{const e=c.get("source"),t=c.get("sourceProperty"),n=!!e?.value;return t&&!n?!0:t&&t?.value!=="value"},value:c=>{const e=c.get("target"),t=c.get("targetProperty");return t===void 0?!1:e&&!e.value||!Bg(c.get("comparison"))||t.value===Ph?!0:t.value.startsWith("is")}},Jc=c=>{for(const[e,t]of c){const n=!!Hg[e]?.(c)||!1;t.classList.toggle(Nh,n)}},Ph="isChecked",jo=c=>c.value.endsWith("Checked"),eu=(c,e)=>{if(c&&jo(e))return null;const t=Array.from(e.querySelectorAll("option")),n=[];for(const p of t){const d=jo(p),g=c?!d:d;g&&n.push(p.value),p.classList.toggle(Ng,g)}n.includes(e.value)&&(e.value=c?Ph:t.find(p=>!jo(p))?.value||e.value)};function zg(c,e=qf){return e.reduce((t,n)=>(c[n]!==void 0&&t.push([n,c[n]]),t),[])}class jg{constructor({conditionValues:e,conditionType:t,conditionCount:n,index:p},d){this.values=new Map(zg(e)),this.conditionType=t,this.parent=d,this.baseAddress=`${d.address}.${t}`,this.fields=new Map,this.conditionCount=n,this.index=p,this.dom=this.generateDom()}setConditionIndex(e){this.index=e}get address(){return`${this.baseAddress}[${this.index}]`}destroy(){const e=ce.getAddress(this.baseAddress);e.splice(this.index,1),ce.setAddress(this.baseAddress,e),$e.slideUp(this.dom,gt,()=>{this.dom.remove()})}label(){return this.index?null:{tag:"label",className:`condition-label ${this.conditionType}-condition-label`,content:Q.get(`condition.type.${this.conditionType}`)}}generateDom(){const e=[];for(const[p,d]of this.values){const g=r=>this.onChangeCondition({key:p,target:r.target}),m={key:p,value:d,conditionType:this.conditionType,onChange:g},l=Fh[p](m,this.values),f=l.dom||U.create(l);this.fields.set(p,l.dom?l:f),e.push(f)}const n={children:[this.label(),...e,...this.generateConditionTypeActionButtons()],className:`f-condition-row ${this.conditionType}-condition-row display-none`,action:{onRender:p=>{this.processUiState()}}};return U.create(n)}generateConditionTypeActionButtons(){const e=[],t="manage-condition-type",n=g=>`${g}-condition-type`,p=U.btnTemplate({title:Q.get(`remove${this.conditionType}Condition`),className:[t,n("remove")],content:U.icon("minus"),action:{click:()=>this.destroy(),mouseover:g=>{this.dom.classList.add("to-remove")},mouseout:g=>{this.dom.classList.remove("to-remove")}}});e.push(p);const d=U.btnTemplate({title:Q.get(`add${this.conditionType}Condition`),className:[t,n("add")],content:U.icon("plus"),action:{click:()=>{const g=this.parent.addConditionType(this.conditionType),m={changedProperty:null,dataPath:g.address,value:g.value,src:g.dom};this.updateDataDebounced(m)}}});return e.push(d),e}get value(){return Array.from(this.fields).reduce((e,[t,n])=>(e[t]=n.value,e),{})}processUiState(){Jc(this.fields),this.dom.classList.remove("display-none")}updateDataDebounced=An(e=>{le.formeoUpdated(e),ce.setAddress(e.dataPath,e.value)});onChangeCondition=({key:e,target:t})=>{const n={changedProperty:e,dataPath:this.address,value:this.value,src:t};Jc(this.fields),this.updateDataDebounced(n)}}const Ug=new Map([["attrs",({itemKey:c})=>c],["options",({itemKey:c,key:e})=>`${c}.${e}`]]),Wh=(c,e)=>{if(e.controlId==="select"){const t=e.editPanels.get("options"),[n,p]=c?En:Zf,d=t.data.map(({[n]:g,...m})=>({[p]:g,...m}));t.setData(d)}},Gg=new Map([["attrs-multiple",c=>({change:({target:e})=>{c.field.controlId==="select"&&Wh(e.checked,c.field)}})]]);class hn{constructor({key:e,index:t,field:n,panel:p,data:d}){this.field=n,this.itemKey=e,this.itemIndex=t,this.panel=p,this.panelName=p.name,this.isDisabled=n.isDisabledProp(e,this.panelName),this.isHidden=this.isDisabled&&n.config.panels[this.panelName].hideDisabled,this.isLocked=n.isLockedProp(e,this.panelName),this.address=`${n.indexName}.${n.id}.${e}`,this.itemSlug=ec(e),this.conditionTypeWrap=new Map,d!==void 0&&this.field.get(this.itemKey)===void 0&&this.field.set(this.itemKey,d);const g=[`field-${this.itemSlug}`,"prop-wrap"];this.isHidden&&g.push("hidden-property"),this.dom=U.create({tag:"li",className:g,children:{className:"component-prop",children:[this.itemInputs(),this.itemControls]}})}get itemValues(){const e=this.field.get(this.itemKey);return e?.constructor===Object?Rn(Object.entries(e),En,"0"):[[this.itemKey,e]]}findOrCreateConditionTypeWrap(e){let t=this.conditionTypeWrap.get(e);return t||(t=U.create({className:`type-conditions-wrap ${e}-conditions-wrap`}),this.conditionTypeWrap.set(e,t),t)}itemInputs(){const e=U.create({className:`${this.panelName}-prop-inputs prop-inputs f-input-group`,children:this.itemValues.map(([t,n])=>this.panelName==="conditions"?this.generateConditionFields(t,n):this.itemInput(t,n))});return this.inputs&&this.inputs.replaceWith(e),this.inputs=e,e}addConditionType=(e,t)=>{const n=this.findOrCreateConditionTypeWrap(e);let p=t;if(!p){const[g]=js()[e],m=n.children.length;e===ah&&(g.logical="||"),p={conditionValues:g,conditionCount:m,index:m}}const d=new jg({conditionType:e,...p},this);return n.appendChild(d.dom),d};removeConditionType=(e,t)=>{const n=this.conditionTypeWrap.get(e),p=n.children[t];p.destroy(),n.removeChild(p.dom)};generateConditionFields=(e,t)=>(this.conditions=new Map,t.forEach((n,p)=>{const d=this.addConditionType(e,{index:p,conditionCount:t.length,conditionValues:n});this.conditions.set(p,d)}),this.findOrCreateConditionTypeWrap(e));get itemControls(){if(this.isLocked)return{className:`${this.panelName}-prop-controls prop-controls`,content:[]};const e={tag:"button",attrs:{type:"button",className:"prop-remove prop-control"},action:{click:()=>{$e.slideUp(this.dom,Ke,n=>{this.field.remove(this.itemKey),n.remove(),this.panel.updateProps()})},mouseover:n=>{this.dom.classList.add("to-remove")},mouseout:n=>{this.dom.classList.remove("to-remove")}},content:U.icon("remove")};return{className:`${this.panelName}-prop-controls prop-controls`,content:[e]}}itemInput(e,t){const n=U.childType(t)||"string",p=Ug.get(this.panelName)?.({itemKey:this.itemKey,key:e})||this.itemKey,d=p.split(".").filter(Number.isNaN).join(".")||e,g=_t[n]({key:e,value:t}),m=`${this.field.shortId}-${ec(p).replace(/-\d+-(selected)/g,"-$1")}`,l={label:this.panelName!=="options"&&(Dh(d)||st(d)),labelAfter:!1},f={name:g.attrs.type==="checkbox"?`${m}[]`:m};f.disabled=this.isDisabled,f.locked=this.isLocked;const r=Gg.get(this.itemSlug)?.(this),o=yp(Dg[n](p,this.field),r||{}),s=ze(_t[n]({key:e,value:t}),{action:o,attrs:f,config:l});return En.includes(e)?{className:"f-addon",children:s}:s}}const Vg={multiple:(c,e)=>{Wh(!!c,e)}};class Kg{constructor(e,t,n){this.type=U.childType(e),this.name=t,this.component=n,this.panelConfig=this.getPanelConfig(this.data)}get data(){const e=this.component.get(this.name);return this.type==="object"?Object.entries(e):e}getPanelConfig(e){return this.props=this.createProps(e),this.editButtons=this.createEditButtons(),{config:{label:Q.get(`panel.label.${this.name}`)},attrs:{className:`${Zu} ${this.name}-panel`},children:[this.props,this.editButtons]}}createProps(e=this.data){this.editPanelItems=Array.from(e).map((n,p)=>{const d=this.type==="array",g=d?`[${p}]`:`.${n[0]}`,m=d?n:{[n[0]]:n[1]};return new hn({key:`${this.name}${g}`,data:m,field:this.component,index:p,panel:this})});const t={tag:"ul",attrs:{className:["edit-group",`${this.component.name}-edit-group`,`${this.component.name}-edit-${this.name}`]},editGroup:this.name,isSortable:this.name==="options",content:this.editPanelItems};return U.create(t)}updateProps(){const e=this.createProps();this.props.replaceWith(e),this.props=e}createEditButtons(){const e=this.name,t=Q.get(`panelEditButtons.${e}`),n={attrs:this.addAttribute,options:this.addOption,conditions:this.addCondition},p=[];if(e==="conditions"){Q.current.clearAll||Q.put("clearAll","Clear All");const m={...U.btnTemplate({content:[U.icon("bin"),Q.get("clearAll")],title:Q.get("clearAll")}),className:`clear-all-${e}`,action:{click:()=>{this.clearAllItems()}}};p.push(m)}const d={...U.btnTemplate({content:t,title:t}),className:`add-${e}`,action:{click:m=>{const l={btnCoords:U.coords(m.target),addAction:n[e]};e==="attrs"&&(l.isDisabled=this.component.isDisabledProp,l.isLocked=this.component.isLockedProp,l.message={attr:Q.get(`action.add.${e}.attr`),value:Q.get(`action.add.${e}.value`)});const f=st(e),r=new window.CustomEvent(`onAdd${f}`,{detail:l});Te.add[e](l),document.dispatchEvent(r)}}};return p.push(d),{className:"panel-action-buttons",content:p}}addAttribute=(e,t)=>{let n=t;const p=xh(e),d=`attrs.${p}`;Q.current[d]||Q.put(d,Lh(e)),typeof n=="string"&&["true","false"].includes(n)&&(n=JSON.parse(n)),this.component.set(`attrs.${e}`,n),Vg[p]?.(n,this.component);const g=this.props.querySelector(`.${this.component.name}-attrs-${p}`),m=new hn({key:d,data:{[p]:n},field:this.component,panel:this});g?g.replaceWith(m.dom):this.props.appendChild(m.dom),this.component.resizePanelWrap()};addOption=()=>{const e=this.component.data.config.controlId,t=this.component.get("options"),n=e==="select"?"option":e,p=Q.get("newOptionLabel",{type:n})||"New Option",d=`${this.name}[${this.data.length}]`,g=t[t.length-1],l={...t.length?g:{},label:p};e!=="button"&&(l.value=ch(p));const f=new hn({key:d,data:l,field:this.component,index:this.props.children.length,panel:this});this.editPanelItems.push(f),this.props.appendChild(f.dom),this.component.debouncedUpdatePreview(),this.component.resizePanelWrap()};addCondition=e=>{const n=`conditions[${this.component.get("conditions").length}]`,p=new hn({key:n,data:e.template,field:this.component,panel:this});this.props.appendChild(p.dom),this.component.set(n,e.template),this.component.resizePanelWrap()};clearAllItems=()=>{const e=this.type==="array"?[]:{},t={type:this.name,removeAction:()=>{this.component.set(this.name,e),this.updateProps()}};Te.remove[this.name](t);const n=st(this.name),p=new window.CustomEvent(`onRemove${n}`,{detail:t});document.dispatchEvent(p)};setData(e){this.data=e,this.component.set(this.name,e),this.updateProps()}}const tu=Object.freeze({type:"field",displayType:"slider"}),dn=c=>({transform:`translateX(${c?`${c}px`:0})`});class Bh{constructor(e){this.opts=ze(tu,e),this.panelDisplay=this.opts.displayType,this.activePanelIndex=0,this.panelNav=this.createPanelNav();const t=this.createPanelsWrap();this.nav=this.navActions(),this.nav.groupChange(this.activePanelIndex);const n=new window.ResizeObserver(([{contentRect:{width:d}}])=>{this.currentWidth!==d&&(this.toggleTabbedLayout(),this.currentWidth=d,this.nav.setTranslateX(this.activePanelIndex,!1))}),p=window.setTimeout(()=>{n.observe(t),window.clearTimeout(p)},zs)}getPanelDisplay(){const e=this.panelsWrap,n=Number.parseInt(U.getStyle(e,"width"),10)>390?"tabbed":"slider",p=this.opts.displayType==="auto";return this.panelDisplay=p?n:this.opts.displayType||tu.displayType,this.panelDisplay}toggleTabbedLayout=()=>{this.getPanelDisplay();const e=this.isTabbed;return this.panelsWrap.parentElement?.classList.toggle("tabbed-panels",e),e&&this.panelNav.removeAttribute("style"),e};resizePanels=()=>{this.toggleTabbedLayout()};createPanelsWrap(){const e=U.create({className:"panels",content:this.opts.panels.map(({config:t,...n})=>n)});return this.opts.type==="field"&&this.sortableProperties(e),this.panelsWrap=e,this.panels=e.children,this.currentPanel=this.panels[this.activePanelIndex],e}sortableProperties(e){const t=e.getElementsByClassName("field-edit-group");return Ne.forEach(t,n=>{n.fieldId=this.opts.id,n.isSortable&&ee.create(n,{animation:150,group:{name:`edit-${n.editGroup}`,pull:!0,put:["properties"]},sort:!0,handle:".prop-order",onSort:p=>{this.propertySave(p.to),this.resizePanels()}})})}createPanelNavLabels(){const e=this.opts.panels.map(p=>({tag:"h5",action:{click:d=>{const g=at(d.target);this.nav.setTranslateX(g,!1),this.nav.groupChange(g)}},content:p.config.label})),t={className:"panel-labels",content:{content:e}},[n]=e;return n.className="active-tab",U.create(t)}createPanelNav(){this.labels=this.createPanelNavLabels();const e={tag:"button",attrs:{className:"next-group",title:Q.get("controlGroups.nextGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:n=>this.nav.nextGroup(n)},content:U.icon("triangle-right")},t={tag:"button",attrs:{className:"prev-group",title:Q.get("controlGroups.prevGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:n=>this.nav.prevGroup(n)},content:U.icon("triangle-left")};return U.create({tag:"nav",attrs:{className:"panel-nav"},content:[t,this.labels,e]})}get isTabbed(){return this.panelDisplay==="tabbed"}navActions(){const e={},t=this.currentPanel.parentElement,n=this.labels.firstChild,p=n.children,d=this.currentPanel.parentElement.childNodes;this.activePanelIndex=at(this.currentPanel);let g={nav:0,panel:0},m={...g};e.groupChange=r=>(this.activePanelIndex=r,this.currentPanel=d[r],U.removeClasses(d,"active-panel"),U.removeClasses(p,"active-tab"),this.currentPanel.classList.add("active-panel"),p[r].classList.add("active-tab"),this.currentPanel);const l=r=>({nav:-n.offsetWidth*r,panel:-t.offsetWidth*r}),f=({offset:r,reset:o,duration:s=gt,animate:a=!this.isTabbed})=>{const i=[dn(m.panel),dn(r.panel)],u=[dn(m.nav),dn(this.isTabbed?0:r.nav)];if(o){const[T]=i,[$]=u;i.push(T),u.push($)}const h={easing:"ease-in-out",duration:a?s:0,fill:"forwards"},y=t.animate(i,h);n.animate(u,h);const b=()=>{y.removeEventListener("finish",b),o||(m=r)};y.addEventListener("finish",b)};return e.setTranslateX=(r=this.activePanelIndex,o=!0)=>{g=l(r),f({offset:g,animate:o})},e.refresh=(r=this.activePanelIndex)=>{this.activePanelIndex!==r&&e.groupChange(r),e.setTranslateX(this.activePanelIndex,!1),this.resizePanels()},e.nextGroup=()=>{const r=this.activePanelIndex+1;if(r!==d.length){const o=d[r];g={nav:-n.offsetWidth*r,panel:-o.offsetLeft},f({offset:g}),e.groupChange(r)}else g={nav:m.nav-8,panel:m.panel-8},f({offset:g,reset:!0});return this.currentPanel},e.prevGroup=()=>{if(this.activePanelIndex!==0){const r=this.activePanelIndex-1,o=d[r];g={nav:-n.offsetWidth*r,panel:-o.offsetLeft},f({offset:g}),e.groupChange(r)}else g={nav:8,panel:8},f({offset:g,reset:!0})},e}}let Uo=null;const Go=pn(fn);class Yn extends Gs{constructor(e,t={}){const n={...t,id:t.id||We()};super(e,n),this.id=n.id,this.shortId=this.id.slice(0,this.id.indexOf("-")),this.name=e,this.indexName=`${e}s`,this.config=ce[`${this.name}s`].config,ze(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(([e,t])=>{this.addEventListener(e,t)})}addEventListener(e,t){this.eventListeners.has(e)||this.eventListeners.set(e,[]),this.eventListeners.get(e).push(t)}removeEventListener(e,t){if(!this.eventListeners?.has(e))return;const n=this.eventListeners.get(e),p=n.indexOf(t);p>-1&&n.splice(p,1)}dispatchComponentEvent(e,t={}){const n={component:this,type:e,timestamp:Date.now(),...t};return this.eventListeners?.has(e)&&this.eventListeners.get(e).forEach(p=>{try{typeof p=="function"&&p(n)}catch(d){console.error(`Error in ${e} event handler for ${this.name} ${this.id}:`,d)}}),n}set(e,t){const n=this.get(e),p=super.set(e,t);return n!==t&&this.dom&&this.dispatchComponentEvent("onUpdate",{path:e,oldValue:n,newValue:t}),p}get js(){return this.data}get json(){return this.data}remove=e=>{if(e){const p=mt(e),d=p.pop(),g=this.get(p);return Array.isArray(g)?_h(d)?g.splice(Number(d),1):this.set(p,g.filter(m=>m!==d)):delete g[d],g}if(this.name==="stage")return null;const t=this.parent,n=this.children;return this.dispatchComponentEvent("onRemove",{path:e,parent:t,children:[...n]}),qn(n,p=>p.remove()),this.dom.parentElement.removeChild(this.dom),Cf(ce.getAddress(`${t.name}s.${t.id}.children`),this.id),t.children.length||t.emptyClass(),t.name==="row"&&t.autoColumnWidths(),ce[`${this.name}s`].delete(this.id)};empty(){const e=this.children.map(t=>(t.remove(),t));return this.dom.classList.add("empty"),e}emptyClass=()=>this.dom.classList.toggle("empty",!this.children.length);getActionButtons(){const e=[`hovering-${this.name}`,"hovering"];return{className:[`${this.name}-actions`,"group-actions"],action:{mouseenter:()=>{ce.stages.active.dom.classList.add(`active-hover-${this.name}`),this.dom.classList.add(...e)},mouseleave:({target:t})=>{this.dom.classList.remove(...e),ce.stages.active.dom.classList.remove(`active-hover-${this.name}`),t.removeAttribute("style")}},children:[{...U.btnTemplate({content:U.icon(`handle-${this.name}`)}),className:["component-handle",`${this.name}-handle`]},{className:["action-btn-wrap",`${this.name}-action-btn-wrap`],children:this.buttons}]}}getComponentTag=()=>U.create({tag:"span",className:["component-tag",`${this.name}-tag`],children:[(this.isColumn||this.isField)&&U.icon("component-corner",{className:"bottom-left"}),U.icon(`handle-${this.name}`),st(this.name),(this.isColumn||this.isRow)&&U.icon("component-corner",{className:"bottom-right"})].filter(Boolean)});toggleEdit(e=!this.isEditing){this.isEditing=e;const t=this.dom,n="editing",p=`${n}-${this.name}`,d=this.dom.querySelector(`.${this.name}-edit`);$e.slideToggle(d,Ke,e),this.name==="field"&&($e.slideToggle(this.preview,Ke,!e),t.parentElement.classList.toggle(`column-${p}`,e)),t.classList.toggle(n,e),t.classList.toggle(p,e)}get buttons(){if(this.actionButtons)return this.actionButtons;const e={handle:(g=`handle-${this.name}`)=>({...U.btnTemplate({content:U.icon(g)}),className:["component-handle"]}),move:(g="move")=>({...U.btnTemplate({content:U.icon(g)}),className:["item-move"],meta:{id:"move"}}),edit:(g="edit")=>({...U.btnTemplate({content:U.icon(g)}),className:["edit-toggle"],meta:{id:"edit"},action:{click:()=>{this.toggleEdit()}}}),remove:(g="remove")=>({...U.btnTemplate({content:U.icon(g)}),className:["item-remove"],meta:{id:"remove"},action:{click:()=>{$e.slideUp(this.dom,Ke,()=>{this.name==="column"?(this.parent.autoColumnWidths(),this.remove()):this.remove()})}}}),clone:(g="copy")=>({...U.btnTemplate({content:U.icon(g)}),className:["item-clone"],meta:{id:"clone"},action:{click:()=>{this.clone(this.parent),this.name==="column"&&this.parent.autoColumnWidths()}}})},{buttons:t,disabled:n}=this.config.actionButtons,d=t.filter(g=>!n.includes(g)).map(g=>e[g]?.()||g);return this.actionButtons=d,this.actionButtons}get index(){return at(this.dom)}removeClasses=e=>{const t={string:()=>this.dom.classList.remove(e),array:()=>e.map(n=>this.dom.classList.remove(n))};return t.object=t.string,t[U.childType(e)](this.dom)};get parentType(){return Pf.get(this.name)}get parent(){const e=this.parentType;if(!this.dom||!e)return null;const t=this.dom.closest(`.${Hs[e]}`);return t&&U.asComponent(t)}get children(){if(!this.dom)return[];const e=this.domChildren,t=Xl.get(this.name);return Ys(e,n=>ce.getAddress(`${t}s.${n.id}`)).filter(Boolean)}loadChildren=(e=this.data.children)=>e.map(t=>this.addChild({id:t}));get domChildren(){const e=this.dom.querySelector(".children");return e?e.children:[]}addChild(e={},t=this.domChildren.length){let n=e;typeof e!="object"&&(n={id:n});const p=this.dom.querySelector(".children"),{id:d=We()}=n,g=Xl.get(this.name);if(!g)return null;const m=`${g}s`,l=ce.getAddress(`${m}.${d}`)||ce[m].add(d,n);t>=p.children.length?p.appendChild(l.dom):p.children[t].before(l.dom),this.dispatchComponentEvent("onAddChild",{parent:this,target:l,child:l,index:t}),l.dispatchComponentEvent("onAdd",{parent:this,target:l,index:t,addedVia:"addChild"}),this.config.events?.onAddChild?.({parent:this,child:l});const f=l.get("children");return f?.length&&l.loadChildren(f),this.removeClasses("empty"),this.saveChildOrder(),l}saveChildOrder=()=>{if(this.render)return;const e=this.children.map(({id:t})=>t);return this.set("children",e),e};onAdd({from:e,to:t,item:n,newIndex:p}){e.classList.contains(rt)||(e=e.parentElement);const d=Le(e),g=Le(t.parentElement),m=()=>{this.saveChildOrder(),this.removeClasses("empty")},l=new Map([[-2,()=>{const o=this.addChild({},p).addChild();return o.addChild.bind(o)}],[-1,()=>{const o=this.addChild({},p);return o.addChild.bind(o)}],[0,()=>this.addChild.bind(this)],[1,o=>{const s=at(this.dom);return()=>this.parent.addChild(o,s+1)}],[2,o=>()=>this.parent.parent.addChild(o)]]),r={controls:async()=>{if(!Uo){const{default:b}=await At(async()=>{const{default:T}=await Promise.resolve().then(()=>mm);return{default:T}},void 0);Uo=b}const{controlData:{meta:{id:o},...s}}=Uo.get(n.id);Gn(s,"config.controlId",o);const a=o.startsWith("layout-")?o.replace(/^layout-/,""):"field",u=De({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}.${a}`),h=l.get(u)();return U.remove(n),h(s,p)},row:()=>{const o={stage:-1,row:0,column:1};return(l.get(o[g])||bs)()?.({id:n.id},p)},column:()=>{const o={stage:-2,row:-1};return(l.get(o[g])||bs)()?.(n.id)}}[d]?.(n,p);return this.dispatchComponentEvent("onAdd",{from:e,to:t,item:n,newIndex:p,fromType:d,toType:g,addedComponent:r,addedVia:"dragDrop"}),m(),r}onSort=()=>this.saveChildOrder();onRemove({from:{parentElement:e}}){return e.classList.contains(Qe)&&e.classList.remove("column-editing-field"),this.name!=="stage"&&!this.children.length?this.remove():(this.emptyClass(),this.saveChildOrder())}onEnd=({to:{parentElement:e},from:{parentElement:t}})=>{e?.classList.remove(`hovering-${Le(e)}`),t?.classList.remove(`hovering-${Le(t)}`)};onRender(){this.dispatchComponentEvent("onRender",{dom:this.dom});const{events:e}=this.config;if(!e)return null;e.onRender&&U.onRender(this.dom,e.onRender)}set config(e){const t=De(e,"all"),n=De(this.data,"config.controlId"),p=n&&De(e,n),d=De(e,this.id),g=[t,p,d].reduce((m,l)=>l?ze(m,l):m,this.configVal);this.configVal=g}get config(){return this.configVal}runConditions=()=>{const e=this.get("conditions");return e?.length?e.map(n=>{const p=this.processConditions(n.if),d=this.processResults(n.then);return p.map(g=>this.evaluateConditions(g)&&this.execResults(d))}):null};getComponent(e){const[t,n]=e.split("."),p=ce[t];return n===this.id?this:p?.get(n)}value=(e,t)=>{const n=e.split("."),p=this.getComponent(e),d=p&&n.slice(2,n.length).join(".");return[!p,!d,!Go[d]].some(Boolean)?e:t?p.set(Go[d],t):p.get(Go[d])};getResult=e=>({"=":(n,p,d)=>n.set(p,d)})[e];processResults=e=>e.map(({operator:t,target:n,value:p})=>{const d=this.getComponent(n),g=d&&n.split(".").slice(2,n.length).join(".");return{target:d,propertyPath:g,action:this.getResult(t),value:this.value(p)}});execResults=e=>{const t=e.map(n=>this.execResult(n));return Promise.all(t)};execResult=({target:e,action:t,value:n,_propertyPath:p})=>new Promise((d,g)=>{try{return d(t(e,n))}catch(m){return g(m)}});cloneData=()=>{const e={...Ye(this.data),id:We()};return this.name!=="field"&&(e.children=[]),e};clone=(e=this.parent)=>{const t=e.addChild(this.cloneData(),this.index+1);return this.name!=="field"&&this.cloneChildren(t),this.dispatchComponentEvent("onClone",{original:this,clone:t,parent:e}),t};cloneChildren(e){for(const t of this.children)t?.clone(e)}createChildWrap=e=>U.create({tag:"ul",attrs:{className:"children"},children:e});get isRow(){return this.name===Br.row}get isColumn(){return this.name===Br.column}get isField(){return this.name===Br.field}isDisabledProp=(e,t="attrs")=>{const n=this.config.panels[t];return n?n.disabled.concat(this.get("config.disabled")).includes(e):!1};isLockedProp=(e,t="attrs")=>{const n=this.config.panels[t];return n?n.locked.concat(this.get("config.locked")).includes(e):!1};get editWindow(){const e={className:["component-edit",`${this.name}-edit`,"slide-toggle","formeo-panels-wrap"]},t=this.editPanels.size;return t&&(e.className.push(`panel-count-${t}`),e.content=[this.panels.panelNav,this.panels.panelsWrap],this.panelNav=this.panels.nav,this.resizePanelWrap=this.panels.nav.refresh),e.action={onRender:()=>{if(t===0){const n=this.dom.querySelector(".edit-toggle"),p=this.dom.querySelector(`.${this.name}-actions`),d=p.getElementsByTagName("button");p.style.maxWidth=`${d.length*d[0].clientWidth}px`,U.remove(n)}else this.resizePanelWrap()}},U.create(e)}updateEditPanels=()=>{if(!this.config)return null;const e=["object","array"],t=pt([...this.config.panels.order,...Object.keys(this.data)]),n=["children","config","meta","action","events",...this.config.panels.disabled],p=t.filter(g=>!n.includes(g));for(const g of p){const m=this.get(g),l=U.childType(m);if(e.includes(l)){const f=new Kg(m,g,this);this.editPanels.set(f.name,f)}}const d={panels:Array.from(this.editPanels.values()).map(({panelConfig:g})=>g),id:this.id,displayType:"auto"};this.panels=new Bh(d),this.dom&&(this.dom.querySelector(".panel-nav").replaceWith(this.panels.panelNav),this.dom.querySelector(".panels").replaceWith(this.panels.panelsWrap))}}class qg{constructor(){this.onMove=this.onMove.bind(this),this.onStop=this.onStop.bind(this),this.cleanup=this.cleanup.bind(this)}getRowWidth(e){const t=e.querySelector(".children");if(!t)return 0;const n=t.children.length,p=U.getStyle(t,"gap")||"0px",d=parseFloat(p,10)||0;return this.totalGapWidth=d*(n-1),t.offsetWidth-this.totalGapWidth}validateResizeTarget(e,t){return e&&t&&e.offsetWidth&&t.offsetWidth}onStart(e){if(e.preventDefault(),this.resized=!1,e.button!==0)return;const t=e.target.parentElement,n=t.nextSibling||t.previousSibling,p=t.closest(`.${Xe}`);if(!this.validateResizeTarget(t,n)){console.warn("Invalid resize targets"),this.cleanup();return}if(this.startX=e.type==="touchstart"?e.touches[0].clientX:e.clientX,p.classList.add(Wr),this.columnPreset=p.querySelector(`.${Ju}`),this.originalColumnClass=t.className,this.originalSiblingClass=n.className,t.className=t.className.replace(Ss,""),n.className=n.className.replace(Ss,""),this.colStartWidth=t.offsetWidth,this.sibStartWidth=n.offsetWidth,this.rowWidth=this.getRowWidth(p),this.rowWidth<=0){console.warn("Invalid row width calculated"),this.cleanup();return}this.column=t,this.sibling=n,this.row=p;try{window.addEventListener("pointermove",this.onMove,!1),window.addEventListener("pointerup",this.onStop,!1)}catch(d){console.error("Failed to initialize resize listeners:",d),this.cleanup()}}calculateNewWidths(e){const t=this.colStartWidth+e-this.startX,n=this.sibStartWidth-e+this.startX,p=parseFloat(Pr(t,this.rowWidth)),d=parseFloat(Pr(n,this.rowWidth));return p<10||d<10?null:{colWidth:ys(p.toFixed(1)),siblingColWidth:ys(d.toFixed(1))}}onMove(e){e.preventDefault();const{column:t,sibling:n}=this,p=e.type==="touchmove"?e.touches[0].clientX:e.clientX,d=this.calculateNewWidths(p);if(!d)return;const{colWidth:g,siblingColWidth:m}=d;t.dataset.colWidth=g,n.dataset.colWidth=m,t.style.width=g,n.style.width=m,this.resized=!0}onStop(){const{column:e,sibling:t}=this;window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop),this.resized&&(this.setCustomWidthValue(),ce.setAddress(`columns.${e.id}.config.width`,e.dataset.colWidth),ce.setAddress(`columns.${t.id}.config.width`,t.dataset.colWidth),this.row.classList.remove(Wr),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(Wr),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const e=this.columnPreset;let t=e.querySelector(`.${Cs}`);const n=this.row.querySelector(".children").children,p=Ys(n,m=>Pr(m.clientWidth,this.rowWidth).toFixed(1)),d=p.join(","),g=p.join(" | ");return t||(t=U.create({tag:"option",attrs:{className:Cs,value:d,selected:!0},content:g}),e.append(t)),t.value=d,t.textContent=g,d}}const Yg=()=>Object.freeze({config:{width:"100%"},children:[],className:[Qe]}),nu={resizeHandle:c=>({className:"resize-x-handle",action:{pointerdown:c.onStart.bind(c)},content:[U.icon("triangle-down"),U.icon("triangle-up")]}),editWindow:()=>({className:"column-edit group-config"})};class Xg extends Yn{constructor(e){super("column",{...Yg(),...e});const t=this.createChildWrap();this.dom=U.create({tag:"li",className:[Qe,"empty"],dataset:{hoverTag:Q.get("column")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),nu.editWindow(),nu.resizeHandle(new qg),t]}),this.processConfig(),le.columnResized=new window.CustomEvent("columnResized",{detail:{column:this.dom,instance:this}}),ee.create(t,{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:n=>{n.from!==n.to&&n.from.classList.remove("hovering-column")},draggable:`.${It}`,handle:".item-move"})}processConfig(){const e=Ne.get(this.data,"config.width");e&&this.setDomWidth(e)}refreshFieldPanels=()=>{for(const e of this.children)e.panels.nav.refresh()};setDomWidth=e=>{this.dom.dataset.colWidth=e,this.dom.style.width=e};setWidth=e=>(this.setDomWidth(e),this.set("config.width",e))}const Qg={actionButtons:{buttons:["clone","move","remove"],disabled:[]}};let Zg=class extends Vn{constructor(e){super("columns",e),this.config={all:Qg}}Component(e){return new Xg(e)}};const Hh=new Zg,Jg=()=>Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[Xe]});class em extends Yn{constructor(e){super("row",{...Jg(),...e});const t=this.createChildWrap();this.dom=U.create({tag:"li",className:[Xe,"empty"],dataset:{hoverTag:Q.get("row"),editingHoverTag:Q.get("editing.row")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),this.editWindow,t]}),ee.create(t,{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:`.${Qe}`,handle:".item-move"})}get editWindow(){const e={tag:"input",id:`${this.id}-fieldset`,attrs:{type:"checkbox",checked:this.get("config.fieldset"),ariaLabel:Q.get("row.settings.fieldsetWrap.aria")},action:{click:({target:{checked:s}})=>{this.set("config.fieldset",!!s)}},config:{label:Q.get("row.settings.fieldsetWrap")}},t={tag:"input",id:`${this.id}-inputGroup`,attrs:{type:"checkbox",checked:this.get("config.inputGroup"),ariaLabel:Q.get("row.settings.inputGroup.aria")},action:{click:({target:{checked:s}})=>this.set("config.inputGroup",s)},config:{label:Q.get("row.makeInputGroup"),description:Q.get("row.makeInputGroupDesc")}},n={tag:"span",content:" ⓘ",dataset:{tooltip:"Row title will be used as the legend for the fieldset"}},d={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",n]}},action:{input:({target:{value:s}})=>this.set("config.legend",s)},className:""}},g=U.formGroup([e,d]),m={tag:"label",content:Q.get("defineColumnWidths"),className:"col-sm-4 form-control-label"};this.columnPresetControl=U.create(this.columnPresetControlConfig);const l={className:"col-sm-8",content:this.columnPresetControl,action:{onRender:()=>{this.updateColumnPreset()}}},f=U.formGroup([m,l],"row"),r=[t,"hr",g,"hr",f];return U.create({className:`${this.name}-edit group-config`,action:{onRender:s=>{const a=r.map(i=>U.create(i));s.append(...a)}}})}onAdd(...e){super.onAdd(...e),this.autoColumnWidths()}onRemove(...e){super.onRemove(...e),this.autoColumnWidths()}autoColumnWidths=()=>{const e=this.children;if(!e.length)return;const t=Number.parseFloat((100/e.length).toFixed(1))/1;for(const n of e){n.removeClasses(Ss);const p=n.dom,d=ys(t);n.set("config.width",d),p.style.width=d,p.dataset.colWidth=d;const g=setTimeout(()=>{clearTimeout(g),n.refreshFieldPanels()},gt);document.dispatchEvent(le.columnResized)}this.updateColumnPreset()};updateColumnPreset=()=>{this.columnPresetControl.innerHTML="";const e=this.getColumnPresetOptions.map(({label:t,...n})=>U.create({tag:"option",content:t,attrs:n}));this.columnPresetControl.append(...e)};setColumnWidths=e=>{typeof e=="string"&&(e=e.split(",")),this.children.forEach((t,n)=>{t.setWidth(`${e[n]}%`),t.refreshFieldPanels()})};get getColumnPresetOptions(){const e=this.children,n=Bf.get(e.length-1)||[],p=e.map(d=>{const g=d.get("config.width")||"";return Number(g.replace("%","")).toFixed(1)}).join(",");if(n.length){const d=n.slice();return!d.find(m=>m.value===p)&&d.push({value:p,label:p.replace(/,/g," | "),className:Cs}),d.map(m=>{const l={...m};return l.selected=m.value===p,l})}return[]}get columnPresetControlConfig(){return{tag:"select",attrs:{ariaLabel:Q.get("defineColumnLayout"),className:Ju},action:{change:({target:t})=>{const{value:n}=t;this.setColumnWidths(n)}},options:this.getColumnPresetOptions}}}const tm={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}};let nm=class extends Vn{constructor(e){super("rows",e),this.config={all:tm}}Component(e){return new em(e)}};const Qs=new nm,im=()=>({conditions:[js()],children:[]});class rm extends Yn{constructor(e){super("stage",{...im(),...e}),this.updateEditPanels(),this.debouncedUpdateEditPanels=An(this.updateEditPanels),Q.get("Untitled Form"),Q.get("Untitled Form"),Q.get("Form Title"),Q.get("Form novalidate"),Q.get("Tags");const t=this.createChildWrap();this.dom=U.create({attrs:{className:[kt,"empty"],id:this.id},children:[this.getComponentTag(),this.getActionButtons(),this.editWindow,t]}),ee.create(t,{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:()=>{Jt.active=this},onSort:this.onSort.bind(this),draggable:`.${Xe}`,handle:".item-move"})}empty(e=!0){return new Promise(t=>{e?(this.dom.classList.add("removing-all-fields"),$e.slideUp(this.dom,Ke,()=>{t(super.empty(e)),this.dom.classList.remove("removing-all-fields"),$e.slideDown(this.dom,Ke)})):t(super.empty())})}onAdd(...e){const t=super.onAdd(...e);t&&t.name==="column"&&t.parent.autoColumnWidths()}}const om=()=>({actionButtons:{buttons:["edit"],disabled:[]},panels:{disabled:[],order:["attrs","options","conditions"]}});let sm=class extends Vn{constructor(e){super("stages",e),this.config={all:om()}}Component(e){return new rm(e)}};const Jt=new sm,In={js:new Set,css:new Set},iu=(c,e,t=ws)=>new Promise(n=>fetch(c).then(p=>{if(!p.ok)return n(t(p));n(e?e(p):p)}).catch(p=>t(p))),zh=(c,e)=>{c.removeEventListener("load",zh),e(c.src)},jh=(c,e)=>{c.removeEventListener("load",jh),e(c.src)},Uh=c=>new Promise((e,t)=>{if(In.js.has(c))return e(c);In.js.add(c);const n=U.create({tag:"script",attrs:{type:"text/javascript",async:!0,src:c},action:{load:()=>jh(n,e),error:()=>t(new Error(`${c} failed to load.`))}});document.head.appendChild(n)}),_s=c=>{c=Array.isArray(c)?c:[c];const e=c.map(t=>new Promise((n,p)=>{if(In.css.has(t))return n(t);In.css.add(t);const d=U.create({tag:"link",attrs:{rel:"stylesheet",href:t},action:{load:()=>zh(d,n),error:()=>p(new Error(`${(void 0).src} failed to load.`))}});document.head.appendChild(d)}));return Promise.all(e)},am=c=>{c=Array.isArray(c)?c:[c];const e=c.map(t=>Uh(t));return Promise.all(e)},lm=c=>{c=Array.isArray(c)?c:[c];const e=c.map(t=>_s(t));return Promise.all(e)},cm=c=>{let e=document.getElementById(ot);return e||(e=U.create({id:ot,children:c,attrs:{hidden:!0,style:"display: none;"}}),document.body.insertBefore(e,document.body.childNodes[0])),e},um=async(c=Qu)=>{if(document.getElementById(ot))return;const t=async n=>cm(await n.text());return iu(c,t,()=>iu($f,t))},hm=c=>{const e=Array.isArray(c)?ql.filter(({name:t})=>c.indexOf(t)!==-1):ql;return Promise.all(e.map(({src:t})=>Uh(t)))},dm={js:am,css:lm},Gh=c=>{const e=Object.entries(c).map(([t,n])=>dm[t](n));return Promise.all(e)},ru=()=>{const c=document.getElementById(ot);return window.getComputedStyle(c).visibility==="hidden"},fm=async c=>{if(!ru()&&(await _s(c),!ru()))return await _s(Tf)};class pm{controlCache=new Set;constructor({events:e={},dependencies:t={},controlAction:n,...p}){this.events=e,this.controlData=p,this.controlAction=n,this.dependencies=t,this.id=p.id||We()}get controlId(){return this.controlData.meta?.id||this.controlData.config?.controlId}get dom(){const{meta:e,config:t}=this.controlData,n=this.i18n(t.label)||t.label,p={tag:"button",attrs:{type:"button"},content:[{tag:"span",className:"control-icon",children:U.icon(e.icon)},{tag:"span",className:"control-label",content:n}],action:{focus:({target:d})=>{const g=d.closest(`.${rt}`);return g&&xt.panels.nav.refresh(at(g))},click:({target:d})=>{const g=d.closest(".field-control")?.id;g&&xt.addElement(g)}}};return U.create({tag:"li",id:this.id,className:["field-control",`${e.group}-control`,`${e.id}-control`],content:p,meta:e,action:this.controlAction})}promise(){return Gh(this.dependencies)}i18n(e,t){const n=Q.locale,d=this.definition?.i18n?.[n]||{};return(d[e]?.()??d[e])||Q.get(e,t)}}const gm=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 Vh=class{constructor(){this.data=new Map,this.buttonActions={focus:({target:e})=>{const t=e.closest(`.${rt}`);return t&&this.panels.nav.refresh(at(t))},click:({target:e})=>{this.addElement(e.parentElement.id)}}}async init(e,t=!1){return await this.applyOptions(e),this.buildDOM(t),this}registerControls(e){return this.controls=[],e.map(t=>{const p=typeof t=="function"?new t:new pm(t);return this.add(p),this.controls.push(p.dom),p.promise()})}groupLabel=e=>Q.get(e)||e||"";groupElements(){let e=this.options.groups.slice(),t=this.controls.slice(),n=[];const p=[];return e=Rn(e,this.groupOrder,"id"),e=e.filter(d=>Kl(d.id,this.options.disable.groups)),n=e.map(d=>{const g={tag:"ul",attrs:{className:[rt,Zu],id:`${d.id}-${rt}`},config:{label:this.groupLabel(d.label)}};if(this.options.elementOrder[d.id]){const m=this.options.elementOrder[d.id],l=pt(m.concat(d.elementOrder));d.elementOrder=l}return t=Rn(t,d.elementOrder,"meta.id"),g.content=t.filter(m=>{const{controlData:l}=this.get(m.id),f=l.meta.id||"",r=[Kl(f,this.options.disable.elements),l.meta.group===d.id,!p.includes(f)];let o=!0;return o=r.every(s=>s===!0),o&&p.push(f),o}),g}),n}add(e=Object.create(null)){const t=Ye(e);return this.data.set(t.id,t),t.controlData.meta.id&&this.data.set(t.controlData.meta.id,t.controlData),t}get(e){return Ye(this.data.get(e))}formActions(){if(this.options.disable.formActions===!0)return null;const e={...U.btnTemplate({content:[U.icon("bin"),Q.get("clear")],title:Q.get("clearAll")}),className:["clear-form"],action:{click:p=>{Qs.size?(le.confirmClearAll=new window.CustomEvent("confirmClearAll",{detail:{confirmationMessage:Q.get("confirmClearAll"),clearAllAction:()=>{Jt.clearAll().then(()=>{const d={src:p.target};le.formeoCleared(d)})},btnCoords:U.coords(p.target)}}),document.dispatchEvent(le.confirmClearAll)):window.alert(Q.get("cannotClearFields"))}}},t={...U.btnTemplate({content:[U.icon("floppy-disk"),Q.get("save")],title:Q.get("save")}),className:["save-form"],action:{click:async({target:p})=>{const{default:d}=await At(async()=>{const{default:l}=await Promise.resolve().then(()=>$m);return{default:l}},void 0),{formData:g}=d,m={action:()=>{},coords:U.coords(p),message:"",button:p};return Te.click.btn(m),Te.save.form(g)}}};return{className:"form-actions f-btn-group",content:Object.entries({clearBtn:e,saveBtn:t}).reduce((p,[d,g])=>(this.options.disable.formActions.includes(d)||p.push(g),p),[])}}buildDOM(e){const t=this.groupElements(),n=this.formActions(),{displayType:p}=this.options.panels;this.panels=new Bh({panels:t,type:"controls",displayType:p});const d=["control-groups","formeo-panels-wrap",`panel-count-${t.length}`],g=U.create({className:d,content:[this.panels.panelNav,this.panels.panelsWrap]}),m=["formeo-controls"];e&&m.push("formeo-sticky");const l=U.create({className:m,content:[g,n]}),f=l.getElementsByClassName("control-group");this.dom=l,this.groups=f;const[r]=f;this.currentGroup=r,this.actions={filter:o=>{const s=o!=="",a=this.controls;let i=g.querySelector(".filtered-term");if(U.toggleElementsByStr(a,o),s){const u=Q.get("controls.filteringTerm",o);l.classList.add("filtered"),i?i.textContent=u:(i=U.create({tag:"h5",className:"filtered-term",content:u}),g.insertBefore(i,g.firstChild))}else i&&(l.classList.remove("filtered"),i.remove())},addElement:this.addElement,addGroup:o=>console.log(o)};for(let o=f.length-1;o>=0;o--){const s=`formeo-controls-${f[o]}`;this.options.sortable||window.localStorage.removeItem(s),ee.create(f[o],{animation:150,forceFallback:!0,fallbackClass:"control-moving",fallbackOnBody:!0,group:{name:"controls",pull:"clone",put:!1},onStart:async({item:a})=>{const{controlData:i}=this.get(a.id);if(this.options.ghostPreview){const{default:u}=await At(async()=>{const{default:h}=await Promise.resolve().then(()=>wm);return{default:h}},void 0);a.innerHTML="",a.appendChild(new u(i).preview)}},onEnd:({from:a,item:i,clone:u})=>{a.contains(u)&&a.replaceChild(i,u)},sort:this.options.sortable,store:{get:()=>{const a=window.localStorage.getItem(s);return a?a.split("|"):[]},set:a=>{const i=a.toArray();window.localStorage.setItem(s,i.join("|"))}}})}return l}layoutTypes={row:()=>Jt.active.addChild(),column:()=>this.layoutTypes.row().addChild(),field:e=>this.layoutTypes.column().addChild(e)};addElement=e=>{const{meta:{group:t,id:n},...p}=De(this.get(e),"controlData");return Gn(p,"config.controlId",n),t==="layout"?this.layoutTypes[n.replace("layout-","")]():this.layoutTypes.field(p)};applyOptions=async(e={})=>{const{container:t,elements:n,groupOrder:p,...d}=ze(gm,e);this.container=t,this.groupOrder=pt(p.concat(["common","html","layout"])),this.options=d;const[g,m,l]=await Promise.all([At(()=>import("./index.min.js"),[]),At(()=>import("./index.min2.js"),[]),At(()=>import("./index.min3.js"),[])]),f=[g.default,m.default,l.default].flat();return Promise.all(this.registerControls([...f,...n]))}};const xt=new Vh,mm=Object.freeze(Object.defineProperty({__proto__:null,Controls:Vh,default:xt},Symbol.toStringTag,{value:"Module"})),vm=()=>({}),ym=new Set(["checkbox","radio"]),bm=new Set(["radio","checkbox","select-one","select-multiple"]);class Kh extends Yn{constructor(e=Object.create(null)){super("field",{...vm(),...e}),this.debouncedUpdateEditPanels=An(this.updateEditPanels),this.debouncedUpdatePreview=An(this.updatePreview),this.label=U.create(this.labelConfig),this.preview=this.fieldPreview(),this.controlId=this.get("config.controlId")||this.get("meta.id");const t=this.getActionButtons(),n=this.actionButtons.some(d=>d.meta?.id==="edit");this.updateEditPanels();const p=U.create({tag:"li",attrs:{className:It},id:this.id,children:[this.label,this.getComponentTag(),t,n&&this.editWindow,this.preview].filter(Boolean),panelNav:this.panelNav,dataset:{hoverTag:Q.get("field")}});this.dom=p,this.isEditing=!1}get labelConfig(){if(!!this.get("config.hideLabel"))return null;const t=this.get("config.editorLabel")||this.get("config.label"),n=this.get("attrs.required"),p=this.config.label.disableHTML;return{className:"prev-label",children:[{...(()=>{const l={tag:"label",attrs:{}};return p?(l.tag="input",l.attrs.value=t,l):(l.attrs.contenteditable=!0,l.children=t,l)})(),action:{input:({target:{innerHTML:l,innerText:f}})=>{super.set("config.label",p?f:l)}}},n&&U.requiredMark()]}}setData=(e,t)=>super.set(e,t);set(e,t){const n=this.setData(e,t);return this.debouncedUpdatePreview(),n}updateLabel(){if(!this.label)return null;const e=U.create(this.labelConfig);this.label.replaceWith(e),this.label=e}updatePreview=()=>{this.updateLabel();const e=this.fieldPreview();this.preview.replaceWith(e),this.preview=e};get defaultPreviewActions(){return{change:e=>{const{target:t}=e,{type:n}=t;if(bm.has(n)){const p=this.preview.querySelectorAll(":checked"),d=this.get("options"),g=d?.[0]?.selected!==void 0?"selected":"checked",m=d.reduce((l,f)=>(l[f.value]=f,l[f.value][g]=!1,l),{});for(const l of p)m[l.value][g]=l.value===m[l.value].value;return super.set("options",Object.values(m)),this.debouncedUpdateEditPanels()}},click:e=>{e.target.contentEditable==="true"&&e.preventDefault()},input:({target:e})=>{if(["input","meter","progress","button"].includes(e.tagName.toLowerCase()))return super.set("attrs.value",e.value),this.debouncedUpdateEditPanels();if(e.contentEditable&&!e.type?.startsWith("select-")){const t=e.parentElement.classList;if(t.contains("f-checkbox")||t.contains("f-radio")){const p=e.parentElement,d=at(p);return this.setData(`options[${d}].label`,e.innerHTML),this.debouncedUpdateEditPanels()}this.setData("content",e.innerHTML||e.value)}}}}fieldPreview(){const{action:e={},...t}=Ye(this.data);t.id=`prev-${this.id}`,t.action=Object.entries(e).reduce((p,[d,g])=>(p[d]=g.bind(this),p),{}),this.data?.config.editableContent&&(t.attrs={...t.attrs,contenteditable:!0});const n={attrs:{className:"field-preview",style:this.isEditing&&"display: none;"},content:U.create(t,!0),action:this.defaultPreviewActions};return U.create(n,!0)}get isCheckable(){return ym.has(this.get("config.controlId"))}}const wm=Object.freeze(Object.defineProperty({__proto__:null,default:Kh},Symbol.toStringTag,{value:"Module"})),Cm=()=>({actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}});let Sm=class extends Vn{constructor(e){super("fields",e),this.config={all:Cm()}}Component(e){return new Kh(e)}get=e=>{let t=e&&De(this.data,e);if(!t){const n=xt.get(e);n&&(t=this.add(null,n.controlData))}return t};getData=()=>Object.entries(this.data).reduce((e,[t,n])=>{const{conditions:p,...d}=n?.getData()||n;if(p?.length){let g=!0;if(p.length===1){const[m]=p;g=!!m.if[0].source}g&&(d.conditions=p)}return e[t]=d,e},{});load=(e=Object.create(null))=>{const t=Hn(e);this.empty();for(const[n,p]of Object.entries(t)){const{meta:d,...g}=p;d?.id&&Gn(g,"config.controlId",d?.id),this.add(n,g)}return this.data}};const qh=new Sm,wn=Jt,Cn=Qs,Zt=Hh,Sn=qh,On=xt,Am=(c,e=!1)=>c?Ye(Hn(c)):e&&Yu.get(nh)||$n();class Yh extends Gs{constructor(){super("components"),this.disableEvents=!0,this.stages=wn,this.rows=Cn,this.columns=Zt,this.fields=Sn,this.controls=On}load=(e,t)=>{this.empty();const n=Am(e,t.sessionStorage);this.opts=t,this.set("id",n.id),this.add("stages",wn.load(n.stages)),this.add("rows",Cn.load(n.rows)),this.add("columns",Zt.load(n.columns)),this.add("fields",Sn.load(n.fields));for(const p of Object.values(this.get("stages")))p.loadChildren();return this.data};flatList(){const e={};for(const t of Object.keys(this.data.stages))Xu(this.data,t,"stages",e);return e}getChildData=({type:e,id:t})=>{const n=this.get(e,t);if(n)return n.getData()};get json(){return window.JSON.stringify({$schema:`https://cdn.jsdelivr.net/npm/formeo@${Ps}/dist/formData_schema.json`,...this.formData})}get formData(){return{id:this.get("id"),stages:Jt.getData(),rows:Qs.getData(),columns:Hh.getData(),fields:qh.getData()}}set config(e){const{stages:t,rows:n,columns:p,fields:d}=e;wn.config=t,Cn.config=n,Zt.config=p,Sn.config=d}getIndex(e){return this[e]||this[Lf.get(e)]}setAddress(e,t){if(!Pe(e))return;const[n,p,...d]=Array.isArray(e)?e:mt(e),m=this.getIndex(n).get(p);return m?.set(d,t),m}getAddress(e){if(!Pe(e))return;const[t,n,...p]=Array.isArray(e)?e:mt(e),g=this.getIndex(t).get(n);if(!(p.length&&!g))return p.length?g.get(p):g}}const ce=new Yh,$m=Object.freeze(Object.defineProperty({__proto__:null,Columns:Zt,Components:Yh,Controls:On,Fields:Sn,Rows:Cn,Stages:wn,default:ce},Symbol.toStringTag,{value:"Module"})),ou="no-transition",Xh={debug:!1,bubbles:!0,formeoLoaded:c=>{},onAdd:()=>{},onChange:(...c)=>Xh.onUpdate(...c),onUpdate:c=>le.opts?.debug&&console.log(c),onUpdateStage:c=>le.opts?.debug&&console.log(c),onUpdateRow:c=>le.opts?.debug&&console.log(c),onUpdateColumn:c=>le.opts?.debug&&console.log(c),onUpdateField:c=>le.opts?.debug&&console.log(c),onRender:c=>le.opts?.debug&&console.log(c),onSave:c=>{},confirmClearAll:c=>{window.confirm(c.confirmationMessage)&&c.clearAllAction(c)}},Pt=({src:c,...e},t=jn)=>{const n=new window.CustomEvent(t,{detail:e,bubbles:le.opts?.debug||le.opts?.bubbles});return n.data=(c||document).dispatchEvent(n),n},le={init:function(c){return this.opts={...Xh,...c},this},formeoSaved:c=>Pt(c,ih),formeoUpdated:c=>Pt(c,jn),formeoCleared:c=>Pt(c,Gf),formeoOnRender:c=>Pt(c,rh),formeoConditionUpdated:c=>Pt(c,Vf)},Em=Af(()=>{le.opts.onUpdate({timeStamp:window.performance.now(),type:jn,detail:ce.formData})},gt);document.addEventListener(jn,Em);document.addEventListener(Hf,c=>{const{timeStamp:e,type:t,detail:n}=c;le.opts.onUpdate({timeStamp:e,type:t,detail:n})});document.addEventListener(zf,c=>{const{timeStamp:e,type:t,detail:n}=c;le.opts.onUpdate({timeStamp:e,type:t,detail:n})});document.addEventListener(jf,c=>{const{timeStamp:e,type:t,detail:n}=c;le.opts.onUpdate({timeStamp:e,type:t,detail:n})});document.addEventListener(Uf,c=>{const{timeStamp:e,type:t,detail:n}=c;le.opts.onUpdate({timeStamp:e,type:t,detail:n})});document.addEventListener(rh,c=>{const{timeStamp:e,type:t,detail:n}=c;le.opts.onRender({timeStamp:e,type:t,detail:n})});document.addEventListener("confirmClearAll",c=>{c={timeStamp:c.timeStamp,type:c.type,confirmationMessage:c.detail.confirmationMessage,clearAllAction:c.detail.clearAllAction,btnCoords:c.detail.btnCoords},le.opts.confirmClearAll(c)});document.addEventListener(ih,({timeStamp:c,type:e,detail:{formData:t}})=>{const n={timeStamp:c,type:e,formData:t};le.opts.onSave(n)});document.addEventListener("formeoLoaded",c=>{le.opts.formeoLoaded(c.detail.formeo)});let Vo;function Tm(){Vo=Vo||window.requestAnimationFrame(()=>{Vo=!1;for(const c of Object.values(Zt.data))c.dom.classList.add(ou),On.dom.classList.add(ou),On.panels.nav.refresh(),c.refreshFieldPanels()})}window.addEventListener("resize",Tm);const su={add:{attr:c=>{const e=window.prompt(c.message.attr);if(e&&c.isDisabled(e))return window.alert(Q.get("attributeNotPermitted",e||"")),Te.add.attrs(c);let t;e&&(t=String(window.prompt(c.message.value,"")),c.addAction(e,t))},option:c=>{c.addAction()},condition:c=>{c.addAction(c)}},remove:{attrs:c=>{c.removeAction()},options:c=>{c.removeAction()},conditions:c=>{c.removeAction()}},click:{btn:c=>{c.action()}},save:{form:bs}},Te={init:function(c){const e=Object.keys(su);return this.opts=e.reduce((t,n)=>(t[n]={...su[n],...c[n]},t),c),this},add:{attrs:c=>Te.opts.add.attr(c),options:c=>Te.opts.add.option(c),conditions:c=>(c.template=c.template||js(),Te.opts.add.condition(c))},remove:{attrs:c=>Te.opts.remove.attrs(c),options:c=>Te.opts.remove.options(c),conditions:c=>Te.opts.remove.conditions(c)},click:{btn:c=>Te.opts.click.btn(c)},save:{form:c=>(Te.opts.sessionStorage&&Yu.set(nh,c),le.formeoSaved({formData:c}),Te.opts.save.form(c))}};var Mm={"en-US":"English",dir:"ltr","af-ZA":"Afrikaans (South Africa)","ar-TN":"Arabic (Tunisia)","cs-CZ":"Czech (Czechia)","de-DE":"German (Germany)","es-ES":"European Spanish","fa-IR":"Persian (Iran)","fi-FI":"Finnish (Finland)","fr-FR":"French (France)","hu-HU":"Hungarian (Hungary)","it-IT":"Italian (Italy)","ja-JP":"Japanese (Japan)","nb-NO":"Norwegian Bokmål (Norway)","pl-PL":"Polish (Poland)","pt-BR":"Brazilian Portuguese","pt-PT":"European Portuguese","ro-RO":"Romanian (Romania)","ru-RU":"Russian (Russia)","th-TH":"Thai (Thailand)","tr-TR":"Turkish (Türkiye)","zh-CN":"Chinese (China)","zh-HK":"Chinese (Hong Kong SAR China)","action.add.attrs.attr":"What attribute would you like to add?","action.add.attrs.value":"Default Value",addOption:"Add Option",allFieldsRemoved:"All fields were removed.",allowSelect:"Allow Select",and:"and",attribute:"Attribute",attributeNotPermitted:'Attribute "{attribute}" is not permitted, please choose another.',attributes:"Attributes","attrs.class":"Class","attrs.className":"Class","attrs.dir":"Direction","attrs.id":"Id","attrs.required":"Required","attrs.style":"Style","attrs.title":"Title","attrs.type":"Type","attrs.value":"Value",autocomplete:"Autocomplete",button:"Button",cannotBeEmpty:"This field cannot be empty",cannotClearFields:"There are no fields to clear",checkbox:"Checkbox",checkboxes:"Checkboxes",class:"Class",clear:"Clear",clearAllMessage:"Are you sure you want to clear all fields?",close:"Close",column:"Column","condition.target.placeholder":"target","condition.type.and":"And","condition.type.if":"If","condition.type.or":"Or","condition.type.then":"Then","condition.value.placeholder":"value",confirmClearAll:"Are you sure you want to remove all fields?",content:"Content",control:"Control","controlGroups.nextGroup":"Next Group","controlGroups.prevGroup":"Previous Group","controls.filteringTerm":'Filtering "{term}"',"controls.form.button":"Button","controls.form.checkbox-group":"Checkbox Group","controls.form.input.date":"Date","controls.form.input.email":"Email","controls.form.input.file":"File Upload","controls.form.input.hidden":"Hidden Input","controls.form.input.number":"Number","controls.form.input.text":"Text Input","controls.form.radio-group":"Radio Group","controls.form.select":"Select","controls.form.textarea":"TextArea","controls.groups.form":"Form Fields","controls.groups.html":"HTML Elements","controls.groups.layout":"Layout","controls.html.divider":"Divider","controls.html.header":"Header","controls.html.paragraph":"Paragraph","controls.layout.column":"Column","controls.layout.row":"Row",copy:"Copy To Clipboard",danger:"Danger",defineColumnLayout:"Define a column layout",defineColumnWidths:"Define column widths",description:"Help Text",descriptionField:"Description","editing.row":"Editing Row",editorTitle:"Form Elements",field:"Field","field.property.invalid":"not valid","field.property.isChecked":"is checked","field.property.isNotVisible":"is not visible","field.property.isVisible":"is visible","field.property.label":"label","field.property.valid":"valid","field.property.value":"value",fieldNonEditable:"This field cannot be edited.",fieldRemoveWarning:"Are you sure you want to remove this field?",fileUpload:"File Upload",formUpdated:"Form Updated",getStarted:"Drag a field from the right to get started.",group:"Group",grouped:"Grouped",hidden:"Hidden Input",hide:"Edit",htmlElements:"HTML Elements",if:"If","if.condition.source.placeholder":"source","if.condition.target.placeholder":"target / value",info:"Info","input.date":"Date","input.text":"Text",label:"Label",labelCount:"{label} {count}",labelEmpty:"Field Label cannot be empty","lang.af":"Afrikaans","lang.ar":"Arabic","lang.cs":"Czech","lang.de":"German","lang.en":"English","lang.es":"Spanish","lang.fa":"Persian","lang.fi":"Finnish","lang.fr":"French","lang.hu":"Hungarian","lang.it":"Italian","lang.ja":"Japanese","lang.nb":"Norwegian Bokmål","lang.pl":"Polish","lang.pt":"Portuguese","lang.ro":"Romanian","lang.ru":"Russian","lang.th":"Thai","lang.tr":"Turkish","lang.zh":"Chinese",layout:"Layout",limitRole:"Limit access to one or more of the following roles:",mandatory:"Mandatory",maxlength:"Max Length","meta.group":"Group","meta.icon":"Ico","meta.label":"Label",minOptionMessage:"This field requires a minimum of 2 options",name:"Name",newOptionLabel:"New {type}",no:"No",number:"Number",off:"Off",on:"On","operator.contains":"contains","operator.equals":"equals","operator.notContains":"not contains","operator.notEquals":"not equal","operator.notVisible":"not visible","operator.visible":"visible",option:"Option",optional:"optional",optionEmpty:"Option value required",optionLabel:"Option {count}",options:"Options",or:"or",order:"Order","panel.label.attrs":"Attributes","panel.label.conditions":"Conditions","panel.label.config":"Configuration","panel.label.meta":"Meta","panel.label.options":"Options","panelEditButtons.attrs":"+ Attribute","panelEditButtons.conditions":"+ Condition","panelEditButtons.options":"+ Option",placeholder:"Placeholder","placeholder.className":"space separated classes","placeholder.email":"Enter you email","placeholder.label":"Label","placeholder.password":"Enter your password","placeholder.placeholder":"Placeholder","placeholder.text":"Enter some Text","placeholder.textarea":"Enter a lot of text","placeholder.value":"Value",preview:"Preview",primary:"Primary",remove:"Remove",removeMessage:"Remove Element",removeType:"Remove {type}",required:"Required",reset:"Reset",richText:"Rich Text Editor",roles:"Access",row:"Row","row.makeInputGroup":"Make this row an input group.","row.makeInputGroupDesc":"Input Groups enable users to add sets of inputs at a time.","row.settings.fieldsetWrap":"Wrap row in a &lt;fieldset&gt; tag","row.settings.fieldsetWrap.aria":"Wrap Row in Fieldset",save:"Save",secondary:"Secondary",select:"Select",selectColor:"Select Color",selectionsMessage:"Allow Multiple Selections",selectOptions:"Options",separator:"Separator",settings:"Settings",size:"Size",sizes:"Sizes","sizes.lg":"Large","sizes.m":"Default","sizes.sm":"Small","sizes.xs":"Extra Small",style:"Style",styles:"Styles","styles.btn":"Button Style","styles.btn.danger":"Danger","styles.btn.default":"Default","styles.btn.info":"Info","styles.btn.primary":"Primary","styles.btn.success":"Success","styles.btn.warning":"Warning",subtype:"Type",success:"Success",text:"Text Field",then:"Then","then.condition.target.placeholder":"target",toggle:"Toggle",ungrouped:"Un-Grouped",warning:"Warning",yes:"Yes"};const _m=Mm;Q.addLanguage("en-US",_m);const xm={get editor(){return{stickyControls:!1,allowEdit:!0,dataType:"json",debug:!1,sessionStorage:!1,editorContainer:null,svgSprite:Qu,style:Ef,iconFont:null,config:{},events:{},actions:{},controls:{},polyfills:Rh(),i18n:{location:"https://draggable.github.io/formeo/assets/lang/"},onLoad:()=>{}}}};let Qh=class{constructor({formData:e,...t},n){const p=ze(xm.editor,t),{actions:d,events:g,debug:m,config:l,editorContainer:f,...r}=p;f&&(this.editorContainer=typeof f=="string"?document.querySelector(f):f),this.opts=r,U.setOptions=r,ce.config=l,this.userFormData=n||e,this.Components=ce,this.dom=U,le.init({debug:m,...g}),Te.init({debug:m,sessionStorage:r.sessionStorage,...d}),this.tooltip=new ku,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",this.loadResources.bind(this)):this.loadResources()}get formData(){return this.Components.formData}set formData(e={}){this.userFormData=Vt(e),this.load(this.userFormData,this.opts)}get json(){return this.Components.json}clear(){this.userFormData=$n(),this.Components.load(this.userFormData,this.opts),this.render()}async loadResources(){document.removeEventListener("DOMContentLoaded",this.loadResources);const e=[];this.opts.polyfills&&hm(this.opts.polyfills),await um(this.opts.svgSprite),e.push(fm(this.opts.style)),e.push(Q.init({...this.opts.i18n,locale:window.sessionStorage?.getItem(Ql)}));const t=await Promise.all(e);return this.opts.allowEdit&&this.init(),t}init(){return xt.init(this.opts.controls,this.opts.stickyControls).then(e=>{this.controls=e,this.load(this.userFormData,this.opts),this.formId=ce.get("id"),this.i18n={setLang:t=>{window.sessionStorage?.setItem(Ql,t),Q.setCurrent(t).then(()=>{this.init()},console.error)}},this.opts.onLoad?.(this)})}load(e=this.userFormData,t=this.opts){this.Components.load(e,t),this.render()}render(){if(!this.controls)return window.requestAnimationFrame(()=>this.render());if(this.stages=Object.values(ce.get("stages")),this.opts.controlOnLeft)for(const n of this.stages)n.dom.style.order=1;const e={attrs:{className:"formeo formeo-editor",id:this.formId},content:[this.stages.map(({dom:n})=>n)]};Q.current.dir&&(e.attrs.dir=Q.current.dir,U.dir=Q.current.dir),this.editor=U.create(e),(this.controls.container||this.editor).appendChild(this.controls.dom),this.editorContainer&&(U.empty(this.editorContainer),this.editorContainer.appendChild(this.editor)),le.formeoLoaded=new window.CustomEvent("formeoLoaded",{detail:{formeo:this}}),document.dispatchEvent(le.formeoLoaded)}};const Ko="f-",au=c=>typeof c=="string"?document.querySelector(c):c,Lm=({editorContainer:c,renderContainer:e,formData:t,...n})=>{const p={renderContainer:au(e),editorContainer:au(c),formData:Vt(t)};return{elements:{},...n,...p}},qo=c=>c.match(Qf)?.[0]||c``,lu=c=>{if(!c||c.hasAttribute("hidden")||c.parentElement.hasAttribute("hidden"))return!1;const e=window.getComputedStyle(c);return!(e.display==="none"||e.visibility==="hidden"||e.opacity==="0")},Rm={isChecked:c=>c.checked,isNotChecked:c=>!c.checked,value:c=>c.value,isVisible:c=>lu(c),isNotVisible:c=>!lu(c)},km=()=>U.btnTemplate({className:"remove-input-group",children:U.icon("remove"),action:{mouseover:({target:c})=>c.parentElement.classList.add("will-remove"),mouseleave:({target:c})=>c.parentElement.classList.remove("will-remove"),click:({target:c})=>c.parentElement.remove()}}),cu={equals:As,notEquals:(c,e)=>!As(c,e),contains:(c,e)=>c.includes(e),notContains:(c,e)=>!c.includes(e)},Im=Object.entries(oh).reduce((c,[e,t])=>(c[t]=cu[e],c[e]=cu[e],c),{}),uu={equals:(c,{targetProperty:e,value:t})=>{c[`_${e}`]=c[e],c[e]=t}},Om=Object.entries(sh).reduce((c,[e,t])=>(c[t]=uu[e],c[e]=uu[e],c),{}),Dm={isChecked:c=>{c.checked=!0},isNotChecked:c=>{c.checked=!1},value:(c,{assignment:e,...t})=>{const n=Om[e]?.(c,t),p=new Event("input",{bubbles:!0});return c.dispatchEvent(p),n},isNotVisible:c=>{c?._required===void 0&&(c._required=c.required),c.parentElement.setAttribute("hidden",!0),c.required=!1},isVisible:c=>{c.parentElement.removeAttribute("hidden"),c.required=c._required}};let Zh=class{constructor(e,t){const{renderContainer:n,elements:p,formData:d}=Lm(e);this.container=n,this.form=Vt(t||d),this.dom=U,this.components=Object.create(null),this.elements=p}get formData(){return this.form}set formData(e){this.form=Vt(e)}get userData(){const e=new FormData(this.renderedForm),t={};for(const[n,p]of e.entries())t[n]?Array.isArray(t[n])?t[n].push(p):t[n]=[t[n],p]:t[n]=p;return t}set userData(e={}){const t=this.container.querySelector("form");for(const n of Object.keys(e)){const p=t.elements[n];if(p.length&&p[0].type==="checkbox"){const d=Array.isArray(e[n])?e[n]:[e[n]];for(const g of p)g.checked=d.includes(g.value)}else if(p.length&&p[0].type==="radio")for(const d of p)d.checked=d.value===e[n];else p.type&&(p.value=e[n])}}render(e=this.form){const t=this.getRenderedForm(e),n=this.container.querySelector(".formeo-render");n?n.replaceWith(t):this.container.appendChild(t)}getRenderedForm(e=this.form){this.form=Vt(e);const t=document.getElementsByClassName("formeo-render").length,n={tag:"form",id:this.form.id,className:`formeo-render formeo formeo-rendered-${t}`,children:this.processedData};return this.renderedForm=U.render(n),this.applyConditions(),this.renderedForm}get html(){return(this.renderedForm||this.getRenderedForm()).outerHTML}orderChildren=(e,t)=>t.reduce((n,p)=>(n.push(this.form[e][p]),n),[]);prefixId=e=>Ko+e;processColumn=({id:e,...t})=>({...t,id:this.prefixId(e),children:this.processFields(t.children),style:`width: ${t.config.width||"100%"}`});processRows=e=>this.orderChildren("rows",this.form.stages[e].children).reduce((t,n)=>(n&&t.push(this.processRow(n)),t),[]);cacheComponent=e=>(this.components[qo(e.id)]=e,e);processRow=(e,t="row")=>{const{config:n,id:p}=e,d=[`formeo-${t}-wrap`],g={...e,children:this.processColumns(e.id),id:this.prefixId(p)};this.cacheComponent(g);const l=[{condition:n.legend,result:()=>({tag:n.fieldset?"legend":"h3",children:n.legend})},{condition:!0,result:()=>g},{condition:n.inputGroup,result:()=>this.addButton(p)}].reduce((f,{condition:r,result:o})=>(r&&f.push(o()),f),[]);return n.inputGroup&&d.push(`${Ko}input-group-wrap`),{tag:n.fieldset?"fieldset":"div",className:d,children:l}};cloneComponentData=e=>{const{children:t=[],id:n,...p}=this.components[e];return{...p,id:We(n),children:t?.length&&t.map(({id:d})=>this.cloneComponentData(qo(d)))}};addButton=e=>({tag:"button",attrs:{className:"add-input-group btn pull-right",type:"button"},children:"Add +",action:{click:t=>{const n=t.target.parentElement,p=U.create(this.cloneComponentData(e));n.insertBefore(p,n.lastChild);const d=U.create(km());p.appendChild(d)}}});processColumns=e=>this.orderChildren("columns",this.form.rows[e].children).map(t=>this.cacheComponent(this.processColumn(t)));processFields=e=>this.orderChildren("fields",e).map(({id:t,...n})=>{const p=n.config?.controlId||n.meta?.id,{action:d={},dependencies:g={}}=this.elements[p]||{};g&&Gh(g);const m=ze({action:d},n);return this.cacheComponent({...m,id:this.prefixId(t)})});get processedData(){return Object.values(this.form.stages).map(e=>(e.children=this.processRows(e.id),e.className=kt,this.components[qo(e.id)]=e,e))}handleComponentCondition=(e,t,n)=>{if(e.length){for(const g of e)this.handleComponentCondition(g,t,n);return}const p=Nm(e);p&&e.addEventListener(p,g=>{if(this.evaluateCondition(t,g))for(const m of n)this.execResult(m,g)},!1);const d={target:e};if(this.evaluateCondition(t,d))for(const g of n)this.execResult(g,d)};applyConditions=()=>{for(const{conditions:e}of Object.values(this.components))if(e)for(const t of e){const{if:n,then:p}=t;for(const d of n){const{source:g,target:m}=d;if(Pe(g)){const{component:l,options:f}=this.getComponent(g),r=f||l;this.handleComponentCondition(r,d,p)}if(Pe(m)){const{component:l,options:f}=this.getComponent(m),r=f||l;this.handleComponentCondition(r,d,p)}}}};evaluateCondition=({source:e,sourceProperty:t,targetProperty:n,comparison:p,target:d})=>{const g=this.getComponentProperty(e,t);if(typeof g=="boolean")return g;const m=String(Pe(d)?this.getComponentProperty(d,n):d);return Im[p]?.(g,m)};execResult=({target:e,targetProperty:t,assignment:n,value:p})=>{if(Pe(e)){const{component:d,option:g}=this.getComponent(e),m=g||d;Dm[t]?.(m,{targetProperty:t,assignment:n,value:p})}};getComponentProperty=(e,t)=>{const{component:n,option:p}=this.getComponent(e),d=p||n;return Rm[t]?.(d)||d[t]};getComponent=e=>{const t={component:null};if(!Pe(e))return null;const[,n,p,d]=mt(e),g=this.renderedForm.querySelector(`#${Ko}${n}`);if(!g)return t;if(t.component=g,p){const m=g.querySelectorAll("input"),l=m[d];return t.options=m,t.option=l,t}return t};getComponents=e=>{const t=[],n=e.slice(e.indexOf(".")+1);return t.push(...this.renderedForm.querySelectorAll(`[name=f-${n}]`)),t}};const Nm=c=>{const e=[["input",n=>["textarea","text"].includes(n.type)],["change",n=>["select"].includes(n.tagName.toLowerCase())||["checkbox","radio"].includes(n.type)]],[t]=e.find(n=>n[1](c))||[!1];return t};window!==void 0&&(window.FormeoEditor=Qh,window.FormeoRenderer=Zh);const Zs=Qh,Js=Zh,Fm={rows:{all:{events:{onAdd:c=>{if(console.log(`You just added a new row with the id "${c.target.id}"`,c.index),c.index===2){const e=c.target.dom.querySelector(".action-btn-wrap"),t=document.createElement("button");t.type="button",t.className="btn btn-sm btn-secondary",t.textContent="Add Column",t.style.border="1px solid #ccc",t.style.width="auto",t.addEventListener("click",()=>{c.target.addChild()}),e.appendChild(t)}}}}},fields:{checkbox:{actionButtons:{},panels:{attrs:{hideDisabled:!0}}}}},Pm={sortable:!1,groupOrder:["common","html"],disable:{},elements:[{tag:"input",config:{label:"Email",disabledAttrs:["type"],lockedAttrs:["required","className"]},meta:{group:"common",id:"email",icon:"@"},attrs:{className:"custom-email",type:"email",required:!0}}],elementOrder:{common:["button","checkbox","date-input","hidden","upload","number","radio","select","text-input","textarea"]}},Wm=".build-form",Bm=".render-form",en={editorContainer:Wm,i18n:{location:"./assets/lang"},actions:{},controls:Pm,config:Fm,events:{onSave:console.log,onChange:console.log},sessionStorage:!0,editPanelOrder:["attrs","options"],onLoad:()=>{console.log("demo loaded")}},ea={renderContainer:Bm,elements:{tinymce:{action:{onRender:c=>{if(c.id){const e=`#${c.id}`;window.tinymce.remove(e),window.tinymce.init({selector:e})}}}}}};async function Hm(c){c.innerHTML=`
10
+ `),n={};for(let p,d=0;d<t.length;d++)p=/^(.+?) *?= *?([^\n]+)/.exec(t[d]),p&&(n[p[1]]=p[2].replace(/(^\s+|\s+$)/g,""));return n}loadLang(e,t=!0){const n=this;return new Promise(function(p,d){if(n.loaded.indexOf(e)!==-1&&t)return n.applyLanguage(n.langs[e]),p(n.langs[e]);{const g=[n.config.location,e,n.config.extension].join("");return hd(g).then(m=>{const c=Gt.processFile(m);return n.applyLanguage(e,c),n.loaded.push(e),p(n.langs[e])}).catch(m=>{console.error(m);const c=n.applyLanguage(e);p(c)})}})}applyLanguage(e,t={}){const n=this.config.override[e]||{},p=this.langs[e]||{};return this.langs[e]={...p,...t,...n},this.langs[e]}get getLangs(){return this.config.langs}async setCurrent(e="en-US"){return await this.loadLang(e),this.locale=e,this.current=this.langs[e],this.current}}const Q=new Gt;(function(){try{if(typeof document<"u"){var l=document.createElement("style");l.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(l)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();var dd=Object.defineProperty,fd=(l,e,t)=>e in l?dd(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t,Ke=(l,e,t)=>fd(l,typeof e!="symbol"?e+"":e,t);const pd="_3x4ZIcu-",gd="JIt36hCJ",Nt={tooltip:pd,visible:gd},md={triggerName:"tooltip"};class Pu{constructor(e=md){Ke(this,"triggerName"),Ke(this,"tooltip"),Ke(this,"activeTriggerType",null),Ke(this,"spacing",12),Ke(this,"handleClick",t=>{const n=this.triggerName,p=t.target.closest(`[${n}][${n}-type="click"]`);if(p)if(this.isVisible())this.hide();else{const d=p.getAttribute(`${n}`);this.show(p,d),this.activeTriggerType="click"}else this.hide()}),Ke(this,"handleMouseOver",t=>{const n=this.triggerName,p=t.target.closest(`[${n}]`);if(this.activeTriggerType!=="click"&&p?.getAttribute(`${n}-type`)!=="click"){const d=p?.getAttribute(`${n}`);d&&(this.show(p,d),this.activeTriggerType="hover")}}),Ke(this,"handleMouseOut",t=>{const n=this.triggerName,p=t.target.closest(`[${n}]`);this.activeTriggerType!=="click"&&p?.getAttribute(`${n}-type`)!=="click"&&this.hide()}),Ke(this,"handleResize",()=>{this.isVisible()&&this.hide()}),Ke(this,"handleScroll",()=>{this.isVisible()&&this.hide()}),this.triggerName=`data-${e.triggerName}`,this.tooltip=document.createElement("div"),this.tooltip.className=`d-tooltip ${Nt.tooltip}`,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(Nt.visible)}calculatePosition(e){const t=e.getBoundingClientRect(),n=this.tooltip.getBoundingClientRect(),p=[{name:"top",x:t.left+(t.width-n.width)/2,y:t.top-n.height-this.spacing},{name:"bottom",x:t.left+(t.width-n.width)/2,y:t.bottom+this.spacing},{name:"left",x:t.left-n.width-this.spacing,y:t.top+(t.height-n.height)/2},{name:"right",x:t.right+this.spacing,y:t.top+(t.height-n.height)/2},{name:"top-left",x:t.left,y:t.top-n.height-this.spacing},{name:"top-right",x:t.right-n.width,y:t.top-n.height-this.spacing},{name:"bottom-left",x:t.left,y:t.bottom+this.spacing},{name:"bottom-right",x:t.right-n.width,y:t.bottom+this.spacing}];return p.find(d=>this.fitsInViewport(d,n))||p[0]}fitsInViewport(e,t){return e.x>=0&&e.y>=0&&e.x+t.width<=window.innerWidth&&e.y+t.height<=window.innerHeight?[[e.x,e.y],[e.x+t.width,e.y],[e.x,e.y+t.height],[e.x+t.width,e.y+t.height],[e.x+t.width/2,e.y+t.height/2]].flatMap(([m,c])=>Array.from(document.elementsFromPoint(m,c))).filter(m=>{if(this.tooltip.contains(m)||m===this.tooltip||m.classList.contains(Nt.tooltip)||getComputedStyle(m).pointerEvents==="none")return!1}).length===0:!1}show(e,t){this.tooltip.innerHTML=t??"",this.tooltip.classList.add(Nt.visible);const n=this.calculatePosition(e);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(Nt.visible),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()}}window!==void 0&&(window.SmartTooltip=Pu);const vd="formeo",yd="4.1.4",Wu={name:vd,version:yd};var an=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rt(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Jn,ha;function bd(){if(ha)return Jn;ha=1;function l(){this.__data__=[],this.size=0}return Jn=l,Jn}var ei,da;function nn(){if(da)return ei;da=1;function l(e,t){return e===t||e!==e&&t!==t}return ei=l,ei}var ti,fa;function Nn(){if(fa)return ti;fa=1;var l=nn();function e(t,n){for(var p=t.length;p--;)if(l(t[p][0],n))return p;return-1}return ti=e,ti}var ni,pa;function wd(){if(pa)return ni;pa=1;var l=Nn(),e=Array.prototype,t=e.splice;function n(p){var d=this.__data__,g=l(d,p);if(g<0)return!1;var m=d.length-1;return g==m?d.pop():t.call(d,g,1),--this.size,!0}return ni=n,ni}var ii,ga;function Cd(){if(ga)return ii;ga=1;var l=Nn();function e(t){var n=this.__data__,p=l(n,t);return p<0?void 0:n[p][1]}return ii=e,ii}var ri,ma;function Sd(){if(ma)return ri;ma=1;var l=Nn();function e(t){return l(this.__data__,t)>-1}return ri=e,ri}var oi,va;function Ad(){if(va)return oi;va=1;var l=Nn();function e(t,n){var p=this.__data__,d=l(p,t);return d<0?(++this.size,p.push([t,n])):p[d][1]=n,this}return oi=e,oi}var si,ya;function Fn(){if(ya)return si;ya=1;var l=bd(),e=wd(),t=Cd(),n=Sd(),p=Ad();function d(g){var m=-1,c=g==null?0:g.length;for(this.clear();++m<c;){var f=g[m];this.set(f[0],f[1])}}return d.prototype.clear=l,d.prototype.delete=e,d.prototype.get=t,d.prototype.has=n,d.prototype.set=p,si=d,si}var ai,ba;function $d(){if(ba)return ai;ba=1;var l=Fn();function e(){this.__data__=new l,this.size=0}return ai=e,ai}var li,wa;function Ed(){if(wa)return li;wa=1;function l(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}return li=l,li}var ci,Ca;function Td(){if(Ca)return ci;Ca=1;function l(e){return this.__data__.get(e)}return ci=l,ci}var ui,Sa;function Md(){if(Sa)return ui;Sa=1;function l(e){return this.__data__.has(e)}return ui=l,ui}var hi,Aa;function Bu(){if(Aa)return hi;Aa=1;var l=typeof an=="object"&&an&&an.Object===Object&&an;return hi=l,hi}var di,$a;function Ve(){if($a)return di;$a=1;var l=Bu(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=l||e||Function("return this")();return di=t,di}var fi,Ea;function Pn(){if(Ea)return fi;Ea=1;var l=Ve(),e=l.Symbol;return fi=e,fi}var pi,Ta;function _d(){if(Ta)return pi;Ta=1;var l=Pn(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,p=l?l.toStringTag:void 0;function d(g){var m=t.call(g,p),c=g[p];try{g[p]=void 0;var f=!0}catch{}var r=n.call(g);return f&&(m?g[p]=c:delete g[p]),r}return pi=d,pi}var gi,Ma;function xd(){if(Ma)return gi;Ma=1;var l=Object.prototype,e=l.toString;function t(n){return e.call(n)}return gi=t,gi}var mi,_a;function kt(){if(_a)return mi;_a=1;var l=Pn(),e=_d(),t=xd(),n="[object Null]",p="[object Undefined]",d=l?l.toStringTag:void 0;function g(m){return m==null?m===void 0?p:n:d&&d in Object(m)?e(m):t(m)}return mi=g,mi}var vi,xa;function ct(){if(xa)return vi;xa=1;function l(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return vi=l,vi}var yi,La;function xs(){if(La)return yi;La=1;var l=kt(),e=ct(),t="[object AsyncFunction]",n="[object Function]",p="[object GeneratorFunction]",d="[object Proxy]";function g(m){if(!e(m))return!1;var c=l(m);return c==n||c==p||c==t||c==d}return yi=g,yi}var bi,Ra;function Ld(){if(Ra)return bi;Ra=1;var l=Ve(),e=l["__core-js_shared__"];return bi=e,bi}var wi,ka;function Rd(){if(ka)return wi;ka=1;var l=Ld(),e=(function(){var n=/[^.]+$/.exec(l&&l.keys&&l.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function t(n){return!!e&&e in n}return wi=t,wi}var Ci,Oa;function Hu(){if(Oa)return Ci;Oa=1;var l=Function.prototype,e=l.toString;function t(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return Ci=t,Ci}var Si,Da;function kd(){if(Da)return Si;Da=1;var l=xs(),e=Rd(),t=ct(),n=Hu(),p=/[\\^$.*+?()[\]{}|]/g,d=/^\[object .+?Constructor\]$/,g=Function.prototype,m=Object.prototype,c=g.toString,f=m.hasOwnProperty,r=RegExp("^"+c.call(f).replace(p,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function o(s){if(!t(s)||e(s))return!1;var a=l(s)?r:d;return a.test(n(s))}return Si=o,Si}var Ai,Ia;function Od(){if(Ia)return Ai;Ia=1;function l(e,t){return e?.[t]}return Ai=l,Ai}var $i,Na;function yt(){if(Na)return $i;Na=1;var l=kd(),e=Od();function t(n,p){var d=e(n,p);return l(d)?d:void 0}return $i=t,$i}var Ei,Fa;function Ls(){if(Fa)return Ei;Fa=1;var l=yt(),e=Ve(),t=l(e,"Map");return Ei=t,Ei}var Ti,Pa;function Wn(){if(Pa)return Ti;Pa=1;var l=yt(),e=l(Object,"create");return Ti=e,Ti}var Mi,Wa;function Dd(){if(Wa)return Mi;Wa=1;var l=Wn();function e(){this.__data__=l?l(null):{},this.size=0}return Mi=e,Mi}var _i,Ba;function Id(){if(Ba)return _i;Ba=1;function l(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return _i=l,_i}var xi,Ha;function Nd(){if(Ha)return xi;Ha=1;var l=Wn(),e="__lodash_hash_undefined__",t=Object.prototype,n=t.hasOwnProperty;function p(d){var g=this.__data__;if(l){var m=g[d];return m===e?void 0:m}return n.call(g,d)?g[d]:void 0}return xi=p,xi}var Li,za;function Fd(){if(za)return Li;za=1;var l=Wn(),e=Object.prototype,t=e.hasOwnProperty;function n(p){var d=this.__data__;return l?d[p]!==void 0:t.call(d,p)}return Li=n,Li}var Ri,ja;function Pd(){if(ja)return Ri;ja=1;var l=Wn(),e="__lodash_hash_undefined__";function t(n,p){var d=this.__data__;return this.size+=this.has(n)?0:1,d[n]=l&&p===void 0?e:p,this}return Ri=t,Ri}var ki,Ua;function Wd(){if(Ua)return ki;Ua=1;var l=Dd(),e=Id(),t=Nd(),n=Fd(),p=Pd();function d(g){var m=-1,c=g==null?0:g.length;for(this.clear();++m<c;){var f=g[m];this.set(f[0],f[1])}}return d.prototype.clear=l,d.prototype.delete=e,d.prototype.get=t,d.prototype.has=n,d.prototype.set=p,ki=d,ki}var Oi,Ga;function Bd(){if(Ga)return Oi;Ga=1;var l=Wd(),e=Fn(),t=Ls();function n(){this.size=0,this.__data__={hash:new l,map:new(t||e),string:new l}}return Oi=n,Oi}var Di,Va;function Hd(){if(Va)return Di;Va=1;function l(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return Di=l,Di}var Ii,Ka;function Bn(){if(Ka)return Ii;Ka=1;var l=Hd();function e(t,n){var p=t.__data__;return l(n)?p[typeof n=="string"?"string":"hash"]:p.map}return Ii=e,Ii}var Ni,qa;function zd(){if(qa)return Ni;qa=1;var l=Bn();function e(t){var n=l(this,t).delete(t);return this.size-=n?1:0,n}return Ni=e,Ni}var Fi,Ya;function jd(){if(Ya)return Fi;Ya=1;var l=Bn();function e(t){return l(this,t).get(t)}return Fi=e,Fi}var Pi,Xa;function Ud(){if(Xa)return Pi;Xa=1;var l=Bn();function e(t){return l(this,t).has(t)}return Pi=e,Pi}var Wi,Qa;function Gd(){if(Qa)return Wi;Qa=1;var l=Bn();function e(t,n){var p=l(this,t),d=p.size;return p.set(t,n),this.size+=p.size==d?0:1,this}return Wi=e,Wi}var Bi,Za;function Rs(){if(Za)return Bi;Za=1;var l=Bd(),e=zd(),t=jd(),n=Ud(),p=Gd();function d(g){var m=-1,c=g==null?0:g.length;for(this.clear();++m<c;){var f=g[m];this.set(f[0],f[1])}}return d.prototype.clear=l,d.prototype.delete=e,d.prototype.get=t,d.prototype.has=n,d.prototype.set=p,Bi=d,Bi}var Hi,Ja;function Vd(){if(Ja)return Hi;Ja=1;var l=Fn(),e=Ls(),t=Rs(),n=200;function p(d,g){var m=this.__data__;if(m instanceof l){var c=m.__data__;if(!e||c.length<n-1)return c.push([d,g]),this.size=++m.size,this;m=this.__data__=new t(c)}return m.set(d,g),this.size=m.size,this}return Hi=p,Hi}var zi,el;function zu(){if(el)return zi;el=1;var l=Fn(),e=$d(),t=Ed(),n=Td(),p=Md(),d=Vd();function g(m){var c=this.__data__=new l(m);this.size=c.size}return g.prototype.clear=e,g.prototype.delete=t,g.prototype.get=n,g.prototype.has=p,g.prototype.set=d,zi=g,zi}var ji,tl;function ju(){if(tl)return ji;tl=1;var l=yt(),e=(function(){try{var t=l(Object,"defineProperty");return t({},"",{}),t}catch{}})();return ji=e,ji}var Ui,nl;function ks(){if(nl)return Ui;nl=1;var l=ju();function e(t,n,p){n=="__proto__"&&l?l(t,n,{configurable:!0,enumerable:!0,value:p,writable:!0}):t[n]=p}return Ui=e,Ui}var Gi,il;function Uu(){if(il)return Gi;il=1;var l=ks(),e=nn();function t(n,p,d){(d!==void 0&&!e(n[p],d)||d===void 0&&!(p in n))&&l(n,p,d)}return Gi=t,Gi}var Vi,rl;function Kd(){if(rl)return Vi;rl=1;function l(e){return function(t,n,p){for(var d=-1,g=Object(t),m=p(t),c=m.length;c--;){var f=m[e?c:++d];if(n(g[f],f,g)===!1)break}return t}}return Vi=l,Vi}var Ki,ol;function qd(){if(ol)return Ki;ol=1;var l=Kd(),e=l();return Ki=e,Ki}var Wt={exports:{}};Wt.exports;var sl;function Yd(){return sl||(sl=1,(function(l,e){var t=Ve(),n=e&&!e.nodeType&&e,p=n&&!0&&l&&!l.nodeType&&l,d=p&&p.exports===n,g=d?t.Buffer:void 0,m=g?g.allocUnsafe:void 0;function c(f,r){if(r)return f.slice();var o=f.length,s=m?m(o):new f.constructor(o);return f.copy(s),s}l.exports=c})(Wt,Wt.exports)),Wt.exports}var qi,al;function Gu(){if(al)return qi;al=1;var l=Ve(),e=l.Uint8Array;return qi=e,qi}var Yi,ll;function Xd(){if(ll)return Yi;ll=1;var l=Gu();function e(t){var n=new t.constructor(t.byteLength);return new l(n).set(new l(t)),n}return Yi=e,Yi}var Xi,cl;function Qd(){if(cl)return Xi;cl=1;var l=Xd();function e(t,n){var p=n?l(t.buffer):t.buffer;return new t.constructor(p,t.byteOffset,t.length)}return Xi=e,Xi}var Qi,ul;function Zd(){if(ul)return Qi;ul=1;function l(e,t){var n=-1,p=e.length;for(t||(t=Array(p));++n<p;)t[n]=e[n];return t}return Qi=l,Qi}var Zi,hl;function Jd(){if(hl)return Zi;hl=1;var l=ct(),e=Object.create,t=(function(){function n(){}return function(p){if(!l(p))return{};if(e)return e(p);n.prototype=p;var d=new n;return n.prototype=void 0,d}})();return Zi=t,Zi}var Ji,dl;function Vu(){if(dl)return Ji;dl=1;function l(e,t){return function(n){return e(t(n))}}return Ji=l,Ji}var er,fl;function Ku(){if(fl)return er;fl=1;var l=Vu(),e=l(Object.getPrototypeOf,Object);return er=e,er}var tr,pl;function Os(){if(pl)return tr;pl=1;var l=Object.prototype;function e(t){var n=t&&t.constructor,p=typeof n=="function"&&n.prototype||l;return t===p}return tr=e,tr}var nr,gl;function ef(){if(gl)return nr;gl=1;var l=Jd(),e=Ku(),t=Os();function n(p){return typeof p.constructor=="function"&&!t(p)?l(e(p)):{}}return nr=n,nr}var ir,ml;function bt(){if(ml)return ir;ml=1;function l(e){return e!=null&&typeof e=="object"}return ir=l,ir}var rr,vl;function tf(){if(vl)return rr;vl=1;var l=kt(),e=bt(),t="[object Arguments]";function n(p){return e(p)&&l(p)==t}return rr=n,rr}var or,yl;function qu(){if(yl)return or;yl=1;var l=tf(),e=bt(),t=Object.prototype,n=t.hasOwnProperty,p=t.propertyIsEnumerable,d=l((function(){return arguments})())?l:function(g){return e(g)&&n.call(g,"callee")&&!p.call(g,"callee")};return or=d,or}var sr,bl;function wt(){if(bl)return sr;bl=1;var l=Array.isArray;return sr=l,sr}var ar,wl;function Yu(){if(wl)return ar;wl=1;var l=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=l}return ar=e,ar}var lr,Cl;function Hn(){if(Cl)return lr;Cl=1;var l=xs(),e=Yu();function t(n){return n!=null&&e(n.length)&&!l(n)}return lr=t,lr}var cr,Sl;function nf(){if(Sl)return cr;Sl=1;var l=Hn(),e=bt();function t(n){return e(n)&&l(n)}return cr=t,cr}var Bt={exports:{}},ur,Al;function rf(){if(Al)return ur;Al=1;function l(){return!1}return ur=l,ur}Bt.exports;var $l;function Ds(){return $l||($l=1,(function(l,e){var t=Ve(),n=rf(),p=e&&!e.nodeType&&e,d=p&&!0&&l&&!l.nodeType&&l,g=d&&d.exports===p,m=g?t.Buffer:void 0,c=m?m.isBuffer:void 0,f=c||n;l.exports=f})(Bt,Bt.exports)),Bt.exports}var hr,El;function of(){if(El)return hr;El=1;var l=kt(),e=Ku(),t=bt(),n="[object Object]",p=Function.prototype,d=Object.prototype,g=p.toString,m=d.hasOwnProperty,c=g.call(Object);function f(r){if(!t(r)||l(r)!=n)return!1;var o=e(r);if(o===null)return!0;var s=m.call(o,"constructor")&&o.constructor;return typeof s=="function"&&s instanceof s&&g.call(s)==c}return hr=f,hr}var dr,Tl;function sf(){if(Tl)return dr;Tl=1;var l=kt(),e=Yu(),t=bt(),n="[object Arguments]",p="[object Array]",d="[object Boolean]",g="[object Date]",m="[object Error]",c="[object Function]",f="[object Map]",r="[object Number]",o="[object Object]",s="[object RegExp]",a="[object Set]",i="[object String]",u="[object WeakMap]",h="[object ArrayBuffer]",y="[object DataView]",b="[object Float32Array]",T="[object Float64Array]",$="[object Int8Array]",A="[object Int16Array]",S="[object Int32Array]",M="[object Uint8Array]",R="[object Uint8ClampedArray]",L="[object Uint16Array]",_="[object Uint32Array]",O={};O[b]=O[T]=O[$]=O[A]=O[S]=O[M]=O[R]=O[L]=O[_]=!0,O[n]=O[p]=O[h]=O[d]=O[y]=O[g]=O[m]=O[c]=O[f]=O[r]=O[o]=O[s]=O[a]=O[i]=O[u]=!1;function w(v){return t(v)&&e(v.length)&&!!O[l(v)]}return dr=w,dr}var fr,Ml;function af(){if(Ml)return fr;Ml=1;function l(e){return function(t){return e(t)}}return fr=l,fr}var Ht={exports:{}};Ht.exports;var _l;function lf(){return _l||(_l=1,(function(l,e){var t=Bu(),n=e&&!e.nodeType&&e,p=n&&!0&&l&&!l.nodeType&&l,d=p&&p.exports===n,g=d&&t.process,m=(function(){try{var c=p&&p.require&&p.require("util").types;return c||g&&g.binding&&g.binding("util")}catch{}})();l.exports=m})(Ht,Ht.exports)),Ht.exports}var pr,xl;function Is(){if(xl)return pr;xl=1;var l=sf(),e=af(),t=lf(),n=t&&t.isTypedArray,p=n?e(n):l;return pr=p,pr}var gr,Ll;function Xu(){if(Ll)return gr;Ll=1;function l(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return gr=l,gr}var mr,Rl;function Qu(){if(Rl)return mr;Rl=1;var l=ks(),e=nn(),t=Object.prototype,n=t.hasOwnProperty;function p(d,g,m){var c=d[g];(!(n.call(d,g)&&e(c,m))||m===void 0&&!(g in d))&&l(d,g,m)}return mr=p,mr}var vr,kl;function cf(){if(kl)return vr;kl=1;var l=Qu(),e=ks();function t(n,p,d,g){var m=!d;d||(d={});for(var c=-1,f=p.length;++c<f;){var r=p[c],o=g?g(d[r],n[r],r,d,n):void 0;o===void 0&&(o=n[r]),m?e(d,r,o):l(d,r,o)}return d}return vr=t,vr}var yr,Ol;function uf(){if(Ol)return yr;Ol=1;function l(e,t){for(var n=-1,p=Array(e);++n<e;)p[n]=t(n);return p}return yr=l,yr}var br,Dl;function Ns(){if(Dl)return br;Dl=1;var l=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(n,p){var d=typeof n;return p=p??l,!!p&&(d=="number"||d!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<p}return br=t,br}var wr,Il;function Zu(){if(Il)return wr;Il=1;var l=uf(),e=qu(),t=wt(),n=Ds(),p=Ns(),d=Is(),g=Object.prototype,m=g.hasOwnProperty;function c(f,r){var o=t(f),s=!o&&e(f),a=!o&&!s&&n(f),i=!o&&!s&&!a&&d(f),u=o||s||a||i,h=u?l(f.length,String):[],y=h.length;for(var b in f)(r||m.call(f,b))&&!(u&&(b=="length"||a&&(b=="offset"||b=="parent")||i&&(b=="buffer"||b=="byteLength"||b=="byteOffset")||p(b,y)))&&h.push(b);return h}return wr=c,wr}var Cr,Nl;function hf(){if(Nl)return Cr;Nl=1;function l(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}return Cr=l,Cr}var Sr,Fl;function df(){if(Fl)return Sr;Fl=1;var l=ct(),e=Os(),t=hf(),n=Object.prototype,p=n.hasOwnProperty;function d(g){if(!l(g))return t(g);var m=e(g),c=[];for(var f in g)f=="constructor"&&(m||!p.call(g,f))||c.push(f);return c}return Sr=d,Sr}var Ar,Pl;function Ju(){if(Pl)return Ar;Pl=1;var l=Zu(),e=df(),t=Hn();function n(p){return t(p)?l(p,!0):e(p)}return Ar=n,Ar}var $r,Wl;function ff(){if(Wl)return $r;Wl=1;var l=cf(),e=Ju();function t(n){return l(n,e(n))}return $r=t,$r}var Er,Bl;function pf(){if(Bl)return Er;Bl=1;var l=Uu(),e=Yd(),t=Qd(),n=Zd(),p=ef(),d=qu(),g=wt(),m=nf(),c=Ds(),f=xs(),r=ct(),o=of(),s=Is(),a=Xu(),i=ff();function u(h,y,b,T,$,A,S){var M=a(h,b),R=a(y,b),L=S.get(R);if(L){l(h,b,L);return}var _=A?A(M,R,b+"",h,y,S):void 0,O=_===void 0;if(O){var w=g(R),v=!w&&c(R),C=!w&&!v&&s(R);_=R,w||v||C?g(M)?_=M:m(M)?_=n(M):v?(O=!1,_=e(R,!0)):C?(O=!1,_=t(R,!0)):_=[]:o(R)||d(R)?(_=M,d(M)?_=i(M):(!r(M)||f(M))&&(_=p(R))):O=!1}O&&(S.set(R,_),$(_,R,T,A,S),S.delete(R)),l(h,b,_)}return Er=u,Er}var Tr,Hl;function gf(){if(Hl)return Tr;Hl=1;var l=zu(),e=Uu(),t=qd(),n=pf(),p=ct(),d=Ju(),g=Xu();function m(c,f,r,o,s){c!==f&&t(f,function(a,i){if(s||(s=new l),p(a))n(c,f,i,r,m,o,s);else{var u=o?o(g(c,i),a,i+"",c,f,s):void 0;u===void 0&&(u=a),e(c,i,u)}},d)}return Tr=m,Tr}var Mr,zl;function eh(){if(zl)return Mr;zl=1;function l(e){return e}return Mr=l,Mr}var _r,jl;function mf(){if(jl)return _r;jl=1;function l(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}return _r=l,_r}var xr,Ul;function vf(){if(Ul)return xr;Ul=1;var l=mf(),e=Math.max;function t(n,p,d){return p=e(p===void 0?n.length-1:p,0),function(){for(var g=arguments,m=-1,c=e(g.length-p,0),f=Array(c);++m<c;)f[m]=g[p+m];m=-1;for(var r=Array(p+1);++m<p;)r[m]=g[m];return r[p]=d(f),l(n,this,r)}}return xr=t,xr}var Lr,Gl;function yf(){if(Gl)return Lr;Gl=1;function l(e){return function(){return e}}return Lr=l,Lr}var Rr,Vl;function bf(){if(Vl)return Rr;Vl=1;var l=yf(),e=ju(),t=eh(),n=e?function(p,d){return e(p,"toString",{configurable:!0,enumerable:!1,value:l(d),writable:!0})}:t;return Rr=n,Rr}var kr,Kl;function wf(){if(Kl)return kr;Kl=1;var l=800,e=16,t=Date.now;function n(p){var d=0,g=0;return function(){var m=t(),c=e-(m-g);if(g=m,c>0){if(++d>=l)return arguments[0]}else d=0;return p.apply(void 0,arguments)}}return kr=n,kr}var Or,ql;function Cf(){if(ql)return Or;ql=1;var l=bf(),e=wf(),t=e(l);return Or=t,Or}var Dr,Yl;function Sf(){if(Yl)return Dr;Yl=1;var l=eh(),e=vf(),t=Cf();function n(p,d){return t(e(p,d,l),p+"")}return Dr=n,Dr}var Ir,Xl;function Af(){if(Xl)return Ir;Xl=1;var l=nn(),e=Hn(),t=Ns(),n=ct();function p(d,g,m){if(!n(m))return!1;var c=typeof g;return(c=="number"?e(m)&&t(g,m.length):c=="string"&&g in m)?l(m[g],d):!1}return Ir=p,Ir}var Nr,Ql;function $f(){if(Ql)return Nr;Ql=1;var l=Sf(),e=Af();function t(n){return l(function(p,d){var g=-1,m=d.length,c=m>1?d[m-1]:void 0,f=m>2?d[2]:void 0;for(c=n.length>3&&typeof c=="function"?(m--,c):void 0,f&&e(d[0],d[1],f)&&(c=m<3?void 0:c,m=1),p=Object(p);++g<m;){var r=d[g];r&&n(p,r,g,c)}return p})}return Nr=t,Nr}var Fr,Zl;function Ef(){if(Zl)return Fr;Zl=1;var l=gf(),e=$f(),t=e(function(n,p,d,g){l(n,p,d,g)});return Fr=t,Fr}var Tf=Ef();const Mf=Rt(Tf),_f=()=>crypto.randomUUID().slice(0,8),xf=()=>_f().slice(0,8),Jl=(l="",e)=>{if(!e)return console.warn("utils.match missing argument 2."),!1;const t=/[|\\{}()[\]^*$+?.]/g;let n=typeof e=="string"?[e]:e;n=n.map(d=>d==="*"?"":d.replace(t,"\\$&"));let p=!0;return n.length&&(p=!new RegExp(n.join("|"),"i").exec(l)),p},Lf=(l,e)=>{const t=l.indexOf(e);t!==-1&&l.splice(t,1)},Le=l=>{const e=l.className?.match(jf);return e&&Hf[e[0]]},gt=l=>Array.from(new Set(l)),We=l=>l?.attrs?.id||l?.id||xf(),je=(l,e)=>Mf({},l,e,(n,p)=>{if(Array.isArray(n))return p!=null?gt(n.concat(p)):p;if(Array.isArray(p))return n!=null?gt(p.concat(n)):p}),Xe=l=>{let e;const t=l instanceof Promise;if(l===null||!(typeof l=="object")||t)return l;if(l instanceof Date)return e=new Date,e.setTime(l.getTime()),e;if(Array.isArray(l)){e=[];for(let p=0,d=l.length;p<d;p++)e[p]=Xe(l[p]);return e}if(l instanceof Object){e={};for(const p in l)Object.hasOwn(l,p)&&(e[p]=Xe(l[p]));return e}throw new Error("Unable to copy Object, type not supported.")},Pr=(l,e)=>l/e*100,ys=l=>`${l.toString()}%`,th=Object.create(null,{get:{value:l=>{const e=window.sessionStorage?.getItem(l);try{return JSON.parse(e)}catch{return e}}},set:{value:(l,e)=>{try{return window.sessionStorage?.setItem(l,JSON.stringify(e))}catch(t){console.error(t)}}}}),Pe=l=>/^(stage|row|column|field)s./.test(l),Rf=l=>Ff.test(l);function kf(l,e=zs){let t=0;return function(...n){const p=Date.now();p-t>=e&&(t=p,l.apply(this,n))}}function $n(l,e=mt){let t;return function(...n){t&&clearTimeout(t),t=setTimeout(()=>l.apply(this,n),e)}}function bs(l){return l}function ws(){}function zn(l=Object.create(null)){if(typeof l=="string")try{return JSON.parse(l)}catch(e){return console.error("Invalid JSON string provided:",e),Object.create(null)}return l}const Vt=l=>l?Xe(zn(l)):En();function nh(l,e,t,n={}){if(!e||!l[t][e])return n;const p=`${t}.${e}`;n[p]=l[t][e];const d=Vf.get(t);if(d){const g=l[t][e].data?.children||[];for(const m of g)nh(l,m,d,n)}return n}const Fs=Wu.name,Ps=Wu.version,jn=Fs,st="formeo-sprite",ec=[{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"}],tc=`../../lib/icons/${st}.svg`;typeof import.meta.resolve=="function"&&import.meta.resolve(tc);const ih=`https://cdn.jsdelivr.net/npm/formeo@${Ps}/dist/${st}.svg`,Of=`https://draggable.github.io/formeo/assets/img/${st}.svg`,Df=`https://cdn.jsdelivr.net/npm/formeo@${Ps}/dist/formeo.min.css`,If="https://draggable.github.io/formeo/assets/css/formeo.min.css",rh="f-panel",ot="control-group",Ot=`${jn}-stage`,Qe=`${jn}-row`,Ze=`${jn}-column`,Dt=`${jn}-field`,Cs="custom-column-widths",oh="column-preset",Wr="resizing-columns",Nf=new Map([[Ot,Qe],[Qe,Ze],[Ze,Dt]]),Ws=["stage","row","column","field"],Bs=Ws.map(l=>`${l}s`);new Map(Bs.map((l,e)=>[l,Ws[e]]));const Ff=new RegExp(`^${Bs.join("|")}.`),sh=[...Ws],Pf=[...Bs],Wf=new Map(Pf.map((l,e)=>[l,sh[e]])),Br=sh.reduce((l,e)=>(l[e]=e,l),{}),Bf=[{name:"controls",className:ot},{name:"stage",className:Ot},{name:"row",className:Qe},{name:"column",className:Ze},{name:"field",className:Dt}],Hs={controls:ot,stage:Ot,row:Qe,column:Ze,field:Dt},Hf=Object.entries(Hs).reduce((l,[e,t])=>(l[t]=e,l),{}),zf=Object.values(Hs),jf=new RegExp(`${zf.join("|")}`,"g"),{childTypeMapVals:ah,childTypeIndexMapVals:Uf}=Bf.reduce((l,{name:e},t,n)=>{const{name:p}=n[t+1]||{};return p&&(l.childTypeMapVals.push([e,p]),l.childTypeIndexMapVals.push([`${e}s`,`${p}s`])),l},{childTypeMapVals:[],childTypeIndexMapVals:[]}),Gf=ah.slice().map(l=>l.slice().reverse()).reverse(),nc=new Map(ah),Vf=new Map(Uf),Kf=new Map(Gf.slice()),qf=[[{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"}]],Yf=new Map(qf.reduce((l,e,t)=>(l.push([t,e]),l),[])),lh=`${Fs}-formData`,ic=`${Fs}-locale`,qe=333,mt=Math.round(qe/2),zs=Math.round(qe*2),ch="formeoSaved",Jt="formeoUpdated",Xf="formeoChanged",uh="formeoUpdatedStage",hh="formeoUpdatedRow",dh="formeoUpdatedColumn",fh="formeoUpdatedField",Qf="formeoCleared",ph="formeoOnRender",Zf="formeoConditionUpdated",js="formeoAddedRow",Us="formeoAddedColumn",Gs="formeoAddedField",Vs="formeoRemovedRow",Ks="formeoRemovedColumn",qs="formeoRemovedField",gh={equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},Jf={and:"&&",or:"||"},mh={equals:"="},ep=["logical","source","sourceProperty","comparison","target","targetProperty","assignment","value"],rc=["isChecked","isNotChecked"],oc=["isVisible","isNotVisible"],pn=["value"],tp={comparison:gh,assignment:mh,logical:Jf},vh="if",np="then",Ys=()=>({[vh]:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],[np]:[{target:"",targetProperty:"",assignment:"",value:""}]}),ip=/(\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,Ss=/\bcol-\w+-\d+/g,yh="f-i-",En=()=>({id:We(),stages:{[We()]:{}},rows:{},columns:{},fields:{}}),Tn=["selected","checked"],rp=Tn.toReversed(),op="a an and as at but by for for from in into near nor of on onto or the to with".split(" ").map(l=>`\\s${l}\\s`),sp=new RegExp(`(?!${op.join("|")})\\w\\S*`,"g"),ap=/\s+/g;function at(l){return typeof l!="string"||l.trim().match(ap)?l:l.replace(sp,t=>t.charAt(0).toUpperCase()+t.substring(1).replace(/[A-Z]/g,n=>` ${n}`))}const bh=(l,e="-")=>l.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,e),vt=l=>{if(Array.isArray(l))return l;const e=/[.[\]]/g,t=[];let n=0,p=e.exec(l);for(;p!==null;)t.push(l.slice(n,p.index)),n=p.index+p[0].length,p=e.exec(l);return n<l.length&&t.push(l.slice(n)),t.filter(Boolean)},sc=(l,e="-")=>vt(l).join(e),lp=l=>{const e=document.createElement("div");return e.innerHTML=l,e.textContent||e.innerText||""},cp=(l,e,t="…")=>{if(l.length<=e)return l;const n=l.slice(0,e),p=n.lastIndexOf(" ");let d=`${p>0?n.slice(0,p):n}`;return t&&(d+=t),d};var Hr,ac;function Xs(){if(ac)return Hr;ac=1;var l=kt(),e=bt(),t="[object Symbol]";function n(p){return typeof p=="symbol"||e(p)&&l(p)==t}return Hr=n,Hr}var zr,lc;function up(){if(lc)return zr;lc=1;var l=wt(),e=Xs(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function p(d,g){if(l(d))return!1;var m=typeof d;return m=="number"||m=="symbol"||m=="boolean"||d==null||e(d)?!0:n.test(d)||!t.test(d)||g!=null&&d in Object(g)}return zr=p,zr}var jr,cc;function hp(){if(cc)return jr;cc=1;var l=Rs(),e="Expected a function";function t(n,p){if(typeof n!="function"||p!=null&&typeof p!="function")throw new TypeError(e);var d=function(){var g=arguments,m=p?p.apply(this,g):g[0],c=d.cache;if(c.has(m))return c.get(m);var f=n.apply(this,g);return d.cache=c.set(m,f)||c,f};return d.cache=new(t.Cache||l),d}return t.Cache=l,jr=t,jr}var Ur,uc;function dp(){if(uc)return Ur;uc=1;var l=hp(),e=500;function t(n){var p=l(n,function(g){return d.size===e&&d.clear(),g}),d=p.cache;return p}return Ur=t,Ur}var Gr,hc;function fp(){if(hc)return Gr;hc=1;var l=dp(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=l(function(p){var d=[];return p.charCodeAt(0)===46&&d.push(""),p.replace(e,function(g,m,c,f){d.push(c?f.replace(t,"$1"):m||g)}),d});return Gr=n,Gr}var Vr,dc;function pp(){if(dc)return Vr;dc=1;function l(e,t){for(var n=-1,p=e==null?0:e.length,d=Array(p);++n<p;)d[n]=t(e[n],n,e);return d}return Vr=l,Vr}var Kr,fc;function gp(){if(fc)return Kr;fc=1;var l=Pn(),e=pp(),t=wt(),n=Xs(),p=l?l.prototype:void 0,d=p?p.toString:void 0;function g(m){if(typeof m=="string")return m;if(t(m))return e(m,g)+"";if(n(m))return d?d.call(m):"";var c=m+"";return c=="0"&&1/m==-1/0?"-0":c}return Kr=g,Kr}var qr,pc;function Un(){if(pc)return qr;pc=1;var l=gp();function e(t){return t==null?"":l(t)}return qr=e,qr}var Yr,gc;function wh(){if(gc)return Yr;gc=1;var l=wt(),e=up(),t=fp(),n=Un();function p(d,g){return l(d)?d:e(d,g)?[d]:t(n(d))}return Yr=p,Yr}var Xr,mc;function Ch(){if(mc)return Xr;mc=1;var l=Xs();function e(t){if(typeof t=="string"||l(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return Xr=e,Xr}var Qr,vc;function mp(){if(vc)return Qr;vc=1;var l=wh(),e=Ch();function t(n,p){p=l(p,n);for(var d=0,g=p.length;n!=null&&d<g;)n=n[e(p[d++])];return d&&d==g?n:void 0}return Qr=t,Qr}var Zr,yc;function vp(){if(yc)return Zr;yc=1;var l=mp();function e(t,n,p){var d=t==null?void 0:l(t,n);return d===void 0?p:d}return Zr=e,Zr}var yp=vp();const bp=Rt(yp);var Jr,bc;function wp(){if(bc)return Jr;bc=1;var l=Qu(),e=wh(),t=Ns(),n=ct(),p=Ch();function d(g,m,c,f){if(!n(g))return g;m=e(m,g);for(var r=-1,o=m.length,s=o-1,a=g;a!=null&&++r<o;){var i=p(m[r]),u=c;if(i==="__proto__"||i==="constructor"||i==="prototype")return g;if(r!=s){var h=a[i];u=f?f(h,i,a):void 0,u===void 0&&(u=n(h)?h:t(m[r+1])?[]:{})}l(a,i,u),a=a[i]}return g}return Jr=d,Jr}var eo,wc;function Cp(){if(wc)return eo;wc=1;var l=wp();function e(t,n,p){return t==null?t:l(t,n,p)}return eo=e,eo}var Sp=Cp();const Ap=Rt(Sp),Ie=bp,Gn=Ap;function $p(l,e={}){const t={...l};for(const n in e)Object.hasOwn(e,n)&&(Object.hasOwn(t,n)?Array.isArray(t[n])?t[n].push(e[n]):t[n]=[t[n],e[n]]:t[n]=e[n]);return t}function gn(...l){return l.flat().reduce((e,t)=>(e[t]=t,e),{})}var to,Cc;function Ep(){if(Cc)return to;Cc=1;var l="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,l),this}return to=e,to}var no,Sc;function Tp(){if(Sc)return no;Sc=1;function l(e){return this.__data__.has(e)}return no=l,no}var io,Ac;function Mp(){if(Ac)return io;Ac=1;var l=Rs(),e=Ep(),t=Tp();function n(p){var d=-1,g=p==null?0:p.length;for(this.__data__=new l;++d<g;)this.add(p[d])}return n.prototype.add=n.prototype.push=e,n.prototype.has=t,io=n,io}var ro,$c;function _p(){if($c)return ro;$c=1;function l(e,t){for(var n=-1,p=e==null?0:e.length;++n<p;)if(t(e[n],n,e))return!0;return!1}return ro=l,ro}var oo,Ec;function xp(){if(Ec)return oo;Ec=1;function l(e,t){return e.has(t)}return oo=l,oo}var so,Tc;function Sh(){if(Tc)return so;Tc=1;var l=Mp(),e=_p(),t=xp(),n=1,p=2;function d(g,m,c,f,r,o){var s=c&n,a=g.length,i=m.length;if(a!=i&&!(s&&i>a))return!1;var u=o.get(g),h=o.get(m);if(u&&h)return u==m&&h==g;var y=-1,b=!0,T=c&p?new l:void 0;for(o.set(g,m),o.set(m,g);++y<a;){var $=g[y],A=m[y];if(f)var S=s?f(A,$,y,m,g,o):f($,A,y,g,m,o);if(S!==void 0){if(S)continue;b=!1;break}if(T){if(!e(m,function(M,R){if(!t(T,R)&&($===M||r($,M,c,f,o)))return T.push(R)})){b=!1;break}}else if(!($===A||r($,A,c,f,o))){b=!1;break}}return o.delete(g),o.delete(m),b}return so=d,so}var ao,Mc;function Lp(){if(Mc)return ao;Mc=1;function l(e){var t=-1,n=Array(e.size);return e.forEach(function(p,d){n[++t]=[d,p]}),n}return ao=l,ao}var lo,_c;function Rp(){if(_c)return lo;_c=1;function l(e){var t=-1,n=Array(e.size);return e.forEach(function(p){n[++t]=p}),n}return lo=l,lo}var co,xc;function kp(){if(xc)return co;xc=1;var l=Pn(),e=Gu(),t=nn(),n=Sh(),p=Lp(),d=Rp(),g=1,m=2,c="[object Boolean]",f="[object Date]",r="[object Error]",o="[object Map]",s="[object Number]",a="[object RegExp]",i="[object Set]",u="[object String]",h="[object Symbol]",y="[object ArrayBuffer]",b="[object DataView]",T=l?l.prototype:void 0,$=T?T.valueOf:void 0;function A(S,M,R,L,_,O,w){switch(R){case b:if(S.byteLength!=M.byteLength||S.byteOffset!=M.byteOffset)return!1;S=S.buffer,M=M.buffer;case y:return!(S.byteLength!=M.byteLength||!O(new e(S),new e(M)));case c:case f:case s:return t(+S,+M);case r:return S.name==M.name&&S.message==M.message;case a:case u:return S==M+"";case o:var v=p;case i:var C=L&g;if(v||(v=d),S.size!=M.size&&!C)return!1;var E=w.get(S);if(E)return E==M;L|=m,w.set(S,M);var x=n(v(S),v(M),L,_,O,w);return w.delete(S),x;case h:if($)return $.call(S)==$.call(M)}return!1}return co=A,co}var uo,Lc;function Op(){if(Lc)return uo;Lc=1;function l(e,t){for(var n=-1,p=t.length,d=e.length;++n<p;)e[d+n]=t[n];return e}return uo=l,uo}var ho,Rc;function Dp(){if(Rc)return ho;Rc=1;var l=Op(),e=wt();function t(n,p,d){var g=p(n);return e(n)?g:l(g,d(n))}return ho=t,ho}var fo,kc;function Ip(){if(kc)return fo;kc=1;function l(e,t){for(var n=-1,p=e==null?0:e.length,d=0,g=[];++n<p;){var m=e[n];t(m,n,e)&&(g[d++]=m)}return g}return fo=l,fo}var po,Oc;function Np(){if(Oc)return po;Oc=1;function l(){return[]}return po=l,po}var go,Dc;function Fp(){if(Dc)return go;Dc=1;var l=Ip(),e=Np(),t=Object.prototype,n=t.propertyIsEnumerable,p=Object.getOwnPropertySymbols,d=p?function(g){return g==null?[]:(g=Object(g),l(p(g),function(m){return n.call(g,m)}))}:e;return go=d,go}var mo,Ic;function Pp(){if(Ic)return mo;Ic=1;var l=Vu(),e=l(Object.keys,Object);return mo=e,mo}var vo,Nc;function Wp(){if(Nc)return vo;Nc=1;var l=Os(),e=Pp(),t=Object.prototype,n=t.hasOwnProperty;function p(d){if(!l(d))return e(d);var g=[];for(var m in Object(d))n.call(d,m)&&m!="constructor"&&g.push(m);return g}return vo=p,vo}var yo,Fc;function Bp(){if(Fc)return yo;Fc=1;var l=Zu(),e=Wp(),t=Hn();function n(p){return t(p)?l(p):e(p)}return yo=n,yo}var bo,Pc;function Hp(){if(Pc)return bo;Pc=1;var l=Dp(),e=Fp(),t=Bp();function n(p){return l(p,t,e)}return bo=n,bo}var wo,Wc;function zp(){if(Wc)return wo;Wc=1;var l=Hp(),e=1,t=Object.prototype,n=t.hasOwnProperty;function p(d,g,m,c,f,r){var o=m&e,s=l(d),a=s.length,i=l(g),u=i.length;if(a!=u&&!o)return!1;for(var h=a;h--;){var y=s[h];if(!(o?y in g:n.call(g,y)))return!1}var b=r.get(d),T=r.get(g);if(b&&T)return b==g&&T==d;var $=!0;r.set(d,g),r.set(g,d);for(var A=o;++h<a;){y=s[h];var S=d[y],M=g[y];if(c)var R=o?c(M,S,y,g,d,r):c(S,M,y,d,g,r);if(!(R===void 0?S===M||f(S,M,m,c,r):R)){$=!1;break}A||(A=y=="constructor")}if($&&!A){var L=d.constructor,_=g.constructor;L!=_&&"constructor"in d&&"constructor"in g&&!(typeof L=="function"&&L instanceof L&&typeof _=="function"&&_ instanceof _)&&($=!1)}return r.delete(d),r.delete(g),$}return wo=p,wo}var Co,Bc;function jp(){if(Bc)return Co;Bc=1;var l=yt(),e=Ve(),t=l(e,"DataView");return Co=t,Co}var So,Hc;function Up(){if(Hc)return So;Hc=1;var l=yt(),e=Ve(),t=l(e,"Promise");return So=t,So}var Ao,zc;function Gp(){if(zc)return Ao;zc=1;var l=yt(),e=Ve(),t=l(e,"Set");return Ao=t,Ao}var $o,jc;function Vp(){if(jc)return $o;jc=1;var l=yt(),e=Ve(),t=l(e,"WeakMap");return $o=t,$o}var Eo,Uc;function Kp(){if(Uc)return Eo;Uc=1;var l=jp(),e=Ls(),t=Up(),n=Gp(),p=Vp(),d=kt(),g=Hu(),m="[object Map]",c="[object Object]",f="[object Promise]",r="[object Set]",o="[object WeakMap]",s="[object DataView]",a=g(l),i=g(e),u=g(t),h=g(n),y=g(p),b=d;return(l&&b(new l(new ArrayBuffer(1)))!=s||e&&b(new e)!=m||t&&b(t.resolve())!=f||n&&b(new n)!=r||p&&b(new p)!=o)&&(b=function(T){var $=d(T),A=$==c?T.constructor:void 0,S=A?g(A):"";if(S)switch(S){case a:return s;case i:return m;case u:return f;case h:return r;case y:return o}return $}),Eo=b,Eo}var To,Gc;function qp(){if(Gc)return To;Gc=1;var l=zu(),e=Sh(),t=kp(),n=zp(),p=Kp(),d=wt(),g=Ds(),m=Is(),c=1,f="[object Arguments]",r="[object Array]",o="[object Object]",s=Object.prototype,a=s.hasOwnProperty;function i(u,h,y,b,T,$){var A=d(u),S=d(h),M=A?r:p(u),R=S?r:p(h);M=M==f?o:M,R=R==f?o:R;var L=M==o,_=R==o,O=M==R;if(O&&g(u)){if(!g(h))return!1;A=!0,L=!1}if(O&&!L)return $||($=new l),A||m(u)?e(u,h,y,b,T,$):t(u,h,M,y,b,T,$);if(!(y&c)){var w=L&&a.call(u,"__wrapped__"),v=_&&a.call(h,"__wrapped__");if(w||v){var C=w?u.value():u,E=v?h.value():h;return $||($=new l),T(C,E,y,b,$)}}return O?($||($=new l),n(u,h,y,b,T,$)):!1}return To=i,To}var Mo,Vc;function Yp(){if(Vc)return Mo;Vc=1;var l=qp(),e=bt();function t(n,p,d,g,m){return n===p?!0:n==null||p==null||!e(n)&&!e(p)?n!==n&&p!==p:l(n,p,d,g,t,m)}return Mo=t,Mo}var _o,Kc;function Xp(){if(Kc)return _o;Kc=1;var l=Yp();function e(t,n){return l(t,n)}return _o=e,_o}var Qp=Xp();const As=Rt(Qp),Zp=(l,e)=>l===void 0?"added":e===void 0?"removed":As(l,e)?"unchanged":"changed";class Qs{constructor(e,t=Object.create(null)){this.name=e,this.data=t,this.dataPath=""}get size(){return Object.keys(this.data).length}get js(){return this.data}get json(){return this.data}toJSON=(e,t)=>JSON.stringify(e,null,t);get=e=>Ie(this.data,e);set(e,t){const n=Ie(this.data,e),p=Gn(this.data,e,t),d=Array.isArray(e)?e.join("."):e,g=Object.keys(this.setCallbacks).filter(c=>new RegExp(c).test(d)),m={newVal:t,oldVal:n,path:e};for(const c of g)for(const f of this.setCallbacks[c])f(m);if(!this.disableEvents){const c={entity:this,dataPath:this.dataPath.replace(/\.+$/,""),changePath:this.dataPath+e,value:t,data:p,changeType:Zp(n,t),src:this.dom};if(n&&(c.previousValue=n),J.formeoUpdated(c),this.name){const r={stage:uh,row:hh,column:dh,field:fh}[this.name];r&&J.formeoUpdated(c,r)}}return p}addSetCallback(e,t){this.setCallbacks[e]?this.setCallbacks[e].push(t):this.setCallbacks[e]=[t]}removeSetCallback(e,t){this.setCallbacks[e]=this.setCallbacks[e].filter(n=>n!==t)}add=(e,t=Object.create(null))=>{const{id:n}=t,p=e||n||We();return this.set(p,t)};remove=e=>{const t=vt(e),n=t.pop(),p=this.get(t);return Array.isArray(p)?p.splice(Number(n),1):p&&delete p[n],p};empty(){this.data=Object.create(null)}getData=()=>Object.entries(this.data).reduce((e,[t,n])=>(e[t]=n?.data?n.getData():n,e),{});setCallbacks={};configVal=Object.create(null)}class Vn extends Qs{load=e=>{const t=zn(e);this.empty();for(const[n,p]of Object.entries(t))this.add(n,p);return this.data};get=e=>e?Ie(this.data,e):this.add();add=(e,t=Object.create(null))=>{const n=e||We(),p=this.Component({...t,id:n});this.data[n]=p,this.active=p;const g={row:js,column:Us,field:Gs}[this.name];return g&&J.formeoUpdated({entity:p,componentId:n,componentType:this.name,data:p.data},g),p};remove=e=>{if(Array.isArray(e))for(const t of e)this.get(t).remove();else this.get(e).remove();return this.data};delete=e=>(delete this.data[e],e);clearAll=(e=!0)=>{const t=Object.values(this.data).map(n=>n.empty(e));return Promise.all(t)};set config(e){this.configVal=je(this.configVal,Xe(e))}get config(){return this.configVal}conditionMap=new Map}function qc(l,e){var t=Object.keys(l);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(l);e&&(n=n.filter(function(p){return Object.getOwnPropertyDescriptor(l,p).enumerable})),t.push.apply(t,n)}return t}function Ge(l){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?qc(Object(t),!0).forEach(function(n){Jp(l,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(t)):qc(Object(t)).forEach(function(n){Object.defineProperty(l,n,Object.getOwnPropertyDescriptor(t,n))})}return l}function mn(l){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?mn=function(e){return typeof e}:mn=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mn(l)}function Jp(l,e,t){return e in l?Object.defineProperty(l,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):l[e]=t,l}function Je(){return Je=Object.assign||function(l){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(l[n]=t[n])}return l},Je.apply(this,arguments)}function eg(l,e){if(l==null)return{};var t={},n=Object.keys(l),p,d;for(d=0;d<n.length;d++)p=n[d],!(e.indexOf(p)>=0)&&(t[p]=l[p]);return t}function tg(l,e){if(l==null)return{};var t=eg(l,e),n,p;if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(l);for(p=0;p<d.length;p++)n=d[p],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(l,n)&&(t[n]=l[n])}return t}var ng="1.15.3";function Ye(l){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(l)}var tt=Ye(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),rn=Ye(/Edge/i),Yc=Ye(/firefox/i),Kt=Ye(/safari/i)&&!Ye(/chrome/i)&&!Ye(/android/i),Ah=Ye(/iP(ad|od|hone)/i),$h=Ye(/chrome/i)&&Ye(/android/i),Eh={capture:!1,passive:!1};function se(l,e,t){l.addEventListener(e,t,!tt&&Eh)}function oe(l,e,t){l.removeEventListener(e,t,!tt&&Eh)}function Mn(l,e){if(e){if(e[0]===">"&&(e=e.substring(1)),l)try{if(l.matches)return l.matches(e);if(l.msMatchesSelector)return l.msMatchesSelector(e);if(l.webkitMatchesSelector)return l.webkitMatchesSelector(e)}catch{return!1}return!1}}function Th(l){return l.host&&l!==document&&l.host.nodeType?l.host:l.parentNode}function ze(l,e,t,n){if(l){t=t||document;do{if(e!=null&&(e[0]===">"?l.parentNode===t&&Mn(l,e):Mn(l,e))||n&&l===t)return l;if(l===t)break}while(l=Th(l))}return null}var Xc=/\s+/g;function Oe(l,e,t){if(l&&e)if(l.classList)l.classList[t?"add":"remove"](e);else{var n=(" "+l.className+" ").replace(Xc," ").replace(" "+e+" "," ");l.className=(n+(t?" "+e:"")).replace(Xc," ")}}function ne(l,e,t){var n=l&&l.style;if(n){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(l,""):l.currentStyle&&(t=l.currentStyle),e===void 0?t:t[e];!(e in n)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),n[e]=t+(typeof t=="string"?"":"px")}}function Mt(l,e){var t="";if(typeof l=="string")t=l;else do{var n=ne(l,"transform");n&&n!=="none"&&(t=n+" "+t)}while(!e&&(l=l.parentNode));var p=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return p&&new p(t)}function Mh(l,e,t){if(l){var n=l.getElementsByTagName(e),p=0,d=n.length;if(t)for(;p<d;p++)t(n[p],p);return n}return[]}function Ue(){var l=document.scrollingElement;return l||document.documentElement}function we(l,e,t,n,p){if(!(!l.getBoundingClientRect&&l!==window)){var d,g,m,c,f,r,o;if(l!==window&&l.parentNode&&l!==Ue()?(d=l.getBoundingClientRect(),g=d.top,m=d.left,c=d.bottom,f=d.right,r=d.height,o=d.width):(g=0,m=0,c=window.innerHeight,f=window.innerWidth,r=window.innerHeight,o=window.innerWidth),(e||t)&&l!==window&&(p=p||l.parentNode,!tt))do if(p&&p.getBoundingClientRect&&(ne(p,"transform")!=="none"||t&&ne(p,"position")!=="static")){var s=p.getBoundingClientRect();g-=s.top+parseInt(ne(p,"border-top-width")),m-=s.left+parseInt(ne(p,"border-left-width")),c=g+d.height,f=m+d.width;break}while(p=p.parentNode);if(n&&l!==window){var a=Mt(p||l),i=a&&a.a,u=a&&a.d;a&&(g/=u,m/=i,o/=i,r/=u,c=g+r,f=m+o)}return{top:g,left:m,bottom:c,right:f,width:o,height:r}}}function Qc(l,e,t){for(var n=rt(l,!0),p=we(l)[e];n;){var d=we(n)[t],g=void 0;if(g=p>=d,!g)return n;if(n===Ue())break;n=rt(n,!1)}return!1}function _t(l,e,t,n){for(var p=0,d=0,g=l.children;d<g.length;){if(g[d].style.display!=="none"&&g[d]!==te.ghost&&(n||g[d]!==te.dragged)&&ze(g[d],t.draggable,l,!1)){if(p===e)return g[d];p++}d++}return null}function Zs(l,e){for(var t=l.lastElementChild;t&&(t===te.ghost||ne(t,"display")==="none"||e&&!Mn(t,e));)t=t.previousElementSibling;return t||null}function Fe(l,e){var t=0;if(!l||!l.parentNode)return-1;for(;l=l.previousElementSibling;)l.nodeName.toUpperCase()!=="TEMPLATE"&&l!==te.clone&&(!e||Mn(l,e))&&t++;return t}function Zc(l){var e=0,t=0,n=Ue();if(l)do{var p=Mt(l),d=p.a,g=p.d;e+=l.scrollLeft*d,t+=l.scrollTop*g}while(l!==n&&(l=l.parentNode));return[e,t]}function ig(l,e){for(var t in l)if(l.hasOwnProperty(t)){for(var n in e)if(e.hasOwnProperty(n)&&e[n]===l[t][n])return Number(t)}return-1}function rt(l,e){if(!l||!l.getBoundingClientRect)return Ue();var t=l,n=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var p=ne(t);if(t.clientWidth<t.scrollWidth&&(p.overflowX=="auto"||p.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(p.overflowY=="auto"||p.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return Ue();if(n||e)return t;n=!0}}while(t=t.parentNode);return Ue()}function rg(l,e){if(l&&e)for(var t in e)e.hasOwnProperty(t)&&(l[t]=e[t]);return l}function xo(l,e){return Math.round(l.top)===Math.round(e.top)&&Math.round(l.left)===Math.round(e.left)&&Math.round(l.height)===Math.round(e.height)&&Math.round(l.width)===Math.round(e.width)}var qt;function _h(l,e){return function(){if(!qt){var t=arguments,n=this;t.length===1?l.call(n,t[0]):l.apply(n,t),qt=setTimeout(function(){qt=void 0},e)}}}function og(){clearTimeout(qt),qt=void 0}function xh(l,e,t){l.scrollLeft+=e,l.scrollTop+=t}function Lh(l){var e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(l).cloneNode(!0):t?t(l).clone(!0)[0]:l.cloneNode(!0)}function Rh(l,e,t){var n={};return Array.from(l.children).forEach(function(p){var d,g,m,c;if(!(!ze(p,e.draggable,l,!1)||p.animated||p===t)){var f=we(p);n.left=Math.min((d=n.left)!==null&&d!==void 0?d:1/0,f.left),n.top=Math.min((g=n.top)!==null&&g!==void 0?g:1/0,f.top),n.right=Math.max((m=n.right)!==null&&m!==void 0?m:-1/0,f.right),n.bottom=Math.max((c=n.bottom)!==null&&c!==void 0?c:-1/0,f.bottom)}}),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var Re="Sortable"+new Date().getTime();function sg(){var l=[],e;return{captureAnimationState:function(){if(l=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(p){if(!(ne(p,"display")==="none"||p===te.ghost)){l.push({target:p,rect:we(p)});var d=Ge({},l[l.length-1].rect);if(p.thisAnimationDuration){var g=Mt(p,!0);g&&(d.top-=g.f,d.left-=g.e)}p.fromRect=d}})}},addAnimationState:function(n){l.push(n)},removeAnimationState:function(n){l.splice(ig(l,{target:n}),1)},animateAll:function(n){var p=this;if(!this.options.animation){clearTimeout(e),typeof n=="function"&&n();return}var d=!1,g=0;l.forEach(function(m){var c=0,f=m.target,r=f.fromRect,o=we(f),s=f.prevFromRect,a=f.prevToRect,i=m.rect,u=Mt(f,!0);u&&(o.top-=u.f,o.left-=u.e),f.toRect=o,f.thisAnimationDuration&&xo(s,o)&&!xo(r,o)&&(i.top-o.top)/(i.left-o.left)===(r.top-o.top)/(r.left-o.left)&&(c=lg(i,s,a,p.options)),xo(o,r)||(f.prevFromRect=r,f.prevToRect=o,c||(c=p.options.animation),p.animate(f,i,o,c)),c&&(d=!0,g=Math.max(g,c),clearTimeout(f.animationResetTimer),f.animationResetTimer=setTimeout(function(){f.animationTime=0,f.prevFromRect=null,f.fromRect=null,f.prevToRect=null,f.thisAnimationDuration=null},c),f.thisAnimationDuration=c)}),clearTimeout(e),d?e=setTimeout(function(){typeof n=="function"&&n()},g):typeof n=="function"&&n(),l=[]},animate:function(n,p,d,g){if(g){ne(n,"transition",""),ne(n,"transform","");var m=Mt(this.el),c=m&&m.a,f=m&&m.d,r=(p.left-d.left)/(c||1),o=(p.top-d.top)/(f||1);n.animatingX=!!r,n.animatingY=!!o,ne(n,"transform","translate3d("+r+"px,"+o+"px,0)"),this.forRepaintDummy=ag(n),ne(n,"transition","transform "+g+"ms"+(this.options.easing?" "+this.options.easing:"")),ne(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){ne(n,"transition",""),ne(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},g)}}}}function ag(l){return l.offsetWidth}function lg(l,e,t,n){return Math.sqrt(Math.pow(e.top-l.top,2)+Math.pow(e.left-l.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*n.animation}var Ct=[],Lo={initializeByDefault:!0},on={mount:function(e){for(var t in Lo)Lo.hasOwnProperty(t)&&!(t in e)&&(e[t]=Lo[t]);Ct.forEach(function(n){if(n.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),Ct.push(e)},pluginEvent:function(e,t,n){var p=this;this.eventCanceled=!1,n.cancel=function(){p.eventCanceled=!0};var d=e+"Global";Ct.forEach(function(g){t[g.pluginName]&&(t[g.pluginName][d]&&t[g.pluginName][d](Ge({sortable:t},n)),t.options[g.pluginName]&&t[g.pluginName][e]&&t[g.pluginName][e](Ge({sortable:t},n)))})},initializePlugins:function(e,t,n,p){Ct.forEach(function(m){var c=m.pluginName;if(!(!e.options[c]&&!m.initializeByDefault)){var f=new m(e,t,e.options);f.sortable=e,f.options=e.options,e[c]=f,Je(n,f.defaults)}});for(var d in e.options)if(e.options.hasOwnProperty(d)){var g=this.modifyOption(e,d,e.options[d]);typeof g<"u"&&(e.options[d]=g)}},getEventProperties:function(e,t){var n={};return Ct.forEach(function(p){typeof p.eventProperties=="function"&&Je(n,p.eventProperties.call(t[p.pluginName],e))}),n},modifyOption:function(e,t,n){var p;return Ct.forEach(function(d){e[d.pluginName]&&d.optionListeners&&typeof d.optionListeners[t]=="function"&&(p=d.optionListeners[t].call(e[d.pluginName],n))}),p}};function cg(l){var e=l.sortable,t=l.rootEl,n=l.name,p=l.targetEl,d=l.cloneEl,g=l.toEl,m=l.fromEl,c=l.oldIndex,f=l.newIndex,r=l.oldDraggableIndex,o=l.newDraggableIndex,s=l.originalEvent,a=l.putSortable,i=l.extraEventProperties;if(e=e||t&&t[Re],!!e){var u,h=e.options,y="on"+n.charAt(0).toUpperCase()+n.substr(1);window.CustomEvent&&!tt&&!rn?u=new CustomEvent(n,{bubbles:!0,cancelable:!0}):(u=document.createEvent("Event"),u.initEvent(n,!0,!0)),u.to=g||t,u.from=m||t,u.item=p||t,u.clone=d,u.oldIndex=c,u.newIndex=f,u.oldDraggableIndex=r,u.newDraggableIndex=o,u.originalEvent=s,u.pullMode=a?a.lastPutMode:void 0;var b=Ge(Ge({},i),on.getEventProperties(n,e));for(var T in b)u[T]=b[T];t&&t.dispatchEvent(u),h[y]&&h[y].call(e,u)}}var ug=["evt"],xe=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p=n.evt,d=tg(n,ug);on.pluginEvent.bind(te)(e,t,Ge({dragEl:K,parentEl:ve,ghostEl:ie,rootEl:fe,nextEl:pt,lastDownEl:vn,cloneEl:pe,cloneHidden:it,dragStarted:zt,putSortable:Se,activeSortable:te.active,originalEvent:p,oldIndex:Et,oldDraggableIndex:Yt,newIndex:De,newDraggableIndex:nt,hideGhostForTarget:Ih,unhideGhostForTarget:Nh,cloneNowHidden:function(){it=!0},cloneNowShown:function(){it=!1},dispatchSortableEvent:function(m){Ee({sortable:t,name:m,originalEvent:p})}},d))};function Ee(l){cg(Ge({putSortable:Se,cloneEl:pe,targetEl:K,rootEl:fe,oldIndex:Et,oldDraggableIndex:Yt,newIndex:De,newDraggableIndex:nt},l))}var K,ve,ie,fe,pt,vn,pe,it,Et,De,Yt,nt,ln,Se,At=!1,_n=!1,xn=[],dt,Be,Ro,ko,Jc,eu,zt,St,Xt,Qt=!1,cn=!1,yn,Ae,Oo=[],$s=!1,Ln=[],Kn=typeof document<"u",un=Ah,tu=rn||tt?"cssFloat":"float",hg=Kn&&!$h&&!Ah&&"draggable"in document.createElement("div"),kh=(function(){if(Kn){if(tt)return!1;var l=document.createElement("x");return l.style.cssText="pointer-events:auto",l.style.pointerEvents==="auto"}})(),Oh=function(e,t){var n=ne(e),p=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),d=_t(e,0,t),g=_t(e,1,t),m=d&&ne(d),c=g&&ne(g),f=m&&parseInt(m.marginLeft)+parseInt(m.marginRight)+we(d).width,r=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+we(g).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(d&&m.float&&m.float!=="none"){var o=m.float==="left"?"left":"right";return g&&(c.clear==="both"||c.clear===o)?"vertical":"horizontal"}return d&&(m.display==="block"||m.display==="flex"||m.display==="table"||m.display==="grid"||f>=p&&n[tu]==="none"||g&&n[tu]==="none"&&f+r>p)?"vertical":"horizontal"},dg=function(e,t,n){var p=n?e.left:e.top,d=n?e.right:e.bottom,g=n?e.width:e.height,m=n?t.left:t.top,c=n?t.right:t.bottom,f=n?t.width:t.height;return p===m||d===c||p+g/2===m+f/2},fg=function(e,t){var n;return xn.some(function(p){var d=p[Re].options.emptyInsertThreshold;if(!(!d||Zs(p))){var g=we(p),m=e>=g.left-d&&e<=g.right+d,c=t>=g.top-d&&t<=g.bottom+d;if(m&&c)return n=p}}),n},Dh=function(e){function t(d,g){return function(m,c,f,r){var o=m.options.group.name&&c.options.group.name&&m.options.group.name===c.options.group.name;if(d==null&&(g||o))return!0;if(d==null||d===!1)return!1;if(g&&d==="clone")return d;if(typeof d=="function")return t(d(m,c,f,r),g)(m,c,f,r);var s=(g?m:c).options.group.name;return d===!0||typeof d=="string"&&d===s||d.join&&d.indexOf(s)>-1}}var n={},p=e.group;(!p||mn(p)!="object")&&(p={name:p}),n.name=p.name,n.checkPull=t(p.pull,!0),n.checkPut=t(p.put),n.revertClone=p.revertClone,e.group=n},Ih=function(){!kh&&ie&&ne(ie,"display","none")},Nh=function(){!kh&&ie&&ne(ie,"display","")};Kn&&!$h&&document.addEventListener("click",function(l){if(_n)return l.preventDefault(),l.stopPropagation&&l.stopPropagation(),l.stopImmediatePropagation&&l.stopImmediatePropagation(),_n=!1,!1},!0);var ft=function(e){if(K){e=e.touches?e.touches[0]:e;var t=fg(e.clientX,e.clientY);if(t){var n={};for(var p in e)e.hasOwnProperty(p)&&(n[p]=e[p]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[Re]._onDragOver(n)}}},pg=function(e){K&&K.parentNode[Re]._isOutsideThisEl(e.target)};function te(l,e){if(!(l&&l.nodeType&&l.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(l));this.el=l,this.options=e=Je({},e),l[Re]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(l.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Oh(l,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(g,m){g.setData("Text",m.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:te.supportPointer!==!1&&"PointerEvent"in window&&!Kt,emptyInsertThreshold:5};on.initializePlugins(this,l,t);for(var n in t)!(n in e)&&(e[n]=t[n]);Dh(e);for(var p in this)p.charAt(0)==="_"&&typeof this[p]=="function"&&(this[p]=this[p].bind(this));this.nativeDraggable=e.forceFallback?!1:hg,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?se(l,"pointerdown",this._onTapStart):(se(l,"mousedown",this._onTapStart),se(l,"touchstart",this._onTapStart)),this.nativeDraggable&&(se(l,"dragover",this),se(l,"dragenter",this)),xn.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),Je(this,sg())}te.prototype={constructor:te,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(St=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,K):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,p=this.options,d=p.preventOnFilter,g=e.type,m=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,c=(m||e).target,f=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||c,r=p.filter;if(Sg(n),!K&&!(/mousedown|pointerdown/.test(g)&&e.button!==0||p.disabled)&&!f.isContentEditable&&!(!this.nativeDraggable&&Kt&&c&&c.tagName.toUpperCase()==="SELECT")&&(c=ze(c,p.draggable,n,!1),!(c&&c.animated)&&vn!==c)){if(Et=Fe(c),Yt=Fe(c,p.draggable),typeof r=="function"){if(r.call(this,e,c,this)){Ee({sortable:t,rootEl:f,name:"filter",targetEl:c,toEl:n,fromEl:n}),xe("filter",t,{evt:e}),d&&e.cancelable&&e.preventDefault();return}}else if(r&&(r=r.split(",").some(function(o){if(o=ze(f,o.trim(),n,!1),o)return Ee({sortable:t,rootEl:o,name:"filter",targetEl:c,fromEl:n,toEl:n}),xe("filter",t,{evt:e}),!0}),r)){d&&e.cancelable&&e.preventDefault();return}p.handle&&!ze(f,p.handle,n,!1)||this._prepareDragStart(e,m,c)}}},_prepareDragStart:function(e,t,n){var p=this,d=p.el,g=p.options,m=d.ownerDocument,c;if(n&&!K&&n.parentNode===d){var f=we(n);if(fe=d,K=n,ve=K.parentNode,pt=K.nextSibling,vn=n,ln=g.group,te.dragged=K,dt={target:K,clientX:(t||e).clientX,clientY:(t||e).clientY},Jc=dt.clientX-f.left,eu=dt.clientY-f.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,K.style["will-change"]="all",c=function(){if(xe("delayEnded",p,{evt:e}),te.eventCanceled){p._onDrop();return}p._disableDelayedDragEvents(),!Yc&&p.nativeDraggable&&(K.draggable=!0),p._triggerDragStart(e,t),Ee({sortable:p,name:"choose",originalEvent:e}),Oe(K,g.chosenClass,!0)},g.ignore.split(",").forEach(function(r){Mh(K,r.trim(),Do)}),se(m,"dragover",ft),se(m,"mousemove",ft),se(m,"touchmove",ft),se(m,"mouseup",p._onDrop),se(m,"touchend",p._onDrop),se(m,"touchcancel",p._onDrop),Yc&&this.nativeDraggable&&(this.options.touchStartThreshold=4,K.draggable=!0),xe("delayStart",this,{evt:e}),g.delay&&(!g.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(rn||tt))){if(te.eventCanceled){this._onDrop();return}se(m,"mouseup",p._disableDelayedDrag),se(m,"touchend",p._disableDelayedDrag),se(m,"touchcancel",p._disableDelayedDrag),se(m,"mousemove",p._delayedDragTouchMoveHandler),se(m,"touchmove",p._delayedDragTouchMoveHandler),g.supportPointer&&se(m,"pointermove",p._delayedDragTouchMoveHandler),p._dragStartTimer=setTimeout(c,g.delay)}else c()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){K&&Do(K),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;oe(e,"mouseup",this._disableDelayedDrag),oe(e,"touchend",this._disableDelayedDrag),oe(e,"touchcancel",this._disableDelayedDrag),oe(e,"mousemove",this._delayedDragTouchMoveHandler),oe(e,"touchmove",this._delayedDragTouchMoveHandler),oe(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?se(document,"pointermove",this._onTouchMove):t?se(document,"touchmove",this._onTouchMove):se(document,"mousemove",this._onTouchMove):(se(K,"dragend",this),se(fe,"dragstart",this._onDragStart));try{document.selection?bn(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(At=!1,fe&&K){xe("dragStarted",this,{evt:t}),this.nativeDraggable&&se(document,"dragover",pg);var n=this.options;!e&&Oe(K,n.dragClass,!1),Oe(K,n.ghostClass,!0),te.active=this,e&&this._appendGhost(),Ee({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(Be){this._lastX=Be.clientX,this._lastY=Be.clientY,Ih();for(var e=document.elementFromPoint(Be.clientX,Be.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Be.clientX,Be.clientY),e!==t);)t=e;if(K.parentNode[Re]._isOutsideThisEl(e),t)do{if(t[Re]){var n=void 0;if(n=t[Re]._onDragOver({clientX:Be.clientX,clientY:Be.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=Th(t));Nh()}},_onTouchMove:function(e){if(dt){var t=this.options,n=t.fallbackTolerance,p=t.fallbackOffset,d=e.touches?e.touches[0]:e,g=ie&&Mt(ie,!0),m=ie&&g&&g.a,c=ie&&g&&g.d,f=un&&Ae&&Zc(Ae),r=(d.clientX-dt.clientX+p.x)/(m||1)+(f?f[0]-Oo[0]:0)/(m||1),o=(d.clientY-dt.clientY+p.y)/(c||1)+(f?f[1]-Oo[1]:0)/(c||1);if(!te.active&&!At){if(n&&Math.max(Math.abs(d.clientX-this._lastX),Math.abs(d.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(ie){g?(g.e+=r-(Ro||0),g.f+=o-(ko||0)):g={a:1,b:0,c:0,d:1,e:r,f:o};var s="matrix(".concat(g.a,",").concat(g.b,",").concat(g.c,",").concat(g.d,",").concat(g.e,",").concat(g.f,")");ne(ie,"webkitTransform",s),ne(ie,"mozTransform",s),ne(ie,"msTransform",s),ne(ie,"transform",s),Ro=r,ko=o,Be=d}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!ie){var e=this.options.fallbackOnBody?document.body:fe,t=we(K,!0,un,!0,e),n=this.options;if(un){for(Ae=e;ne(Ae,"position")==="static"&&ne(Ae,"transform")==="none"&&Ae!==document;)Ae=Ae.parentNode;Ae!==document.body&&Ae!==document.documentElement?(Ae===document&&(Ae=Ue()),t.top+=Ae.scrollTop,t.left+=Ae.scrollLeft):Ae=Ue(),Oo=Zc(Ae)}ie=K.cloneNode(!0),Oe(ie,n.ghostClass,!1),Oe(ie,n.fallbackClass,!0),Oe(ie,n.dragClass,!0),ne(ie,"transition",""),ne(ie,"transform",""),ne(ie,"box-sizing","border-box"),ne(ie,"margin",0),ne(ie,"top",t.top),ne(ie,"left",t.left),ne(ie,"width",t.width),ne(ie,"height",t.height),ne(ie,"opacity","0.8"),ne(ie,"position",un?"absolute":"fixed"),ne(ie,"zIndex","100000"),ne(ie,"pointerEvents","none"),te.ghost=ie,e.appendChild(ie),ne(ie,"transform-origin",Jc/parseInt(ie.style.width)*100+"% "+eu/parseInt(ie.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,p=e.dataTransfer,d=n.options;if(xe("dragStart",this,{evt:e}),te.eventCanceled){this._onDrop();return}xe("setupClone",this),te.eventCanceled||(pe=Lh(K),pe.removeAttribute("id"),pe.draggable=!1,pe.style["will-change"]="",this._hideClone(),Oe(pe,this.options.chosenClass,!1),te.clone=pe),n.cloneId=bn(function(){xe("clone",n),!te.eventCanceled&&(n.options.removeCloneOnHide||fe.insertBefore(pe,K),n._hideClone(),Ee({sortable:n,name:"clone"}))}),!t&&Oe(K,d.dragClass,!0),t?(_n=!0,n._loopId=setInterval(n._emulateDragOver,50)):(oe(document,"mouseup",n._onDrop),oe(document,"touchend",n._onDrop),oe(document,"touchcancel",n._onDrop),p&&(p.effectAllowed="move",d.setData&&d.setData.call(n,p,K)),se(document,"drop",n),ne(K,"transform","translateZ(0)")),At=!0,n._dragStartId=bn(n._dragStarted.bind(n,t,e)),se(document,"selectstart",n),zt=!0,Kt&&ne(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,n=e.target,p,d,g,m=this.options,c=m.group,f=te.active,r=ln===c,o=m.sort,s=Se||f,a,i=this,u=!1;if($s)return;function h(D,I){xe(D,i,Ge({evt:e,isOwner:r,axis:a?"vertical":"horizontal",revert:g,dragRect:p,targetRect:d,canSort:o,fromSortable:s,target:n,completed:b,onMove:function(P,z){return hn(fe,t,K,p,P,we(P),e,z)},changed:T},I))}function y(){h("dragOverAnimationCapture"),i.captureAnimationState(),i!==s&&s.captureAnimationState()}function b(D){return h("dragOverCompleted",{insertion:D}),D&&(r?f._hideClone():f._showClone(i),i!==s&&(Oe(K,Se?Se.options.ghostClass:f.options.ghostClass,!1),Oe(K,m.ghostClass,!0)),Se!==i&&i!==te.active?Se=i:i===te.active&&Se&&(Se=null),s===i&&(i._ignoreWhileAnimating=n),i.animateAll(function(){h("dragOverAnimationComplete"),i._ignoreWhileAnimating=null}),i!==s&&(s.animateAll(),s._ignoreWhileAnimating=null)),(n===K&&!K.animated||n===t&&!n.animated)&&(St=null),!m.dragoverBubble&&!e.rootEl&&n!==document&&(K.parentNode[Re]._isOutsideThisEl(e.target),!D&&ft(e)),!m.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),u=!0}function T(){De=Fe(K),nt=Fe(K,m.draggable),Ee({sortable:i,name:"change",toEl:t,newIndex:De,newDraggableIndex:nt,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=ze(n,m.draggable,t,!0),h("dragOver"),te.eventCanceled)return u;if(K.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||i._ignoreWhileAnimating===n)return b(!1);if(_n=!1,f&&!m.disabled&&(r?o||(g=ve!==fe):Se===this||(this.lastPutMode=ln.checkPull(this,f,K,e))&&c.checkPut(this,f,K,e))){if(a=this._getDirection(e,n)==="vertical",p=we(K),h("dragOverValid"),te.eventCanceled)return u;if(g)return ve=fe,y(),this._hideClone(),h("revert"),te.eventCanceled||(pt?fe.insertBefore(K,pt):fe.appendChild(K)),b(!0);var $=Zs(t,m.draggable);if(!$||yg(e,a,this)&&!$.animated){if($===K)return b(!1);if($&&t===e.target&&(n=$),n&&(d=we(n)),hn(fe,t,K,p,n,d,e,!!n)!==!1)return y(),$&&$.nextSibling?t.insertBefore(K,$.nextSibling):t.appendChild(K),ve=t,T(),b(!0)}else if($&&vg(e,a,this)){var A=_t(t,0,m,!0);if(A===K)return b(!1);if(n=A,d=we(n),hn(fe,t,K,p,n,d,e,!1)!==!1)return y(),t.insertBefore(K,A),ve=t,T(),b(!0)}else if(n.parentNode===t){d=we(n);var S=0,M,R=K.parentNode!==t,L=!dg(K.animated&&K.toRect||p,n.animated&&n.toRect||d,a),_=a?"top":"left",O=Qc(n,"top","top")||Qc(K,"top","top"),w=O?O.scrollTop:void 0;St!==n&&(M=d[_],Qt=!1,cn=!L&&m.invertSwap||R),S=bg(e,n,d,a,L?1:m.swapThreshold,m.invertedSwapThreshold==null?m.swapThreshold:m.invertedSwapThreshold,cn,St===n);var v;if(S!==0){var C=Fe(K);do C-=S,v=ve.children[C];while(v&&(ne(v,"display")==="none"||v===ie))}if(S===0||v===n)return b(!1);St=n,Xt=S;var E=n.nextElementSibling,x=!1;x=S===1;var k=hn(fe,t,K,p,n,d,e,x);if(k!==!1)return(k===1||k===-1)&&(x=k===1),$s=!0,setTimeout(mg,30),y(),x&&!E?t.appendChild(K):n.parentNode.insertBefore(K,x?E:n),O&&xh(O,0,w-O.scrollTop),ve=K.parentNode,M!==void 0&&!cn&&(yn=Math.abs(M-we(n)[_])),T(),b(!0)}if(t.contains(K))return b(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){oe(document,"mousemove",this._onTouchMove),oe(document,"touchmove",this._onTouchMove),oe(document,"pointermove",this._onTouchMove),oe(document,"dragover",ft),oe(document,"mousemove",ft),oe(document,"touchmove",ft)},_offUpEvents:function(){var e=this.el.ownerDocument;oe(e,"mouseup",this._onDrop),oe(e,"touchend",this._onDrop),oe(e,"pointerup",this._onDrop),oe(e,"touchcancel",this._onDrop),oe(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;if(De=Fe(K),nt=Fe(K,n.draggable),xe("drop",this,{evt:e}),ve=K&&K.parentNode,De=Fe(K),nt=Fe(K,n.draggable),te.eventCanceled){this._nulling();return}At=!1,cn=!1,Qt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Es(this.cloneId),Es(this._dragStartId),this.nativeDraggable&&(oe(document,"drop",this),oe(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Kt&&ne(document.body,"user-select",""),ne(K,"transform",""),e&&(zt&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),ie&&ie.parentNode&&ie.parentNode.removeChild(ie),(fe===ve||Se&&Se.lastPutMode!=="clone")&&pe&&pe.parentNode&&pe.parentNode.removeChild(pe),K&&(this.nativeDraggable&&oe(K,"dragend",this),Do(K),K.style["will-change"]="",zt&&!At&&Oe(K,Se?Se.options.ghostClass:this.options.ghostClass,!1),Oe(K,this.options.chosenClass,!1),Ee({sortable:this,name:"unchoose",toEl:ve,newIndex:null,newDraggableIndex:null,originalEvent:e}),fe!==ve?(De>=0&&(Ee({rootEl:ve,name:"add",toEl:ve,fromEl:fe,originalEvent:e}),Ee({sortable:this,name:"remove",toEl:ve,originalEvent:e}),Ee({rootEl:ve,name:"sort",toEl:ve,fromEl:fe,originalEvent:e}),Ee({sortable:this,name:"sort",toEl:ve,originalEvent:e})),Se&&Se.save()):De!==Et&&De>=0&&(Ee({sortable:this,name:"update",toEl:ve,originalEvent:e}),Ee({sortable:this,name:"sort",toEl:ve,originalEvent:e})),te.active&&((De==null||De===-1)&&(De=Et,nt=Yt),Ee({sortable:this,name:"end",toEl:ve,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){xe("nulling",this),fe=K=ve=ie=pt=pe=vn=it=dt=Be=zt=De=nt=Et=Yt=St=Xt=Se=ln=te.dragged=te.ghost=te.clone=te.active=null,Ln.forEach(function(e){e.checked=!0}),Ln.length=Ro=ko=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":K&&(this._onDragOver(e),gg(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,p=0,d=n.length,g=this.options;p<d;p++)t=n[p],ze(t,g.draggable,this.el,!1)&&e.push(t.getAttribute(g.dataIdAttr)||Cg(t));return e},sort:function(e,t){var n={},p=this.el;this.toArray().forEach(function(d,g){var m=p.children[g];ze(m,this.options.draggable,p,!1)&&(n[d]=m)},this),t&&this.captureAnimationState(),e.forEach(function(d){n[d]&&(p.removeChild(n[d]),p.appendChild(n[d]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return ze(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(t===void 0)return n[e];var p=on.modifyOption(this,e,t);typeof p<"u"?n[e]=p:n[e]=t,e==="group"&&Dh(n)},destroy:function(){xe("destroy",this);var e=this.el;e[Re]=null,oe(e,"mousedown",this._onTapStart),oe(e,"touchstart",this._onTapStart),oe(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(oe(e,"dragover",this),oe(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),xn.splice(xn.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!it){if(xe("hideClone",this),te.eventCanceled)return;ne(pe,"display","none"),this.options.removeCloneOnHide&&pe.parentNode&&pe.parentNode.removeChild(pe),it=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(it){if(xe("showClone",this),te.eventCanceled)return;K.parentNode==fe&&!this.options.group.revertClone?fe.insertBefore(pe,K):pt?fe.insertBefore(pe,pt):fe.appendChild(pe),this.options.group.revertClone&&this.animate(K,pe),ne(pe,"display",""),it=!1}}};function gg(l){l.dataTransfer&&(l.dataTransfer.dropEffect="move"),l.cancelable&&l.preventDefault()}function hn(l,e,t,n,p,d,g,m){var c,f=l[Re],r=f.options.onMove,o;return window.CustomEvent&&!tt&&!rn?c=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(c=document.createEvent("Event"),c.initEvent("move",!0,!0)),c.to=e,c.from=l,c.dragged=t,c.draggedRect=n,c.related=p||e,c.relatedRect=d||we(e),c.willInsertAfter=m,c.originalEvent=g,l.dispatchEvent(c),r&&(o=r.call(f,c,g)),o}function Do(l){l.draggable=!1}function mg(){$s=!1}function vg(l,e,t){var n=we(_t(t.el,0,t.options,!0)),p=Rh(t.el,t.options,ie),d=10;return e?l.clientX<p.left-d||l.clientY<n.top&&l.clientX<n.right:l.clientY<p.top-d||l.clientY<n.bottom&&l.clientX<n.left}function yg(l,e,t){var n=we(Zs(t.el,t.options.draggable)),p=Rh(t.el,t.options,ie),d=10;return e?l.clientX>p.right+d||l.clientY>n.bottom&&l.clientX>n.left:l.clientY>p.bottom+d||l.clientX>n.right&&l.clientY>n.top}function bg(l,e,t,n,p,d,g,m){var c=n?l.clientY:l.clientX,f=n?t.height:t.width,r=n?t.top:t.left,o=n?t.bottom:t.right,s=!1;if(!g){if(m&&yn<f*p){if(!Qt&&(Xt===1?c>r+f*d/2:c<o-f*d/2)&&(Qt=!0),Qt)s=!0;else if(Xt===1?c<r+yn:c>o-yn)return-Xt}else if(c>r+f*(1-p)/2&&c<o-f*(1-p)/2)return wg(e)}return s=s||g,s&&(c<r+f*d/2||c>o-f*d/2)?c>r+f/2?1:-1:0}function wg(l){return Fe(K)<Fe(l)?1:-1}function Cg(l){for(var e=l.tagName+l.className+l.src+l.href+l.textContent,t=e.length,n=0;t--;)n+=e.charCodeAt(t);return n.toString(36)}function Sg(l){Ln.length=0;for(var e=l.getElementsByTagName("input"),t=e.length;t--;){var n=e[t];n.checked&&Ln.push(n)}}function bn(l){return setTimeout(l,0)}function Es(l){return clearTimeout(l)}Kn&&se(document,"touchmove",function(l){(te.active||At)&&l.cancelable&&l.preventDefault()});te.utils={on:se,off:oe,css:ne,find:Mh,is:function(e,t){return!!ze(e,t,e,!1)},extend:rg,throttle:_h,closest:ze,toggleClass:Oe,clone:Lh,index:Fe,nextTick:bn,cancelNextTick:Es,detectDirection:Oh,getChild:_t,expando:Re};te.get=function(l){return l[Re]};te.mount=function(){for(var l=arguments.length,e=new Array(l),t=0;t<l;t++)e[t]=arguments[t];e[0].constructor===Array&&(e=e[0]),e.forEach(function(n){if(!n.prototype||!n.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));n.utils&&(te.utils=Ge(Ge({},te.utils),n.utils)),on.mount(n)})};te.create=function(l,e){return new te(l,e)};te.version=ng;var be=[],jt,Ts,Ms=!1,Io,No,Rn,Ut;function Ag(){function l(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return l.prototype={dragStarted:function(t){var n=t.originalEvent;this.sortable.nativeDraggable?se(document,"dragover",this._handleAutoScroll):this.options.supportPointer?se(document,"pointermove",this._handleFallbackAutoScroll):n.touches?se(document,"touchmove",this._handleFallbackAutoScroll):se(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var n=t.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?oe(document,"dragover",this._handleAutoScroll):(oe(document,"pointermove",this._handleFallbackAutoScroll),oe(document,"touchmove",this._handleFallbackAutoScroll),oe(document,"mousemove",this._handleFallbackAutoScroll)),nu(),wn(),og()},nulling:function(){Rn=Ts=jt=Ms=Ut=Io=No=null,be.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,n){var p=this,d=(t.touches?t.touches[0]:t).clientX,g=(t.touches?t.touches[0]:t).clientY,m=document.elementFromPoint(d,g);if(Rn=t,n||this.options.forceAutoScrollFallback||rn||tt||Kt){Fo(t,this.options,m,n);var c=rt(m,!0);Ms&&(!Ut||d!==Io||g!==No)&&(Ut&&nu(),Ut=setInterval(function(){var f=rt(document.elementFromPoint(d,g),!0);f!==c&&(c=f,wn()),Fo(t,p.options,f,n)},10),Io=d,No=g)}else{if(!this.options.bubbleScroll||rt(m,!0)===Ue()){wn();return}Fo(t,this.options,rt(m,!1),!1)}}},Je(l,{pluginName:"scroll",initializeByDefault:!0})}function wn(){be.forEach(function(l){clearInterval(l.pid)}),be=[]}function nu(){clearInterval(Ut)}var Fo=_h(function(l,e,t,n){if(e.scroll){var p=(l.touches?l.touches[0]:l).clientX,d=(l.touches?l.touches[0]:l).clientY,g=e.scrollSensitivity,m=e.scrollSpeed,c=Ue(),f=!1,r;Ts!==t&&(Ts=t,wn(),jt=e.scroll,r=e.scrollFn,jt===!0&&(jt=rt(t,!0)));var o=0,s=jt;do{var a=s,i=we(a),u=i.top,h=i.bottom,y=i.left,b=i.right,T=i.width,$=i.height,A=void 0,S=void 0,M=a.scrollWidth,R=a.scrollHeight,L=ne(a),_=a.scrollLeft,O=a.scrollTop;a===c?(A=T<M&&(L.overflowX==="auto"||L.overflowX==="scroll"||L.overflowX==="visible"),S=$<R&&(L.overflowY==="auto"||L.overflowY==="scroll"||L.overflowY==="visible")):(A=T<M&&(L.overflowX==="auto"||L.overflowX==="scroll"),S=$<R&&(L.overflowY==="auto"||L.overflowY==="scroll"));var w=A&&(Math.abs(b-p)<=g&&_+T<M)-(Math.abs(y-p)<=g&&!!_),v=S&&(Math.abs(h-d)<=g&&O+$<R)-(Math.abs(u-d)<=g&&!!O);if(!be[o])for(var C=0;C<=o;C++)be[C]||(be[C]={});(be[o].vx!=w||be[o].vy!=v||be[o].el!==a)&&(be[o].el=a,be[o].vx=w,be[o].vy=v,clearInterval(be[o].pid),(w!=0||v!=0)&&(f=!0,be[o].pid=setInterval((function(){n&&this.layer===0&&te.active._onTouchMove(Rn);var E=be[this.layer].vy?be[this.layer].vy*m:0,x=be[this.layer].vx?be[this.layer].vx*m:0;typeof r=="function"&&r.call(te.dragged.parentNode[Re],x,E,l,Rn,be[this.layer].el)!=="continue"||xh(be[this.layer].el,x,E)}).bind({layer:o}),24))),o++}while(e.bubbleScroll&&s!==c&&(s=rt(s,!1)));Ms=f}},30),Fh=function(e){var t=e.originalEvent,n=e.putSortable,p=e.dragEl,d=e.activeSortable,g=e.dispatchSortableEvent,m=e.hideGhostForTarget,c=e.unhideGhostForTarget;if(t){var f=n||d;m();var r=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,o=document.elementFromPoint(r.clientX,r.clientY);c(),f&&!f.el.contains(o)&&(g("spill"),this.onSpill({dragEl:p,putSortable:n}))}};function Js(){}Js.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var p=_t(this.sortable.el,this.startIndex,this.options);p?this.sortable.el.insertBefore(t,p):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:Fh};Je(Js,{pluginName:"revertOnSpill"});function ea(){}ea.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable,p=n||this.sortable;p.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),p.animateAll()},drop:Fh};Je(ea,{pluginName:"removeOnSpill"});te.mount(new Ag);te.mount(ea,Js);const $e={getStyle:(l,e=!1)=>{let t;return window.getComputedStyle?t=window.getComputedStyle(l,null):l.currentStyle&&(t=l.currentStyle),e?t[e]:t},fadeOut:(l,e=250)=>{const t=1/(e/60);l.style.opacity=1,(function n(){const p=Number(l.style.opacity)-t;p>0?(l.style.opacity=p,window.requestAnimationFrame(n)):l.remove()})()},slideDown:(l,e=250,t=!1)=>{l.style.display="block";const n=$e.getStyle(l),p=Number.parseInt(n.height,10),d=p/(e/60);l.style.height="0px",(function g(){const m=Number.parseFloat(l.style.height),c=m+d;m<p?(l.style.height=`${c}px`,window.requestAnimationFrame(g)):(l.style.height="auto",t&&t(l))})()},slideUp:(l,e=250,t=!1)=>{const n=$e.getStyle(l),p=Number.parseInt(n.height,10),d=n.overflow;l.style.overflow="hidden",l.style.height=`${p}px`;const g=n.minHeight;l.style.minHeight="auto";const m=parseFloat(p/(e/60)).toFixed(2);(function c(){const r=Number.parseInt(l.style.height,10)-m;r>0?(l.style.height=`${r}px`,window.requestAnimationFrame(c)):(l.style.overflow=d,l.style.display="none",l.style.minHeight=g,delete l.style.height,t&&t(l))})()},slideToggle:(l,e=250,t=$e.getStyle(l,"display")==="none")=>{t?$e.slideDown(l,e):$e.slideUp(l,e)}},Ph=l=>Number.isInteger(Number(l)),lt=l=>{let e=0,t=l;for(;t?.previousElementSibling;)t=t.previousElementSibling,e++;return e},kn=(l,e,t)=>{const n=t.split("||"),d=gt(e).map(g=>l.find(m=>{const c=n.find(f=>!!Ie(m,f));return c&&Ie(m,c)===g})).filter(Boolean).concat(l);return gt(d)},qn=(l,e,t)=>{for(let n=0;n<l.length;n++)e.call(t,l[n],n)},ta=(l,e)=>{const t=[];return qn(l,(n,p)=>t.push(e(n,p))),t},Po={},Wh=l=>{const e={className:"class"};if(Po[l])return Po[l];const n=(e[l]||l).replace(/^\d+/,"").replace(/[^a-zA-Z0-9-:]/g,"");return Po[l]=n,n},Bh=l=>l.replace(/\b\w/g,e=>e.toUpperCase()),$g=l=>window.JSON.parse(window.JSON.stringify(l)),Eg=(l,e)=>e.filter(t=>!~l.indexOf(t)),Hh=()=>window.navigator.userAgent.indexOf("MSIE ")!==-1,Ne={capitalize:Bh,safeAttrName:Wh,forEach:qn,copyObj:$g,map:ta,subtract:Eg,indexOfNode:lt,isInt:Ph,get:Ie,orderObjectsBy:kn,isIE:Hh},Tg={glyphicons:l=>`<span class="glyphicon glyphicon-${l}" aria-hidden="true"></span>`,"font-awesome":l=>{const[e,t]=l.split(" ");return`<i class="${e} fa-${t}"></i>`},fontello:l=>`<i class="${yh}${l}">${l}</i>`},Mg=new Set(["input","textarea","select"]),_g=(l={})=>{let e=l?.attrs?.name||l?.name;if(e)return e;const t=We(l);let n=l.config?.label||l.attrs?.label||l?.label;return n&&(typeof n=="object"&&(n=U.create(n).textContent),/^<.+>.+<.+>$/gim.test(n)&&(n=lp(n)),e=`${t}-${bh(cp(n,24,null))}`),e||t};class xg{constructor(e=Object.create(null)){this.options=e}set setOptions(e){this.options=je(this.options,e)}processElemArg(e){let t=e,n;if(typeof t=="string")return n=t,t={tag:n},t;if(t.attrs){const{tag:p,...d}=t.attrs;p&&(typeof p=="string"?n=p:n=(p.find(m=>m.selected===!0)||p[0]).value),t.attrs=d}return t.tag=n||t.tag||"div",t}render=e=>(e.id=`f-${e.id||We()}`,this.create(e));create=(e,t=!1)=>{if(!e)return;if(this.isDOMElement(e))return e;const n=this,p=["children","content"],{className:d,options:g,dataset:m,...c}=this.processElemArg(e);p.push("tag");let f;const{tag:r}=c;let o;const s={attrs:{},className:[Ne.get(c,"config.inputWrap")],children:[],config:{}};let a=document.createElement(r);const i={string:h=>{a.innerHTML+=h},object:h=>h&&a.appendChild(n.create(h,t)),node:h=>a.appendChild(h),component:h=>a.appendChild(h.dom),array:h=>{for(const y of h)f=n.childType(y),i[f](y)},function:h=>{h=h(),f=n.childType(h),i[f](h)},undefined:()=>null,boolean:()=>null};if(d&&(c.attrs=je(c.attrs,{className:d})),g){const h=this.processOptions(g,c,t);if(this.holdsContent(a)&&r!=="button")i.array.call(this,h),c.content=void 0;else return Ne.forEach(h,y=>{s.children.push(n.create(y,t))}),c.attrs.className&&(s.className=c.attrs.className),s.id=c.id,s.config={...c.config},this.create(s,t);p.push("options")}if(c.attrs&&(n.processAttrs(c,a,t),p.push("attrs")),c.config){if(c.config.label&&(c.config.label&&r!=="button"||["radio","checkbox"].includes(Ne.get(c,"attrs.type")))&&!t){const h=n.label(c);if(!c.config.hideLabel){const y=[h,a];n.labelAfter(c)&&y.reverse(),s.children.push(y)}}p.push("config")}if(c.content||c.children){const h=c.content||c.children;f=n.childType(h),i[f]||console.error(`childType: ${f} is not supported`),i[f].call(this,h)}if(m){for(const h in m)Object.hasOwn(m,h)&&(a.dataset[h]=typeof m[h]=="function"?m[h]():m[h]);p.push("dataset")}c.action&&(this.actionHandler(a,c.action),p.push("action"));const u=Ne.subtract(p,Object.keys(c));for(o=u.length-1;o>=0;o--)a[u[o]]=c[u[o]];return s.children.length&&(a=this.create(s)),a};onRender=(e,t,n=qe)=>{const p=Date.now(),d=()=>{!e.parentElement&&Date.now()-p<n?window.requestAnimationFrame(d):e.parentElement&&t(e)};d()};actionHandler(e,t){const n={onRender:U.onRender,render:U.onRender},p=["focus","blur"],d=g=>(m,c)=>m.addEventListener(g,c,p.includes(g));return Object.entries(t).map(([g,m])=>(Array.isArray(m)?m:[m]).map(f=>(n[g]||d(g))(e,f)))}get icons(){if(this.iconSymbols)return this.iconSymbols;const e=document.querySelectorAll(`#${st} svg symbol`),t=n=>({tag:"svg",attrs:{className:["svg-icon",n]},children:[{tag:"use",attrs:{"xmlns:xlink":"http://www.w3.org/1999/xlink","xlink:href":`#${n}`}}]});return this.iconSymbols=Array.from(e).reduce((n,p)=>{const d=p.id.replace(yh,"");return n[d]=t(p.id),n},{}),this.cachedIcons={},this.iconSymbols}icon(e,t){if(!e)return;const n=`${e}?${new URLSearchParams(t).toString()}`;if(this.cachedIcons?.[n])return this.cachedIcons[n];const p=this.icons[e];if(p){if(t){const d=je(p,t);return this.cachedIcons[n]=U.create(d).outerHTML,this.cachedIcons[n]}return this.cachedIcons[n]=U.create(p).outerHTML,this.cachedIcons[n]}return Tg[U.options.iconFont]?.(e)||e}processAttrs(e,t,n){const{attrs:p={}}=e;if(!n&&!p.name&&p.name!==null&&this.isInput(e.tag)){const d=_g(e);d&&t.setAttribute("name",d)}for(const d of Object.keys(p)){const g=Ne.safeAttrName(d),m=this.processAttrValue(p[d]);m!==!1&&t.setAttribute(g,m)}}processAttrValue(e){if(typeof e=="function")return e();if(typeof e=="boolean")return e&&"";let t=e||"";if(Array.isArray(t))if(typeof t[0]=="object"){const n=t.filter(p=>p.selected===!0);t=n.length?n[0].value:t[0].value}else t=t.join(" ");return t}toggleElementsByStr=(e,t)=>{const n=[],p=(d,g)=>{g?(d.style.display="block",n.push(d)):d.style.display="none"};return U.elementsContainText(e,t,p),n};elementsContainText=(e,t,n)=>{const p=[];return qn(e,d=>{const m=d.textContent.toLowerCase().indexOf(t.toLowerCase())!==-1;n?.(d,m),m&&p.push(d)}),p};generateOption=({type:e="option",label:t,value:n,i:p=0,selected:d})=>({tag:e==="option"?"option":"input",attrs:{type:e,value:n||`${e}-${p}`,[e==="option"?"selected":"checked"]:d||!p},config:{label:t||Q.get("labelCount",{label:Q.get("option"),count:p})}});processOptions(e,t,n){const{action:p,attrs:d={}}=t,g=d.type||t.tag,m=d.id||t.id,c=(r,o)=>{const{label:s,value:a,...i}=r,u=()=>{const y={tag:"input",attrs:{name:m,type:g,value:a||"",id:`${m}-${o}`,...i},action:p},b={tag:"label",attrs:{for:`${m}-${o}`},children:s},T={children:[y,b],className:[`f-${g}`]};return d.className&&(t.config.inputWrap=d.className),t.config.inline&&T.className.push(`f-${g}-inline`),r.selected&&(y.attrs.checked=!0),n&&(b.attrs.contenteditable=!0),T};return{select:()=>{const y=r.attrs||r,b={attrs:y,...r,...y},{label:T,checked:$,selected:A,attrs:S}=b;return{tag:"option",attrs:{...S,selected:!!($||A)},children:T}},button:y=>{const{type:b,label:T,className:$,id:A}=y;return{...t,attrs:{type:b},className:$,id:A||We(),options:void 0,children:T,action:t.action}},checkbox:u,radio:u}[g]?.(r)};return e.map(c)}holdsContent(e){return e.outerHTML.indexOf("/")!==-1}isBlockInput(e){return!this.isInput(e)&&this.holdsContent(e)}isInput(e){let t=e;return typeof t!="string"&&(t=t.tagName),Mg.has(t)}parsedHtml(e){const t=document.createElement("textarea");return t.innerHTML=e,t.textContent}labelAfter(e){const t=Ne.get(e,"attrs.type"),n=Ne.get(e,"config.labelAfter");return n!==void 0?n:t==="checkbox"||t==="radio"}requiredMark=()=>({tag:"span",className:"text-error",children:"*"});label(e,t){const n=Ne.get(e,"attrs.required");let{config:{label:p=""}}=e;const{id:d,attrs:g}=e;typeof p=="function"&&(p=p());const m={tag:"label",attrs:{for:d||g?.id},className:[],children:[p,n&&this.requiredMark()],action:{}};return t&&(m.attrs.for=void 0,m.attrs.contenteditable=!0,m.fMap=t),m}childType(e){return e===void 0?e:[["array",t=>Array.isArray(t)],["node",t=>t instanceof window.Node||t instanceof window.HTMLElement],["component",()=>e?.dom],[typeof e,()=>!0]].find(t=>t[1](e))[0]}getStyle(e,t=!1){let n;return window.getComputedStyle?n=window.getComputedStyle(e,null):e.currentStyle&&(n=e.currentStyle),t?n[t]:n}getElement(e){const t={node:()=>e,object:()=>document.getElementById(e.id),string:()=>document.getElementById(e)},n=this.childType(e);return t[n]()}empty(e){for(;e.firstChild;)this.remove(e.firstChild);return e}removeEmpty=e=>{const t=e.parentElement,n=Le(e),p=t.getElementsByClassName(`formeo-${n}`);if(this.remove(e),!p.length)return this.isStage(t)?this.emptyClass(t):this.removeEmpty(t)};remove(e){const t=Le(e);return t?ce.remove(`${t}s.${e.id}`):e.parentElement.removeChild(e)}removeClasses(e,t){const n={string:p=>p.classList.remove(t),array:p=>{for(const d of t)p.classList.remove(d)}};n.object=n.string,Ne.forEach(e,n[this.childType(t)])}addClasses(e,t){const n={string:p=>p.classList.add(t),array:p=>{for(const d of t)p.classList.add(d)}};Ne.forEach(e,n[this.childType(t)])}formGroup(e,t=""){return{className:["f-field-group",t],children:e}}coords(e){const t=e.getBoundingClientRect(),n=document.body.getBoundingClientRect();return{pageX:t.left+t.width/2,pageY:t.top-n.top-t.height/2}}clearStage(e){e.classList.add("removing-all-fields");const t=()=>{U.empty(e),e.classList.remove("removing-all-fields"),U.emptyClass(e),$e.slideDown(e,300)};$e.slideUp(e,600,t)}toggleSortable(e,t){let n=t;const p=Le(e);if(!p)return;const d=Le(e.parentElement),g=U[p].get(e.id).sortable;n||(n=!g.option("disabled")),g.option("disabled",n),d&&["rows","columns","stages"].includes(d)&&this.toggleSortable(e.parentElement,n)}emptyClass(e){const t=e.getElementsByClassName(Nf.get(e.classList.item(0)));e.classList.toggle("empty",!t.length)}btnTemplate=({title:e="",...t})=>({tag:"button",attrs:{type:"button",title:e},...t});isControls=e=>Le(e)===ot;isStage=e=>Le(e)===Ot;isRow=e=>Le(e)===Qe;isColumn=e=>Le(e)===Ze;isField=e=>Le(e)===Dt;asComponent=e=>ce[`${Le(e)}s`].get(e.id);isDOMElement(e){return e instanceof window.Element||e instanceof window.HTMLElement||!!(e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string")}}const U=new xg,Lg="modulepreload",Rg=function(l){return"/formeo/"+l},iu={},$t=function(e,t,n){let p=Promise.resolve();if(t&&t.length>0){let c=function(f){return Promise.all(f.map(r=>Promise.resolve(r).then(o=>({status:"fulfilled",value:o}),o=>({status:"rejected",reason:o}))))};document.getElementsByTagName("link");const g=document.querySelector("meta[property=csp-nonce]"),m=g?.nonce||g?.getAttribute("nonce");p=c(t.map(f=>{if(f=Rg(f),f in iu)return;iu[f]=!0;const r=f.endsWith(".css"),o=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${o}`))return;const s=document.createElement("link");if(s.rel=r?"stylesheet":Lg,r||(s.as="script"),s.crossOrigin="",s.href=f,m&&s.setAttribute("nonce",m),document.head.appendChild(s),r)return new Promise((a,i)=>{s.addEventListener("load",a),s.addEventListener("error",()=>i(new Error(`Unable to preload CSS for ${f}`)))})}))}function d(g){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=g,window.dispatchEvent(m),!m.defaultPrevented)throw g}return p.then(g=>{for(const m of g||[])m.status==="rejected"&&d(m.reason);return e().catch(d)})},Tt="f-autocomplete",kg=`${Tt}-display-field`,na=`${Tt}-list`,Ft="highlight-component",On=`${na}-item`,Og=(l,e)=>{const t=l.reduce((n,p)=>n+(p===e),0);return t>1?`(${t})`:""},zh=["config.label","config.controlId"],Dg=["config.legend","name"],Ig=[...zh,...Dg],Wo=l=>zh.reduce((e,t)=>e||l.get(t),null),ru=l=>Ig.reduce((e,t)=>e||l.get(t),null)||at(l.name),Ng=new Map([["condition.source",Wo],["if.condition.source",Wo],["if.condition.target",Wo],["then.condition.target",ru],["condition.target",ru]]),jh=({id:l,...e},t)=>{const{name:n,label:p}=e;return n?Ng.get(t)(e):p},Fg=({selectedId:l,...e})=>(e.value===l&&(e.selected=!0),e),Bo=l=>(l.classList.contains(On)||(l=l.parentElement),l),Uh=({value:l,textLabel:e,htmlLabel:t,componentType:n,depth:p=0},d)=>{const g={tag:"li",children:t,dataset:{value:l,label:e},className:[On,`${On}-depth-${p}`,`component-type-${n}`],action:{mousedown:({target:m})=>{m=Bo(m),d.setValue(m),d.selectOption(m),d.hideList()},mouseover:({target:m})=>{m=Bo(m),d.removeHighlight(),d.highlightComponent(m)},mouseleave:({target:m})=>{m=Bo(m),d.removeHighlight()}}};return U.create(g)},Pg=(l,e)=>{const t=l.data.options.map((p,d)=>{const g=`${l.address}.options[${d}]`,m=p.label,c=p.label;return Uh({value:g,textLabel:m,htmlLabel:c,componentType:"option",depth:1},e)});return U.create({tag:"ul",attrs:{className:[na,"options-list"]},children:t})},Wg=l=>{const e=l.value,t=[],n=ce.flatList();return Object.entries(n).reduce((d,[g,m])=>{const c=jh(m,l.key);if(c){const f=m.name,r={tag:"span",content:` ${at(f)}`,className:"component-type"},o=`${f}.${c}`;t.push(o);const s=Og(t,o),a={tag:"span",content:s,className:"component-label-count"},i=[`${c} `,a,r],u=[c,s].join(" ").trim();if(m.isCheckable){const y=Pg(m,l);i.push(y)}const h=Fg({value:g,textLabel:u,htmlLabel:i,componentType:f,selectedId:e});d.push(Uh(h,l))}return d},[])};class Bg{lastCache=Date.now();optionsCache=null;constructor({key:e,value:t,className:n,onChange:p=ws}){this.key=e,this.className=[n||this.key.replace(/\./g,"-")].flat(),this.value=t,this.onChange=p||ws,this.events=[],this.build()}createProxy(){return new Proxy(this,{get(e,t){if(t in e)return e[t];if(t in e.dom){const n=e.dom[t];return typeof n=="function"?n.bind(e.dom):n}},set(e,t,n){return t in e?e[t]=n:e.dom[t]=n,!0}})}get isAddress(){return Pe(this.value)}get valueComponent(){return Pe(this.value)&&ce.getAddress(this.value)}build(){const e=n=>{const p=this.list,d=this.getActiveOption();let m=new Map([[38,()=>{const c=this.getPreviousOption(d);c&&this.selectOption(c)}],[40,()=>{const c=this.getNextOption(d);c&&this.selectOption(c)}],[13,()=>{d&&(this.selectOption(d),this.setValue(d),p.style.display==="none"?this.showList(d):this.hideList()),n.preventDefault()}],[27,()=>{this.hideList()}]]).get(n.keyCode);return m||(m=()=>!1),m()},t={focus:({target:n})=>{this.updateOptions(),n.parentElement.classList.add(`${Tt}-focused`);const p=U.toggleElementsByStr(this.list.querySelectorAll(`.${On}-depth-0`),n.value);n.addEventListener("keydown",e);const d=this.list.querySelector(".active-option")||p[0];this.showList(d)},blur:({target:n})=>{n.parentElement.classList.remove(`${Tt}-focused`),n.removeEventListener("keydown",e),this.hideList()},input:n=>{const{value:p}=n.target,d=U.toggleElementsByStr(this.list.querySelectorAll("li"),p);if(p.length===0&&this.clearValue(),d.length===0)this.hideList();else{const g=this.getActiveOption()||d[0];this.showList(g)}this.setValue({dataset:{label:p,value:p}})}};return this.displayField=U.create({tag:"input",autocomplete:"off",action:t,attrs:{type:"text",className:kg,value:this.label||this.value,placeholder:Q.get(`${this.key}.placeholder`)}}),this.hiddenField=U.create({tag:"input",attrs:{type:"hidden",className:Tt,value:this.value}}),this.list=U.create({tag:"ul",attrs:{className:na}}),this.clearButton=U.create({tag:"span",content:U.icon("remove"),className:"clear-button hidden",action:{click:()=>this.clearValue()}}),this.dom=U.create({children:[this.displayField,this.clearButton,this.hiddenField],className:[Tt,this.className].flat(),action:{onRender:n=>{this.stage=n.closest(".formeo-stage"),this.value&&(this.displayField.value=this.label),this.clearButton.classList.toggle("hidden",!this.value.length)}}}),this.dom}get label(){if(!Pe(this.value))return this.value;const e=this.value&&ce.getAddress(this.value);return e&&jh(e,`${this.key}`)||this.value}updateOptions(){let e=this.optionsCache;const t=Date.now();(t-this.lastCache>zs*5||!e)&&(U.empty(this.list),e=this.generateOptions(),this.lastCache=t),this.list.children.length||this.list.append(...e)}generateOptions(){return this.optionsCache=Wg(this),this.optionsCache}setListPosition(){const{offsetHeight:e,offsetWidth:t}=this.displayField,n=this.displayField.closest(".formeo-stage").getBoundingClientRect(),p=this.displayField.getBoundingClientRect(),d={position:"absolute",top:`${p.y+e-n.y}px`,left:`${p.x+window.scrollX-n.x+2}px`,width:`${t}px`};Object.assign(this.list.style,d)}showList(e,t=this.list){this.stage.contains(this.list)||this.stage.appendChild(this.list),this.setListPosition(),this.selectOption(e),$e.slideDown(t,mt)}hideList(e=this.list){$e.slideUp(e,mt),this.removeHighlight(),this.stage.contains(this.list)&&this.stage.removeChild(this.list)}getActiveOption(e=this.list){const t=e.querySelector(".active-option");return t?.style.display!=="none"?t:null}getPreviousOption(e){let t=e;do t=t?t.previousSibling:null;while(t!=null&&t.style.display==="none");return t}getNextOption(e){let t=e;do t=t?t.nextSibling:null;while(t!=null&&t.style.display==="none");return t}selectOption(e,t=this.list){const n=t.querySelectorAll("li");for(const p of n){const{dataset:{value:d}}=p;p.classList.remove("active-option"),Pe(d)&&ce.getAddress(d)?.dom?.classList.remove(Ft)}e&&(e.classList.add("active-option"),this.highlightComponent(e))}removeHighlight(){const e=document.getElementsByClassName(Ft);for(const t of e)t.classList.remove(Ft)}highlightComponent(e){const{dataset:{value:t}}=e;if(Pe(t)){const{componentAddress:n,isOptionAddress:p,optionIndex:d}=vt(t).reduce((m,c)=>c==="options"?(m.isOptionAddress=!0,m):m.isOptionAddress?(m.optionIndex=+c,m):(m.componentAddress.push(c),m),{componentAddress:[],optionIndex:null,isOptionAddress:!1}),g=ce.getAddress(n);g?.dom&&(g.dom.classList.add(Ft),p&&g.dom.querySelectorAll(".field-preview .f-checkbox, .field-preview .f-radio")[d]?.classList.add(Ft))}}clearValue(){this.selectOption(null),this.setValue({dataset:{label:"",value:""}}),this.displayField.focus()}setValue(e){const{label:t,value:n}=e.dataset;this.displayField.value=t,this.hiddenField.value=n,this.value=n,this.clearButton.classList.toggle("hidden",!n.length),this.onChange?.({target:this.hiddenField})}}function Ho({key:l,value:e,type:t="text",checked:n}){const p={tag:"input",attrs:{type:t,value:e,placeholder:Q.get(`${l}.placeholder`)||at(l)},className:[l.replace(/\./g,"-")],config:{}};return n&&(p.attrs.checked=!0),p}function Gh(l){const e=Q.get(l);if(e)return e;const t=l.split(".");return Q.get(t[t.length-1])}const xt={autocomplete:(...l)=>new Bg(...l).createProxy(),string:({key:l,value:e})=>Ho({key:l,value:e}),boolean:({key:l,value:e})=>Ho({key:l,value:e,type:l==="selected"?"radio":"checkbox",checked:!!e}),number:({key:l,value:e})=>Ho({key:l,value:e,type:"number"}),array:({key:l,value:e})=>({tag:"select",attrs:{placeholder:Gh(`placeholder.${l}`)},className:[l.replace(/\./g,"-")],options:e}),object:l=>Object.entries(l).map(([e,t])=>xt[U.childType(t)]({key:e,value:t}))},Hg={boolean:(l,e)=>({click:({target:t})=>{if(t.type==="radio"){const n=e.data.options.map(p=>({...p,selected:!1}));e.set("options",n)}e.set(l,t.checked),e.updatePreview()}}),string:(l,e)=>({input:({target:{value:t}})=>{e.set(l,t),e.debouncedUpdatePreview()}}),number:(l,e)=>({input:({target:{value:t}})=>{e.set(l,Number(t)),e.debouncedUpdatePreview()}}),array:(l,e)=>({change:({target:{value:t}})=>{e.set(l,t),e.debouncedUpdatePreview()}}),object:()=>({})},Vh="hidden-property",zg="hidden-option",zo=/\.options\[\d+\]$/,jg={"if-sourceProperty":gn(pn,rc,oc),"if-targetProperty":gn(pn),"then-targetProperty":gn(pn,rc,oc),...Object.entries(tp).reduce((l,[e,t])=>(l[`if-${e}`]=t,l[`then-${e}`]=t,l),{})},Kh={assignment:Pt,comparison:Pt,logical:Pt,source:({key:l,value:e,onChange:t,conditionType:n})=>xt.autocomplete({key:`${n}.condition.${l}`,value:e,onChange:t,className:`condition-${l}`}),sourceProperty:Pt,targetProperty:Pt,target:l=>Kh.source(l),value:({key:l,value:e,onChange:t},n)=>{const p=xt.string({key:`condition.${l}`,value:e});return p.action={input:t},p}};function Ug({key:l,value:e,conditionType:t}){const n=`${t}-${l}`,p=jg[n];return Object.entries(p||{}).map(([d,g])=>Gg({fieldName:l,fieldValue:e,key:d,optionValue:g}))}function Gg({fieldName:l,fieldValue:e,key:t,optionValue:n}){return{label:Q.get(`${l}.${t}`)||at(t).toLowerCase(),value:n,selected:n===e}}function Pt({key:l,value:e,onChange:t,conditionType:n}){const p=Ug({key:l,value:e,conditionType:n}),d=xt.array({key:`condition.${l}`,value:p});return d.action={change:t},d}const Vg=l=>!l?.classList.contains(Vh),Kg={sourceProperty:l=>{const e=l.get("source"),t=l.get("sourceProperty"),n=!!e.value,p=!!e.value.match(zo);return su(p,t),!n},comparison:l=>{const e=l.get("source"),t=l.get("sourceProperty"),n=!!e.value,p=!!e.value.match(zo);return!n||p||t.value!=="value"},assignment:l=>{const e=l.get("target"),t=l.get("targetProperty");return!!!e.value||t.value.startsWith("is")},targetProperty:l=>{const e=l.get("target"),t=l.get("targetProperty"),n=!!e.value.match(zo);return su(n,t),!Rf(e.value)},target:l=>{const e=l.get("source"),t=l.get("sourceProperty"),n=!!e?.value;return t&&!n?!0:t&&t?.value!=="value"},value:l=>{const e=l.get("target"),t=l.get("targetProperty");return t===void 0?!1:e&&!e.value||!Vg(l.get("comparison"))||t.value===qh?!0:t.value.startsWith("is")}},ou=l=>{for(const[e,t]of l){const n=!!Kg[e]?.(l)||!1;t.classList.toggle(Vh,n)}},qh="isChecked",jo=l=>l.value.endsWith("Checked"),su=(l,e)=>{if(l&&jo(e))return null;const t=Array.from(e.querySelectorAll("option")),n=[];for(const p of t){const d=jo(p),g=l?!d:d;g&&n.push(p.value),p.classList.toggle(zg,g)}n.includes(e.value)&&(e.value=l?qh:t.find(p=>!jo(p))?.value||e.value)};function qg(l,e=ep){return e.reduce((t,n)=>(l[n]!==void 0&&t.push([n,l[n]]),t),[])}class Yg{constructor({conditionValues:e,conditionType:t,conditionCount:n,index:p},d){this.values=new Map(qg(e)),this.conditionType=t,this.parent=d,this.baseAddress=`${d.address}.${t}`,this.fields=new Map,this.conditionCount=n,this.index=p,this.dom=this.generateDom()}setConditionIndex(e){this.index=e}get address(){return`${this.baseAddress}[${this.index}]`}destroy(){const e=ce.getAddress(this.baseAddress);e.splice(this.index,1),ce.setAddress(this.baseAddress,e),$e.slideUp(this.dom,mt,()=>{this.dom.remove()})}label(){return this.index?null:{tag:"label",className:`condition-label ${this.conditionType}-condition-label`,content:Q.get(`condition.type.${this.conditionType}`)}}generateDom(){const e=[];for(const[p,d]of this.values){const g=r=>this.onChangeCondition({key:p,target:r.target}),m={key:p,value:d,conditionType:this.conditionType,onChange:g},c=Kh[p](m,this.values),f=c.dom||U.create(c);this.fields.set(p,c.dom?c:f),e.push(f)}const n={children:[this.label(),...e,...this.generateConditionTypeActionButtons()],className:`f-condition-row ${this.conditionType}-condition-row display-none`,action:{onRender:p=>{this.processUiState()}}};return U.create(n)}generateConditionTypeActionButtons(){const e=[],t="manage-condition-type",n=g=>`${g}-condition-type`,p=U.btnTemplate({title:Q.get(`remove${this.conditionType}Condition`),className:[t,n("remove")],content:U.icon("minus"),action:{click:()=>this.destroy(),mouseover:g=>{this.dom.classList.add("to-remove")},mouseout:g=>{this.dom.classList.remove("to-remove")}}});e.push(p);const d=U.btnTemplate({title:Q.get(`add${this.conditionType}Condition`),className:[t,n("add")],content:U.icon("plus"),action:{click:()=>{const g=this.parent.addConditionType(this.conditionType),m={changedProperty:null,dataPath:g.address,value:g.value,src:g.dom};this.updateDataDebounced(m)}}});return e.push(d),e}get value(){return Array.from(this.fields).reduce((e,[t,n])=>(e[t]=n.value,e),{})}processUiState(){ou(this.fields),this.dom.classList.remove("display-none")}updateDataDebounced=$n(e=>{J.formeoUpdated(e),ce.setAddress(e.dataPath,e.value)});onChangeCondition=({key:e,target:t})=>{const n={changedProperty:e,dataPath:this.address,value:this.value,src:t};ou(this.fields),this.updateDataDebounced(n)}}const Xg=new Map([["attrs",({itemKey:l})=>l],["options",({itemKey:l,key:e})=>`${l}.${e}`]]),Yh=(l,e)=>{if(e.controlId==="select"){const t=e.editPanels.get("options"),[n,p]=l?Tn:rp,d=t.data.map(({[n]:g,...m})=>({[p]:g,...m}));t.setData(d)}},Qg=new Map([["attrs-multiple",l=>({change:({target:e})=>{l.field.controlId==="select"&&Yh(e.checked,l.field)}})]]);class dn{constructor({key:e,index:t,field:n,panel:p,data:d}){this.field=n,this.itemKey=e,this.itemIndex=t,this.panel=p,this.panelName=p.name,this.isDisabled=n.isDisabledProp(e,this.panelName),this.isHidden=this.isDisabled&&n.config.panels[this.panelName].hideDisabled,this.isLocked=n.isLockedProp(e,this.panelName),this.address=`${n.indexName}.${n.id}.${e}`,this.itemSlug=sc(e),this.conditionTypeWrap=new Map,d!==void 0&&this.field.get(this.itemKey)===void 0&&this.field.set(this.itemKey,d);const g=[`field-${this.itemSlug}`,"prop-wrap"];this.isHidden&&g.push("hidden-property"),this.dom=U.create({tag:"li",className:g,children:{className:"component-prop",children:[this.itemInputs(),this.itemControls]}})}get itemValues(){const e=this.field.get(this.itemKey);return e?.constructor===Object?kn(Object.entries(e),Tn,"0"):[[this.itemKey,e]]}findOrCreateConditionTypeWrap(e){let t=this.conditionTypeWrap.get(e);return t||(t=U.create({className:`type-conditions-wrap ${e}-conditions-wrap`}),this.conditionTypeWrap.set(e,t),t)}itemInputs(){const e=U.create({className:`${this.panelName}-prop-inputs prop-inputs f-input-group`,children:this.itemValues.map(([t,n])=>this.panelName==="conditions"?this.generateConditionFields(t,n):this.itemInput(t,n))});return this.inputs&&this.inputs.replaceWith(e),this.inputs=e,e}addConditionType=(e,t)=>{const n=this.findOrCreateConditionTypeWrap(e);let p=t;if(!p){const[g]=Ys()[e],m=n.children.length;e===vh&&(g.logical="||"),p={conditionValues:g,conditionCount:m,index:m}}const d=new Yg({conditionType:e,...p},this);return n.appendChild(d.dom),d};removeConditionType=(e,t)=>{const n=this.conditionTypeWrap.get(e),p=n.children[t];p.destroy(),n.removeChild(p.dom)};generateConditionFields=(e,t)=>(this.conditions=new Map,t.forEach((n,p)=>{const d=this.addConditionType(e,{index:p,conditionCount:t.length,conditionValues:n});this.conditions.set(p,d)}),this.findOrCreateConditionTypeWrap(e));get itemControls(){if(this.isLocked)return{className:`${this.panelName}-prop-controls prop-controls`,content:[]};const e={tag:"button",attrs:{type:"button",className:"prop-remove prop-control"},action:{click:()=>{$e.slideUp(this.dom,qe,n=>{this.field.remove(this.itemKey),n.remove(),this.panel.updateProps()})},mouseover:n=>{this.dom.classList.add("to-remove")},mouseout:n=>{this.dom.classList.remove("to-remove")}},content:U.icon("remove")};return{className:`${this.panelName}-prop-controls prop-controls`,content:[e]}}itemInput(e,t){const n=U.childType(t)||"string",p=Xg.get(this.panelName)?.({itemKey:this.itemKey,key:e})||this.itemKey,d=p.split(".").filter(Number.isNaN).join(".")||e,g=xt[n]({key:e,value:t}),m=`${this.field.shortId}-${sc(p).replace(/-\d+-(selected)/g,"-$1")}`,c={label:this.panelName!=="options"&&(Gh(d)||at(d)),labelAfter:!1},f={name:g.attrs.type==="checkbox"?`${m}[]`:m};f.disabled=this.isDisabled,f.locked=this.isLocked;const r=Qg.get(this.itemSlug)?.(this),o=$p(Hg[n](p,this.field),r||{}),s=je(xt[n]({key:e,value:t}),{action:o,attrs:f,config:c});return Tn.includes(e)?{className:"f-addon",children:s}:s}}const Zg={multiple:(l,e)=>{Yh(!!l,e)}};class Jg{constructor(e,t,n){this.type=U.childType(e),this.name=t,this.component=n,this.panelConfig=this.getPanelConfig(this.data)}get data(){const e=this.component.get(this.name);return this.type==="object"?Object.entries(e):e}getPanelConfig(e){return this.props=this.createProps(e),this.editButtons=this.createEditButtons(),{config:{label:Q.get(`panel.label.${this.name}`)},attrs:{className:`${rh} ${this.name}-panel`},children:[this.props,this.editButtons]}}createProps(e=this.data){this.editPanelItems=Array.from(e).map((n,p)=>{const d=this.type==="array",g=d?`[${p}]`:`.${n[0]}`,m=d?n:{[n[0]]:n[1]};return new dn({key:`${this.name}${g}`,data:m,field:this.component,index:p,panel:this})});const t={tag:"ul",attrs:{className:["edit-group",`${this.component.name}-edit-group`,`${this.component.name}-edit-${this.name}`]},editGroup:this.name,isSortable:this.name==="options",content:this.editPanelItems};return U.create(t)}updateProps(){const e=this.createProps();this.props.replaceWith(e),this.props=e}createEditButtons(){const e=this.name,t=Q.get(`panelEditButtons.${e}`),n={attrs:this.addAttribute,options:this.addOption,conditions:this.addCondition},p=[];if(e==="conditions"){Q.current&&!Q.current.clearAll&&Q.put("clearAll","Clear All");const m={...U.btnTemplate({content:[U.icon("bin"),Q.get("clearAll")],title:Q.get("clearAll")}),className:`clear-all-${e}`,action:{click:()=>{this.clearAllItems()}}};p.push(m)}const d={...U.btnTemplate({content:t,title:t}),className:`add-${e}`,action:{click:m=>{const c={btnCoords:U.coords(m.target),addAction:n[e]};e==="attrs"&&(c.isDisabled=this.component.isDisabledProp,c.isLocked=this.component.isLockedProp,c.message={attr:Q.get(`action.add.${e}.attr`),value:Q.get(`action.add.${e}.value`)});const f=at(e),r=new window.CustomEvent(`onAdd${f}`,{detail:c});Te.add[e](c),document.dispatchEvent(r)}}};return p.push(d),{className:"panel-action-buttons",content:p}}addAttribute=(e,t)=>{let n=t;const p=Wh(e),d=`attrs.${p}`;Q.current[d]||Q.put(d,Bh(e)),typeof n=="string"&&["true","false"].includes(n)&&(n=JSON.parse(n)),this.component.set(`attrs.${e}`,n),Zg[p]?.(n,this.component);const g=this.props.querySelector(`.${this.component.name}-attrs-${p}`),m=new dn({key:d,data:{[p]:n},field:this.component,panel:this});g?g.replaceWith(m.dom):this.props.appendChild(m.dom),this.component.resizePanelWrap()};addOption=()=>{const e=this.component.data.config.controlId,t=this.component.get("options"),n=e==="select"?"option":e,p=Q.get("newOptionLabel",{type:n})||"New Option",d=`${this.name}[${this.data.length}]`,g=t[t.length-1],c={...t.length?g:{},label:p};e!=="button"&&(c.value=bh(p));const f=new dn({key:d,data:c,field:this.component,index:this.props.children.length,panel:this});this.editPanelItems.push(f),this.props.appendChild(f.dom),this.component.debouncedUpdatePreview(),this.component.resizePanelWrap()};addCondition=e=>{const n=`conditions[${this.component.get("conditions").length}]`,p=new dn({key:n,data:e.template,field:this.component,panel:this});this.props.appendChild(p.dom),this.component.set(n,e.template),this.component.resizePanelWrap()};clearAllItems=()=>{const e=this.type==="array"?[]:{},t={type:this.name,removeAction:()=>{this.component.set(this.name,e),this.updateProps()}};Te.remove[this.name](t);const n=at(this.name),p=new window.CustomEvent(`onRemove${n}`,{detail:t});document.dispatchEvent(p)};setData(e){this.data=e,this.component.set(this.name,e),this.updateProps()}}const au=Object.freeze({type:"field",displayType:"slider"}),fn=l=>({transform:`translateX(${l?`${l}px`:0})`});class Xh{constructor(e){this.opts=je(au,e),this.panelDisplay=this.opts.displayType,this.activePanelIndex=0,this.panelNav=this.createPanelNav();const t=this.createPanelsWrap();this.nav=this.navActions(),this.nav.groupChange(this.activePanelIndex);const n=new window.ResizeObserver(([{contentRect:{width:d}}])=>{this.currentWidth!==d&&(this.toggleTabbedLayout(),this.currentWidth=d,this.nav.setTranslateX(this.activePanelIndex,!1))}),p=window.setTimeout(()=>{n.observe(t),window.clearTimeout(p)},zs)}getPanelDisplay(){const e=this.panelsWrap,n=Number.parseInt(U.getStyle(e,"width"),10)>390?"tabbed":"slider",p=this.opts.displayType==="auto";return this.panelDisplay=p?n:this.opts.displayType||au.displayType,this.panelDisplay}toggleTabbedLayout=()=>{this.getPanelDisplay();const e=this.isTabbed;return this.panelsWrap.parentElement?.classList.toggle("tabbed-panels",e),e&&this.panelNav.removeAttribute("style"),e};resizePanels=()=>{this.toggleTabbedLayout()};createPanelsWrap(){const e=U.create({className:"panels",content:this.opts.panels.map(({config:t,...n})=>n)});return this.opts.type==="field"&&this.sortableProperties(e),this.panelsWrap=e,this.panels=e.children,this.currentPanel=this.panels[this.activePanelIndex],e}sortableProperties(e){const t=e.getElementsByClassName("field-edit-group");return Ne.forEach(t,n=>{n.fieldId=this.opts.id,n.isSortable&&te.create(n,{animation:150,group:{name:`edit-${n.editGroup}`,pull:!0,put:["properties"]},sort:!0,handle:".prop-order",onSort:p=>{this.propertySave(p.to),this.resizePanels()}})})}createPanelNavLabels(){const e=this.opts.panels.map(p=>({tag:"h5",action:{click:d=>{const g=lt(d.target);this.nav.setTranslateX(g,!1),this.nav.groupChange(g)}},content:p.config.label})),t={className:"panel-labels",content:{content:e}},[n]=e;return n.className="active-tab",U.create(t)}createPanelNav(){this.labels=this.createPanelNavLabels();const e={tag:"button",attrs:{className:"next-group",title:Q.get("controlGroups.nextGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:n=>this.nav.nextGroup(n)},content:U.icon("triangle-right")},t={tag:"button",attrs:{className:"prev-group",title:Q.get("controlGroups.prevGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:n=>this.nav.prevGroup(n)},content:U.icon("triangle-left")};return U.create({tag:"nav",attrs:{className:"panel-nav"},content:[t,this.labels,e]})}get isTabbed(){return this.panelDisplay==="tabbed"}navActions(){const e={},t=this.currentPanel.parentElement,n=this.labels.firstChild,p=n.children,d=this.currentPanel.parentElement.childNodes;this.activePanelIndex=lt(this.currentPanel);let g={nav:0,panel:0},m={...g};e.groupChange=r=>(this.activePanelIndex=r,this.currentPanel=d[r],U.removeClasses(d,"active-panel"),U.removeClasses(p,"active-tab"),this.currentPanel.classList.add("active-panel"),p[r].classList.add("active-tab"),this.currentPanel);const c=r=>({nav:-n.offsetWidth*r,panel:-t.offsetWidth*r}),f=({offset:r,reset:o,duration:s=mt,animate:a=!this.isTabbed})=>{const i=[fn(m.panel),fn(r.panel)],u=[fn(m.nav),fn(this.isTabbed?0:r.nav)];if(o){const[T]=i,[$]=u;i.push(T),u.push($)}const h={easing:"ease-in-out",duration:a?s:0,fill:"forwards"},y=t.animate(i,h);n.animate(u,h);const b=()=>{y.removeEventListener("finish",b),o||(m=r)};y.addEventListener("finish",b)};return e.setTranslateX=(r=this.activePanelIndex,o=!0)=>{g=c(r),f({offset:g,animate:o})},e.refresh=(r=this.activePanelIndex)=>{this.activePanelIndex!==r&&e.groupChange(r),e.setTranslateX(this.activePanelIndex,!1),this.resizePanels()},e.nextGroup=()=>{const r=this.activePanelIndex+1;if(r!==d.length){const o=d[r];g={nav:-n.offsetWidth*r,panel:-o.offsetLeft},f({offset:g}),e.groupChange(r)}else g={nav:m.nav-8,panel:m.panel-8},f({offset:g,reset:!0});return this.currentPanel},e.prevGroup=()=>{if(this.activePanelIndex!==0){const r=this.activePanelIndex-1,o=d[r];g={nav:-n.offsetWidth*r,panel:-o.offsetLeft},f({offset:g}),e.groupChange(r)}else g={nav:8,panel:8},f({offset:g,reset:!0})},e}}let Uo=null;const Go=gn(pn);class Yn extends Qs{constructor(e,t={}){const n={...t,id:t.id||We()};super(e,n),this.id=n.id,this.shortId=this.id.slice(0,this.id.indexOf("-")),this.name=e,this.indexName=`${e}s`,this.config=ce[`${this.name}s`].config,je(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(([e,t])=>{this.addEventListener(e,t)})}addEventListener(e,t){this.eventListeners.has(e)||this.eventListeners.set(e,[]),this.eventListeners.get(e).push(t)}removeEventListener(e,t){if(!this.eventListeners?.has(e))return;const n=this.eventListeners.get(e),p=n.indexOf(t);p>-1&&n.splice(p,1)}dispatchComponentEvent(e,t={}){const n={component:this,target:this,type:e,timestamp:Date.now(),...t};return this.eventListeners?.has(e)&&this.eventListeners.get(e).forEach(p=>{try{typeof p=="function"&&p(n)}catch(d){console.error(`Error in ${e} event handler for ${this.name} ${this.id}:`,d)}}),n}set(e,t){const n=this.get(e),p=super.set(e,t);return n!==t&&this.dom&&this.dispatchComponentEvent("onUpdate",{path:e,oldValue:n,newValue:t}),p}get js(){return this.data}get json(){return this.data}remove=e=>{if(e){const g=vt(e),m=g.pop(),c=this.get(g);return Array.isArray(c)?Ph(m)?c.splice(Number(m),1):this.set(g,c.filter(f=>f!==m)):delete c[m],c}if(this.name==="stage")return null;const t=this.parent,n=this.children;this.dispatchComponentEvent("onRemove",{path:e,parent:t,children:[...n]}),qn(n,g=>g.remove()),this.dom.parentElement.removeChild(this.dom),Lf(ce.getAddress(`${t.name}s.${t.id}.children`),this.id),t.children.length||t.emptyClass(),t.name==="row"&&t.autoColumnWidths();const d={row:Vs,column:Ks,field:qs}[this.name];return d&&J.formeoUpdated({componentId:this.id,componentType:this.name,parent:t},d),ce[`${this.name}s`].delete(this.id)};empty(){const e=this.children.map(t=>(t.remove(),t));return this.dom.classList.add("empty"),e}emptyClass=()=>this.dom.classList.toggle("empty",!this.children.length);getActionButtons(){const e=[`hovering-${this.name}`,"hovering"];return{className:[`${this.name}-actions`,"group-actions"],action:{mouseenter:()=>{ce.stages.active.dom.classList.add(`active-hover-${this.name}`),this.dom.classList.add(...e)},mouseleave:({target:t})=>{this.dom.classList.remove(...e),ce.stages.active.dom.classList.remove(`active-hover-${this.name}`),t.removeAttribute("style")}},children:[{...U.btnTemplate({content:U.icon(`handle-${this.name}`)}),className:["component-handle",`${this.name}-handle`]},{className:["action-btn-wrap",`${this.name}-action-btn-wrap`],children:this.buttons}]}}getComponentTag=()=>U.create({tag:"span",className:["component-tag",`${this.name}-tag`],children:[(this.isColumn||this.isField)&&U.icon("component-corner",{className:"bottom-left"}),U.icon(`handle-${this.name}`),at(this.name),(this.isColumn||this.isRow)&&U.icon("component-corner",{className:"bottom-right"})].filter(Boolean)});toggleEdit(e=!this.isEditing){this.isEditing=e;const t=this.dom,n="editing",p=`${n}-${this.name}`,d=this.dom.querySelector(`.${this.name}-edit`);$e.slideToggle(d,qe,e),this.name==="field"&&($e.slideToggle(this.preview,qe,!e),t.parentElement.classList.toggle(`column-${p}`,e)),t.classList.toggle(n,e),t.classList.toggle(p,e)}get buttons(){if(this.actionButtons)return this.actionButtons;const e={handle:(g=`handle-${this.name}`)=>({...U.btnTemplate({content:U.icon(g)}),className:["component-handle"]}),move:(g="move")=>({...U.btnTemplate({content:U.icon(g)}),className:["item-move"],meta:{id:"move"}}),edit:(g="edit")=>({...U.btnTemplate({content:U.icon(g)}),className:["edit-toggle"],meta:{id:"edit"},action:{click:()=>{this.toggleEdit()}}}),remove:(g="remove")=>({...U.btnTemplate({content:U.icon(g)}),className:["item-remove"],meta:{id:"remove"},action:{click:()=>{$e.slideUp(this.dom,qe,()=>{this.name==="column"?(this.parent.autoColumnWidths(),this.remove()):this.remove()})}}}),clone:(g="copy")=>({...U.btnTemplate({content:U.icon(g)}),className:["item-clone"],meta:{id:"clone"},action:{click:()=>{this.clone(this.parent),this.name==="column"&&this.parent.autoColumnWidths()}}})},{buttons:t,disabled:n}=this.config.actionButtons,d=t.filter(g=>!n.includes(g)).map(g=>e[g]?.()||g);return this.actionButtons=d,this.actionButtons}get index(){return lt(this.dom)}removeClasses=e=>{const t={string:()=>this.dom.classList.remove(e),array:()=>e.map(n=>this.dom.classList.remove(n))};return t.object=t.string,t[U.childType(e)](this.dom)};get parentType(){return Kf.get(this.name)}get parent(){const e=this.parentType;if(!this.dom||!e)return null;const t=this.dom.closest(`.${Hs[e]}`);return t&&U.asComponent(t)}get children(){if(!this.dom)return[];const e=this.domChildren,t=nc.get(this.name);return ta(e,n=>ce.getAddress(`${t}s.${n.id}`)).filter(Boolean)}loadChildren=(e=this.data.children)=>e.map(t=>this.addChild({id:t}));get domChildren(){const e=this.dom.querySelector(".children");return e?e.children:[]}addChild(e={},t=this.domChildren.length){let n=e;typeof e!="object"&&(n={id:n});const p=this.dom.querySelector(".children"),{id:d=We()}=n,g=nc.get(this.name);if(!g)return null;const m=`${g}s`,c=ce.getAddress(`${m}.${d}`)||ce[m].add(d,n);t>=p.children.length?p.appendChild(c.dom):p.children[t].before(c.dom),this.dispatchComponentEvent("onAddChild",{parent:this,target:c,child:c,index:t}),c.dispatchComponentEvent("onAdd",{parent:this,target:c,index:t,addedVia:"addChild"}),this.config.events?.onAddChild?.({parent:this,child:c});const f=c.get("children");return f?.length&&c.loadChildren(f),this.removeClasses("empty"),this.saveChildOrder(),c}saveChildOrder=()=>{if(this.render)return;const e=this.children.map(({id:t})=>t);return this.set("children",e),e};onAdd({from:e,to:t,item:n,newIndex:p}){e.classList.contains(ot)||(e=e.parentElement);const d=Le(e),g=Le(t.parentElement),m=()=>{this.saveChildOrder(),this.removeClasses("empty")},c=new Map([[-2,()=>{const o=this.addChild({},p).addChild();return o.addChild.bind(o)}],[-1,()=>{const o=this.addChild({},p);return o.addChild.bind(o)}],[0,()=>this.addChild.bind(this)],[1,o=>{const s=lt(this.dom);return()=>this.parent.addChild(o,s+1)}],[2,o=>()=>this.parent.parent.addChild(o)]]),r={controls:async()=>{if(!Uo){const{default:b}=await $t(async()=>{const{default:T}=await Promise.resolve().then(()=>Sm);return{default:T}},void 0);Uo=b}const{controlData:{meta:{id:o},...s}}=Uo.get(n.id);Gn(s,"config.controlId",o);const a=o.startsWith("layout-")?o.replace(/^layout-/,""):"field",u=Ie({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}.${a}`),h=c.get(u)();return U.remove(n),h(s,p)},row:()=>{const o={stage:-1,row:0,column:1};return(c.get(o[g])||bs)()?.({id:n.id},p)},column:()=>{const o={stage:-2,row:-1};return(c.get(o[g])||bs)()?.(n.id)}}[d]?.(n,p);return this.dispatchComponentEvent("onAdd",{from:e,to:t,item:n,newIndex:p,fromType:d,toType:g,addedComponent:r,addedVia:"dragDrop"}),m(),r}onSort=()=>this.saveChildOrder();onRemove({from:{parentElement:e}}){return e.classList.contains(Ze)&&e.classList.remove("column-editing-field"),this.name!=="stage"&&!this.children.length?this.remove():(this.emptyClass(),this.saveChildOrder())}onEnd=({to:{parentElement:e},from:{parentElement:t}})=>{e?.classList.remove(`hovering-${Le(e)}`),t?.classList.remove(`hovering-${Le(t)}`)};onRender(){this.dispatchComponentEvent("onRender",{dom:this.dom});const{events:e}=this.config;if(!e)return null;e.onRender&&U.onRender(this.dom,e.onRender)}set config(e){const t=Ie(e,"all"),n=Ie(this.data,"config.controlId"),p=n&&Ie(e,n),d=Ie(e,this.id),g=[t,p,d].reduce((m,c)=>c?je(m,c):m,this.configVal);this.configVal=g}get config(){return this.configVal}runConditions=()=>{const e=this.get("conditions");return e?.length?e.map(n=>{const p=this.processConditions(n.if),d=this.processResults(n.then);return p.map(g=>this.evaluateConditions(g)&&this.execResults(d))}):null};getComponent(e){const[t,n]=e.split("."),p=ce[t];return n===this.id?this:p?.get(n)}value=(e,t)=>{const n=e.split("."),p=this.getComponent(e),d=p&&n.slice(2,n.length).join(".");return[!p,!d,!Go[d]].some(Boolean)?e:t?p.set(Go[d],t):p.get(Go[d])};getResult=e=>({"=":(n,p,d)=>n.set(p,d)})[e];processResults=e=>e.map(({operator:t,target:n,value:p})=>{const d=this.getComponent(n),g=d&&n.split(".").slice(2,n.length).join(".");return{target:d,propertyPath:g,action:this.getResult(t),value:this.value(p)}});execResults=e=>{const t=e.map(n=>this.execResult(n));return Promise.all(t)};execResult=({target:e,action:t,value:n,_propertyPath:p})=>new Promise((d,g)=>{try{return d(t(e,n))}catch(m){return g(m)}});cloneData=()=>{const e={...Xe(this.data),id:We()};return this.name!=="field"&&(e.children=[]),e};clone=(e=this.parent)=>{const t=e.addChild(this.cloneData(),this.index+1);return this.name!=="field"&&this.cloneChildren(t),this.dispatchComponentEvent("onClone",{original:this,clone:t,parent:e}),t};cloneChildren(e){for(const t of this.children)t?.clone(e)}createChildWrap=e=>U.create({tag:"ul",attrs:{className:"children"},children:e});get isRow(){return this.name===Br.row}get isColumn(){return this.name===Br.column}get isField(){return this.name===Br.field}isDisabledProp=(e,t="attrs")=>{const n=this.config.panels[t];return n?n.disabled.concat(this.get("config.disabled")).includes(e):!1};isLockedProp=(e,t="attrs")=>{const n=this.config.panels[t];return n?n.locked.concat(this.get("config.locked")).includes(e):!1};get editWindow(){const e={className:["component-edit",`${this.name}-edit`,"slide-toggle","formeo-panels-wrap"]},t=this.editPanels.size;return t&&(e.className.push(`panel-count-${t}`),e.content=[this.panels.panelNav,this.panels.panelsWrap],this.panelNav=this.panels.nav,this.resizePanelWrap=this.panels.nav.refresh),e.action={onRender:()=>{if(t===0){const n=this.dom.querySelector(".edit-toggle"),p=this.dom.querySelector(`.${this.name}-actions`),d=p.getElementsByTagName("button");p.style.maxWidth=`${d.length*d[0].clientWidth}px`,U.remove(n)}else this.resizePanelWrap()}},U.create(e)}updateEditPanels=()=>{if(!this.config)return null;const e=["object","array"],t=gt([...this.config.panels.order,...Object.keys(this.data)]),n=["children","config","meta","action","events",...this.config.panels.disabled],p=t.filter(g=>!n.includes(g));for(const g of p){const m=this.get(g),c=U.childType(m);if(e.includes(c)){const f=new Jg(m,g,this);this.editPanels.set(f.name,f)}}const d={panels:Array.from(this.editPanels.values()).map(({panelConfig:g})=>g),id:this.id,displayType:"auto"};this.panels=new Xh(d),this.dom&&(this.dom.querySelector(".panel-nav").replaceWith(this.panels.panelNav),this.dom.querySelector(".panels").replaceWith(this.panels.panelsWrap))}}class em{constructor(){this.onMove=this.onMove.bind(this),this.onStop=this.onStop.bind(this),this.cleanup=this.cleanup.bind(this)}getRowWidth(e){const t=e.querySelector(".children");if(!t)return 0;const n=t.children.length,p=U.getStyle(t,"gap")||"0px",d=parseFloat(p,10)||0;return this.totalGapWidth=d*(n-1),t.offsetWidth-this.totalGapWidth}validateResizeTarget(e,t){return e&&t&&e.offsetWidth&&t.offsetWidth}onStart(e){if(e.preventDefault(),this.resized=!1,e.button!==0)return;const t=e.target.parentElement,n=t.nextSibling||t.previousSibling,p=t.closest(`.${Qe}`);if(!this.validateResizeTarget(t,n)){console.warn("Invalid resize targets"),this.cleanup();return}if(this.startX=e.type==="touchstart"?e.touches[0].clientX:e.clientX,p.classList.add(Wr),this.columnPreset=p.querySelector(`.${oh}`),this.originalColumnClass=t.className,this.originalSiblingClass=n.className,t.className=t.className.replace(Ss,""),n.className=n.className.replace(Ss,""),this.colStartWidth=t.offsetWidth,this.sibStartWidth=n.offsetWidth,this.rowWidth=this.getRowWidth(p),this.rowWidth<=0){console.warn("Invalid row width calculated"),this.cleanup();return}this.column=t,this.sibling=n,this.row=p;try{window.addEventListener("pointermove",this.onMove,!1),window.addEventListener("pointerup",this.onStop,!1)}catch(d){console.error("Failed to initialize resize listeners:",d),this.cleanup()}}calculateNewWidths(e){const t=this.colStartWidth+e-this.startX,n=this.sibStartWidth-e+this.startX,p=parseFloat(Pr(t,this.rowWidth)),d=parseFloat(Pr(n,this.rowWidth));return p<10||d<10?null:{colWidth:ys(p.toFixed(1)),siblingColWidth:ys(d.toFixed(1))}}onMove(e){e.preventDefault();const{column:t,sibling:n}=this,p=e.type==="touchmove"?e.touches[0].clientX:e.clientX,d=this.calculateNewWidths(p);if(!d)return;const{colWidth:g,siblingColWidth:m}=d;t.dataset.colWidth=g,n.dataset.colWidth=m,t.style.width=g,n.style.width=m,this.resized=!0}onStop(){const{column:e,sibling:t}=this;window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop),this.resized&&(this.setCustomWidthValue(),ce.setAddress(`columns.${e.id}.config.width`,e.dataset.colWidth),ce.setAddress(`columns.${t.id}.config.width`,t.dataset.colWidth),this.row.classList.remove(Wr),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(Wr),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const e=this.columnPreset;let t=e.querySelector(`.${Cs}`);const n=this.row.querySelector(".children").children,p=ta(n,m=>Pr(m.clientWidth,this.rowWidth).toFixed(1)),d=p.join(","),g=p.join(" | ");return t||(t=U.create({tag:"option",attrs:{className:Cs,value:d,selected:!0},content:g}),e.append(t)),t.value=d,t.textContent=g,d}}const tm=()=>Object.freeze({config:{width:"100%"},children:[],className:[Ze]}),lu={resizeHandle:l=>({className:"resize-x-handle",action:{pointerdown:l.onStart.bind(l)},content:[U.icon("triangle-down"),U.icon("triangle-up")]}),editWindow:()=>({className:"column-edit group-config"})};class nm extends Yn{constructor(e){super("column",{...tm(),...e});const t=this.createChildWrap();this.dom=U.create({tag:"li",className:[Ze,"empty"],dataset:{hoverTag:Q.get("column")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),lu.editWindow(),lu.resizeHandle(new em),t]}),this.processConfig(),J.columnResized=new window.CustomEvent("columnResized",{detail:{column:this.dom,instance:this}}),te.create(t,{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:n=>{n.from!==n.to&&n.from.classList.remove("hovering-column")},draggable:`.${Dt}`,handle:".item-move"})}processConfig(){const e=Ne.get(this.data,"config.width");e&&this.setDomWidth(e)}refreshFieldPanels=()=>{for(const e of this.children)e.panels.nav.refresh()};setDomWidth=e=>{this.dom.dataset.colWidth=e,this.dom.style.width=e};setWidth=e=>(this.setDomWidth(e),this.set("config.width",e))}const im={actionButtons:{buttons:["clone","move","remove"],disabled:[]}};let rm=class extends Vn{constructor(e){super("columns",e),this.config={all:im}}Component(e){return new nm(e)}};const Qh=new rm,om=()=>Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[Qe]});class sm extends Yn{constructor(e){super("row",{...om(),...e});const t=this.createChildWrap();this.dom=U.create({tag:"li",className:[Qe,"empty"],dataset:{hoverTag:Q.get("row"),editingHoverTag:Q.get("editing.row")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),this.editWindow,t]}),te.create(t,{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:`.${Ze}`,handle:".item-move"})}get editWindow(){const e={tag:"input",id:`${this.id}-fieldset`,attrs:{type:"checkbox",checked:this.get("config.fieldset"),ariaLabel:Q.get("row.settings.fieldsetWrap.aria")},action:{click:({target:{checked:s}})=>{this.set("config.fieldset",!!s)}},config:{label:Q.get("row.settings.fieldsetWrap")}},t={tag:"input",id:`${this.id}-inputGroup`,attrs:{type:"checkbox",checked:this.get("config.inputGroup"),ariaLabel:Q.get("row.settings.inputGroup.aria")},action:{click:({target:{checked:s}})=>this.set("config.inputGroup",s)},config:{label:Q.get("row.makeInputGroup"),description:Q.get("row.makeInputGroupDesc")}},n={tag:"span",content:" ⓘ",dataset:{tooltip:"Row title will be used as the legend for the fieldset"}},d={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",n]}},action:{input:({target:{value:s}})=>this.set("config.legend",s)},className:""}},g=U.formGroup([e,d]),m={tag:"label",content:Q.get("defineColumnWidths"),className:"col-sm-4 form-control-label"};this.columnPresetControl=U.create(this.columnPresetControlConfig);const c={className:"col-sm-8",content:this.columnPresetControl,action:{onRender:()=>{this.updateColumnPreset()}}},f=U.formGroup([m,c],"row"),r=[t,"hr",g,"hr",f];return U.create({className:`${this.name}-edit group-config`,action:{onRender:s=>{const a=r.map(i=>U.create(i));s.append(...a)}}})}onAdd(...e){super.onAdd(...e),this.autoColumnWidths()}onRemove(...e){super.onRemove(...e),this.autoColumnWidths()}autoColumnWidths=()=>{const e=this.children;if(!e.length)return;const t=Number.parseFloat((100/e.length).toFixed(1))/1;for(const n of e){n.removeClasses(Ss);const p=n.dom,d=ys(t);n.set("config.width",d),p.style.width=d,p.dataset.colWidth=d;const g=setTimeout(()=>{clearTimeout(g),n.refreshFieldPanels()},mt);document.dispatchEvent(J.columnResized)}this.updateColumnPreset()};updateColumnPreset=()=>{this.columnPresetControl.innerHTML="";const e=this.getColumnPresetOptions.map(({label:t,...n})=>U.create({tag:"option",content:t,attrs:n}));this.columnPresetControl.append(...e)};setColumnWidths=e=>{typeof e=="string"&&(e=e.split(",")),this.children.forEach((t,n)=>{t.setWidth(`${e[n]}%`),t.refreshFieldPanels()})};get getColumnPresetOptions(){const e=this.children,n=Yf.get(e.length-1)||[],p=e.map(d=>{const g=d.get("config.width")||"";return Number(g.replace("%","")).toFixed(1)}).join(",");if(n.length){const d=n.slice();return!d.find(m=>m.value===p)&&d.push({value:p,label:p.replace(/,/g," | "),className:Cs}),d.map(m=>{const c={...m};return c.selected=m.value===p,c})}return[]}get columnPresetControlConfig(){return{tag:"select",attrs:{ariaLabel:Q.get("defineColumnLayout"),className:oh},action:{change:({target:t})=>{const{value:n}=t;this.setColumnWidths(n)}},options:this.getColumnPresetOptions}}}const am={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}};let lm=class extends Vn{constructor(e){super("rows",e),this.config={all:am}}Component(e){return new sm(e)}};const ia=new lm,cm=()=>({conditions:[Ys()],children:[]});class um extends Yn{constructor(e){super("stage",{...cm(),...e}),this.updateEditPanels(),this.debouncedUpdateEditPanels=$n(this.updateEditPanels),Q.get("Untitled Form"),Q.get("Untitled Form"),Q.get("Form Title"),Q.get("Form novalidate"),Q.get("Tags");const t=this.createChildWrap();this.dom=U.create({attrs:{className:[Ot,"empty"],id:this.id},children:[this.getComponentTag(),this.getActionButtons(),this.editWindow,t]}),te.create(t,{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:()=>{en.active=this},onSort:this.onSort.bind(this),draggable:`.${Qe}`,handle:".item-move"})}empty(e=!0){return new Promise(t=>{e?(this.dom.classList.add("removing-all-fields"),$e.slideUp(this.dom,qe,()=>{t(super.empty(e)),this.dom.classList.remove("removing-all-fields"),$e.slideDown(this.dom,qe)})):t(super.empty())})}onAdd(...e){const t=super.onAdd(...e);t?.name==="column"&&t.parent.autoColumnWidths()}}const hm=()=>({actionButtons:{buttons:["edit"],disabled:[]},panels:{disabled:[],order:["attrs","options","conditions"]}});let dm=class extends Vn{constructor(e){super("stages",e),this.config={all:hm()}}Component(e){return new um(e)}};const en=new dm,Dn={js:new Set,css:new Set},cu=(l,e,t=ws)=>new Promise(n=>fetch(l).then(p=>{if(!p.ok)return n(t(p));n(e?e(p):p)}).catch(p=>t(p))),Zh=(l,e)=>{l.removeEventListener("load",Zh),e(l.src)},Jh=(l,e)=>{l.removeEventListener("load",Jh),e(l.src)},ed=l=>new Promise((e,t)=>{if(Dn.js.has(l))return e(l);Dn.js.add(l);const n=U.create({tag:"script",attrs:{type:"text/javascript",async:!0,src:l},action:{load:()=>Jh(n,e),error:()=>t(new Error(`${l} failed to load.`))}});document.head.appendChild(n)}),_s=l=>{l=Array.isArray(l)?l:[l];const e=l.map(t=>new Promise((n,p)=>{if(Dn.css.has(t))return n(t);Dn.css.add(t);const d=U.create({tag:"link",attrs:{rel:"stylesheet",href:t},action:{load:()=>Zh(d,n),error:()=>p(new Error(`${(void 0).src} failed to load.`))}});document.head.appendChild(d)}));return Promise.all(e)},fm=l=>{l=Array.isArray(l)?l:[l];const e=l.map(t=>ed(t));return Promise.all(e)},pm=l=>{l=Array.isArray(l)?l:[l];const e=l.map(t=>_s(t));return Promise.all(e)},gm=l=>{let e=document.getElementById(st);return e||(e=U.create({id:st,children:l,attrs:{hidden:!0,style:"display: none;"}}),document.body.insertBefore(e,document.body.childNodes[0])),e},mm=async(l=ih)=>{if(document.getElementById(st))return;const t=async n=>gm(await n.text());return cu(l,t,()=>cu(Of,t))},vm=l=>{const e=Array.isArray(l)?ec.filter(({name:t})=>l.indexOf(t)!==-1):ec;return Promise.all(e.map(({src:t})=>ed(t)))},ym={js:fm,css:pm},td=l=>{const e=Object.entries(l).map(([t,n])=>ym[t](n));return Promise.all(e)},uu=()=>{const l=document.getElementById(st);return window.getComputedStyle(l).visibility==="hidden"},bm=async l=>{if(!uu()&&(await _s(l),!uu()))return await _s(If)};class wm{controlCache=new Set;constructor({events:e={},dependencies:t={},controlAction:n,...p}){this.events=e,this.controlData=p,this.controlAction=n,this.dependencies=t,this.id=p.id||We()}get controlId(){return this.controlData.meta?.id||this.controlData.config?.controlId}get dom(){const{meta:e,config:t}=this.controlData,n=this.i18n(t.label)||t.label,p={tag:"button",attrs:{type:"button"},content:[{tag:"span",className:"control-icon",children:U.icon(e.icon)},{tag:"span",className:"control-label",content:n}],action:{focus:({target:d})=>{const g=d.closest(`.${ot}`);return g&&Lt.panels.nav.refresh(lt(g))},click:({target:d})=>{const g=d.closest(".field-control")?.id;g&&Lt.addElement(g)}}};return U.create({tag:"li",id:this.id,className:["field-control",`${e.group}-control`,`${e.id}-control`],content:p,meta:e,action:this.controlAction})}promise(){return td(this.dependencies)}i18n(e,t){const n=Q.locale,d=this.definition?.i18n?.[n]||{};return(d[e]?.()??d[e])||Q.get(e,t)}}const Cm=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 nd=class{constructor(){this.data=new Map,this.buttonActions={focus:({target:e})=>{const t=e.closest(`.${ot}`);return t&&this.panels.nav.refresh(lt(t))},click:({target:e})=>{this.addElement(e.parentElement.id)}}}async init(e,t=!1){return await this.applyOptions(e),this.buildDOM(t),this}registerControls(e){return this.controls=[],e.map(t=>{const p=typeof t=="function"?new t:new wm(t);return this.add(p),this.controls.push(p.dom),p.promise()})}groupLabel=e=>Q.get(e)||e||"";groupElements(){let e=this.options.groups.slice(),t=this.controls.slice(),n=[];const p=[];return e=kn(e,this.groupOrder,"id"),e=e.filter(d=>Jl(d.id,this.options.disable.groups)),n=e.map(d=>{const g={tag:"ul",attrs:{className:[ot,rh],id:`${d.id}-${ot}`},config:{label:this.groupLabel(d.label)}};if(this.options.elementOrder[d.id]){const m=this.options.elementOrder[d.id],c=gt(m.concat(d.elementOrder));d.elementOrder=c}return t=kn(t,d.elementOrder,"meta.id"),g.content=t.filter(m=>{const{controlData:c}=this.get(m.id),f=c.meta.id||"",r=[Jl(f,this.options.disable.elements),c.meta.group===d.id,!p.includes(f)];let o=!0;return o=r.every(s=>s===!0),o&&p.push(f),o}),g}),n}add(e=Object.create(null)){const t=Xe(e);return this.data.set(t.id,t),t.controlData.meta.id&&this.data.set(t.controlData.meta.id,t.controlData),t}get(e){return Xe(this.data.get(e))}formActions(){if(this.options.disable.formActions===!0)return null;const e={...U.btnTemplate({content:[U.icon("bin"),Q.get("clear")],title:Q.get("clearAll")}),className:["clear-form"],action:{click:p=>{ia.size?(J.confirmClearAll=new window.CustomEvent("confirmClearAll",{detail:{confirmationMessage:Q.get("confirmClearAll"),clearAllAction:()=>{en.clearAll().then(()=>{const d={src:p.target};J.formeoCleared(d)})},btnCoords:U.coords(p.target)}}),document.dispatchEvent(J.confirmClearAll)):window.alert(Q.get("cannotClearFields"))}}},t={...U.btnTemplate({content:[U.icon("floppy-disk"),Q.get("save")],title:Q.get("save")}),className:["save-form"],action:{click:async({target:p})=>{const{default:d}=await $t(async()=>{const{default:c}=await Promise.resolve().then(()=>Lm);return{default:c}},void 0),{formData:g}=d,m={action:()=>{},coords:U.coords(p),message:"",button:p};return Te.click.btn(m),Te.save.form(g)}}};return{className:"form-actions f-btn-group",content:Object.entries({clearBtn:e,saveBtn:t}).reduce((p,[d,g])=>(this.options.disable.formActions.includes(d)||p.push(g),p),[])}}buildDOM(e){const t=this.groupElements(),n=this.formActions(),{displayType:p}=this.options.panels;this.panels=new Xh({panels:t,type:"controls",displayType:p});const d=["control-groups","formeo-panels-wrap",`panel-count-${t.length}`],g=U.create({className:d,content:[this.panels.panelNav,this.panels.panelsWrap]}),m=["formeo-controls"];e&&m.push("formeo-sticky");const c=U.create({className:m,content:[g,n]}),f=c.getElementsByClassName("control-group");this.dom=c,this.groups=f;const[r]=f;this.currentGroup=r,this.actions={filter:o=>{const s=o!=="",a=this.controls;let i=g.querySelector(".filtered-term");if(U.toggleElementsByStr(a,o),s){const u=Q.get("controls.filteringTerm",o);c.classList.add("filtered"),i?i.textContent=u:(i=U.create({tag:"h5",className:"filtered-term",content:u}),g.insertBefore(i,g.firstChild))}else i&&(c.classList.remove("filtered"),i.remove())},addElement:this.addElement,addGroup:o=>console.log(o)};for(let o=f.length-1;o>=0;o--){const s=`formeo-controls-${f[o]}`;this.options.sortable||window.localStorage.removeItem(s),te.create(f[o],{animation:150,forceFallback:!0,fallbackClass:"control-moving",fallbackOnBody:!0,group:{name:"controls",pull:"clone",put:!1},onStart:async({item:a})=>{const{controlData:i}=this.get(a.id);if(this.options.ghostPreview){const{default:u}=await $t(async()=>{const{default:h}=await Promise.resolve().then(()=>Tm);return{default:h}},void 0);a.innerHTML="",a.appendChild(new u(i).preview)}},onEnd:({from:a,item:i,clone:u})=>{a.contains(u)&&a.replaceChild(i,u)},sort:this.options.sortable,store:{get:()=>{const a=window.localStorage.getItem(s);return a?a.split("|"):[]},set:a=>{const i=a.toArray();window.localStorage.setItem(s,i.join("|"))}}})}return c}layoutTypes={row:()=>en.active.addChild(),column:()=>this.layoutTypes.row().addChild(),field:e=>this.layoutTypes.column().addChild(e)};addElement=e=>{const{meta:{group:t,id:n},...p}=Ie(this.get(e),"controlData");return Gn(p,"config.controlId",n),t==="layout"?this.layoutTypes[n.replace("layout-","")]():this.layoutTypes.field(p)};applyOptions=async(e={})=>{const{container:t,elements:n,groupOrder:p,...d}=je(Cm,e);this.container=t,this.groupOrder=gt(p.concat(["common","html","layout"])),this.options=d;const[g,m,c]=await Promise.all([$t(()=>import("./index.min.js"),[]),$t(()=>import("./index.min2.js"),[]),$t(()=>import("./index.min3.js"),[])]),f=[g.default,m.default,c.default].flat();return Promise.all(this.registerControls([...f,...n]))}};const Lt=new nd,Sm=Object.freeze(Object.defineProperty({__proto__:null,Controls:nd,default:Lt},Symbol.toStringTag,{value:"Module"})),Am=()=>({}),$m=new Set(["checkbox","radio"]),Em=new Set(["radio","checkbox","select-one","select-multiple"]);class id extends Yn{constructor(e=Object.create(null)){super("field",{...Am(),...e}),this.debouncedUpdateEditPanels=$n(this.updateEditPanels),this.debouncedUpdatePreview=$n(this.updatePreview),this.label=U.create(this.labelConfig),this.preview=this.fieldPreview(),this.controlId=this.get("config.controlId")||this.get("meta.id");const t=this.getActionButtons(),n=this.actionButtons.some(d=>d.meta?.id==="edit");this.updateEditPanels();const p=U.create({tag:"li",attrs:{className:Dt},id:this.id,children:[this.label,this.getComponentTag(),t,n&&this.editWindow,this.preview].filter(Boolean),panelNav:this.panelNav,dataset:{hoverTag:Q.get("field")}});this.dom=p,this.isEditing=!1}get labelConfig(){if(!!this.get("config.hideLabel"))return null;const t=this.get("config.editorLabel")||this.get("config.label"),n=this.get("attrs.required"),p=this.config.label.disableHTML;return{className:"prev-label",children:[{...(()=>{const c={tag:"label",attrs:{}};return p?(c.tag="input",c.attrs.value=t,c):(c.attrs.contenteditable=!0,c.children=t,c)})(),action:{input:({target:{innerHTML:c,innerText:f}})=>{super.set("config.label",p?f:c)}}},n&&U.requiredMark()]}}setData=(e,t)=>super.set(e,t);set(e,t){const n=this.setData(e,t);return this.debouncedUpdatePreview(),n}updateLabel(){if(!this.label)return null;const e=U.create(this.labelConfig);this.label.replaceWith(e),this.label=e}updatePreview=()=>{this.updateLabel();const e=this.fieldPreview();this.preview.replaceWith(e),this.preview=e};get defaultPreviewActions(){return{change:e=>{const{target:t}=e,{type:n}=t;if(Em.has(n)){const p=this.preview.querySelectorAll(":checked"),d=this.get("options"),g=d?.[0]?.selected!==void 0?"selected":"checked",m=d.reduce((c,f)=>(c[f.value]=f,c[f.value][g]=!1,c),{});for(const c of p)m[c.value][g]=c.value===m[c.value].value;return super.set("options",Object.values(m)),this.debouncedUpdateEditPanels()}},click:e=>{e.target.contentEditable==="true"&&e.preventDefault()},input:({target:e})=>{if(["input","meter","progress","button"].includes(e.tagName.toLowerCase()))return super.set("attrs.value",e.value),this.debouncedUpdateEditPanels();if(e.contentEditable&&!e.type?.startsWith("select-")){const t=e.parentElement.classList;if(t.contains("f-checkbox")||t.contains("f-radio")){const p=e.parentElement,d=lt(p);return this.setData(`options[${d}].label`,e.innerHTML),this.debouncedUpdateEditPanels()}this.setData("content",e.innerHTML||e.value)}}}}fieldPreview(){const{action:e={},...t}=Xe(this.data);t.id=`prev-${this.id}`,t.action=Object.entries(e).reduce((p,[d,g])=>(p[d]=g.bind(this),p),{}),this.data?.config.editableContent&&(t.attrs={...t.attrs,contenteditable:!0});const n={attrs:{className:"field-preview",style:this.isEditing&&"display: none;"},content:U.create(t,!0),action:this.defaultPreviewActions};return U.create(n,!0)}get isCheckable(){return $m.has(this.get("config.controlId"))}}const Tm=Object.freeze(Object.defineProperty({__proto__:null,default:id},Symbol.toStringTag,{value:"Module"})),Mm=()=>({actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}});let _m=class extends Vn{constructor(e){super("fields",e),this.config={all:Mm()}}Component(e){return new id(e)}get=e=>{let t=e&&Ie(this.data,e);if(!t){const n=Lt.get(e);n&&(t=this.add(null,n.controlData))}return t};getData=()=>Object.entries(this.data).reduce((e,[t,n])=>{const{conditions:p,...d}=n?.getData()||n;if(p?.length){let g=!0;if(p.length===1){const[m]=p;g=!!m.if[0].source}g&&(d.conditions=p)}return e[t]=d,e},{});load=(e=Object.create(null))=>{const t=zn(e);this.empty();for(const[n,p]of Object.entries(t)){const{meta:d,...g}=p;d?.id&&Gn(g,"config.controlId",d?.id),this.add(n,g)}return this.data}};const rd=new _m,Cn=en,Sn=ia,Zt=Qh,An=rd,In=Lt,xm=(l,e=!1)=>l?Xe(zn(l)):e&&th.get(lh)||En();class od extends Qs{constructor(){super("components"),this.disableEvents=!0,this.stages=Cn,this.rows=Sn,this.columns=Zt,this.fields=An,this.controls=In}load=(e,t)=>{this.empty();const n=xm(e,t.sessionStorage);this.opts=t,this.set("id",n.id),this.add("stages",Cn.load(n.stages)),this.add("rows",Sn.load(n.rows)),this.add("columns",Zt.load(n.columns)),this.add("fields",An.load(n.fields));for(const p of Object.values(this.get("stages")))p.loadChildren();return this.data};flatList(){const e={};for(const t of Object.keys(this.data.stages))nh(this.data,t,"stages",e);return e}getChildData=({type:e,id:t})=>{const n=this.get(e,t);if(n)return n.getData()};get json(){return window.JSON.stringify({$schema:`https://cdn.jsdelivr.net/npm/formeo@${Ps}/dist/formData_schema.json`,...this.formData})}get formData(){return{id:this.get("id"),stages:en.getData(),rows:ia.getData(),columns:Qh.getData(),fields:rd.getData()}}set config(e){const{stages:t,rows:n,columns:p,fields:d}=e;Cn.config=t,Sn.config=n,Zt.config=p,An.config=d}getIndex(e){return this[e]||this[Wf.get(e)]}setAddress(e,t){if(!Pe(e))return;const[n,p,...d]=Array.isArray(e)?e:vt(e),m=this.getIndex(n).get(p);return m?.set(d,t),m}getAddress(e){if(!Pe(e))return;const[t,n,...p]=Array.isArray(e)?e:vt(e),g=this.getIndex(t).get(n);if(!(p.length&&!g))return p.length?g.get(p):g}}const ce=new od,Lm=Object.freeze(Object.defineProperty({__proto__:null,Columns:Zt,Components:od,Controls:In,Fields:An,Rows:Sn,Stages:Cn,default:ce},Symbol.toStringTag,{value:"Module"})),hu="no-transition",Rm={debug:!1,bubbles:!0,formeoLoaded:l=>{},onAdd:()=>{},onChange:l=>J.opts?.debug&&console.log(l),onUpdate:l=>J.opts?.debug&&console.log(l),onUpdateStage:l=>J.opts?.debug&&console.log(l),onUpdateRow:l=>J.opts?.debug&&console.log(l),onUpdateColumn:l=>J.opts?.debug&&console.log(l),onUpdateField:l=>J.opts?.debug&&console.log(l),onAddRow:l=>J.opts?.debug&&console.log(l),onAddColumn:l=>J.opts?.debug&&console.log(l),onAddField:l=>J.opts?.debug&&console.log(l),onRemoveRow:l=>J.opts?.debug&&console.log(l),onRemoveColumn:l=>J.opts?.debug&&console.log(l),onRemoveField:l=>J.opts?.debug&&console.log(l),onRender:l=>J.opts?.debug&&console.log(l),onSave:l=>{},confirmClearAll:l=>{window.confirm(l.confirmationMessage)&&l.clearAllAction(l)}},He=({src:l,...e},t=Jt)=>{const n=new window.CustomEvent(t,{detail:e,bubbles:J.opts?.debug||J.opts?.bubbles});if(n.data=(l||document).dispatchEvent(n),t===Jt){const p=new window.CustomEvent(Xf,{detail:e,bubbles:J.opts?.debug||J.opts?.bubbles});(l||document).dispatchEvent(p)}return n},J={init:function(l){return this.opts={...Rm,...l},this},formeoSaved:l=>He(l,ch),formeoUpdated:(l,e)=>He(l,e||Jt),formeoCleared:l=>He(l,Qf),formeoOnRender:l=>He(l,ph),formeoConditionUpdated:l=>He(l,Zf),formeoAddedRow:l=>He(l,js),formeoAddedColumn:l=>He(l,Us),formeoAddedField:l=>He(l,Gs),formeoRemovedRow:l=>He(l,Vs),formeoRemovedColumn:l=>He(l,Ks),formeoRemovedField:l=>He(l,qs)},km=kf(()=>{const l={timeStamp:window.performance.now(),type:Jt,detail:ce.formData};J.opts.onUpdate(l),J.opts.onChange!==J.opts.onUpdate&&J.opts.onChange(l)},mt);document.addEventListener(Jt,km);document.addEventListener(uh,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onUpdate(p),J.opts.onUpdateStage(p)});document.addEventListener(hh,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onUpdate(p),J.opts.onUpdateRow(p)});document.addEventListener(dh,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onUpdate(p),J.opts.onUpdateColumn(p)});document.addEventListener(fh,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onUpdate(p),J.opts.onUpdateField(p)});document.addEventListener(js,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onAddRow(p)});document.addEventListener(Us,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onAddColumn(p)});document.addEventListener(Gs,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onAddField(p)});document.addEventListener(Vs,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onRemoveRow(p)});document.addEventListener(Ks,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onRemoveColumn(p)});document.addEventListener(qs,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onRemoveField(p)});document.addEventListener(ph,l=>{const{timeStamp:e,type:t,detail:n}=l;J.opts.onRender({timeStamp:e,type:t,detail:n})});document.addEventListener("confirmClearAll",l=>{l={timeStamp:l.timeStamp,type:l.type,confirmationMessage:l.detail.confirmationMessage,clearAllAction:l.detail.clearAllAction,btnCoords:l.detail.btnCoords},J.opts.confirmClearAll(l)});document.addEventListener(ch,({timeStamp:l,type:e,detail:{formData:t}})=>{const n={timeStamp:l,type:e,formData:t};J.opts.onSave(n)});document.addEventListener("formeoLoaded",l=>{J.opts.formeoLoaded(l.detail.formeo)});let Vo;function Om(){Vo=Vo||window.requestAnimationFrame(()=>{Vo=!1;for(const l of Object.values(Zt.data))l.dom.classList.add(hu),In.dom.classList.add(hu),In.panels.nav.refresh(),l.refreshFieldPanels()})}window.addEventListener("resize",Om);const du={add:{attr:l=>{const e=window.prompt(l.message.attr);if(e&&l.isDisabled(e))return window.alert(Q.get("attributeNotPermitted",e||"")),Te.add.attrs(l);let t;e&&(t=String(window.prompt(l.message.value,"")),l.addAction(e,t))},option:l=>{l.addAction()},condition:l=>{l.addAction(l)}},remove:{attrs:l=>{l.removeAction()},options:l=>{l.removeAction()},conditions:l=>{l.removeAction()}},click:{btn:l=>{l.action()}},save:{form:bs}},Te={init:function(l){const e=Object.keys(du);return this.opts=e.reduce((t,n)=>(t[n]={...du[n],...l[n]},t),l),this},add:{attrs:l=>Te.opts.add.attr(l),options:l=>Te.opts.add.option(l),conditions:l=>(l.template=l.template||Ys(),Te.opts.add.condition(l))},remove:{attrs:l=>Te.opts.remove.attrs(l),options:l=>Te.opts.remove.options(l),conditions:l=>Te.opts.remove.conditions(l)},click:{btn:l=>Te.opts.click.btn(l)},save:{form:l=>(Te.opts.sessionStorage&&th.set(lh,l),J.formeoSaved({formData:l}),Te.opts.save.form(l))}};var Dm={"en-US":"English",dir:"ltr","af-ZA":"Afrikaans (South Africa)","ar-TN":"Arabic (Tunisia)","cs-CZ":"Czech (Czechia)","de-DE":"German (Germany)","es-ES":"European Spanish","fa-IR":"Persian (Iran)","fi-FI":"Finnish (Finland)","fr-FR":"French (France)","hu-HU":"Hungarian (Hungary)","it-IT":"Italian (Italy)","ja-JP":"Japanese (Japan)","nb-NO":"Norwegian Bokmål (Norway)","pl-PL":"Polish (Poland)","pt-BR":"Brazilian Portuguese","pt-PT":"European Portuguese","ro-RO":"Romanian (Romania)","ru-RU":"Russian (Russia)","th-TH":"Thai (Thailand)","tr-TR":"Turkish (Türkiye)","zh-CN":"Chinese (China)","zh-HK":"Chinese (Hong Kong SAR China)","action.add.attrs.attr":"What attribute would you like to add?","action.add.attrs.value":"Default Value",addOption:"Add Option",allFieldsRemoved:"All fields were removed.",allowSelect:"Allow Select",and:"and",attribute:"Attribute",attributeNotPermitted:'Attribute "{attribute}" is not permitted, please choose another.',attributes:"Attributes","attrs.class":"Class","attrs.className":"Class","attrs.dir":"Direction","attrs.id":"Id","attrs.required":"Required","attrs.style":"Style","attrs.title":"Title","attrs.type":"Type","attrs.value":"Value",autocomplete:"Autocomplete",button:"Button",cannotBeEmpty:"This field cannot be empty",cannotClearFields:"There are no fields to clear",checkbox:"Checkbox",checkboxes:"Checkboxes",class:"Class",clear:"Clear",clearAllMessage:"Are you sure you want to clear all fields?",close:"Close",column:"Column","condition.target.placeholder":"target","condition.type.and":"And","condition.type.if":"If","condition.type.or":"Or","condition.type.then":"Then","condition.value.placeholder":"value",confirmClearAll:"Are you sure you want to remove all fields?",content:"Content",control:"Control","controlGroups.nextGroup":"Next Group","controlGroups.prevGroup":"Previous Group","controls.filteringTerm":'Filtering "{term}"',"controls.form.button":"Button","controls.form.checkbox-group":"Checkbox Group","controls.form.input.date":"Date","controls.form.input.email":"Email","controls.form.input.file":"File Upload","controls.form.input.hidden":"Hidden Input","controls.form.input.number":"Number","controls.form.input.text":"Text Input","controls.form.radio-group":"Radio Group","controls.form.select":"Select","controls.form.textarea":"TextArea","controls.groups.form":"Form Fields","controls.groups.html":"HTML Elements","controls.groups.layout":"Layout","controls.html.divider":"Divider","controls.html.header":"Header","controls.html.paragraph":"Paragraph","controls.layout.column":"Column","controls.layout.row":"Row",copy:"Copy To Clipboard",danger:"Danger",defineColumnLayout:"Define a column layout",defineColumnWidths:"Define column widths",description:"Help Text",descriptionField:"Description","editing.row":"Editing Row",editorTitle:"Form Elements",field:"Field","field.property.invalid":"not valid","field.property.isChecked":"is checked","field.property.isNotVisible":"is not visible","field.property.isVisible":"is visible","field.property.label":"label","field.property.valid":"valid","field.property.value":"value",fieldNonEditable:"This field cannot be edited.",fieldRemoveWarning:"Are you sure you want to remove this field?",fileUpload:"File Upload",formUpdated:"Form Updated",getStarted:"Drag a field from the right to get started.",group:"Group",grouped:"Grouped",hidden:"Hidden Input",hide:"Edit",htmlElements:"HTML Elements",if:"If","if.condition.source.placeholder":"source","if.condition.target.placeholder":"target / value",info:"Info","input.date":"Date","input.text":"Text",label:"Label",labelCount:"{label} {count}",labelEmpty:"Field Label cannot be empty","lang.af":"Afrikaans","lang.ar":"Arabic","lang.cs":"Czech","lang.de":"German","lang.en":"English","lang.es":"Spanish","lang.fa":"Persian","lang.fi":"Finnish","lang.fr":"French","lang.hu":"Hungarian","lang.it":"Italian","lang.ja":"Japanese","lang.nb":"Norwegian Bokmål","lang.pl":"Polish","lang.pt":"Portuguese","lang.ro":"Romanian","lang.ru":"Russian","lang.th":"Thai","lang.tr":"Turkish","lang.zh":"Chinese",layout:"Layout",limitRole:"Limit access to one or more of the following roles:",mandatory:"Mandatory",maxlength:"Max Length","meta.group":"Group","meta.icon":"Ico","meta.label":"Label",minOptionMessage:"This field requires a minimum of 2 options",name:"Name",newOptionLabel:"New {type}",no:"No",number:"Number",off:"Off",on:"On","operator.contains":"contains","operator.equals":"equals","operator.notContains":"not contains","operator.notEquals":"not equal","operator.notVisible":"not visible","operator.visible":"visible",option:"Option",optional:"optional",optionEmpty:"Option value required",optionLabel:"Option {count}",options:"Options",or:"or",order:"Order","panel.label.attrs":"Attributes","panel.label.conditions":"Conditions","panel.label.config":"Configuration","panel.label.meta":"Meta","panel.label.options":"Options","panelEditButtons.attrs":"+ Attribute","panelEditButtons.conditions":"+ Condition","panelEditButtons.options":"+ Option",placeholder:"Placeholder","placeholder.className":"space separated classes","placeholder.email":"Enter you email","placeholder.label":"Label","placeholder.password":"Enter your password","placeholder.placeholder":"Placeholder","placeholder.text":"Enter some Text","placeholder.textarea":"Enter a lot of text","placeholder.value":"Value",preview:"Preview",primary:"Primary",remove:"Remove",removeMessage:"Remove Element",removeType:"Remove {type}",required:"Required",reset:"Reset",richText:"Rich Text Editor",roles:"Access",row:"Row","row.makeInputGroup":"Make this row an input group.","row.makeInputGroupDesc":"Input Groups enable users to add sets of inputs at a time.","row.settings.fieldsetWrap":"Wrap row in a &lt;fieldset&gt; tag","row.settings.fieldsetWrap.aria":"Wrap Row in Fieldset",save:"Save",secondary:"Secondary",select:"Select",selectColor:"Select Color",selectionsMessage:"Allow Multiple Selections",selectOptions:"Options",separator:"Separator",settings:"Settings",size:"Size",sizes:"Sizes","sizes.lg":"Large","sizes.m":"Default","sizes.sm":"Small","sizes.xs":"Extra Small",style:"Style",styles:"Styles","styles.btn":"Button Style","styles.btn.danger":"Danger","styles.btn.default":"Default","styles.btn.info":"Info","styles.btn.primary":"Primary","styles.btn.success":"Success","styles.btn.warning":"Warning",subtype:"Type",success:"Success",text:"Text Field",then:"Then","then.condition.target.placeholder":"target",toggle:"Toggle",ungrouped:"Un-Grouped",warning:"Warning",yes:"Yes"};const Im=Dm;Q.addLanguage("en-US",Im);const Nm={get editor(){return{stickyControls:!1,allowEdit:!0,dataType:"json",debug:!1,sessionStorage:!1,editorContainer:null,svgSprite:ih,style:Df,iconFont:null,config:{},events:{},actions:{},controls:{},polyfills:Hh(),i18n:{location:"https://draggable.github.io/formeo/assets/lang/"},onLoad:()=>{}}}};let sd=class{constructor({formData:e,...t},n){const p=je(Nm.editor,t),{actions:d,events:g,debug:m,config:c,editorContainer:f,...r}=p;f&&(this.editorContainer=typeof f=="string"?document.querySelector(f):f),this.opts=r,U.setOptions=r,ce.config=c,this.userFormData=n||e,this.Components=ce,this.dom=U,J.init({debug:m,...g}),Te.init({debug:m,sessionStorage:r.sessionStorage,...d}),this.tooltip=new Pu,document.readyState==="loading"?document.addEventListener("DOMContentLoaded",this.loadResources.bind(this)):this.loadResources()}get formData(){return this.Components.formData}set formData(e={}){this.userFormData=Vt(e),this.load(this.userFormData,this.opts)}loadData(e={}){this.formData=e}get json(){return this.Components.json}clear(){this.userFormData=En(),this.Components.load(this.userFormData,this.opts),this.render()}async loadResources(){document.removeEventListener("DOMContentLoaded",this.loadResources);const e=[];this.opts.polyfills&&vm(this.opts.polyfills),await mm(this.opts.svgSprite),e.push(bm(this.opts.style)),e.push(Q.init({...this.opts.i18n,locale:window.sessionStorage?.getItem(ic)}));const t=await Promise.all(e);return this.opts.allowEdit&&this.init(),t}init(){return Lt.init(this.opts.controls,this.opts.stickyControls).then(e=>{this.controls=e,this.load(this.userFormData,this.opts),this.formId=ce.get("id"),this.i18n={setLang:t=>{window.sessionStorage?.setItem(ic,t),Q.setCurrent(t).then(()=>{this.init()},console.error)}},this.opts.onLoad?.(this)})}load(e=this.userFormData,t=this.opts){this.Components.load(e,t),this.render()}render(){if(!this.controls)return window.requestAnimationFrame(()=>this.render());if(this.stages=Object.values(ce.get("stages")),this.opts.controlOnLeft)for(const n of this.stages)n.dom.style.order=1;const e={attrs:{className:"formeo formeo-editor",id:this.formId},content:[this.stages.map(({dom:n})=>n)]};Q.current.dir&&(e.attrs.dir=Q.current.dir,U.dir=Q.current.dir),this.editor=U.create(e),(this.controls.container||this.editor).appendChild(this.controls.dom),this.editorContainer&&(U.empty(this.editorContainer),this.editorContainer.appendChild(this.editor)),J.formeoLoaded=new window.CustomEvent("formeoLoaded",{detail:{formeo:this}}),document.dispatchEvent(J.formeoLoaded)}};const Ko="f-",fu=l=>typeof l=="string"?document.querySelector(l):l,Fm=({editorContainer:l,renderContainer:e,formData:t,...n})=>{const p={renderContainer:fu(e),editorContainer:fu(l),formData:Vt(t)};return{elements:{},...n,...p}},qo=l=>l.match(ip)?.[0]||l``,pu=l=>{if(!l||l.hasAttribute("hidden")||l.parentElement.hasAttribute("hidden"))return!1;const e=window.getComputedStyle(l);return!(e.display==="none"||e.visibility==="hidden"||e.opacity==="0")},Pm={isChecked:l=>l.checked,isNotChecked:l=>!l.checked,value:l=>l.value,isVisible:l=>pu(l),isNotVisible:l=>!pu(l)},Wm=()=>U.btnTemplate({className:"remove-input-group",children:U.icon("remove"),action:{mouseover:({target:l})=>l.parentElement.classList.add("will-remove"),mouseleave:({target:l})=>l.parentElement.classList.remove("will-remove"),click:({target:l})=>l.parentElement.remove()}}),gu={equals:As,notEquals:(l,e)=>!As(l,e),contains:(l,e)=>l.includes(e),notContains:(l,e)=>!l.includes(e)},Bm=Object.entries(gh).reduce((l,[e,t])=>(l[t]=gu[e],l[e]=gu[e],l),{}),mu={equals:(l,{targetProperty:e,value:t})=>{l[`_${e}`]=l[e],l[e]=t}},Hm=Object.entries(mh).reduce((l,[e,t])=>(l[t]=mu[e],l[e]=mu[e],l),{}),zm={isChecked:l=>{l.checked=!0},isNotChecked:l=>{l.checked=!1},value:(l,{assignment:e,...t})=>{const n=Hm[e]?.(l,t),p=new Event("input",{bubbles:!0});return l.dispatchEvent(p),n},isNotVisible:l=>{l?._required===void 0&&(l._required=l.required),l.parentElement.setAttribute("hidden",!0),l.required=!1},isVisible:l=>{l.parentElement.removeAttribute("hidden"),l.required=l._required}};let ad=class{constructor(e,t){const{renderContainer:n,elements:p,formData:d}=Fm(e);this.container=n,this.form=Vt(t||d),this.dom=U,this.components=Object.create(null),this.elements=p}get formData(){return this.form}set formData(e){this.form=Vt(e)}get userData(){const e=new FormData(this.renderedForm),t={};for(const[n,p]of e.entries())t[n]?Array.isArray(t[n])?t[n].push(p):t[n]=[t[n],p]:t[n]=p;return t}set userData(e={}){const t=this.container.querySelector("form");for(const n of Object.keys(e)){const p=t.elements[n];if(p.length&&p[0].type==="checkbox"){const d=Array.isArray(e[n])?e[n]:[e[n]];for(const g of p)g.checked=d.includes(g.value)}else if(p.length&&p[0].type==="radio")for(const d of p)d.checked=d.value===e[n];else p.type&&(p.value=e[n])}}render(e=this.form){const t=this.getRenderedForm(e),n=this.container.querySelector(".formeo-render");n?n.replaceWith(t):this.container.appendChild(t)}getRenderedForm(e=this.form){this.form=Vt(e);const t=document.getElementsByClassName("formeo-render").length,n={tag:"form",id:this.form.id,className:`formeo-render formeo formeo-rendered-${t}`,children:this.processedData};return this.renderedForm=U.render(n),this.applyConditions(),this.renderedForm}get html(){return(this.renderedForm||this.getRenderedForm()).outerHTML}orderChildren=(e,t)=>t.reduce((n,p)=>(n.push(this.form[e][p]),n),[]);prefixId=e=>Ko+e;processColumn=({id:e,...t})=>({...t,id:this.prefixId(e),children:this.processFields(t.children),style:`width: ${t.config.width||"100%"}`});processRows=e=>this.orderChildren("rows",this.form.stages[e].children).reduce((t,n)=>(n&&t.push(this.processRow(n)),t),[]);cacheComponent=e=>(this.components[qo(e.id)]=e,e);processRow=(e,t="row")=>{const{config:n,id:p}=e,d=[`formeo-${t}-wrap`],g={...e,children:this.processColumns(e.id),id:this.prefixId(p)};this.cacheComponent(g);const c=[{condition:n.legend,result:()=>({tag:n.fieldset?"legend":"h3",children:n.legend})},{condition:!0,result:()=>g},{condition:n.inputGroup,result:()=>this.addButton(p)}].reduce((f,{condition:r,result:o})=>(r&&f.push(o()),f),[]);return n.inputGroup&&d.push(`${Ko}input-group-wrap`),{tag:n.fieldset?"fieldset":"div",className:d,children:c}};cloneComponentData=e=>{const{children:t=[],id:n,...p}=this.components[e];return{...p,id:We(n),children:t?.length&&t.map(({id:d})=>this.cloneComponentData(qo(d)))}};addButton=e=>({tag:"button",attrs:{className:"add-input-group btn pull-right",type:"button"},children:"Add +",action:{click:t=>{const n=t.target.parentElement,p=U.create(this.cloneComponentData(e));n.insertBefore(p,n.lastChild);const d=U.create(Wm());p.appendChild(d)}}});processColumns=e=>this.orderChildren("columns",this.form.rows[e].children).map(t=>this.cacheComponent(this.processColumn(t)));processFields=e=>this.orderChildren("fields",e).map(({id:t,...n})=>{const p=n.config?.controlId||n.meta?.id,{action:d={},dependencies:g={}}=this.elements[p]||{};g&&td(g);const m=je({action:d},n);return this.cacheComponent({...m,id:this.prefixId(t)})});get processedData(){return Object.values(this.form.stages).map(e=>(e.children=this.processRows(e.id),e.className=Ot,this.components[qo(e.id)]=e,e))}handleComponentCondition=(e,t,n)=>{if(e.length){for(const g of e)this.handleComponentCondition(g,t,n);return}const p=jm(e);p&&e.addEventListener(p,g=>{if(this.evaluateCondition(t,g))for(const m of n)this.execResult(m,g)},!1);const d={target:e};if(this.evaluateCondition(t,d))for(const g of n)this.execResult(g,d)};applyConditions=()=>{for(const{conditions:e}of Object.values(this.components))if(e)for(const t of e){const{if:n,then:p}=t;for(const d of n){const{source:g,target:m}=d;if(Pe(g)){const{component:c,options:f}=this.getComponent(g),r=f||c;this.handleComponentCondition(r,d,p)}if(Pe(m)){const{component:c,options:f}=this.getComponent(m),r=f||c;this.handleComponentCondition(r,d,p)}}}};evaluateCondition=({source:e,sourceProperty:t,targetProperty:n,comparison:p,target:d})=>{const g=this.getComponentProperty(e,t);if(typeof g=="boolean")return g;const m=String(Pe(d)?this.getComponentProperty(d,n):d);return Bm[p]?.(g,m)};execResult=({target:e,targetProperty:t,assignment:n,value:p})=>{if(Pe(e)){const{component:d,option:g}=this.getComponent(e),m=g||d;zm[t]?.(m,{targetProperty:t,assignment:n,value:p})}};getComponentProperty=(e,t)=>{const{component:n,option:p}=this.getComponent(e),d=p||n;return Pm[t]?.(d)||d[t]};getComponent=e=>{const t={component:null};if(!Pe(e))return null;const[,n,p,d]=vt(e),g=this.renderedForm.querySelector(`#${Ko}${n}`);if(!g)return t;if(t.component=g,p){const m=g.querySelectorAll("input"),c=m[d];return t.options=m,t.option=c,t}return t};getComponents=e=>{const t=[],n=e.slice(e.indexOf(".")+1);return t.push(...this.renderedForm.querySelectorAll(`[name=f-${n}]`)),t}};const jm=l=>{const e=[["input",n=>["textarea","text"].includes(n.type)],["change",n=>["select"].includes(n.tagName.toLowerCase())||["checkbox","radio"].includes(n.type)]],[t]=e.find(n=>n[1](l))||[!1];return t};window!==void 0&&(window.FormeoEditor=sd,window.FormeoRenderer=ad);const ra=sd,oa=ad,Um={rows:{all:{events:{onAdd:l=>{if(console.log(`You just added a new row with the id "${l.target.id}"`,l.index),l.index===2){const e=l.target.dom.querySelector(".action-btn-wrap"),t=document.createElement("button");t.type="button",t.className="btn btn-sm btn-secondary",t.textContent="Add Column",t.style.border="1px solid #ccc",t.style.width="auto",t.addEventListener("click",()=>{l.target.addChild()}),e.appendChild(t)}}}}},fields:{all:{events:{onRemove:l=>{console.log(`You just removed the field with the id "${l.target.id}"`,l)}}},checkbox:{actionButtons:{},panels:{attrs:{hideDisabled:!0}}}}},Gm={sortable:!1,groupOrder:["common","html"],disable:{},elements:[{tag:"input",config:{label:"Email",disabledAttrs:["type"],lockedAttrs:["required","className"]},meta:{group:"common",id:"email",icon:"@"},attrs:{className:"custom-email",type:"email",required:!0}}],elementOrder:{common:["button","checkbox","date-input","hidden","upload","number","radio","select","text-input","textarea"]}},Vm=".build-form",Km=".render-form",tn={editorContainer:Vm,i18n:{location:"./assets/lang"},actions:{},controls:Gm,config:Um,events:{onSave:console.log,onChange:console.log},sessionStorage:!0,editPanelOrder:["attrs","options"],onLoad:()=>{console.log("demo loaded")}},sa={renderContainer:Km,elements:{tinymce:{action:{onRender:l=>{if(l.id){const e=`#${l.id}`;window.tinymce.remove(e),window.tinymce.init({selector:e})}}}}}};async function qm(l){l.innerHTML=`
11
11
  <div class="angular-demo">
12
12
  <h3>Angular Integration Demo</h3>
13
13
  <p>Demonstrating Formeo integration patterns for Angular applications</p>
@@ -15,7 +15,7 @@ Author: Draggable https://draggable.io
15
15
  <p>Initializing Angular-style Formeo integration demo...</p>
16
16
  </div>
17
17
  </div>
18
- `;try{await zm(),await jm()&&console.log("Highlight.js loaded successfully"),c.innerHTML=`
18
+ `;try{await Ym(),await Xm()&&console.log("Highlight.js loaded successfully"),l.innerHTML=`
19
19
  <div class="angular-demo">
20
20
  <h3>Angular Integration Demo</h3>
21
21
  <div class="demo-description">
@@ -51,17 +51,17 @@ npm install formeo</code></pre>
51
51
 
52
52
  <div class="guide-section">
53
53
  <h4>2. Angular Component Implementation</h4>
54
- <pre><code class="language-typescript">${Xo(Vm)}</code></pre>
54
+ <pre><code class="language-typescript">${Xo(Jm)}</code></pre>
55
55
  </div>
56
56
 
57
57
  <div class="guide-section">
58
58
  <h4>3. Service for Formeo Management (Optional)</h4>
59
- <pre><code class="language-typescript">${Xo(Km)}</code></pre>
59
+ <pre><code class="language-typescript">${Xo(ev)}</code></pre>
60
60
  </div>
61
61
 
62
62
  <div class="guide-section">
63
63
  <h4>4. Module Configuration</h4>
64
- <pre><code class="language-typescript">${Xo(qm)}</code></pre>
64
+ <pre><code class="language-typescript">${Xo(tv)}</code></pre>
65
65
  </div>
66
66
  </div>
67
67
 
@@ -70,7 +70,7 @@ npm install formeo</code></pre>
70
70
  <div id="angular-app-root"></div>
71
71
  </div>
72
72
  </div>
73
- `;const t=await Gm();hu();const n=c.querySelector("#toggle-instructions"),p=c.querySelector("#instructions-section"),d=n.querySelector(".toggle-text"),g=n.querySelector(".toggle-icon");return n&&p&&n.addEventListener("click",()=>{const m=p.style.display==="block";p.style.display=m?"none":"block",d.textContent=m?"Show Implementation Guide":"Hide Implementation Guide",g.textContent=m?"▼":"▲",m||setTimeout(()=>hu(),50)}),{angularApp:t,cleanup:()=>{t?.destroy&&t.destroy();const m=document.getElementById("angular-app-root");m&&(m.innerHTML="")}}}catch(e){return console.error("Failed to load Angular demo:",e),c.innerHTML=`
73
+ `;const t=await Zm();vu();const n=l.querySelector("#toggle-instructions"),p=l.querySelector("#instructions-section"),d=n.querySelector(".toggle-text"),g=n.querySelector(".toggle-icon");return n&&p&&n.addEventListener("click",()=>{const m=p.style.display==="block";p.style.display=m?"none":"block",d.textContent=m?"Show Implementation Guide":"Hide Implementation Guide",g.textContent=m?"▼":"▲",m||setTimeout(()=>vu(),50)}),{angularApp:t,cleanup:()=>{t?.destroy&&t.destroy();const m=document.getElementById("angular-app-root");m&&(m.innerHTML="")}}}catch(e){return console.error("Failed to load Angular demo:",e),l.innerHTML=`
74
74
  <div class="angular-demo">
75
75
  <h3>Angular Integration Demo</h3>
76
76
  <div class="error-message">
@@ -80,7 +80,7 @@ npm install formeo</code></pre>
80
80
  <button class="retry-button" onclick="window.frameworkLoader?.switchFramework('angular')">Retry</button>
81
81
  </div>
82
82
  </div>
83
- `,{cleanup:()=>{}}}}async function zm(){await new Promise(c=>setTimeout(c,500)),console.log("Angular-style demo environment ready")}async function jm(){if(window.hljs)return window.hljs;try{const c=document.createElement("link");return c.rel="stylesheet",c.href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css",document.head.appendChild(c),Um(),await Yo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"),await Yo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/typescript.min.js"),await Yo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/bash.min.js"),window.hljs}catch(c){return console.warn("Failed to load Highlight.js:",c),null}}function Um(){const c=document.createElement("style");c.textContent=`
83
+ `,{cleanup:()=>{}}}}async function Ym(){await new Promise(l=>setTimeout(l,500)),console.log("Angular-style demo environment ready")}async function Xm(){if(window.hljs)return window.hljs;try{const l=document.createElement("link");return l.rel="stylesheet",l.href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css",document.head.appendChild(l),Qm(),await Yo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"),await Yo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/typescript.min.js"),await Yo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/bash.min.js"),window.hljs}catch(l){return console.warn("Failed to load Highlight.js:",l),null}}function Qm(){const l=document.createElement("style");l.textContent=`
84
84
  .angular-demo .guide-section {
85
85
  margin-bottom: 24px;
86
86
  }
@@ -146,7 +146,7 @@ npm install formeo</code></pre>
146
146
  padding: 20px;
147
147
  margin-top: 16px;
148
148
  }
149
- `,document.head.appendChild(c)}function Yo(c){return new Promise((e,t)=>{const n=document.createElement("script");n.src=c,n.onload=e,n.onerror=t,document.head.appendChild(n)})}function hu(){window.hljs?document.querySelectorAll("pre code").forEach(c=>{try{window.hljs.highlightElement(c)}catch(e){console.warn("Failed to highlight code block:",e)}}):document.querySelectorAll("pre code").forEach(c=>{c.style.fontFamily="'Monaco', 'Menlo', 'Ubuntu Mono', monospace",c.style.fontSize="14px",c.style.lineHeight="1.5"})}async function Gm(){const c=document.getElementById("angular-app-root");if(!c)return null;c.innerHTML=`
149
+ `,document.head.appendChild(l)}function Yo(l){return new Promise((e,t)=>{const n=document.createElement("script");n.src=l,n.onload=e,n.onerror=t,document.head.appendChild(n)})}function vu(){window.hljs?document.querySelectorAll("pre code").forEach(l=>{try{window.hljs.highlightElement(l)}catch(e){console.warn("Failed to highlight code block:",e)}}):document.querySelectorAll("pre code").forEach(l=>{l.style.fontFamily="'Monaco', 'Menlo', 'Ubuntu Mono', monospace",l.style.fontSize="14px",l.style.lineHeight="1.5"})}async function Zm(){const l=document.getElementById("angular-app-root");if(!l)return null;l.innerHTML=`
150
150
  <div class="angular-component">
151
151
  <div class="form-builder-container">
152
152
  <div class="editor-section">
@@ -164,7 +164,7 @@ npm install formeo</code></pre>
164
164
  </div>
165
165
  </div>
166
166
  </div>
167
- `;const e=c.querySelector(".angular-form-editor"),t=c.querySelector(".angular-form-renderer");if(e&&t){const n=document.createElement("form");n.className="build-form-angular-real";const p=document.createElement("div");p.className="render-form-angular-real",e.appendChild(n),t.appendChild(p);const d={...en,editorContainer:".build-form-angular-real",events:{...en.events,onSave:s=>{console.log("Angular Component - Form saved:",s)},onChange:s=>{console.log("Angular Component - Form changed:",s)}}},g={...ea,renderContainer:".render-form-angular-real"},m=new Zs(d),l=new Js(g),f=c.querySelector("#angular-save-btn"),r=c.querySelector("#angular-render-btn"),o=c.querySelector("#angular-clear-btn");return f&&f.addEventListener("click",()=>{const s=m.formData;console.log("Angular Component - Save clicked:",s),alert("Form saved! Check console for form data.")}),r&&r.addEventListener("click",()=>{const s=m.formData;s&&Object.keys(s).length>0?(p.style.display="block",l.render(s),console.log("Angular Component - Render clicked:",s)):alert("Please create a form first before rendering")}),o&&o.addEventListener("click",()=>{m&&m.clear(),l&&p&&(p.innerHTML="",p.style.display="none"),console.log("Angular Component - Clear clicked")}),{editor:m,renderer:l,destroy:()=>{m?.destroy&&m.destroy(),l?.destroy&&l.destroy()}}}return null}function Xo(c){const e=document.createElement("div");return e.textContent=c,e.innerHTML}const Vm=`import { Component, OnInit, OnDestroy, ElementRef, ViewChild, inject } from '@angular/core';
167
+ `;const e=l.querySelector(".angular-form-editor"),t=l.querySelector(".angular-form-renderer");if(e&&t){const n=document.createElement("form");n.className="build-form-angular-real";const p=document.createElement("div");p.className="render-form-angular-real",e.appendChild(n),t.appendChild(p);const d={...tn,editorContainer:".build-form-angular-real",events:{...tn.events,onSave:s=>{console.log("Angular Component - Form saved:",s)},onChange:s=>{console.log("Angular Component - Form changed:",s)}}},g={...sa,renderContainer:".render-form-angular-real"},m=new ra(d),c=new oa(g),f=l.querySelector("#angular-save-btn"),r=l.querySelector("#angular-render-btn"),o=l.querySelector("#angular-clear-btn");return f&&f.addEventListener("click",()=>{const s=m.formData;console.log("Angular Component - Save clicked:",s),alert("Form saved! Check console for form data.")}),r&&r.addEventListener("click",()=>{const s=m.formData;s&&Object.keys(s).length>0?(p.style.display="block",c.render(s),console.log("Angular Component - Render clicked:",s)):alert("Please create a form first before rendering")}),o&&o.addEventListener("click",()=>{m&&m.clear(),c&&p&&(p.innerHTML="",p.style.display="none"),console.log("Angular Component - Clear clicked")}),{editor:m,renderer:c,destroy:()=>{m?.destroy&&m.destroy(),c?.destroy&&c.destroy()}}}return null}function Xo(l){const e=document.createElement("div");return e.textContent=l,e.innerHTML}const Jm=`import { Component, OnInit, OnDestroy, ElementRef, ViewChild, inject } from '@angular/core';
168
168
  import { FormeoEditor, FormeoRenderer } from 'formeo';
169
169
 
170
170
  @Component({
@@ -353,7 +353,7 @@ export class FormBuilderComponent implements OnInit, OnDestroy {
353
353
  this.renderer.destroy();
354
354
  }
355
355
  }
356
- }`,Km=`import { Injectable, signal } from '@angular/core';
356
+ }`,ev=`import { Injectable, signal } from '@angular/core';
357
357
  import { FormeoEditor, FormeoRenderer } from 'formeo';
358
358
 
359
359
  export interface FormeoConfig {
@@ -473,7 +473,7 @@ export class FormeoService {
473
473
  console.log('Form submitted via service:', formData);
474
474
  // Handle form submission logic here
475
475
  }
476
- }`,qm=`// app.config.ts (for standalone applications)
476
+ }`,tv=`// app.config.ts (for standalone applications)
477
477
  import { ApplicationConfig } from '@angular/core';
478
478
  import { provideRouter } from '@angular/router';
479
479
  import { routes } from './app.routes';
@@ -511,7 +511,7 @@ import { AppComponent } from './app/app.component';
511
511
  import { appConfig } from './app/app.config';
512
512
 
513
513
  bootstrapApplication(AppComponent, appConfig)
514
- .catch(err => console.error(err));`;async function Ym(c){c.innerHTML=`
514
+ .catch(err => console.error(err));`;async function nv(l){l.innerHTML=`
515
515
  <div class="react-demo">
516
516
  <h3>React Integration Demo</h3>
517
517
  <p>Demonstrating Formeo integration patterns for React applications</p>
@@ -519,7 +519,7 @@ bootstrapApplication(AppComponent, appConfig)
519
519
  <p>Initializing React-style Formeo integration demo...</p>
520
520
  </div>
521
521
  </div>
522
- `;try{await Xm(),await Qm()&&console.log("Highlight.js loaded successfully for React demo"),c.innerHTML=`
522
+ `;try{await iv(),await rv()&&console.log("Highlight.js loaded successfully for React demo"),l.innerHTML=`
523
523
  <div class="react-demo">
524
524
  <h3>React Integration Demo</h3>
525
525
  <div class="demo-description">
@@ -553,17 +553,17 @@ npm install --save-dev @types/react @types/react-dom typescript</code></pre>
553
553
 
554
554
  <div class="guide-section">
555
555
  <h4>2. React Hook for Formeo</h4>
556
- <pre><code class="language-typescript">${Zo(ev)}</code></pre>
556
+ <pre><code class="language-typescript">${Zo(av)}</code></pre>
557
557
  </div>
558
558
 
559
559
  <div class="guide-section">
560
560
  <h4>3. React Component Implementation</h4>
561
- <pre><code class="language-typescript">${Zo(tv)}</code></pre>
561
+ <pre><code class="language-typescript">${Zo(lv)}</code></pre>
562
562
  </div>
563
563
 
564
564
  <div class="guide-section">
565
565
  <h4>4. Context Provider (Advanced)</h4>
566
- <pre><code class="language-typescript">${Zo(nv)}</code></pre>
566
+ <pre><code class="language-typescript">${Zo(cv)}</code></pre>
567
567
  </div>
568
568
  </div>
569
569
 
@@ -572,7 +572,7 @@ npm install --save-dev @types/react @types/react-dom typescript</code></pre>
572
572
  <div id="react-app-root"></div>
573
573
  </div>
574
574
  </div>
575
- `;const t=await Jm();du();const n=c.querySelector("#toggle-instructions"),p=c.querySelector("#instructions-section"),d=n.querySelector(".toggle-text"),g=n.querySelector(".toggle-icon");return n&&p&&n.addEventListener("click",()=>{const m=p.style.display==="block";p.style.display=m?"none":"block",d.textContent=m?"Show Implementation Guide":"Hide Implementation Guide",g.textContent=m?"▼":"▲",m||setTimeout(()=>du(),50)}),{reactApp:t,cleanup:()=>{t?.cleanup&&t.cleanup();const m=document.getElementById("react-app-root");m&&(m.innerHTML="")}}}catch(e){return console.error("Failed to load React demo:",e),c.innerHTML=`
575
+ `;const t=await sv();yu();const n=l.querySelector("#toggle-instructions"),p=l.querySelector("#instructions-section"),d=n.querySelector(".toggle-text"),g=n.querySelector(".toggle-icon");return n&&p&&n.addEventListener("click",()=>{const m=p.style.display==="block";p.style.display=m?"none":"block",d.textContent=m?"Show Implementation Guide":"Hide Implementation Guide",g.textContent=m?"▼":"▲",m||setTimeout(()=>yu(),50)}),{reactApp:t,cleanup:()=>{t?.cleanup&&t.cleanup();const m=document.getElementById("react-app-root");m&&(m.innerHTML="")}}}catch(e){return console.error("Failed to load React demo:",e),l.innerHTML=`
576
576
  <div class="react-demo">
577
577
  <h3>React Integration Demo</h3>
578
578
  <div class="error-message">
@@ -582,7 +582,7 @@ npm install --save-dev @types/react @types/react-dom typescript</code></pre>
582
582
  <button class="retry-button" onclick="window.frameworkLoader?.switchFramework('react')">Retry</button>
583
583
  </div>
584
584
  </div>
585
- `,{cleanup:()=>{}}}}async function Xm(){await new Promise(c=>setTimeout(c,500)),console.log("React-style demo environment ready")}async function Qm(){if(window.hljs)return window.hljs;try{const c=document.createElement("link");return c.rel="stylesheet",c.href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css",document.head.appendChild(c),Zm(),await Qo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"),await Qo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/typescript.min.js"),await Qo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/bash.min.js"),window.hljs}catch(c){return console.warn("Failed to load Highlight.js:",c),null}}function Zm(){const c=document.createElement("style");c.textContent=`
585
+ `,{cleanup:()=>{}}}}async function iv(){await new Promise(l=>setTimeout(l,500)),console.log("React-style demo environment ready")}async function rv(){if(window.hljs)return window.hljs;try{const l=document.createElement("link");return l.rel="stylesheet",l.href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css",document.head.appendChild(l),ov(),await Qo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"),await Qo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/typescript.min.js"),await Qo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/bash.min.js"),window.hljs}catch(l){return console.warn("Failed to load Highlight.js:",l),null}}function ov(){const l=document.createElement("style");l.textContent=`
586
586
  .react-demo .guide-section {
587
587
  margin-bottom: 24px;
588
588
  }
@@ -656,7 +656,7 @@ npm install --save-dev @types/react @types/react-dom typescript</code></pre>
656
656
  padding: 12px;
657
657
  margin: 12px 0;
658
658
  }
659
- `,document.head.appendChild(c)}function Qo(c){return new Promise((e,t)=>{const n=document.createElement("script");n.src=c,n.onload=e,n.onerror=t,document.head.appendChild(n)})}function du(){window.hljs?document.querySelectorAll("pre code").forEach(c=>{try{window.hljs.highlightElement(c)}catch(e){console.warn("Failed to highlight code block:",e)}}):document.querySelectorAll("pre code").forEach(c=>{c.style.fontFamily="'Monaco', 'Menlo', 'Ubuntu Mono', monospace",c.style.fontSize="14px",c.style.lineHeight="1.5"})}async function Jm(){const c=document.getElementById("react-app-root");if(!c)return null;c.innerHTML=`
659
+ `,document.head.appendChild(l)}function Qo(l){return new Promise((e,t)=>{const n=document.createElement("script");n.src=l,n.onload=e,n.onerror=t,document.head.appendChild(n)})}function yu(){window.hljs?document.querySelectorAll("pre code").forEach(l=>{try{window.hljs.highlightElement(l)}catch(e){console.warn("Failed to highlight code block:",e)}}):document.querySelectorAll("pre code").forEach(l=>{l.style.fontFamily="'Monaco', 'Menlo', 'Ubuntu Mono', monospace",l.style.fontSize="14px",l.style.lineHeight="1.5"})}async function sv(){const l=document.getElementById("react-app-root");if(!l)return null;l.innerHTML=`
660
660
  <div class="react-component">
661
661
  <div class="form-builder-container">
662
662
  <div class="editor-section">
@@ -675,7 +675,7 @@ npm install --save-dev @types/react @types/react-dom typescript</code></pre>
675
675
  </div>
676
676
  </div>
677
677
  </div>
678
- `;const e=c.querySelector(".react-form-editor"),t=c.querySelector(".react-form-renderer");if(e&&t){const n=document.createElement("form");n.className="build-form-react-real";const p=document.createElement("div");p.className="render-form-react-real",e.appendChild(n),t.appendChild(p);const d={...en,editorContainer:".build-form-react-real",events:{...en.events,onSave:a=>{console.log("React Component - Form saved:",a)},onChange:a=>{console.log("React Component - Form changed:",a)}}},g={...ea,renderContainer:".render-form-react-real"},m=new Zs(d),l=new Js(g),f=c.querySelector("#react-save-btn"),r=c.querySelector("#react-render-btn"),o=c.querySelector("#react-clear-btn"),s=c.querySelector("#react-export-btn");return f&&f.addEventListener("click",()=>{const a=m.formData;console.log("React Component - Save clicked:",a),localStorage.setItem("formeo-react-form",JSON.stringify(a)),alert("Form saved! Check console for form data.")}),r&&r.addEventListener("click",()=>{const a=m.formData;a&&Object.keys(a).length>0?(p.style.display="block",l.render(a),console.log("React Component - Render clicked:",a)):alert("Please create a form first before rendering")}),o&&o.addEventListener("click",()=>{m?.clear(),p.style.display="none",localStorage.removeItem("formeo-react-form"),console.log("React Component - Clear clicked")}),s&&s.addEventListener("click",()=>{const a=m.formData;if(a&&Object.keys(a).length>0){const i=new Blob([JSON.stringify(a,null,2)],{type:"application/json"}),u=URL.createObjectURL(i),h=document.createElement("a");h.href=u,h.download="formeo-react-form.json",h.click(),URL.revokeObjectURL(u),console.log("React Component - Export clicked")}else alert("Please create a form first before exporting")}),console.log(m),{editor:m,renderer:l,cleanup:()=>{m?.destroy&&m.destroy(),l?.destroy&&l.destroy()}}}return null}function Zo(c){const e=document.createElement("div");return e.textContent=c,e.innerHTML}const ev=`import { useEffect, useRef, useCallback } from 'react';
678
+ `;const e=l.querySelector(".react-form-editor"),t=l.querySelector(".react-form-renderer");if(e&&t){const n=document.createElement("form");n.className="build-form-react-real";const p=document.createElement("div");p.className="render-form-react-real",e.appendChild(n),t.appendChild(p);const d={...tn,editorContainer:".build-form-react-real",events:{...tn.events,onSave:a=>{console.log("React Component - Form saved:",a)},onChange:a=>{console.log("React Component - Form changed:",a)}}},g={...sa,renderContainer:".render-form-react-real"},m=new ra(d),c=new oa(g),f=l.querySelector("#react-save-btn"),r=l.querySelector("#react-render-btn"),o=l.querySelector("#react-clear-btn"),s=l.querySelector("#react-export-btn");return f&&f.addEventListener("click",()=>{const a=m.formData;console.log("React Component - Save clicked:",a),localStorage.setItem("formeo-react-form",JSON.stringify(a)),alert("Form saved! Check console for form data.")}),r&&r.addEventListener("click",()=>{const a=m.formData;a&&Object.keys(a).length>0?(p.style.display="block",c.render(a),console.log("React Component - Render clicked:",a)):alert("Please create a form first before rendering")}),o&&o.addEventListener("click",()=>{m?.clear(),p.style.display="none",localStorage.removeItem("formeo-react-form"),console.log("React Component - Clear clicked")}),s&&s.addEventListener("click",()=>{const a=m.formData;if(a&&Object.keys(a).length>0){const i=new Blob([JSON.stringify(a,null,2)],{type:"application/json"}),u=URL.createObjectURL(i),h=document.createElement("a");h.href=u,h.download="formeo-react-form.json",h.click(),URL.revokeObjectURL(u),console.log("React Component - Export clicked")}else alert("Please create a form first before exporting")}),console.log(m),{editor:m,renderer:c,cleanup:()=>{m?.destroy&&m.destroy(),c?.destroy&&c.destroy()}}}return null}function Zo(l){const e=document.createElement("div");return e.textContent=l,e.innerHTML}const av=`import { useEffect, useRef, useCallback } from 'react';
679
679
  import { FormeoEditor, FormeoRenderer } from 'formeo';
680
680
 
681
681
  // Custom hook for Formeo Editor
@@ -808,7 +808,7 @@ export function useFormeoRenderer(options = {}) {
808
808
  clearRenderer,
809
809
  renderer: rendererRef.current
810
810
  };
811
- }`,tv=`import React, { useState } from 'react';
811
+ }`,lv=`import React, { useState } from 'react';
812
812
  import { useFormeoEditor, useFormeoRenderer } from './hooks/useFormeo';
813
813
 
814
814
  interface FormBuilderProps {
@@ -980,7 +980,7 @@ export default function App() {
980
980
  )}
981
981
  </div>
982
982
  );
983
- }`,nv=`import React, { createContext, useContext, useReducer, useCallback } from 'react';
983
+ }`,cv=`import React, { createContext, useContext, useReducer, useCallback } from 'react';
984
984
  import { FormeoEditor, FormeoRenderer } from 'formeo';
985
985
 
986
986
  // Types
@@ -1167,8 +1167,8 @@ export const FormManager: React.FC = () => {
1167
1167
  <p>Active Renderers: {Object.keys(state.renderers).length}</p>
1168
1168
  </div>
1169
1169
  );
1170
- };`;var Jo={exports:{}},fu;function iv(){return fu||(fu=1,(function(c,e){(function(){var t="ace",n=(function(){return this})();!n&&typeof window<"u"&&(n=window);var p=function(r,o,s){if(typeof r!="string"){p.original?p.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(s=o),p.modules[r]||(p.payloads[r]=s,p.modules[r]=null)};p.modules={},p.payloads={};var d=function(r,o,s){if(typeof o=="string"){var a=l(r,o);if(a!=null)return s&&s(),a}else if(Object.prototype.toString.call(o)==="[object Array]"){for(var i=[],u=0,h=o.length;u<h;++u){var y=l(r,o[u]);if(y==null&&g.original)return;i.push(y)}return s&&s.apply(null,i)||!0}},g=function(r,o){var s=d("",r,o);return s==null&&g.original?g.original.apply(this,arguments):s},m=function(r,o){if(o.indexOf("!")!==-1){var s=o.split("!");return m(r,s[0])+"!"+m(r,s[1])}if(o.charAt(0)=="."){var a=r.split("/").slice(0,-1).join("/");for(o=a+"/"+o;o.indexOf(".")!==-1&&i!=o;){var i=o;o=o.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return o},l=function(r,o){o=m(r,o);var s=p.modules[o];if(!s){if(s=p.payloads[o],typeof s=="function"){var a={},i={id:o,uri:"",exports:a,packaged:!0},u=function(y,b){return d(o,y,b)},h=s(u,a,i);a=h||i.exports,p.modules[o]=a,delete p.payloads[o]}s=p.modules[o]=a||s}return s};function f(r){var o=n;n[r]||(n[r]={}),o=n[r],(!o.define||!o.define.packaged)&&(p.original=o.define,o.define=p,o.define.packaged=!0),(!o.require||!o.require.packaged)&&(g.original=o.require,o.require=g,o.require.packaged=!0)}f(t)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(t,n,p){function d(g,m,l){Object.defineProperty(g,m,{value:l,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||d(String.prototype,"startsWith",function(g,m){return m=m||0,this.lastIndexOf(g,m)===m}),String.prototype.endsWith||d(String.prototype,"endsWith",function(g,m){var l=this;(m===void 0||m>l.length)&&(m=l.length),m-=g.length;var f=l.indexOf(g,m);return f!==-1&&f===m}),String.prototype.repeat||d(String.prototype,"repeat",function(g){for(var m="",l=this;g>0;)g&1&&(m+=l),(g>>=1)&&(l+=l);return m}),String.prototype.includes||d(String.prototype,"includes",function(g,m){return this.indexOf(g,m)!=-1}),Object.assign||(Object.assign=function(g){if(g==null)throw new TypeError("Cannot convert undefined or null to object");for(var m=Object(g),l=1;l<arguments.length;l++){var f=arguments[l];f!=null&&Object.keys(f).forEach(function(r){m[r]=f[r]})}return m}),Object.values||(Object.values=function(g){return Object.keys(g).map(function(m){return g[m]})}),Array.prototype.find||d(Array.prototype,"find",function(g){for(var m=this.length,l=arguments[1],f=0;f<m;f++){var r=this[f];if(g.call(l,r,f,this))return r}}),Array.prototype.findIndex||d(Array.prototype,"findIndex",function(g){for(var m=this.length,l=arguments[1],f=0;f<m;f++){var r=this[f];if(g.call(l,r,f,this))return f}}),Array.prototype.includes||d(Array.prototype,"includes",function(g,m){return this.indexOf(g,m)!=-1}),Array.prototype.fill||d(Array.prototype,"fill",function(g){for(var m=this,l=m.length>>>0,f=arguments[1],r=f>>0,o=r<0?Math.max(l+r,0):Math.min(r,l),s=arguments[2],a=s===void 0?l:s>>0,i=a<0?Math.max(l+a,0):Math.min(a,l);o<i;)m[o]=g,o++;return m}),Array.of||d(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(t,n,p){t("./es6-shim")}),ace.define("ace/lib/deep_copy",["require","exports","module"],function(t,n,p){n.deepCopy=function d(g){if(typeof g!="object"||!g)return g;var m;if(Array.isArray(g)){m=[];for(var l=0;l<g.length;l++)m[l]=d(g[l]);return m}if(Object.prototype.toString.call(g)!=="[object Object]")return g;m={};for(var l in g)m[l]=d(g[l]);return m}}),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(t,n,p){n.last=function(m){return m[m.length-1]},n.stringReverse=function(m){return m.split("").reverse().join("")},n.stringRepeat=function(m,l){for(var f="";l>0;)l&1&&(f+=m),(l>>=1)&&(m+=m);return f};var d=/^\s\s*/,g=/\s\s*$/;n.stringTrimLeft=function(m){return m.replace(d,"")},n.stringTrimRight=function(m){return m.replace(g,"")},n.copyObject=function(m){var l={};for(var f in m)l[f]=m[f];return l},n.copyArray=function(m){for(var l=[],f=0,r=m.length;f<r;f++)m[f]&&typeof m[f]=="object"?l[f]=this.copyObject(m[f]):l[f]=m[f];return l},n.deepCopy=t("./deep_copy").deepCopy,n.arrayToMap=function(m){for(var l={},f=0;f<m.length;f++)l[m[f]]=1;return l},n.createMap=function(m){var l=Object.create(null);for(var f in m)l[f]=m[f];return l},n.arrayRemove=function(m,l){for(var f=0;f<=m.length;f++)l===m[f]&&m.splice(f,1)},n.escapeRegExp=function(m){return m.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},n.escapeHTML=function(m){return(""+m).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},n.getMatchOffsets=function(m,l){var f=[];return m.replace(l,function(r){f.push({offset:arguments[arguments.length-2],length:r.length})}),f},n.deferredCall=function(m){var l=null,f=function(){l=null,m()},r=function(o){return r.cancel(),l=setTimeout(f,o||0),r};return r.schedule=r,r.call=function(){return this.cancel(),m(),r},r.cancel=function(){return clearTimeout(l),l=null,r},r.isPending=function(){return l},r},n.delayedCall=function(m,l){var f=null,r=function(){f=null,m()},o=function(s){f==null&&(f=setTimeout(r,s||l))};return o.delay=function(s){f&&clearTimeout(f),f=setTimeout(r,s||l)},o.schedule=o,o.call=function(){this.cancel(),m()},o.cancel=function(){f&&clearTimeout(f),f=null},o.isPending=function(){return f},o},n.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},n.skipEmptyMatch=function(m,l,f){return f&&m.codePointAt(l)>65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(t,n,p){n.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},n.getOS=function(){return n.isMac?n.OS.MAC:n.isLinux?n.OS.LINUX:n.OS.WINDOWS};var d=typeof navigator=="object"?navigator:{},g=(/mac|win|linux/i.exec(d.platform)||["other"])[0].toLowerCase(),m=d.userAgent||"",l=d.appName||"";n.isWin=g=="win",n.isMac=g=="mac",n.isLinux=g=="linux",n.isIE=l=="Microsoft Internet Explorer"||l.indexOf("MSAppHost")>=0?parseFloat((m.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((m.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),n.isOldIE=n.isIE&&n.isIE<9,n.isGecko=n.isMozilla=m.match(/ Gecko\/\d+/),n.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",n.isWebKit=parseFloat(m.split("WebKit/")[1])||void 0,n.isChrome=parseFloat(m.split(" Chrome/")[1])||void 0,n.isSafari=parseFloat(m.split(" Safari/")[1])&&!n.isChrome||void 0,n.isEdge=parseFloat(m.split(" Edge/")[1])||void 0,n.isAIR=m.indexOf("AdobeAIR")>=0,n.isAndroid=m.indexOf("Android")>=0,n.isChromeOS=m.indexOf(" CrOS ")>=0,n.isIOS=/iPad|iPhone|iPod/.test(m)&&!window.MSStream,n.isIOS&&(n.isMac=!0),n.isMobile=n.isIOS||n.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(t,n,p){var d=t("./useragent"),g="http://www.w3.org/1999/xhtml";n.buildDom=function s(a,i,u){if(typeof a=="string"&&a){var h=document.createTextNode(a);return i&&i.appendChild(h),h}if(!Array.isArray(a))return a&&a.appendChild&&i&&i.appendChild(a),a;if(typeof a[0]!="string"||!a[0]){for(var y=[],b=0;b<a.length;b++){var T=s(a[b],i,u);T&&y.push(T)}return y}var $=document.createElement(a[0]),A=a[1],S=1;A&&typeof A=="object"&&!Array.isArray(A)&&(S=2);for(var b=S;b<a.length;b++)s(a[b],$,u);return S==2&&Object.keys(A).forEach(function(M){var R=A[M];M==="class"?$.className=Array.isArray(R)?R.join(" "):R:typeof R=="function"||M=="value"||M[0]=="$"?$[M]=R:M==="ref"?u&&(u[R]=$):M==="style"?typeof R=="string"&&($.style.cssText=R):R!=null&&$.setAttribute(M,R)}),i&&i.appendChild($),$},n.getDocumentHead=function(s){return s||(s=document),s.head||s.getElementsByTagName("head")[0]||s.documentElement},n.createElement=function(s,a){return document.createElementNS?document.createElementNS(a||g,s):document.createElement(s)},n.removeChildren=function(s){s.innerHTML=""},n.createTextNode=function(s,a){var i=a?a.ownerDocument:document;return i.createTextNode(s)},n.createFragment=function(s){var a=s?s.ownerDocument:document;return a.createDocumentFragment()},n.hasCssClass=function(s,a){var i=(s.className+"").split(/\s+/g);return i.indexOf(a)!==-1},n.addCssClass=function(s,a){n.hasCssClass(s,a)||(s.className+=" "+a)},n.removeCssClass=function(s,a){for(var i=s.className.split(/\s+/g);;){var u=i.indexOf(a);if(u==-1)break;i.splice(u,1)}s.className=i.join(" ")},n.toggleCssClass=function(s,a){for(var i=s.className.split(/\s+/g),u=!0;;){var h=i.indexOf(a);if(h==-1)break;u=!1,i.splice(h,1)}return u&&i.push(a),s.className=i.join(" "),u},n.setCssClass=function(s,a,i){i?n.addCssClass(s,a):n.removeCssClass(s,a)},n.hasCssString=function(s,a){var i=0,u;if(a=a||document,u=a.querySelectorAll("style")){for(;i<u.length;)if(u[i++].id===s)return!0}},n.removeElementById=function(s,a){a=a||document,a.getElementById(s)&&a.getElementById(s).remove()};var m,l=[];n.useStrictCSP=function(s){m=s,s==!1?f():l||(l=[])};function f(){var s=l;l=null,s&&s.forEach(function(a){r(a[0],a[1])})}function r(s,a,i){if(!(typeof document>"u")){if(l){if(i)f();else if(i===!1)return l.push([s,a])}if(!m){var u=i;!i||!i.getRootNode?u=document:(u=i.getRootNode(),(!u||u==i)&&(u=document));var h=u.ownerDocument||u;if(a&&n.hasCssString(a,u))return null;a&&(s+=`
1171
- /*# sourceURL=ace/css/`+a+" */");var y=n.createElement("style");y.appendChild(h.createTextNode(s)),a&&(y.id=a),u==h&&(u=n.getDocumentHead(h)),u.insertBefore(y,u.firstChild)}}}if(n.importCssString=r,n.importCssStylsheet=function(s,a){n.buildDom(["link",{rel:"stylesheet",href:s}],n.getDocumentHead(a))},n.scrollbarWidth=function(s){var a=n.createElement("ace_inner");a.style.width="100%",a.style.minWidth="0px",a.style.height="200px",a.style.display="block";var i=n.createElement("ace_outer"),u=i.style;u.position="absolute",u.left="-10000px",u.overflow="hidden",u.width="200px",u.minWidth="0px",u.height="150px",u.display="block",i.appendChild(a);var h=s&&s.documentElement||document&&document.documentElement;if(!h)return 0;h.appendChild(i);var y=a.offsetWidth;u.overflow="scroll";var b=a.offsetWidth;return y===b&&(b=i.clientWidth),h.removeChild(i),y-b},n.computedStyle=function(s,a){return window.getComputedStyle(s,"")||{}},n.setStyle=function(s,a,i){s[a]!==i&&(s[a]=i)},n.HAS_CSS_ANIMATION=!1,n.HAS_CSS_TRANSFORMS=!1,n.HI_DPI=d.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,d.isChromeOS&&(n.HI_DPI=!1),typeof document<"u"){var o=document.createElement("div");n.HI_DPI&&o.style.transform!==void 0&&(n.HAS_CSS_TRANSFORMS=!0),!d.isEdge&&typeof o.style.animationName<"u"&&(n.HAS_CSS_ANIMATION=!0),o=null}n.HAS_CSS_TRANSFORMS?n.translate=function(s,a,i){s.style.transform="translate("+Math.round(a)+"px, "+Math.round(i)+"px)"}:n.translate=function(s,a,i){s.style.top=Math.round(i)+"px",s.style.left=Math.round(a)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(t,n,p){var d=t("./dom");n.get=function(g,m){var l=new XMLHttpRequest;l.open("GET",g,!0),l.onreadystatechange=function(){l.readyState===4&&m(l.responseText)},l.send(null)},n.loadScript=function(g,m){var l=d.getDocumentHead(),f=document.createElement("script");f.src=g,l.appendChild(f),f.onload=f.onreadystatechange=function(r,o){(o||!f.readyState||f.readyState=="loaded"||f.readyState=="complete")&&(f=f.onload=f.onreadystatechange=null,o||m())}},n.qualifyURL=function(g){var m=document.createElement("a");return m.href=g,m.href}}),ace.define("ace/lib/oop",["require","exports","module"],function(t,n,p){n.inherits=function(d,g){d.super_=g,d.prototype=Object.create(g.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}})},n.mixin=function(d,g){for(var m in g)d[m]=g[m];return d},n.implement=function(d,g){n.mixin(d,g)}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(t,n,p){var d={},g=function(){this.propagationStopped=!0},m=function(){this.defaultPrevented=!0};d._emit=d._dispatchEvent=function(l,f){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var r=this._eventRegistry[l]||[],o=this._defaultHandlers[l];if(!(!r.length&&!o)){(typeof f!="object"||!f)&&(f={}),f.type||(f.type=l),f.stopPropagation||(f.stopPropagation=g),f.preventDefault||(f.preventDefault=m),r=r.slice();for(var s=0;s<r.length&&(r[s](f,this),!f.propagationStopped);s++);if(o&&!f.defaultPrevented)return o(f,this)}},d._signal=function(l,f){var r=(this._eventRegistry||{})[l];if(r){r=r.slice();for(var o=0;o<r.length;o++)r[o](f,this)}},d.once=function(l,f){var r=this;if(this.on(l,function o(){r.off(l,o),f.apply(null,arguments)}),!f)return new Promise(function(o){f=o})},d.setDefaultHandler=function(l,f){var r=this._defaultHandlers;if(r||(r=this._defaultHandlers={_disabled_:{}}),r[l]){var o=r[l],s=r._disabled_[l];s||(r._disabled_[l]=s=[]),s.push(o);var a=s.indexOf(f);a!=-1&&s.splice(a,1)}r[l]=f},d.removeDefaultHandler=function(l,f){var r=this._defaultHandlers;if(r){var o=r._disabled_[l];if(r[l]==f)o&&this.setDefaultHandler(l,o.pop());else if(o){var s=o.indexOf(f);s!=-1&&o.splice(s,1)}}},d.on=d.addEventListener=function(l,f,r){this._eventRegistry=this._eventRegistry||{};var o=this._eventRegistry[l];return o||(o=this._eventRegistry[l]=[]),o.indexOf(f)==-1&&o[r?"unshift":"push"](f),f},d.off=d.removeListener=d.removeEventListener=function(l,f){this._eventRegistry=this._eventRegistry||{};var r=this._eventRegistry[l];if(r){var o=r.indexOf(f);o!==-1&&r.splice(o,1)}},d.removeAllListeners=function(l){l||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[l]=void 0),this._defaultHandlers&&(this._defaultHandlers[l]=void 0)},n.EventEmitter=d}),ace.define("ace/lib/report_error",["require","exports","module"],function(t,n,p){n.reportError=function(g,m){var l=new Error(g);l.data=m,typeof console=="object"&&console.error&&console.error(l),setTimeout(function(){throw l})}}),ace.define("ace/lib/default_english_messages",["require","exports","module"],function(t,n,p){var d={"autocomplete.popup.aria-roledescription":"Autocomplete suggestions","autocomplete.popup.aria-label":"Autocomplete suggestions","autocomplete.popup.item.aria-roledescription":"item","autocomplete.loading":"Loading...","editor.scroller.aria-roledescription":"editor","editor.scroller.aria-label":"Editor content, press Enter to start editing, press Escape to exit","editor.gutter.aria-roledescription":"editor","editor.gutter.aria-label":"Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit","error-marker.good-state":"Looks good!","prompt.recently-used":"Recently used","prompt.other-commands":"Other commands","prompt.no-matching-commands":"No matching commands","search-box.find.placeholder":"Search for","search-box.find-all.text":"All","search-box.replace.placeholder":"Replace with","search-box.replace-next.text":"Replace","search-box.replace-all.text":"All","search-box.toggle-replace.title":"Toggle Replace mode","search-box.toggle-regexp.title":"RegExp Search","search-box.toggle-case.title":"CaseSensitive Search","search-box.toggle-whole-word.title":"Whole Word Search","search-box.toggle-in-selection.title":"Search In Selection","search-box.search-counter":"$0 of $1","text-input.aria-roledescription":"editor","text-input.aria-label":"Cursor at row $0","gutter.code-folding.range.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.closed.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.open.aria-label":"Toggle code folding, row $0","gutter.code-folding.closed.title":"Unfold code","gutter.code-folding.open.title":"Fold code","gutter.annotation.aria-label.error":"Error, read annotations row $0","gutter.annotation.aria-label.warning":"Warning, read annotations row $0","gutter.annotation.aria-label.info":"Info, read annotations row $0","inline-fold.closed.title":"Unfold code","gutter-tooltip.aria-label.error.singular":"error","gutter-tooltip.aria-label.error.plural":"errors","gutter-tooltip.aria-label.warning.singular":"warning","gutter-tooltip.aria-label.warning.plural":"warnings","gutter-tooltip.aria-label.info.singular":"information message","gutter-tooltip.aria-label.info.plural":"information messages","gutter.annotation.aria-label.security":"Security finding, read annotations row $0","gutter.annotation.aria-label.hint":"Suggestion, read annotations row $0","gutter-tooltip.aria-label.security.singular":"security finding","gutter-tooltip.aria-label.security.plural":"security findings","gutter-tooltip.aria-label.hint.singular":"suggestion","gutter-tooltip.aria-label.hint.plural":"suggestions"};n.defaultEnglishMessages=d}),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/report_error","ace/lib/default_english_messages"],function(t,n,p){"no use strict";var d=t("./oop"),g=t("./event_emitter").EventEmitter,m=t("./report_error").reportError,l=t("./default_english_messages").defaultEnglishMessages,f={setOptions:function(i){Object.keys(i).forEach(function(u){this.setOption(u,i[u])},this)},getOptions:function(i){var u={};if(i)Array.isArray(i)||(u=i,i=Object.keys(u));else{var h=this.$options;i=Object.keys(h).filter(function(y){return!h[y].hidden})}return i.forEach(function(y){u[y]=this.getOption(y)},this),u},setOption:function(i,u){if(this["$"+i]!==u){var h=this.$options[i];if(!h)return r('misspelled option "'+i+'"');if(h.forwardTo)return this[h.forwardTo]&&this[h.forwardTo].setOption(i,u);h.handlesSet||(this["$"+i]=u),h&&h.set&&h.set.call(this,u)}},getOption:function(i){var u=this.$options[i];return u?u.forwardTo?this[u.forwardTo]&&this[u.forwardTo].getOption(i):u&&u.get?u.get.call(this):this["$"+i]:r('misspelled option "'+i+'"')}};function r(i){typeof console<"u"&&console.warn&&console.warn.apply(console,arguments)}var o,s,a=(function(){function i(){this.$defaultOptions={},o=l,s="dollarSigns"}return i.prototype.defineOptions=function(u,h,y){return u.$options||(this.$defaultOptions[h]=u.$options={}),Object.keys(y).forEach(function(b){var T=y[b];typeof T=="string"&&(T={forwardTo:T}),T.name||(T.name=b),u.$options[T.name]=T,"initialValue"in T&&(u["$"+T.name]=T.initialValue)}),d.implement(u,f),this},i.prototype.resetOptions=function(u){Object.keys(u.$options).forEach(function(h){var y=u.$options[h];"value"in y&&u.setOption(h,y.value)})},i.prototype.setDefaultValue=function(u,h,y){if(!u){for(u in this.$defaultOptions)if(this.$defaultOptions[u][h])break;if(!this.$defaultOptions[u][h])return!1}var b=this.$defaultOptions[u]||(this.$defaultOptions[u]={});b[h]&&(b.forwardTo?this.setDefaultValue(b.forwardTo,h,y):b[h].value=y)},i.prototype.setDefaultValues=function(u,h){Object.keys(h).forEach(function(y){this.setDefaultValue(u,y,h[y])},this)},i.prototype.setMessages=function(u,h){o=u,h&&h.placeholders&&(s=h.placeholders)},i.prototype.nls=function(u,h,y){o[u]||(r("No message found for the key '"+u+"' in the provided messages, trying to find a translation for the default string '"+h+"'."),o[h]||r("No message found for the default string '"+h+"' in the provided messages. Falling back to the default English message."));var b=o[u]||o[h]||h;return y&&(s==="dollarSigns"&&(b=b.replace(/\$(\$|[\d]+)/g,function(T,$){return $=="$"?"$":y[$]})),s==="curlyBrackets"&&(b=b.replace(/\{([^\}]+)\}/g,function(T,$){return y[$]}))),b},i})();a.prototype.warn=r,a.prototype.reportError=m,d.implement(a.prototype,g),n.AppConfig=a}),ace.define("ace/theme/textmate-css",["require","exports","module"],function(t,n,p){p.exports=`.ace-tm .ace_gutter {
1170
+ };`;var Jo={exports:{}},bu;function uv(){return bu||(bu=1,(function(l,e){(function(){var t="ace",n=(function(){return this})();!n&&typeof window<"u"&&(n=window);var p=function(r,o,s){if(typeof r!="string"){p.original?p.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(s=o),p.modules[r]||(p.payloads[r]=s,p.modules[r]=null)};p.modules={},p.payloads={};var d=function(r,o,s){if(typeof o=="string"){var a=c(r,o);if(a!=null)return s&&s(),a}else if(Object.prototype.toString.call(o)==="[object Array]"){for(var i=[],u=0,h=o.length;u<h;++u){var y=c(r,o[u]);if(y==null&&g.original)return;i.push(y)}return s&&s.apply(null,i)||!0}},g=function(r,o){var s=d("",r,o);return s==null&&g.original?g.original.apply(this,arguments):s},m=function(r,o){if(o.indexOf("!")!==-1){var s=o.split("!");return m(r,s[0])+"!"+m(r,s[1])}if(o.charAt(0)=="."){var a=r.split("/").slice(0,-1).join("/");for(o=a+"/"+o;o.indexOf(".")!==-1&&i!=o;){var i=o;o=o.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return o},c=function(r,o){o=m(r,o);var s=p.modules[o];if(!s){if(s=p.payloads[o],typeof s=="function"){var a={},i={id:o,uri:"",exports:a,packaged:!0},u=function(y,b){return d(o,y,b)},h=s(u,a,i);a=h||i.exports,p.modules[o]=a,delete p.payloads[o]}s=p.modules[o]=a||s}return s};function f(r){var o=n;n[r]||(n[r]={}),o=n[r],(!o.define||!o.define.packaged)&&(p.original=o.define,o.define=p,o.define.packaged=!0),(!o.require||!o.require.packaged)&&(g.original=o.require,o.require=g,o.require.packaged=!0)}f(t)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(t,n,p){function d(g,m,c){Object.defineProperty(g,m,{value:c,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||d(String.prototype,"startsWith",function(g,m){return m=m||0,this.lastIndexOf(g,m)===m}),String.prototype.endsWith||d(String.prototype,"endsWith",function(g,m){var c=this;(m===void 0||m>c.length)&&(m=c.length),m-=g.length;var f=c.indexOf(g,m);return f!==-1&&f===m}),String.prototype.repeat||d(String.prototype,"repeat",function(g){for(var m="",c=this;g>0;)g&1&&(m+=c),(g>>=1)&&(c+=c);return m}),String.prototype.includes||d(String.prototype,"includes",function(g,m){return this.indexOf(g,m)!=-1}),Object.assign||(Object.assign=function(g){if(g==null)throw new TypeError("Cannot convert undefined or null to object");for(var m=Object(g),c=1;c<arguments.length;c++){var f=arguments[c];f!=null&&Object.keys(f).forEach(function(r){m[r]=f[r]})}return m}),Object.values||(Object.values=function(g){return Object.keys(g).map(function(m){return g[m]})}),Array.prototype.find||d(Array.prototype,"find",function(g){for(var m=this.length,c=arguments[1],f=0;f<m;f++){var r=this[f];if(g.call(c,r,f,this))return r}}),Array.prototype.findIndex||d(Array.prototype,"findIndex",function(g){for(var m=this.length,c=arguments[1],f=0;f<m;f++){var r=this[f];if(g.call(c,r,f,this))return f}}),Array.prototype.includes||d(Array.prototype,"includes",function(g,m){return this.indexOf(g,m)!=-1}),Array.prototype.fill||d(Array.prototype,"fill",function(g){for(var m=this,c=m.length>>>0,f=arguments[1],r=f>>0,o=r<0?Math.max(c+r,0):Math.min(r,c),s=arguments[2],a=s===void 0?c:s>>0,i=a<0?Math.max(c+a,0):Math.min(a,c);o<i;)m[o]=g,o++;return m}),Array.of||d(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(t,n,p){t("./es6-shim")}),ace.define("ace/lib/deep_copy",["require","exports","module"],function(t,n,p){n.deepCopy=function d(g){if(typeof g!="object"||!g)return g;var m;if(Array.isArray(g)){m=[];for(var c=0;c<g.length;c++)m[c]=d(g[c]);return m}if(Object.prototype.toString.call(g)!=="[object Object]")return g;m={};for(var c in g)m[c]=d(g[c]);return m}}),ace.define("ace/lib/lang",["require","exports","module","ace/lib/deep_copy"],function(t,n,p){n.last=function(m){return m[m.length-1]},n.stringReverse=function(m){return m.split("").reverse().join("")},n.stringRepeat=function(m,c){for(var f="";c>0;)c&1&&(f+=m),(c>>=1)&&(m+=m);return f};var d=/^\s\s*/,g=/\s\s*$/;n.stringTrimLeft=function(m){return m.replace(d,"")},n.stringTrimRight=function(m){return m.replace(g,"")},n.copyObject=function(m){var c={};for(var f in m)c[f]=m[f];return c},n.copyArray=function(m){for(var c=[],f=0,r=m.length;f<r;f++)m[f]&&typeof m[f]=="object"?c[f]=this.copyObject(m[f]):c[f]=m[f];return c},n.deepCopy=t("./deep_copy").deepCopy,n.arrayToMap=function(m){for(var c={},f=0;f<m.length;f++)c[m[f]]=1;return c},n.createMap=function(m){var c=Object.create(null);for(var f in m)c[f]=m[f];return c},n.arrayRemove=function(m,c){for(var f=0;f<=m.length;f++)c===m[f]&&m.splice(f,1)},n.escapeRegExp=function(m){return m.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},n.escapeHTML=function(m){return(""+m).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},n.getMatchOffsets=function(m,c){var f=[];return m.replace(c,function(r){f.push({offset:arguments[arguments.length-2],length:r.length})}),f},n.deferredCall=function(m){var c=null,f=function(){c=null,m()},r=function(o){return r.cancel(),c=setTimeout(f,o||0),r};return r.schedule=r,r.call=function(){return this.cancel(),m(),r},r.cancel=function(){return clearTimeout(c),c=null,r},r.isPending=function(){return c},r},n.delayedCall=function(m,c){var f=null,r=function(){f=null,m()},o=function(s){f==null&&(f=setTimeout(r,s||c))};return o.delay=function(s){f&&clearTimeout(f),f=setTimeout(r,s||c)},o.schedule=o,o.call=function(){this.cancel(),m()},o.cancel=function(){f&&clearTimeout(f),f=null},o.isPending=function(){return f},o},n.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},n.skipEmptyMatch=function(m,c,f){return f&&m.codePointAt(c)>65535?2:1}}),ace.define("ace/lib/useragent",["require","exports","module"],function(t,n,p){n.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},n.getOS=function(){return n.isMac?n.OS.MAC:n.isLinux?n.OS.LINUX:n.OS.WINDOWS};var d=typeof navigator=="object"?navigator:{},g=(/mac|win|linux/i.exec(d.platform)||["other"])[0].toLowerCase(),m=d.userAgent||"",c=d.appName||"";n.isWin=g=="win",n.isMac=g=="mac",n.isLinux=g=="linux",n.isIE=c=="Microsoft Internet Explorer"||c.indexOf("MSAppHost")>=0?parseFloat((m.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((m.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),n.isOldIE=n.isIE&&n.isIE<9,n.isGecko=n.isMozilla=m.match(/ Gecko\/\d+/),n.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",n.isWebKit=parseFloat(m.split("WebKit/")[1])||void 0,n.isChrome=parseFloat(m.split(" Chrome/")[1])||void 0,n.isSafari=parseFloat(m.split(" Safari/")[1])&&!n.isChrome||void 0,n.isEdge=parseFloat(m.split(" Edge/")[1])||void 0,n.isAIR=m.indexOf("AdobeAIR")>=0,n.isAndroid=m.indexOf("Android")>=0,n.isChromeOS=m.indexOf(" CrOS ")>=0,n.isIOS=/iPad|iPhone|iPod/.test(m)&&!window.MSStream,n.isIOS&&(n.isMac=!0),n.isMobile=n.isIOS||n.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(t,n,p){var d=t("./useragent"),g="http://www.w3.org/1999/xhtml";n.buildDom=function s(a,i,u){if(typeof a=="string"&&a){var h=document.createTextNode(a);return i&&i.appendChild(h),h}if(!Array.isArray(a))return a&&a.appendChild&&i&&i.appendChild(a),a;if(typeof a[0]!="string"||!a[0]){for(var y=[],b=0;b<a.length;b++){var T=s(a[b],i,u);T&&y.push(T)}return y}var $=document.createElement(a[0]),A=a[1],S=1;A&&typeof A=="object"&&!Array.isArray(A)&&(S=2);for(var b=S;b<a.length;b++)s(a[b],$,u);return S==2&&Object.keys(A).forEach(function(M){var R=A[M];M==="class"?$.className=Array.isArray(R)?R.join(" "):R:typeof R=="function"||M=="value"||M[0]=="$"?$[M]=R:M==="ref"?u&&(u[R]=$):M==="style"?typeof R=="string"&&($.style.cssText=R):R!=null&&$.setAttribute(M,R)}),i&&i.appendChild($),$},n.getDocumentHead=function(s){return s||(s=document),s.head||s.getElementsByTagName("head")[0]||s.documentElement},n.createElement=function(s,a){return document.createElementNS?document.createElementNS(a||g,s):document.createElement(s)},n.removeChildren=function(s){s.innerHTML=""},n.createTextNode=function(s,a){var i=a?a.ownerDocument:document;return i.createTextNode(s)},n.createFragment=function(s){var a=s?s.ownerDocument:document;return a.createDocumentFragment()},n.hasCssClass=function(s,a){var i=(s.className+"").split(/\s+/g);return i.indexOf(a)!==-1},n.addCssClass=function(s,a){n.hasCssClass(s,a)||(s.className+=" "+a)},n.removeCssClass=function(s,a){for(var i=s.className.split(/\s+/g);;){var u=i.indexOf(a);if(u==-1)break;i.splice(u,1)}s.className=i.join(" ")},n.toggleCssClass=function(s,a){for(var i=s.className.split(/\s+/g),u=!0;;){var h=i.indexOf(a);if(h==-1)break;u=!1,i.splice(h,1)}return u&&i.push(a),s.className=i.join(" "),u},n.setCssClass=function(s,a,i){i?n.addCssClass(s,a):n.removeCssClass(s,a)},n.hasCssString=function(s,a){var i=0,u;if(a=a||document,u=a.querySelectorAll("style")){for(;i<u.length;)if(u[i++].id===s)return!0}},n.removeElementById=function(s,a){a=a||document,a.getElementById(s)&&a.getElementById(s).remove()};var m,c=[];n.useStrictCSP=function(s){m=s,s==!1?f():c||(c=[])};function f(){var s=c;c=null,s&&s.forEach(function(a){r(a[0],a[1])})}function r(s,a,i){if(!(typeof document>"u")){if(c){if(i)f();else if(i===!1)return c.push([s,a])}if(!m){var u=i;!i||!i.getRootNode?u=document:(u=i.getRootNode(),(!u||u==i)&&(u=document));var h=u.ownerDocument||u;if(a&&n.hasCssString(a,u))return null;a&&(s+=`
1171
+ /*# sourceURL=ace/css/`+a+" */");var y=n.createElement("style");y.appendChild(h.createTextNode(s)),a&&(y.id=a),u==h&&(u=n.getDocumentHead(h)),u.insertBefore(y,u.firstChild)}}}if(n.importCssString=r,n.importCssStylsheet=function(s,a){n.buildDom(["link",{rel:"stylesheet",href:s}],n.getDocumentHead(a))},n.scrollbarWidth=function(s){var a=n.createElement("ace_inner");a.style.width="100%",a.style.minWidth="0px",a.style.height="200px",a.style.display="block";var i=n.createElement("ace_outer"),u=i.style;u.position="absolute",u.left="-10000px",u.overflow="hidden",u.width="200px",u.minWidth="0px",u.height="150px",u.display="block",i.appendChild(a);var h=s&&s.documentElement||document&&document.documentElement;if(!h)return 0;h.appendChild(i);var y=a.offsetWidth;u.overflow="scroll";var b=a.offsetWidth;return y===b&&(b=i.clientWidth),h.removeChild(i),y-b},n.computedStyle=function(s,a){return window.getComputedStyle(s,"")||{}},n.setStyle=function(s,a,i){s[a]!==i&&(s[a]=i)},n.HAS_CSS_ANIMATION=!1,n.HAS_CSS_TRANSFORMS=!1,n.HI_DPI=d.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,d.isChromeOS&&(n.HI_DPI=!1),typeof document<"u"){var o=document.createElement("div");n.HI_DPI&&o.style.transform!==void 0&&(n.HAS_CSS_TRANSFORMS=!0),!d.isEdge&&typeof o.style.animationName<"u"&&(n.HAS_CSS_ANIMATION=!0),o=null}n.HAS_CSS_TRANSFORMS?n.translate=function(s,a,i){s.style.transform="translate("+Math.round(a)+"px, "+Math.round(i)+"px)"}:n.translate=function(s,a,i){s.style.top=Math.round(i)+"px",s.style.left=Math.round(a)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(t,n,p){var d=t("./dom");n.get=function(g,m){var c=new XMLHttpRequest;c.open("GET",g,!0),c.onreadystatechange=function(){c.readyState===4&&m(c.responseText)},c.send(null)},n.loadScript=function(g,m){var c=d.getDocumentHead(),f=document.createElement("script");f.src=g,c.appendChild(f),f.onload=f.onreadystatechange=function(r,o){(o||!f.readyState||f.readyState=="loaded"||f.readyState=="complete")&&(f=f.onload=f.onreadystatechange=null,o||m())}},n.qualifyURL=function(g){var m=document.createElement("a");return m.href=g,m.href}}),ace.define("ace/lib/oop",["require","exports","module"],function(t,n,p){n.inherits=function(d,g){d.super_=g,d.prototype=Object.create(g.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}})},n.mixin=function(d,g){for(var m in g)d[m]=g[m];return d},n.implement=function(d,g){n.mixin(d,g)}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(t,n,p){var d={},g=function(){this.propagationStopped=!0},m=function(){this.defaultPrevented=!0};d._emit=d._dispatchEvent=function(c,f){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var r=this._eventRegistry[c]||[],o=this._defaultHandlers[c];if(!(!r.length&&!o)){(typeof f!="object"||!f)&&(f={}),f.type||(f.type=c),f.stopPropagation||(f.stopPropagation=g),f.preventDefault||(f.preventDefault=m),r=r.slice();for(var s=0;s<r.length&&(r[s](f,this),!f.propagationStopped);s++);if(o&&!f.defaultPrevented)return o(f,this)}},d._signal=function(c,f){var r=(this._eventRegistry||{})[c];if(r){r=r.slice();for(var o=0;o<r.length;o++)r[o](f,this)}},d.once=function(c,f){var r=this;if(this.on(c,function o(){r.off(c,o),f.apply(null,arguments)}),!f)return new Promise(function(o){f=o})},d.setDefaultHandler=function(c,f){var r=this._defaultHandlers;if(r||(r=this._defaultHandlers={_disabled_:{}}),r[c]){var o=r[c],s=r._disabled_[c];s||(r._disabled_[c]=s=[]),s.push(o);var a=s.indexOf(f);a!=-1&&s.splice(a,1)}r[c]=f},d.removeDefaultHandler=function(c,f){var r=this._defaultHandlers;if(r){var o=r._disabled_[c];if(r[c]==f)o&&this.setDefaultHandler(c,o.pop());else if(o){var s=o.indexOf(f);s!=-1&&o.splice(s,1)}}},d.on=d.addEventListener=function(c,f,r){this._eventRegistry=this._eventRegistry||{};var o=this._eventRegistry[c];return o||(o=this._eventRegistry[c]=[]),o.indexOf(f)==-1&&o[r?"unshift":"push"](f),f},d.off=d.removeListener=d.removeEventListener=function(c,f){this._eventRegistry=this._eventRegistry||{};var r=this._eventRegistry[c];if(r){var o=r.indexOf(f);o!==-1&&r.splice(o,1)}},d.removeAllListeners=function(c){c||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[c]=void 0),this._defaultHandlers&&(this._defaultHandlers[c]=void 0)},n.EventEmitter=d}),ace.define("ace/lib/report_error",["require","exports","module"],function(t,n,p){n.reportError=function(g,m){var c=new Error(g);c.data=m,typeof console=="object"&&console.error&&console.error(c),setTimeout(function(){throw c})}}),ace.define("ace/lib/default_english_messages",["require","exports","module"],function(t,n,p){var d={"autocomplete.popup.aria-roledescription":"Autocomplete suggestions","autocomplete.popup.aria-label":"Autocomplete suggestions","autocomplete.popup.item.aria-roledescription":"item","autocomplete.loading":"Loading...","editor.scroller.aria-roledescription":"editor","editor.scroller.aria-label":"Editor content, press Enter to start editing, press Escape to exit","editor.gutter.aria-roledescription":"editor","editor.gutter.aria-label":"Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit","error-marker.good-state":"Looks good!","prompt.recently-used":"Recently used","prompt.other-commands":"Other commands","prompt.no-matching-commands":"No matching commands","search-box.find.placeholder":"Search for","search-box.find-all.text":"All","search-box.replace.placeholder":"Replace with","search-box.replace-next.text":"Replace","search-box.replace-all.text":"All","search-box.toggle-replace.title":"Toggle Replace mode","search-box.toggle-regexp.title":"RegExp Search","search-box.toggle-case.title":"CaseSensitive Search","search-box.toggle-whole-word.title":"Whole Word Search","search-box.toggle-in-selection.title":"Search In Selection","search-box.search-counter":"$0 of $1","text-input.aria-roledescription":"editor","text-input.aria-label":"Cursor at row $0","gutter.code-folding.range.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.closed.aria-label":"Toggle code folding, rows $0 through $1","gutter.code-folding.open.aria-label":"Toggle code folding, row $0","gutter.code-folding.closed.title":"Unfold code","gutter.code-folding.open.title":"Fold code","gutter.annotation.aria-label.error":"Error, read annotations row $0","gutter.annotation.aria-label.warning":"Warning, read annotations row $0","gutter.annotation.aria-label.info":"Info, read annotations row $0","inline-fold.closed.title":"Unfold code","gutter-tooltip.aria-label.error.singular":"error","gutter-tooltip.aria-label.error.plural":"errors","gutter-tooltip.aria-label.warning.singular":"warning","gutter-tooltip.aria-label.warning.plural":"warnings","gutter-tooltip.aria-label.info.singular":"information message","gutter-tooltip.aria-label.info.plural":"information messages","gutter.annotation.aria-label.security":"Security finding, read annotations row $0","gutter.annotation.aria-label.hint":"Suggestion, read annotations row $0","gutter-tooltip.aria-label.security.singular":"security finding","gutter-tooltip.aria-label.security.plural":"security findings","gutter-tooltip.aria-label.hint.singular":"suggestion","gutter-tooltip.aria-label.hint.plural":"suggestions"};n.defaultEnglishMessages=d}),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/report_error","ace/lib/default_english_messages"],function(t,n,p){"no use strict";var d=t("./oop"),g=t("./event_emitter").EventEmitter,m=t("./report_error").reportError,c=t("./default_english_messages").defaultEnglishMessages,f={setOptions:function(i){Object.keys(i).forEach(function(u){this.setOption(u,i[u])},this)},getOptions:function(i){var u={};if(i)Array.isArray(i)||(u=i,i=Object.keys(u));else{var h=this.$options;i=Object.keys(h).filter(function(y){return!h[y].hidden})}return i.forEach(function(y){u[y]=this.getOption(y)},this),u},setOption:function(i,u){if(this["$"+i]!==u){var h=this.$options[i];if(!h)return r('misspelled option "'+i+'"');if(h.forwardTo)return this[h.forwardTo]&&this[h.forwardTo].setOption(i,u);h.handlesSet||(this["$"+i]=u),h&&h.set&&h.set.call(this,u)}},getOption:function(i){var u=this.$options[i];return u?u.forwardTo?this[u.forwardTo]&&this[u.forwardTo].getOption(i):u&&u.get?u.get.call(this):this["$"+i]:r('misspelled option "'+i+'"')}};function r(i){typeof console<"u"&&console.warn&&console.warn.apply(console,arguments)}var o,s,a=(function(){function i(){this.$defaultOptions={},o=c,s="dollarSigns"}return i.prototype.defineOptions=function(u,h,y){return u.$options||(this.$defaultOptions[h]=u.$options={}),Object.keys(y).forEach(function(b){var T=y[b];typeof T=="string"&&(T={forwardTo:T}),T.name||(T.name=b),u.$options[T.name]=T,"initialValue"in T&&(u["$"+T.name]=T.initialValue)}),d.implement(u,f),this},i.prototype.resetOptions=function(u){Object.keys(u.$options).forEach(function(h){var y=u.$options[h];"value"in y&&u.setOption(h,y.value)})},i.prototype.setDefaultValue=function(u,h,y){if(!u){for(u in this.$defaultOptions)if(this.$defaultOptions[u][h])break;if(!this.$defaultOptions[u][h])return!1}var b=this.$defaultOptions[u]||(this.$defaultOptions[u]={});b[h]&&(b.forwardTo?this.setDefaultValue(b.forwardTo,h,y):b[h].value=y)},i.prototype.setDefaultValues=function(u,h){Object.keys(h).forEach(function(y){this.setDefaultValue(u,y,h[y])},this)},i.prototype.setMessages=function(u,h){o=u,h&&h.placeholders&&(s=h.placeholders)},i.prototype.nls=function(u,h,y){o[u]||(r("No message found for the key '"+u+"' in the provided messages, trying to find a translation for the default string '"+h+"'."),o[h]||r("No message found for the default string '"+h+"' in the provided messages. Falling back to the default English message."));var b=o[u]||o[h]||h;return y&&(s==="dollarSigns"&&(b=b.replace(/\$(\$|[\d]+)/g,function(T,$){return $=="$"?"$":y[$]})),s==="curlyBrackets"&&(b=b.replace(/\{([^\}]+)\}/g,function(T,$){return y[$]}))),b},i})();a.prototype.warn=r,a.prototype.reportError=m,d.implement(a.prototype,g),n.AppConfig=a}),ace.define("ace/theme/textmate-css",["require","exports","module"],function(t,n,p){p.exports=`.ace-tm .ace_gutter {
1172
1172
  background: #f0f0f0;
1173
1173
  color: #333;
1174
1174
  }
@@ -1326,49 +1326,49 @@ export const FormManager: React.FC = () => {
1326
1326
  .ace-tm .ace_indent-guide-active {
1327
1327
  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
1328
1328
  }
1329
- `}),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],function(t,n,p){n.isDark=!1,n.cssClass="ace-tm",n.cssText=t("./textmate-css"),n.$id="ace/theme/textmate";var d=t("../lib/dom");d.importCssString(n.cssText,n.cssClass,!1)}),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/net","ace/lib/dom","ace/lib/app_config","ace/theme/textmate"],function(t,n,p){"no use strict";var d=t("./lib/lang"),g=t("./lib/net"),m=t("./lib/dom"),l=t("./lib/app_config").AppConfig;p.exports=n=new l;var f={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};n.get=function(a){if(!f.hasOwnProperty(a))throw new Error("Unknown config key: "+a);return f[a]},n.set=function(a,i){if(f.hasOwnProperty(a))f[a]=i;else if(this.setDefaultValue("",a,i)==!1)throw new Error("Unknown config key: "+a);a=="useStrictCSP"&&m.useStrictCSP(i)},n.all=function(){return d.copyObject(f)},n.$modes={},n.moduleUrl=function(a,i){if(f.$moduleUrls[a])return f.$moduleUrls[a];var u=a.split("/");i=i||u[u.length-2]||"";var h=i=="snippets"?"/":"-",y=u[u.length-1];if(i=="worker"&&h=="-"){var b=new RegExp("^"+i+"[\\-_]|[\\-_]"+i+"$","g");y=y.replace(b,"")}(!y||y==i)&&u.length>1&&(y=u[u.length-2]);var T=f[i+"Path"];return T==null?T=f.basePath:h=="/"&&(i=h=""),T&&T.slice(-1)!="/"&&(T+="/"),T+i+h+y+this.get("suffix")},n.setModuleUrl=function(a,i){return f.$moduleUrls[a]=i};var r=function(a,i){if(a==="ace/theme/textmate"||a==="./theme/textmate")return i(null,t("./theme/textmate"));if(o)return o(a,i);console.error("loader is not configured")},o;n.setLoader=function(a){o=a},n.dynamicModules=Object.create(null),n.$loading={},n.$loaded={},n.loadModule=function(a,i){var u;if(Array.isArray(a))var h=a[0],y=a[1];else if(typeof a=="string")var y=a;var b=function(T){if(T&&!n.$loading[y])return i&&i(T);if(n.$loading[y]||(n.$loading[y]=[]),n.$loading[y].push(i),!(n.$loading[y].length>1)){var $=function(){r(y,function(A,S){S&&(n.$loaded[y]=S),n._emit("load.module",{name:y,module:S});var M=n.$loading[y];n.$loading[y]=null,M.forEach(function(R){R&&R(S)})})};if(!n.get("packaged"))return $();g.loadScript(n.moduleUrl(y,h),$),s()}};if(n.dynamicModules[y])n.dynamicModules[y]().then(function(T){T.default?b(T.default):b(T)});else{try{u=this.$require(y)}catch{}b(u||n.$loaded[y])}},n.$require=function(a){if(typeof p.require=="function"){var i="require";return p[i](a)}},n.setModuleLoader=function(a,i){n.dynamicModules[a]=i};var s=function(){!f.basePath&&!f.workerPath&&!f.modePath&&!f.themePath&&!Object.keys(f.$moduleUrls).length&&(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),s=function(){})};n.version="1.36.5"}),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(t,n,p){t("./lib/fixoldbrowsers");var d=t("./config");d.setLoader(function(f,r){t([f],function(o){r(null,o)})});var g=(function(){return this||typeof window<"u"&&window})();p.exports=function(f){d.init=m,d.$require=t,f.require=t},m(!0);function m(f){if(!(!g||!g.document)){d.set("packaged",f||t.packaged||p.packaged||g.define&&(void 0).packaged);var r={},o="",s=document.currentScript||document._currentScript,a=s&&s.ownerDocument||document;s&&s.src&&(o=s.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var i=a.getElementsByTagName("script"),u=0;u<i.length;u++){var h=i[u],y=h.src||h.getAttribute("src");if(y){for(var b=h.attributes,T=0,$=b.length;T<$;T++){var A=b[T];A.name.indexOf("data-ace-")===0&&(r[l(A.name.replace(/^data-ace-/,""))]=A.value)}var S=y.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);S&&(o=S[1])}}o&&(r.base=r.base||o,r.packaged=!0),r.basePath=r.base,r.workerPath=r.workerPath||r.base,r.modePath=r.modePath||r.base,r.themePath=r.themePath||r.base,delete r.base;for(var M in r)typeof r[M]<"u"&&d.set(M,r[M])}}function l(f){return f.replace(/-(.)/g,function(r,o){return o.toUpperCase()})}}),ace.define("ace/range",["require","exports","module"],function(t,n,p){var d=(function(){function g(m,l,f,r){this.start={row:m,column:l},this.end={row:f,column:r}}return g.prototype.isEqual=function(m){return this.start.row===m.start.row&&this.end.row===m.end.row&&this.start.column===m.start.column&&this.end.column===m.end.column},g.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},g.prototype.contains=function(m,l){return this.compare(m,l)==0},g.prototype.compareRange=function(m){var l,f=m.end,r=m.start;return l=this.compare(f.row,f.column),l==1?(l=this.compare(r.row,r.column),l==1?2:l==0?1:0):l==-1?-2:(l=this.compare(r.row,r.column),l==-1?-1:l==1?42:0)},g.prototype.comparePoint=function(m){return this.compare(m.row,m.column)},g.prototype.containsRange=function(m){return this.comparePoint(m.start)==0&&this.comparePoint(m.end)==0},g.prototype.intersects=function(m){var l=this.compareRange(m);return l==-1||l==0||l==1},g.prototype.isEnd=function(m,l){return this.end.row==m&&this.end.column==l},g.prototype.isStart=function(m,l){return this.start.row==m&&this.start.column==l},g.prototype.setStart=function(m,l){typeof m=="object"?(this.start.column=m.column,this.start.row=m.row):(this.start.row=m,this.start.column=l)},g.prototype.setEnd=function(m,l){typeof m=="object"?(this.end.column=m.column,this.end.row=m.row):(this.end.row=m,this.end.column=l)},g.prototype.inside=function(m,l){return this.compare(m,l)==0?!(this.isEnd(m,l)||this.isStart(m,l)):!1},g.prototype.insideStart=function(m,l){return this.compare(m,l)==0?!this.isEnd(m,l):!1},g.prototype.insideEnd=function(m,l){return this.compare(m,l)==0?!this.isStart(m,l):!1},g.prototype.compare=function(m,l){return!this.isMultiLine()&&m===this.start.row?l<this.start.column?-1:l>this.end.column?1:0:m<this.start.row?-1:m>this.end.row?1:this.start.row===m?l>=this.start.column?0:-1:this.end.row===m?l<=this.end.column?0:1:0},g.prototype.compareStart=function(m,l){return this.start.row==m&&this.start.column==l?-1:this.compare(m,l)},g.prototype.compareEnd=function(m,l){return this.end.row==m&&this.end.column==l?1:this.compare(m,l)},g.prototype.compareInside=function(m,l){return this.end.row==m&&this.end.column==l?1:this.start.row==m&&this.start.column==l?-1:this.compare(m,l)},g.prototype.clipRows=function(m,l){if(this.end.row>l)var f={row:l+1,column:0};else if(this.end.row<m)var f={row:m,column:0};if(this.start.row>l)var r={row:l+1,column:0};else if(this.start.row<m)var r={row:m,column:0};return g.fromPoints(r||this.start,f||this.end)},g.prototype.extend=function(m,l){var f=this.compare(m,l);if(f==0)return this;if(f==-1)var r={row:m,column:l};else var o={row:m,column:l};return g.fromPoints(r||this.start,o||this.end)},g.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},g.prototype.isMultiLine=function(){return this.start.row!==this.end.row},g.prototype.clone=function(){return g.fromPoints(this.start,this.end)},g.prototype.collapseRows=function(){return this.end.column==0?new g(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new g(this.start.row,0,this.end.row,0)},g.prototype.toScreenRange=function(m){var l=m.documentToScreenPosition(this.start),f=m.documentToScreenPosition(this.end);return new g(l.row,l.column,f.row,f.column)},g.prototype.moveBy=function(m,l){this.start.row+=m,this.start.column+=l,this.end.row+=m,this.end.column+=l},g})();d.fromPoints=function(g,m){return new d(g.row,g.column,m.row,m.column)},d.comparePoints=function(g,m){return g.row-m.row||g.column-m.column},n.Range=d}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(t,n,p){for(var d=t("./oop"),g={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete","-13":"NumpadEnter",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",59:";",61:"=",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}},m={Command:224,Backspace:8,Tab:9,Return:13,Enter:13,Pause:19,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,Insert:45,Delete:46,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Backquote:192,Minus:189,Equal:187,BracketLeft:219,Backslash:220,BracketRight:221,Semicolon:186,Quote:222,Comma:188,Period:190,Slash:191,Space:32,NumpadAdd:107,NumpadDecimal:110,NumpadSubtract:109,NumpadDivide:111,NumpadMultiply:106},l=0;l<10;l++)m["Digit"+l]=48+l,m["Numpad"+l]=96+l,g.PRINTABLE_KEYS[48+l]=""+l,g.FUNCTION_KEYS[96+l]="Numpad"+l;for(var l=65;l<91;l++){var f=String.fromCharCode(l+32);m["Key"+f.toUpperCase()]=l,g.PRINTABLE_KEYS[l]=f}for(var l=1;l<13;l++)m["F"+l]=111+l,g.FUNCTION_KEYS[111+l]="F"+l;var r={Shift:16,Control:17,Alt:18,Meta:224};for(var o in r)m[o]=m[o+"Left"]=m[o+"Right"]=r[o];n.$codeToKeyCode=m,g.PRINTABLE_KEYS[173]="-";for(var s in g.FUNCTION_KEYS){var a=g.FUNCTION_KEYS[s].toLowerCase();g[a]=parseInt(s,10)}for(var s in g.PRINTABLE_KEYS){var a=g.PRINTABLE_KEYS[s].toLowerCase();g[a]=parseInt(s,10)}d.mixin(g,g.MODIFIER_KEYS),d.mixin(g,g.PRINTABLE_KEYS),d.mixin(g,g.FUNCTION_KEYS),g.enter=g.return,g.escape=g.esc,g.del=g.delete,(function(){for(var i=["cmd","ctrl","alt","shift"],u=Math.pow(2,i.length);u--;)g.KEY_MODS[u]=i.filter(function(h){return u&g.KEY_MODS[h]}).join("-")+"-"})(),g.KEY_MODS[0]="",g.KEY_MODS[-1]="input-",d.mixin(n,g),n.default=n,n.keyCodeToString=function(i){var u=g[i];return typeof u!="string"&&(u=String.fromCharCode(i)),u.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,n,p){var d=t("./keys"),g=t("./useragent"),m=null,l=0,f;function r(){f=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){return f={passive:!1},!0}})}catch{}}function o(){return f==null&&r(),f}function s(T,$,A){this.elem=T,this.type=$,this.callback=A}s.prototype.destroy=function(){i(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var a=n.addListener=function(T,$,A,S){T.addEventListener($,A,o()),S&&S.$toDestroy.push(new s(T,$,A))},i=n.removeListener=function(T,$,A){T.removeEventListener($,A,o())};n.stopEvent=function(T){return n.stopPropagation(T),n.preventDefault(T),!1},n.stopPropagation=function(T){T.stopPropagation&&T.stopPropagation()},n.preventDefault=function(T){T.preventDefault&&T.preventDefault()},n.getButton=function(T){return T.type=="dblclick"?0:T.type=="contextmenu"||g.isMac&&T.ctrlKey&&!T.altKey&&!T.shiftKey?2:T.button},n.capture=function(T,$,A){var S=T&&T.ownerDocument||document;function M(R){$&&$(R),A&&A(R),i(S,"mousemove",$),i(S,"mouseup",M),i(S,"dragstart",M)}return a(S,"mousemove",$),a(S,"mouseup",M),a(S,"dragstart",M),M},n.addMouseWheelListener=function(T,$,A){a(T,"wheel",function(S){var M=.15,R=S.deltaX||0,L=S.deltaY||0;switch(S.deltaMode){case S.DOM_DELTA_PIXEL:S.wheelX=R*M,S.wheelY=L*M;break;case S.DOM_DELTA_LINE:var _=15;S.wheelX=R*_,S.wheelY=L*_;break;case S.DOM_DELTA_PAGE:var I=150;S.wheelX=R*I,S.wheelY=L*I;break}$(S)},A)},n.addMultiMouseDownListener=function(T,$,A,S,M){var R=0,L,_,I,w={2:"dblclick",3:"tripleclick",4:"quadclick"};function v(C){if(n.getButton(C)!==0?R=0:C.detail>1?(R++,R>4&&(R=1)):R=1,g.isIE){var E=Math.abs(C.clientX-L)>5||Math.abs(C.clientY-_)>5;(!I||E)&&(R=1),I&&clearTimeout(I),I=setTimeout(function(){I=null},$[R-1]||600),R==1&&(L=C.clientX,_=C.clientY)}if(C._clicks=R,A[S]("mousedown",C),R>4)R=0;else if(R>1)return A[S](w[R],C)}Array.isArray(T)||(T=[T]),T.forEach(function(C){a(C,"mousedown",v,M)})};function u(T){return 0|(T.ctrlKey?1:0)|(T.altKey?2:0)|(T.shiftKey?4:0)|(T.metaKey?8:0)}n.getModifierString=function(T){return d.KEY_MODS[u(T)]};function h(T,$,A){var S=u($);if(!A&&$.code&&(A=d.$codeToKeyCode[$.code]||A),!g.isMac&&m){if($.getModifierState&&($.getModifierState("OS")||$.getModifierState("Win"))&&(S|=8),m.altGr)if((3&S)!=3)m.altGr=0;else return;if(A===18||A===17){var M=$.location;if(A===17&&M===1)m[A]==1&&(l=$.timeStamp);else if(A===18&&S===3&&M===2){var R=$.timeStamp-l;R<50&&(m.altGr=!0)}}}if(A in d.MODIFIER_KEYS&&(A=-1),!(!S&&A===13&&$.location===3&&(T($,S,-A),$.defaultPrevented))){if(g.isChromeOS&&S&8){if(T($,S,A),$.defaultPrevented)return;S&=-9}return!S&&!(A in d.FUNCTION_KEYS)&&!(A in d.PRINTABLE_KEYS)?!1:T($,S,A)}}n.addCommandKeyListener=function(T,$,A){var S=null;a(T,"keydown",function(M){m[M.keyCode]=(m[M.keyCode]||0)+1;var R=h($,M,M.keyCode);return S=M.defaultPrevented,R},A),a(T,"keypress",function(M){S&&(M.ctrlKey||M.altKey||M.shiftKey||M.metaKey)&&(n.stopEvent(M),S=null)},A),a(T,"keyup",function(M){m[M.keyCode]=null},A),m||(y(),a(window,"focus",y))};function y(){m=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!g.isOldIE){var b=1;n.nextTick=function(T,$){$=$||window;var A="zero-timeout-message-"+b++,S=function(M){M.data==A&&(n.stopPropagation(M),i($,"message",S),T())};a($,"message",S),$.postMessage(A,"*")}}n.$idleBlocked=!1,n.onIdle=function(T,$){return setTimeout(function A(){n.$idleBlocked?setTimeout(A,100):T()},$)},n.$idleBlockId=null,n.blockIdle=function(T){n.$idleBlockId&&clearTimeout(n.$idleBlockId),n.$idleBlocked=!0,n.$idleBlockId=setTimeout(function(){n.$idleBlocked=!1},T||100)},n.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),n.nextFrame?n.nextFrame=n.nextFrame.bind(window):n.nextFrame=function(T){setTimeout(T,17)}}),ace.define("ace/clipboard",["require","exports","module"],function(t,n,p){var d;p.exports={lineMode:!1,pasteCancelled:function(){return d&&d>Date.now()-50?!0:d=!1},cancel:function(){d=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/config","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(t,n,p){var d=t("../lib/event"),g=t("../config").nls,m=t("../lib/useragent"),l=t("../lib/dom"),f=t("../lib/lang"),r=t("../clipboard"),o=m.isChrome<18,s=m.isIE,a=m.isChrome>63,i=400,u=t("../lib/keys"),h=u.KEY_MODS,y=m.isIOS,b=y?/\s/:/\n/,T=m.isMobile,$;$=function(A,S){var M=l.createElement("textarea");M.className="ace_text-input",M.setAttribute("wrap","off"),M.setAttribute("autocorrect","off"),M.setAttribute("autocapitalize","off"),M.setAttribute("spellcheck","false"),M.style.opacity="0",A.insertBefore(M,A.firstChild);var R=!1,L=!1,_=!1,I=!1,w="";T||(M.style.fontSize="1px");var v=!1,C=!1,E="",x=0,k=0,O=0,D=Number.MAX_SAFE_INTEGER,N=Number.MIN_SAFE_INTEGER,P=0;try{var z=document.activeElement===M}catch{}this.setNumberOfExtraLines=function(j){if(D=Number.MAX_SAFE_INTEGER,N=Number.MIN_SAFE_INTEGER,j<0){P=0;return}P=j},this.setAriaLabel=function(){var j="";if(S.$textInputAriaLabel&&(j+="".concat(S.$textInputAriaLabel,", ")),S.session){var X=S.session.selection.cursor.row;j+=g("text-input.aria-label","Cursor at row $0",[X+1])}M.setAttribute("aria-label",j)},this.setAriaOptions=function(j){j.activeDescendant?(M.setAttribute("aria-haspopup","true"),M.setAttribute("aria-autocomplete",j.inline?"both":"list"),M.setAttribute("aria-activedescendant",j.activeDescendant)):(M.setAttribute("aria-haspopup","false"),M.setAttribute("aria-autocomplete","both"),M.removeAttribute("aria-activedescendant")),j.role&&M.setAttribute("role",j.role),j.setLabel&&(M.setAttribute("aria-roledescription",g("text-input.aria-roledescription","editor")),this.setAriaLabel())},this.setAriaOptions({role:"textbox"}),d.addListener(M,"blur",function(j){C||(S.onBlur(j),z=!1)},S),d.addListener(M,"focus",function(j){if(!C){if(z=!0,m.isEdge)try{if(!document.hasFocus())return}catch{}S.onFocus(j),m.isEdge?setTimeout(W):W()}},S),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:S.renderer.enableKeyboardAccessibility}),w||a||this.$focusScroll=="browser")return M.focus({preventScroll:!0});var j=M.style.top;M.style.position="fixed",M.style.top="0px";try{var X=M.getBoundingClientRect().top!=0}catch{return}var J=[];if(X)for(var ie=M.parentElement;ie&&ie.nodeType==1;)J.push(ie),ie.setAttribute("ace_nocontext","true"),!ie.parentElement&&ie.getRootNode?ie=ie.getRootNode().host:ie=ie.parentElement;M.focus({preventScroll:!0}),X&&J.forEach(function(se){se.removeAttribute("ace_nocontext")}),setTimeout(function(){M.style.position="",M.style.top=="0px"&&(M.style.top=j)},0)},this.blur=function(){M.blur()},this.isFocused=function(){return z},S.on("beforeEndOperation",function(){var j=S.curOp,X=j&&j.command&&j.command.name;if(X!="insertstring"){var J=X&&(j.docChanged||j.selectionChanged);_&&J&&(E=M.value="",ut()),W()}}),S.on("changeSelection",this.setAriaLabel);var F=function(j,X){for(var J=X,ie=1;ie<=j-D&&ie<2*P+1;ie++)J+=S.session.getLine(j-ie).length+1;return J},W=y?function(j){if(!(!z||R&&!j||I)){j||(j="");var X=`
1329
+ `}),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],function(t,n,p){n.isDark=!1,n.cssClass="ace-tm",n.cssText=t("./textmate-css"),n.$id="ace/theme/textmate";var d=t("../lib/dom");d.importCssString(n.cssText,n.cssClass,!1)}),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/net","ace/lib/dom","ace/lib/app_config","ace/theme/textmate"],function(t,n,p){"no use strict";var d=t("./lib/lang"),g=t("./lib/net"),m=t("./lib/dom"),c=t("./lib/app_config").AppConfig;p.exports=n=new c;var f={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};n.get=function(a){if(!f.hasOwnProperty(a))throw new Error("Unknown config key: "+a);return f[a]},n.set=function(a,i){if(f.hasOwnProperty(a))f[a]=i;else if(this.setDefaultValue("",a,i)==!1)throw new Error("Unknown config key: "+a);a=="useStrictCSP"&&m.useStrictCSP(i)},n.all=function(){return d.copyObject(f)},n.$modes={},n.moduleUrl=function(a,i){if(f.$moduleUrls[a])return f.$moduleUrls[a];var u=a.split("/");i=i||u[u.length-2]||"";var h=i=="snippets"?"/":"-",y=u[u.length-1];if(i=="worker"&&h=="-"){var b=new RegExp("^"+i+"[\\-_]|[\\-_]"+i+"$","g");y=y.replace(b,"")}(!y||y==i)&&u.length>1&&(y=u[u.length-2]);var T=f[i+"Path"];return T==null?T=f.basePath:h=="/"&&(i=h=""),T&&T.slice(-1)!="/"&&(T+="/"),T+i+h+y+this.get("suffix")},n.setModuleUrl=function(a,i){return f.$moduleUrls[a]=i};var r=function(a,i){if(a==="ace/theme/textmate"||a==="./theme/textmate")return i(null,t("./theme/textmate"));if(o)return o(a,i);console.error("loader is not configured")},o;n.setLoader=function(a){o=a},n.dynamicModules=Object.create(null),n.$loading={},n.$loaded={},n.loadModule=function(a,i){var u;if(Array.isArray(a))var h=a[0],y=a[1];else if(typeof a=="string")var y=a;var b=function(T){if(T&&!n.$loading[y])return i&&i(T);if(n.$loading[y]||(n.$loading[y]=[]),n.$loading[y].push(i),!(n.$loading[y].length>1)){var $=function(){r(y,function(A,S){S&&(n.$loaded[y]=S),n._emit("load.module",{name:y,module:S});var M=n.$loading[y];n.$loading[y]=null,M.forEach(function(R){R&&R(S)})})};if(!n.get("packaged"))return $();g.loadScript(n.moduleUrl(y,h),$),s()}};if(n.dynamicModules[y])n.dynamicModules[y]().then(function(T){T.default?b(T.default):b(T)});else{try{u=this.$require(y)}catch{}b(u||n.$loaded[y])}},n.$require=function(a){if(typeof p.require=="function"){var i="require";return p[i](a)}},n.setModuleLoader=function(a,i){n.dynamicModules[a]=i};var s=function(){!f.basePath&&!f.workerPath&&!f.modePath&&!f.themePath&&!Object.keys(f.$moduleUrls).length&&(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),s=function(){})};n.version="1.36.5"}),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(t,n,p){t("./lib/fixoldbrowsers");var d=t("./config");d.setLoader(function(f,r){t([f],function(o){r(null,o)})});var g=(function(){return this||typeof window<"u"&&window})();p.exports=function(f){d.init=m,d.$require=t,f.require=t},m(!0);function m(f){if(!(!g||!g.document)){d.set("packaged",f||t.packaged||p.packaged||g.define&&(void 0).packaged);var r={},o="",s=document.currentScript||document._currentScript,a=s&&s.ownerDocument||document;s&&s.src&&(o=s.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var i=a.getElementsByTagName("script"),u=0;u<i.length;u++){var h=i[u],y=h.src||h.getAttribute("src");if(y){for(var b=h.attributes,T=0,$=b.length;T<$;T++){var A=b[T];A.name.indexOf("data-ace-")===0&&(r[c(A.name.replace(/^data-ace-/,""))]=A.value)}var S=y.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);S&&(o=S[1])}}o&&(r.base=r.base||o,r.packaged=!0),r.basePath=r.base,r.workerPath=r.workerPath||r.base,r.modePath=r.modePath||r.base,r.themePath=r.themePath||r.base,delete r.base;for(var M in r)typeof r[M]<"u"&&d.set(M,r[M])}}function c(f){return f.replace(/-(.)/g,function(r,o){return o.toUpperCase()})}}),ace.define("ace/range",["require","exports","module"],function(t,n,p){var d=(function(){function g(m,c,f,r){this.start={row:m,column:c},this.end={row:f,column:r}}return g.prototype.isEqual=function(m){return this.start.row===m.start.row&&this.end.row===m.end.row&&this.start.column===m.start.column&&this.end.column===m.end.column},g.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},g.prototype.contains=function(m,c){return this.compare(m,c)==0},g.prototype.compareRange=function(m){var c,f=m.end,r=m.start;return c=this.compare(f.row,f.column),c==1?(c=this.compare(r.row,r.column),c==1?2:c==0?1:0):c==-1?-2:(c=this.compare(r.row,r.column),c==-1?-1:c==1?42:0)},g.prototype.comparePoint=function(m){return this.compare(m.row,m.column)},g.prototype.containsRange=function(m){return this.comparePoint(m.start)==0&&this.comparePoint(m.end)==0},g.prototype.intersects=function(m){var c=this.compareRange(m);return c==-1||c==0||c==1},g.prototype.isEnd=function(m,c){return this.end.row==m&&this.end.column==c},g.prototype.isStart=function(m,c){return this.start.row==m&&this.start.column==c},g.prototype.setStart=function(m,c){typeof m=="object"?(this.start.column=m.column,this.start.row=m.row):(this.start.row=m,this.start.column=c)},g.prototype.setEnd=function(m,c){typeof m=="object"?(this.end.column=m.column,this.end.row=m.row):(this.end.row=m,this.end.column=c)},g.prototype.inside=function(m,c){return this.compare(m,c)==0?!(this.isEnd(m,c)||this.isStart(m,c)):!1},g.prototype.insideStart=function(m,c){return this.compare(m,c)==0?!this.isEnd(m,c):!1},g.prototype.insideEnd=function(m,c){return this.compare(m,c)==0?!this.isStart(m,c):!1},g.prototype.compare=function(m,c){return!this.isMultiLine()&&m===this.start.row?c<this.start.column?-1:c>this.end.column?1:0:m<this.start.row?-1:m>this.end.row?1:this.start.row===m?c>=this.start.column?0:-1:this.end.row===m?c<=this.end.column?0:1:0},g.prototype.compareStart=function(m,c){return this.start.row==m&&this.start.column==c?-1:this.compare(m,c)},g.prototype.compareEnd=function(m,c){return this.end.row==m&&this.end.column==c?1:this.compare(m,c)},g.prototype.compareInside=function(m,c){return this.end.row==m&&this.end.column==c?1:this.start.row==m&&this.start.column==c?-1:this.compare(m,c)},g.prototype.clipRows=function(m,c){if(this.end.row>c)var f={row:c+1,column:0};else if(this.end.row<m)var f={row:m,column:0};if(this.start.row>c)var r={row:c+1,column:0};else if(this.start.row<m)var r={row:m,column:0};return g.fromPoints(r||this.start,f||this.end)},g.prototype.extend=function(m,c){var f=this.compare(m,c);if(f==0)return this;if(f==-1)var r={row:m,column:c};else var o={row:m,column:c};return g.fromPoints(r||this.start,o||this.end)},g.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},g.prototype.isMultiLine=function(){return this.start.row!==this.end.row},g.prototype.clone=function(){return g.fromPoints(this.start,this.end)},g.prototype.collapseRows=function(){return this.end.column==0?new g(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new g(this.start.row,0,this.end.row,0)},g.prototype.toScreenRange=function(m){var c=m.documentToScreenPosition(this.start),f=m.documentToScreenPosition(this.end);return new g(c.row,c.column,f.row,f.column)},g.prototype.moveBy=function(m,c){this.start.row+=m,this.start.column+=c,this.end.row+=m,this.end.column+=c},g})();d.fromPoints=function(g,m){return new d(g.row,g.column,m.row,m.column)},d.comparePoints=function(g,m){return g.row-m.row||g.column-m.column},n.Range=d}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(t,n,p){for(var d=t("./oop"),g={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete","-13":"NumpadEnter",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",59:";",61:"=",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}},m={Command:224,Backspace:8,Tab:9,Return:13,Enter:13,Pause:19,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,Insert:45,Delete:46,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Backquote:192,Minus:189,Equal:187,BracketLeft:219,Backslash:220,BracketRight:221,Semicolon:186,Quote:222,Comma:188,Period:190,Slash:191,Space:32,NumpadAdd:107,NumpadDecimal:110,NumpadSubtract:109,NumpadDivide:111,NumpadMultiply:106},c=0;c<10;c++)m["Digit"+c]=48+c,m["Numpad"+c]=96+c,g.PRINTABLE_KEYS[48+c]=""+c,g.FUNCTION_KEYS[96+c]="Numpad"+c;for(var c=65;c<91;c++){var f=String.fromCharCode(c+32);m["Key"+f.toUpperCase()]=c,g.PRINTABLE_KEYS[c]=f}for(var c=1;c<13;c++)m["F"+c]=111+c,g.FUNCTION_KEYS[111+c]="F"+c;var r={Shift:16,Control:17,Alt:18,Meta:224};for(var o in r)m[o]=m[o+"Left"]=m[o+"Right"]=r[o];n.$codeToKeyCode=m,g.PRINTABLE_KEYS[173]="-";for(var s in g.FUNCTION_KEYS){var a=g.FUNCTION_KEYS[s].toLowerCase();g[a]=parseInt(s,10)}for(var s in g.PRINTABLE_KEYS){var a=g.PRINTABLE_KEYS[s].toLowerCase();g[a]=parseInt(s,10)}d.mixin(g,g.MODIFIER_KEYS),d.mixin(g,g.PRINTABLE_KEYS),d.mixin(g,g.FUNCTION_KEYS),g.enter=g.return,g.escape=g.esc,g.del=g.delete,(function(){for(var i=["cmd","ctrl","alt","shift"],u=Math.pow(2,i.length);u--;)g.KEY_MODS[u]=i.filter(function(h){return u&g.KEY_MODS[h]}).join("-")+"-"})(),g.KEY_MODS[0]="",g.KEY_MODS[-1]="input-",d.mixin(n,g),n.default=n,n.keyCodeToString=function(i){var u=g[i];return typeof u!="string"&&(u=String.fromCharCode(i)),u.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,n,p){var d=t("./keys"),g=t("./useragent"),m=null,c=0,f;function r(){f=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){return f={passive:!1},!0}})}catch{}}function o(){return f==null&&r(),f}function s(T,$,A){this.elem=T,this.type=$,this.callback=A}s.prototype.destroy=function(){i(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var a=n.addListener=function(T,$,A,S){T.addEventListener($,A,o()),S&&S.$toDestroy.push(new s(T,$,A))},i=n.removeListener=function(T,$,A){T.removeEventListener($,A,o())};n.stopEvent=function(T){return n.stopPropagation(T),n.preventDefault(T),!1},n.stopPropagation=function(T){T.stopPropagation&&T.stopPropagation()},n.preventDefault=function(T){T.preventDefault&&T.preventDefault()},n.getButton=function(T){return T.type=="dblclick"?0:T.type=="contextmenu"||g.isMac&&T.ctrlKey&&!T.altKey&&!T.shiftKey?2:T.button},n.capture=function(T,$,A){var S=T&&T.ownerDocument||document;function M(R){$&&$(R),A&&A(R),i(S,"mousemove",$),i(S,"mouseup",M),i(S,"dragstart",M)}return a(S,"mousemove",$),a(S,"mouseup",M),a(S,"dragstart",M),M},n.addMouseWheelListener=function(T,$,A){a(T,"wheel",function(S){var M=.15,R=S.deltaX||0,L=S.deltaY||0;switch(S.deltaMode){case S.DOM_DELTA_PIXEL:S.wheelX=R*M,S.wheelY=L*M;break;case S.DOM_DELTA_LINE:var _=15;S.wheelX=R*_,S.wheelY=L*_;break;case S.DOM_DELTA_PAGE:var O=150;S.wheelX=R*O,S.wheelY=L*O;break}$(S)},A)},n.addMultiMouseDownListener=function(T,$,A,S,M){var R=0,L,_,O,w={2:"dblclick",3:"tripleclick",4:"quadclick"};function v(C){if(n.getButton(C)!==0?R=0:C.detail>1?(R++,R>4&&(R=1)):R=1,g.isIE){var E=Math.abs(C.clientX-L)>5||Math.abs(C.clientY-_)>5;(!O||E)&&(R=1),O&&clearTimeout(O),O=setTimeout(function(){O=null},$[R-1]||600),R==1&&(L=C.clientX,_=C.clientY)}if(C._clicks=R,A[S]("mousedown",C),R>4)R=0;else if(R>1)return A[S](w[R],C)}Array.isArray(T)||(T=[T]),T.forEach(function(C){a(C,"mousedown",v,M)})};function u(T){return 0|(T.ctrlKey?1:0)|(T.altKey?2:0)|(T.shiftKey?4:0)|(T.metaKey?8:0)}n.getModifierString=function(T){return d.KEY_MODS[u(T)]};function h(T,$,A){var S=u($);if(!A&&$.code&&(A=d.$codeToKeyCode[$.code]||A),!g.isMac&&m){if($.getModifierState&&($.getModifierState("OS")||$.getModifierState("Win"))&&(S|=8),m.altGr)if((3&S)!=3)m.altGr=0;else return;if(A===18||A===17){var M=$.location;if(A===17&&M===1)m[A]==1&&(c=$.timeStamp);else if(A===18&&S===3&&M===2){var R=$.timeStamp-c;R<50&&(m.altGr=!0)}}}if(A in d.MODIFIER_KEYS&&(A=-1),!(!S&&A===13&&$.location===3&&(T($,S,-A),$.defaultPrevented))){if(g.isChromeOS&&S&8){if(T($,S,A),$.defaultPrevented)return;S&=-9}return!S&&!(A in d.FUNCTION_KEYS)&&!(A in d.PRINTABLE_KEYS)?!1:T($,S,A)}}n.addCommandKeyListener=function(T,$,A){var S=null;a(T,"keydown",function(M){m[M.keyCode]=(m[M.keyCode]||0)+1;var R=h($,M,M.keyCode);return S=M.defaultPrevented,R},A),a(T,"keypress",function(M){S&&(M.ctrlKey||M.altKey||M.shiftKey||M.metaKey)&&(n.stopEvent(M),S=null)},A),a(T,"keyup",function(M){m[M.keyCode]=null},A),m||(y(),a(window,"focus",y))};function y(){m=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!g.isOldIE){var b=1;n.nextTick=function(T,$){$=$||window;var A="zero-timeout-message-"+b++,S=function(M){M.data==A&&(n.stopPropagation(M),i($,"message",S),T())};a($,"message",S),$.postMessage(A,"*")}}n.$idleBlocked=!1,n.onIdle=function(T,$){return setTimeout(function A(){n.$idleBlocked?setTimeout(A,100):T()},$)},n.$idleBlockId=null,n.blockIdle=function(T){n.$idleBlockId&&clearTimeout(n.$idleBlockId),n.$idleBlocked=!0,n.$idleBlockId=setTimeout(function(){n.$idleBlocked=!1},T||100)},n.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),n.nextFrame?n.nextFrame=n.nextFrame.bind(window):n.nextFrame=function(T){setTimeout(T,17)}}),ace.define("ace/clipboard",["require","exports","module"],function(t,n,p){var d;p.exports={lineMode:!1,pasteCancelled:function(){return d&&d>Date.now()-50?!0:d=!1},cancel:function(){d=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/config","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(t,n,p){var d=t("../lib/event"),g=t("../config").nls,m=t("../lib/useragent"),c=t("../lib/dom"),f=t("../lib/lang"),r=t("../clipboard"),o=m.isChrome<18,s=m.isIE,a=m.isChrome>63,i=400,u=t("../lib/keys"),h=u.KEY_MODS,y=m.isIOS,b=y?/\s/:/\n/,T=m.isMobile,$;$=function(A,S){var M=c.createElement("textarea");M.className="ace_text-input",M.setAttribute("wrap","off"),M.setAttribute("autocorrect","off"),M.setAttribute("autocapitalize","off"),M.setAttribute("spellcheck","false"),M.style.opacity="0",A.insertBefore(M,A.firstChild);var R=!1,L=!1,_=!1,O=!1,w="";T||(M.style.fontSize="1px");var v=!1,C=!1,E="",x=0,k=0,D=0,I=Number.MAX_SAFE_INTEGER,N=Number.MIN_SAFE_INTEGER,P=0;try{var z=document.activeElement===M}catch{}this.setNumberOfExtraLines=function(j){if(I=Number.MAX_SAFE_INTEGER,N=Number.MIN_SAFE_INTEGER,j<0){P=0;return}P=j},this.setAriaLabel=function(){var j="";if(S.$textInputAriaLabel&&(j+="".concat(S.$textInputAriaLabel,", ")),S.session){var X=S.session.selection.cursor.row;j+=g("text-input.aria-label","Cursor at row $0",[X+1])}M.setAttribute("aria-label",j)},this.setAriaOptions=function(j){j.activeDescendant?(M.setAttribute("aria-haspopup","true"),M.setAttribute("aria-autocomplete",j.inline?"both":"list"),M.setAttribute("aria-activedescendant",j.activeDescendant)):(M.setAttribute("aria-haspopup","false"),M.setAttribute("aria-autocomplete","both"),M.removeAttribute("aria-activedescendant")),j.role&&M.setAttribute("role",j.role),j.setLabel&&(M.setAttribute("aria-roledescription",g("text-input.aria-roledescription","editor")),this.setAriaLabel())},this.setAriaOptions({role:"textbox"}),d.addListener(M,"blur",function(j){C||(S.onBlur(j),z=!1)},S),d.addListener(M,"focus",function(j){if(!C){if(z=!0,m.isEdge)try{if(!document.hasFocus())return}catch{}S.onFocus(j),m.isEdge?setTimeout(W):W()}},S),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:S.renderer.enableKeyboardAccessibility}),w||a||this.$focusScroll=="browser")return M.focus({preventScroll:!0});var j=M.style.top;M.style.position="fixed",M.style.top="0px";try{var X=M.getBoundingClientRect().top!=0}catch{return}var ee=[];if(X)for(var re=M.parentElement;re&&re.nodeType==1;)ee.push(re),re.setAttribute("ace_nocontext","true"),!re.parentElement&&re.getRootNode?re=re.getRootNode().host:re=re.parentElement;M.focus({preventScroll:!0}),X&&ee.forEach(function(ae){ae.removeAttribute("ace_nocontext")}),setTimeout(function(){M.style.position="",M.style.top=="0px"&&(M.style.top=j)},0)},this.blur=function(){M.blur()},this.isFocused=function(){return z},S.on("beforeEndOperation",function(){var j=S.curOp,X=j&&j.command&&j.command.name;if(X!="insertstring"){var ee=X&&(j.docChanged||j.selectionChanged);_&&ee&&(E=M.value="",ht()),W()}}),S.on("changeSelection",this.setAriaLabel);var F=function(j,X){for(var ee=X,re=1;re<=j-I&&re<2*P+1;re++)ee+=S.session.getLine(j-re).length+1;return ee},W=y?function(j){if(!(!z||R&&!j||O)){j||(j="");var X=`
1330
1330
  ab`+j+`cde fg
1331
- `;X!=M.value&&(M.value=E=X);var J=4,ie=4+(j.length||(S.selection.isEmpty()?0:1));(x!=J||k!=ie)&&M.setSelectionRange(J,ie),x=J,k=ie}}:function(){if(!(_||I)&&!(!z&&!q)){_=!0;var j=0,X=0,J="";if(S.session){var ie=S.selection,se=ie.getRange(),ge=ie.cursor.row;ge===N+1?(D=N+1,N=D+2*P):ge===D-1?(N=D-1,D=N-2*P):(ge<D-1||ge>N+1)&&(D=ge>P?ge-P:0,N=ge>P?ge+P:2*P);for(var ye=[],me=D;me<=N;me++)ye.push(S.session.getLine(me));if(J=ye.join(`
1332
- `),j=F(se.start.row,se.start.column),X=F(se.end.row,se.end.column),se.start.row<D){var de=S.session.getLine(D-1);j=se.start.row<D-1?0:j,X+=de.length+1,J=de+`
1333
- `+J}else if(se.end.row>N){var ae=S.session.getLine(N+1);X=se.end.row>N+1?ae.length:se.end.column,X+=J.length+1,J=J+`
1334
- `+ae}else T&&ge>0&&(J=`
1335
- `+J,X+=1,j+=1);J.length>i&&(j<i&&X<i?J=J.slice(0,i):(J=`
1336
- `,j==X?j=X=0:(j=0,X=1)));var _e=J+`
1337
-
1338
- `;_e!=E&&(M.value=E=_e,x=k=_e.length)}if(q&&(x=M.selectionStart,k=M.selectionEnd),k!=X||x!=j||M.selectionEnd!=k)try{M.setSelectionRange(j,X),x=j,k=X}catch{}_=!1}};this.resetSelection=W,z&&S.onFocus();var H=function(j){return j.selectionStart===0&&j.selectionEnd>=E.length&&j.value===E&&E&&j.selectionEnd!==k},B=function(j){_||(R?R=!1:H(M)?(S.selectAll(),W()):T&&M.selectionStart!=x&&W())},G=null;this.setInputHandler=function(j){G=j},this.getInputHandler=function(){return G};var q=!1,Y=function(j,X){if(q&&(q=!1),L)return W(),j&&S.onPaste(j),L=!1,"";for(var J=M.selectionStart,ie=M.selectionEnd,se=x,ge=E.length-k,ye=j,me=j.length-J,de=j.length-ie,ae=0;se>0&&E[ae]==j[ae];)ae++,se--;for(ye=ye.slice(ae),ae=1;ge>0&&E.length-ae>x-1&&E[E.length-ae]==j[j.length-ae];)ae++,ge--;me-=ae-1,de-=ae-1;var _e=ye.length-ae+1;if(_e<0&&(se=-_e,_e=0),ye=ye.slice(0,_e),!X&&!ye&&!me&&!se&&!ge&&!de)return"";I=!0;var Ot=!1;return m.isAndroid&&ye==". "&&(ye=" ",Ot=!0),ye&&!se&&!ge&&!me&&!de||v?S.onTextInput(ye):S.onTextInput(ye,{extendLeft:se,extendRight:ge,restoreStart:me,restoreEnd:de}),I=!1,E=j,x=J,k=ie,O=de,Ot?`
1339
- `:ye},V=function(j){if(_)return ct();if(j&&j.inputType){if(j.inputType=="historyUndo")return S.execCommand("undo");if(j.inputType=="historyRedo")return S.execCommand("redo")}var X=M.value,J=Y(X,!0);(X.length>i+100||b.test(J)||T&&x<1&&x==k)&&W()},Z=function(j,X,J){var ie=j.clipboardData||window.clipboardData;if(!(!ie||o)){var se=s||J?"Text":"text/plain";try{return X?ie.setData(se,X)!==!1:ie.getData(se)}catch(ge){if(!J)return Z(ge,X,!0)}}},ue=function(j,X){var J=S.getCopyText();if(!J)return d.preventDefault(j);Z(j,J)?(y&&(W(J),R=J,setTimeout(function(){R=!1},10)),X?S.onCut():S.onCopy(),d.preventDefault(j)):(R=!0,M.value=J,M.select(),setTimeout(function(){R=!1,W(),X?S.onCut():S.onCopy()}))},Me=function(j){ue(j,!0)},Ce=function(j){ue(j,!1)},he=function(j){var X=Z(j);r.pasteCancelled()||(typeof X=="string"?(X&&S.onPaste(X,j),m.isIE&&setTimeout(W),d.preventDefault(j)):(M.value="",L=!0))};d.addCommandKeyListener(M,function(j,X,J){if(!_)return S.onCommandKey(j,X,J)},S),d.addListener(M,"select",B,S),d.addListener(M,"input",V,S),d.addListener(M,"cut",Me,S),d.addListener(M,"copy",Ce,S),d.addListener(M,"paste",he,S),(!("oncut"in M)||!("oncopy"in M)||!("onpaste"in M))&&d.addListener(A,"keydown",function(j){if(!(m.isMac&&!j.metaKey||!j.ctrlKey))switch(j.keyCode){case 67:Ce(j);break;case 86:he(j);break;case 88:Me(j);break}},S);var ke=function(j){if(!(_||!S.onCompositionStart||S.$readOnly)&&(_={},!v)){j.data&&(_.useTextareaForIME=!1),setTimeout(ct,0),S._signal("compositionStart"),S.on("mousedown",Xn);var X=S.getSelectionRange();X.end.row=X.start.row,X.end.column=X.start.column,_.markerRange=X,_.selectionStart=x,S.onCompositionStart(_),_.useTextareaForIME?(E=M.value="",x=0,k=0):(M.msGetInputContext&&(_.context=M.msGetInputContext()),M.getInputContext&&(_.context=M.getInputContext()))}},ct=function(){if(!(!_||!S.onCompositionUpdate||S.$readOnly)){if(v)return Xn();if(_.useTextareaForIME)S.onCompositionUpdate(M.value);else{var j=M.value;Y(j),_.markerRange&&(_.context&&(_.markerRange.start.column=_.selectionStart=_.context.compositionStartOffset),_.markerRange.end.column=_.markerRange.start.column+k-_.selectionStart+O)}}},ut=function(j){!S.onCompositionEnd||S.$readOnly||(_=!1,S.onCompositionEnd(),S.off("mousedown",Xn),j&&V())};function Xn(){C=!0,M.blur(),M.focus(),C=!1}var na=f.delayedCall(ct,50).schedule.bind(null,null);function ed(j){j.keyCode==27&&M.value.length<M.selectionStart&&(_||(E=M.value),x=k=-1,W()),na()}d.addListener(M,"compositionstart",ke,S),d.addListener(M,"compositionupdate",ct,S),d.addListener(M,"keyup",ed,S),d.addListener(M,"keydown",na,S),d.addListener(M,"compositionend",ut,S),this.getElement=function(){return M},this.setCommandMode=function(j){v=j,M.readOnly=!1},this.setReadOnly=function(j){v||(M.readOnly=j)},this.setCopyWithEmptySelection=function(j){},this.onContextMenu=function(j){q=!0,W(),S._emit("nativecontextmenu",{target:S,domEvent:j}),this.moveToMouse(j,!0)},this.moveToMouse=function(j,X){w||(w=M.style.cssText),M.style.cssText=(X?"z-index:100000;":"")+(m.isIE?"opacity:0.1;":"")+"text-indent: -"+(x+k)*S.renderer.characterWidth*.5+"px;";var J=S.container.getBoundingClientRect(),ie=l.computedStyle(S.container),se=J.top+(parseInt(ie.borderTopWidth)||0),ge=J.left+(parseInt(J.borderLeftWidth)||0),ye=J.bottom-se-M.clientHeight-2,me=function(de){l.translate(M,de.clientX-ge-2,Math.min(de.clientY-se-2,ye))};me(j),j.type=="mousedown"&&(S.renderer.$isMousePressed=!0,clearTimeout(Qn),m.isWin&&d.capture(S.container,me,on))},this.onContextMenuClose=on;var Qn;function on(){clearTimeout(Qn),Qn=setTimeout(function(){w&&(M.style.cssText=w,w=""),S.renderer.$isMousePressed=!1,S.renderer.$keepTextAreaAtCursor&&S.renderer.$moveTextAreaToCursor()},0)}var Zn=function(j){S.textInput.onContextMenu(j),on()};d.addListener(M,"mouseup",Zn,S),d.addListener(M,"mousedown",function(j){j.preventDefault(),on()},S),d.addListener(S.renderer.scroller,"contextmenu",Zn,S),d.addListener(M,"contextmenu",Zn,S),y&&td(A,S,M);function td(j,X,J){var ie=null,se=!1;J.addEventListener("keydown",function(ye){ie&&clearTimeout(ie),se=!0},!0),J.addEventListener("keyup",function(ye){ie=setTimeout(function(){se=!1},100)},!0);var ge=function(ye){if(document.activeElement===J&&!(se||_||X.$mouseHandler.isMousePressed)&&!R){var me=J.selectionStart,de=J.selectionEnd,ae=null,_e=0;if(me==0?ae=u.up:me==1?ae=u.home:de>k&&E[de]==`
1340
- `?ae=u.end:me<x&&E[me-1]==" "?(ae=u.left,_e=h.option):me<x||me==x&&k!=x&&me==de?ae=u.left:de>k&&E.slice(0,de).split(`
1341
- `).length>2?ae=u.down:de>k&&E[de-1]==" "?(ae=u.right,_e=h.option):(de>k||de==k&&k!=x&&me==de)&&(ae=u.right),me!==de&&(_e|=h.shift),ae){var Ot=X.onCommandKey({},_e,ae);if(!Ot&&X.commands){ae=u.keyCodeToString(ae);var ia=X.commands.findKeyCommand(_e,ae);ia&&X.execCommand(ia)}x=me,k=de,W("")}}};document.addEventListener("selectionchange",ge),X.on("destroy",function(){document.removeEventListener("selectionchange",ge)})}this.destroy=function(){M.parentElement&&M.parentElement.removeChild(M)}},n.TextInput=$,n.$setUserAgentForTests=function(A,S){T=A,y=S}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(t,n,p){var d=t("../lib/useragent"),g=0,m=550,l=(function(){function o(s){s.$clickSelection=null;var a=s.editor;a.setDefaultHandler("mousedown",this.onMouseDown.bind(s)),a.setDefaultHandler("dblclick",this.onDoubleClick.bind(s)),a.setDefaultHandler("tripleclick",this.onTripleClick.bind(s)),a.setDefaultHandler("quadclick",this.onQuadClick.bind(s)),a.setDefaultHandler("mousewheel",this.onMouseWheel.bind(s));var i=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];i.forEach(function(u){s[u]=this[u]},this),s.selectByLines=this.extendSelectionBy.bind(s,"getLineRange"),s.selectByWords=this.extendSelectionBy.bind(s,"getWordRange")}return o.prototype.onMouseDown=function(s){var a=s.inSelection(),i=s.getDocumentPosition();this.mousedownEvent=s;var u=this.editor,h=s.getButton();if(h!==0){var y=u.getSelectionRange(),b=y.isEmpty();(b||h==1)&&u.selection.moveToPosition(i),h==2&&(u.textInput.onContextMenu(s.domEvent),d.isMozilla||s.preventDefault());return}if(this.mousedownEvent.time=Date.now(),a&&!u.isFocused()&&(u.focus(),this.$focusTimeout&&!this.$clickSelection&&!u.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(s);return}return this.captureMouse(s),this.startSelect(i,s.domEvent._clicks>1),s.preventDefault()},o.prototype.startSelect=function(s,a){s=s||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var i=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?i.selection.selectToPosition(s):a||i.selection.moveToPosition(s),a||this.select(),i.setStyle("ace_selecting"),this.setState("select"))},o.prototype.select=function(){var s,a=this.editor,i=a.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var u=this.$clickSelection.comparePoint(i);if(u==-1)s=this.$clickSelection.end;else if(u==1)s=this.$clickSelection.start;else{var h=r(this.$clickSelection,i);i=h.cursor,s=h.anchor}a.selection.setSelectionAnchor(s.row,s.column)}a.selection.selectToPosition(i),a.renderer.scrollCursorIntoView()},o.prototype.extendSelectionBy=function(s){var a,i=this.editor,u=i.renderer.screenToTextCoordinates(this.x,this.y),h=i.selection[s](u.row,u.column);if(this.$clickSelection){var y=this.$clickSelection.comparePoint(h.start),b=this.$clickSelection.comparePoint(h.end);if(y==-1&&b<=0)a=this.$clickSelection.end,(h.end.row!=u.row||h.end.column!=u.column)&&(u=h.start);else if(b==1&&y>=0)a=this.$clickSelection.start,(h.start.row!=u.row||h.start.column!=u.column)&&(u=h.end);else if(y==-1&&b==1)u=h.end,a=h.start;else{var T=r(this.$clickSelection,u);u=T.cursor,a=T.anchor}i.selection.setSelectionAnchor(a.row,a.column)}i.selection.selectToPosition(u),i.renderer.scrollCursorIntoView()},o.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},o.prototype.focusWait=function(){var s=f(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),a=Date.now();(s>g||a-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},o.prototype.onDoubleClick=function(s){var a=s.getDocumentPosition(),i=this.editor,u=i.session,h=u.getBracketRange(a);h?(h.isEmpty()&&(h.start.column--,h.end.column++),this.setState("select")):(h=i.selection.getWordRange(a.row,a.column),this.setState("selectByWords")),this.$clickSelection=h,this.select()},o.prototype.onTripleClick=function(s){var a=s.getDocumentPosition(),i=this.editor;this.setState("selectByLines");var u=i.getSelectionRange();u.isMultiLine()&&u.contains(a.row,a.column)?(this.$clickSelection=i.selection.getLineRange(u.start.row),this.$clickSelection.end=i.selection.getLineRange(u.end.row).end):this.$clickSelection=i.selection.getLineRange(a.row),this.select()},o.prototype.onQuadClick=function(s){var a=this.editor;a.selectAll(),this.$clickSelection=a.getSelectionRange(),this.setState("selectAll")},o.prototype.onMouseWheel=function(s){if(!s.getAccelKey()){s.getShiftKey()&&s.wheelY&&!s.wheelX&&(s.wheelX=s.wheelY,s.wheelY=0);var a=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var i=this.$lastScroll,u=s.domEvent.timeStamp,h=u-i.t,y=h?s.wheelX/h:i.vx,b=h?s.wheelY/h:i.vy;h<m&&(y=(y+i.vx)/2,b=(b+i.vy)/2);var T=Math.abs(y/b),$=!1;if(T>=1&&a.renderer.isScrollableBy(s.wheelX*s.speed,0)&&($=!0),T<=1&&a.renderer.isScrollableBy(0,s.wheelY*s.speed)&&($=!0),$)i.allowed=u;else if(u-i.allowed<m){var A=Math.abs(y)<=1.5*Math.abs(i.vx)&&Math.abs(b)<=1.5*Math.abs(i.vy);A?($=!0,i.allowed=u):i.allowed=0}if(i.t=u,i.vx=y,i.vy=b,$)return a.renderer.scrollBy(s.wheelX*s.speed,s.wheelY*s.speed),s.stop()}},o})();l.prototype.selectEnd=l.prototype.selectByLinesEnd,l.prototype.selectAllEnd=l.prototype.selectByLinesEnd,l.prototype.selectByWordsEnd=l.prototype.selectByLinesEnd,n.DefaultHandlers=l;function f(o,s,a,i){return Math.sqrt(Math.pow(a-o,2)+Math.pow(i-s,2))}function r(o,s){if(o.start.row==o.end.row)var a=2*s.column-o.start.column-o.end.column;else if(o.start.row==o.end.row-1&&!o.start.column&&!o.end.column)var a=s.column-4;else var a=2*s.row-o.start.row-o.end.row;return a<0?{cursor:o.start,anchor:o.end}:{cursor:o.end,anchor:o.start}}}),ace.define("ace/lib/scroll",["require","exports","module"],function(t,n,p){n.preventParentScroll=function(g){g.stopPropagation();var m=g.currentTarget,l=m.scrollHeight>m.clientHeight;l||g.preventDefault()}}),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(t,n,p){var d=this&&this.__extends||(function(){var u=function(h,y){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,T){b.__proto__=T}||function(b,T){for(var $ in T)Object.prototype.hasOwnProperty.call(T,$)&&(b[$]=T[$])},u(h,y)};return function(h,y){if(typeof y!="function"&&y!==null)throw new TypeError("Class extends value "+String(y)+" is not a constructor or null");u(h,y);function b(){this.constructor=h}h.prototype=y===null?Object.create(y):(b.prototype=y.prototype,new b)}})(),g=this&&this.__values||function(u){var h=typeof Symbol=="function"&&Symbol.iterator,y=h&&u[h],b=0;if(y)return y.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&b>=u.length&&(u=void 0),{value:u&&u[b++],done:!u}}};throw new TypeError(h?"Object is not iterable.":"Symbol.iterator is not defined.")},m=t("./lib/dom");t("./lib/event");var l=t("./range").Range,f=t("./lib/scroll").preventParentScroll,r="ace_tooltip",o=(function(){function u(h){this.isOpen=!1,this.$element=null,this.$parentNode=h}return u.prototype.$init=function(){return this.$element=m.createElement("div"),this.$element.className=r,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},u.prototype.getElement=function(){return this.$element||this.$init()},u.prototype.setText=function(h){this.getElement().textContent=h},u.prototype.setHtml=function(h){this.getElement().innerHTML=h},u.prototype.setPosition=function(h,y){this.getElement().style.left=h+"px",this.getElement().style.top=y+"px"},u.prototype.setClassName=function(h){m.addCssClass(this.getElement(),h)},u.prototype.setTheme=function(h){this.$element.className=r+" "+(h.isDark?"ace_dark ":"")+(h.cssClass||"")},u.prototype.show=function(h,y,b){h!=null&&this.setText(h),y!=null&&b!=null&&this.setPosition(y,b),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},u.prototype.hide=function(h){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=r,this.isOpen=!1)},u.prototype.getHeight=function(){return this.getElement().offsetHeight},u.prototype.getWidth=function(){return this.getElement().offsetWidth},u.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},u})(),s=(function(){function u(){this.popups=[]}return u.prototype.addPopup=function(h){this.popups.push(h),this.updatePopups()},u.prototype.removePopup=function(h){var y=this.popups.indexOf(h);y!==-1&&(this.popups.splice(y,1),this.updatePopups())},u.prototype.updatePopups=function(){var h,y,b,T;this.popups.sort(function(w,v){return v.priority-w.priority});var $=[];try{for(var A=g(this.popups),S=A.next();!S.done;S=A.next()){var M=S.value,R=!0;try{for(var L=(b=void 0,g($)),_=L.next();!_.done;_=L.next()){var I=_.value;if(this.doPopupsOverlap(I,M)){R=!1;break}}}catch(w){b={error:w}}finally{try{_&&!_.done&&(T=L.return)&&T.call(L)}finally{if(b)throw b.error}}R?$.push(M):M.hide()}}catch(w){h={error:w}}finally{try{S&&!S.done&&(y=A.return)&&y.call(A)}finally{if(h)throw h.error}}},u.prototype.doPopupsOverlap=function(h,y){var b=h.getElement().getBoundingClientRect(),T=y.getElement().getBoundingClientRect();return b.left<T.right&&b.right>T.left&&b.top<T.bottom&&b.bottom>T.top},u})(),a=new s;n.popupManager=a,n.Tooltip=o;var i=(function(u){d(h,u);function h(y){y===void 0&&(y=document.body);var b=u.call(this,y)||this;b.timeout=void 0,b.lastT=0,b.idleTime=350,b.lastEvent=void 0,b.onMouseOut=b.onMouseOut.bind(b),b.onMouseMove=b.onMouseMove.bind(b),b.waitForHover=b.waitForHover.bind(b),b.hide=b.hide.bind(b);var T=b.getElement();return T.style.whiteSpace="pre-wrap",T.style.pointerEvents="auto",T.addEventListener("mouseout",b.onMouseOut),T.tabIndex=-1,T.addEventListener("blur",(function(){T.contains(document.activeElement)||this.hide()}).bind(b)),T.addEventListener("wheel",f),b}return h.prototype.addToEditor=function(y){y.on("mousemove",this.onMouseMove),y.on("mousedown",this.hide),y.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},h.prototype.removeFromEditor=function(y){y.off("mousemove",this.onMouseMove),y.off("mousedown",this.hide),y.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},h.prototype.onMouseMove=function(y,b){this.lastEvent=y,this.lastT=Date.now();var T=b.$mouseHandler.isMousePressed;if(this.isOpen){var $=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains($.row,$.column)||T||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||T||(this.lastEvent=y,this.timeout=setTimeout(this.waitForHover,this.idleTime))},h.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var y=Date.now()-this.lastT;if(this.idleTime-y>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-y);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},h.prototype.isOutsideOfText=function(y){var b=y.editor,T=y.getDocumentPosition(),$=b.session.getLine(T.row);if(T.column==$.length){var A=b.renderer.pixelToScreenCoordinates(y.clientX,y.clientY),S=b.session.documentToScreenPosition(T.row,T.column);if(S.column!=A.column||S.row!=A.row)return!0}return!1},h.prototype.setDataProvider=function(y){this.$gatherData=y},h.prototype.showForRange=function(y,b,T,$){var A=10;if(!($&&$!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var S=y.renderer;this.isOpen||(a.addPopup(this),this.$registerCloseEvents(),this.setTheme(S.theme)),this.isOpen=!0,this.addMarker(b,y.session),this.range=l.fromPoints(b.start,b.end);var M=S.textToScreenCoordinates(b.start.row,b.start.column),R=S.scroller.getBoundingClientRect();M.pageX<R.left&&(M.pageX=R.left);var L=this.getElement();L.innerHTML="",L.appendChild(T),L.style.maxHeight="",L.style.display="block";var _=L.clientHeight,I=L.clientWidth,w=window.innerHeight-M.pageY-S.lineHeight,v=!0;M.pageY-_<0&&M.pageY<w&&(v=!1),L.style.maxHeight=(v?M.pageY:w)-A+"px",L.style.top=v?"":M.pageY+S.lineHeight+"px",L.style.bottom=v?window.innerHeight-M.pageY+"px":"",L.style.left=Math.min(M.pageX,window.innerWidth-I-A)+"px"}},h.prototype.addMarker=function(y,b){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=b,this.marker=b&&b.addMarker(y,"ace_highlight-marker","text")},h.prototype.hide=function(y){!y&&document.activeElement==this.getElement()||y&&y.target&&(y.type!="keydown"||y.ctrlKey||y.metaKey)&&this.$element.contains(y.target)||(this.lastEvent=null,this.timeout&&clearTimeout(this.timeout),this.timeout=null,this.addMarker(null),this.isOpen&&(this.$removeCloseEvents(),this.getElement().style.display="none",this.isOpen=!1,a.removePopup(this)))},h.prototype.$registerCloseEvents=function(){window.addEventListener("keydown",this.hide,!0),window.addEventListener("wheel",this.hide,!0),window.addEventListener("mousedown",this.hide,!0)},h.prototype.$removeCloseEvents=function(){window.removeEventListener("keydown",this.hide,!0),window.removeEventListener("wheel",this.hide,!0),window.removeEventListener("mousedown",this.hide,!0)},h.prototype.onMouseOut=function(y){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.lastEvent=null,this.isOpen&&(!y.relatedTarget||this.getElement().contains(y.relatedTarget)||y&&y.currentTarget.contains(y.relatedTarget)||y.relatedTarget.classList.contains("ace_content")||this.hide())},h})(o);n.HoverTooltip=i}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/tooltip","ace/config","ace/lib/lang"],function(t,n,p){var d=this&&this.__extends||(function(){var a=function(i,u){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,y){h.__proto__=y}||function(h,y){for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])},a(i,u)};return function(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");a(i,u);function h(){this.constructor=i}i.prototype=u===null?Object.create(u):(h.prototype=u.prototype,new h)}})(),g=this&&this.__values||function(a){var i=typeof Symbol=="function"&&Symbol.iterator,u=i&&a[i],h=0;if(u)return u.call(a);if(a&&typeof a.length=="number")return{next:function(){return a&&h>=a.length&&(a=void 0),{value:a&&a[h++],done:!a}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},m=t("../lib/dom"),l=t("../lib/event"),f=t("../tooltip").Tooltip,r=t("../config").nls;t("../lib/lang");function o(a){var i=a.editor,u=i.renderer.$gutterLayer,h=new s(i);a.editor.setDefaultHandler("guttermousedown",function(S){if(!(!i.isFocused()||S.getButton()!=0)){var M=u.getRegion(S);if(M!="foldWidgets"){var R=S.getDocumentPosition().row,L=i.session.selection;if(S.getShiftKey())L.selectTo(R,0);else{if(S.domEvent.detail==2)return i.selectAll(),S.preventDefault();a.$clickSelection=i.selection.getLineRange(R)}return a.setState("selectByLines"),a.captureMouse(S),S.preventDefault()}}});var y,b;function T(){var S=b.getDocumentPosition().row,M=i.session.getLength();if(S==M){var R=i.renderer.pixelToScreenCoordinates(0,b.y).row,L=b.$pos;if(R>i.session.documentToScreenRow(L.row,L.column))return $()}if(h.showTooltip(S),!!h.isOpen)if(i.on("mousewheel",$),a.$tooltipFollowsMouse)A(b);else{var _=b.getGutterRow(),I=u.$lines.get(_);if(I){var w=I.element.querySelector(".ace_gutter_annotation"),v=w.getBoundingClientRect(),C=h.getElement().style;C.left=v.right+"px",C.top=v.bottom+"px"}else A(b)}}function $(){y&&(y=clearTimeout(y)),h.isOpen&&(h.hideTooltip(),i.off("mousewheel",$))}function A(S){h.setPosition(S.x,S.y)}a.editor.setDefaultHandler("guttermousemove",function(S){var M=S.domEvent.target||S.domEvent.srcElement;if(m.hasCssClass(M,"ace_fold-widget"))return $();h.isOpen&&a.$tooltipFollowsMouse&&A(S),b=S,!y&&(y=setTimeout(function(){y=null,b&&!a.isMousePressed?T():$()},50))}),l.addListener(i.renderer.$gutter,"mouseout",function(S){b=null,!(!h.isOpen||y)&&(y=setTimeout(function(){y=null,$()},50))},i),i.on("changeSession",$),i.on("input",$)}n.GutterHandler=o;var s=(function(a){d(i,a);function i(u){var h=a.call(this,u.container)||this;return h.editor=u,h}return i.prototype.setPosition=function(u,h){var y=window.innerWidth||document.documentElement.clientWidth,b=window.innerHeight||document.documentElement.clientHeight,T=this.getWidth(),$=this.getHeight();u+=15,h+=15,u+T>y&&(u-=u+T-y),h+$>b&&(h-=20+$),f.prototype.setPosition.call(this,u,h)},Object.defineProperty(i,"annotationLabels",{get:function(){return{error:{singular:r("gutter-tooltip.aria-label.error.singular","error"),plural:r("gutter-tooltip.aria-label.error.plural","errors")},security:{singular:r("gutter-tooltip.aria-label.security.singular","security finding"),plural:r("gutter-tooltip.aria-label.security.plural","security findings")},warning:{singular:r("gutter-tooltip.aria-label.warning.singular","warning"),plural:r("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:r("gutter-tooltip.aria-label.info.singular","information message"),plural:r("gutter-tooltip.aria-label.info.plural","information messages")},hint:{singular:r("gutter-tooltip.aria-label.hint.singular","suggestion"),plural:r("gutter-tooltip.aria-label.hint.plural","suggestions")}}},enumerable:!1,configurable:!0}),i.prototype.showTooltip=function(u){var h,y=this.editor.renderer.$gutterLayer,b=y.$annotations[u],T;b?T={displayText:Array.from(b.displayText),type:Array.from(b.type)}:T={displayText:[],type:[]};var $=y.session.getFoldLine(u);if($&&y.$showFoldedAnnotations){for(var A={error:[],security:[],warning:[],info:[],hint:[]},S={error:1,security:2,warning:3,info:4,hint:5},M,R=u+1;R<=$.end.row;R++)if(y.$annotations[R])for(var L=0;L<y.$annotations[R].text.length;L++){var _=y.$annotations[R].type[L];A[_].push(y.$annotations[R].text[L]),(!M||S[_]<S[M])&&(M=_)}if(["error","security","warning"].includes(M)){var I="".concat(i.annotationsToSummaryString(A)," in folded code.");T.displayText.push(I),T.type.push(M+"_fold")}}if(T.displayText.length===0)return this.hide();for(var w={error:[],security:[],warning:[],info:[],hint:[]},v=y.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",R=0;R<T.displayText.length;R++){var C=m.createElement("span"),E=m.createElement("span");(h=E.classList).add.apply(h,["ace_".concat(T.type[R]),v]),E.setAttribute("aria-label","".concat(i.annotationLabels[T.type[R].replace("_fold","")].singular)),E.setAttribute("role","img"),E.appendChild(m.createTextNode(" ")),C.appendChild(E),C.appendChild(m.createTextNode(T.displayText[R])),C.appendChild(m.createElement("br")),w[T.type[R].replace("_fold","")].push(C)}var x=this.getElement();m.removeChildren(x),w.error.forEach(function(k){return x.appendChild(k)}),w.security.forEach(function(k){return x.appendChild(k)}),w.warning.forEach(function(k){return x.appendChild(k)}),w.info.forEach(function(k){return x.appendChild(k)}),w.hint.forEach(function(k){return x.appendChild(k)}),x.setAttribute("aria-live","polite"),this.isOpen||(this.setTheme(this.editor.renderer.theme),this.setClassName("ace_gutter-tooltip")),this.show(),this.editor._signal("showGutterTooltip",this)},i.prototype.hideTooltip=function(){this.$element.removeAttribute("aria-live"),this.hide(),this.editor._signal("hideGutterTooltip",this)},i.annotationsToSummaryString=function(u){var h,y,b=[],T=["error","security","warning","info","hint"];try{for(var $=g(T),A=$.next();!A.done;A=$.next()){var S=A.value;if(u[S].length){var M=u[S].length===1?i.annotationLabels[S].singular:i.annotationLabels[S].plural;b.push("".concat(u[S].length," ").concat(M))}}}catch(R){h={error:R}}finally{try{A&&!A.done&&(y=$.return)&&y.call($)}finally{if(h)throw h.error}}return b.join(", ")},i})(f);n.GutterTooltip=s}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(t,n,p){var d=t("../lib/event"),g=t("../lib/useragent"),m=(function(){function l(f,r){this.speed,this.wheelX,this.wheelY,this.domEvent=f,this.editor=r,this.x=this.clientX=f.clientX,this.y=this.clientY=f.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return l.prototype.stopPropagation=function(){d.stopPropagation(this.domEvent),this.propagationStopped=!0},l.prototype.preventDefault=function(){d.preventDefault(this.domEvent),this.defaultPrevented=!0},l.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},l.prototype.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},l.prototype.getGutterRow=function(){var f=this.getDocumentPosition().row,r=this.editor.session.documentToScreenRow(f,0),o=this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0);return r-o},l.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var f=this.editor,r=f.getSelectionRange();if(r.isEmpty())this.$inSelection=!1;else{var o=this.getDocumentPosition();this.$inSelection=r.contains(o.row,o.column)}return this.$inSelection},l.prototype.getButton=function(){return d.getButton(this.domEvent)},l.prototype.getShiftKey=function(){return this.domEvent.shiftKey},l.prototype.getAccelKey=function(){return g.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},l})();n.MouseEvent=m}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(t,n,p){var d=t("../lib/dom"),g=t("../lib/event"),m=t("../lib/useragent"),l=200,f=200,r=5;function o(a){var i=a.editor,u=d.createElement("div");u.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",u.textContent=" ";var h=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];h.forEach(function(F){a[F]=this[F]},this),i.on("mousedown",this.onMouseDown.bind(a));var y=i.container,b,T,$,A,S,M,R=0,L,_,I,w,v;this.onDragStart=function(F){if(this.cancelDrag||!y.draggable){var W=this;return setTimeout(function(){W.startSelect(),W.captureMouse(F)},0),F.preventDefault()}S=i.getSelectionRange();var H=F.dataTransfer;H.effectAllowed=i.getReadOnly()?"copy":"copyMove",i.container.appendChild(u),H.setDragImage&&H.setDragImage(u,0,0),setTimeout(function(){i.container.removeChild(u)}),H.clearData(),H.setData("Text",i.session.getTextRange()),_=!0,this.setState("drag")},this.onDragEnd=function(F){if(y.draggable=!1,_=!1,this.setState(null),!i.getReadOnly()){var W=F.dataTransfer.dropEffect;!L&&W=="move"&&i.session.remove(i.getSelectionRange()),i.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(F){if(!(i.getReadOnly()||!P(F.dataTransfer)))return T=F.clientX,$=F.clientY,b||k(),R++,F.dataTransfer.dropEffect=L=z(F),g.preventDefault(F)},this.onDragOver=function(F){if(!(i.getReadOnly()||!P(F.dataTransfer)))return T=F.clientX,$=F.clientY,b||(k(),R++),D!==null&&(D=null),F.dataTransfer.dropEffect=L=z(F),g.preventDefault(F)},this.onDragLeave=function(F){if(R--,R<=0&&b)return O(),L=null,g.preventDefault(F)},this.onDrop=function(F){if(M){var W=F.dataTransfer;if(_)switch(L){case"move":S.contains(M.row,M.column)?S={start:M,end:M}:S=i.moveText(S,M);break;case"copy":S=i.moveText(S,M,!0);break}else{var H=W.getData("Text");S={start:M,end:i.session.insert(M,H)},i.focus(),L=null}return O(),g.preventDefault(F)}},g.addListener(y,"dragstart",this.onDragStart.bind(a),i),g.addListener(y,"dragend",this.onDragEnd.bind(a),i),g.addListener(y,"dragenter",this.onDragEnter.bind(a),i),g.addListener(y,"dragover",this.onDragOver.bind(a),i),g.addListener(y,"dragleave",this.onDragLeave.bind(a),i),g.addListener(y,"drop",this.onDrop.bind(a),i);function C(F,W){var H=Date.now(),B=!W||F.row!=W.row,G=!W||F.column!=W.column;if(!w||B||G)i.moveCursorToPosition(F),w=H,v={x:T,y:$};else{var q=s(v.x,v.y,T,$);q>r?w=null:H-w>=f&&(i.renderer.scrollCursorIntoView(),w=null)}}function E(F,W){var H=Date.now(),B=i.renderer.layerConfig.lineHeight,G=i.renderer.layerConfig.characterWidth,q=i.renderer.scroller.getBoundingClientRect(),Y={x:{left:T-q.left,right:q.right-T},y:{top:$-q.top,bottom:q.bottom-$}},V=Math.min(Y.x.left,Y.x.right),Z=Math.min(Y.y.top,Y.y.bottom),ue={row:F.row,column:F.column};V/G<=2&&(ue.column+=Y.x.left<Y.x.right?-3:2),Z/B<=1&&(ue.row+=Y.y.top<Y.y.bottom?-1:1);var Me=F.row!=ue.row,Ce=F.column!=ue.column,he=!W||F.row!=W.row;Me||Ce&&!he?I?H-I>=l&&i.renderer.scrollCursorIntoView(ue):I=H:I=null}function x(){var F=M;M=i.renderer.screenToTextCoordinates(T,$),C(M,F),E(M,F)}function k(){S=i.selection.toOrientedRange(),b=i.session.addMarker(S,"ace_selection",i.getSelectionStyle()),i.clearSelection(),i.isFocused()&&i.renderer.$cursorLayer.setBlinking(!1),clearInterval(A),x(),A=setInterval(x,20),R=0,g.addListener(document,"mousemove",N)}function O(){clearInterval(A),i.session.removeMarker(b),b=null,i.selection.fromOrientedRange(S),i.isFocused()&&!_&&i.$resetCursorStyle(),S=null,M=null,R=0,I=null,w=null,g.removeListener(document,"mousemove",N)}var D=null;function N(){D==null&&(D=setTimeout(function(){D!=null&&b&&O()},20))}function P(F){var W=F.types;return!W||Array.prototype.some.call(W,function(H){return H=="text/plain"||H=="Text"})}function z(F){var W=["copy","copymove","all","uninitialized"],H=["move","copymove","linkmove","all","uninitialized"],B=m.isMac?F.altKey:F.ctrlKey,G="uninitialized";try{G=F.dataTransfer.effectAllowed.toLowerCase()}catch{}var q="none";return B&&W.indexOf(G)>=0?q="copy":H.indexOf(G)>=0?q="move":W.indexOf(G)>=0&&(q="copy"),q}}(function(){this.dragWait=function(){var a=Date.now()-this.mousedownEvent.time;a>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var a=this.editor.container;a.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(a){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var a=this.editor,i=a.container;i.draggable=!0,a.renderer.$cursorLayer.setBlinking(!1),a.setStyle("ace_dragging");var u=m.isWin?"default":"move";a.renderer.setCursorStyle(u),this.setState("dragReady")},this.onMouseDrag=function(a){var i=this.editor.container;if(m.isIE&&this.state=="dragReady"){var u=s(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);u>3&&i.dragDrop()}if(this.state==="dragWait"){var u=s(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);u>0&&(i.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(a){if(this.$dragEnabled){this.mousedownEvent=a;var i=this.editor,u=a.inSelection(),h=a.getButton(),y=a.domEvent.detail||1;if(y===1&&h===0&&u){if(a.editor.inMultiSelectMode&&(a.getAccelKey()||a.getShiftKey()))return;this.mousedownEvent.time=Date.now();var b=a.domEvent.target||a.domEvent.srcElement;if("unselectable"in b&&(b.unselectable="on"),i.getDragDelay()){if(m.isWebKit){this.cancelDrag=!0;var T=i.container;T.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(a,this.onMouseDrag.bind(this)),a.defaultPrevented=!0}}}}).call(o.prototype);function s(a,i,u,h){return Math.sqrt(Math.pow(u-a,2)+Math.pow(h-i,2))}n.DragdropHandler=o}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(t,n,p){var d=t("./mouse_event").MouseEvent,g=t("../lib/event"),m=t("../lib/dom");n.addTouchListeners=function(l,f){var r="scroll",o,s,a,i,u,h,y=0,b,T=0,$=0,A=0,S,M;function R(){var C=window.navigator&&window.navigator.clipboard,E=!1,x=function(){var D=f.getCopyText(),N=f.session.getUndoManager().hasUndo();M.replaceChild(m.buildDom(E?["span",!D&&k("selectall")&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],D&&k("copy")&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],D&&k("cut")&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],C&&k("paste")&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],N&&k("undo")&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],k("find")&&["span",{class:"ace_mobile-button",action:"find"},"Find"],k("openCommandPalette")&&["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),M.firstChild)},k=function(D){return f.commands.canExecute(D,f)},O=function(D){var N=D.target.getAttribute("action");if(N=="more"||!E)return E=!E,x();N=="paste"?C.readText().then(function(P){f.execCommand(N,P)}):N&&((N=="cut"||N=="copy")&&(C?C.writeText(f.getCopyText()):document.execCommand("copy")),f.execCommand(N)),M.firstChild.style.display="none",E=!1,N!="openCommandPalette"&&f.focus()};M=m.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(D){r="menu",D.stopPropagation(),D.preventDefault(),f.textInput.focus()},ontouchend:function(D){D.stopPropagation(),D.preventDefault(),O(D)},onclick:O},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],f.container)}function L(){if(!f.getOption("enableMobileMenu")){M&&_();return}M||R();var C=f.selection.cursor,E=f.renderer.textToScreenCoordinates(C.row,C.column),x=f.renderer.textToScreenCoordinates(0,0).pageX,k=f.renderer.scrollLeft,O=f.container.getBoundingClientRect();M.style.top=E.pageY-O.top-3+"px",E.pageX-O.left<O.width-70?(M.style.left="",M.style.right="10px"):(M.style.right="",M.style.left=x+k-O.left+"px"),M.style.display="",M.firstChild.style.display="none",f.on("input",_)}function _(C){M&&(M.style.display="none"),f.off("input",_)}function I(){u=null,clearTimeout(u);var C=f.selection.getRange(),E=C.contains(b.row,b.column);(C.isEmpty()||!E)&&(f.selection.moveToPosition(b),f.selection.selectWord()),r="wait",L()}function w(){u=null,clearTimeout(u),f.selection.moveToPosition(b);var C=T>=2?f.selection.getLineRange(b.row):f.session.getBracketRange(b);C&&!C.isEmpty()?f.selection.setRange(C):f.selection.selectWord(),r="wait"}g.addListener(l,"contextmenu",function(C){if(S){var E=f.textInput.getElement();E.focus()}},f),g.addListener(l,"touchstart",function(C){var E=C.touches;if(u||E.length>1){clearTimeout(u),u=null,a=-1,r="zoom";return}S=f.$mouseHandler.isMousePressed=!0;var x=f.renderer.layerConfig.lineHeight,k=f.renderer.layerConfig.lineHeight,O=C.timeStamp;i=O;var D=E[0],N=D.clientX,P=D.clientY;Math.abs(o-N)+Math.abs(s-P)>x&&(a=-1),o=C.clientX=N,s=C.clientY=P,$=A=0;var z=new d(C,f);if(b=z.getDocumentPosition(),O-a<500&&E.length==1&&!y)T++,C.preventDefault(),C.button=0,w();else{T=0;var F=f.selection.cursor,W=f.selection.isEmpty()?F:f.selection.anchor,H=f.renderer.$cursorLayer.getPixelPosition(F,!0),B=f.renderer.$cursorLayer.getPixelPosition(W,!0),G=f.renderer.scroller.getBoundingClientRect(),q=f.renderer.layerConfig.offset,Y=f.renderer.scrollLeft,V=function(Me,Ce){return Me=Me/k,Ce=Ce/x-.75,Me*Me+Ce*Ce};if(C.clientX<G.left){r="zoom";return}var Z=V(C.clientX-G.left-H.left+Y,C.clientY-G.top-H.top+q),ue=V(C.clientX-G.left-B.left+Y,C.clientY-G.top-B.top+q);Z<3.5&&ue<3.5&&(r=Z>ue?"cursor":"anchor"),ue<3.5?r="anchor":Z<3.5?r="cursor":r="scroll",u=setTimeout(I,450)}a=O},f),g.addListener(l,"touchend",function(C){S=f.$mouseHandler.isMousePressed=!1,h&&clearInterval(h),r=="zoom"?(r="",y=0):u?(f.selection.moveToPosition(b),y=0,L()):r=="scroll"?(v(),_()):L(),clearTimeout(u),u=null},f),g.addListener(l,"touchmove",function(C){u&&(clearTimeout(u),u=null);var E=C.touches;if(!(E.length>1||r=="zoom")){var x=E[0],k=o-x.clientX,O=s-x.clientY;if(r=="wait")if(k*k+O*O>4)r="cursor";else return C.preventDefault();o=x.clientX,s=x.clientY,C.clientX=x.clientX,C.clientY=x.clientY;var D=C.timeStamp,N=D-i;if(i=D,r=="scroll"){var P=new d(C,f);P.speed=1,P.wheelX=k,P.wheelY=O,10*Math.abs(k)<Math.abs(O)&&(k=0),10*Math.abs(O)<Math.abs(k)&&(O=0),N!=0&&($=k/N,A=O/N),f._emit("mousewheel",P),P.propagationStopped||($=A=0)}else{var z=new d(C,f),F=z.getDocumentPosition();r=="cursor"?f.selection.moveCursorToPosition(F):r=="anchor"&&f.selection.setSelectionAnchor(F.row,F.column),f.renderer.scrollCursorIntoView(F),C.preventDefault()}}},f);function v(){y+=60,h=setInterval(function(){y--<=0&&(clearInterval(h),h=null),Math.abs($)<.01&&($=0),Math.abs(A)<.01&&(A=0),y<20&&($=.9*$),y<20&&(A=.9*A);var C=f.session.getScrollTop();f.renderer.scrollBy(10*$,10*A),C==f.session.getScrollTop()&&(y=0)},10)}}}),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/mouse/touch_handler","ace/config"],function(t,n,p){var d=t("../lib/event"),g=t("../lib/useragent"),m=t("./default_handlers").DefaultHandlers,l=t("./default_gutter_handler").GutterHandler,f=t("./mouse_event").MouseEvent,r=t("./dragdrop_handler").DragdropHandler,o=t("./touch_handler").addTouchListeners,s=t("../config"),a=(function(){function i(u){this.$dragDelay,this.$dragEnabled,this.$mouseMoved,this.mouseEvent,this.$focusTimeout;var h=this;this.editor=u,new m(this),new l(this),new r(this);var y=function($){var A=!document.hasFocus||!document.hasFocus()||!u.isFocused()&&document.activeElement==(u.textInput&&u.textInput.getElement());A&&window.focus(),u.focus(),setTimeout(function(){u.isFocused()||u.focus()})},b=u.renderer.getMouseEventTarget();d.addListener(b,"click",this.onMouseEvent.bind(this,"click"),u),d.addListener(b,"mousemove",this.onMouseMove.bind(this,"mousemove"),u),d.addMultiMouseDownListener([b,u.renderer.scrollBarV&&u.renderer.scrollBarV.inner,u.renderer.scrollBarH&&u.renderer.scrollBarH.inner,u.textInput&&u.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",u),d.addMouseWheelListener(u.container,this.onMouseWheel.bind(this,"mousewheel"),u),o(u.container,u);var T=u.renderer.$gutter;d.addListener(T,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),u),d.addListener(T,"click",this.onMouseEvent.bind(this,"gutterclick"),u),d.addListener(T,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),u),d.addListener(T,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),u),d.addListener(b,"mousedown",y,u),d.addListener(T,"mousedown",y,u),g.isIE&&u.renderer.scrollBarV&&(d.addListener(u.renderer.scrollBarV.element,"mousedown",y,u),d.addListener(u.renderer.scrollBarH.element,"mousedown",y,u)),u.on("mousemove",function($){if(!(h.state||h.$dragDelay||!h.$dragEnabled)){var A=u.renderer.screenToTextCoordinates($.x,$.y),S=u.session.selection.getRange(),M=u.renderer;!S.isEmpty()&&S.insideStart(A.row,A.column)?M.setCursorStyle("default"):M.setCursorStyle("")}},u)}return i.prototype.onMouseEvent=function(u,h){this.editor.session&&this.editor._emit(u,new f(h,this.editor))},i.prototype.onMouseMove=function(u,h){var y=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;!y||!y.length||this.editor._emit(u,new f(h,this.editor))},i.prototype.onMouseWheel=function(u,h){var y=new f(h,this.editor);y.speed=this.$scrollSpeed*2,y.wheelX=h.wheelX,y.wheelY=h.wheelY,this.editor._emit(u,y)},i.prototype.setState=function(u){this.state=u},i.prototype.captureMouse=function(u,h){this.x=u.x,this.y=u.y,this.isMousePressed=!0;var y=this.editor,b=this.editor.renderer;b.$isMousePressed=!0;var T=this,$=function(L){if(L){if(g.isWebKit&&!L.which&&T.releaseMouse)return T.releaseMouse();T.x=L.clientX,T.y=L.clientY,h&&h(L),T.mouseEvent=new f(L,T.editor),T.$mouseMoved=!0}},A=function(L){y.off("beforeEndOperation",M),clearInterval(R),y.session&&S(),T[T.state+"End"]&&T[T.state+"End"](L),T.state="",T.isMousePressed=b.$isMousePressed=!1,b.$keepTextAreaAtCursor&&b.$moveTextAreaToCursor(),T.$onCaptureMouseMove=T.releaseMouse=null,L&&T.onMouseEvent("mouseup",L),y.endOperation()},S=function(){T[T.state]&&T[T.state](),T.$mouseMoved=!1};if(g.isOldIE&&u.domEvent.type=="dblclick")return setTimeout(function(){A(u)});var M=function(L){T.releaseMouse&&y.curOp.command.name&&y.curOp.selectionChanged&&(T[T.state+"End"]&&T[T.state+"End"](),T.state="",T.releaseMouse())};y.on("beforeEndOperation",M),y.startOperation({command:{name:"mouse"}}),T.$onCaptureMouseMove=$,T.releaseMouse=d.capture(this.editor.container,$,A);var R=setInterval(S,20)},i.prototype.cancelContextMenu=function(){var u=(function(h){h&&h.domEvent&&h.domEvent.type!="contextmenu"||(this.editor.off("nativecontextmenu",u),h&&h.domEvent&&d.stopEvent(h.domEvent))}).bind(this);setTimeout(u,10),this.editor.on("nativecontextmenu",u)},i.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse()},i})();a.prototype.releaseMouse=null,s.defineOptions(a.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:g.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),n.MouseHandler=a}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(t,n,p){var d=t("../lib/dom"),g=(function(){function m(l){l.on("click",function(f){var r=f.getDocumentPosition(),o=l.session,s=o.getFoldAt(r.row,r.column,1);s&&(f.getAccelKey()?o.removeFold(s):o.expandFold(s),f.stop());var a=f.domEvent&&f.domEvent.target;a&&d.hasCssClass(a,"ace_inline_button")&&d.hasCssClass(a,"ace_toggle_wrap")&&(o.setOption("wrap",!o.getUseWrapMode()),l.renderer.scrollCursorIntoView())}),l.on("gutterclick",function(f){var r=l.renderer.$gutterLayer.getRegion(f);if(r=="foldWidgets"){var o=f.getDocumentPosition().row,s=l.session;s.foldWidgets&&s.foldWidgets[o]&&l.session.onFoldWidgetClick(o,f),l.isFocused()||l.focus(),f.stop()}}),l.on("gutterdblclick",function(f){var r=l.renderer.$gutterLayer.getRegion(f);if(r=="foldWidgets"){var o=f.getDocumentPosition().row,s=l.session,a=s.getParentFoldRangeData(o,!0),i=a.range||a.firstRange;if(i){o=i.start.row;var u=s.getFoldAt(o,s.getLine(o).length,1);u?s.removeFold(u):(s.addFold("...",i),l.renderer.scrollCursorIntoView({row:i.start.row,column:0}))}f.stop()}})}return m})();n.FoldHandler=g}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(t,n,p){var d=t("../lib/keys"),g=t("../lib/event"),m=(function(){function l(f){this.$editor=f,this.$data={editor:f},this.$handlers=[],this.setDefaultHandler(f.commands)}return l.prototype.setDefaultHandler=function(f){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=f,this.addKeyboardHandler(f,0)},l.prototype.setKeyboardHandler=function(f){var r=this.$handlers;if(r[r.length-1]!=f){for(;r[r.length-1]&&r[r.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(r[r.length-1]);this.addKeyboardHandler(f,1)}},l.prototype.addKeyboardHandler=function(f,r){if(f){typeof f=="function"&&!f.handleKeyboard&&(f.handleKeyboard=f);var o=this.$handlers.indexOf(f);o!=-1&&this.$handlers.splice(o,1),r==null?this.$handlers.push(f):this.$handlers.splice(r,0,f),o==-1&&f.attach&&f.attach(this.$editor)}},l.prototype.removeKeyboardHandler=function(f){var r=this.$handlers.indexOf(f);return r==-1?!1:(this.$handlers.splice(r,1),f.detach&&f.detach(this.$editor),!0)},l.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},l.prototype.getStatusText=function(){var f=this.$data,r=f.editor;return this.$handlers.map(function(o){return o.getStatusText&&o.getStatusText(r,f)||""}).filter(Boolean).join(" ")},l.prototype.$callKeyboardHandlers=function(f,r,o,s){for(var a,i=!1,u=this.$editor.commands,h=this.$handlers.length;h--&&(a=this.$handlers[h].handleKeyboard(this.$data,f,r,o,s),!(!(!a||!a.command)&&(a.command=="null"?i=!0:i=u.exec(a.command,this.$editor,a.args,s),i&&s&&f!=-1&&a.passEvent!=!0&&a.command.passEvent!=!0&&g.stopEvent(s),i))););return!i&&f==-1&&(a={command:"insertstring"},i=u.exec("insertstring",this.$editor,r)),i&&this.$editor._signal&&this.$editor._signal("keyboardActivity",a),i},l.prototype.onCommandKey=function(f,r,o){var s=d.keyCodeToString(o);return this.$callKeyboardHandlers(r,s,o,f)},l.prototype.onTextInput=function(f){return this.$callKeyboardHandlers(-1,f)},l})();n.KeyBinding=m}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(t,n,p){var d=0,g=0,m=!1,l=!1,f=!1,r=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],o=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],s=0,a=1,i=0,u=1,h=2,y=3,b=4,T=5,$=6,A=7,S=8,M=9,R=10,L=11,_=12,I=13,w=14,v=15,C=16,E=17,x=18,k=[x,x,x,x,x,x,x,x,x,$,T,$,S,T,x,x,x,x,x,x,x,x,x,x,x,x,x,x,T,T,T,$,S,b,b,L,L,L,b,b,b,b,b,R,M,R,M,M,h,h,h,h,h,h,h,h,h,h,M,b,b,b,b,b,b,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,b,b,b,b,b,b,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,b,b,b,b,x,x,x,x,x,x,T,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,M,b,L,L,L,L,b,b,b,b,i,b,b,x,b,b,L,L,h,h,b,i,b,b,b,h,i,b,b,b,b,b],O=[S,S,S,S,S,S,S,S,S,S,S,x,x,x,i,u,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,S,T,I,w,v,C,E,M,L,L,L,L,L,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,M,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,S];function D(F,W,H,B){var G=d?o:r,q=null,Y=null,V=null,Z=0,ue=null,Me=null,Ce=-1,he=null,ke=null,ct=[];if(!B)for(he=0,B=[];he<H;he++)B[he]=z(F[he]);for(g=d,m=!1,l=!1,f=!1,ke=0;ke<H;ke++){if(q=Z,ct[ke]=Y=P(F,B,ct,ke),Z=G[q][Y],ue=Z&240,Z&=15,W[ke]=V=G[Z][5],ue>0)if(ue==16){for(he=Ce;he<ke;he++)W[he]=1;Ce=-1}else Ce=-1;if(Me=G[Z][6],Me)Ce==-1&&(Ce=ke);else if(Ce>-1){for(he=Ce;he<ke;he++)W[he]=V;Ce=-1}B[ke]==T&&(W[ke]=0),g|=V}if(f){for(he=0;he<H;he++)if(B[he]==$){W[he]=d;for(var ut=he-1;ut>=0&&B[ut]==S;ut--)W[ut]=d}}}function N(F,W,H){if(!(g<F)){if(F==1&&d==a&&!l){H.reverse();return}for(var B=H.length,G=0,q,Y,V,Z;G<B;){if(W[G]>=F){for(q=G+1;q<B&&W[q]>=F;)q++;for(Y=G,V=q-1;Y<V;Y++,V--)Z=H[Y],H[Y]=H[V],H[V]=Z;G=q}G++}}}function P(F,W,H,B){var G=W[B],q,Y,V,Z;switch(G){case i:case u:m=!1;case b:case y:return G;case h:return m?y:h;case A:return m=!0,u;case S:return b;case M:return B<1||B+1>=W.length||(q=H[B-1])!=h&&q!=y||(Y=W[B+1])!=h&&Y!=y?b:(m&&(Y=y),Y==q?Y:b);case R:return q=B>0?H[B-1]:T,q==h&&B+1<W.length&&W[B+1]==h?h:b;case L:if(B>0&&H[B-1]==h)return h;if(m)return b;for(Z=B+1,V=W.length;Z<V&&W[Z]==L;)Z++;return Z<V&&W[Z]==h?h:b;case _:for(V=W.length,Z=B+1;Z<V&&W[Z]==_;)Z++;if(Z<V){var ue=F[B],Me=ue>=1425&&ue<=2303||ue==64286;if(q=W[Z],Me&&(q==u||q==A))return u}return B<1||(q=W[B-1])==T?b:H[B-1];case T:return m=!1,l=!0,d;case $:return f=!0,b;case I:case w:case C:case E:case v:m=!1;case x:return b}}function z(F){var W=F.charCodeAt(0),H=W>>8;return H==0?W>191?i:k[W]:H==5?/[\u0591-\u05f4]/.test(F)?u:i:H==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(F)?_:/[\u0660-\u0669\u066b-\u066c]/.test(F)?y:W==1642?L:/[\u06f0-\u06f9]/.test(F)?h:A:H==32&&W<=8287?O[W&255]:H==254&&W>=65136?A:b}n.L=i,n.R=u,n.EN=h,n.ON_R=3,n.AN=4,n.R_H=5,n.B=6,n.RLE=7,n.DOT="·",n.doBidiReorder=function(F,W,H){if(F.length<2)return{};var B=F.split(""),G=new Array(B.length),q=new Array(B.length),Y=[];d=H?a:s,D(B,Y,B.length,W);for(var V=0;V<G.length;G[V]=V,V++);N(2,Y,G),N(1,Y,G);for(var V=0;V<G.length-1;V++)W[V]===y?Y[V]=n.AN:Y[V]===u&&(W[V]>A&&W[V]<I||W[V]===b||W[V]===x)?Y[V]=n.ON_R:V>0&&B[V-1]==="ل"&&/\u0622|\u0623|\u0625|\u0627/.test(B[V])&&(Y[V-1]=Y[V]=n.R_H,V++);B[B.length-1]===n.DOT&&(Y[B.length-1]=n.B),B[0]==="‫"&&(Y[0]=n.RLE);for(var V=0;V<G.length;V++)q[V]=Y[G[V]];return{logicalFromVisual:G,bidiLevels:q}},n.hasBidiCharacters=function(F,W){for(var H=!1,B=0;B<F.length;B++)W[B]=z(F.charAt(B)),!H&&(W[B]==u||W[B]==A||W[B]==y)&&(H=!0);return H},n.getVisualFromLogicalIdx=function(F,W){for(var H=0;H<W.logicalFromVisual.length;H++)if(W.logicalFromVisual[H]==F)return H;return 0}}),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(t,n,p){var d=t("./lib/bidiutil"),g=t("./lib/lang"),m=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,l=(function(){function f(r){this.session=r,this.bidiMap={},this.currentRow=null,this.bidiUtil=d,this.charWidths=[],this.EOL="¬",this.showInvisibles=!0,this.isRtlDir=!1,this.$isRtl=!1,this.line="",this.wrapIndent=0,this.EOF="¶",this.RLE="‫",this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=m.test(r.getValue())}return f.prototype.isBidiRow=function(r,o,s){return this.seenBidi?(r!==this.currentRow&&(this.currentRow=r,this.updateRowLine(o,s),this.updateBidiMap()),this.bidiMap.bidiLevels):!1},f.prototype.onChange=function(r){this.seenBidi?this.currentRow=null:r.action=="insert"&&m.test(r.lines.join(`
1342
- `))&&(this.seenBidi=!0,this.currentRow=null)},f.prototype.getDocumentRow=function(){var r=0,o=this.session.$screenRowCache;if(o.length){var s=this.session.$getRowCacheIndex(o,this.currentRow);s>=0&&(r=this.session.$docRowCache[s])}return r},f.prototype.getSplitIndex=function(){var r=0,o=this.session.$screenRowCache;if(o.length)for(var s,a=this.session.$getRowCacheIndex(o,this.currentRow);this.currentRow-r>0&&(s=this.session.$getRowCacheIndex(o,this.currentRow-r-1),s===a);)a=s,r++;else r=this.currentRow;return r},f.prototype.updateRowLine=function(r,o){r===void 0&&(r=this.getDocumentRow());var s=r===this.session.getLength()-1,a=s?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(r),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var i=this.session.$wrapData[r];i&&(o===void 0&&(o=this.getSplitIndex()),o>0&&i.length?(this.wrapIndent=i.indent,this.wrapOffset=this.wrapIndent*this.charWidths[d.L],this.line=o<i.length?this.line.substring(i[o-1],i[o]):this.line.substring(i[i.length-1])):this.line=this.line.substring(0,i[o]),o==i.length&&(this.line+=this.showInvisibles?a:d.DOT))}else this.line+=this.showInvisibles?a:d.DOT;var u=this.session,h=0,y;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(b,T){return b===" "||u.isFullWidth(b.charCodeAt(0))?(y=b===" "?u.getScreenTabSize(T+h):2,h+=y-1,g.stringRepeat(d.DOT,y)):b}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==d.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},f.prototype.updateBidiMap=function(){var r=[];d.hasBidiCharacters(this.line,r)||this.isRtlDir?this.bidiMap=d.doBidiReorder(this.line,r,this.isRtlDir):this.bidiMap={}},f.prototype.markAsDirty=function(){this.currentRow=null},f.prototype.updateCharacterWidths=function(r){if(this.characterWidth!==r.$characterSize.width){this.fontMetrics=r;var o=this.characterWidth=r.$characterSize.width,s=r.$measureCharWidth("ה");this.charWidths[d.L]=this.charWidths[d.EN]=this.charWidths[d.ON_R]=o,this.charWidths[d.R]=this.charWidths[d.AN]=s,this.charWidths[d.R_H]=s*.45,this.charWidths[d.B]=this.charWidths[d.RLE]=0,this.currentRow=null}},f.prototype.setShowInvisibles=function(r){this.showInvisibles=r,this.currentRow=null},f.prototype.setEolChar=function(r){this.EOL=r},f.prototype.setContentWidth=function(r){this.contentWidth=r},f.prototype.isRtlLine=function(r){return this.$isRtl?!0:r!=null?this.session.getLine(r).charAt(0)==this.RLE:this.isRtlDir},f.prototype.setRtlDirection=function(r,o){for(var s=r.getCursorPosition(),a=r.selection.getSelectionAnchor().row;a<=s.row;a++)!o&&r.session.getLine(a).charAt(0)===r.session.$bidiHandler.RLE?r.session.doc.removeInLine(a,0,1):o&&r.session.getLine(a).charAt(0)!==r.session.$bidiHandler.RLE&&r.session.doc.insert({column:0,row:a},r.session.$bidiHandler.RLE)},f.prototype.getPosLeft=function(r){r-=this.wrapIndent;var o=this.line.charAt(0)===this.RLE?1:0,s=r>o?this.session.getOverwrite()?r:r-1:o,a=d.getVisualFromLogicalIdx(s,this.bidiMap),i=this.bidiMap.bidiLevels,u=0;!this.session.getOverwrite()&&r<=o&&i[a]%2!==0&&a++;for(var h=0;h<a;h++)u+=this.charWidths[i[h]];return!this.session.getOverwrite()&&r>o&&i[a]%2===0&&(u+=this.charWidths[i[a]]),this.wrapIndent&&(u+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(u+=this.rtlLineOffset),u},f.prototype.getSelections=function(r,o){var s=this.bidiMap,a=s.bidiLevels,i,u=[],h=0,y=Math.min(r,o)-this.wrapIndent,b=Math.max(r,o)-this.wrapIndent,T=!1,$=!1,A=0;this.wrapIndent&&(h+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var S,M=0;M<a.length;M++)S=s.logicalFromVisual[M],i=a[M],T=S>=y&&S<b,T&&!$?A=h:!T&&$&&u.push({left:A,width:h-A}),h+=this.charWidths[i],$=T;if(T&&M===a.length&&u.push({left:A,width:h-A}),this.isRtlDir)for(var R=0;R<u.length;R++)u[R].left+=this.rtlLineOffset;return u},f.prototype.offsetToCol=function(s){this.isRtlDir&&(s-=this.rtlLineOffset);var o=0,s=Math.max(s,0),a=0,i=0,u=this.bidiMap.bidiLevels,h=this.charWidths[u[i]];for(this.wrapIndent&&(s-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);s>a+h/2;){if(a+=h,i===u.length-1){h=0;break}h=this.charWidths[u[++i]]}return i>0&&u[i-1]%2!==0&&u[i]%2===0?(s<a&&i--,o=this.bidiMap.logicalFromVisual[i]):i>0&&u[i-1]%2===0&&u[i]%2!==0?o=1+(s>a?this.bidiMap.logicalFromVisual[i]:this.bidiMap.logicalFromVisual[i-1]):this.isRtlDir&&i===u.length-1&&h===0&&u[i-1]%2===0||!this.isRtlDir&&i===0&&u[i]%2!==0?o=1+this.bidiMap.logicalFromVisual[i]:(i>0&&u[i-1]%2!==0&&h!==0&&i--,o=this.bidiMap.logicalFromVisual[i]),o===0&&this.isRtlDir&&o++,o+this.wrapIndent},f})();n.BidiHandler=l}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(t,n,p){var d=t("./lib/oop"),g=t("./lib/lang"),m=t("./lib/event_emitter").EventEmitter,l=t("./range").Range,f=(function(){function r(o){this.session=o,this.doc=o.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var s=this;this.cursor.on("change",function(a){s.$cursorChanged=!0,s.$silent||s._emit("changeCursor"),!s.$isEmpty&&!s.$silent&&s._emit("changeSelection"),!s.$keepDesiredColumnOnChange&&a.old.column!=a.value.column&&(s.$desiredColumn=null)}),this.anchor.on("change",function(){s.$anchorChanged=!0,!s.$isEmpty&&!s.$silent&&s._emit("changeSelection")})}return r.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},r.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},r.prototype.getCursor=function(){return this.lead.getPosition()},r.prototype.setAnchor=function(o,s){this.$isEmpty=!1,this.anchor.setPosition(o,s)},r.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},r.prototype.getSelectionLead=function(){return this.lead.getPosition()},r.prototype.isBackwards=function(){var o=this.anchor,s=this.lead;return o.row>s.row||o.row==s.row&&o.column>s.column},r.prototype.getRange=function(){var o=this.anchor,s=this.lead;return this.$isEmpty?l.fromPoints(s,s):this.isBackwards()?l.fromPoints(s,o):l.fromPoints(o,s)},r.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},r.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},r.prototype.setRange=function(o,s){var a=s?o.end:o.start,i=s?o.start:o.end;this.$setSelection(a.row,a.column,i.row,i.column)},r.prototype.$setSelection=function(o,s,a,i){if(!this.$silent){var u=this.$isEmpty,h=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(o,s),this.cursor.setPosition(a,i),this.$isEmpty=!l.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||u!=this.$isEmpty||h)&&this._emit("changeSelection")}},r.prototype.$moveSelection=function(o){var s=this.lead;this.$isEmpty&&this.setSelectionAnchor(s.row,s.column),o.call(this)},r.prototype.selectTo=function(o,s){this.$moveSelection(function(){this.moveCursorTo(o,s)})},r.prototype.selectToPosition=function(o){this.$moveSelection(function(){this.moveCursorToPosition(o)})},r.prototype.moveTo=function(o,s){this.clearSelection(),this.moveCursorTo(o,s)},r.prototype.moveToPosition=function(o){this.clearSelection(),this.moveCursorToPosition(o)},r.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},r.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},r.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},r.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},r.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},r.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},r.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},r.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},r.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},r.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},r.prototype.getWordRange=function(o,s){if(typeof s>"u"){var a=o||this.lead;o=a.row,s=a.column}return this.session.getWordRange(o,s)},r.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},r.prototype.selectAWord=function(){var o=this.getCursor(),s=this.session.getAWordRange(o.row,o.column);this.setSelectionRange(s)},r.prototype.getLineRange=function(o,s){var a=typeof o=="number"?o:this.lead.row,i,u=this.session.getFoldLine(a);return u?(a=u.start.row,i=u.end.row):i=a,s===!0?new l(a,0,i,this.session.getLine(i).length):new l(a,0,i+1,0)},r.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},r.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},r.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},r.prototype.wouldMoveIntoSoftTab=function(o,s,a){var i=o.column,u=o.column+s;return a<0&&(i=o.column-s,u=o.column),this.session.isTabStop(o)&&this.doc.getLine(o.row).slice(i,u).split(" ").length-1==s},r.prototype.moveCursorLeft=function(){var o=this.lead.getPosition(),s;if(s=this.session.getFoldAt(o.row,o.column,-1))this.moveCursorTo(s.start.row,s.start.column);else if(o.column===0)o.row>0&&this.moveCursorTo(o.row-1,this.doc.getLine(o.row-1).length);else{var a=this.session.getTabSize();this.wouldMoveIntoSoftTab(o,a,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-a):this.moveCursorBy(0,-1)}},r.prototype.moveCursorRight=function(){var o=this.lead.getPosition(),s;if(s=this.session.getFoldAt(o.row,o.column,1))this.moveCursorTo(s.end.row,s.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0);else{var a=this.session.getTabSize(),o=this.lead;this.wouldMoveIntoSoftTab(o,a,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,a):this.moveCursorBy(0,1)}},r.prototype.moveCursorLineStart=function(){var o=this.lead.row,s=this.lead.column,a=this.session.documentToScreenRow(o,s),i=this.session.screenToDocumentPosition(a,0),u=this.session.getDisplayLine(o,null,i.row,i.column),h=u.match(/^\s*/);h[0].length!=s&&!this.session.$useEmacsStyleLineStart&&(i.column+=h[0].length),this.moveCursorToPosition(i)},r.prototype.moveCursorLineEnd=function(){var o=this.lead,s=this.session.getDocumentLastRowColumnPosition(o.row,o.column);if(this.lead.column==s.column){var a=this.session.getLine(s.row);if(s.column==a.length){var i=a.search(/\s+$/);i>0&&(s.column=i)}}this.moveCursorTo(s.row,s.column)},r.prototype.moveCursorFileEnd=function(){var o=this.doc.getLength()-1,s=this.doc.getLine(o).length;this.moveCursorTo(o,s)},r.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},r.prototype.moveCursorLongWordRight=function(){var o=this.lead.row,s=this.lead.column,a=this.doc.getLine(o),i=a.substring(s);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var u=this.session.getFoldAt(o,s,1);if(u){this.moveCursorTo(u.end.row,u.end.column);return}if(this.session.nonTokenRe.exec(i)&&(s+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,i=a.substring(s)),s>=a.length){this.moveCursorTo(o,a.length),this.moveCursorRight(),o<this.doc.getLength()-1&&this.moveCursorWordRight();return}this.session.tokenRe.exec(i)&&(s+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(o,s)},r.prototype.moveCursorLongWordLeft=function(){var o=this.lead.row,s=this.lead.column,a;if(a=this.session.getFoldAt(o,s,-1)){this.moveCursorTo(a.start.row,a.start.column);return}var i=this.session.getFoldStringAt(o,s,-1);i==null&&(i=this.doc.getLine(o).substring(0,s));var u=g.stringReverse(i);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(u)&&(s-=this.session.nonTokenRe.lastIndex,u=u.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),s<=0){this.moveCursorTo(o,0),this.moveCursorLeft(),o>0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(u)&&(s-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(o,s)},r.prototype.$shortWordEndIndex=function(o){var s=0,a,i=/\s/,u=this.session.tokenRe;if(u.lastIndex=0,this.session.tokenRe.exec(o))s=this.session.tokenRe.lastIndex;else{for(;(a=o[s])&&i.test(a);)s++;if(s<1){for(u.lastIndex=0;(a=o[s])&&!u.test(a);)if(u.lastIndex=0,s++,i.test(a))if(s>2){s--;break}else{for(;(a=o[s])&&i.test(a);)s++;if(s>2)break}}}return u.lastIndex=0,s},r.prototype.moveCursorShortWordRight=function(){var o=this.lead.row,s=this.lead.column,a=this.doc.getLine(o),i=a.substring(s),u=this.session.getFoldAt(o,s,1);if(u)return this.moveCursorTo(u.end.row,u.end.column);if(s==a.length){var h=this.doc.getLength();do o++,i=this.doc.getLine(o);while(o<h&&/^\s*$/.test(i));/^\s+/.test(i)||(i=""),s=0}var y=this.$shortWordEndIndex(i);this.moveCursorTo(o,s+y)},r.prototype.moveCursorShortWordLeft=function(){var o=this.lead.row,s=this.lead.column,a;if(a=this.session.getFoldAt(o,s,-1))return this.moveCursorTo(a.start.row,a.start.column);var i=this.session.getLine(o).substring(0,s);if(s===0){do o--,i=this.doc.getLine(o);while(o>0&&/^\s*$/.test(i));s=i.length,/\s+$/.test(i)||(i="")}var u=g.stringReverse(i),h=this.$shortWordEndIndex(u);return this.moveCursorTo(o,s-h)},r.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},r.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},r.prototype.moveCursorBy=function(o,s){var a=this.session.documentToScreenPosition(this.lead.row,this.lead.column),i;if(s===0&&(o!==0&&(this.session.$bidiHandler.isBidiRow(a.row,this.lead.row)?(i=this.session.$bidiHandler.getPosLeft(a.column),a.column=Math.round(i/this.session.$bidiHandler.charWidths[0])):i=a.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?a.column=this.$desiredColumn:this.$desiredColumn=a.column),o!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var u=this.session.lineWidgets[this.lead.row];o<0?o-=u.rowsAbove||0:o>0&&(o+=u.rowCount-(u.rowsAbove||0))}var h=this.session.screenToDocumentPosition(a.row+o,a.column,i);o!==0&&s===0&&h.row===this.lead.row&&(h.column,this.lead.column),this.moveCursorTo(h.row,h.column+s,s===0)},r.prototype.moveCursorToPosition=function(o){this.moveCursorTo(o.row,o.column)},r.prototype.moveCursorTo=function(o,s,a){var i=this.session.getFoldAt(o,s,1);i&&(o=i.start.row,s=i.start.column),this.$keepDesiredColumnOnChange=!0;var u=this.session.getLine(o);/[\uDC00-\uDFFF]/.test(u.charAt(s))&&u.charAt(s-1)&&(this.lead.row==o&&this.lead.column==s+1?s=s-1:s=s+1),this.lead.setPosition(o,s),this.$keepDesiredColumnOnChange=!1,a||(this.$desiredColumn=null)},r.prototype.moveCursorToScreen=function(o,s,a){var i=this.session.screenToDocumentPosition(o,s);this.moveCursorTo(i.row,i.column,a)},r.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},r.prototype.fromOrientedRange=function(o){this.setSelectionRange(o,o.cursor==o.start),this.$desiredColumn=o.desiredColumn||this.$desiredColumn},r.prototype.toOrientedRange=function(o){var s=this.getRange();return o?(o.start.column=s.start.column,o.start.row=s.start.row,o.end.column=s.end.column,o.end.row=s.end.row):o=s,o.cursor=this.isBackwards()?o.start:o.end,o.desiredColumn=this.$desiredColumn,o},r.prototype.getRangeOfMovements=function(o){var s=this.getCursor();try{o(this);var a=this.getCursor();return l.fromPoints(s,a)}catch{return l.fromPoints(s,s)}finally{this.moveCursorToPosition(s)}},r.prototype.toJSON=function(){if(this.rangeCount)var o=this.ranges.map(function(s){var a=s.clone();return a.isBackwards=s.cursor==s.start,a});else{var o=this.getRange();o.isBackwards=this.isBackwards()}return o},r.prototype.fromJSON=function(o){if(o.start==null)if(this.rangeList&&o.length>1){this.toSingleRange(o[0]);for(var s=o.length;s--;){var a=l.fromPoints(o[s].start,o[s].end);o[s].isBackwards&&(a.cursor=a.start),this.addRange(a,!0)}return}else o=o[0];this.rangeList&&this.toSingleRange(o),this.setSelectionRange(o,o.isBackwards)},r.prototype.isEqual=function(o){if((o.length||this.rangeCount)&&o.length!=this.rangeCount)return!1;if(!o.length||!this.ranges)return this.getRange().isEqual(o);for(var s=this.ranges.length;s--;)if(!this.ranges[s].isEqual(o[s]))return!1;return!0},r})();f.prototype.setSelectionAnchor=f.prototype.setAnchor,f.prototype.getSelectionAnchor=f.prototype.getAnchor,f.prototype.setSelectionRange=f.prototype.setRange,d.implement(f.prototype,m),n.Selection=f}),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(t,n,p){var d=t("./lib/report_error").reportError,g=2e3,m=(function(){function l(f){this.splitRegex,this.states=f,this.regExps={},this.matchMappings={};for(var r in this.states){for(var o=this.states[r],s=[],a=0,i=this.matchMappings[r]={defaultToken:"text"},u="g",h=[],y=0;y<o.length;y++){var b=o[y];if(b.defaultToken&&(i.defaultToken=b.defaultToken),b.caseInsensitive&&u.indexOf("i")===-1&&(u+="i"),b.unicode&&u.indexOf("u")===-1&&(u+="u"),b.regex!=null){b.regex instanceof RegExp&&(b.regex=b.regex.toString().slice(1,-1));var T=b.regex,$=new RegExp("(?:("+T+")|(.))").exec("a").length-2;Array.isArray(b.token)?b.token.length==1||$==1?b.token=b.token[0]:$-1!=b.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:b,groupCount:$-1}),b.token=b.token[0]):(b.tokenArray=b.token,b.token=null,b.onMatch=this.$arrayTokens):typeof b.token=="function"&&!b.onMatch&&($>1?b.onMatch=this.$applyToken:b.onMatch=b.token),$>1&&(/\\\d/.test(b.regex)?T=b.regex.replace(/\\([0-9]+)/g,function(A,S){return"\\"+(parseInt(S,10)+a+1)}):($=1,T=this.removeCapturingGroups(b.regex)),!b.splitRegex&&typeof b.token!="string"&&h.push(b)),i[a]=y,a+=$,s.push(T),b.onMatch||(b.onMatch=null)}}s.length||(i[0]=0,s.push("$")),h.forEach(function(A){A.splitRegex=this.createSplitterRegexp(A.regex,u)},this),this.regExps[r]=new RegExp("("+s.join(")|(")+")|($)",u)}}return l.prototype.$setMaxTokenCount=function(f){g=f|0},l.prototype.$applyToken=function(f){var r=this.splitRegex.exec(f).slice(1),o=this.token.apply(this,r);if(typeof o=="string")return[{type:o,value:f}];for(var s=[],a=0,i=o.length;a<i;a++)r[a]&&(s[s.length]={type:o[a],value:r[a]});return s},l.prototype.$arrayTokens=function(f){if(!f)return[];var r=this.splitRegex.exec(f);if(!r)return"text";for(var o=[],s=this.tokenArray,a=0,i=s.length;a<i;a++)r[a+1]&&(o[o.length]={type:s[a],value:r[a+1]});return o},l.prototype.removeCapturingGroups=function(f){var r=f.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,function(o,s){return s?"(?:":o});return r},l.prototype.createSplitterRegexp=function(f,r){if(f.indexOf("(?=")!=-1){var o=0,s=!1,a={};f.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(i,u,h,y,b,T){return s?s=b!="]":b?s=!0:y?(o==a.stack&&(a.end=T+1,a.stack=-1),o--):h&&(o++,h.length!=1&&(a.stack=o,a.start=T)),i}),a.end!=null&&/^\)*$/.test(f.substr(a.end))&&(f=f.substring(0,a.start)+f.substr(a.end))}return f.charAt(0)!="^"&&(f="^"+f),f.charAt(f.length-1)!="$"&&(f+="$"),new RegExp(f,(r||"").replace("g",""))},l.prototype.getLineTokens=function(f,r){if(r&&typeof r!="string"){var o=r.slice(0);r=o[0],r==="#tmp"&&(o.shift(),r=o.shift())}else var o=[];var s=r||"start",a=this.states[s];a||(s="start",a=this.states[s]);var i=this.matchMappings[s],u=this.regExps[s];u.lastIndex=0;for(var h,y=[],b=0,T=0,$={type:null,value:""};h=u.exec(f);){var A=i.defaultToken,S=null,M=h[0],R=u.lastIndex;if(R-M.length>b){var L=f.substring(b,R-M.length);$.type==A?$.value+=L:($.type&&y.push($),$={type:A,value:L})}for(var _=0;_<h.length-2;_++)if(h[_+1]!==void 0){S=a[i[_]],S.onMatch?A=S.onMatch(M,s,o,f):A=S.token,S.next&&(typeof S.next=="string"?s=S.next:s=S.next(s,o),a=this.states[s],a||(this.reportError("state doesn't exist",s),s="start",a=this.states[s]),i=this.matchMappings[s],b=R,u=this.regExps[s],u.lastIndex=R),S.consumeLineEnd&&(b=R);break}if(M){if(typeof A=="string")(!S||S.merge!==!1)&&$.type===A?$.value+=M:($.type&&y.push($),$={type:A,value:M});else if(A){$.type&&y.push($),$={type:null,value:""};for(var _=0;_<A.length;_++)y.push(A[_])}}if(b==f.length)break;if(b=R,T++>g){for(T>2*f.length&&this.reportError("infinite loop with in ace tokenizer",{startState:r,line:f});b<f.length;)$.type&&y.push($),$={value:f.substring(b,b+=500),type:"overflow"};s="start",o=[];break}}return $.type&&y.push($),o.length>1&&o[0]!==s&&o.unshift("#tmp",s),{tokens:y,state:o.length?o:s}},l})();m.prototype.reportError=d,n.Tokenizer=m}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(t,n,p){var d=t("../lib/deep_copy").deepCopy,g;g=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}},(function(){this.addRules=function(f,r){if(!r){for(var o in f)this.$rules[o]=f[o];return}for(var o in f){for(var s=f[o],a=0;a<s.length;a++){var i=s[a];(i.next||i.onMatch)&&(typeof i.next=="string"&&i.next.indexOf(r)!==0&&(i.next=r+i.next),i.nextState&&i.nextState.indexOf(r)!==0&&(i.nextState=r+i.nextState))}this.$rules[r+o]=s}},this.getRules=function(){return this.$rules},this.embedRules=function(f,r,o,s,a){var i=typeof f=="function"?new f().getRules():f;if(s)for(var u=0;u<s.length;u++)s[u]=r+s[u];else{s=[];for(var h in i)s.push(r+h)}if(this.addRules(i,r),o)for(var y=Array.prototype[a?"push":"unshift"],u=0;u<s.length;u++)y.apply(this.$rules[s[u]],d(o));this.$embeds||(this.$embeds=[]),this.$embeds.push(r)},this.getEmbeds=function(){return this.$embeds};var m=function(f,r){return(f!="start"||r.length)&&r.unshift(this.nextState,f),this.nextState},l=function(f,r){return r.shift(),r.shift()||"start"};this.normalizeRules=function(){var f=0,r=this.$rules;function o(s){var a=r[s];a.processed=!0;for(var i=0;i<a.length;i++){var u=a[i],h=null;Array.isArray(u)&&(h=u,u={}),!u.regex&&u.start&&(u.regex=u.start,u.next||(u.next=[]),u.next.push({defaultToken:u.token},{token:u.token+".end",regex:u.end||u.start,next:"pop"}),u.token=u.token+".start",u.push=!0);var y=u.next||u.push;if(y&&Array.isArray(y)){var b=u.stateName;b||(b=u.token,typeof b!="string"&&(b=b[0]||""),r[b]&&(b+=f++)),r[b]=y,u.next=b,o(b)}else y=="pop"&&(u.next=l);if(u.push&&(u.nextState=u.next||u.push,u.next=m,delete u.push),u.rules)for(var T in u.rules)r[T]?r[T].push&&r[T].push.apply(r[T],u.rules[T]):r[T]=u.rules[T];var $=typeof u=="string"?u:u.include;if($&&($==="$self"&&($="start"),Array.isArray($)?h=$.map(function(S){return r[S]}):h=r[$]),h){var A=[i,1].concat(h);u.noEscape&&(A=A.filter(function(S){return!S.next})),a.splice.apply(a,A),i--}u.keywordMap&&(u.token=this.createKeywordMapper(u.keywordMap,u.defaultToken||"text",u.caseInsensitive),delete u.defaultToken)}}Object.keys(r).forEach(o,this)},this.createKeywordMapper=function(f,r,o,s){var a=Object.create(null);return this.$keywordList=[],Object.keys(f).forEach(function(i){for(var u=f[i],h=u.split(s||"|"),y=h.length;y--;){var b=h[y];this.$keywordList.push(b),o&&(b=b.toLowerCase()),a[b]=i}},this),f=null,o?function(i){return a[i.toLowerCase()]||r}:function(i){return a[i]||r}},this.getKeywords=function(){return this.$keywords}}).call(g.prototype),n.TextHighlightRules=g}),ace.define("ace/mode/behaviour",["require","exports","module"],function(t,n,p){var d;d=function(){this.$behaviours={}},(function(){this.add=function(g,m,l){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[g]:this.$behaviours[g]={}}this.$behaviours[g][m]=l},this.addBehaviours=function(g){for(var m in g)for(var l in g[m])this.add(m,l,g[m][l])},this.remove=function(g){this.$behaviours&&this.$behaviours[g]&&delete this.$behaviours[g]},this.inherit=function(g,m){if(typeof g=="function")var l=new g().getBehaviours(m);else var l=g.getBehaviours(m);this.addBehaviours(l)},this.getBehaviours=function(g){if(g){for(var m={},l=0;l<g.length;l++)this.$behaviours[g[l]]&&(m[g[l]]=this.$behaviours[g[l]]);return m}else return this.$behaviours}}).call(d.prototype),n.Behaviour=d}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(t,n,p){var d=t("./range").Range,g=(function(){function m(l,f,r){this.$session=l,this.$row=f,this.$rowTokens=l.getTokens(f);var o=l.getTokenAt(f,r);this.$tokenIndex=o?o.index:-1}return m.prototype.stepBackward=function(){for(this.$tokenIndex-=1;this.$tokenIndex<0;){if(this.$row-=1,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},m.prototype.stepForward=function(){this.$tokenIndex+=1;for(var l;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,l||(l=this.$session.getLength()),this.$row>=l)return this.$row=l-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},m.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},m.prototype.getCurrentTokenRow=function(){return this.$row},m.prototype.getCurrentTokenColumn=function(){var l=this.$rowTokens,f=this.$tokenIndex,r=l[f].start;if(r!==void 0)return r;for(r=0;f>0;)f-=1,r+=l[f].value.length;return r},m.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},m.prototype.getCurrentTokenRange=function(){var l=this.$rowTokens[this.$tokenIndex],f=this.getCurrentTokenColumn();return new d(this.$row,f,this.$row,f+l.value.length)},m})();n.TokenIterator=g}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(t,n,p){var d=t("../../lib/oop"),g=t("../behaviour").Behaviour,m=t("../../token_iterator").TokenIterator,l=t("../../lib/lang"),f=["text","paren.rparen","rparen","paren","punctuation.operator"],r=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],o,s={},a={'"':'"',"'":"'"},i=function(y){var b=-1;if(y.multiSelect&&(b=y.selection.index,s.rangeCount!=y.multiSelect.rangeCount&&(s={rangeCount:y.multiSelect.rangeCount})),s[b])return o=s[b];o=s[b]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},u=function(y,b,T,$){var A=y.end.row-y.start.row;return{text:T+b+$,selection:[0,y.start.column+1,A,y.end.column+(A?0:1)]}},h;h=function(y){y=y||{},this.add("braces","insertion",function(b,T,$,A,S){var M=$.getCursorPosition(),R=A.doc.getLine(M.row);if(S=="{"){i($);var L=$.getSelectionRange(),_=A.doc.getTextRange(L),I=A.getTokenAt(M.row,M.column);if(_!==""&&_!=="{"&&$.getWrapBehavioursEnabled())return u(L,_,"{","}");if(I&&/(?:string)\.quasi|\.xml/.test(I.type)){var w=[/tag\-(?:open|name)/,/attribute\-name/];return w.some(function(D){return D.test(I.type)})||/(string)\.quasi/.test(I.type)&&I.value[M.column-I.start-1]!=="$"?void 0:(h.recordAutoInsert($,A,"}"),{text:"{}",selection:[1,1]})}else if(h.isSaneInsertion($,A))return/[\]\}\)]/.test(R[M.column])||$.inMultiSelectMode||y.braces?(h.recordAutoInsert($,A,"}"),{text:"{}",selection:[1,1]}):(h.recordMaybeInsert($,A,"{"),{text:"{",selection:[1,1]})}else if(S=="}"){i($);var v=R.substring(M.column,M.column+1);if(v=="}"){var C=A.$findOpeningBracket("}",{column:M.column+1,row:M.row});if(C!==null&&h.isAutoInsertedClosing(M,R,S))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(S==`
1331
+ `;X!=M.value&&(M.value=E=X);var ee=4,re=4+(j.length||(S.selection.isEmpty()?0:1));(x!=ee||k!=re)&&M.setSelectionRange(ee,re),x=ee,k=re}}:function(){if(!(_||O)&&!(!z&&!q)){_=!0;var j=0,X=0,ee="";if(S.session){var re=S.selection,ae=re.getRange(),ge=re.cursor.row;ge===N+1?(I=N+1,N=I+2*P):ge===I-1?(N=I-1,I=N-2*P):(ge<I-1||ge>N+1)&&(I=ge>P?ge-P:0,N=ge>P?ge+P:2*P);for(var ye=[],me=I;me<=N;me++)ye.push(S.session.getLine(me));if(ee=ye.join(`
1332
+ `),j=F(ae.start.row,ae.start.column),X=F(ae.end.row,ae.end.column),ae.start.row<I){var de=S.session.getLine(I-1);j=ae.start.row<I-1?0:j,X+=de.length+1,ee=de+`
1333
+ `+ee}else if(ae.end.row>N){var le=S.session.getLine(N+1);X=ae.end.row>N+1?le.length:ae.end.column,X+=ee.length+1,ee=ee+`
1334
+ `+le}else T&&ge>0&&(ee=`
1335
+ `+ee,X+=1,j+=1);ee.length>i&&(j<i&&X<i?ee=ee.slice(0,i):(ee=`
1336
+ `,j==X?j=X=0:(j=0,X=1)));var _e=ee+`
1337
+
1338
+ `;_e!=E&&(M.value=E=_e,x=k=_e.length)}if(q&&(x=M.selectionStart,k=M.selectionEnd),k!=X||x!=j||M.selectionEnd!=k)try{M.setSelectionRange(j,X),x=j,k=X}catch{}_=!1}};this.resetSelection=W,z&&S.onFocus();var H=function(j){return j.selectionStart===0&&j.selectionEnd>=E.length&&j.value===E&&E&&j.selectionEnd!==k},B=function(j){_||(R?R=!1:H(M)?(S.selectAll(),W()):T&&M.selectionStart!=x&&W())},G=null;this.setInputHandler=function(j){G=j},this.getInputHandler=function(){return G};var q=!1,Y=function(j,X){if(q&&(q=!1),L)return W(),j&&S.onPaste(j),L=!1,"";for(var ee=M.selectionStart,re=M.selectionEnd,ae=x,ge=E.length-k,ye=j,me=j.length-ee,de=j.length-re,le=0;ae>0&&E[le]==j[le];)le++,ae--;for(ye=ye.slice(le),le=1;ge>0&&E.length-le>x-1&&E[E.length-le]==j[j.length-le];)le++,ge--;me-=le-1,de-=le-1;var _e=ye.length-le+1;if(_e<0&&(ae=-_e,_e=0),ye=ye.slice(0,_e),!X&&!ye&&!me&&!ae&&!ge&&!de)return"";O=!0;var It=!1;return m.isAndroid&&ye==". "&&(ye=" ",It=!0),ye&&!ae&&!ge&&!me&&!de||v?S.onTextInput(ye):S.onTextInput(ye,{extendLeft:ae,extendRight:ge,restoreStart:me,restoreEnd:de}),O=!1,E=j,x=ee,k=re,D=de,It?`
1339
+ `:ye},V=function(j){if(_)return ut();if(j&&j.inputType){if(j.inputType=="historyUndo")return S.execCommand("undo");if(j.inputType=="historyRedo")return S.execCommand("redo")}var X=M.value,ee=Y(X,!0);(X.length>i+100||b.test(ee)||T&&x<1&&x==k)&&W()},Z=function(j,X,ee){var re=j.clipboardData||window.clipboardData;if(!(!re||o)){var ae=s||ee?"Text":"text/plain";try{return X?re.setData(ae,X)!==!1:re.getData(ae)}catch(ge){if(!ee)return Z(ge,X,!0)}}},ue=function(j,X){var ee=S.getCopyText();if(!ee)return d.preventDefault(j);Z(j,ee)?(y&&(W(ee),R=ee,setTimeout(function(){R=!1},10)),X?S.onCut():S.onCopy(),d.preventDefault(j)):(R=!0,M.value=ee,M.select(),setTimeout(function(){R=!1,W(),X?S.onCut():S.onCopy()}))},Me=function(j){ue(j,!0)},Ce=function(j){ue(j,!1)},he=function(j){var X=Z(j);r.pasteCancelled()||(typeof X=="string"?(X&&S.onPaste(X,j),m.isIE&&setTimeout(W),d.preventDefault(j)):(M.value="",L=!0))};d.addCommandKeyListener(M,function(j,X,ee){if(!_)return S.onCommandKey(j,X,ee)},S),d.addListener(M,"select",B,S),d.addListener(M,"input",V,S),d.addListener(M,"cut",Me,S),d.addListener(M,"copy",Ce,S),d.addListener(M,"paste",he,S),(!("oncut"in M)||!("oncopy"in M)||!("onpaste"in M))&&d.addListener(A,"keydown",function(j){if(!(m.isMac&&!j.metaKey||!j.ctrlKey))switch(j.keyCode){case 67:Ce(j);break;case 86:he(j);break;case 88:Me(j);break}},S);var ke=function(j){if(!(_||!S.onCompositionStart||S.$readOnly)&&(_={},!v)){j.data&&(_.useTextareaForIME=!1),setTimeout(ut,0),S._signal("compositionStart"),S.on("mousedown",Xn);var X=S.getSelectionRange();X.end.row=X.start.row,X.end.column=X.start.column,_.markerRange=X,_.selectionStart=x,S.onCompositionStart(_),_.useTextareaForIME?(E=M.value="",x=0,k=0):(M.msGetInputContext&&(_.context=M.msGetInputContext()),M.getInputContext&&(_.context=M.getInputContext()))}},ut=function(){if(!(!_||!S.onCompositionUpdate||S.$readOnly)){if(v)return Xn();if(_.useTextareaForIME)S.onCompositionUpdate(M.value);else{var j=M.value;Y(j),_.markerRange&&(_.context&&(_.markerRange.start.column=_.selectionStart=_.context.compositionStartOffset),_.markerRange.end.column=_.markerRange.start.column+k-_.selectionStart+D)}}},ht=function(j){!S.onCompositionEnd||S.$readOnly||(_=!1,S.onCompositionEnd(),S.off("mousedown",Xn),j&&V())};function Xn(){C=!0,M.blur(),M.focus(),C=!1}var la=f.delayedCall(ut,50).schedule.bind(null,null);function cd(j){j.keyCode==27&&M.value.length<M.selectionStart&&(_||(E=M.value),x=k=-1,W()),la()}d.addListener(M,"compositionstart",ke,S),d.addListener(M,"compositionupdate",ut,S),d.addListener(M,"keyup",cd,S),d.addListener(M,"keydown",la,S),d.addListener(M,"compositionend",ht,S),this.getElement=function(){return M},this.setCommandMode=function(j){v=j,M.readOnly=!1},this.setReadOnly=function(j){v||(M.readOnly=j)},this.setCopyWithEmptySelection=function(j){},this.onContextMenu=function(j){q=!0,W(),S._emit("nativecontextmenu",{target:S,domEvent:j}),this.moveToMouse(j,!0)},this.moveToMouse=function(j,X){w||(w=M.style.cssText),M.style.cssText=(X?"z-index:100000;":"")+(m.isIE?"opacity:0.1;":"")+"text-indent: -"+(x+k)*S.renderer.characterWidth*.5+"px;";var ee=S.container.getBoundingClientRect(),re=c.computedStyle(S.container),ae=ee.top+(parseInt(re.borderTopWidth)||0),ge=ee.left+(parseInt(ee.borderLeftWidth)||0),ye=ee.bottom-ae-M.clientHeight-2,me=function(de){c.translate(M,de.clientX-ge-2,Math.min(de.clientY-ae-2,ye))};me(j),j.type=="mousedown"&&(S.renderer.$isMousePressed=!0,clearTimeout(Qn),m.isWin&&d.capture(S.container,me,sn))},this.onContextMenuClose=sn;var Qn;function sn(){clearTimeout(Qn),Qn=setTimeout(function(){w&&(M.style.cssText=w,w=""),S.renderer.$isMousePressed=!1,S.renderer.$keepTextAreaAtCursor&&S.renderer.$moveTextAreaToCursor()},0)}var Zn=function(j){S.textInput.onContextMenu(j),sn()};d.addListener(M,"mouseup",Zn,S),d.addListener(M,"mousedown",function(j){j.preventDefault(),sn()},S),d.addListener(S.renderer.scroller,"contextmenu",Zn,S),d.addListener(M,"contextmenu",Zn,S),y&&ud(A,S,M);function ud(j,X,ee){var re=null,ae=!1;ee.addEventListener("keydown",function(ye){re&&clearTimeout(re),ae=!0},!0),ee.addEventListener("keyup",function(ye){re=setTimeout(function(){ae=!1},100)},!0);var ge=function(ye){if(document.activeElement===ee&&!(ae||_||X.$mouseHandler.isMousePressed)&&!R){var me=ee.selectionStart,de=ee.selectionEnd,le=null,_e=0;if(me==0?le=u.up:me==1?le=u.home:de>k&&E[de]==`
1340
+ `?le=u.end:me<x&&E[me-1]==" "?(le=u.left,_e=h.option):me<x||me==x&&k!=x&&me==de?le=u.left:de>k&&E.slice(0,de).split(`
1341
+ `).length>2?le=u.down:de>k&&E[de-1]==" "?(le=u.right,_e=h.option):(de>k||de==k&&k!=x&&me==de)&&(le=u.right),me!==de&&(_e|=h.shift),le){var It=X.onCommandKey({},_e,le);if(!It&&X.commands){le=u.keyCodeToString(le);var ca=X.commands.findKeyCommand(_e,le);ca&&X.execCommand(ca)}x=me,k=de,W("")}}};document.addEventListener("selectionchange",ge),X.on("destroy",function(){document.removeEventListener("selectionchange",ge)})}this.destroy=function(){M.parentElement&&M.parentElement.removeChild(M)}},n.TextInput=$,n.$setUserAgentForTests=function(A,S){T=A,y=S}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(t,n,p){var d=t("../lib/useragent"),g=0,m=550,c=(function(){function o(s){s.$clickSelection=null;var a=s.editor;a.setDefaultHandler("mousedown",this.onMouseDown.bind(s)),a.setDefaultHandler("dblclick",this.onDoubleClick.bind(s)),a.setDefaultHandler("tripleclick",this.onTripleClick.bind(s)),a.setDefaultHandler("quadclick",this.onQuadClick.bind(s)),a.setDefaultHandler("mousewheel",this.onMouseWheel.bind(s));var i=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];i.forEach(function(u){s[u]=this[u]},this),s.selectByLines=this.extendSelectionBy.bind(s,"getLineRange"),s.selectByWords=this.extendSelectionBy.bind(s,"getWordRange")}return o.prototype.onMouseDown=function(s){var a=s.inSelection(),i=s.getDocumentPosition();this.mousedownEvent=s;var u=this.editor,h=s.getButton();if(h!==0){var y=u.getSelectionRange(),b=y.isEmpty();(b||h==1)&&u.selection.moveToPosition(i),h==2&&(u.textInput.onContextMenu(s.domEvent),d.isMozilla||s.preventDefault());return}if(this.mousedownEvent.time=Date.now(),a&&!u.isFocused()&&(u.focus(),this.$focusTimeout&&!this.$clickSelection&&!u.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(s);return}return this.captureMouse(s),this.startSelect(i,s.domEvent._clicks>1),s.preventDefault()},o.prototype.startSelect=function(s,a){s=s||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var i=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?i.selection.selectToPosition(s):a||i.selection.moveToPosition(s),a||this.select(),i.setStyle("ace_selecting"),this.setState("select"))},o.prototype.select=function(){var s,a=this.editor,i=a.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var u=this.$clickSelection.comparePoint(i);if(u==-1)s=this.$clickSelection.end;else if(u==1)s=this.$clickSelection.start;else{var h=r(this.$clickSelection,i);i=h.cursor,s=h.anchor}a.selection.setSelectionAnchor(s.row,s.column)}a.selection.selectToPosition(i),a.renderer.scrollCursorIntoView()},o.prototype.extendSelectionBy=function(s){var a,i=this.editor,u=i.renderer.screenToTextCoordinates(this.x,this.y),h=i.selection[s](u.row,u.column);if(this.$clickSelection){var y=this.$clickSelection.comparePoint(h.start),b=this.$clickSelection.comparePoint(h.end);if(y==-1&&b<=0)a=this.$clickSelection.end,(h.end.row!=u.row||h.end.column!=u.column)&&(u=h.start);else if(b==1&&y>=0)a=this.$clickSelection.start,(h.start.row!=u.row||h.start.column!=u.column)&&(u=h.end);else if(y==-1&&b==1)u=h.end,a=h.start;else{var T=r(this.$clickSelection,u);u=T.cursor,a=T.anchor}i.selection.setSelectionAnchor(a.row,a.column)}i.selection.selectToPosition(u),i.renderer.scrollCursorIntoView()},o.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},o.prototype.focusWait=function(){var s=f(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),a=Date.now();(s>g||a-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},o.prototype.onDoubleClick=function(s){var a=s.getDocumentPosition(),i=this.editor,u=i.session,h=u.getBracketRange(a);h?(h.isEmpty()&&(h.start.column--,h.end.column++),this.setState("select")):(h=i.selection.getWordRange(a.row,a.column),this.setState("selectByWords")),this.$clickSelection=h,this.select()},o.prototype.onTripleClick=function(s){var a=s.getDocumentPosition(),i=this.editor;this.setState("selectByLines");var u=i.getSelectionRange();u.isMultiLine()&&u.contains(a.row,a.column)?(this.$clickSelection=i.selection.getLineRange(u.start.row),this.$clickSelection.end=i.selection.getLineRange(u.end.row).end):this.$clickSelection=i.selection.getLineRange(a.row),this.select()},o.prototype.onQuadClick=function(s){var a=this.editor;a.selectAll(),this.$clickSelection=a.getSelectionRange(),this.setState("selectAll")},o.prototype.onMouseWheel=function(s){if(!s.getAccelKey()){s.getShiftKey()&&s.wheelY&&!s.wheelX&&(s.wheelX=s.wheelY,s.wheelY=0);var a=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var i=this.$lastScroll,u=s.domEvent.timeStamp,h=u-i.t,y=h?s.wheelX/h:i.vx,b=h?s.wheelY/h:i.vy;h<m&&(y=(y+i.vx)/2,b=(b+i.vy)/2);var T=Math.abs(y/b),$=!1;if(T>=1&&a.renderer.isScrollableBy(s.wheelX*s.speed,0)&&($=!0),T<=1&&a.renderer.isScrollableBy(0,s.wheelY*s.speed)&&($=!0),$)i.allowed=u;else if(u-i.allowed<m){var A=Math.abs(y)<=1.5*Math.abs(i.vx)&&Math.abs(b)<=1.5*Math.abs(i.vy);A?($=!0,i.allowed=u):i.allowed=0}if(i.t=u,i.vx=y,i.vy=b,$)return a.renderer.scrollBy(s.wheelX*s.speed,s.wheelY*s.speed),s.stop()}},o})();c.prototype.selectEnd=c.prototype.selectByLinesEnd,c.prototype.selectAllEnd=c.prototype.selectByLinesEnd,c.prototype.selectByWordsEnd=c.prototype.selectByLinesEnd,n.DefaultHandlers=c;function f(o,s,a,i){return Math.sqrt(Math.pow(a-o,2)+Math.pow(i-s,2))}function r(o,s){if(o.start.row==o.end.row)var a=2*s.column-o.start.column-o.end.column;else if(o.start.row==o.end.row-1&&!o.start.column&&!o.end.column)var a=s.column-4;else var a=2*s.row-o.start.row-o.end.row;return a<0?{cursor:o.start,anchor:o.end}:{cursor:o.end,anchor:o.start}}}),ace.define("ace/lib/scroll",["require","exports","module"],function(t,n,p){n.preventParentScroll=function(g){g.stopPropagation();var m=g.currentTarget,c=m.scrollHeight>m.clientHeight;c||g.preventDefault()}}),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/lib/event","ace/range","ace/lib/scroll"],function(t,n,p){var d=this&&this.__extends||(function(){var u=function(h,y){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,T){b.__proto__=T}||function(b,T){for(var $ in T)Object.prototype.hasOwnProperty.call(T,$)&&(b[$]=T[$])},u(h,y)};return function(h,y){if(typeof y!="function"&&y!==null)throw new TypeError("Class extends value "+String(y)+" is not a constructor or null");u(h,y);function b(){this.constructor=h}h.prototype=y===null?Object.create(y):(b.prototype=y.prototype,new b)}})(),g=this&&this.__values||function(u){var h=typeof Symbol=="function"&&Symbol.iterator,y=h&&u[h],b=0;if(y)return y.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&b>=u.length&&(u=void 0),{value:u&&u[b++],done:!u}}};throw new TypeError(h?"Object is not iterable.":"Symbol.iterator is not defined.")},m=t("./lib/dom");t("./lib/event");var c=t("./range").Range,f=t("./lib/scroll").preventParentScroll,r="ace_tooltip",o=(function(){function u(h){this.isOpen=!1,this.$element=null,this.$parentNode=h}return u.prototype.$init=function(){return this.$element=m.createElement("div"),this.$element.className=r,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},u.prototype.getElement=function(){return this.$element||this.$init()},u.prototype.setText=function(h){this.getElement().textContent=h},u.prototype.setHtml=function(h){this.getElement().innerHTML=h},u.prototype.setPosition=function(h,y){this.getElement().style.left=h+"px",this.getElement().style.top=y+"px"},u.prototype.setClassName=function(h){m.addCssClass(this.getElement(),h)},u.prototype.setTheme=function(h){this.$element.className=r+" "+(h.isDark?"ace_dark ":"")+(h.cssClass||"")},u.prototype.show=function(h,y,b){h!=null&&this.setText(h),y!=null&&b!=null&&this.setPosition(y,b),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},u.prototype.hide=function(h){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=r,this.isOpen=!1)},u.prototype.getHeight=function(){return this.getElement().offsetHeight},u.prototype.getWidth=function(){return this.getElement().offsetWidth},u.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},u})(),s=(function(){function u(){this.popups=[]}return u.prototype.addPopup=function(h){this.popups.push(h),this.updatePopups()},u.prototype.removePopup=function(h){var y=this.popups.indexOf(h);y!==-1&&(this.popups.splice(y,1),this.updatePopups())},u.prototype.updatePopups=function(){var h,y,b,T;this.popups.sort(function(w,v){return v.priority-w.priority});var $=[];try{for(var A=g(this.popups),S=A.next();!S.done;S=A.next()){var M=S.value,R=!0;try{for(var L=(b=void 0,g($)),_=L.next();!_.done;_=L.next()){var O=_.value;if(this.doPopupsOverlap(O,M)){R=!1;break}}}catch(w){b={error:w}}finally{try{_&&!_.done&&(T=L.return)&&T.call(L)}finally{if(b)throw b.error}}R?$.push(M):M.hide()}}catch(w){h={error:w}}finally{try{S&&!S.done&&(y=A.return)&&y.call(A)}finally{if(h)throw h.error}}},u.prototype.doPopupsOverlap=function(h,y){var b=h.getElement().getBoundingClientRect(),T=y.getElement().getBoundingClientRect();return b.left<T.right&&b.right>T.left&&b.top<T.bottom&&b.bottom>T.top},u})(),a=new s;n.popupManager=a,n.Tooltip=o;var i=(function(u){d(h,u);function h(y){y===void 0&&(y=document.body);var b=u.call(this,y)||this;b.timeout=void 0,b.lastT=0,b.idleTime=350,b.lastEvent=void 0,b.onMouseOut=b.onMouseOut.bind(b),b.onMouseMove=b.onMouseMove.bind(b),b.waitForHover=b.waitForHover.bind(b),b.hide=b.hide.bind(b);var T=b.getElement();return T.style.whiteSpace="pre-wrap",T.style.pointerEvents="auto",T.addEventListener("mouseout",b.onMouseOut),T.tabIndex=-1,T.addEventListener("blur",(function(){T.contains(document.activeElement)||this.hide()}).bind(b)),T.addEventListener("wheel",f),b}return h.prototype.addToEditor=function(y){y.on("mousemove",this.onMouseMove),y.on("mousedown",this.hide),y.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},h.prototype.removeFromEditor=function(y){y.off("mousemove",this.onMouseMove),y.off("mousedown",this.hide),y.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},h.prototype.onMouseMove=function(y,b){this.lastEvent=y,this.lastT=Date.now();var T=b.$mouseHandler.isMousePressed;if(this.isOpen){var $=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains($.row,$.column)||T||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||T||(this.lastEvent=y,this.timeout=setTimeout(this.waitForHover,this.idleTime))},h.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var y=Date.now()-this.lastT;if(this.idleTime-y>10){this.timeout=setTimeout(this.waitForHover,this.idleTime-y);return}this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor)},h.prototype.isOutsideOfText=function(y){var b=y.editor,T=y.getDocumentPosition(),$=b.session.getLine(T.row);if(T.column==$.length){var A=b.renderer.pixelToScreenCoordinates(y.clientX,y.clientY),S=b.session.documentToScreenPosition(T.row,T.column);if(S.column!=A.column||S.row!=A.row)return!0}return!1},h.prototype.setDataProvider=function(y){this.$gatherData=y},h.prototype.showForRange=function(y,b,T,$){var A=10;if(!($&&$!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var S=y.renderer;this.isOpen||(a.addPopup(this),this.$registerCloseEvents(),this.setTheme(S.theme)),this.isOpen=!0,this.addMarker(b,y.session),this.range=c.fromPoints(b.start,b.end);var M=S.textToScreenCoordinates(b.start.row,b.start.column),R=S.scroller.getBoundingClientRect();M.pageX<R.left&&(M.pageX=R.left);var L=this.getElement();L.innerHTML="",L.appendChild(T),L.style.maxHeight="",L.style.display="block";var _=L.clientHeight,O=L.clientWidth,w=window.innerHeight-M.pageY-S.lineHeight,v=!0;M.pageY-_<0&&M.pageY<w&&(v=!1),L.style.maxHeight=(v?M.pageY:w)-A+"px",L.style.top=v?"":M.pageY+S.lineHeight+"px",L.style.bottom=v?window.innerHeight-M.pageY+"px":"",L.style.left=Math.min(M.pageX,window.innerWidth-O-A)+"px"}},h.prototype.addMarker=function(y,b){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=b,this.marker=b&&b.addMarker(y,"ace_highlight-marker","text")},h.prototype.hide=function(y){!y&&document.activeElement==this.getElement()||y&&y.target&&(y.type!="keydown"||y.ctrlKey||y.metaKey)&&this.$element.contains(y.target)||(this.lastEvent=null,this.timeout&&clearTimeout(this.timeout),this.timeout=null,this.addMarker(null),this.isOpen&&(this.$removeCloseEvents(),this.getElement().style.display="none",this.isOpen=!1,a.removePopup(this)))},h.prototype.$registerCloseEvents=function(){window.addEventListener("keydown",this.hide,!0),window.addEventListener("wheel",this.hide,!0),window.addEventListener("mousedown",this.hide,!0)},h.prototype.$removeCloseEvents=function(){window.removeEventListener("keydown",this.hide,!0),window.removeEventListener("wheel",this.hide,!0),window.removeEventListener("mousedown",this.hide,!0)},h.prototype.onMouseOut=function(y){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.lastEvent=null,this.isOpen&&(!y.relatedTarget||this.getElement().contains(y.relatedTarget)||y&&y.currentTarget.contains(y.relatedTarget)||y.relatedTarget.classList.contains("ace_content")||this.hide())},h})(o);n.HoverTooltip=i}),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/tooltip","ace/config","ace/lib/lang"],function(t,n,p){var d=this&&this.__extends||(function(){var a=function(i,u){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,y){h.__proto__=y}||function(h,y){for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])},a(i,u)};return function(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");a(i,u);function h(){this.constructor=i}i.prototype=u===null?Object.create(u):(h.prototype=u.prototype,new h)}})(),g=this&&this.__values||function(a){var i=typeof Symbol=="function"&&Symbol.iterator,u=i&&a[i],h=0;if(u)return u.call(a);if(a&&typeof a.length=="number")return{next:function(){return a&&h>=a.length&&(a=void 0),{value:a&&a[h++],done:!a}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},m=t("../lib/dom"),c=t("../lib/event"),f=t("../tooltip").Tooltip,r=t("../config").nls;t("../lib/lang");function o(a){var i=a.editor,u=i.renderer.$gutterLayer,h=new s(i);a.editor.setDefaultHandler("guttermousedown",function(S){if(!(!i.isFocused()||S.getButton()!=0)){var M=u.getRegion(S);if(M!="foldWidgets"){var R=S.getDocumentPosition().row,L=i.session.selection;if(S.getShiftKey())L.selectTo(R,0);else{if(S.domEvent.detail==2)return i.selectAll(),S.preventDefault();a.$clickSelection=i.selection.getLineRange(R)}return a.setState("selectByLines"),a.captureMouse(S),S.preventDefault()}}});var y,b;function T(){var S=b.getDocumentPosition().row,M=i.session.getLength();if(S==M){var R=i.renderer.pixelToScreenCoordinates(0,b.y).row,L=b.$pos;if(R>i.session.documentToScreenRow(L.row,L.column))return $()}if(h.showTooltip(S),!!h.isOpen)if(i.on("mousewheel",$),a.$tooltipFollowsMouse)A(b);else{var _=b.getGutterRow(),O=u.$lines.get(_);if(O){var w=O.element.querySelector(".ace_gutter_annotation"),v=w.getBoundingClientRect(),C=h.getElement().style;C.left=v.right+"px",C.top=v.bottom+"px"}else A(b)}}function $(){y&&(y=clearTimeout(y)),h.isOpen&&(h.hideTooltip(),i.off("mousewheel",$))}function A(S){h.setPosition(S.x,S.y)}a.editor.setDefaultHandler("guttermousemove",function(S){var M=S.domEvent.target||S.domEvent.srcElement;if(m.hasCssClass(M,"ace_fold-widget"))return $();h.isOpen&&a.$tooltipFollowsMouse&&A(S),b=S,!y&&(y=setTimeout(function(){y=null,b&&!a.isMousePressed?T():$()},50))}),c.addListener(i.renderer.$gutter,"mouseout",function(S){b=null,!(!h.isOpen||y)&&(y=setTimeout(function(){y=null,$()},50))},i),i.on("changeSession",$),i.on("input",$)}n.GutterHandler=o;var s=(function(a){d(i,a);function i(u){var h=a.call(this,u.container)||this;return h.editor=u,h}return i.prototype.setPosition=function(u,h){var y=window.innerWidth||document.documentElement.clientWidth,b=window.innerHeight||document.documentElement.clientHeight,T=this.getWidth(),$=this.getHeight();u+=15,h+=15,u+T>y&&(u-=u+T-y),h+$>b&&(h-=20+$),f.prototype.setPosition.call(this,u,h)},Object.defineProperty(i,"annotationLabels",{get:function(){return{error:{singular:r("gutter-tooltip.aria-label.error.singular","error"),plural:r("gutter-tooltip.aria-label.error.plural","errors")},security:{singular:r("gutter-tooltip.aria-label.security.singular","security finding"),plural:r("gutter-tooltip.aria-label.security.plural","security findings")},warning:{singular:r("gutter-tooltip.aria-label.warning.singular","warning"),plural:r("gutter-tooltip.aria-label.warning.plural","warnings")},info:{singular:r("gutter-tooltip.aria-label.info.singular","information message"),plural:r("gutter-tooltip.aria-label.info.plural","information messages")},hint:{singular:r("gutter-tooltip.aria-label.hint.singular","suggestion"),plural:r("gutter-tooltip.aria-label.hint.plural","suggestions")}}},enumerable:!1,configurable:!0}),i.prototype.showTooltip=function(u){var h,y=this.editor.renderer.$gutterLayer,b=y.$annotations[u],T;b?T={displayText:Array.from(b.displayText),type:Array.from(b.type)}:T={displayText:[],type:[]};var $=y.session.getFoldLine(u);if($&&y.$showFoldedAnnotations){for(var A={error:[],security:[],warning:[],info:[],hint:[]},S={error:1,security:2,warning:3,info:4,hint:5},M,R=u+1;R<=$.end.row;R++)if(y.$annotations[R])for(var L=0;L<y.$annotations[R].text.length;L++){var _=y.$annotations[R].type[L];A[_].push(y.$annotations[R].text[L]),(!M||S[_]<S[M])&&(M=_)}if(["error","security","warning"].includes(M)){var O="".concat(i.annotationsToSummaryString(A)," in folded code.");T.displayText.push(O),T.type.push(M+"_fold")}}if(T.displayText.length===0)return this.hide();for(var w={error:[],security:[],warning:[],info:[],hint:[]},v=y.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",R=0;R<T.displayText.length;R++){var C=m.createElement("span"),E=m.createElement("span");(h=E.classList).add.apply(h,["ace_".concat(T.type[R]),v]),E.setAttribute("aria-label","".concat(i.annotationLabels[T.type[R].replace("_fold","")].singular)),E.setAttribute("role","img"),E.appendChild(m.createTextNode(" ")),C.appendChild(E),C.appendChild(m.createTextNode(T.displayText[R])),C.appendChild(m.createElement("br")),w[T.type[R].replace("_fold","")].push(C)}var x=this.getElement();m.removeChildren(x),w.error.forEach(function(k){return x.appendChild(k)}),w.security.forEach(function(k){return x.appendChild(k)}),w.warning.forEach(function(k){return x.appendChild(k)}),w.info.forEach(function(k){return x.appendChild(k)}),w.hint.forEach(function(k){return x.appendChild(k)}),x.setAttribute("aria-live","polite"),this.isOpen||(this.setTheme(this.editor.renderer.theme),this.setClassName("ace_gutter-tooltip")),this.show(),this.editor._signal("showGutterTooltip",this)},i.prototype.hideTooltip=function(){this.$element.removeAttribute("aria-live"),this.hide(),this.editor._signal("hideGutterTooltip",this)},i.annotationsToSummaryString=function(u){var h,y,b=[],T=["error","security","warning","info","hint"];try{for(var $=g(T),A=$.next();!A.done;A=$.next()){var S=A.value;if(u[S].length){var M=u[S].length===1?i.annotationLabels[S].singular:i.annotationLabels[S].plural;b.push("".concat(u[S].length," ").concat(M))}}}catch(R){h={error:R}}finally{try{A&&!A.done&&(y=$.return)&&y.call($)}finally{if(h)throw h.error}}return b.join(", ")},i})(f);n.GutterTooltip=s}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(t,n,p){var d=t("../lib/event"),g=t("../lib/useragent"),m=(function(){function c(f,r){this.speed,this.wheelX,this.wheelY,this.domEvent=f,this.editor=r,this.x=this.clientX=f.clientX,this.y=this.clientY=f.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return c.prototype.stopPropagation=function(){d.stopPropagation(this.domEvent),this.propagationStopped=!0},c.prototype.preventDefault=function(){d.preventDefault(this.domEvent),this.defaultPrevented=!0},c.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},c.prototype.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},c.prototype.getGutterRow=function(){var f=this.getDocumentPosition().row,r=this.editor.session.documentToScreenRow(f,0),o=this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0);return r-o},c.prototype.inSelection=function(){if(this.$inSelection!==null)return this.$inSelection;var f=this.editor,r=f.getSelectionRange();if(r.isEmpty())this.$inSelection=!1;else{var o=this.getDocumentPosition();this.$inSelection=r.contains(o.row,o.column)}return this.$inSelection},c.prototype.getButton=function(){return d.getButton(this.domEvent)},c.prototype.getShiftKey=function(){return this.domEvent.shiftKey},c.prototype.getAccelKey=function(){return g.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},c})();n.MouseEvent=m}),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],function(t,n,p){var d=t("../lib/dom"),g=t("../lib/event"),m=t("../lib/useragent"),c=200,f=200,r=5;function o(a){var i=a.editor,u=d.createElement("div");u.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",u.textContent=" ";var h=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];h.forEach(function(F){a[F]=this[F]},this),i.on("mousedown",this.onMouseDown.bind(a));var y=i.container,b,T,$,A,S,M,R=0,L,_,O,w,v;this.onDragStart=function(F){if(this.cancelDrag||!y.draggable){var W=this;return setTimeout(function(){W.startSelect(),W.captureMouse(F)},0),F.preventDefault()}S=i.getSelectionRange();var H=F.dataTransfer;H.effectAllowed=i.getReadOnly()?"copy":"copyMove",i.container.appendChild(u),H.setDragImage&&H.setDragImage(u,0,0),setTimeout(function(){i.container.removeChild(u)}),H.clearData(),H.setData("Text",i.session.getTextRange()),_=!0,this.setState("drag")},this.onDragEnd=function(F){if(y.draggable=!1,_=!1,this.setState(null),!i.getReadOnly()){var W=F.dataTransfer.dropEffect;!L&&W=="move"&&i.session.remove(i.getSelectionRange()),i.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(F){if(!(i.getReadOnly()||!P(F.dataTransfer)))return T=F.clientX,$=F.clientY,b||k(),R++,F.dataTransfer.dropEffect=L=z(F),g.preventDefault(F)},this.onDragOver=function(F){if(!(i.getReadOnly()||!P(F.dataTransfer)))return T=F.clientX,$=F.clientY,b||(k(),R++),I!==null&&(I=null),F.dataTransfer.dropEffect=L=z(F),g.preventDefault(F)},this.onDragLeave=function(F){if(R--,R<=0&&b)return D(),L=null,g.preventDefault(F)},this.onDrop=function(F){if(M){var W=F.dataTransfer;if(_)switch(L){case"move":S.contains(M.row,M.column)?S={start:M,end:M}:S=i.moveText(S,M);break;case"copy":S=i.moveText(S,M,!0);break}else{var H=W.getData("Text");S={start:M,end:i.session.insert(M,H)},i.focus(),L=null}return D(),g.preventDefault(F)}},g.addListener(y,"dragstart",this.onDragStart.bind(a),i),g.addListener(y,"dragend",this.onDragEnd.bind(a),i),g.addListener(y,"dragenter",this.onDragEnter.bind(a),i),g.addListener(y,"dragover",this.onDragOver.bind(a),i),g.addListener(y,"dragleave",this.onDragLeave.bind(a),i),g.addListener(y,"drop",this.onDrop.bind(a),i);function C(F,W){var H=Date.now(),B=!W||F.row!=W.row,G=!W||F.column!=W.column;if(!w||B||G)i.moveCursorToPosition(F),w=H,v={x:T,y:$};else{var q=s(v.x,v.y,T,$);q>r?w=null:H-w>=f&&(i.renderer.scrollCursorIntoView(),w=null)}}function E(F,W){var H=Date.now(),B=i.renderer.layerConfig.lineHeight,G=i.renderer.layerConfig.characterWidth,q=i.renderer.scroller.getBoundingClientRect(),Y={x:{left:T-q.left,right:q.right-T},y:{top:$-q.top,bottom:q.bottom-$}},V=Math.min(Y.x.left,Y.x.right),Z=Math.min(Y.y.top,Y.y.bottom),ue={row:F.row,column:F.column};V/G<=2&&(ue.column+=Y.x.left<Y.x.right?-3:2),Z/B<=1&&(ue.row+=Y.y.top<Y.y.bottom?-1:1);var Me=F.row!=ue.row,Ce=F.column!=ue.column,he=!W||F.row!=W.row;Me||Ce&&!he?O?H-O>=c&&i.renderer.scrollCursorIntoView(ue):O=H:O=null}function x(){var F=M;M=i.renderer.screenToTextCoordinates(T,$),C(M,F),E(M,F)}function k(){S=i.selection.toOrientedRange(),b=i.session.addMarker(S,"ace_selection",i.getSelectionStyle()),i.clearSelection(),i.isFocused()&&i.renderer.$cursorLayer.setBlinking(!1),clearInterval(A),x(),A=setInterval(x,20),R=0,g.addListener(document,"mousemove",N)}function D(){clearInterval(A),i.session.removeMarker(b),b=null,i.selection.fromOrientedRange(S),i.isFocused()&&!_&&i.$resetCursorStyle(),S=null,M=null,R=0,O=null,w=null,g.removeListener(document,"mousemove",N)}var I=null;function N(){I==null&&(I=setTimeout(function(){I!=null&&b&&D()},20))}function P(F){var W=F.types;return!W||Array.prototype.some.call(W,function(H){return H=="text/plain"||H=="Text"})}function z(F){var W=["copy","copymove","all","uninitialized"],H=["move","copymove","linkmove","all","uninitialized"],B=m.isMac?F.altKey:F.ctrlKey,G="uninitialized";try{G=F.dataTransfer.effectAllowed.toLowerCase()}catch{}var q="none";return B&&W.indexOf(G)>=0?q="copy":H.indexOf(G)>=0?q="move":W.indexOf(G)>=0&&(q="copy"),q}}(function(){this.dragWait=function(){var a=Date.now()-this.mousedownEvent.time;a>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var a=this.editor.container;a.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(a){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var a=this.editor,i=a.container;i.draggable=!0,a.renderer.$cursorLayer.setBlinking(!1),a.setStyle("ace_dragging");var u=m.isWin?"default":"move";a.renderer.setCursorStyle(u),this.setState("dragReady")},this.onMouseDrag=function(a){var i=this.editor.container;if(m.isIE&&this.state=="dragReady"){var u=s(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);u>3&&i.dragDrop()}if(this.state==="dragWait"){var u=s(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);u>0&&(i.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(a){if(this.$dragEnabled){this.mousedownEvent=a;var i=this.editor,u=a.inSelection(),h=a.getButton(),y=a.domEvent.detail||1;if(y===1&&h===0&&u){if(a.editor.inMultiSelectMode&&(a.getAccelKey()||a.getShiftKey()))return;this.mousedownEvent.time=Date.now();var b=a.domEvent.target||a.domEvent.srcElement;if("unselectable"in b&&(b.unselectable="on"),i.getDragDelay()){if(m.isWebKit){this.cancelDrag=!0;var T=i.container;T.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(a,this.onMouseDrag.bind(this)),a.defaultPrevented=!0}}}}).call(o.prototype);function s(a,i,u,h){return Math.sqrt(Math.pow(u-a,2)+Math.pow(h-i,2))}n.DragdropHandler=o}),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],function(t,n,p){var d=t("./mouse_event").MouseEvent,g=t("../lib/event"),m=t("../lib/dom");n.addTouchListeners=function(c,f){var r="scroll",o,s,a,i,u,h,y=0,b,T=0,$=0,A=0,S,M;function R(){var C=window.navigator&&window.navigator.clipboard,E=!1,x=function(){var I=f.getCopyText(),N=f.session.getUndoManager().hasUndo();M.replaceChild(m.buildDom(E?["span",!I&&k("selectall")&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],I&&k("copy")&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],I&&k("cut")&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],C&&k("paste")&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],N&&k("undo")&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],k("find")&&["span",{class:"ace_mobile-button",action:"find"},"Find"],k("openCommandPalette")&&["span",{class:"ace_mobile-button",action:"openCommandPalette"},"Palette"]]:["span"]),M.firstChild)},k=function(I){return f.commands.canExecute(I,f)},D=function(I){var N=I.target.getAttribute("action");if(N=="more"||!E)return E=!E,x();N=="paste"?C.readText().then(function(P){f.execCommand(N,P)}):N&&((N=="cut"||N=="copy")&&(C?C.writeText(f.getCopyText()):document.execCommand("copy")),f.execCommand(N)),M.firstChild.style.display="none",E=!1,N!="openCommandPalette"&&f.focus()};M=m.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(I){r="menu",I.stopPropagation(),I.preventDefault(),f.textInput.focus()},ontouchend:function(I){I.stopPropagation(),I.preventDefault(),D(I)},onclick:D},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],f.container)}function L(){if(!f.getOption("enableMobileMenu")){M&&_();return}M||R();var C=f.selection.cursor,E=f.renderer.textToScreenCoordinates(C.row,C.column),x=f.renderer.textToScreenCoordinates(0,0).pageX,k=f.renderer.scrollLeft,D=f.container.getBoundingClientRect();M.style.top=E.pageY-D.top-3+"px",E.pageX-D.left<D.width-70?(M.style.left="",M.style.right="10px"):(M.style.right="",M.style.left=x+k-D.left+"px"),M.style.display="",M.firstChild.style.display="none",f.on("input",_)}function _(C){M&&(M.style.display="none"),f.off("input",_)}function O(){u=null,clearTimeout(u);var C=f.selection.getRange(),E=C.contains(b.row,b.column);(C.isEmpty()||!E)&&(f.selection.moveToPosition(b),f.selection.selectWord()),r="wait",L()}function w(){u=null,clearTimeout(u),f.selection.moveToPosition(b);var C=T>=2?f.selection.getLineRange(b.row):f.session.getBracketRange(b);C&&!C.isEmpty()?f.selection.setRange(C):f.selection.selectWord(),r="wait"}g.addListener(c,"contextmenu",function(C){if(S){var E=f.textInput.getElement();E.focus()}},f),g.addListener(c,"touchstart",function(C){var E=C.touches;if(u||E.length>1){clearTimeout(u),u=null,a=-1,r="zoom";return}S=f.$mouseHandler.isMousePressed=!0;var x=f.renderer.layerConfig.lineHeight,k=f.renderer.layerConfig.lineHeight,D=C.timeStamp;i=D;var I=E[0],N=I.clientX,P=I.clientY;Math.abs(o-N)+Math.abs(s-P)>x&&(a=-1),o=C.clientX=N,s=C.clientY=P,$=A=0;var z=new d(C,f);if(b=z.getDocumentPosition(),D-a<500&&E.length==1&&!y)T++,C.preventDefault(),C.button=0,w();else{T=0;var F=f.selection.cursor,W=f.selection.isEmpty()?F:f.selection.anchor,H=f.renderer.$cursorLayer.getPixelPosition(F,!0),B=f.renderer.$cursorLayer.getPixelPosition(W,!0),G=f.renderer.scroller.getBoundingClientRect(),q=f.renderer.layerConfig.offset,Y=f.renderer.scrollLeft,V=function(Me,Ce){return Me=Me/k,Ce=Ce/x-.75,Me*Me+Ce*Ce};if(C.clientX<G.left){r="zoom";return}var Z=V(C.clientX-G.left-H.left+Y,C.clientY-G.top-H.top+q),ue=V(C.clientX-G.left-B.left+Y,C.clientY-G.top-B.top+q);Z<3.5&&ue<3.5&&(r=Z>ue?"cursor":"anchor"),ue<3.5?r="anchor":Z<3.5?r="cursor":r="scroll",u=setTimeout(O,450)}a=D},f),g.addListener(c,"touchend",function(C){S=f.$mouseHandler.isMousePressed=!1,h&&clearInterval(h),r=="zoom"?(r="",y=0):u?(f.selection.moveToPosition(b),y=0,L()):r=="scroll"?(v(),_()):L(),clearTimeout(u),u=null},f),g.addListener(c,"touchmove",function(C){u&&(clearTimeout(u),u=null);var E=C.touches;if(!(E.length>1||r=="zoom")){var x=E[0],k=o-x.clientX,D=s-x.clientY;if(r=="wait")if(k*k+D*D>4)r="cursor";else return C.preventDefault();o=x.clientX,s=x.clientY,C.clientX=x.clientX,C.clientY=x.clientY;var I=C.timeStamp,N=I-i;if(i=I,r=="scroll"){var P=new d(C,f);P.speed=1,P.wheelX=k,P.wheelY=D,10*Math.abs(k)<Math.abs(D)&&(k=0),10*Math.abs(D)<Math.abs(k)&&(D=0),N!=0&&($=k/N,A=D/N),f._emit("mousewheel",P),P.propagationStopped||($=A=0)}else{var z=new d(C,f),F=z.getDocumentPosition();r=="cursor"?f.selection.moveCursorToPosition(F):r=="anchor"&&f.selection.setSelectionAnchor(F.row,F.column),f.renderer.scrollCursorIntoView(F),C.preventDefault()}}},f);function v(){y+=60,h=setInterval(function(){y--<=0&&(clearInterval(h),h=null),Math.abs($)<.01&&($=0),Math.abs(A)<.01&&(A=0),y<20&&($=.9*$),y<20&&(A=.9*A);var C=f.session.getScrollTop();f.renderer.scrollBy(10*$,10*A),C==f.session.getScrollTop()&&(y=0)},10)}}}),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/mouse/touch_handler","ace/config"],function(t,n,p){var d=t("../lib/event"),g=t("../lib/useragent"),m=t("./default_handlers").DefaultHandlers,c=t("./default_gutter_handler").GutterHandler,f=t("./mouse_event").MouseEvent,r=t("./dragdrop_handler").DragdropHandler,o=t("./touch_handler").addTouchListeners,s=t("../config"),a=(function(){function i(u){this.$dragDelay,this.$dragEnabled,this.$mouseMoved,this.mouseEvent,this.$focusTimeout;var h=this;this.editor=u,new m(this),new c(this),new r(this);var y=function($){var A=!document.hasFocus||!document.hasFocus()||!u.isFocused()&&document.activeElement==(u.textInput&&u.textInput.getElement());A&&window.focus(),u.focus(),setTimeout(function(){u.isFocused()||u.focus()})},b=u.renderer.getMouseEventTarget();d.addListener(b,"click",this.onMouseEvent.bind(this,"click"),u),d.addListener(b,"mousemove",this.onMouseMove.bind(this,"mousemove"),u),d.addMultiMouseDownListener([b,u.renderer.scrollBarV&&u.renderer.scrollBarV.inner,u.renderer.scrollBarH&&u.renderer.scrollBarH.inner,u.textInput&&u.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",u),d.addMouseWheelListener(u.container,this.onMouseWheel.bind(this,"mousewheel"),u),o(u.container,u);var T=u.renderer.$gutter;d.addListener(T,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),u),d.addListener(T,"click",this.onMouseEvent.bind(this,"gutterclick"),u),d.addListener(T,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),u),d.addListener(T,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),u),d.addListener(b,"mousedown",y,u),d.addListener(T,"mousedown",y,u),g.isIE&&u.renderer.scrollBarV&&(d.addListener(u.renderer.scrollBarV.element,"mousedown",y,u),d.addListener(u.renderer.scrollBarH.element,"mousedown",y,u)),u.on("mousemove",function($){if(!(h.state||h.$dragDelay||!h.$dragEnabled)){var A=u.renderer.screenToTextCoordinates($.x,$.y),S=u.session.selection.getRange(),M=u.renderer;!S.isEmpty()&&S.insideStart(A.row,A.column)?M.setCursorStyle("default"):M.setCursorStyle("")}},u)}return i.prototype.onMouseEvent=function(u,h){this.editor.session&&this.editor._emit(u,new f(h,this.editor))},i.prototype.onMouseMove=function(u,h){var y=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;!y||!y.length||this.editor._emit(u,new f(h,this.editor))},i.prototype.onMouseWheel=function(u,h){var y=new f(h,this.editor);y.speed=this.$scrollSpeed*2,y.wheelX=h.wheelX,y.wheelY=h.wheelY,this.editor._emit(u,y)},i.prototype.setState=function(u){this.state=u},i.prototype.captureMouse=function(u,h){this.x=u.x,this.y=u.y,this.isMousePressed=!0;var y=this.editor,b=this.editor.renderer;b.$isMousePressed=!0;var T=this,$=function(L){if(L){if(g.isWebKit&&!L.which&&T.releaseMouse)return T.releaseMouse();T.x=L.clientX,T.y=L.clientY,h&&h(L),T.mouseEvent=new f(L,T.editor),T.$mouseMoved=!0}},A=function(L){y.off("beforeEndOperation",M),clearInterval(R),y.session&&S(),T[T.state+"End"]&&T[T.state+"End"](L),T.state="",T.isMousePressed=b.$isMousePressed=!1,b.$keepTextAreaAtCursor&&b.$moveTextAreaToCursor(),T.$onCaptureMouseMove=T.releaseMouse=null,L&&T.onMouseEvent("mouseup",L),y.endOperation()},S=function(){T[T.state]&&T[T.state](),T.$mouseMoved=!1};if(g.isOldIE&&u.domEvent.type=="dblclick")return setTimeout(function(){A(u)});var M=function(L){T.releaseMouse&&y.curOp.command.name&&y.curOp.selectionChanged&&(T[T.state+"End"]&&T[T.state+"End"](),T.state="",T.releaseMouse())};y.on("beforeEndOperation",M),y.startOperation({command:{name:"mouse"}}),T.$onCaptureMouseMove=$,T.releaseMouse=d.capture(this.editor.container,$,A);var R=setInterval(S,20)},i.prototype.cancelContextMenu=function(){var u=(function(h){h&&h.domEvent&&h.domEvent.type!="contextmenu"||(this.editor.off("nativecontextmenu",u),h&&h.domEvent&&d.stopEvent(h.domEvent))}).bind(this);setTimeout(u,10),this.editor.on("nativecontextmenu",u)},i.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse()},i})();a.prototype.releaseMouse=null,s.defineOptions(a.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:g.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),n.MouseHandler=a}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(t,n,p){var d=t("../lib/dom"),g=(function(){function m(c){c.on("click",function(f){var r=f.getDocumentPosition(),o=c.session,s=o.getFoldAt(r.row,r.column,1);s&&(f.getAccelKey()?o.removeFold(s):o.expandFold(s),f.stop());var a=f.domEvent&&f.domEvent.target;a&&d.hasCssClass(a,"ace_inline_button")&&d.hasCssClass(a,"ace_toggle_wrap")&&(o.setOption("wrap",!o.getUseWrapMode()),c.renderer.scrollCursorIntoView())}),c.on("gutterclick",function(f){var r=c.renderer.$gutterLayer.getRegion(f);if(r=="foldWidgets"){var o=f.getDocumentPosition().row,s=c.session;s.foldWidgets&&s.foldWidgets[o]&&c.session.onFoldWidgetClick(o,f),c.isFocused()||c.focus(),f.stop()}}),c.on("gutterdblclick",function(f){var r=c.renderer.$gutterLayer.getRegion(f);if(r=="foldWidgets"){var o=f.getDocumentPosition().row,s=c.session,a=s.getParentFoldRangeData(o,!0),i=a.range||a.firstRange;if(i){o=i.start.row;var u=s.getFoldAt(o,s.getLine(o).length,1);u?s.removeFold(u):(s.addFold("...",i),c.renderer.scrollCursorIntoView({row:i.start.row,column:0}))}f.stop()}})}return m})();n.FoldHandler=g}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(t,n,p){var d=t("../lib/keys"),g=t("../lib/event"),m=(function(){function c(f){this.$editor=f,this.$data={editor:f},this.$handlers=[],this.setDefaultHandler(f.commands)}return c.prototype.setDefaultHandler=function(f){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=f,this.addKeyboardHandler(f,0)},c.prototype.setKeyboardHandler=function(f){var r=this.$handlers;if(r[r.length-1]!=f){for(;r[r.length-1]&&r[r.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(r[r.length-1]);this.addKeyboardHandler(f,1)}},c.prototype.addKeyboardHandler=function(f,r){if(f){typeof f=="function"&&!f.handleKeyboard&&(f.handleKeyboard=f);var o=this.$handlers.indexOf(f);o!=-1&&this.$handlers.splice(o,1),r==null?this.$handlers.push(f):this.$handlers.splice(r,0,f),o==-1&&f.attach&&f.attach(this.$editor)}},c.prototype.removeKeyboardHandler=function(f){var r=this.$handlers.indexOf(f);return r==-1?!1:(this.$handlers.splice(r,1),f.detach&&f.detach(this.$editor),!0)},c.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},c.prototype.getStatusText=function(){var f=this.$data,r=f.editor;return this.$handlers.map(function(o){return o.getStatusText&&o.getStatusText(r,f)||""}).filter(Boolean).join(" ")},c.prototype.$callKeyboardHandlers=function(f,r,o,s){for(var a,i=!1,u=this.$editor.commands,h=this.$handlers.length;h--&&(a=this.$handlers[h].handleKeyboard(this.$data,f,r,o,s),!(!(!a||!a.command)&&(a.command=="null"?i=!0:i=u.exec(a.command,this.$editor,a.args,s),i&&s&&f!=-1&&a.passEvent!=!0&&a.command.passEvent!=!0&&g.stopEvent(s),i))););return!i&&f==-1&&(a={command:"insertstring"},i=u.exec("insertstring",this.$editor,r)),i&&this.$editor._signal&&this.$editor._signal("keyboardActivity",a),i},c.prototype.onCommandKey=function(f,r,o){var s=d.keyCodeToString(o);return this.$callKeyboardHandlers(r,s,o,f)},c.prototype.onTextInput=function(f){return this.$callKeyboardHandlers(-1,f)},c})();n.KeyBinding=m}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(t,n,p){var d=0,g=0,m=!1,c=!1,f=!1,r=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],o=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],s=0,a=1,i=0,u=1,h=2,y=3,b=4,T=5,$=6,A=7,S=8,M=9,R=10,L=11,_=12,O=13,w=14,v=15,C=16,E=17,x=18,k=[x,x,x,x,x,x,x,x,x,$,T,$,S,T,x,x,x,x,x,x,x,x,x,x,x,x,x,x,T,T,T,$,S,b,b,L,L,L,b,b,b,b,b,R,M,R,M,M,h,h,h,h,h,h,h,h,h,h,M,b,b,b,b,b,b,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,b,b,b,b,b,b,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,b,b,b,b,x,x,x,x,x,x,T,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,M,b,L,L,L,L,b,b,b,b,i,b,b,x,b,b,L,L,h,h,b,i,b,b,b,h,i,b,b,b,b,b],D=[S,S,S,S,S,S,S,S,S,S,S,x,x,x,i,u,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,S,T,O,w,v,C,E,M,L,L,L,L,L,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,M,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,S];function I(F,W,H,B){var G=d?o:r,q=null,Y=null,V=null,Z=0,ue=null,Me=null,Ce=-1,he=null,ke=null,ut=[];if(!B)for(he=0,B=[];he<H;he++)B[he]=z(F[he]);for(g=d,m=!1,c=!1,f=!1,ke=0;ke<H;ke++){if(q=Z,ut[ke]=Y=P(F,B,ut,ke),Z=G[q][Y],ue=Z&240,Z&=15,W[ke]=V=G[Z][5],ue>0)if(ue==16){for(he=Ce;he<ke;he++)W[he]=1;Ce=-1}else Ce=-1;if(Me=G[Z][6],Me)Ce==-1&&(Ce=ke);else if(Ce>-1){for(he=Ce;he<ke;he++)W[he]=V;Ce=-1}B[ke]==T&&(W[ke]=0),g|=V}if(f){for(he=0;he<H;he++)if(B[he]==$){W[he]=d;for(var ht=he-1;ht>=0&&B[ht]==S;ht--)W[ht]=d}}}function N(F,W,H){if(!(g<F)){if(F==1&&d==a&&!c){H.reverse();return}for(var B=H.length,G=0,q,Y,V,Z;G<B;){if(W[G]>=F){for(q=G+1;q<B&&W[q]>=F;)q++;for(Y=G,V=q-1;Y<V;Y++,V--)Z=H[Y],H[Y]=H[V],H[V]=Z;G=q}G++}}}function P(F,W,H,B){var G=W[B],q,Y,V,Z;switch(G){case i:case u:m=!1;case b:case y:return G;case h:return m?y:h;case A:return m=!0,u;case S:return b;case M:return B<1||B+1>=W.length||(q=H[B-1])!=h&&q!=y||(Y=W[B+1])!=h&&Y!=y?b:(m&&(Y=y),Y==q?Y:b);case R:return q=B>0?H[B-1]:T,q==h&&B+1<W.length&&W[B+1]==h?h:b;case L:if(B>0&&H[B-1]==h)return h;if(m)return b;for(Z=B+1,V=W.length;Z<V&&W[Z]==L;)Z++;return Z<V&&W[Z]==h?h:b;case _:for(V=W.length,Z=B+1;Z<V&&W[Z]==_;)Z++;if(Z<V){var ue=F[B],Me=ue>=1425&&ue<=2303||ue==64286;if(q=W[Z],Me&&(q==u||q==A))return u}return B<1||(q=W[B-1])==T?b:H[B-1];case T:return m=!1,c=!0,d;case $:return f=!0,b;case O:case w:case C:case E:case v:m=!1;case x:return b}}function z(F){var W=F.charCodeAt(0),H=W>>8;return H==0?W>191?i:k[W]:H==5?/[\u0591-\u05f4]/.test(F)?u:i:H==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(F)?_:/[\u0660-\u0669\u066b-\u066c]/.test(F)?y:W==1642?L:/[\u06f0-\u06f9]/.test(F)?h:A:H==32&&W<=8287?D[W&255]:H==254&&W>=65136?A:b}n.L=i,n.R=u,n.EN=h,n.ON_R=3,n.AN=4,n.R_H=5,n.B=6,n.RLE=7,n.DOT="·",n.doBidiReorder=function(F,W,H){if(F.length<2)return{};var B=F.split(""),G=new Array(B.length),q=new Array(B.length),Y=[];d=H?a:s,I(B,Y,B.length,W);for(var V=0;V<G.length;G[V]=V,V++);N(2,Y,G),N(1,Y,G);for(var V=0;V<G.length-1;V++)W[V]===y?Y[V]=n.AN:Y[V]===u&&(W[V]>A&&W[V]<O||W[V]===b||W[V]===x)?Y[V]=n.ON_R:V>0&&B[V-1]==="ل"&&/\u0622|\u0623|\u0625|\u0627/.test(B[V])&&(Y[V-1]=Y[V]=n.R_H,V++);B[B.length-1]===n.DOT&&(Y[B.length-1]=n.B),B[0]==="‫"&&(Y[0]=n.RLE);for(var V=0;V<G.length;V++)q[V]=Y[G[V]];return{logicalFromVisual:G,bidiLevels:q}},n.hasBidiCharacters=function(F,W){for(var H=!1,B=0;B<F.length;B++)W[B]=z(F.charAt(B)),!H&&(W[B]==u||W[B]==A||W[B]==y)&&(H=!0);return H},n.getVisualFromLogicalIdx=function(F,W){for(var H=0;H<W.logicalFromVisual.length;H++)if(W.logicalFromVisual[H]==F)return H;return 0}}),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],function(t,n,p){var d=t("./lib/bidiutil"),g=t("./lib/lang"),m=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,c=(function(){function f(r){this.session=r,this.bidiMap={},this.currentRow=null,this.bidiUtil=d,this.charWidths=[],this.EOL="¬",this.showInvisibles=!0,this.isRtlDir=!1,this.$isRtl=!1,this.line="",this.wrapIndent=0,this.EOF="¶",this.RLE="‫",this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=m.test(r.getValue())}return f.prototype.isBidiRow=function(r,o,s){return this.seenBidi?(r!==this.currentRow&&(this.currentRow=r,this.updateRowLine(o,s),this.updateBidiMap()),this.bidiMap.bidiLevels):!1},f.prototype.onChange=function(r){this.seenBidi?this.currentRow=null:r.action=="insert"&&m.test(r.lines.join(`
1342
+ `))&&(this.seenBidi=!0,this.currentRow=null)},f.prototype.getDocumentRow=function(){var r=0,o=this.session.$screenRowCache;if(o.length){var s=this.session.$getRowCacheIndex(o,this.currentRow);s>=0&&(r=this.session.$docRowCache[s])}return r},f.prototype.getSplitIndex=function(){var r=0,o=this.session.$screenRowCache;if(o.length)for(var s,a=this.session.$getRowCacheIndex(o,this.currentRow);this.currentRow-r>0&&(s=this.session.$getRowCacheIndex(o,this.currentRow-r-1),s===a);)a=s,r++;else r=this.currentRow;return r},f.prototype.updateRowLine=function(r,o){r===void 0&&(r=this.getDocumentRow());var s=r===this.session.getLength()-1,a=s?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(r),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var i=this.session.$wrapData[r];i&&(o===void 0&&(o=this.getSplitIndex()),o>0&&i.length?(this.wrapIndent=i.indent,this.wrapOffset=this.wrapIndent*this.charWidths[d.L],this.line=o<i.length?this.line.substring(i[o-1],i[o]):this.line.substring(i[i.length-1])):this.line=this.line.substring(0,i[o]),o==i.length&&(this.line+=this.showInvisibles?a:d.DOT))}else this.line+=this.showInvisibles?a:d.DOT;var u=this.session,h=0,y;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(b,T){return b===" "||u.isFullWidth(b.charCodeAt(0))?(y=b===" "?u.getScreenTabSize(T+h):2,h+=y-1,g.stringRepeat(d.DOT,y)):b}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==d.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},f.prototype.updateBidiMap=function(){var r=[];d.hasBidiCharacters(this.line,r)||this.isRtlDir?this.bidiMap=d.doBidiReorder(this.line,r,this.isRtlDir):this.bidiMap={}},f.prototype.markAsDirty=function(){this.currentRow=null},f.prototype.updateCharacterWidths=function(r){if(this.characterWidth!==r.$characterSize.width){this.fontMetrics=r;var o=this.characterWidth=r.$characterSize.width,s=r.$measureCharWidth("ה");this.charWidths[d.L]=this.charWidths[d.EN]=this.charWidths[d.ON_R]=o,this.charWidths[d.R]=this.charWidths[d.AN]=s,this.charWidths[d.R_H]=s*.45,this.charWidths[d.B]=this.charWidths[d.RLE]=0,this.currentRow=null}},f.prototype.setShowInvisibles=function(r){this.showInvisibles=r,this.currentRow=null},f.prototype.setEolChar=function(r){this.EOL=r},f.prototype.setContentWidth=function(r){this.contentWidth=r},f.prototype.isRtlLine=function(r){return this.$isRtl?!0:r!=null?this.session.getLine(r).charAt(0)==this.RLE:this.isRtlDir},f.prototype.setRtlDirection=function(r,o){for(var s=r.getCursorPosition(),a=r.selection.getSelectionAnchor().row;a<=s.row;a++)!o&&r.session.getLine(a).charAt(0)===r.session.$bidiHandler.RLE?r.session.doc.removeInLine(a,0,1):o&&r.session.getLine(a).charAt(0)!==r.session.$bidiHandler.RLE&&r.session.doc.insert({column:0,row:a},r.session.$bidiHandler.RLE)},f.prototype.getPosLeft=function(r){r-=this.wrapIndent;var o=this.line.charAt(0)===this.RLE?1:0,s=r>o?this.session.getOverwrite()?r:r-1:o,a=d.getVisualFromLogicalIdx(s,this.bidiMap),i=this.bidiMap.bidiLevels,u=0;!this.session.getOverwrite()&&r<=o&&i[a]%2!==0&&a++;for(var h=0;h<a;h++)u+=this.charWidths[i[h]];return!this.session.getOverwrite()&&r>o&&i[a]%2===0&&(u+=this.charWidths[i[a]]),this.wrapIndent&&(u+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(u+=this.rtlLineOffset),u},f.prototype.getSelections=function(r,o){var s=this.bidiMap,a=s.bidiLevels,i,u=[],h=0,y=Math.min(r,o)-this.wrapIndent,b=Math.max(r,o)-this.wrapIndent,T=!1,$=!1,A=0;this.wrapIndent&&(h+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var S,M=0;M<a.length;M++)S=s.logicalFromVisual[M],i=a[M],T=S>=y&&S<b,T&&!$?A=h:!T&&$&&u.push({left:A,width:h-A}),h+=this.charWidths[i],$=T;if(T&&M===a.length&&u.push({left:A,width:h-A}),this.isRtlDir)for(var R=0;R<u.length;R++)u[R].left+=this.rtlLineOffset;return u},f.prototype.offsetToCol=function(s){this.isRtlDir&&(s-=this.rtlLineOffset);var o=0,s=Math.max(s,0),a=0,i=0,u=this.bidiMap.bidiLevels,h=this.charWidths[u[i]];for(this.wrapIndent&&(s-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);s>a+h/2;){if(a+=h,i===u.length-1){h=0;break}h=this.charWidths[u[++i]]}return i>0&&u[i-1]%2!==0&&u[i]%2===0?(s<a&&i--,o=this.bidiMap.logicalFromVisual[i]):i>0&&u[i-1]%2===0&&u[i]%2!==0?o=1+(s>a?this.bidiMap.logicalFromVisual[i]:this.bidiMap.logicalFromVisual[i-1]):this.isRtlDir&&i===u.length-1&&h===0&&u[i-1]%2===0||!this.isRtlDir&&i===0&&u[i]%2!==0?o=1+this.bidiMap.logicalFromVisual[i]:(i>0&&u[i-1]%2!==0&&h!==0&&i--,o=this.bidiMap.logicalFromVisual[i]),o===0&&this.isRtlDir&&o++,o+this.wrapIndent},f})();n.BidiHandler=c}),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],function(t,n,p){var d=t("./lib/oop"),g=t("./lib/lang"),m=t("./lib/event_emitter").EventEmitter,c=t("./range").Range,f=(function(){function r(o){this.session=o,this.doc=o.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var s=this;this.cursor.on("change",function(a){s.$cursorChanged=!0,s.$silent||s._emit("changeCursor"),!s.$isEmpty&&!s.$silent&&s._emit("changeSelection"),!s.$keepDesiredColumnOnChange&&a.old.column!=a.value.column&&(s.$desiredColumn=null)}),this.anchor.on("change",function(){s.$anchorChanged=!0,!s.$isEmpty&&!s.$silent&&s._emit("changeSelection")})}return r.prototype.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},r.prototype.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},r.prototype.getCursor=function(){return this.lead.getPosition()},r.prototype.setAnchor=function(o,s){this.$isEmpty=!1,this.anchor.setPosition(o,s)},r.prototype.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},r.prototype.getSelectionLead=function(){return this.lead.getPosition()},r.prototype.isBackwards=function(){var o=this.anchor,s=this.lead;return o.row>s.row||o.row==s.row&&o.column>s.column},r.prototype.getRange=function(){var o=this.anchor,s=this.lead;return this.$isEmpty?c.fromPoints(s,s):this.isBackwards()?c.fromPoints(s,o):c.fromPoints(o,s)},r.prototype.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},r.prototype.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},r.prototype.setRange=function(o,s){var a=s?o.end:o.start,i=s?o.start:o.end;this.$setSelection(a.row,a.column,i.row,i.column)},r.prototype.$setSelection=function(o,s,a,i){if(!this.$silent){var u=this.$isEmpty,h=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(o,s),this.cursor.setPosition(a,i),this.$isEmpty=!c.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||u!=this.$isEmpty||h)&&this._emit("changeSelection")}},r.prototype.$moveSelection=function(o){var s=this.lead;this.$isEmpty&&this.setSelectionAnchor(s.row,s.column),o.call(this)},r.prototype.selectTo=function(o,s){this.$moveSelection(function(){this.moveCursorTo(o,s)})},r.prototype.selectToPosition=function(o){this.$moveSelection(function(){this.moveCursorToPosition(o)})},r.prototype.moveTo=function(o,s){this.clearSelection(),this.moveCursorTo(o,s)},r.prototype.moveToPosition=function(o){this.clearSelection(),this.moveCursorToPosition(o)},r.prototype.selectUp=function(){this.$moveSelection(this.moveCursorUp)},r.prototype.selectDown=function(){this.$moveSelection(this.moveCursorDown)},r.prototype.selectRight=function(){this.$moveSelection(this.moveCursorRight)},r.prototype.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},r.prototype.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},r.prototype.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},r.prototype.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},r.prototype.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},r.prototype.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},r.prototype.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},r.prototype.getWordRange=function(o,s){if(typeof s>"u"){var a=o||this.lead;o=a.row,s=a.column}return this.session.getWordRange(o,s)},r.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},r.prototype.selectAWord=function(){var o=this.getCursor(),s=this.session.getAWordRange(o.row,o.column);this.setSelectionRange(s)},r.prototype.getLineRange=function(o,s){var a=typeof o=="number"?o:this.lead.row,i,u=this.session.getFoldLine(a);return u?(a=u.start.row,i=u.end.row):i=a,s===!0?new c(a,0,i,this.session.getLine(i).length):new c(a,0,i+1,0)},r.prototype.selectLine=function(){this.setSelectionRange(this.getLineRange())},r.prototype.moveCursorUp=function(){this.moveCursorBy(-1,0)},r.prototype.moveCursorDown=function(){this.moveCursorBy(1,0)},r.prototype.wouldMoveIntoSoftTab=function(o,s,a){var i=o.column,u=o.column+s;return a<0&&(i=o.column-s,u=o.column),this.session.isTabStop(o)&&this.doc.getLine(o.row).slice(i,u).split(" ").length-1==s},r.prototype.moveCursorLeft=function(){var o=this.lead.getPosition(),s;if(s=this.session.getFoldAt(o.row,o.column,-1))this.moveCursorTo(s.start.row,s.start.column);else if(o.column===0)o.row>0&&this.moveCursorTo(o.row-1,this.doc.getLine(o.row-1).length);else{var a=this.session.getTabSize();this.wouldMoveIntoSoftTab(o,a,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-a):this.moveCursorBy(0,-1)}},r.prototype.moveCursorRight=function(){var o=this.lead.getPosition(),s;if(s=this.session.getFoldAt(o.row,o.column,1))this.moveCursorTo(s.end.row,s.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0);else{var a=this.session.getTabSize(),o=this.lead;this.wouldMoveIntoSoftTab(o,a,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,a):this.moveCursorBy(0,1)}},r.prototype.moveCursorLineStart=function(){var o=this.lead.row,s=this.lead.column,a=this.session.documentToScreenRow(o,s),i=this.session.screenToDocumentPosition(a,0),u=this.session.getDisplayLine(o,null,i.row,i.column),h=u.match(/^\s*/);h[0].length!=s&&!this.session.$useEmacsStyleLineStart&&(i.column+=h[0].length),this.moveCursorToPosition(i)},r.prototype.moveCursorLineEnd=function(){var o=this.lead,s=this.session.getDocumentLastRowColumnPosition(o.row,o.column);if(this.lead.column==s.column){var a=this.session.getLine(s.row);if(s.column==a.length){var i=a.search(/\s+$/);i>0&&(s.column=i)}}this.moveCursorTo(s.row,s.column)},r.prototype.moveCursorFileEnd=function(){var o=this.doc.getLength()-1,s=this.doc.getLine(o).length;this.moveCursorTo(o,s)},r.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},r.prototype.moveCursorLongWordRight=function(){var o=this.lead.row,s=this.lead.column,a=this.doc.getLine(o),i=a.substring(s);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var u=this.session.getFoldAt(o,s,1);if(u){this.moveCursorTo(u.end.row,u.end.column);return}if(this.session.nonTokenRe.exec(i)&&(s+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,i=a.substring(s)),s>=a.length){this.moveCursorTo(o,a.length),this.moveCursorRight(),o<this.doc.getLength()-1&&this.moveCursorWordRight();return}this.session.tokenRe.exec(i)&&(s+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(o,s)},r.prototype.moveCursorLongWordLeft=function(){var o=this.lead.row,s=this.lead.column,a;if(a=this.session.getFoldAt(o,s,-1)){this.moveCursorTo(a.start.row,a.start.column);return}var i=this.session.getFoldStringAt(o,s,-1);i==null&&(i=this.doc.getLine(o).substring(0,s));var u=g.stringReverse(i);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(u)&&(s-=this.session.nonTokenRe.lastIndex,u=u.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),s<=0){this.moveCursorTo(o,0),this.moveCursorLeft(),o>0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(u)&&(s-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(o,s)},r.prototype.$shortWordEndIndex=function(o){var s=0,a,i=/\s/,u=this.session.tokenRe;if(u.lastIndex=0,this.session.tokenRe.exec(o))s=this.session.tokenRe.lastIndex;else{for(;(a=o[s])&&i.test(a);)s++;if(s<1){for(u.lastIndex=0;(a=o[s])&&!u.test(a);)if(u.lastIndex=0,s++,i.test(a))if(s>2){s--;break}else{for(;(a=o[s])&&i.test(a);)s++;if(s>2)break}}}return u.lastIndex=0,s},r.prototype.moveCursorShortWordRight=function(){var o=this.lead.row,s=this.lead.column,a=this.doc.getLine(o),i=a.substring(s),u=this.session.getFoldAt(o,s,1);if(u)return this.moveCursorTo(u.end.row,u.end.column);if(s==a.length){var h=this.doc.getLength();do o++,i=this.doc.getLine(o);while(o<h&&/^\s*$/.test(i));/^\s+/.test(i)||(i=""),s=0}var y=this.$shortWordEndIndex(i);this.moveCursorTo(o,s+y)},r.prototype.moveCursorShortWordLeft=function(){var o=this.lead.row,s=this.lead.column,a;if(a=this.session.getFoldAt(o,s,-1))return this.moveCursorTo(a.start.row,a.start.column);var i=this.session.getLine(o).substring(0,s);if(s===0){do o--,i=this.doc.getLine(o);while(o>0&&/^\s*$/.test(i));s=i.length,/\s+$/.test(i)||(i="")}var u=g.stringReverse(i),h=this.$shortWordEndIndex(u);return this.moveCursorTo(o,s-h)},r.prototype.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},r.prototype.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},r.prototype.moveCursorBy=function(o,s){var a=this.session.documentToScreenPosition(this.lead.row,this.lead.column),i;if(s===0&&(o!==0&&(this.session.$bidiHandler.isBidiRow(a.row,this.lead.row)?(i=this.session.$bidiHandler.getPosLeft(a.column),a.column=Math.round(i/this.session.$bidiHandler.charWidths[0])):i=a.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?a.column=this.$desiredColumn:this.$desiredColumn=a.column),o!=0&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var u=this.session.lineWidgets[this.lead.row];o<0?o-=u.rowsAbove||0:o>0&&(o+=u.rowCount-(u.rowsAbove||0))}var h=this.session.screenToDocumentPosition(a.row+o,a.column,i);o!==0&&s===0&&h.row===this.lead.row&&(h.column,this.lead.column),this.moveCursorTo(h.row,h.column+s,s===0)},r.prototype.moveCursorToPosition=function(o){this.moveCursorTo(o.row,o.column)},r.prototype.moveCursorTo=function(o,s,a){var i=this.session.getFoldAt(o,s,1);i&&(o=i.start.row,s=i.start.column),this.$keepDesiredColumnOnChange=!0;var u=this.session.getLine(o);/[\uDC00-\uDFFF]/.test(u.charAt(s))&&u.charAt(s-1)&&(this.lead.row==o&&this.lead.column==s+1?s=s-1:s=s+1),this.lead.setPosition(o,s),this.$keepDesiredColumnOnChange=!1,a||(this.$desiredColumn=null)},r.prototype.moveCursorToScreen=function(o,s,a){var i=this.session.screenToDocumentPosition(o,s);this.moveCursorTo(i.row,i.column,a)},r.prototype.detach=function(){this.lead.detach(),this.anchor.detach()},r.prototype.fromOrientedRange=function(o){this.setSelectionRange(o,o.cursor==o.start),this.$desiredColumn=o.desiredColumn||this.$desiredColumn},r.prototype.toOrientedRange=function(o){var s=this.getRange();return o?(o.start.column=s.start.column,o.start.row=s.start.row,o.end.column=s.end.column,o.end.row=s.end.row):o=s,o.cursor=this.isBackwards()?o.start:o.end,o.desiredColumn=this.$desiredColumn,o},r.prototype.getRangeOfMovements=function(o){var s=this.getCursor();try{o(this);var a=this.getCursor();return c.fromPoints(s,a)}catch{return c.fromPoints(s,s)}finally{this.moveCursorToPosition(s)}},r.prototype.toJSON=function(){if(this.rangeCount)var o=this.ranges.map(function(s){var a=s.clone();return a.isBackwards=s.cursor==s.start,a});else{var o=this.getRange();o.isBackwards=this.isBackwards()}return o},r.prototype.fromJSON=function(o){if(o.start==null)if(this.rangeList&&o.length>1){this.toSingleRange(o[0]);for(var s=o.length;s--;){var a=c.fromPoints(o[s].start,o[s].end);o[s].isBackwards&&(a.cursor=a.start),this.addRange(a,!0)}return}else o=o[0];this.rangeList&&this.toSingleRange(o),this.setSelectionRange(o,o.isBackwards)},r.prototype.isEqual=function(o){if((o.length||this.rangeCount)&&o.length!=this.rangeCount)return!1;if(!o.length||!this.ranges)return this.getRange().isEqual(o);for(var s=this.ranges.length;s--;)if(!this.ranges[s].isEqual(o[s]))return!1;return!0},r})();f.prototype.setSelectionAnchor=f.prototype.setAnchor,f.prototype.getSelectionAnchor=f.prototype.getAnchor,f.prototype.setSelectionRange=f.prototype.setRange,d.implement(f.prototype,m),n.Selection=f}),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(t,n,p){var d=t("./lib/report_error").reportError,g=2e3,m=(function(){function c(f){this.splitRegex,this.states=f,this.regExps={},this.matchMappings={};for(var r in this.states){for(var o=this.states[r],s=[],a=0,i=this.matchMappings[r]={defaultToken:"text"},u="g",h=[],y=0;y<o.length;y++){var b=o[y];if(b.defaultToken&&(i.defaultToken=b.defaultToken),b.caseInsensitive&&u.indexOf("i")===-1&&(u+="i"),b.unicode&&u.indexOf("u")===-1&&(u+="u"),b.regex!=null){b.regex instanceof RegExp&&(b.regex=b.regex.toString().slice(1,-1));var T=b.regex,$=new RegExp("(?:("+T+")|(.))").exec("a").length-2;Array.isArray(b.token)?b.token.length==1||$==1?b.token=b.token[0]:$-1!=b.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:b,groupCount:$-1}),b.token=b.token[0]):(b.tokenArray=b.token,b.token=null,b.onMatch=this.$arrayTokens):typeof b.token=="function"&&!b.onMatch&&($>1?b.onMatch=this.$applyToken:b.onMatch=b.token),$>1&&(/\\\d/.test(b.regex)?T=b.regex.replace(/\\([0-9]+)/g,function(A,S){return"\\"+(parseInt(S,10)+a+1)}):($=1,T=this.removeCapturingGroups(b.regex)),!b.splitRegex&&typeof b.token!="string"&&h.push(b)),i[a]=y,a+=$,s.push(T),b.onMatch||(b.onMatch=null)}}s.length||(i[0]=0,s.push("$")),h.forEach(function(A){A.splitRegex=this.createSplitterRegexp(A.regex,u)},this),this.regExps[r]=new RegExp("("+s.join(")|(")+")|($)",u)}}return c.prototype.$setMaxTokenCount=function(f){g=f|0},c.prototype.$applyToken=function(f){var r=this.splitRegex.exec(f).slice(1),o=this.token.apply(this,r);if(typeof o=="string")return[{type:o,value:f}];for(var s=[],a=0,i=o.length;a<i;a++)r[a]&&(s[s.length]={type:o[a],value:r[a]});return s},c.prototype.$arrayTokens=function(f){if(!f)return[];var r=this.splitRegex.exec(f);if(!r)return"text";for(var o=[],s=this.tokenArray,a=0,i=s.length;a<i;a++)r[a+1]&&(o[o.length]={type:s[a],value:r[a+1]});return o},c.prototype.removeCapturingGroups=function(f){var r=f.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,function(o,s){return s?"(?:":o});return r},c.prototype.createSplitterRegexp=function(f,r){if(f.indexOf("(?=")!=-1){var o=0,s=!1,a={};f.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(i,u,h,y,b,T){return s?s=b!="]":b?s=!0:y?(o==a.stack&&(a.end=T+1,a.stack=-1),o--):h&&(o++,h.length!=1&&(a.stack=o,a.start=T)),i}),a.end!=null&&/^\)*$/.test(f.substr(a.end))&&(f=f.substring(0,a.start)+f.substr(a.end))}return f.charAt(0)!="^"&&(f="^"+f),f.charAt(f.length-1)!="$"&&(f+="$"),new RegExp(f,(r||"").replace("g",""))},c.prototype.getLineTokens=function(f,r){if(r&&typeof r!="string"){var o=r.slice(0);r=o[0],r==="#tmp"&&(o.shift(),r=o.shift())}else var o=[];var s=r||"start",a=this.states[s];a||(s="start",a=this.states[s]);var i=this.matchMappings[s],u=this.regExps[s];u.lastIndex=0;for(var h,y=[],b=0,T=0,$={type:null,value:""};h=u.exec(f);){var A=i.defaultToken,S=null,M=h[0],R=u.lastIndex;if(R-M.length>b){var L=f.substring(b,R-M.length);$.type==A?$.value+=L:($.type&&y.push($),$={type:A,value:L})}for(var _=0;_<h.length-2;_++)if(h[_+1]!==void 0){S=a[i[_]],S.onMatch?A=S.onMatch(M,s,o,f):A=S.token,S.next&&(typeof S.next=="string"?s=S.next:s=S.next(s,o),a=this.states[s],a||(this.reportError("state doesn't exist",s),s="start",a=this.states[s]),i=this.matchMappings[s],b=R,u=this.regExps[s],u.lastIndex=R),S.consumeLineEnd&&(b=R);break}if(M){if(typeof A=="string")(!S||S.merge!==!1)&&$.type===A?$.value+=M:($.type&&y.push($),$={type:A,value:M});else if(A){$.type&&y.push($),$={type:null,value:""};for(var _=0;_<A.length;_++)y.push(A[_])}}if(b==f.length)break;if(b=R,T++>g){for(T>2*f.length&&this.reportError("infinite loop with in ace tokenizer",{startState:r,line:f});b<f.length;)$.type&&y.push($),$={value:f.substring(b,b+=500),type:"overflow"};s="start",o=[];break}}return $.type&&y.push($),o.length>1&&o[0]!==s&&o.unshift("#tmp",s),{tokens:y,state:o.length?o:s}},c})();m.prototype.reportError=d,n.Tokenizer=m}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(t,n,p){var d=t("../lib/deep_copy").deepCopy,g;g=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}},(function(){this.addRules=function(f,r){if(!r){for(var o in f)this.$rules[o]=f[o];return}for(var o in f){for(var s=f[o],a=0;a<s.length;a++){var i=s[a];(i.next||i.onMatch)&&(typeof i.next=="string"&&i.next.indexOf(r)!==0&&(i.next=r+i.next),i.nextState&&i.nextState.indexOf(r)!==0&&(i.nextState=r+i.nextState))}this.$rules[r+o]=s}},this.getRules=function(){return this.$rules},this.embedRules=function(f,r,o,s,a){var i=typeof f=="function"?new f().getRules():f;if(s)for(var u=0;u<s.length;u++)s[u]=r+s[u];else{s=[];for(var h in i)s.push(r+h)}if(this.addRules(i,r),o)for(var y=Array.prototype[a?"push":"unshift"],u=0;u<s.length;u++)y.apply(this.$rules[s[u]],d(o));this.$embeds||(this.$embeds=[]),this.$embeds.push(r)},this.getEmbeds=function(){return this.$embeds};var m=function(f,r){return(f!="start"||r.length)&&r.unshift(this.nextState,f),this.nextState},c=function(f,r){return r.shift(),r.shift()||"start"};this.normalizeRules=function(){var f=0,r=this.$rules;function o(s){var a=r[s];a.processed=!0;for(var i=0;i<a.length;i++){var u=a[i],h=null;Array.isArray(u)&&(h=u,u={}),!u.regex&&u.start&&(u.regex=u.start,u.next||(u.next=[]),u.next.push({defaultToken:u.token},{token:u.token+".end",regex:u.end||u.start,next:"pop"}),u.token=u.token+".start",u.push=!0);var y=u.next||u.push;if(y&&Array.isArray(y)){var b=u.stateName;b||(b=u.token,typeof b!="string"&&(b=b[0]||""),r[b]&&(b+=f++)),r[b]=y,u.next=b,o(b)}else y=="pop"&&(u.next=c);if(u.push&&(u.nextState=u.next||u.push,u.next=m,delete u.push),u.rules)for(var T in u.rules)r[T]?r[T].push&&r[T].push.apply(r[T],u.rules[T]):r[T]=u.rules[T];var $=typeof u=="string"?u:u.include;if($&&($==="$self"&&($="start"),Array.isArray($)?h=$.map(function(S){return r[S]}):h=r[$]),h){var A=[i,1].concat(h);u.noEscape&&(A=A.filter(function(S){return!S.next})),a.splice.apply(a,A),i--}u.keywordMap&&(u.token=this.createKeywordMapper(u.keywordMap,u.defaultToken||"text",u.caseInsensitive),delete u.defaultToken)}}Object.keys(r).forEach(o,this)},this.createKeywordMapper=function(f,r,o,s){var a=Object.create(null);return this.$keywordList=[],Object.keys(f).forEach(function(i){for(var u=f[i],h=u.split(s||"|"),y=h.length;y--;){var b=h[y];this.$keywordList.push(b),o&&(b=b.toLowerCase()),a[b]=i}},this),f=null,o?function(i){return a[i.toLowerCase()]||r}:function(i){return a[i]||r}},this.getKeywords=function(){return this.$keywords}}).call(g.prototype),n.TextHighlightRules=g}),ace.define("ace/mode/behaviour",["require","exports","module"],function(t,n,p){var d;d=function(){this.$behaviours={}},(function(){this.add=function(g,m,c){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[g]:this.$behaviours[g]={}}this.$behaviours[g][m]=c},this.addBehaviours=function(g){for(var m in g)for(var c in g[m])this.add(m,c,g[m][c])},this.remove=function(g){this.$behaviours&&this.$behaviours[g]&&delete this.$behaviours[g]},this.inherit=function(g,m){if(typeof g=="function")var c=new g().getBehaviours(m);else var c=g.getBehaviours(m);this.addBehaviours(c)},this.getBehaviours=function(g){if(g){for(var m={},c=0;c<g.length;c++)this.$behaviours[g[c]]&&(m[g[c]]=this.$behaviours[g[c]]);return m}else return this.$behaviours}}).call(d.prototype),n.Behaviour=d}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(t,n,p){var d=t("./range").Range,g=(function(){function m(c,f,r){this.$session=c,this.$row=f,this.$rowTokens=c.getTokens(f);var o=c.getTokenAt(f,r);this.$tokenIndex=o?o.index:-1}return m.prototype.stepBackward=function(){for(this.$tokenIndex-=1;this.$tokenIndex<0;){if(this.$row-=1,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},m.prototype.stepForward=function(){this.$tokenIndex+=1;for(var c;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,c||(c=this.$session.getLength()),this.$row>=c)return this.$row=c-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},m.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},m.prototype.getCurrentTokenRow=function(){return this.$row},m.prototype.getCurrentTokenColumn=function(){var c=this.$rowTokens,f=this.$tokenIndex,r=c[f].start;if(r!==void 0)return r;for(r=0;f>0;)f-=1,r+=c[f].value.length;return r},m.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},m.prototype.getCurrentTokenRange=function(){var c=this.$rowTokens[this.$tokenIndex],f=this.getCurrentTokenColumn();return new d(this.$row,f,this.$row,f+c.value.length)},m})();n.TokenIterator=g}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(t,n,p){var d=t("../../lib/oop"),g=t("../behaviour").Behaviour,m=t("../../token_iterator").TokenIterator,c=t("../../lib/lang"),f=["text","paren.rparen","rparen","paren","punctuation.operator"],r=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],o,s={},a={'"':'"',"'":"'"},i=function(y){var b=-1;if(y.multiSelect&&(b=y.selection.index,s.rangeCount!=y.multiSelect.rangeCount&&(s={rangeCount:y.multiSelect.rangeCount})),s[b])return o=s[b];o=s[b]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},u=function(y,b,T,$){var A=y.end.row-y.start.row;return{text:T+b+$,selection:[0,y.start.column+1,A,y.end.column+(A?0:1)]}},h;h=function(y){y=y||{},this.add("braces","insertion",function(b,T,$,A,S){var M=$.getCursorPosition(),R=A.doc.getLine(M.row);if(S=="{"){i($);var L=$.getSelectionRange(),_=A.doc.getTextRange(L),O=A.getTokenAt(M.row,M.column);if(_!==""&&_!=="{"&&$.getWrapBehavioursEnabled())return u(L,_,"{","}");if(O&&/(?:string)\.quasi|\.xml/.test(O.type)){var w=[/tag\-(?:open|name)/,/attribute\-name/];return w.some(function(I){return I.test(O.type)})||/(string)\.quasi/.test(O.type)&&O.value[M.column-O.start-1]!=="$"?void 0:(h.recordAutoInsert($,A,"}"),{text:"{}",selection:[1,1]})}else if(h.isSaneInsertion($,A))return/[\]\}\)]/.test(R[M.column])||$.inMultiSelectMode||y.braces?(h.recordAutoInsert($,A,"}"),{text:"{}",selection:[1,1]}):(h.recordMaybeInsert($,A,"{"),{text:"{",selection:[1,1]})}else if(S=="}"){i($);var v=R.substring(M.column,M.column+1);if(v=="}"){var C=A.$findOpeningBracket("}",{column:M.column+1,row:M.row});if(C!==null&&h.isAutoInsertedClosing(M,R,S))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(S==`
1343
1343
  `||S==`\r
1344
- `){i($);var E="";h.isMaybeInsertedClosing(M,R)&&(E=l.stringRepeat("}",o.maybeInsertedBrackets),h.clearMaybeInsertedClosing());var v=R.substring(M.column,M.column+1);if(v==="}"){var x=A.findMatchingBracket({row:M.row,column:M.column+1},"}");if(!x)return null;var k=this.$getIndent(A.getLine(x.row))}else if(E)var k=this.$getIndent(R);else{h.clearMaybeInsertedClosing();return}var O=k+A.getTabString();return{text:`
1345
- `+O+`
1346
- `+k+E,selection:[1,O.length,1,O.length]}}else h.clearMaybeInsertedClosing()}),this.add("braces","deletion",function(b,T,$,A,S){var M=A.doc.getTextRange(S);if(!S.isMultiLine()&&M=="{"){i($);var R=A.doc.getLine(S.start.row),L=R.substring(S.end.column,S.end.column+1);if(L=="}")return S.end.column++,S;o.maybeInsertedBrackets--}}),this.add("parens","insertion",function(b,T,$,A,S){if(S=="("){i($);var M=$.getSelectionRange(),R=A.doc.getTextRange(M);if(R!==""&&$.getWrapBehavioursEnabled())return u(M,R,"(",")");if(h.isSaneInsertion($,A))return h.recordAutoInsert($,A,")"),{text:"()",selection:[1,1]}}else if(S==")"){i($);var L=$.getCursorPosition(),_=A.doc.getLine(L.row),I=_.substring(L.column,L.column+1);if(I==")"){var w=A.$findOpeningBracket(")",{column:L.column+1,row:L.row});if(w!==null&&h.isAutoInsertedClosing(L,_,S))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(b,T,$,A,S){var M=A.doc.getTextRange(S);if(!S.isMultiLine()&&M=="("){i($);var R=A.doc.getLine(S.start.row),L=R.substring(S.start.column+1,S.start.column+2);if(L==")")return S.end.column++,S}}),this.add("brackets","insertion",function(b,T,$,A,S){if(S=="["){i($);var M=$.getSelectionRange(),R=A.doc.getTextRange(M);if(R!==""&&$.getWrapBehavioursEnabled())return u(M,R,"[","]");if(h.isSaneInsertion($,A))return h.recordAutoInsert($,A,"]"),{text:"[]",selection:[1,1]}}else if(S=="]"){i($);var L=$.getCursorPosition(),_=A.doc.getLine(L.row),I=_.substring(L.column,L.column+1);if(I=="]"){var w=A.$findOpeningBracket("]",{column:L.column+1,row:L.row});if(w!==null&&h.isAutoInsertedClosing(L,_,S))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(b,T,$,A,S){var M=A.doc.getTextRange(S);if(!S.isMultiLine()&&M=="["){i($);var R=A.doc.getLine(S.start.row),L=R.substring(S.start.column+1,S.start.column+2);if(L=="]")return S.end.column++,S}}),this.add("string_dquotes","insertion",function(b,T,$,A,S){var M=A.$mode.$quotes||a;if(S.length==1&&M[S]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(S)!=-1)return;i($);var R=S,L=$.getSelectionRange(),_=A.doc.getTextRange(L);if(_!==""&&(_.length!=1||!M[_])&&$.getWrapBehavioursEnabled())return u(L,_,R,R);if(!_){var I=$.getCursorPosition(),w=A.doc.getLine(I.row),v=w.substring(I.column-1,I.column),C=w.substring(I.column,I.column+1),E=A.getTokenAt(I.row,I.column),x=A.getTokenAt(I.row,I.column+1);if(v=="\\"&&E&&/escape/.test(E.type))return null;var k=E&&/string|escape/.test(E.type),O=!x||/string|escape/.test(x.type),D;if(C==R)D=k!==O,D&&/string\.end/.test(x.type)&&(D=!1);else{if(k&&!O||k&&O)return null;var N=A.$mode.tokenRe;N.lastIndex=0;var P=N.test(v);N.lastIndex=0;var z=N.test(C),F=A.$mode.$pairQuotesAfter,W=F&&F[R]&&F[R].test(v);if(!W&&P||z||C&&!/[\s;,.})\]\\]/.test(C))return null;var H=w[I.column-2];if(v==R&&(H==R||N.test(H)))return null;D=!0}return{text:D?R+R:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(b,T,$,A,S){var M=A.$mode.$quotes||a,R=A.doc.getTextRange(S);if(!S.isMultiLine()&&M.hasOwnProperty(R)){i($);var L=A.doc.getLine(S.start.row),_=L.substring(S.start.column+1,S.start.column+2);if(_==R)return S.end.column++,S}}),y.closeDocComment!==!1&&this.add("doc comment end","insertion",function(b,T,$,A,S){if(b==="doc-start"&&(S===`
1344
+ `){i($);var E="";h.isMaybeInsertedClosing(M,R)&&(E=c.stringRepeat("}",o.maybeInsertedBrackets),h.clearMaybeInsertedClosing());var v=R.substring(M.column,M.column+1);if(v==="}"){var x=A.findMatchingBracket({row:M.row,column:M.column+1},"}");if(!x)return null;var k=this.$getIndent(A.getLine(x.row))}else if(E)var k=this.$getIndent(R);else{h.clearMaybeInsertedClosing();return}var D=k+A.getTabString();return{text:`
1345
+ `+D+`
1346
+ `+k+E,selection:[1,D.length,1,D.length]}}else h.clearMaybeInsertedClosing()}),this.add("braces","deletion",function(b,T,$,A,S){var M=A.doc.getTextRange(S);if(!S.isMultiLine()&&M=="{"){i($);var R=A.doc.getLine(S.start.row),L=R.substring(S.end.column,S.end.column+1);if(L=="}")return S.end.column++,S;o.maybeInsertedBrackets--}}),this.add("parens","insertion",function(b,T,$,A,S){if(S=="("){i($);var M=$.getSelectionRange(),R=A.doc.getTextRange(M);if(R!==""&&$.getWrapBehavioursEnabled())return u(M,R,"(",")");if(h.isSaneInsertion($,A))return h.recordAutoInsert($,A,")"),{text:"()",selection:[1,1]}}else if(S==")"){i($);var L=$.getCursorPosition(),_=A.doc.getLine(L.row),O=_.substring(L.column,L.column+1);if(O==")"){var w=A.$findOpeningBracket(")",{column:L.column+1,row:L.row});if(w!==null&&h.isAutoInsertedClosing(L,_,S))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(b,T,$,A,S){var M=A.doc.getTextRange(S);if(!S.isMultiLine()&&M=="("){i($);var R=A.doc.getLine(S.start.row),L=R.substring(S.start.column+1,S.start.column+2);if(L==")")return S.end.column++,S}}),this.add("brackets","insertion",function(b,T,$,A,S){if(S=="["){i($);var M=$.getSelectionRange(),R=A.doc.getTextRange(M);if(R!==""&&$.getWrapBehavioursEnabled())return u(M,R,"[","]");if(h.isSaneInsertion($,A))return h.recordAutoInsert($,A,"]"),{text:"[]",selection:[1,1]}}else if(S=="]"){i($);var L=$.getCursorPosition(),_=A.doc.getLine(L.row),O=_.substring(L.column,L.column+1);if(O=="]"){var w=A.$findOpeningBracket("]",{column:L.column+1,row:L.row});if(w!==null&&h.isAutoInsertedClosing(L,_,S))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(b,T,$,A,S){var M=A.doc.getTextRange(S);if(!S.isMultiLine()&&M=="["){i($);var R=A.doc.getLine(S.start.row),L=R.substring(S.start.column+1,S.start.column+2);if(L=="]")return S.end.column++,S}}),this.add("string_dquotes","insertion",function(b,T,$,A,S){var M=A.$mode.$quotes||a;if(S.length==1&&M[S]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(S)!=-1)return;i($);var R=S,L=$.getSelectionRange(),_=A.doc.getTextRange(L);if(_!==""&&(_.length!=1||!M[_])&&$.getWrapBehavioursEnabled())return u(L,_,R,R);if(!_){var O=$.getCursorPosition(),w=A.doc.getLine(O.row),v=w.substring(O.column-1,O.column),C=w.substring(O.column,O.column+1),E=A.getTokenAt(O.row,O.column),x=A.getTokenAt(O.row,O.column+1);if(v=="\\"&&E&&/escape/.test(E.type))return null;var k=E&&/string|escape/.test(E.type),D=!x||/string|escape/.test(x.type),I;if(C==R)I=k!==D,I&&/string\.end/.test(x.type)&&(I=!1);else{if(k&&!D||k&&D)return null;var N=A.$mode.tokenRe;N.lastIndex=0;var P=N.test(v);N.lastIndex=0;var z=N.test(C),F=A.$mode.$pairQuotesAfter,W=F&&F[R]&&F[R].test(v);if(!W&&P||z||C&&!/[\s;,.})\]\\]/.test(C))return null;var H=w[O.column-2];if(v==R&&(H==R||N.test(H)))return null;I=!0}return{text:I?R+R:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(b,T,$,A,S){var M=A.$mode.$quotes||a,R=A.doc.getTextRange(S);if(!S.isMultiLine()&&M.hasOwnProperty(R)){i($);var L=A.doc.getLine(S.start.row),_=L.substring(S.start.column+1,S.start.column+2);if(_==R)return S.end.column++,S}}),y.closeDocComment!==!1&&this.add("doc comment end","insertion",function(b,T,$,A,S){if(b==="doc-start"&&(S===`
1347
1347
  `||S===`\r
1348
- `)&&$.selection.isEmpty()){var M=$.getCursorPosition();if(M.column===0)return;for(var R=A.doc.getLine(M.row),L=A.doc.getLine(M.row+1),_=A.getTokens(M.row),I=0,w=0;w<_.length;w++){I+=_[w].value.length;var v=_[w];if(I>=M.column){if(I===M.column){if(!/\.doc/.test(v.type))return;if(/\*\//.test(v.value)){var C=_[w+1];if(!C||!/\.doc/.test(C.type))return}}var E=M.column-(I-v.value.length),x=v.value.indexOf("*/"),k=v.value.indexOf("/**",x>-1?x+2:0);if(k!==-1&&E>k&&E<k+3||x!==-1&&k!==-1&&E>=x&&E<=k||!/\.doc/.test(v.type))return;break}}var O=this.$getIndent(R);if(/\s*\*/.test(L))return/^\s*\*/.test(R)?{text:S+O+"* ",selection:[1,2+O.length,1,2+O.length]}:{text:S+O+" * ",selection:[1,3+O.length,1,3+O.length]};if(/\/\*\*/.test(R.substring(0,M.column)))return{text:S+O+" * "+S+" "+O+"*/",selection:[1,4+O.length,1,4+O.length]}}})},h.isSaneInsertion=function(y,b){var T=y.getCursorPosition(),$=new m(b,T.row,T.column);if(!this.$matchTokenType($.getCurrentToken()||"text",f)){if(/[)}\]]/.test(y.session.getLine(T.row)[T.column]))return!0;var A=new m(b,T.row,T.column+1);if(!this.$matchTokenType(A.getCurrentToken()||"text",f))return!1}return $.stepForward(),$.getCurrentTokenRow()!==T.row||this.$matchTokenType($.getCurrentToken()||"text",r)},h.$matchTokenType=function(y,b){return b.indexOf(y.type||y)>-1},h.recordAutoInsert=function(y,b,T){var $=y.getCursorPosition(),A=b.doc.getLine($.row);this.isAutoInsertedClosing($,A,o.autoInsertedLineEnd[0])||(o.autoInsertedBrackets=0),o.autoInsertedRow=$.row,o.autoInsertedLineEnd=T+A.substr($.column),o.autoInsertedBrackets++},h.recordMaybeInsert=function(y,b,T){var $=y.getCursorPosition(),A=b.doc.getLine($.row);this.isMaybeInsertedClosing($,A)||(o.maybeInsertedBrackets=0),o.maybeInsertedRow=$.row,o.maybeInsertedLineStart=A.substr(0,$.column)+T,o.maybeInsertedLineEnd=A.substr($.column),o.maybeInsertedBrackets++},h.isAutoInsertedClosing=function(y,b,T){return o.autoInsertedBrackets>0&&y.row===o.autoInsertedRow&&T===o.autoInsertedLineEnd[0]&&b.substr(y.column)===o.autoInsertedLineEnd},h.isMaybeInsertedClosing=function(y,b){return o.maybeInsertedBrackets>0&&y.row===o.maybeInsertedRow&&b.substr(y.column)===o.maybeInsertedLineEnd&&b.substr(0,y.column)==o.maybeInsertedLineStart},h.popAutoInsertedClosing=function(){o.autoInsertedLineEnd=o.autoInsertedLineEnd.substr(1),o.autoInsertedBrackets--},h.clearMaybeInsertedClosing=function(){o&&(o.maybeInsertedBrackets=0,o.maybeInsertedRow=-1)},d.inherits(h,g),n.CstyleBehaviour=h}),ace.define("ace/unicode",["require","exports","module"],function(t,n,p){for(var d=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],g=0,m=[],l=0;l<d.length;l+=2)m.push(g+=d[l]),d[l+1]&&m.push(45,g+=d[l+1]);n.wordChars=String.fromCharCode.apply(null,m)}),ace.define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(t,n,p){var d=t("../config"),g=t("../tokenizer").Tokenizer,m=t("./text_highlight_rules").TextHighlightRules,l=t("./behaviour/cstyle").CstyleBehaviour,f=t("../unicode"),r=t("../lib/lang"),o=t("../token_iterator").TokenIterator,s=t("../range").Range,a;a=function(){this.HighlightRules=m},(function(){this.$defaultBehaviour=new l,this.tokenRe=new RegExp("^["+f.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+f.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new g(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(i,u,h,y){var b=u.doc,T=!0,$=!0,A=1/0,S=u.getTabSize(),M=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var _=this.lineCommentStart.map(r.escapeRegExp).join("|"),R=this.lineCommentStart[0];else var _=r.escapeRegExp(this.lineCommentStart),R=this.lineCommentStart;_=new RegExp("^(\\s*)(?:"+_+") ?"),M=u.getUseSoftTabs();var v=function(z,F){var W=z.match(_);if(W){var H=W[1].length,B=W[0].length;!x(z,H,B)&&W[0][B-1]==" "&&B--,b.removeInLine(F,H,B)}},E=R+" ",w=function(z,F){(!T||/\S/.test(z))&&(x(z,A,A)?b.insertInLine({row:F,column:A},E):b.insertInLine({row:F,column:A},R))},C=function(z,F){return _.test(z)},x=function(z,F,W){for(var H=0;F--&&z.charAt(F)==" ";)H++;if(H%S!=0)return!1;for(var H=0;z.charAt(W++)==" ";)H++;return S>2?H%S!=S-1:H%S==0}}else{if(!this.blockComment)return!1;var R=this.blockComment.start,L=this.blockComment.end,_=new RegExp("^(\\s*)(?:"+r.escapeRegExp(R)+")"),I=new RegExp("(?:"+r.escapeRegExp(L)+")\\s*$"),w=function(D,N){C(D,N)||(!T||/\S/.test(D))&&(b.insertInLine({row:N,column:D.length},L),b.insertInLine({row:N,column:A},R))},v=function(D,N){var P;(P=D.match(I))&&b.removeInLine(N,D.length-P[0].length,D.length),(P=D.match(_))&&b.removeInLine(N,P[1].length,P[0].length)},C=function(D,N){if(_.test(D))return!0;for(var P=u.getTokens(N),z=0;z<P.length;z++)if(P[z].type==="comment")return!0}}function k(D){for(var N=h;N<=y;N++)D(b.getLine(N),N)}var O=1/0;k(function(D,N){var P=D.search(/\S/);P!==-1?(P<A&&(A=P),$&&!C(D,N)&&($=!1)):O>D.length&&(O=D.length)}),A==1/0&&(A=O,T=!1,$=!1),M&&A%S!=0&&(A=Math.floor(A/S)*S),k($?v:w)},this.toggleBlockComment=function(i,u,h,y){var b=this.blockComment;if(b){!b.start&&b[0]&&(b=b[0]);var T=new o(u,y.row,y.column),$=T.getCurrentToken();u.selection;var A=u.selection.toOrientedRange(),S,M;if($&&/comment/.test($.type)){for(var R,L;$&&/comment/.test($.type);){var _=$.value.indexOf(b.start);if(_!=-1){var I=T.getCurrentTokenRow(),w=T.getCurrentTokenColumn()+_;R=new s(I,w,I,w+b.start.length);break}$=T.stepBackward()}for(var T=new o(u,y.row,y.column),$=T.getCurrentToken();$&&/comment/.test($.type);){var _=$.value.indexOf(b.end);if(_!=-1){var I=T.getCurrentTokenRow(),w=T.getCurrentTokenColumn()+_;L=new s(I,w,I,w+b.end.length);break}$=T.stepForward()}L&&u.remove(L),R&&(u.remove(R),S=R.start.row,M=-b.start.length)}else M=b.start.length,S=h.start.row,u.insert(h.end,b.end),u.insert(h.start,b.start);A.start.row==S&&(A.start.column+=M),A.end.row==S&&(A.end.column+=M),u.selection.fromOrientedRange(A)}},this.getNextLineIndent=function(i,u,h){return this.$getIndent(u)},this.checkOutdent=function(i,u,h){return!1},this.autoOutdent=function(i,u,h){},this.$getIndent=function(i){return i.match(/^\s*/)[0]},this.createWorker=function(i){return null},this.createModeDelegates=function(i){this.$embeds=[],this.$modes={};for(var u in i)if(i[u]){var h=i[u],y=h.prototype.$id,b=d.$modes[y];b||(d.$modes[y]=b=new h),d.$modes[u]||(d.$modes[u]=b),this.$embeds.push(u),this.$modes[u]=b}for(var T=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],$=function(S){(function(M){var R=T[S],L=M[R];M[T[S]]=function(){return this.$delegator(R,arguments,L)}})(A)},A=this,u=0;u<T.length;u++)$(u)},this.$delegator=function(i,u,h){var y=u[0]||"start";if(typeof y!="string"){if(Array.isArray(y[2])){var b=y[2][y[2].length-1],T=this.$modes[b];if(T)return T[i].apply(T,[y[1]].concat([].slice.call(u,1)))}y=y[0]||"start"}for(var $=0;$<this.$embeds.length;$++)if(this.$modes[this.$embeds[$]]){var A=y.split(this.$embeds[$]);if(!A[0]&&A[1]){u[0]=A[1];var T=this.$modes[this.$embeds[$]];return T[i].apply(T,u)}}var S=h.apply(this,u);return h?S:void 0},this.transformAction=function(i,u,h,y,b){if(this.$behaviour){var T=this.$behaviour.getBehaviours();for(var $ in T)if(T[$][u]){var A=T[$][u].apply(this,arguments);if(A)return A}}},this.getKeywords=function(i){if(!this.completionKeywords){var u=this.$tokenizer.rules,h=[];for(var y in u)for(var b=u[y],T=0,$=b.length;T<$;T++)if(typeof b[T].token=="string")/keyword|support|storage/.test(b[T].token)&&h.push(b[T].regex);else if(typeof b[T].token=="object"){for(var A=0,S=b[T].token.length;A<S;A++)if(/keyword|support|storage/.test(b[T].token[A])){var y=b[T].regex.match(/\(.+?\)/g)[A];h.push(y.substr(1,y.length-2))}}this.completionKeywords=h}return i?h.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(i,u,h,y){var b=this.$keywordList||this.$createKeywordList();return b.map(function(T){return{name:T,value:T,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}).call(a.prototype),n.Mode=a}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(t,n,p){var d=t("./lib/dom"),g=(function(){function m(l){this.session=l,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}return m.prototype.getRowLength=function(l){var f;return this.lineWidgets?f=this.lineWidgets[l]&&this.lineWidgets[l].rowCount||0:f=0,!this.$useWrapMode||!this.$wrapData[l]?1+f:this.$wrapData[l].length+1+f},m.prototype.$getWidgetScreenLength=function(){var l=0;return this.lineWidgets.forEach(function(f){f&&f.rowCount&&!f.hidden&&(l+=f.rowCount)}),l},m.prototype.$onChangeEditor=function(l){this.attach(l.editor)},m.prototype.attach=function(l){l&&l.widgetManager&&l.widgetManager!=this&&l.widgetManager.detach(),this.editor!=l&&(this.detach(),this.editor=l,l&&(l.widgetManager=this,l.renderer.on("beforeRender",this.measureWidgets),l.renderer.on("afterRender",this.renderWidgets)))},m.prototype.detach=function(l){var f=this.editor;if(f){this.editor=null,f.widgetManager=null,f.renderer.off("beforeRender",this.measureWidgets),f.renderer.off("afterRender",this.renderWidgets);var r=this.session.lineWidgets;r&&r.forEach(function(o){o&&o.el&&o.el.parentNode&&(o._inDocument=!1,o.el.parentNode.removeChild(o.el))})}},m.prototype.updateOnFold=function(l,f){var r=f.lineWidgets;if(!(!r||!l.action)){for(var o=l.data,s=o.start.row,a=o.end.row,i=l.action=="add",u=s+1;u<a;u++)r[u]&&(r[u].hidden=i);r[a]&&(i?r[s]?r[a].hidden=i:r[s]=r[a]:(r[s]==r[a]&&(r[s]=void 0),r[a].hidden=i))}},m.prototype.updateOnChange=function(l){var f=this.session.lineWidgets;if(f){var r=l.start.row,o=l.end.row-r;if(o!==0)if(l.action=="remove"){var s=f.splice(r+1,o);!f[r]&&s[s.length-1]&&(f[r]=s.pop()),s.forEach(function(i){i&&this.removeLineWidget(i)},this),this.$updateRows()}else{var a=new Array(o);f[r]&&f[r].column!=null&&l.start.column>f[r].column&&r++,a.unshift(r,0),f.splice.apply(f,a),this.$updateRows()}}},m.prototype.$updateRows=function(){var l=this.session.lineWidgets;if(l){var f=!0;l.forEach(function(r,o){if(r)for(f=!1,r.row=o;r.$oldWidget;)r.$oldWidget.row=o,r=r.$oldWidget}),f&&(this.session.lineWidgets=null)}},m.prototype.$registerLineWidget=function(l){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var f=this.session.lineWidgets[l.row];return f&&(l.$oldWidget=f,f.el&&f.el.parentNode&&(f.el.parentNode.removeChild(f.el),f._inDocument=!1)),this.session.lineWidgets[l.row]=l,l},m.prototype.addLineWidget=function(l){if(this.$registerLineWidget(l),l.session=this.session,!this.editor)return l;var f=this.editor.renderer;l.html&&!l.el&&(l.el=d.createElement("div"),l.el.innerHTML=l.html),l.text&&!l.el&&(l.el=d.createElement("div"),l.el.textContent=l.text),l.el&&(d.addCssClass(l.el,"ace_lineWidgetContainer"),l.className&&d.addCssClass(l.el,l.className),l.el.style.position="absolute",l.el.style.zIndex="5",f.container.appendChild(l.el),l._inDocument=!0,l.coverGutter||(l.el.style.zIndex="3"),l.pixelHeight==null&&(l.pixelHeight=l.el.offsetHeight)),l.rowCount==null&&(l.rowCount=l.pixelHeight/f.layerConfig.lineHeight);var r=this.session.getFoldAt(l.row,0);if(l.$fold=r,r){var o=this.session.lineWidgets;l.row==r.end.row&&!o[r.start.row]?o[r.start.row]=l:l.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:l.row}}}),this.$updateRows(),this.renderWidgets(null,f),this.onWidgetChanged(l),l},m.prototype.removeLineWidget=function(l){if(l._inDocument=!1,l.session=null,l.el&&l.el.parentNode&&l.el.parentNode.removeChild(l.el),l.editor&&l.editor.destroy)try{l.editor.destroy()}catch{}if(this.session.lineWidgets){var f=this.session.lineWidgets[l.row];if(f==l)this.session.lineWidgets[l.row]=l.$oldWidget,l.$oldWidget&&this.onWidgetChanged(l.$oldWidget);else for(;f;){if(f.$oldWidget==l){f.$oldWidget=l.$oldWidget;break}f=f.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:l.row}}}),this.$updateRows()},m.prototype.getWidgetsAtRow=function(l){for(var f=this.session.lineWidgets,r=f&&f[l],o=[];r;)o.push(r),r=r.$oldWidget;return o},m.prototype.onWidgetChanged=function(l){this.session._changedWidgets.push(l),this.editor&&this.editor.renderer.updateFull()},m.prototype.measureWidgets=function(l,f){var r=this.session._changedWidgets,o=f.layerConfig;if(!(!r||!r.length)){for(var s=1/0,a=0;a<r.length;a++){var i=r[a];if(!(!i||!i.el)&&i.session==this.session){if(!i._inDocument){if(this.session.lineWidgets[i.row]!=i)continue;i._inDocument=!0,f.container.appendChild(i.el)}i.h=i.el.offsetHeight,i.fixedWidth||(i.w=i.el.offsetWidth,i.screenWidth=Math.ceil(i.w/o.characterWidth));var u=i.h/o.lineHeight;i.coverLine&&(u-=this.session.getRowLineCount(i.row),u<0&&(u=0)),i.rowCount!=u&&(i.rowCount=u,i.row<s&&(s=i.row))}}s!=1/0&&(this.session._emit("changeFold",{data:{start:{row:s}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},m.prototype.renderWidgets=function(l,f){var r=f.layerConfig,o=this.session.lineWidgets;if(o){for(var s=Math.min(this.firstRow,r.firstRow),a=Math.max(this.lastRow,r.lastRow,o.length);s>0&&!o[s];)s--;this.firstRow=r.firstRow,this.lastRow=r.lastRow,f.$cursorLayer.config=r;for(var i=s;i<=a;i++){var u=o[i];if(!(!u||!u.el)){if(u.hidden){u.el.style.top=-100-(u.pixelHeight||0)+"px";continue}u._inDocument||(u._inDocument=!0,f.container.appendChild(u.el));var h=f.$cursorLayer.getPixelPosition({row:i,column:0},!0).top;u.coverLine||(h+=r.lineHeight*this.session.getRowLineCount(u.row)),u.el.style.top=h-r.offset+"px";var y=u.coverGutter?0:f.gutterWidth;u.fixedWidth||(y-=f.scrollLeft),u.el.style.left=y+"px",u.fullWidth&&u.screenWidth&&(u.el.style.minWidth=r.width+2*r.padding+"px"),u.fixedWidth?u.el.style.right=f.scrollBar.getWidth()+"px":u.el.style.right=""}}}},m})();n.LineWidgets=g}),ace.define("ace/apply_delta",["require","exports","module"],function(t,n,p){n.applyDelta=function(d,g,m){var l=g.start.row,f=g.start.column,r=d[l]||"";switch(g.action){case"insert":var o=g.lines;if(o.length===1)d[l]=r.substring(0,f)+g.lines[0]+r.substring(f);else{var s=[l,1].concat(g.lines);d.splice.apply(d,s),d[l]=r.substring(0,f)+d[l],d[l+g.lines.length-1]+=r.substring(f)}break;case"remove":var a=g.end.column,i=g.end.row;l===i?d[l]=r.substring(0,f)+r.substring(a):d.splice(l,i-l+1,r.substring(0,f)+d[i].substring(a));break}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(t,n,p){var d=t("./lib/oop"),g=t("./lib/event_emitter").EventEmitter,m=(function(){function r(o,s,a){this.$onChange=this.onChange.bind(this),this.attach(o),typeof s!="number"?this.setPosition(s.row,s.column):this.setPosition(s,a)}return r.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},r.prototype.getDocument=function(){return this.document},r.prototype.onChange=function(o){if(!(o.start.row==o.end.row&&o.start.row!=this.row)&&!(o.start.row>this.row)){var s=f(o,{row:this.row,column:this.column},this.$insertRight);this.setPosition(s.row,s.column,!0)}},r.prototype.setPosition=function(o,s,a){var i;if(a?i={row:o,column:s}:i=this.$clipPositionToDocument(o,s),!(this.row==i.row&&this.column==i.column)){var u={row:this.row,column:this.column};this.row=i.row,this.column=i.column,this._signal("change",{old:u,value:i})}},r.prototype.detach=function(){this.document.off("change",this.$onChange)},r.prototype.attach=function(o){this.document=o||this.document,this.document.on("change",this.$onChange)},r.prototype.$clipPositionToDocument=function(o,s){var a={};return o>=this.document.getLength()?(a.row=Math.max(0,this.document.getLength()-1),a.column=this.document.getLine(a.row).length):o<0?(a.row=0,a.column=0):(a.row=o,a.column=Math.min(this.document.getLine(a.row).length,Math.max(0,s))),s<0&&(a.column=0),a},r})();m.prototype.$insertRight=!1,d.implement(m.prototype,g);function l(r,o,s){var a=s?r.column<=o.column:r.column<o.column;return r.row<o.row||r.row==o.row&&a}function f(r,o,s){var a=r.action=="insert",i=(a?1:-1)*(r.end.row-r.start.row),u=(a?1:-1)*(r.end.column-r.start.column),h=r.start,y=a?h:r.end;return l(o,h,s)?{row:o.row,column:o.column}:l(y,o,!s)?{row:o.row+i,column:o.column+(o.row==y.row?u:0)}:{row:h.row,column:h.column}}n.Anchor=m}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(t,n,p){var d=t("./lib/oop"),g=t("./apply_delta").applyDelta,m=t("./lib/event_emitter").EventEmitter,l=t("./range").Range,f=t("./anchor").Anchor,r=(function(){function o(s){this.$lines=[""],s.length===0?this.$lines=[""]:Array.isArray(s)?this.insertMergedLines({row:0,column:0},s):this.insert({row:0,column:0},s)}return o.prototype.setValue=function(s){var a=this.getLength()-1;this.remove(new l(0,0,a,this.getLine(a).length)),this.insert({row:0,column:0},s||"")},o.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},o.prototype.createAnchor=function(s,a){return new f(this,s,a)},o.prototype.$detectNewLine=function(s){var a=s.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=a?a[1]:`
1348
+ `)&&$.selection.isEmpty()){var M=$.getCursorPosition();if(M.column===0)return;for(var R=A.doc.getLine(M.row),L=A.doc.getLine(M.row+1),_=A.getTokens(M.row),O=0,w=0;w<_.length;w++){O+=_[w].value.length;var v=_[w];if(O>=M.column){if(O===M.column){if(!/\.doc/.test(v.type))return;if(/\*\//.test(v.value)){var C=_[w+1];if(!C||!/\.doc/.test(C.type))return}}var E=M.column-(O-v.value.length),x=v.value.indexOf("*/"),k=v.value.indexOf("/**",x>-1?x+2:0);if(k!==-1&&E>k&&E<k+3||x!==-1&&k!==-1&&E>=x&&E<=k||!/\.doc/.test(v.type))return;break}}var D=this.$getIndent(R);if(/\s*\*/.test(L))return/^\s*\*/.test(R)?{text:S+D+"* ",selection:[1,2+D.length,1,2+D.length]}:{text:S+D+" * ",selection:[1,3+D.length,1,3+D.length]};if(/\/\*\*/.test(R.substring(0,M.column)))return{text:S+D+" * "+S+" "+D+"*/",selection:[1,4+D.length,1,4+D.length]}}})},h.isSaneInsertion=function(y,b){var T=y.getCursorPosition(),$=new m(b,T.row,T.column);if(!this.$matchTokenType($.getCurrentToken()||"text",f)){if(/[)}\]]/.test(y.session.getLine(T.row)[T.column]))return!0;var A=new m(b,T.row,T.column+1);if(!this.$matchTokenType(A.getCurrentToken()||"text",f))return!1}return $.stepForward(),$.getCurrentTokenRow()!==T.row||this.$matchTokenType($.getCurrentToken()||"text",r)},h.$matchTokenType=function(y,b){return b.indexOf(y.type||y)>-1},h.recordAutoInsert=function(y,b,T){var $=y.getCursorPosition(),A=b.doc.getLine($.row);this.isAutoInsertedClosing($,A,o.autoInsertedLineEnd[0])||(o.autoInsertedBrackets=0),o.autoInsertedRow=$.row,o.autoInsertedLineEnd=T+A.substr($.column),o.autoInsertedBrackets++},h.recordMaybeInsert=function(y,b,T){var $=y.getCursorPosition(),A=b.doc.getLine($.row);this.isMaybeInsertedClosing($,A)||(o.maybeInsertedBrackets=0),o.maybeInsertedRow=$.row,o.maybeInsertedLineStart=A.substr(0,$.column)+T,o.maybeInsertedLineEnd=A.substr($.column),o.maybeInsertedBrackets++},h.isAutoInsertedClosing=function(y,b,T){return o.autoInsertedBrackets>0&&y.row===o.autoInsertedRow&&T===o.autoInsertedLineEnd[0]&&b.substr(y.column)===o.autoInsertedLineEnd},h.isMaybeInsertedClosing=function(y,b){return o.maybeInsertedBrackets>0&&y.row===o.maybeInsertedRow&&b.substr(y.column)===o.maybeInsertedLineEnd&&b.substr(0,y.column)==o.maybeInsertedLineStart},h.popAutoInsertedClosing=function(){o.autoInsertedLineEnd=o.autoInsertedLineEnd.substr(1),o.autoInsertedBrackets--},h.clearMaybeInsertedClosing=function(){o&&(o.maybeInsertedBrackets=0,o.maybeInsertedRow=-1)},d.inherits(h,g),n.CstyleBehaviour=h}),ace.define("ace/unicode",["require","exports","module"],function(t,n,p){for(var d=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],g=0,m=[],c=0;c<d.length;c+=2)m.push(g+=d[c]),d[c+1]&&m.push(45,g+=d[c+1]);n.wordChars=String.fromCharCode.apply(null,m)}),ace.define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(t,n,p){var d=t("../config"),g=t("../tokenizer").Tokenizer,m=t("./text_highlight_rules").TextHighlightRules,c=t("./behaviour/cstyle").CstyleBehaviour,f=t("../unicode"),r=t("../lib/lang"),o=t("../token_iterator").TokenIterator,s=t("../range").Range,a;a=function(){this.HighlightRules=m},(function(){this.$defaultBehaviour=new c,this.tokenRe=new RegExp("^["+f.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+f.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new g(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(i,u,h,y){var b=u.doc,T=!0,$=!0,A=1/0,S=u.getTabSize(),M=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var _=this.lineCommentStart.map(r.escapeRegExp).join("|"),R=this.lineCommentStart[0];else var _=r.escapeRegExp(this.lineCommentStart),R=this.lineCommentStart;_=new RegExp("^(\\s*)(?:"+_+") ?"),M=u.getUseSoftTabs();var v=function(z,F){var W=z.match(_);if(W){var H=W[1].length,B=W[0].length;!x(z,H,B)&&W[0][B-1]==" "&&B--,b.removeInLine(F,H,B)}},E=R+" ",w=function(z,F){(!T||/\S/.test(z))&&(x(z,A,A)?b.insertInLine({row:F,column:A},E):b.insertInLine({row:F,column:A},R))},C=function(z,F){return _.test(z)},x=function(z,F,W){for(var H=0;F--&&z.charAt(F)==" ";)H++;if(H%S!=0)return!1;for(var H=0;z.charAt(W++)==" ";)H++;return S>2?H%S!=S-1:H%S==0}}else{if(!this.blockComment)return!1;var R=this.blockComment.start,L=this.blockComment.end,_=new RegExp("^(\\s*)(?:"+r.escapeRegExp(R)+")"),O=new RegExp("(?:"+r.escapeRegExp(L)+")\\s*$"),w=function(I,N){C(I,N)||(!T||/\S/.test(I))&&(b.insertInLine({row:N,column:I.length},L),b.insertInLine({row:N,column:A},R))},v=function(I,N){var P;(P=I.match(O))&&b.removeInLine(N,I.length-P[0].length,I.length),(P=I.match(_))&&b.removeInLine(N,P[1].length,P[0].length)},C=function(I,N){if(_.test(I))return!0;for(var P=u.getTokens(N),z=0;z<P.length;z++)if(P[z].type==="comment")return!0}}function k(I){for(var N=h;N<=y;N++)I(b.getLine(N),N)}var D=1/0;k(function(I,N){var P=I.search(/\S/);P!==-1?(P<A&&(A=P),$&&!C(I,N)&&($=!1)):D>I.length&&(D=I.length)}),A==1/0&&(A=D,T=!1,$=!1),M&&A%S!=0&&(A=Math.floor(A/S)*S),k($?v:w)},this.toggleBlockComment=function(i,u,h,y){var b=this.blockComment;if(b){!b.start&&b[0]&&(b=b[0]);var T=new o(u,y.row,y.column),$=T.getCurrentToken();u.selection;var A=u.selection.toOrientedRange(),S,M;if($&&/comment/.test($.type)){for(var R,L;$&&/comment/.test($.type);){var _=$.value.indexOf(b.start);if(_!=-1){var O=T.getCurrentTokenRow(),w=T.getCurrentTokenColumn()+_;R=new s(O,w,O,w+b.start.length);break}$=T.stepBackward()}for(var T=new o(u,y.row,y.column),$=T.getCurrentToken();$&&/comment/.test($.type);){var _=$.value.indexOf(b.end);if(_!=-1){var O=T.getCurrentTokenRow(),w=T.getCurrentTokenColumn()+_;L=new s(O,w,O,w+b.end.length);break}$=T.stepForward()}L&&u.remove(L),R&&(u.remove(R),S=R.start.row,M=-b.start.length)}else M=b.start.length,S=h.start.row,u.insert(h.end,b.end),u.insert(h.start,b.start);A.start.row==S&&(A.start.column+=M),A.end.row==S&&(A.end.column+=M),u.selection.fromOrientedRange(A)}},this.getNextLineIndent=function(i,u,h){return this.$getIndent(u)},this.checkOutdent=function(i,u,h){return!1},this.autoOutdent=function(i,u,h){},this.$getIndent=function(i){return i.match(/^\s*/)[0]},this.createWorker=function(i){return null},this.createModeDelegates=function(i){this.$embeds=[],this.$modes={};for(var u in i)if(i[u]){var h=i[u],y=h.prototype.$id,b=d.$modes[y];b||(d.$modes[y]=b=new h),d.$modes[u]||(d.$modes[u]=b),this.$embeds.push(u),this.$modes[u]=b}for(var T=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],$=function(S){(function(M){var R=T[S],L=M[R];M[T[S]]=function(){return this.$delegator(R,arguments,L)}})(A)},A=this,u=0;u<T.length;u++)$(u)},this.$delegator=function(i,u,h){var y=u[0]||"start";if(typeof y!="string"){if(Array.isArray(y[2])){var b=y[2][y[2].length-1],T=this.$modes[b];if(T)return T[i].apply(T,[y[1]].concat([].slice.call(u,1)))}y=y[0]||"start"}for(var $=0;$<this.$embeds.length;$++)if(this.$modes[this.$embeds[$]]){var A=y.split(this.$embeds[$]);if(!A[0]&&A[1]){u[0]=A[1];var T=this.$modes[this.$embeds[$]];return T[i].apply(T,u)}}var S=h.apply(this,u);return h?S:void 0},this.transformAction=function(i,u,h,y,b){if(this.$behaviour){var T=this.$behaviour.getBehaviours();for(var $ in T)if(T[$][u]){var A=T[$][u].apply(this,arguments);if(A)return A}}},this.getKeywords=function(i){if(!this.completionKeywords){var u=this.$tokenizer.rules,h=[];for(var y in u)for(var b=u[y],T=0,$=b.length;T<$;T++)if(typeof b[T].token=="string")/keyword|support|storage/.test(b[T].token)&&h.push(b[T].regex);else if(typeof b[T].token=="object"){for(var A=0,S=b[T].token.length;A<S;A++)if(/keyword|support|storage/.test(b[T].token[A])){var y=b[T].regex.match(/\(.+?\)/g)[A];h.push(y.substr(1,y.length-2))}}this.completionKeywords=h}return i?h.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(i,u,h,y){var b=this.$keywordList||this.$createKeywordList();return b.map(function(T){return{name:T,value:T,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}).call(a.prototype),n.Mode=a}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(t,n,p){var d=t("./lib/dom"),g=(function(){function m(c){this.session=c,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}return m.prototype.getRowLength=function(c){var f;return this.lineWidgets?f=this.lineWidgets[c]&&this.lineWidgets[c].rowCount||0:f=0,!this.$useWrapMode||!this.$wrapData[c]?1+f:this.$wrapData[c].length+1+f},m.prototype.$getWidgetScreenLength=function(){var c=0;return this.lineWidgets.forEach(function(f){f&&f.rowCount&&!f.hidden&&(c+=f.rowCount)}),c},m.prototype.$onChangeEditor=function(c){this.attach(c.editor)},m.prototype.attach=function(c){c&&c.widgetManager&&c.widgetManager!=this&&c.widgetManager.detach(),this.editor!=c&&(this.detach(),this.editor=c,c&&(c.widgetManager=this,c.renderer.on("beforeRender",this.measureWidgets),c.renderer.on("afterRender",this.renderWidgets)))},m.prototype.detach=function(c){var f=this.editor;if(f){this.editor=null,f.widgetManager=null,f.renderer.off("beforeRender",this.measureWidgets),f.renderer.off("afterRender",this.renderWidgets);var r=this.session.lineWidgets;r&&r.forEach(function(o){o&&o.el&&o.el.parentNode&&(o._inDocument=!1,o.el.parentNode.removeChild(o.el))})}},m.prototype.updateOnFold=function(c,f){var r=f.lineWidgets;if(!(!r||!c.action)){for(var o=c.data,s=o.start.row,a=o.end.row,i=c.action=="add",u=s+1;u<a;u++)r[u]&&(r[u].hidden=i);r[a]&&(i?r[s]?r[a].hidden=i:r[s]=r[a]:(r[s]==r[a]&&(r[s]=void 0),r[a].hidden=i))}},m.prototype.updateOnChange=function(c){var f=this.session.lineWidgets;if(f){var r=c.start.row,o=c.end.row-r;if(o!==0)if(c.action=="remove"){var s=f.splice(r+1,o);!f[r]&&s[s.length-1]&&(f[r]=s.pop()),s.forEach(function(i){i&&this.removeLineWidget(i)},this),this.$updateRows()}else{var a=new Array(o);f[r]&&f[r].column!=null&&c.start.column>f[r].column&&r++,a.unshift(r,0),f.splice.apply(f,a),this.$updateRows()}}},m.prototype.$updateRows=function(){var c=this.session.lineWidgets;if(c){var f=!0;c.forEach(function(r,o){if(r)for(f=!1,r.row=o;r.$oldWidget;)r.$oldWidget.row=o,r=r.$oldWidget}),f&&(this.session.lineWidgets=null)}},m.prototype.$registerLineWidget=function(c){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var f=this.session.lineWidgets[c.row];return f&&(c.$oldWidget=f,f.el&&f.el.parentNode&&(f.el.parentNode.removeChild(f.el),f._inDocument=!1)),this.session.lineWidgets[c.row]=c,c},m.prototype.addLineWidget=function(c){if(this.$registerLineWidget(c),c.session=this.session,!this.editor)return c;var f=this.editor.renderer;c.html&&!c.el&&(c.el=d.createElement("div"),c.el.innerHTML=c.html),c.text&&!c.el&&(c.el=d.createElement("div"),c.el.textContent=c.text),c.el&&(d.addCssClass(c.el,"ace_lineWidgetContainer"),c.className&&d.addCssClass(c.el,c.className),c.el.style.position="absolute",c.el.style.zIndex="5",f.container.appendChild(c.el),c._inDocument=!0,c.coverGutter||(c.el.style.zIndex="3"),c.pixelHeight==null&&(c.pixelHeight=c.el.offsetHeight)),c.rowCount==null&&(c.rowCount=c.pixelHeight/f.layerConfig.lineHeight);var r=this.session.getFoldAt(c.row,0);if(c.$fold=r,r){var o=this.session.lineWidgets;c.row==r.end.row&&!o[r.start.row]?o[r.start.row]=c:c.hidden=!0}return this.session._emit("changeFold",{data:{start:{row:c.row}}}),this.$updateRows(),this.renderWidgets(null,f),this.onWidgetChanged(c),c},m.prototype.removeLineWidget=function(c){if(c._inDocument=!1,c.session=null,c.el&&c.el.parentNode&&c.el.parentNode.removeChild(c.el),c.editor&&c.editor.destroy)try{c.editor.destroy()}catch{}if(this.session.lineWidgets){var f=this.session.lineWidgets[c.row];if(f==c)this.session.lineWidgets[c.row]=c.$oldWidget,c.$oldWidget&&this.onWidgetChanged(c.$oldWidget);else for(;f;){if(f.$oldWidget==c){f.$oldWidget=c.$oldWidget;break}f=f.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:c.row}}}),this.$updateRows()},m.prototype.getWidgetsAtRow=function(c){for(var f=this.session.lineWidgets,r=f&&f[c],o=[];r;)o.push(r),r=r.$oldWidget;return o},m.prototype.onWidgetChanged=function(c){this.session._changedWidgets.push(c),this.editor&&this.editor.renderer.updateFull()},m.prototype.measureWidgets=function(c,f){var r=this.session._changedWidgets,o=f.layerConfig;if(!(!r||!r.length)){for(var s=1/0,a=0;a<r.length;a++){var i=r[a];if(!(!i||!i.el)&&i.session==this.session){if(!i._inDocument){if(this.session.lineWidgets[i.row]!=i)continue;i._inDocument=!0,f.container.appendChild(i.el)}i.h=i.el.offsetHeight,i.fixedWidth||(i.w=i.el.offsetWidth,i.screenWidth=Math.ceil(i.w/o.characterWidth));var u=i.h/o.lineHeight;i.coverLine&&(u-=this.session.getRowLineCount(i.row),u<0&&(u=0)),i.rowCount!=u&&(i.rowCount=u,i.row<s&&(s=i.row))}}s!=1/0&&(this.session._emit("changeFold",{data:{start:{row:s}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},m.prototype.renderWidgets=function(c,f){var r=f.layerConfig,o=this.session.lineWidgets;if(o){for(var s=Math.min(this.firstRow,r.firstRow),a=Math.max(this.lastRow,r.lastRow,o.length);s>0&&!o[s];)s--;this.firstRow=r.firstRow,this.lastRow=r.lastRow,f.$cursorLayer.config=r;for(var i=s;i<=a;i++){var u=o[i];if(!(!u||!u.el)){if(u.hidden){u.el.style.top=-100-(u.pixelHeight||0)+"px";continue}u._inDocument||(u._inDocument=!0,f.container.appendChild(u.el));var h=f.$cursorLayer.getPixelPosition({row:i,column:0},!0).top;u.coverLine||(h+=r.lineHeight*this.session.getRowLineCount(u.row)),u.el.style.top=h-r.offset+"px";var y=u.coverGutter?0:f.gutterWidth;u.fixedWidth||(y-=f.scrollLeft),u.el.style.left=y+"px",u.fullWidth&&u.screenWidth&&(u.el.style.minWidth=r.width+2*r.padding+"px"),u.fixedWidth?u.el.style.right=f.scrollBar.getWidth()+"px":u.el.style.right=""}}}},m})();n.LineWidgets=g}),ace.define("ace/apply_delta",["require","exports","module"],function(t,n,p){n.applyDelta=function(d,g,m){var c=g.start.row,f=g.start.column,r=d[c]||"";switch(g.action){case"insert":var o=g.lines;if(o.length===1)d[c]=r.substring(0,f)+g.lines[0]+r.substring(f);else{var s=[c,1].concat(g.lines);d.splice.apply(d,s),d[c]=r.substring(0,f)+d[c],d[c+g.lines.length-1]+=r.substring(f)}break;case"remove":var a=g.end.column,i=g.end.row;c===i?d[c]=r.substring(0,f)+r.substring(a):d.splice(c,i-c+1,r.substring(0,f)+d[i].substring(a));break}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(t,n,p){var d=t("./lib/oop"),g=t("./lib/event_emitter").EventEmitter,m=(function(){function r(o,s,a){this.$onChange=this.onChange.bind(this),this.attach(o),typeof s!="number"?this.setPosition(s.row,s.column):this.setPosition(s,a)}return r.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},r.prototype.getDocument=function(){return this.document},r.prototype.onChange=function(o){if(!(o.start.row==o.end.row&&o.start.row!=this.row)&&!(o.start.row>this.row)){var s=f(o,{row:this.row,column:this.column},this.$insertRight);this.setPosition(s.row,s.column,!0)}},r.prototype.setPosition=function(o,s,a){var i;if(a?i={row:o,column:s}:i=this.$clipPositionToDocument(o,s),!(this.row==i.row&&this.column==i.column)){var u={row:this.row,column:this.column};this.row=i.row,this.column=i.column,this._signal("change",{old:u,value:i})}},r.prototype.detach=function(){this.document.off("change",this.$onChange)},r.prototype.attach=function(o){this.document=o||this.document,this.document.on("change",this.$onChange)},r.prototype.$clipPositionToDocument=function(o,s){var a={};return o>=this.document.getLength()?(a.row=Math.max(0,this.document.getLength()-1),a.column=this.document.getLine(a.row).length):o<0?(a.row=0,a.column=0):(a.row=o,a.column=Math.min(this.document.getLine(a.row).length,Math.max(0,s))),s<0&&(a.column=0),a},r})();m.prototype.$insertRight=!1,d.implement(m.prototype,g);function c(r,o,s){var a=s?r.column<=o.column:r.column<o.column;return r.row<o.row||r.row==o.row&&a}function f(r,o,s){var a=r.action=="insert",i=(a?1:-1)*(r.end.row-r.start.row),u=(a?1:-1)*(r.end.column-r.start.column),h=r.start,y=a?h:r.end;return c(o,h,s)?{row:o.row,column:o.column}:c(y,o,!s)?{row:o.row+i,column:o.column+(o.row==y.row?u:0)}:{row:h.row,column:h.column}}n.Anchor=m}),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],function(t,n,p){var d=t("./lib/oop"),g=t("./apply_delta").applyDelta,m=t("./lib/event_emitter").EventEmitter,c=t("./range").Range,f=t("./anchor").Anchor,r=(function(){function o(s){this.$lines=[""],s.length===0?this.$lines=[""]:Array.isArray(s)?this.insertMergedLines({row:0,column:0},s):this.insert({row:0,column:0},s)}return o.prototype.setValue=function(s){var a=this.getLength()-1;this.remove(new c(0,0,a,this.getLine(a).length)),this.insert({row:0,column:0},s||"")},o.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},o.prototype.createAnchor=function(s,a){return new f(this,s,a)},o.prototype.$detectNewLine=function(s){var a=s.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=a?a[1]:`
1349
1349
  `,this._signal("changeNewLineMode")},o.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return`\r
1350
1350
  `;case"unix":return`
1351
1351
  `;default:return this.$autoNewLine||`
1352
1352
  `}},o.prototype.setNewLineMode=function(s){this.$newLineMode!==s&&(this.$newLineMode=s,this._signal("changeNewLineMode"))},o.prototype.getNewLineMode=function(){return this.$newLineMode},o.prototype.isNewLine=function(s){return s==`\r
1353
1353
  `||s=="\r"||s==`
1354
- `},o.prototype.getLine=function(s){return this.$lines[s]||""},o.prototype.getLines=function(s,a){return this.$lines.slice(s,a+1)},o.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},o.prototype.getLength=function(){return this.$lines.length},o.prototype.getTextRange=function(s){return this.getLinesForRange(s).join(this.getNewLineCharacter())},o.prototype.getLinesForRange=function(s){var a;if(s.start.row===s.end.row)a=[this.getLine(s.start.row).substring(s.start.column,s.end.column)];else{a=this.getLines(s.start.row,s.end.row),a[0]=(a[0]||"").substring(s.start.column);var i=a.length-1;s.end.row-s.start.row==i&&(a[i]=a[i].substring(0,s.end.column))}return a},o.prototype.insertLines=function(s,a){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(s,a)},o.prototype.removeLines=function(s,a){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(s,a)},o.prototype.insertNewLine=function(s){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(s,["",""])},o.prototype.insert=function(s,a){return this.getLength()<=1&&this.$detectNewLine(a),this.insertMergedLines(s,this.$split(a))},o.prototype.insertInLine=function(s,a){var i=this.clippedPos(s.row,s.column),u=this.pos(s.row,s.column+a.length);return this.applyDelta({start:i,end:u,action:"insert",lines:[a]},!0),this.clonePos(u)},o.prototype.clippedPos=function(s,a){var i=this.getLength();s===void 0?s=i:s<0?s=0:s>=i&&(s=i-1,a=void 0);var u=this.getLine(s);return a==null&&(a=u.length),a=Math.min(Math.max(a,0),u.length),{row:s,column:a}},o.prototype.clonePos=function(s){return{row:s.row,column:s.column}},o.prototype.pos=function(s,a){return{row:s,column:a}},o.prototype.$clipPosition=function(s){var a=this.getLength();return s.row>=a?(s.row=Math.max(0,a-1),s.column=this.getLine(a-1).length):(s.row=Math.max(0,s.row),s.column=Math.min(Math.max(s.column,0),this.getLine(s.row).length)),s},o.prototype.insertFullLines=function(s,a){s=Math.min(Math.max(s,0),this.getLength());var i=0;s<this.getLength()?(a=a.concat([""]),i=0):(a=[""].concat(a),s--,i=this.$lines[s].length),this.insertMergedLines({row:s,column:i},a)},o.prototype.insertMergedLines=function(s,a){var i=this.clippedPos(s.row,s.column),u={row:i.row+a.length-1,column:(a.length==1?i.column:0)+a[a.length-1].length};return this.applyDelta({start:i,end:u,action:"insert",lines:a}),this.clonePos(u)},o.prototype.remove=function(s){var a=this.clippedPos(s.start.row,s.start.column),i=this.clippedPos(s.end.row,s.end.column);return this.applyDelta({start:a,end:i,action:"remove",lines:this.getLinesForRange({start:a,end:i})}),this.clonePos(a)},o.prototype.removeInLine=function(s,a,i){var u=this.clippedPos(s,a),h=this.clippedPos(s,i);return this.applyDelta({start:u,end:h,action:"remove",lines:this.getLinesForRange({start:u,end:h})},!0),this.clonePos(u)},o.prototype.removeFullLines=function(s,a){s=Math.min(Math.max(0,s),this.getLength()-1),a=Math.min(Math.max(0,a),this.getLength()-1);var i=a==this.getLength()-1&&s>0,u=a<this.getLength()-1,h=i?s-1:s,y=i?this.getLine(h).length:0,b=u?a+1:a,T=u?0:this.getLine(b).length,$=new l(h,y,b,T),A=this.$lines.slice(s,a+1);return this.applyDelta({start:$.start,end:$.end,action:"remove",lines:this.getLinesForRange($)}),A},o.prototype.removeNewLine=function(s){s<this.getLength()-1&&s>=0&&this.applyDelta({start:this.pos(s,this.getLine(s).length),end:this.pos(s+1,0),action:"remove",lines:["",""]})},o.prototype.replace=function(s,a){if(s instanceof l||(s=l.fromPoints(s.start,s.end)),a.length===0&&s.isEmpty())return s.start;if(a==this.getTextRange(s))return s.end;this.remove(s);var i;return a?i=this.insert(s.start,a):i=s.start,i},o.prototype.applyDeltas=function(s){for(var a=0;a<s.length;a++)this.applyDelta(s[a])},o.prototype.revertDeltas=function(s){for(var a=s.length-1;a>=0;a--)this.revertDelta(s[a])},o.prototype.applyDelta=function(s,a){var i=s.action=="insert";(i?s.lines.length<=1&&!s.lines[0]:!l.comparePoints(s.start,s.end))||(i&&s.lines.length>2e4?this.$splitAndapplyLargeDelta(s,2e4):(g(this.$lines,s,a),this._signal("change",s)))},o.prototype.$safeApplyDelta=function(s){var a=this.$lines.length;(s.action=="remove"&&s.start.row<a&&s.end.row<a||s.action=="insert"&&s.start.row<=a)&&this.applyDelta(s)},o.prototype.$splitAndapplyLargeDelta=function(s,a){for(var i=s.lines,u=i.length-a+1,h=s.start.row,y=s.start.column,b=0,T=0;b<u;b=T){T+=a-1;var $=i.slice(b,T);$.push(""),this.applyDelta({start:this.pos(h+b,y),end:this.pos(h+T,y=0),action:s.action,lines:$},!0)}s.lines=i.slice(b),s.start.row=h+b,s.start.column=y,this.applyDelta(s,!0)},o.prototype.revertDelta=function(s){this.$safeApplyDelta({start:this.clonePos(s.start),end:this.clonePos(s.end),action:s.action=="insert"?"remove":"insert",lines:s.lines.slice()})},o.prototype.indexToPosition=function(s,a){for(var i=this.$lines||this.getAllLines(),u=this.getNewLineCharacter().length,h=a||0,y=i.length;h<y;h++)if(s-=i[h].length+u,s<0)return{row:h,column:s+i[h].length+u};return{row:y-1,column:s+i[y-1].length+u}},o.prototype.positionToIndex=function(s,a){for(var i=this.$lines||this.getAllLines(),u=this.getNewLineCharacter().length,h=0,y=Math.min(s.row,i.length),b=a||0;b<y;++b)h+=i[b].length+u;return h+s.column},o.prototype.$split=function(s){return s.split(/\r\n|\r|\n/)},o})();r.prototype.$autoNewLine="",r.prototype.$newLineMode="auto",d.implement(r.prototype,m),n.Document=r}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(t,n,p){var d=t("./lib/oop"),g=t("./lib/event_emitter").EventEmitter,m=(function(){function l(f,r){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=f;var o=this;this.$worker=function(){if(o.running){for(var s=new Date,a=o.currentLine,i=-1,u=o.doc,h=a;o.lines[a];)a++;var y=u.getLength(),b=0;for(o.running=!1;a<y;){o.$tokenizeRow(a),i=a;do a++;while(o.lines[a]);if(b++,b%5===0&&new Date-s>20){o.running=setTimeout(o.$worker,20);break}}o.currentLine=a,i==-1&&(i=a),h<=i&&o.fireUpdateEvent(h,i)}}}return l.prototype.setTokenizer=function(f){this.tokenizer=f,this.lines=[],this.states=[],this.start(0)},l.prototype.setDocument=function(f){this.doc=f,this.lines=[],this.states=[],this.stop()},l.prototype.fireUpdateEvent=function(f,r){var o={first:f,last:r};this._signal("update",{data:o})},l.prototype.start=function(f){this.currentLine=Math.min(f||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},l.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},l.prototype.$updateOnChange=function(f){var r=f.start.row,o=f.end.row-r;if(o===0)this.lines[r]=null;else if(f.action=="remove")this.lines.splice(r,o+1,null),this.states.splice(r,o+1,null);else{var s=Array(o+1);s.unshift(r,1),this.lines.splice.apply(this.lines,s),this.states.splice.apply(this.states,s)}this.currentLine=Math.min(r,this.currentLine,this.doc.getLength()),this.stop()},l.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},l.prototype.getTokens=function(f){return this.lines[f]||this.$tokenizeRow(f)},l.prototype.getState=function(f){return this.currentLine==f&&this.$tokenizeRow(f),this.states[f]||"start"},l.prototype.$tokenizeRow=function(f){var r=this.doc.getLine(f),o=this.states[f-1],s=this.tokenizer.getLineTokens(r,o,f);return this.states[f]+""!=s.state+""?(this.states[f]=s.state,this.lines[f+1]=null,this.currentLine>f+1&&(this.currentLine=f+1)):this.currentLine==f&&(this.currentLine=f+1),this.lines[f]=s.tokens},l.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},l})();d.implement(m.prototype,g),n.BackgroundTokenizer=m}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(t,n,p){var d=t("./lib/lang"),g=t("./range").Range,m=(function(){function l(f,r,o){o===void 0&&(o="text"),this.setRegexp(f),this.clazz=r,this.type=o}return l.prototype.setRegexp=function(f){this.regExp+""!=f+""&&(this.regExp=f,this.cache=[])},l.prototype.update=function(f,r,o,s){if(this.regExp)for(var a=s.firstRow,i=s.lastRow,u={},h=a;h<=i;h++){var y=this.cache[h];y==null&&(y=d.getMatchOffsets(o.getLine(h),this.regExp),y.length>this.MAX_RANGES&&(y=y.slice(0,this.MAX_RANGES)),y=y.map(function(A){return new g(h,A.offset,h,A.offset+A.length)}),this.cache[h]=y.length?y:"");for(var b=y.length;b--;){var T=y[b].toScreenRange(o),$=T.toString();u[$]||(u[$]=!0,r.drawSingleLineMarker(f,T,this.clazz,s))}}},l})();m.prototype.MAX_RANGES=500,n.SearchHighlight=m}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(t,n,p){var d=(function(){function A(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return A.prototype.addSession=function(S){this.$session=S},A.prototype.add=function(S,M,R){if(!this.$fromUndo&&S!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),M===!1||!this.lastDeltas){this.lastDeltas=[];var L=this.$undoStack.length;L>this.$undoDepth-1&&this.$undoStack.splice(0,L-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),S.id=this.$rev=++this.$maxRev}(S.action=="remove"||S.action=="insert")&&(this.$lastDelta=S),this.lastDeltas.push(S)}},A.prototype.addSelection=function(S,M){this.selections.push({value:S,rev:M||this.$rev})},A.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},A.prototype.markIgnored=function(S,M){M==null&&(M=this.$rev+1);for(var R=this.$undoStack,L=R.length;L--;){var _=R[L][0];if(_.id<=S)break;_.id<M&&(_.ignore=!0)}this.lastDeltas=null},A.prototype.getSelection=function(S,M){for(var R=this.selections,L=R.length;L--;){var _=R[L];if(_.rev<S)return M&&(_=R[L+1]),_}},A.prototype.getRevision=function(){return this.$rev},A.prototype.getDeltas=function(S,M){M==null&&(M=this.$rev+1);for(var R=this.$undoStack,L=null,_=0,I=R.length;I--;){var w=R[I][0];if(w.id<M&&!L&&(L=I+1),w.id<=S){_=I+1;break}}return R.slice(_,L)},A.prototype.getChangedRanges=function(S,M){M==null&&(M=this.$rev+1)},A.prototype.getChangedLines=function(S,M){M==null&&(M=this.$rev+1)},A.prototype.undo=function(S,M){this.lastDeltas=null;var R=this.$undoStack;if(g(R,R.length)){S||(S=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var L=R.pop(),_=null;return L&&(_=S.undoChanges(L,M),this.$redoStack.push(L),this.$syncRev()),this.$fromUndo=!1,_}},A.prototype.redo=function(S,M){if(this.lastDeltas=null,S||(S=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var R=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);$(this.$redoStack,R),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(I){I[0].id=++this.$maxRev},this)}var L=this.$redoStack.pop(),_=null;return L&&(_=S.redoChanges(L,M),this.$undoStack.push(L),this.$syncRev()),this.$fromUndo=!1,_},A.prototype.$syncRev=function(){var S=this.$undoStack,M=S[S.length-1],R=M&&M[0].id||0;this.$redoStackBaseRev=R,this.$rev=R},A.prototype.reset=function(){this.lastDeltas=null,this.$lastDelta=null,this.$undoStack=[],this.$redoStack=[],this.$rev=0,this.mark=0,this.$redoStackBaseRev=this.$rev,this.selections=[]},A.prototype.canUndo=function(){return this.$undoStack.length>0},A.prototype.canRedo=function(){return this.$redoStack.length>0},A.prototype.bookmark=function(S){S==null&&(S=this.$rev),this.mark=S},A.prototype.isAtBookmark=function(){return this.$rev===this.mark},A.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},A.prototype.fromJSON=function(S){this.reset(),this.$undoStack=S.$undoStack,this.$redoStack=S.$redoStack},A.prototype.$prettyPrint=function(S){return S?o(S):o(this.$undoStack)+`
1354
+ `},o.prototype.getLine=function(s){return this.$lines[s]||""},o.prototype.getLines=function(s,a){return this.$lines.slice(s,a+1)},o.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},o.prototype.getLength=function(){return this.$lines.length},o.prototype.getTextRange=function(s){return this.getLinesForRange(s).join(this.getNewLineCharacter())},o.prototype.getLinesForRange=function(s){var a;if(s.start.row===s.end.row)a=[this.getLine(s.start.row).substring(s.start.column,s.end.column)];else{a=this.getLines(s.start.row,s.end.row),a[0]=(a[0]||"").substring(s.start.column);var i=a.length-1;s.end.row-s.start.row==i&&(a[i]=a[i].substring(0,s.end.column))}return a},o.prototype.insertLines=function(s,a){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(s,a)},o.prototype.removeLines=function(s,a){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(s,a)},o.prototype.insertNewLine=function(s){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(s,["",""])},o.prototype.insert=function(s,a){return this.getLength()<=1&&this.$detectNewLine(a),this.insertMergedLines(s,this.$split(a))},o.prototype.insertInLine=function(s,a){var i=this.clippedPos(s.row,s.column),u=this.pos(s.row,s.column+a.length);return this.applyDelta({start:i,end:u,action:"insert",lines:[a]},!0),this.clonePos(u)},o.prototype.clippedPos=function(s,a){var i=this.getLength();s===void 0?s=i:s<0?s=0:s>=i&&(s=i-1,a=void 0);var u=this.getLine(s);return a==null&&(a=u.length),a=Math.min(Math.max(a,0),u.length),{row:s,column:a}},o.prototype.clonePos=function(s){return{row:s.row,column:s.column}},o.prototype.pos=function(s,a){return{row:s,column:a}},o.prototype.$clipPosition=function(s){var a=this.getLength();return s.row>=a?(s.row=Math.max(0,a-1),s.column=this.getLine(a-1).length):(s.row=Math.max(0,s.row),s.column=Math.min(Math.max(s.column,0),this.getLine(s.row).length)),s},o.prototype.insertFullLines=function(s,a){s=Math.min(Math.max(s,0),this.getLength());var i=0;s<this.getLength()?(a=a.concat([""]),i=0):(a=[""].concat(a),s--,i=this.$lines[s].length),this.insertMergedLines({row:s,column:i},a)},o.prototype.insertMergedLines=function(s,a){var i=this.clippedPos(s.row,s.column),u={row:i.row+a.length-1,column:(a.length==1?i.column:0)+a[a.length-1].length};return this.applyDelta({start:i,end:u,action:"insert",lines:a}),this.clonePos(u)},o.prototype.remove=function(s){var a=this.clippedPos(s.start.row,s.start.column),i=this.clippedPos(s.end.row,s.end.column);return this.applyDelta({start:a,end:i,action:"remove",lines:this.getLinesForRange({start:a,end:i})}),this.clonePos(a)},o.prototype.removeInLine=function(s,a,i){var u=this.clippedPos(s,a),h=this.clippedPos(s,i);return this.applyDelta({start:u,end:h,action:"remove",lines:this.getLinesForRange({start:u,end:h})},!0),this.clonePos(u)},o.prototype.removeFullLines=function(s,a){s=Math.min(Math.max(0,s),this.getLength()-1),a=Math.min(Math.max(0,a),this.getLength()-1);var i=a==this.getLength()-1&&s>0,u=a<this.getLength()-1,h=i?s-1:s,y=i?this.getLine(h).length:0,b=u?a+1:a,T=u?0:this.getLine(b).length,$=new c(h,y,b,T),A=this.$lines.slice(s,a+1);return this.applyDelta({start:$.start,end:$.end,action:"remove",lines:this.getLinesForRange($)}),A},o.prototype.removeNewLine=function(s){s<this.getLength()-1&&s>=0&&this.applyDelta({start:this.pos(s,this.getLine(s).length),end:this.pos(s+1,0),action:"remove",lines:["",""]})},o.prototype.replace=function(s,a){if(s instanceof c||(s=c.fromPoints(s.start,s.end)),a.length===0&&s.isEmpty())return s.start;if(a==this.getTextRange(s))return s.end;this.remove(s);var i;return a?i=this.insert(s.start,a):i=s.start,i},o.prototype.applyDeltas=function(s){for(var a=0;a<s.length;a++)this.applyDelta(s[a])},o.prototype.revertDeltas=function(s){for(var a=s.length-1;a>=0;a--)this.revertDelta(s[a])},o.prototype.applyDelta=function(s,a){var i=s.action=="insert";(i?s.lines.length<=1&&!s.lines[0]:!c.comparePoints(s.start,s.end))||(i&&s.lines.length>2e4?this.$splitAndapplyLargeDelta(s,2e4):(g(this.$lines,s,a),this._signal("change",s)))},o.prototype.$safeApplyDelta=function(s){var a=this.$lines.length;(s.action=="remove"&&s.start.row<a&&s.end.row<a||s.action=="insert"&&s.start.row<=a)&&this.applyDelta(s)},o.prototype.$splitAndapplyLargeDelta=function(s,a){for(var i=s.lines,u=i.length-a+1,h=s.start.row,y=s.start.column,b=0,T=0;b<u;b=T){T+=a-1;var $=i.slice(b,T);$.push(""),this.applyDelta({start:this.pos(h+b,y),end:this.pos(h+T,y=0),action:s.action,lines:$},!0)}s.lines=i.slice(b),s.start.row=h+b,s.start.column=y,this.applyDelta(s,!0)},o.prototype.revertDelta=function(s){this.$safeApplyDelta({start:this.clonePos(s.start),end:this.clonePos(s.end),action:s.action=="insert"?"remove":"insert",lines:s.lines.slice()})},o.prototype.indexToPosition=function(s,a){for(var i=this.$lines||this.getAllLines(),u=this.getNewLineCharacter().length,h=a||0,y=i.length;h<y;h++)if(s-=i[h].length+u,s<0)return{row:h,column:s+i[h].length+u};return{row:y-1,column:s+i[y-1].length+u}},o.prototype.positionToIndex=function(s,a){for(var i=this.$lines||this.getAllLines(),u=this.getNewLineCharacter().length,h=0,y=Math.min(s.row,i.length),b=a||0;b<y;++b)h+=i[b].length+u;return h+s.column},o.prototype.$split=function(s){return s.split(/\r\n|\r|\n/)},o})();r.prototype.$autoNewLine="",r.prototype.$newLineMode="auto",d.implement(r.prototype,m),n.Document=r}),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(t,n,p){var d=t("./lib/oop"),g=t("./lib/event_emitter").EventEmitter,m=(function(){function c(f,r){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=f;var o=this;this.$worker=function(){if(o.running){for(var s=new Date,a=o.currentLine,i=-1,u=o.doc,h=a;o.lines[a];)a++;var y=u.getLength(),b=0;for(o.running=!1;a<y;){o.$tokenizeRow(a),i=a;do a++;while(o.lines[a]);if(b++,b%5===0&&new Date-s>20){o.running=setTimeout(o.$worker,20);break}}o.currentLine=a,i==-1&&(i=a),h<=i&&o.fireUpdateEvent(h,i)}}}return c.prototype.setTokenizer=function(f){this.tokenizer=f,this.lines=[],this.states=[],this.start(0)},c.prototype.setDocument=function(f){this.doc=f,this.lines=[],this.states=[],this.stop()},c.prototype.fireUpdateEvent=function(f,r){var o={first:f,last:r};this._signal("update",{data:o})},c.prototype.start=function(f){this.currentLine=Math.min(f||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},c.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},c.prototype.$updateOnChange=function(f){var r=f.start.row,o=f.end.row-r;if(o===0)this.lines[r]=null;else if(f.action=="remove")this.lines.splice(r,o+1,null),this.states.splice(r,o+1,null);else{var s=Array(o+1);s.unshift(r,1),this.lines.splice.apply(this.lines,s),this.states.splice.apply(this.states,s)}this.currentLine=Math.min(r,this.currentLine,this.doc.getLength()),this.stop()},c.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},c.prototype.getTokens=function(f){return this.lines[f]||this.$tokenizeRow(f)},c.prototype.getState=function(f){return this.currentLine==f&&this.$tokenizeRow(f),this.states[f]||"start"},c.prototype.$tokenizeRow=function(f){var r=this.doc.getLine(f),o=this.states[f-1],s=this.tokenizer.getLineTokens(r,o,f);return this.states[f]+""!=s.state+""?(this.states[f]=s.state,this.lines[f+1]=null,this.currentLine>f+1&&(this.currentLine=f+1)):this.currentLine==f&&(this.currentLine=f+1),this.lines[f]=s.tokens},c.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},c})();d.implement(m.prototype,g),n.BackgroundTokenizer=m}),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],function(t,n,p){var d=t("./lib/lang"),g=t("./range").Range,m=(function(){function c(f,r,o){o===void 0&&(o="text"),this.setRegexp(f),this.clazz=r,this.type=o}return c.prototype.setRegexp=function(f){this.regExp+""!=f+""&&(this.regExp=f,this.cache=[])},c.prototype.update=function(f,r,o,s){if(this.regExp)for(var a=s.firstRow,i=s.lastRow,u={},h=a;h<=i;h++){var y=this.cache[h];y==null&&(y=d.getMatchOffsets(o.getLine(h),this.regExp),y.length>this.MAX_RANGES&&(y=y.slice(0,this.MAX_RANGES)),y=y.map(function(A){return new g(h,A.offset,h,A.offset+A.length)}),this.cache[h]=y.length?y:"");for(var b=y.length;b--;){var T=y[b].toScreenRange(o),$=T.toString();u[$]||(u[$]=!0,r.drawSingleLineMarker(f,T,this.clazz,s))}}},c})();m.prototype.MAX_RANGES=500,n.SearchHighlight=m}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(t,n,p){var d=(function(){function A(){this.$keepRedoStack,this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return A.prototype.addSession=function(S){this.$session=S},A.prototype.add=function(S,M,R){if(!this.$fromUndo&&S!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),M===!1||!this.lastDeltas){this.lastDeltas=[];var L=this.$undoStack.length;L>this.$undoDepth-1&&this.$undoStack.splice(0,L-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),S.id=this.$rev=++this.$maxRev}(S.action=="remove"||S.action=="insert")&&(this.$lastDelta=S),this.lastDeltas.push(S)}},A.prototype.addSelection=function(S,M){this.selections.push({value:S,rev:M||this.$rev})},A.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},A.prototype.markIgnored=function(S,M){M==null&&(M=this.$rev+1);for(var R=this.$undoStack,L=R.length;L--;){var _=R[L][0];if(_.id<=S)break;_.id<M&&(_.ignore=!0)}this.lastDeltas=null},A.prototype.getSelection=function(S,M){for(var R=this.selections,L=R.length;L--;){var _=R[L];if(_.rev<S)return M&&(_=R[L+1]),_}},A.prototype.getRevision=function(){return this.$rev},A.prototype.getDeltas=function(S,M){M==null&&(M=this.$rev+1);for(var R=this.$undoStack,L=null,_=0,O=R.length;O--;){var w=R[O][0];if(w.id<M&&!L&&(L=O+1),w.id<=S){_=O+1;break}}return R.slice(_,L)},A.prototype.getChangedRanges=function(S,M){M==null&&(M=this.$rev+1)},A.prototype.getChangedLines=function(S,M){M==null&&(M=this.$rev+1)},A.prototype.undo=function(S,M){this.lastDeltas=null;var R=this.$undoStack;if(g(R,R.length)){S||(S=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var L=R.pop(),_=null;return L&&(_=S.undoChanges(L,M),this.$redoStack.push(L),this.$syncRev()),this.$fromUndo=!1,_}},A.prototype.redo=function(S,M){if(this.lastDeltas=null,S||(S=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var R=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);$(this.$redoStack,R),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach(function(O){O[0].id=++this.$maxRev},this)}var L=this.$redoStack.pop(),_=null;return L&&(_=S.redoChanges(L,M),this.$undoStack.push(L),this.$syncRev()),this.$fromUndo=!1,_},A.prototype.$syncRev=function(){var S=this.$undoStack,M=S[S.length-1],R=M&&M[0].id||0;this.$redoStackBaseRev=R,this.$rev=R},A.prototype.reset=function(){this.lastDeltas=null,this.$lastDelta=null,this.$undoStack=[],this.$redoStack=[],this.$rev=0,this.mark=0,this.$redoStackBaseRev=this.$rev,this.selections=[]},A.prototype.canUndo=function(){return this.$undoStack.length>0},A.prototype.canRedo=function(){return this.$redoStack.length>0},A.prototype.bookmark=function(S){S==null&&(S=this.$rev),this.mark=S},A.prototype.isAtBookmark=function(){return this.$rev===this.mark},A.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},A.prototype.fromJSON=function(S){this.reset(),this.$undoStack=S.$undoStack,this.$redoStack=S.$redoStack},A.prototype.$prettyPrint=function(S){return S?o(S):o(this.$undoStack)+`
1355
1355
  ---
1356
- `+o(this.$redoStack)},A})();d.prototype.hasUndo=d.prototype.canUndo,d.prototype.hasRedo=d.prototype.canRedo,d.prototype.isClean=d.prototype.isAtBookmark,d.prototype.markClean=d.prototype.bookmark;function g(A,S){for(var M=S;M--;){var R=A[M];if(R&&!R[0].ignore){for(;M<S-1;){var L=i(A[M],A[M+1]);A[M]=L[0],A[M+1]=L[1],M++}return!0}}}var m=t("./range").Range,l=m.comparePoints;m.comparePoints;function f(A){return{row:A.row,column:A.column}}function r(A){return{start:f(A.start),end:f(A.end),action:A.action,lines:A.lines.slice()}}function o(A){if(A=A||this,Array.isArray(A))return A.map(o).join(`
1356
+ `+o(this.$redoStack)},A})();d.prototype.hasUndo=d.prototype.canUndo,d.prototype.hasRedo=d.prototype.canRedo,d.prototype.isClean=d.prototype.isAtBookmark,d.prototype.markClean=d.prototype.bookmark;function g(A,S){for(var M=S;M--;){var R=A[M];if(R&&!R[0].ignore){for(;M<S-1;){var L=i(A[M],A[M+1]);A[M]=L[0],A[M+1]=L[1],M++}return!0}}}var m=t("./range").Range,c=m.comparePoints;m.comparePoints;function f(A){return{row:A.row,column:A.column}}function r(A){return{start:f(A.start),end:f(A.end),action:A.action,lines:A.lines.slice()}}function o(A){if(A=A||this,Array.isArray(A))return A.map(o).join(`
1357
1357
  `);var S="";return A.action?(S=A.action=="insert"?"+":"-",S+="["+A.lines+"]"):A.value&&(Array.isArray(A.value)?S=A.value.map(s).join(`
1358
- `):S=s(A.value)),A.start&&(S+=s(A)),(A.id||A.rev)&&(S+=" ("+(A.id||A.rev)+")"),S}function s(A){return A.start.row+":"+A.start.column+"=>"+A.end.row+":"+A.end.column}function a(A,S){var M=A.action=="insert",R=S.action=="insert";if(M&&R)if(l(S.start,A.end)>=0)h(S,A,-1);else if(l(S.start,A.start)<=0)h(A,S,1);else return null;else if(M&&!R)if(l(S.start,A.end)>=0)h(S,A,-1);else if(l(S.end,A.start)<=0)h(A,S,-1);else return null;else if(!M&&R)if(l(S.start,A.start)>=0)h(S,A,1);else if(l(S.start,A.start)<=0)h(A,S,1);else return null;else if(!M&&!R)if(l(S.start,A.start)>=0)h(S,A,1);else if(l(S.end,A.start)<=0)h(A,S,-1);else return null;return[S,A]}function i(A,S){for(var M=A.length;M--;)for(var R=0;R<S.length;R++)if(!a(A[M],S[R])){for(;M<A.length;){for(;R--;)a(S[R],A[M]);R=S.length,M++}return[A,S]}return A.selectionBefore=S.selectionBefore=A.selectionAfter=S.selectionAfter=null,[S,A]}function u(A,S){var M=A.action=="insert",R=S.action=="insert";if(M&&R)l(A.start,S.start)<0?h(S,A,1):h(A,S,1);else if(M&&!R)l(A.start,S.end)>=0?h(A,S,-1):(l(A.start,S.start)<=0||h(A,m.fromPoints(S.start,A.start),-1),h(S,A,1));else if(!M&&R)l(S.start,A.end)>=0?h(S,A,-1):(l(S.start,A.start)<=0||h(S,m.fromPoints(A.start,S.start),-1),h(A,S,1));else if(!M&&!R)if(l(S.start,A.end)>=0)h(S,A,-1);else if(l(S.end,A.start)<=0)h(A,S,-1);else{var L,_;return l(A.start,S.start)<0&&(L=A,A=b(A,S.start)),l(A.end,S.end)>0&&(_=b(A,S.end)),y(S.end,A.start,A.end,-1),_&&!L&&(A.lines=_.lines,A.start=_.start,A.end=_.end,_=A),[S,L,_].filter(Boolean)}return[S,A]}function h(A,S,M){y(A.start,S.start,S.end,M),y(A.end,S.start,S.end,M)}function y(A,S,M,R){A.row==(R==1?S:M).row&&(A.column+=R*(M.column-S.column)),A.row+=R*(M.row-S.row)}function b(A,S){var M=A.lines,R=A.end;A.end=f(S);var L=A.end.row-A.start.row,_=M.splice(L,M.length),I=L?S.column:S.column-A.start.column;M.push(_[0].substring(0,I)),_[0]=_[0].substr(I);var w={start:f(S),end:R,lines:_,action:A.action};return w}function T(A,S){S=r(S);for(var M=A.length;M--;){for(var R=A[M],L=0;L<R.length;L++){var _=R[L],I=u(_,S);S=I[0],I.length!=2&&(I[2]?(R.splice(L+1,1,I[1],I[2]),L++):I[1]||(R.splice(L,1),L--))}R.length||A.splice(M,1)}return A}function $(A,S){for(var M=0;M<S.length;M++)for(var R=S[M],L=0;L<R.length;L++)T(A,R[L])}n.UndoManager=d}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(t,n,p){var d=t("../range").Range,g=(function(){function m(l,f){this.foldData=l,Array.isArray(f)?this.folds=f:f=this.folds=[f];var r=f[f.length-1];this.range=new d(f[0].start.row,f[0].start.column,r.end.row,r.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(o){o.setFoldLine(this)},this)}return m.prototype.shiftRow=function(l){this.start.row+=l,this.end.row+=l,this.folds.forEach(function(f){f.start.row+=l,f.end.row+=l})},m.prototype.addFold=function(l){if(l.sameRow){if(l.start.row<this.startRow||l.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(l),this.folds.sort(function(f,r){return-f.range.compareEnd(r.start.row,r.start.column)}),this.range.compareEnd(l.start.row,l.start.column)>0?(this.end.row=l.end.row,this.end.column=l.end.column):this.range.compareStart(l.end.row,l.end.column)<0&&(this.start.row=l.start.row,this.start.column=l.start.column)}else if(l.start.row==this.end.row)this.folds.push(l),this.end.row=l.end.row,this.end.column=l.end.column;else if(l.end.row==this.start.row)this.folds.unshift(l),this.start.row=l.start.row,this.start.column=l.start.column;else throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");l.foldLine=this},m.prototype.containsRow=function(l){return l>=this.start.row&&l<=this.end.row},m.prototype.walk=function(l,f,r){var o=0,s=this.folds,a,i,u,h=!0;f==null&&(f=this.end.row,r=this.end.column);for(var y=0;y<s.length;y++){if(a=s[y],i=a.range.compareStart(f,r),i==-1){l(null,f,r,o,h);return}if(u=l(null,a.start.row,a.start.column,o,h),u=!u&&l(a.placeholder,a.start.row,a.start.column,o),u||i===0)return;h=!a.sameRow,o=a.end.column}l(null,f,r,o,h)},m.prototype.getNextFoldTo=function(l,f){for(var r,o,s=0;s<this.folds.length;s++){if(r=this.folds[s],o=r.range.compareEnd(l,f),o==-1)return{fold:r,kind:"after"};if(o===0)return{fold:r,kind:"inside"}}return null},m.prototype.addRemoveChars=function(l,f,r){var o=this.getNextFoldTo(l,f),s,a;if(o){if(s=o.fold,o.kind=="inside"&&s.start.column!=f&&s.start.row!=l)window.console&&window.console.log(l,f,s);else if(s.start.row==l){a=this.folds;var i=a.indexOf(s);for(i===0&&(this.start.column+=r),i;i<a.length;i++){if(s=a[i],s.start.column+=r,!s.sameRow)return;s.end.column+=r}this.end.column+=r}}},m.prototype.split=function(l,f){var r=this.getNextFoldTo(l,f);if(!r||r.kind=="inside")return null;var o=r.fold,s=this.folds,a=this.foldData,i=s.indexOf(o),u=s[i-1];this.end.row=u.end.row,this.end.column=u.end.column,s=s.splice(i,s.length-i);var h=new m(a,s);return a.splice(a.indexOf(this)+1,0,h),h},m.prototype.merge=function(l){for(var f=l.folds,r=0;r<f.length;r++)this.addFold(f[r]);var o=this.foldData;o.splice(o.indexOf(l),1)},m.prototype.toString=function(){var l=[this.range.toString()+": ["];return this.folds.forEach(function(f){l.push(" "+f.toString())}),l.push("]"),l.join(`
1359
- `)},m.prototype.idxToPosition=function(l){for(var f=0,r=0;r<this.folds.length;r++){var o=this.folds[r];if(l-=o.start.column-f,l<0)return{row:o.start.row,column:o.start.column+l};if(l-=o.placeholder.length,l<0)return o.start;f=o.end.column}return{row:this.end.row,column:this.end.column+l}},m})();n.FoldLine=g}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(t,n,p){var d=t("./range").Range,g=d.comparePoints,m=(function(){function l(){this.ranges=[],this.$bias=1}return l.prototype.pointIndex=function(f,r,o){for(var s=this.ranges,a=o||0;a<s.length;a++){var i=s[a],u=g(f,i.end);if(!(u>0)){var h=g(f,i.start);return u===0?r&&h!==0?-a-2:a:h>0||h===0&&!r?a:-a-1}}return-a-1},l.prototype.add=function(f){var r=!f.isEmpty(),o=this.pointIndex(f.start,r);o<0&&(o=-o-1);var s=this.pointIndex(f.end,r,o);return s<0?s=-s-1:s++,this.ranges.splice(o,s-o,f)},l.prototype.addList=function(f){for(var r=[],o=f.length;o--;)r.push.apply(r,this.add(f[o]));return r},l.prototype.substractPoint=function(f){var r=this.pointIndex(f);if(r>=0)return this.ranges.splice(r,1)},l.prototype.merge=function(){var f=[],r=this.ranges;r=r.sort(function(u,h){return g(u.start,h.start)});for(var o=r[0],s,a=1;a<r.length;a++){s=o,o=r[a];var i=g(s.end,o.start);i<0||i==0&&!s.isEmpty()&&!o.isEmpty()||(g(s.end,o.end)<0&&(s.end.row=o.end.row,s.end.column=o.end.column),r.splice(a,1),f.push(o),o=s,a--)}return this.ranges=r,f},l.prototype.contains=function(f,r){return this.pointIndex({row:f,column:r})>=0},l.prototype.containsPoint=function(f){return this.pointIndex(f)>=0},l.prototype.rangeAtPoint=function(f){var r=this.pointIndex(f);if(r>=0)return this.ranges[r]},l.prototype.clipRows=function(f,r){var o=this.ranges;if(o[0].start.row>r||o[o.length-1].start.row<f)return[];var s=this.pointIndex({row:f,column:0});s<0&&(s=-s-1);var a=this.pointIndex({row:r,column:0},s);a<0&&(a=-a-1);for(var i=[],u=s;u<a;u++)i.push(o[u]);return i},l.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},l.prototype.attach=function(f){this.session&&this.detach(),this.session=f,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},l.prototype.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},l.prototype.$onChange=function(f){for(var r=f.start,o=f.end,s=r.row,a=o.row,i=this.ranges,u=0,h=i.length;u<h;u++){var y=i[u];if(y.end.row>=s)break}if(f.action=="insert")for(var b=a-s,T=-r.column+o.column;u<h;u++){var y=i[u];if(y.start.row>s)break;if(y.start.row==s&&y.start.column>=r.column&&(y.start.column==r.column&&this.$bias<=0||(y.start.column+=T,y.start.row+=b)),y.end.row==s&&y.end.column>=r.column){if(y.end.column==r.column&&this.$bias<0)continue;y.end.column==r.column&&T>0&&u<h-1&&y.end.column>y.start.column&&y.end.column==i[u+1].start.column&&(y.end.column-=T),y.end.column+=T,y.end.row+=b}}else for(var b=s-a,T=r.column-o.column;u<h;u++){var y=i[u];if(y.start.row>a)break;y.end.row<a&&(s<y.end.row||s==y.end.row&&r.column<y.end.column)?(y.end.row=s,y.end.column=r.column):y.end.row==a?y.end.column<=o.column?(b||y.end.column>r.column)&&(y.end.column=r.column,y.end.row=r.row):(y.end.column+=T,y.end.row+=b):y.end.row>a&&(y.end.row+=b),y.start.row<a&&(s<y.start.row||s==y.start.row&&r.column<y.start.column)?(y.start.row=s,y.start.column=r.column):y.start.row==a?y.start.column<=o.column?(b||y.start.column>r.column)&&(y.start.column=r.column,y.start.row=r.row):(y.start.column+=T,y.start.row+=b):y.start.row>a&&(y.start.row+=b)}if(b!=0&&u<h)for(;u<h;u++){var y=i[u];y.start.row+=b,y.end.row+=b}},l})();m.prototype.comparePoints=g,n.RangeList=m}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"],function(t,n,p){var d=this&&this.__extends||(function(){var s=function(a,i){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,h){u.__proto__=h}||function(u,h){for(var y in h)Object.prototype.hasOwnProperty.call(h,y)&&(u[y]=h[y])},s(a,i)};return function(a,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");s(a,i);function u(){this.constructor=a}a.prototype=i===null?Object.create(i):(u.prototype=i.prototype,new u)}})(),g=t("../range_list").RangeList,m=(function(s){d(a,s);function a(i,u){var h=s.call(this)||this;return h.foldLine=null,h.placeholder=u,h.range=i,h.start=i.start,h.end=i.end,h.sameRow=i.start.row==i.end.row,h.subFolds=h.ranges=[],h}return a.prototype.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},a.prototype.setFoldLine=function(i){this.foldLine=i,this.subFolds.forEach(function(u){u.setFoldLine(i)})},a.prototype.clone=function(){var i=this.range.clone(),u=new a(i,this.placeholder);return this.subFolds.forEach(function(h){u.subFolds.push(h.clone())}),u.collapseChildren=this.collapseChildren,u},a.prototype.addSubFold=function(i){if(!this.range.isEqual(i)){f(i,this.start);for(var T=i.start.row,$=i.start.column,u=0,h=-1;u<this.subFolds.length&&(h=this.subFolds[u].range.compare(T,$),h==1);u++);var y=this.subFolds[u],b=0;if(h==0){if(y.range.containsRange(i))return y.addSubFold(i);b=1}for(var T=i.range.end.row,$=i.range.end.column,A=u,h=-1;A<this.subFolds.length&&(h=this.subFolds[A].range.compare(T,$),h==1);A++);h==0&&A++;for(var S=this.subFolds.splice(u,A-u,i),M=h==0?S.length-1:S.length,R=b;R<M;R++)i.addSubFold(S[R]);return i.setFoldLine(this.foldLine),i}},a.prototype.restoreRange=function(i){return o(i,this.start)},a})(g);function l(s,a){s.row-=a.row,s.row==0&&(s.column-=a.column)}function f(s,a){l(s.start,a),l(s.end,a)}function r(s,a){s.row==0&&(s.column+=a.column),s.row+=a.row}function o(s,a){r(s.start,a),r(s.end,a)}n.Fold=m}),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator","ace/mouse/mouse_event"],function(t,n,p){var d=t("../range").Range,g=t("./fold_line").FoldLine,m=t("./fold").Fold,l=t("../token_iterator").TokenIterator,f=t("../mouse/mouse_event").MouseEvent;function r(){this.getFoldAt=function(o,s,a){var i=this.getFoldLine(o);if(!i)return null;for(var u=i.folds,h=0;h<u.length;h++){var y=u[h].range;if(y.contains(o,s)){if(a==1&&y.isEnd(o,s)&&!y.isEmpty())continue;if(a==-1&&y.isStart(o,s)&&!y.isEmpty())continue;return u[h]}}},this.getFoldsInRange=function(o){var s=o.start,a=o.end,i=this.$foldData,u=[];s.column+=1,a.column-=1;for(var h=0;h<i.length;h++){var y=i[h].range.compareRange(o);if(y!=2){if(y==-2)break;for(var b=i[h].folds,T=0;T<b.length;T++){var $=b[T];if(y=$.range.compareRange(o),y==-2)break;if(y==2)continue;if(y==42)break;u.push($)}}}return s.column-=1,a.column+=1,u},this.getFoldsInRangeList=function(o){if(Array.isArray(o)){var s=[];o.forEach(function(a){s=s.concat(this.getFoldsInRange(a))},this)}else var s=this.getFoldsInRange(o);return s},this.getAllFolds=function(){for(var o=[],s=this.$foldData,a=0;a<s.length;a++)for(var i=0;i<s[a].folds.length;i++)o.push(s[a].folds[i]);return o},this.getFoldStringAt=function(o,s,a,i){if(i=i||this.getFoldLine(o),!i)return null;for(var u={end:{column:0}},h,y,b=0;b<i.folds.length;b++){y=i.folds[b];var T=y.range.compareEnd(o,s);if(T==-1){h=this.getLine(y.start.row).substring(u.end.column,y.start.column);break}else if(T===0)return null;u=y}return h||(h=this.getLine(y.start.row).substring(u.end.column)),a==-1?h.substring(0,s-u.end.column):a==1?h.substring(s-u.end.column):h},this.getFoldLine=function(o,s){var a=this.$foldData,i=0;for(s&&(i=a.indexOf(s)),i==-1&&(i=0),i;i<a.length;i++){var u=a[i];if(u.start.row<=o&&u.end.row>=o)return u;if(u.end.row>o)return null}return null},this.getNextFoldLine=function(o,s){var a=this.$foldData,i=0;for(s&&(i=a.indexOf(s)),i==-1&&(i=0),i;i<a.length;i++){var u=a[i];if(u.end.row>=o)return u}return null},this.getFoldedRowCount=function(o,s){for(var a=this.$foldData,i=s-o+1,u=0;u<a.length;u++){var h=a[u],y=h.end.row,b=h.start.row;if(y>=s){b<s&&(b>=o?i-=s-b:i=0);break}else y>=o&&(b>=o?i-=y-b:i-=y-o+1)}return i},this.$addFoldLine=function(o){return this.$foldData.push(o),this.$foldData.sort(function(s,a){return s.start.row-a.start.row}),o},this.addFold=function(o,s){var a=this.$foldData,i=!1,u;o instanceof m?u=o:(u=new m(s,o),u.collapseChildren=s.collapseChildren),this.$clipRangeToDocument(u.range);var h=u.start.row,y=u.start.column,b=u.end.row,T=u.end.column,$=this.getFoldAt(h,y,1),A=this.getFoldAt(b,T,-1);if($&&A==$)return $.addSubFold(u);$&&!$.range.isStart(h,y)&&this.removeFold($),A&&!A.range.isEnd(b,T)&&this.removeFold(A);var S=this.getFoldsInRange(u.range);S.length>0&&(this.removeFolds(S),u.collapseChildren||S.forEach(function(_){u.addSubFold(_)}));for(var M=0;M<a.length;M++){var R=a[M];if(b==R.start.row){R.addFold(u),i=!0;break}else if(h==R.end.row){if(R.addFold(u),i=!0,!u.sameRow){var L=a[M+1];if(L&&L.start.row==b){R.merge(L);break}}break}else if(b<=R.start.row)break}return i||(R=this.$addFoldLine(new g(this.$foldData,u))),this.$useWrapMode?this.$updateWrapData(R.start.row,R.start.row):this.$updateRowLengthCache(R.start.row,R.start.row),this.$modified=!0,this._signal("changeFold",{data:u,action:"add"}),u},this.addFolds=function(o){o.forEach(function(s){this.addFold(s)},this)},this.removeFold=function(o){var s=o.foldLine,a=s.start.row,i=s.end.row,u=this.$foldData,h=s.folds;if(h.length==1)u.splice(u.indexOf(s),1);else if(s.range.isEnd(o.end.row,o.end.column))h.pop(),s.end.row=h[h.length-1].end.row,s.end.column=h[h.length-1].end.column;else if(s.range.isStart(o.start.row,o.start.column))h.shift(),s.start.row=h[0].start.row,s.start.column=h[0].start.column;else if(o.sameRow)h.splice(h.indexOf(o),1);else{var y=s.split(o.start.row,o.start.column);h=y.folds,h.shift(),y.start.row=h[0].start.row,y.start.column=h[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(a,i):this.$updateRowLengthCache(a,i)),this.$modified=!0,this._signal("changeFold",{data:o,action:"remove"})},this.removeFolds=function(o){for(var s=[],a=0;a<o.length;a++)s.push(o[a]);s.forEach(function(i){this.removeFold(i)},this),this.$modified=!0},this.expandFold=function(o){this.removeFold(o),o.subFolds.forEach(function(s){o.restoreRange(s),this.addFold(s)},this),o.collapseChildren>0&&this.foldAll(o.start.row+1,o.end.row,o.collapseChildren-1),o.subFolds=[]},this.expandFolds=function(o){o.forEach(function(s){this.expandFold(s)},this)},this.unfold=function(o,s){var a,i;if(o==null)a=new d(0,0,this.getLength(),0),s==null&&(s=!0);else if(typeof o=="number")a=new d(o,0,o,this.getLine(o).length);else if("row"in o)a=d.fromPoints(o,o);else{if(Array.isArray(o))return i=[],o.forEach(function(h){i=i.concat(this.unfold(h))},this),i;a=o}i=this.getFoldsInRangeList(a);for(var u=i;i.length==1&&d.comparePoints(i[0].start,a.start)<0&&d.comparePoints(i[0].end,a.end)>0;)this.expandFolds(i),i=this.getFoldsInRangeList(a);if(s!=!1?this.removeFolds(i):this.expandFolds(i),u.length)return u},this.isRowFolded=function(o,s){return!!this.getFoldLine(o,s)},this.getRowFoldEnd=function(o,s){var a=this.getFoldLine(o,s);return a?a.end.row:o},this.getRowFoldStart=function(o,s){var a=this.getFoldLine(o,s);return a?a.start.row:o},this.getFoldDisplayLine=function(o,s,a,i,u){i==null&&(i=o.start.row),u==null&&(u=0),s==null&&(s=o.end.row),a==null&&(a=this.getLine(s).length);var h=this.doc,y="";return o.walk(function(b,T,$,A){if(!(T<i)){if(T==i){if($<u)return;A=Math.max(u,A)}b!=null?y+=b:y+=h.getLine(T).substring(A,$)}},s,a),y},this.getDisplayLine=function(o,s,a,i){var u=this.getFoldLine(o);if(u)return this.getFoldDisplayLine(u,o,s,a,i);var h;return h=this.doc.getLine(o),h.substring(i||0,s||h.length)},this.$cloneFoldData=function(){var o=[];return o=this.$foldData.map(function(s){var a=s.folds.map(function(i){return i.clone()});return new g(o,a)}),o},this.toggleFold=function(o){var s=this.selection,a=s.getRange(),i,u;if(a.isEmpty()){var h=a.start;if(i=this.getFoldAt(h.row,h.column),i){this.expandFold(i);return}else(u=this.findMatchingBracket(h))?a.comparePoint(u)==1?a.end=u:(a.start=u,a.start.column++,a.end.column--):(u=this.findMatchingBracket({row:h.row,column:h.column+1}))?(a.comparePoint(u)==1?a.end=u:a.start=u,a.start.column++):a=this.getCommentFoldRange(h.row,h.column)||a}else{var y=this.getFoldsInRange(a);if(o&&y.length){this.expandFolds(y);return}else y.length==1&&(i=y[0])}if(i||(i=this.getFoldAt(a.start.row,a.start.column)),i&&i.range.toString()==a.toString()){this.expandFold(i);return}var b="...";if(!a.isMultiLine()){if(b=this.getTextRange(a),b.length<4)return;b=b.trim().substring(0,2)+".."}this.addFold(b,a)},this.getCommentFoldRange=function(o,s,a){var i=new l(this,o,s),u=i.getCurrentToken(),h=u&&u.type;if(u&&/^comment|string/.test(h)){h=h.match(/comment|string/)[0],h=="comment"&&(h+="|doc-start|\\.doc");var y=new RegExp(h),b=new d;if(a!=1){do u=i.stepBackward();while(u&&y.test(u.type));u=i.stepForward()}b.start.row=i.getCurrentTokenRow(),b.start.column=i.getCurrentTokenColumn()+u.value.length,i=new l(this,o,s);var T=this.getState(i.$row);if(a!=-1){var $=-1;do if(u=i.stepForward(),$==-1){var A=this.getState(i.$row);T.toString()!==A.toString()&&($=i.$row)}else if(i.$row>$)break;while(u&&y.test(u.type));u=i.stepBackward()}else u=i.getCurrentToken();return b.end.row=i.getCurrentTokenRow(),b.end.column=i.getCurrentTokenColumn(),b}},this.foldAll=function(o,s,a,i){a==null&&(a=1e5);var u=this.foldWidgets;if(u){s=s||this.getLength(),o=o||0;for(var h=o;h<s;h++)if(u[h]==null&&(u[h]=this.getFoldWidget(h)),u[h]=="start"&&!(i&&!i(h))){var y=this.getFoldWidgetRange(h);y&&y.isMultiLine()&&y.end.row<=s&&y.start.row>=o&&(h=y.end.row,y.collapseChildren=a,this.addFold("...",y))}}},this.foldToLevel=function(o){for(this.foldAll();o-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var o=this;this.foldAll(null,null,null,function(s){for(var a=o.getTokens(s),i=0;i<a.length;i++){var u=a[i];if(!(u.type=="text"&&/^\s+$/.test(u.value)))return!!/comment/.test(u.type)}})},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(o){if(!this.$foldStyles[o])throw new Error("invalid fold style: "+o+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=o){this.$foldStyle=o,o=="manual"&&this.unfold();var s=this.$foldMode;this.$setFolding(null),this.$setFolding(s)}},this.$setFolding=function(o){if(this.$foldMode!=o){if(this.$foldMode=o,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),!o||this.$foldStyle=="manual"){this.foldWidgets=null;return}this.foldWidgets=[],this.getFoldWidget=o.getFoldWidget.bind(o,this,this.$foldStyle),this.getFoldWidgetRange=o.getFoldWidgetRange.bind(o,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)}},this.getParentFoldRangeData=function(o,s){var a=this.foldWidgets;if(!a||s&&a[o])return{};for(var i=o-1,u;i>=0;){var h=a[i];if(h==null&&(h=a[i]=this.getFoldWidget(i)),h=="start"){var y=this.getFoldWidgetRange(i);if(u||(u=y),y&&y.end.row>=o)break}i--}return{range:i!==-1&&y,firstRange:u}},this.onFoldWidgetClick=function(o,s){s instanceof f&&(s=s.domEvent);var a={children:s.shiftKey,all:s.ctrlKey||s.metaKey,siblings:s.altKey},i=this.$toggleFoldWidget(o,a);if(!i){var u=s.target||s.srcElement;u&&/ace_fold-widget/.test(u.className)&&(u.className+=" ace_invalid")}},this.$toggleFoldWidget=function(o,s){if(this.getFoldWidget){var a=this.getFoldWidget(o),i=this.getLine(o),u=a==="end"?-1:1,h=this.getFoldAt(o,u===-1?0:i.length,u);if(h)return s.children||s.all?this.removeFold(h):this.expandFold(h),h;var y=this.getFoldWidgetRange(o,!0);if(y&&!y.isMultiLine()&&(h=this.getFoldAt(y.start.row,y.start.column,1),h&&y.isEqual(h.range)))return this.removeFold(h),h;if(s.siblings){var b=this.getParentFoldRangeData(o);if(b.range)var T=b.range.start.row+1,$=b.range.end.row;this.foldAll(T,$,s.all?1e4:0)}else s.children?($=y?y.end.row:this.getLength(),this.foldAll(o+1,$,s.all?1e4:0)):y&&(s.all&&(y.collapseChildren=1e4),this.addFold("...",y));return y}},this.toggleFoldWidget=function(o){var s=this.selection.getCursor().row;s=this.getRowFoldStart(s);var a=this.$toggleFoldWidget(s,{});if(!a){var i=this.getParentFoldRangeData(s,!0);if(a=i.range||i.firstRange,a){s=a.start.row;var u=this.getFoldAt(s,this.getLine(s).length,1);u?this.removeFold(u):this.addFold("...",a)}}},this.updateFoldWidgets=function(o){var s=o.start.row,a=o.end.row-s;if(a===0)this.foldWidgets[s]=null;else if(o.action=="remove")this.foldWidgets.splice(s,a+1,null);else{var i=Array(a+1);i.unshift(s,1),this.foldWidgets.splice.apply(this.foldWidgets,i)}},this.tokenizerUpdateFoldWidgets=function(o){var s=o.data;s.first!=s.last&&this.foldWidgets.length>s.first&&this.foldWidgets.splice(s.first,this.foldWidgets.length)}}n.Folding=r}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(t,n,p){var d=t("../token_iterator").TokenIterator,g=t("../range").Range;function m(){this.findMatchingBracket=function(l,f){if(l.column==0)return null;var r=f||this.getLine(l.row).charAt(l.column-1);if(r=="")return null;var o=r.match(/([\(\[\{])|([\)\]\}])/);return o?o[1]?this.$findClosingBracket(o[1],l):this.$findOpeningBracket(o[2],l):null},this.getBracketRange=function(l){var f=this.getLine(l.row),r=!0,o,s=f.charAt(l.column-1),a=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(a||(s=f.charAt(l.column),l={row:l.row,column:l.column+1},a=s&&s.match(/([\(\[\{])|([\)\]\}])/),r=!1),!a)return null;if(a[1]){var i=this.$findClosingBracket(a[1],l);if(!i)return null;o=g.fromPoints(l,i),r||(o.end.column++,o.start.column--),o.cursor=o.end}else{var i=this.$findOpeningBracket(a[2],l);if(!i)return null;o=g.fromPoints(i,l),r||(o.start.column++,o.end.column--),o.cursor=o.start}return o},this.getMatchingBracketRanges=function(l,f){var r=this.getLine(l.row),o=/([\(\[\{])|([\)\]\}])/,s=!f&&r.charAt(l.column-1),a=s&&s.match(o);if(a||(s=(f===void 0||f)&&r.charAt(l.column),l={row:l.row,column:l.column+1},a=s&&s.match(o)),!a)return null;var i=new g(l.row,l.column-1,l.row,l.column),u=a[1]?this.$findClosingBracket(a[1],l):this.$findOpeningBracket(a[2],l);if(!u)return[i];var h=new g(u.row,u.column,u.row,u.column+1);return[i,h]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(l,f,r){var o=this.$brackets[l],s=1,a=new d(this,f.row,f.column),i=a.getCurrentToken();if(i||(i=a.stepForward()),!!i){r||(r=new RegExp("(\\.?"+i.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var u=f.column-a.getCurrentTokenColumn()-2,h=i.value;;){for(;u>=0;){var y=h.charAt(u);if(y==o){if(s-=1,s==0)return{row:a.getCurrentTokenRow(),column:u+a.getCurrentTokenColumn()}}else y==l&&(s+=1);u-=1}do i=a.stepBackward();while(i&&!r.test(i.type));if(i==null)break;h=i.value,u=h.length-1}return null}},this.$findClosingBracket=function(l,f,r){var o=this.$brackets[l],s=1,a=new d(this,f.row,f.column),i=a.getCurrentToken();if(i||(i=a.stepForward()),!!i){r||(r=new RegExp("(\\.?"+i.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var u=f.column-a.getCurrentTokenColumn();;){for(var h=i.value,y=h.length;u<y;){var b=h.charAt(u);if(b==o){if(s-=1,s==0)return{row:a.getCurrentTokenRow(),column:u+a.getCurrentTokenColumn()}}else b==l&&(s+=1);u+=1}do i=a.stepForward();while(i&&!r.test(i.type));if(i==null)break;u=0}return null}},this.getMatchingTags=function(l){var f=new d(this,l.row,l.column),r=this.$findTagName(f);if(r){var o=f.stepBackward();return o.value==="<"?this.$findClosingTag(f,r):this.$findOpeningTag(f,r)}},this.$findTagName=function(l){var f=l.getCurrentToken(),r=!1,o=!1;if(f&&f.type.indexOf("tag-name")===-1)do o?f=l.stepBackward():f=l.stepForward(),f&&(f.value==="/>"?o=!0:f.type.indexOf("tag-name")!==-1&&(r=!0));while(f&&!r);return f},this.$findClosingTag=function(l,f){var r,o=f.value,s=f.value,a=0,i=new g(l.getCurrentTokenRow(),l.getCurrentTokenColumn(),l.getCurrentTokenRow(),l.getCurrentTokenColumn()+1);f=l.stepForward();var u=new g(l.getCurrentTokenRow(),l.getCurrentTokenColumn(),l.getCurrentTokenRow(),l.getCurrentTokenColumn()+f.value.length),h=!1;do{if(r=f,r.type.indexOf("tag-close")!==-1&&!h){var y=new g(l.getCurrentTokenRow(),l.getCurrentTokenColumn(),l.getCurrentTokenRow(),l.getCurrentTokenColumn()+1);h=!0}if(f=l.stepForward(),f){if(f.value===">"&&!h){var y=new g(l.getCurrentTokenRow(),l.getCurrentTokenColumn(),l.getCurrentTokenRow(),l.getCurrentTokenColumn()+1);h=!0}if(f.type.indexOf("tag-name")!==-1){if(o=f.value,s===o){if(r.value==="<")a++;else if(r.value==="</"&&(a--,a<0)){l.stepBackward();var b=new g(l.getCurrentTokenRow(),l.getCurrentTokenColumn(),l.getCurrentTokenRow(),l.getCurrentTokenColumn()+2);f=l.stepForward();var T=new g(l.getCurrentTokenRow(),l.getCurrentTokenColumn(),l.getCurrentTokenRow(),l.getCurrentTokenColumn()+f.value.length);if(f.type.indexOf("tag-close")===-1&&(f=l.stepForward()),f&&f.value===">")var $=new g(l.getCurrentTokenRow(),l.getCurrentTokenColumn(),l.getCurrentTokenRow(),l.getCurrentTokenColumn()+1);else return}}}else if(s===o&&f.value==="/>"&&(a--,a<0))var b=new g(l.getCurrentTokenRow(),l.getCurrentTokenColumn(),l.getCurrentTokenRow(),l.getCurrentTokenColumn()+2),T=b,$=T,y=new g(u.end.row,u.end.column,u.end.row,u.end.column+1)}}while(f&&a>=0);if(i&&y&&b&&$&&u&&T)return{openTag:new g(i.start.row,i.start.column,y.end.row,y.end.column),closeTag:new g(b.start.row,b.start.column,$.end.row,$.end.column),openTagName:u,closeTagName:T}},this.$findOpeningTag=function(l,f){var r=l.getCurrentToken(),o=f.value,s=0,a=l.getCurrentTokenRow(),i=l.getCurrentTokenColumn(),u=i+2,h=new g(a,i,a,u);l.stepForward();var y=new g(l.getCurrentTokenRow(),l.getCurrentTokenColumn(),l.getCurrentTokenRow(),l.getCurrentTokenColumn()+f.value.length);if(f.type.indexOf("tag-close")===-1&&(f=l.stepForward()),!(!f||f.value!==">")){var b=new g(l.getCurrentTokenRow(),l.getCurrentTokenColumn(),l.getCurrentTokenRow(),l.getCurrentTokenColumn()+1);l.stepBackward(),l.stepBackward();do if(f=r,a=l.getCurrentTokenRow(),i=l.getCurrentTokenColumn(),u=i+f.value.length,r=l.stepBackward(),f){if(f.type.indexOf("tag-name")!==-1){if(o===f.value)if(r.value==="<"){if(s++,s>0){var T=new g(a,i,a,u),$=new g(l.getCurrentTokenRow(),l.getCurrentTokenColumn(),l.getCurrentTokenRow(),l.getCurrentTokenColumn()+1);do f=l.stepForward();while(f&&f.value!==">");var A=new g(l.getCurrentTokenRow(),l.getCurrentTokenColumn(),l.getCurrentTokenRow(),l.getCurrentTokenColumn()+1)}}else r.value==="</"&&s--}else if(f.value==="/>"){for(var S=0,M=r;M;){if(M.type.indexOf("tag-name")!==-1&&M.value===o){s--;break}else if(M.value==="<")break;M=l.stepBackward(),S++}for(var R=0;R<S;R++)l.stepForward()}}while(r&&s<=0);if($&&A&&h&&b&&T&&y)return{openTag:new g($.start.row,$.start.column,A.end.row,A.end.column),closeTag:new g(h.start.row,h.start.column,b.end.row,b.end.column),openTagName:T,closeTagName:y}}}}n.BracketMatch=m}),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/line_widgets","ace/document","ace/background_tokenizer","ace/search_highlight","ace/undomanager","ace/edit_session/folding","ace/edit_session/bracket_match"],function(t,n,p){var d=t("./lib/oop"),g=t("./lib/lang"),m=t("./bidihandler").BidiHandler,l=t("./config"),f=t("./lib/event_emitter").EventEmitter,r=t("./selection").Selection,o=t("./mode/text").Mode,s=t("./range").Range,a=t("./line_widgets").LineWidgets,i=t("./document").Document,u=t("./background_tokenizer").BackgroundTokenizer,h=t("./search_highlight").SearchHighlight,y=t("./undomanager").UndoManager,b=(function(){function w(v,C){this.doc,this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$editor=null,this.prevOp={},this.$foldData=[],this.id="session"+ ++w.$uid,this.$foldData.toString=function(){return this.join(`
1360
- `)},this.bgTokenizer=new u(new o().getTokenizer(),this);var E=this;this.bgTokenizer.on("update",function(x){E._signal("tokenizerUpdate",x)}),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),(typeof v!="object"||!v.getLine)&&(v=new i(v)),this.setDocument(v),this.selection=new r(this),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.selection.on("changeCursor",this.$onSelectionChange),this.$bidiHandler=new m(this),l.resetOptions(this),this.setMode(C),l._signal("session",this),this.destroyed=!1,this.$initOperationListeners()}return w.prototype.$initOperationListeners=function(){var v=this;this.curOp=null,this.on("change",function(){v.curOp||(v.startOperation(),v.curOp.selectionBefore=v.$lastSel),v.curOp.docChanged=!0},!0),this.on("changeSelection",function(){v.curOp||(v.startOperation(),v.curOp.selectionBefore=v.$lastSel),v.curOp.selectionChanged=!0},!0),this.$operationResetTimer=g.delayedCall(this.endOperation.bind(this,!0))},w.prototype.startOperation=function(v){if(this.curOp){if(!v||this.curOp.command)return;this.prevOp=this.curOp}v||(v={}),this.$operationResetTimer.schedule(),this.curOp={command:v.command||{},args:v.args},this.curOp.selectionBefore=this.selection.toJSON(),this._signal("startOperation",v)},w.prototype.endOperation=function(v){if(this.curOp){if(v&&v.returnValue===!1){this.curOp=null,this._signal("endOperation",v);return}if(v==!0&&this.curOp.command&&this.curOp.command.name=="mouse")return;var C=this.selection.toJSON();this.curOp.selectionAfter=C,this.$lastSel=this.selection.toJSON(),this.getUndoManager().addSelection(C),this._signal("beforeEndOperation"),this.prevOp=this.curOp,this.curOp=null,this._signal("endOperation",v)}},w.prototype.setDocument=function(v){this.doc&&this.doc.off("change",this.$onChange),this.doc=v,v.on("change",this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},w.prototype.getDocument=function(){return this.doc},Object.defineProperty(w.prototype,"widgetManager",{get:function(){var v=new a(this);return this.widgetManager=v,this.$editor&&v.attach(this.$editor),v},set:function(v){Object.defineProperty(this,"widgetManager",{writable:!0,enumerable:!0,configurable:!0,value:v})},enumerable:!1,configurable:!0}),w.prototype.$resetRowCache=function(v){if(!v){this.$docRowCache=[],this.$screenRowCache=[];return}var C=this.$docRowCache.length,E=this.$getRowCacheIndex(this.$docRowCache,v)+1;C>E&&(this.$docRowCache.splice(E,C),this.$screenRowCache.splice(E,C))},w.prototype.$getRowCacheIndex=function(v,C){for(var E=0,x=v.length-1;E<=x;){var k=E+x>>1,O=v[k];if(C>O)E=k+1;else if(C<O)x=k-1;else return k}return E-1},w.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0)},w.prototype.onChangeFold=function(v){var C=v.data;this.$resetRowCache(C.start.row)},w.prototype.onChange=function(v){this.$modified=!0,this.$bidiHandler.onChange(v),this.$resetRowCache(v.start.row);var C=this.$updateInternalDataOnChange(v);!this.$fromUndo&&this.$undoManager&&(C&&C.length&&(this.$undoManager.add({action:"removeFolds",folds:C},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(v,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange(v),this._signal("change",v)},w.prototype.onSelectionChange=function(){this._signal("changeSelection")},w.prototype.setValue=function(v){this.doc.setValue(v),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},w.fromJSON=function(v){typeof v=="string"&&(v=JSON.parse(v));var C=new y;C.$undoStack=v.history.undo,C.$redoStack=v.history.redo,C.mark=v.history.mark,C.$rev=v.history.rev;var E=new w(v.value);return v.folds.forEach(function(x){E.addFold("...",s.fromPoints(x.start,x.end))}),E.setAnnotations(v.annotations),E.setBreakpoints(v.breakpoints),E.setMode(v.mode),E.setScrollLeft(v.scrollLeft),E.setScrollTop(v.scrollTop),E.setUndoManager(C),E.selection.fromJSON(v.selection),E},w.prototype.toJSON=function(){return{annotations:this.$annotations,breakpoints:this.$breakpoints,folds:this.getAllFolds().map(function(v){return v.range}),history:this.getUndoManager(),mode:this.$mode.$id,scrollLeft:this.$scrollLeft,scrollTop:this.$scrollTop,selection:this.selection.toJSON(),value:this.doc.getValue()}},w.prototype.toString=function(){return this.doc.getValue()},w.prototype.getSelection=function(){return this.selection},w.prototype.getState=function(v){return this.bgTokenizer.getState(v)},w.prototype.getTokens=function(v){return this.bgTokenizer.getTokens(v)},w.prototype.getTokenAt=function(v,C){var E=this.bgTokenizer.getTokens(v),x,k=0;if(C==null){var O=E.length-1;k=this.getLine(v).length}else for(var O=0;O<E.length&&(k+=E[O].value.length,!(k>=C));O++);return x=E[O],x?(x.index=O,x.start=k-x.value.length,x):null},w.prototype.setUndoManager=function(v){if(this.$undoManager=v,this.$informUndoManager&&this.$informUndoManager.cancel(),v){var C=this;v.addSession(this),this.$syncInformUndoManager=function(){C.$informUndoManager.cancel(),C.mergeUndoDeltas=!1},this.$informUndoManager=g.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},w.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},w.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},w.prototype.getTabString=function(){return this.getUseSoftTabs()?g.stringRepeat(" ",this.getTabSize()):" "},w.prototype.setUseSoftTabs=function(v){this.setOption("useSoftTabs",v)},w.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},w.prototype.setTabSize=function(v){this.setOption("tabSize",v)},w.prototype.getTabSize=function(){return this.$tabSize},w.prototype.isTabStop=function(v){return this.$useSoftTabs&&v.column%this.$tabSize===0},w.prototype.setNavigateWithinSoftTabs=function(v){this.setOption("navigateWithinSoftTabs",v)},w.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},w.prototype.setOverwrite=function(v){this.setOption("overwrite",v)},w.prototype.getOverwrite=function(){return this.$overwrite},w.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},w.prototype.addGutterDecoration=function(v,C){this.$decorations[v]||(this.$decorations[v]=""),this.$decorations[v]+=" "+C,this._signal("changeBreakpoint",{})},w.prototype.removeGutterDecoration=function(v,C){this.$decorations[v]=(this.$decorations[v]||"").replace(" "+C,""),this._signal("changeBreakpoint",{})},w.prototype.getBreakpoints=function(){return this.$breakpoints},w.prototype.setBreakpoints=function(v){this.$breakpoints=[];for(var C=0;C<v.length;C++)this.$breakpoints[v[C]]="ace_breakpoint";this._signal("changeBreakpoint",{})},w.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},w.prototype.setBreakpoint=function(v,C){C===void 0&&(C="ace_breakpoint"),C?this.$breakpoints[v]=C:delete this.$breakpoints[v],this._signal("changeBreakpoint",{})},w.prototype.clearBreakpoint=function(v){delete this.$breakpoints[v],this._signal("changeBreakpoint",{})},w.prototype.addMarker=function(v,C,E,x){var k=this.$markerId++,O={range:v,type:E||"line",renderer:typeof E=="function"?E:null,clazz:C,inFront:!!x,id:k};return x?(this.$frontMarkers[k]=O,this._signal("changeFrontMarker")):(this.$backMarkers[k]=O,this._signal("changeBackMarker")),k},w.prototype.addDynamicMarker=function(v,C){if(v.update){var E=this.$markerId++;return v.id=E,v.inFront=!!C,C?(this.$frontMarkers[E]=v,this._signal("changeFrontMarker")):(this.$backMarkers[E]=v,this._signal("changeBackMarker")),v}},w.prototype.removeMarker=function(v){var C=this.$frontMarkers[v]||this.$backMarkers[v];if(C){var E=C.inFront?this.$frontMarkers:this.$backMarkers;delete E[v],this._signal(C.inFront?"changeFrontMarker":"changeBackMarker")}},w.prototype.getMarkers=function(v){return v?this.$frontMarkers:this.$backMarkers},w.prototype.highlight=function(v){if(!this.$searchHighlight){var C=new h(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(C)}this.$searchHighlight.setRegexp(v)},w.prototype.highlightLines=function(v,C,E,x){typeof C!="number"&&(E=C,C=v),E||(E="ace_step");var k=new s(v,0,C,1/0);return k.id=this.addMarker(k,E,"fullLine",x),k},w.prototype.setAnnotations=function(v){this.$annotations=v,this._signal("changeAnnotation",{})},w.prototype.getAnnotations=function(){return this.$annotations||[]},w.prototype.clearAnnotations=function(){this.setAnnotations([])},w.prototype.$detectNewLine=function(v){var C=v.match(/^.*?(\r?\n)/m);C?this.$autoNewLine=C[1]:this.$autoNewLine=`
1361
- `},w.prototype.getWordRange=function(v,C){var E=this.getLine(v),x=!1;if(C>0&&(x=!!E.charAt(C-1).match(this.tokenRe)),x||(x=!!E.charAt(C).match(this.tokenRe)),x)var k=this.tokenRe;else if(/^\s+$/.test(E.slice(C-1,C+1)))var k=/\s/;else var k=this.nonTokenRe;var O=C;if(O>0){do O--;while(O>=0&&E.charAt(O).match(k));O++}for(var D=C;D<E.length&&E.charAt(D).match(k);)D++;return new s(v,O,v,D)},w.prototype.getAWordRange=function(v,C){for(var E=this.getWordRange(v,C),x=this.getLine(E.end.row);x.charAt(E.end.column).match(/[ \t]/);)E.end.column+=1;return E},w.prototype.setNewLineMode=function(v){this.doc.setNewLineMode(v)},w.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},w.prototype.setUseWorker=function(v){this.setOption("useWorker",v)},w.prototype.getUseWorker=function(){return this.$useWorker},w.prototype.onReloadTokenizer=function(v){var C=v.data;this.bgTokenizer.start(C.first),this._signal("tokenizerUpdate",v)},w.prototype.setMode=function(v,C){if(v&&typeof v=="object"){if(v.getTokenizer)return this.$onChangeMode(v);var E=v,x=E.path}else x=v||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new o),this.$modes[x]&&!E){this.$onChangeMode(this.$modes[x]),C&&C();return}this.$modeId=x,l.loadModule(["mode",x],(function(k){if(this.$modeId!==x)return C&&C();this.$modes[x]&&!E?this.$onChangeMode(this.$modes[x]):k&&k.Mode&&(k=new k.Mode(E),E||(this.$modes[x]=k,k.$id=x),this.$onChangeMode(k)),C&&C()}).bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},w.prototype.$onChangeMode=function(v,C){if(C||(this.$modeId=v.$id),this.$mode!==v){var E=this.$mode;this.$mode=v,this.$stopWorker(),this.$useWorker&&this.$startWorker();var x=v.getTokenizer();if(x.on!==void 0){var k=this.onReloadTokenizer.bind(this);x.on("update",k)}this.bgTokenizer.setTokenizer(x),this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=v.tokenRe,this.nonTokenRe=v.nonTokenRe,C||(v.attachToSession&&v.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(v.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:E,mode:v}))}},w.prototype.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},w.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(v){l.warn("Could not load worker",v),this.$worker=null}},w.prototype.getMode=function(){return this.$mode},w.prototype.setScrollTop=function(v){this.$scrollTop===v||isNaN(v)||(this.$scrollTop=v,this._signal("changeScrollTop",v))},w.prototype.getScrollTop=function(){return this.$scrollTop},w.prototype.setScrollLeft=function(v){this.$scrollLeft===v||isNaN(v)||(this.$scrollLeft=v,this._signal("changeScrollLeft",v))},w.prototype.getScrollLeft=function(){return this.$scrollLeft},w.prototype.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},w.prototype.getLineWidgetMaxWidth=function(){if(this.lineWidgetsWidth!=null)return this.lineWidgetsWidth;var v=0;return this.lineWidgets.forEach(function(C){C&&C.screenWidth>v&&(v=C.screenWidth)}),this.lineWidgetWidth=v},w.prototype.$computeWidth=function(v){if(this.$modified||v){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var C=this.doc.getAllLines(),E=this.$rowLengthCache,x=0,k=0,O=this.$foldData[k],D=O?O.start.row:1/0,N=C.length,P=0;P<N;P++){if(P>D){if(P=O.end.row+1,P>=N)break;O=this.$foldData[k++],D=O?O.start.row:1/0}E[P]==null&&(E[P]=this.$getStringScreenWidth(C[P])[0]),E[P]>x&&(x=E[P])}this.screenWidth=x}},w.prototype.getLine=function(v){return this.doc.getLine(v)},w.prototype.getLines=function(v,C){return this.doc.getLines(v,C)},w.prototype.getLength=function(){return this.doc.getLength()},w.prototype.getTextRange=function(v){return this.doc.getTextRange(v||this.selection.getRange())},w.prototype.insert=function(v,C){return this.doc.insert(v,C)},w.prototype.remove=function(v){return this.doc.remove(v)},w.prototype.removeFullLines=function(v,C){return this.doc.removeFullLines(v,C)},w.prototype.undoChanges=function(v,C){if(v.length){this.$fromUndo=!0;for(var E=v.length-1;E!=-1;E--){var x=v[E];x.action=="insert"||x.action=="remove"?this.doc.revertDelta(x):x.folds&&this.addFolds(x.folds)}!C&&this.$undoSelect&&(v.selectionBefore?this.selection.fromJSON(v.selectionBefore):this.selection.setRange(this.$getUndoSelection(v,!0))),this.$fromUndo=!1}},w.prototype.redoChanges=function(v,C){if(v.length){this.$fromUndo=!0;for(var E=0;E<v.length;E++){var x=v[E];(x.action=="insert"||x.action=="remove")&&this.doc.$safeApplyDelta(x)}!C&&this.$undoSelect&&(v.selectionAfter?this.selection.fromJSON(v.selectionAfter):this.selection.setRange(this.$getUndoSelection(v,!1))),this.$fromUndo=!1}},w.prototype.setUndoSelect=function(v){this.$undoSelect=v},w.prototype.$getUndoSelection=function(v,C){function E(N){return C?N.action!=="insert":N.action==="insert"}for(var x,k,O=0;O<v.length;O++){var D=v[O];if(D.start){if(!x){E(D)?x=s.fromPoints(D.start,D.end):x=s.fromPoints(D.start,D.start);continue}E(D)?(k=D.start,x.compare(k.row,k.column)==-1&&x.setStart(k),k=D.end,x.compare(k.row,k.column)==1&&x.setEnd(k)):(k=D.start,x.compare(k.row,k.column)==-1&&(x=s.fromPoints(D.start,D.start)))}}return x},w.prototype.replace=function(v,C){return this.doc.replace(v,C)},w.prototype.moveText=function(v,C,E){var x=this.getTextRange(v),k=this.getFoldsInRange(v),O=s.fromPoints(C,C);if(!E){this.remove(v);var D=v.start.row-v.end.row,N=D?-v.end.column:v.start.column-v.end.column;N&&(O.start.row==v.end.row&&O.start.column>v.end.column&&(O.start.column+=N),O.end.row==v.end.row&&O.end.column>v.end.column&&(O.end.column+=N)),D&&O.start.row>=v.end.row&&(O.start.row+=D,O.end.row+=D)}if(O.end=this.insert(O.start,x),k.length){var P=v.start,z=O.start,D=z.row-P.row,N=z.column-P.column;this.addFolds(k.map(function(H){return H=H.clone(),H.start.row==P.row&&(H.start.column+=N),H.end.row==P.row&&(H.end.column+=N),H.start.row+=D,H.end.row+=D,H}))}return O},w.prototype.indentRows=function(v,C,E){E=E.replace(/\t/g,this.getTabString());for(var x=v;x<=C;x++)this.doc.insertInLine({row:x,column:0},E)},w.prototype.outdentRows=function(v){for(var C=v.collapseRows(),E=new s(0,0,0,0),x=this.getTabSize(),k=C.start.row;k<=C.end.row;++k){var O=this.getLine(k);E.start.row=k,E.end.row=k;for(var D=0;D<x&&O.charAt(D)==" ";++D);D<x&&O.charAt(D)==" "?(E.start.column=D,E.end.column=D+1):(E.start.column=0,E.end.column=D),this.remove(E)}},w.prototype.$moveLines=function(v,C,E){if(v=this.getRowFoldStart(v),C=this.getRowFoldEnd(C),E<0){var x=this.getRowFoldStart(v+E);if(x<0)return 0;var k=x-v}else if(E>0){var x=this.getRowFoldEnd(C+E);if(x>this.doc.getLength()-1)return 0;var k=x-C}else{v=this.$clipRowToDocument(v),C=this.$clipRowToDocument(C);var k=C-v+1}var O=new s(v,0,C,Number.MAX_VALUE),D=this.getFoldsInRange(O).map(function(P){return P=P.clone(),P.start.row+=k,P.end.row+=k,P}),N=E==0?this.doc.getLines(v,C):this.doc.removeFullLines(v,C);return this.doc.insertFullLines(v+k,N),D.length&&this.addFolds(D),k},w.prototype.moveLinesUp=function(v,C){return this.$moveLines(v,C,-1)},w.prototype.moveLinesDown=function(v,C){return this.$moveLines(v,C,1)},w.prototype.duplicateLines=function(v,C){return this.$moveLines(v,C,0)},w.prototype.$clipRowToDocument=function(v){return Math.max(0,Math.min(v,this.doc.getLength()-1))},w.prototype.$clipColumnToRow=function(v,C){return C<0?0:Math.min(this.doc.getLine(v).length,C)},w.prototype.$clipPositionToDocument=function(v,C){if(C=Math.max(0,C),v<0)v=0,C=0;else{var E=this.doc.getLength();v>=E?(v=E-1,C=this.doc.getLine(E-1).length):C=Math.min(this.doc.getLine(v).length,C)}return{row:v,column:C}},w.prototype.$clipRangeToDocument=function(v){v.start.row<0?(v.start.row=0,v.start.column=0):v.start.column=this.$clipColumnToRow(v.start.row,v.start.column);var C=this.doc.getLength()-1;return v.end.row>C?(v.end.row=C,v.end.column=this.doc.getLine(C).length):v.end.column=this.$clipColumnToRow(v.end.row,v.end.column),v},w.prototype.setUseWrapMode=function(v){if(v!=this.$useWrapMode){if(this.$useWrapMode=v,this.$modified=!0,this.$resetRowCache(0),v){var C=this.getLength();this.$wrapData=Array(C),this.$updateWrapData(0,C-1)}this._signal("changeWrapMode")}},w.prototype.getUseWrapMode=function(){return this.$useWrapMode},w.prototype.setWrapLimitRange=function(v,C){(this.$wrapLimitRange.min!==v||this.$wrapLimitRange.max!==C)&&(this.$wrapLimitRange={min:v,max:C},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},w.prototype.adjustWrapLimit=function(v,C){var E=this.$wrapLimitRange;E.max<0&&(E={min:C,max:C});var x=this.$constrainWrapLimit(v,E.min,E.max);return x!=this.$wrapLimit&&x>1?(this.$wrapLimit=x,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},w.prototype.$constrainWrapLimit=function(v,C,E){return C&&(v=Math.max(C,v)),E&&(v=Math.min(E,v)),v},w.prototype.getWrapLimit=function(){return this.$wrapLimit},w.prototype.setWrapLimit=function(v){this.setWrapLimitRange(v,v)},w.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},w.prototype.$updateInternalDataOnChange=function(v){var C=this.$useWrapMode,E=v.action,x=v.start,k=v.end,O=x.row,D=k.row,N=D-O,P=null;if(this.$updating=!0,N!=0)if(E==="remove"){this[C?"$wrapData":"$rowLengthCache"].splice(O,N);var z=this.$foldData;P=this.getFoldsInRange(v),this.removeFolds(P);var F=this.getFoldLine(k.row),W=0;if(F){F.addRemoveChars(k.row,k.column,x.column-k.column),F.shiftRow(-N);var H=this.getFoldLine(O);H&&H!==F&&(H.merge(F),F=H),W=z.indexOf(F)+1}for(W;W<z.length;W++){var F=z[W];F.start.row>=k.row&&F.shiftRow(-N)}D=O}else{var B=Array(N);B.unshift(O,0);var G=C?this.$wrapData:this.$rowLengthCache;G.splice.apply(G,B);var z=this.$foldData,F=this.getFoldLine(O),W=0;if(F){var q=F.range.compareInside(x.row,x.column);q==0?(F=F.split(x.row,x.column),F&&(F.shiftRow(N),F.addRemoveChars(D,0,k.column-x.column))):q==-1&&(F.addRemoveChars(O,0,k.column-x.column),F.shiftRow(N)),W=z.indexOf(F)+1}for(W;W<z.length;W++){var F=z[W];F.start.row>=O&&F.shiftRow(N)}}else{N=Math.abs(v.start.column-v.end.column),E==="remove"&&(P=this.getFoldsInRange(v),this.removeFolds(P),N=-N);var F=this.getFoldLine(O);F&&F.addRemoveChars(O,x.column,N)}return C&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,C?this.$updateWrapData(O,D):this.$updateRowLengthCache(O,D),P},w.prototype.$updateRowLengthCache=function(v,C){this.$rowLengthCache[v]=null,this.$rowLengthCache[C]=null},w.prototype.$updateWrapData=function(v,C){var E=this.doc.getAllLines(),x=this.getTabSize(),k=this.$wrapData,O=this.$wrapLimit,D,N,P=v;for(C=Math.min(C,E.length-1);P<=C;)N=this.getFoldLine(P,N),N?(D=[],N.walk((function(z,F,W,H){var B;if(z!=null){B=this.$getDisplayTokens(z,D.length),B[0]=A;for(var G=1;G<B.length;G++)B[G]=S}else B=this.$getDisplayTokens(E[F].substring(H,W),D.length);D=D.concat(B)}).bind(this),N.end.row,E[N.end.row].length+1),k[N.start.row]=this.$computeWrapSplits(D,O,x),P=N.end.row+1):(D=this.$getDisplayTokens(E[P]),k[P]=this.$computeWrapSplits(D,O,x),P++)},w.prototype.$computeWrapSplits=function(v,C,E){if(v.length==0)return[];var x=[],k=v.length,O=0,D=0,N=this.$wrapAsCode,P=this.$indentedSoftWrap,z=C<=Math.max(2*E,8)||P===!1?0:Math.floor(C/2);function F(){var q=0;if(z===0)return q;if(P)for(var Y=0;Y<v.length;Y++){var V=v[Y];if(V==R)q+=1;else if(V==L)q+=E;else{if(V==_)continue;break}}return N&&P!==!1&&(q+=E),Math.min(q,z)}function W(q){for(var Y=q-O,V=O;V<q;V++){var Z=v[V];(Z===12||Z===2)&&(Y-=1)}x.length||(H=F(),x.indent=H),D+=Y,x.push(D),O=q}for(var H=0;k-O>C-H;){var B=O+C-H;if(v[B-1]>=R&&v[B]>=R){W(B);continue}if(v[B]==A||v[B]==S){for(B;B!=O-1&&v[B]!=A;B--);if(B>O){W(B);continue}for(B=O+C,B;B<v.length&&v[B]==S;B++);if(B==v.length)break;W(B);continue}for(var G=Math.max(B-(C-(C>>2)),O-1);B>G&&v[B]<A;)B--;if(N){for(;B>G&&v[B]<A;)B--;for(;B>G&&v[B]==M;)B--}else for(;B>G&&v[B]<R;)B--;if(B>G){W(++B);continue}B=O+C,v[B]==$&&B--,W(B-H)}return x},w.prototype.$getDisplayTokens=function(v,C){var E=[],x;C=C||0;for(var k=0;k<v.length;k++){var O=v.charCodeAt(k);if(O==9){x=this.getScreenTabSize(E.length+C),E.push(L);for(var D=1;D<x;D++)E.push(_)}else O==32?E.push(R):O>39&&O<48||O>57&&O<64?E.push(M):O>=4352&&I(O)?E.push(T,$):E.push(T)}return E},w.prototype.$getStringScreenWidth=function(v,C,E){if(C==0)return[0,0];C==null&&(C=1/0),E=E||0;var x,k;for(k=0;k<v.length&&(x=v.charCodeAt(k),x==9?E+=this.getScreenTabSize(E):x>=4352&&I(x)?E+=2:E+=1,!(E>C));k++);return[E,k]},w.prototype.getRowLength=function(v){var C=1;return this.lineWidgets&&(C+=this.lineWidgets[v]&&this.lineWidgets[v].rowCount||0),!this.$useWrapMode||!this.$wrapData[v]?C:this.$wrapData[v].length+C},w.prototype.getRowLineCount=function(v){return!this.$useWrapMode||!this.$wrapData[v]?1:this.$wrapData[v].length+1},w.prototype.getRowWrapIndent=function(v){if(this.$useWrapMode){var C=this.screenToDocumentPosition(v,Number.MAX_VALUE),E=this.$wrapData[C.row];return E.length&&E[0]<C.column?E.indent:0}else return 0},w.prototype.getScreenLastRowColumn=function(v){var C=this.screenToDocumentPosition(v,Number.MAX_VALUE);return this.documentToScreenColumn(C.row,C.column)},w.prototype.getDocumentLastRowColumn=function(v,C){var E=this.documentToScreenRow(v,C);return this.getScreenLastRowColumn(E)},w.prototype.getDocumentLastRowColumnPosition=function(v,C){var E=this.documentToScreenRow(v,C);return this.screenToDocumentPosition(E,Number.MAX_VALUE/10)},w.prototype.getRowSplitData=function(v){if(this.$useWrapMode)return this.$wrapData[v]},w.prototype.getScreenTabSize=function(v){return this.$tabSize-(v%this.$tabSize|0)},w.prototype.screenToDocumentRow=function(v,C){return this.screenToDocumentPosition(v,C).row},w.prototype.screenToDocumentColumn=function(v,C){return this.screenToDocumentPosition(v,C).column},w.prototype.screenToDocumentPosition=function(v,C,E){if(v<0)return{row:0,column:0};var x,k=0,O=0,D,N=0,P=0,z=this.$screenRowCache,F=this.$getRowCacheIndex(z,v),W=z.length;if(W&&F>=0)var N=z[F],k=this.$docRowCache[F],H=v>z[W-1];else var H=!W;for(var B=this.getLength()-1,G=this.getNextFoldLine(k),q=G?G.start.row:1/0;N<=v&&(P=this.getRowLength(k),!(N+P>v||k>=B));)N+=P,k++,k>q&&(k=G.end.row+1,G=this.getNextFoldLine(k,G),q=G?G.start.row:1/0),H&&(this.$docRowCache.push(k),this.$screenRowCache.push(N));if(G&&G.start.row<=k)x=this.getFoldDisplayLine(G),k=G.start.row;else{if(N+P<=v||k>B)return{row:B,column:this.getLine(B).length};x=this.getLine(k),G=null}var Y=0,V=Math.floor(v-N);if(this.$useWrapMode){var Z=this.$wrapData[k];Z&&(D=Z[V],V>0&&Z.length&&(Y=Z.indent,O=Z[V-1]||Z[Z.length-1],x=x.substring(O)))}return E!==void 0&&this.$bidiHandler.isBidiRow(N+V,k,V)&&(C=this.$bidiHandler.offsetToCol(E)),O+=this.$getStringScreenWidth(x,C-Y)[1],this.$useWrapMode&&O>=D&&(O=D-1),G?G.idxToPosition(O):{row:k,column:O}},w.prototype.documentToScreenPosition=function(v,C){if(typeof C>"u")var E=this.$clipPositionToDocument(v.row,v.column);else E=this.$clipPositionToDocument(v,C);v=E.row,C=E.column;var x=0,k=null,O=null;O=this.getFoldAt(v,C,1),O&&(v=O.start.row,C=O.start.column);var D,N=0,P=this.$docRowCache,z=this.$getRowCacheIndex(P,v),F=P.length;if(F&&z>=0)var N=P[z],x=this.$screenRowCache[z],W=v>P[F-1];else var W=!F;for(var H=this.getNextFoldLine(N),B=H?H.start.row:1/0;N<v;){if(N>=B){if(D=H.end.row+1,D>v)break;H=this.getNextFoldLine(D,H),B=H?H.start.row:1/0}else D=N+1;x+=this.getRowLength(N),N=D,W&&(this.$docRowCache.push(N),this.$screenRowCache.push(x))}var G="";H&&N>=B?(G=this.getFoldDisplayLine(H,v,C),k=H.start.row):(G=this.getLine(v).substring(0,C),k=v);var q=0;if(this.$useWrapMode){var Y=this.$wrapData[k];if(Y){for(var V=0;G.length>=Y[V];)x++,V++;G=G.substring(Y[V-1]||0,G.length),q=V>0?Y.indent:0}}return this.lineWidgets&&this.lineWidgets[N]&&this.lineWidgets[N].rowsAbove&&(x+=this.lineWidgets[N].rowsAbove),{row:x,column:q+this.$getStringScreenWidth(G)[0]}},w.prototype.documentToScreenColumn=function(v,C){return this.documentToScreenPosition(v,C).column},w.prototype.documentToScreenRow=function(v,C){return this.documentToScreenPosition(v,C).row},w.prototype.getScreenLength=function(){var v=0,C=null;if(this.$useWrapMode)for(var k=this.$wrapData.length,O=0,x=0,C=this.$foldData[x++],D=C?C.start.row:1/0;O<k;){var N=this.$wrapData[O];v+=N?N.length+1:1,O++,O>D&&(O=C.end.row+1,C=this.$foldData[x++],D=C?C.start.row:1/0)}else{v=this.getLength();for(var E=this.$foldData,x=0;x<E.length;x++)C=E[x],v-=C.end.row-C.start.row}return this.lineWidgets&&(v+=this.$getWidgetScreenLength()),v},w.prototype.$setFontMetrics=function(v){this.$enableVarChar&&(this.$getStringScreenWidth=function(C,E,x){if(E===0)return[0,0];E||(E=1/0),x=x||0;var k,O;for(O=0;O<C.length&&(k=C.charAt(O),k===" "?x+=this.getScreenTabSize(x):x+=v.getCharacterWidth(k),!(x>E));O++);return[x,O]})},w.prototype.getPrecedingCharacter=function(){var v=this.selection.getCursor();if(v.column===0)return v.row===0?"":this.doc.getNewLineCharacter();var C=this.getLine(v.row);return C[v.column-1]},w.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.endOperation(),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection&&(this.selection.off("changeCursor",this.$onSelectionChange),this.selection.off("changeSelection",this.$onSelectionChange)),this.selection.detach()},w})();b.$uid=0,b.prototype.$modes=l.$modes,b.prototype.getValue=b.prototype.toString,b.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},b.prototype.$overwrite=!1,b.prototype.$mode=null,b.prototype.$modeId=null,b.prototype.$scrollTop=0,b.prototype.$scrollLeft=0,b.prototype.$wrapLimit=80,b.prototype.$useWrapMode=!1,b.prototype.$wrapLimitRange={min:null,max:null},b.prototype.lineWidgets=null,b.prototype.isFullWidth=I,d.implement(b.prototype,f);var T=1,$=2,A=3,S=4,M=9,R=10,L=11,_=12;function I(w){return w<4352?!1:w>=4352&&w<=4447||w>=4515&&w<=4519||w>=4602&&w<=4607||w>=9001&&w<=9002||w>=11904&&w<=11929||w>=11931&&w<=12019||w>=12032&&w<=12245||w>=12272&&w<=12283||w>=12288&&w<=12350||w>=12353&&w<=12438||w>=12441&&w<=12543||w>=12549&&w<=12589||w>=12593&&w<=12686||w>=12688&&w<=12730||w>=12736&&w<=12771||w>=12784&&w<=12830||w>=12832&&w<=12871||w>=12880&&w<=13054||w>=13056&&w<=19903||w>=19968&&w<=42124||w>=42128&&w<=42182||w>=43360&&w<=43388||w>=44032&&w<=55203||w>=55216&&w<=55238||w>=55243&&w<=55291||w>=63744&&w<=64255||w>=65040&&w<=65049||w>=65072&&w<=65106||w>=65108&&w<=65126||w>=65128&&w<=65131||w>=65281&&w<=65376||w>=65504&&w<=65510}t("./edit_session/folding").Folding.call(b.prototype),t("./edit_session/bracket_match").BracketMatch.call(b.prototype),l.defineOptions(b.prototype,"session",{wrap:{set:function(w){if(!w||w=="off"?w=!1:w=="free"?w=!0:w=="printMargin"?w=-1:typeof w=="string"&&(w=parseInt(w,10)||!1),this.$wrap!=w)if(this.$wrap=w,!w)this.setUseWrapMode(!1);else{var v=typeof w=="number"?w:null;this.setWrapLimitRange(v,v),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(w){w=w=="auto"?this.$mode.type!="text":w!="text",w!=this.$wrapAsCode&&(this.$wrapAsCode=w,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(w){this.$useWorker=w,this.$stopWorker(),w&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(w){w=parseInt(w),w>0&&this.$tabSize!==w&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=w,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(w){this.setFoldStyle(w)},handlesSet:!0},overwrite:{set:function(w){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(w){this.doc.setNewLineMode(w)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(w){this.setMode(w)},get:function(){return this.$modeId},handlesSet:!0}}),n.EditSession=b}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(t,n,p){var d=t("./lib/lang"),g=t("./lib/oop"),m=t("./range").Range,l=(function(){function r(){this.$options={}}return r.prototype.set=function(o){return g.mixin(this.$options,o),this},r.prototype.getOptions=function(){return d.copyObject(this.$options)},r.prototype.setOptions=function(o){this.$options=o},r.prototype.find=function(o){var s=this.$options,a=this.$matchIterator(o,s);if(!a)return!1;var i=null;return a.forEach(function(u,h,y,b){return i=new m(u,h,y,b),h==b&&s.start&&s.start.start&&s.skipCurrent!=!1&&i.isEqual(s.start)?(i=null,!1):!0}),i},r.prototype.findAll=function(o){var s=this.$options;if(!s.needle)return[];this.$assembleRegExp(s);var a=s.range,i=a?o.getLines(a.start.row,a.end.row):o.doc.getAllLines(),u=[],h=s.re;if(s.$isMultiLine){var y=h.length,b=i.length-y,T;e:for(var $=h.offset||0;$<=b;$++){for(var A=0;A<y;A++)if(i[$+A].search(h[A])==-1)continue e;var S=i[$],M=i[$+y-1],R=S.length-S.match(h[0])[0].length,L=M.match(h[y-1])[0].length;T&&T.end.row===$&&T.end.column>R||(u.push(T=new m($,R,$+y-1,L)),y>2&&($=$+y-2))}}else for(var _=0;_<i.length;_++)for(var I=d.getMatchOffsets(i[_],h),A=0;A<I.length;A++){var w=I[A];u.push(new m(_,w.offset,_,w.offset+w.length))}if(a){for(var v=a.start.column,C=a.end.column,_=0,A=u.length-1;_<A&&u[_].start.column<v&&u[_].start.row==0;)_++;for(var E=a.end.row-a.start.row;_<A&&u[A].end.column>C&&u[A].end.row==E;)A--;for(u=u.slice(_,A+1),_=0,A=u.length;_<A;_++)u[_].start.row+=a.start.row,u[_].end.row+=a.start.row}return u},r.prototype.replace=function(o,s){var a=this.$options,i=this.$assembleRegExp(a);if(a.$isMultiLine)return s;if(i){var u=i.exec(o);if(!u||u[0].length!=o.length)return null;if(a.regExp||(s=s.replace(/\$/g,"$$$$")),s=o.replace(i,s),a.preserveCase){s=s.split("");for(var h=Math.min(o.length,o.length);h--;){var y=o[h];y&&y.toLowerCase()!=y?s[h]=s[h].toUpperCase():s[h]=s[h].toLowerCase()}s=s.join("")}return s}},r.prototype.$assembleRegExp=function(o,s){if(o.needle instanceof RegExp)return o.re=o.needle;var a=o.needle;if(!o.needle)return o.re=!1;o.regExp||(a=d.escapeRegExp(a));var i=o.caseSensitive?"gm":"gmi";try{new RegExp(a,"u"),o.$supportsUnicodeFlag=!0,i+="u"}catch{o.$supportsUnicodeFlag=!1}if(o.wholeWord&&(a=f(a,o)),o.$isMultiLine=!s&&/[\n\r]/.test(a),o.$isMultiLine)return o.re=this.$assembleMultilineRegExp(a,i);try{var u=new RegExp(a,i)}catch{u=!1}return o.re=u},r.prototype.$assembleMultilineRegExp=function(o,s){for(var a=o.replace(/\r\n|\r|\n/g,`$
1358
+ `):S=s(A.value)),A.start&&(S+=s(A)),(A.id||A.rev)&&(S+=" ("+(A.id||A.rev)+")"),S}function s(A){return A.start.row+":"+A.start.column+"=>"+A.end.row+":"+A.end.column}function a(A,S){var M=A.action=="insert",R=S.action=="insert";if(M&&R)if(c(S.start,A.end)>=0)h(S,A,-1);else if(c(S.start,A.start)<=0)h(A,S,1);else return null;else if(M&&!R)if(c(S.start,A.end)>=0)h(S,A,-1);else if(c(S.end,A.start)<=0)h(A,S,-1);else return null;else if(!M&&R)if(c(S.start,A.start)>=0)h(S,A,1);else if(c(S.start,A.start)<=0)h(A,S,1);else return null;else if(!M&&!R)if(c(S.start,A.start)>=0)h(S,A,1);else if(c(S.end,A.start)<=0)h(A,S,-1);else return null;return[S,A]}function i(A,S){for(var M=A.length;M--;)for(var R=0;R<S.length;R++)if(!a(A[M],S[R])){for(;M<A.length;){for(;R--;)a(S[R],A[M]);R=S.length,M++}return[A,S]}return A.selectionBefore=S.selectionBefore=A.selectionAfter=S.selectionAfter=null,[S,A]}function u(A,S){var M=A.action=="insert",R=S.action=="insert";if(M&&R)c(A.start,S.start)<0?h(S,A,1):h(A,S,1);else if(M&&!R)c(A.start,S.end)>=0?h(A,S,-1):(c(A.start,S.start)<=0||h(A,m.fromPoints(S.start,A.start),-1),h(S,A,1));else if(!M&&R)c(S.start,A.end)>=0?h(S,A,-1):(c(S.start,A.start)<=0||h(S,m.fromPoints(A.start,S.start),-1),h(A,S,1));else if(!M&&!R)if(c(S.start,A.end)>=0)h(S,A,-1);else if(c(S.end,A.start)<=0)h(A,S,-1);else{var L,_;return c(A.start,S.start)<0&&(L=A,A=b(A,S.start)),c(A.end,S.end)>0&&(_=b(A,S.end)),y(S.end,A.start,A.end,-1),_&&!L&&(A.lines=_.lines,A.start=_.start,A.end=_.end,_=A),[S,L,_].filter(Boolean)}return[S,A]}function h(A,S,M){y(A.start,S.start,S.end,M),y(A.end,S.start,S.end,M)}function y(A,S,M,R){A.row==(R==1?S:M).row&&(A.column+=R*(M.column-S.column)),A.row+=R*(M.row-S.row)}function b(A,S){var M=A.lines,R=A.end;A.end=f(S);var L=A.end.row-A.start.row,_=M.splice(L,M.length),O=L?S.column:S.column-A.start.column;M.push(_[0].substring(0,O)),_[0]=_[0].substr(O);var w={start:f(S),end:R,lines:_,action:A.action};return w}function T(A,S){S=r(S);for(var M=A.length;M--;){for(var R=A[M],L=0;L<R.length;L++){var _=R[L],O=u(_,S);S=O[0],O.length!=2&&(O[2]?(R.splice(L+1,1,O[1],O[2]),L++):O[1]||(R.splice(L,1),L--))}R.length||A.splice(M,1)}return A}function $(A,S){for(var M=0;M<S.length;M++)for(var R=S[M],L=0;L<R.length;L++)T(A,R[L])}n.UndoManager=d}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(t,n,p){var d=t("../range").Range,g=(function(){function m(c,f){this.foldData=c,Array.isArray(f)?this.folds=f:f=this.folds=[f];var r=f[f.length-1];this.range=new d(f[0].start.row,f[0].start.column,r.end.row,r.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(o){o.setFoldLine(this)},this)}return m.prototype.shiftRow=function(c){this.start.row+=c,this.end.row+=c,this.folds.forEach(function(f){f.start.row+=c,f.end.row+=c})},m.prototype.addFold=function(c){if(c.sameRow){if(c.start.row<this.startRow||c.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(c),this.folds.sort(function(f,r){return-f.range.compareEnd(r.start.row,r.start.column)}),this.range.compareEnd(c.start.row,c.start.column)>0?(this.end.row=c.end.row,this.end.column=c.end.column):this.range.compareStart(c.end.row,c.end.column)<0&&(this.start.row=c.start.row,this.start.column=c.start.column)}else if(c.start.row==this.end.row)this.folds.push(c),this.end.row=c.end.row,this.end.column=c.end.column;else if(c.end.row==this.start.row)this.folds.unshift(c),this.start.row=c.start.row,this.start.column=c.start.column;else throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");c.foldLine=this},m.prototype.containsRow=function(c){return c>=this.start.row&&c<=this.end.row},m.prototype.walk=function(c,f,r){var o=0,s=this.folds,a,i,u,h=!0;f==null&&(f=this.end.row,r=this.end.column);for(var y=0;y<s.length;y++){if(a=s[y],i=a.range.compareStart(f,r),i==-1){c(null,f,r,o,h);return}if(u=c(null,a.start.row,a.start.column,o,h),u=!u&&c(a.placeholder,a.start.row,a.start.column,o),u||i===0)return;h=!a.sameRow,o=a.end.column}c(null,f,r,o,h)},m.prototype.getNextFoldTo=function(c,f){for(var r,o,s=0;s<this.folds.length;s++){if(r=this.folds[s],o=r.range.compareEnd(c,f),o==-1)return{fold:r,kind:"after"};if(o===0)return{fold:r,kind:"inside"}}return null},m.prototype.addRemoveChars=function(c,f,r){var o=this.getNextFoldTo(c,f),s,a;if(o){if(s=o.fold,o.kind=="inside"&&s.start.column!=f&&s.start.row!=c)window.console&&window.console.log(c,f,s);else if(s.start.row==c){a=this.folds;var i=a.indexOf(s);for(i===0&&(this.start.column+=r),i;i<a.length;i++){if(s=a[i],s.start.column+=r,!s.sameRow)return;s.end.column+=r}this.end.column+=r}}},m.prototype.split=function(c,f){var r=this.getNextFoldTo(c,f);if(!r||r.kind=="inside")return null;var o=r.fold,s=this.folds,a=this.foldData,i=s.indexOf(o),u=s[i-1];this.end.row=u.end.row,this.end.column=u.end.column,s=s.splice(i,s.length-i);var h=new m(a,s);return a.splice(a.indexOf(this)+1,0,h),h},m.prototype.merge=function(c){for(var f=c.folds,r=0;r<f.length;r++)this.addFold(f[r]);var o=this.foldData;o.splice(o.indexOf(c),1)},m.prototype.toString=function(){var c=[this.range.toString()+": ["];return this.folds.forEach(function(f){c.push(" "+f.toString())}),c.push("]"),c.join(`
1359
+ `)},m.prototype.idxToPosition=function(c){for(var f=0,r=0;r<this.folds.length;r++){var o=this.folds[r];if(c-=o.start.column-f,c<0)return{row:o.start.row,column:o.start.column+c};if(c-=o.placeholder.length,c<0)return o.start;f=o.end.column}return{row:this.end.row,column:this.end.column+c}},m})();n.FoldLine=g}),ace.define("ace/range_list",["require","exports","module","ace/range"],function(t,n,p){var d=t("./range").Range,g=d.comparePoints,m=(function(){function c(){this.ranges=[],this.$bias=1}return c.prototype.pointIndex=function(f,r,o){for(var s=this.ranges,a=o||0;a<s.length;a++){var i=s[a],u=g(f,i.end);if(!(u>0)){var h=g(f,i.start);return u===0?r&&h!==0?-a-2:a:h>0||h===0&&!r?a:-a-1}}return-a-1},c.prototype.add=function(f){var r=!f.isEmpty(),o=this.pointIndex(f.start,r);o<0&&(o=-o-1);var s=this.pointIndex(f.end,r,o);return s<0?s=-s-1:s++,this.ranges.splice(o,s-o,f)},c.prototype.addList=function(f){for(var r=[],o=f.length;o--;)r.push.apply(r,this.add(f[o]));return r},c.prototype.substractPoint=function(f){var r=this.pointIndex(f);if(r>=0)return this.ranges.splice(r,1)},c.prototype.merge=function(){var f=[],r=this.ranges;r=r.sort(function(u,h){return g(u.start,h.start)});for(var o=r[0],s,a=1;a<r.length;a++){s=o,o=r[a];var i=g(s.end,o.start);i<0||i==0&&!s.isEmpty()&&!o.isEmpty()||(g(s.end,o.end)<0&&(s.end.row=o.end.row,s.end.column=o.end.column),r.splice(a,1),f.push(o),o=s,a--)}return this.ranges=r,f},c.prototype.contains=function(f,r){return this.pointIndex({row:f,column:r})>=0},c.prototype.containsPoint=function(f){return this.pointIndex(f)>=0},c.prototype.rangeAtPoint=function(f){var r=this.pointIndex(f);if(r>=0)return this.ranges[r]},c.prototype.clipRows=function(f,r){var o=this.ranges;if(o[0].start.row>r||o[o.length-1].start.row<f)return[];var s=this.pointIndex({row:f,column:0});s<0&&(s=-s-1);var a=this.pointIndex({row:r,column:0},s);a<0&&(a=-a-1);for(var i=[],u=s;u<a;u++)i.push(o[u]);return i},c.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},c.prototype.attach=function(f){this.session&&this.detach(),this.session=f,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},c.prototype.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},c.prototype.$onChange=function(f){for(var r=f.start,o=f.end,s=r.row,a=o.row,i=this.ranges,u=0,h=i.length;u<h;u++){var y=i[u];if(y.end.row>=s)break}if(f.action=="insert")for(var b=a-s,T=-r.column+o.column;u<h;u++){var y=i[u];if(y.start.row>s)break;if(y.start.row==s&&y.start.column>=r.column&&(y.start.column==r.column&&this.$bias<=0||(y.start.column+=T,y.start.row+=b)),y.end.row==s&&y.end.column>=r.column){if(y.end.column==r.column&&this.$bias<0)continue;y.end.column==r.column&&T>0&&u<h-1&&y.end.column>y.start.column&&y.end.column==i[u+1].start.column&&(y.end.column-=T),y.end.column+=T,y.end.row+=b}}else for(var b=s-a,T=r.column-o.column;u<h;u++){var y=i[u];if(y.start.row>a)break;y.end.row<a&&(s<y.end.row||s==y.end.row&&r.column<y.end.column)?(y.end.row=s,y.end.column=r.column):y.end.row==a?y.end.column<=o.column?(b||y.end.column>r.column)&&(y.end.column=r.column,y.end.row=r.row):(y.end.column+=T,y.end.row+=b):y.end.row>a&&(y.end.row+=b),y.start.row<a&&(s<y.start.row||s==y.start.row&&r.column<y.start.column)?(y.start.row=s,y.start.column=r.column):y.start.row==a?y.start.column<=o.column?(b||y.start.column>r.column)&&(y.start.column=r.column,y.start.row=r.row):(y.start.column+=T,y.start.row+=b):y.start.row>a&&(y.start.row+=b)}if(b!=0&&u<h)for(;u<h;u++){var y=i[u];y.start.row+=b,y.end.row+=b}},c})();m.prototype.comparePoints=g,n.RangeList=m}),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"],function(t,n,p){var d=this&&this.__extends||(function(){var s=function(a,i){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,h){u.__proto__=h}||function(u,h){for(var y in h)Object.prototype.hasOwnProperty.call(h,y)&&(u[y]=h[y])},s(a,i)};return function(a,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");s(a,i);function u(){this.constructor=a}a.prototype=i===null?Object.create(i):(u.prototype=i.prototype,new u)}})(),g=t("../range_list").RangeList,m=(function(s){d(a,s);function a(i,u){var h=s.call(this)||this;return h.foldLine=null,h.placeholder=u,h.range=i,h.start=i.start,h.end=i.end,h.sameRow=i.start.row==i.end.row,h.subFolds=h.ranges=[],h}return a.prototype.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},a.prototype.setFoldLine=function(i){this.foldLine=i,this.subFolds.forEach(function(u){u.setFoldLine(i)})},a.prototype.clone=function(){var i=this.range.clone(),u=new a(i,this.placeholder);return this.subFolds.forEach(function(h){u.subFolds.push(h.clone())}),u.collapseChildren=this.collapseChildren,u},a.prototype.addSubFold=function(i){if(!this.range.isEqual(i)){f(i,this.start);for(var T=i.start.row,$=i.start.column,u=0,h=-1;u<this.subFolds.length&&(h=this.subFolds[u].range.compare(T,$),h==1);u++);var y=this.subFolds[u],b=0;if(h==0){if(y.range.containsRange(i))return y.addSubFold(i);b=1}for(var T=i.range.end.row,$=i.range.end.column,A=u,h=-1;A<this.subFolds.length&&(h=this.subFolds[A].range.compare(T,$),h==1);A++);h==0&&A++;for(var S=this.subFolds.splice(u,A-u,i),M=h==0?S.length-1:S.length,R=b;R<M;R++)i.addSubFold(S[R]);return i.setFoldLine(this.foldLine),i}},a.prototype.restoreRange=function(i){return o(i,this.start)},a})(g);function c(s,a){s.row-=a.row,s.row==0&&(s.column-=a.column)}function f(s,a){c(s.start,a),c(s.end,a)}function r(s,a){s.row==0&&(s.column+=a.column),s.row+=a.row}function o(s,a){r(s.start,a),r(s.end,a)}n.Fold=m}),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator","ace/mouse/mouse_event"],function(t,n,p){var d=t("../range").Range,g=t("./fold_line").FoldLine,m=t("./fold").Fold,c=t("../token_iterator").TokenIterator,f=t("../mouse/mouse_event").MouseEvent;function r(){this.getFoldAt=function(o,s,a){var i=this.getFoldLine(o);if(!i)return null;for(var u=i.folds,h=0;h<u.length;h++){var y=u[h].range;if(y.contains(o,s)){if(a==1&&y.isEnd(o,s)&&!y.isEmpty())continue;if(a==-1&&y.isStart(o,s)&&!y.isEmpty())continue;return u[h]}}},this.getFoldsInRange=function(o){var s=o.start,a=o.end,i=this.$foldData,u=[];s.column+=1,a.column-=1;for(var h=0;h<i.length;h++){var y=i[h].range.compareRange(o);if(y!=2){if(y==-2)break;for(var b=i[h].folds,T=0;T<b.length;T++){var $=b[T];if(y=$.range.compareRange(o),y==-2)break;if(y==2)continue;if(y==42)break;u.push($)}}}return s.column-=1,a.column+=1,u},this.getFoldsInRangeList=function(o){if(Array.isArray(o)){var s=[];o.forEach(function(a){s=s.concat(this.getFoldsInRange(a))},this)}else var s=this.getFoldsInRange(o);return s},this.getAllFolds=function(){for(var o=[],s=this.$foldData,a=0;a<s.length;a++)for(var i=0;i<s[a].folds.length;i++)o.push(s[a].folds[i]);return o},this.getFoldStringAt=function(o,s,a,i){if(i=i||this.getFoldLine(o),!i)return null;for(var u={end:{column:0}},h,y,b=0;b<i.folds.length;b++){y=i.folds[b];var T=y.range.compareEnd(o,s);if(T==-1){h=this.getLine(y.start.row).substring(u.end.column,y.start.column);break}else if(T===0)return null;u=y}return h||(h=this.getLine(y.start.row).substring(u.end.column)),a==-1?h.substring(0,s-u.end.column):a==1?h.substring(s-u.end.column):h},this.getFoldLine=function(o,s){var a=this.$foldData,i=0;for(s&&(i=a.indexOf(s)),i==-1&&(i=0),i;i<a.length;i++){var u=a[i];if(u.start.row<=o&&u.end.row>=o)return u;if(u.end.row>o)return null}return null},this.getNextFoldLine=function(o,s){var a=this.$foldData,i=0;for(s&&(i=a.indexOf(s)),i==-1&&(i=0),i;i<a.length;i++){var u=a[i];if(u.end.row>=o)return u}return null},this.getFoldedRowCount=function(o,s){for(var a=this.$foldData,i=s-o+1,u=0;u<a.length;u++){var h=a[u],y=h.end.row,b=h.start.row;if(y>=s){b<s&&(b>=o?i-=s-b:i=0);break}else y>=o&&(b>=o?i-=y-b:i-=y-o+1)}return i},this.$addFoldLine=function(o){return this.$foldData.push(o),this.$foldData.sort(function(s,a){return s.start.row-a.start.row}),o},this.addFold=function(o,s){var a=this.$foldData,i=!1,u;o instanceof m?u=o:(u=new m(s,o),u.collapseChildren=s.collapseChildren),this.$clipRangeToDocument(u.range);var h=u.start.row,y=u.start.column,b=u.end.row,T=u.end.column,$=this.getFoldAt(h,y,1),A=this.getFoldAt(b,T,-1);if($&&A==$)return $.addSubFold(u);$&&!$.range.isStart(h,y)&&this.removeFold($),A&&!A.range.isEnd(b,T)&&this.removeFold(A);var S=this.getFoldsInRange(u.range);S.length>0&&(this.removeFolds(S),u.collapseChildren||S.forEach(function(_){u.addSubFold(_)}));for(var M=0;M<a.length;M++){var R=a[M];if(b==R.start.row){R.addFold(u),i=!0;break}else if(h==R.end.row){if(R.addFold(u),i=!0,!u.sameRow){var L=a[M+1];if(L&&L.start.row==b){R.merge(L);break}}break}else if(b<=R.start.row)break}return i||(R=this.$addFoldLine(new g(this.$foldData,u))),this.$useWrapMode?this.$updateWrapData(R.start.row,R.start.row):this.$updateRowLengthCache(R.start.row,R.start.row),this.$modified=!0,this._signal("changeFold",{data:u,action:"add"}),u},this.addFolds=function(o){o.forEach(function(s){this.addFold(s)},this)},this.removeFold=function(o){var s=o.foldLine,a=s.start.row,i=s.end.row,u=this.$foldData,h=s.folds;if(h.length==1)u.splice(u.indexOf(s),1);else if(s.range.isEnd(o.end.row,o.end.column))h.pop(),s.end.row=h[h.length-1].end.row,s.end.column=h[h.length-1].end.column;else if(s.range.isStart(o.start.row,o.start.column))h.shift(),s.start.row=h[0].start.row,s.start.column=h[0].start.column;else if(o.sameRow)h.splice(h.indexOf(o),1);else{var y=s.split(o.start.row,o.start.column);h=y.folds,h.shift(),y.start.row=h[0].start.row,y.start.column=h[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(a,i):this.$updateRowLengthCache(a,i)),this.$modified=!0,this._signal("changeFold",{data:o,action:"remove"})},this.removeFolds=function(o){for(var s=[],a=0;a<o.length;a++)s.push(o[a]);s.forEach(function(i){this.removeFold(i)},this),this.$modified=!0},this.expandFold=function(o){this.removeFold(o),o.subFolds.forEach(function(s){o.restoreRange(s),this.addFold(s)},this),o.collapseChildren>0&&this.foldAll(o.start.row+1,o.end.row,o.collapseChildren-1),o.subFolds=[]},this.expandFolds=function(o){o.forEach(function(s){this.expandFold(s)},this)},this.unfold=function(o,s){var a,i;if(o==null)a=new d(0,0,this.getLength(),0),s==null&&(s=!0);else if(typeof o=="number")a=new d(o,0,o,this.getLine(o).length);else if("row"in o)a=d.fromPoints(o,o);else{if(Array.isArray(o))return i=[],o.forEach(function(h){i=i.concat(this.unfold(h))},this),i;a=o}i=this.getFoldsInRangeList(a);for(var u=i;i.length==1&&d.comparePoints(i[0].start,a.start)<0&&d.comparePoints(i[0].end,a.end)>0;)this.expandFolds(i),i=this.getFoldsInRangeList(a);if(s!=!1?this.removeFolds(i):this.expandFolds(i),u.length)return u},this.isRowFolded=function(o,s){return!!this.getFoldLine(o,s)},this.getRowFoldEnd=function(o,s){var a=this.getFoldLine(o,s);return a?a.end.row:o},this.getRowFoldStart=function(o,s){var a=this.getFoldLine(o,s);return a?a.start.row:o},this.getFoldDisplayLine=function(o,s,a,i,u){i==null&&(i=o.start.row),u==null&&(u=0),s==null&&(s=o.end.row),a==null&&(a=this.getLine(s).length);var h=this.doc,y="";return o.walk(function(b,T,$,A){if(!(T<i)){if(T==i){if($<u)return;A=Math.max(u,A)}b!=null?y+=b:y+=h.getLine(T).substring(A,$)}},s,a),y},this.getDisplayLine=function(o,s,a,i){var u=this.getFoldLine(o);if(u)return this.getFoldDisplayLine(u,o,s,a,i);var h;return h=this.doc.getLine(o),h.substring(i||0,s||h.length)},this.$cloneFoldData=function(){var o=[];return o=this.$foldData.map(function(s){var a=s.folds.map(function(i){return i.clone()});return new g(o,a)}),o},this.toggleFold=function(o){var s=this.selection,a=s.getRange(),i,u;if(a.isEmpty()){var h=a.start;if(i=this.getFoldAt(h.row,h.column),i){this.expandFold(i);return}else(u=this.findMatchingBracket(h))?a.comparePoint(u)==1?a.end=u:(a.start=u,a.start.column++,a.end.column--):(u=this.findMatchingBracket({row:h.row,column:h.column+1}))?(a.comparePoint(u)==1?a.end=u:a.start=u,a.start.column++):a=this.getCommentFoldRange(h.row,h.column)||a}else{var y=this.getFoldsInRange(a);if(o&&y.length){this.expandFolds(y);return}else y.length==1&&(i=y[0])}if(i||(i=this.getFoldAt(a.start.row,a.start.column)),i&&i.range.toString()==a.toString()){this.expandFold(i);return}var b="...";if(!a.isMultiLine()){if(b=this.getTextRange(a),b.length<4)return;b=b.trim().substring(0,2)+".."}this.addFold(b,a)},this.getCommentFoldRange=function(o,s,a){var i=new c(this,o,s),u=i.getCurrentToken(),h=u&&u.type;if(u&&/^comment|string/.test(h)){h=h.match(/comment|string/)[0],h=="comment"&&(h+="|doc-start|\\.doc");var y=new RegExp(h),b=new d;if(a!=1){do u=i.stepBackward();while(u&&y.test(u.type));u=i.stepForward()}b.start.row=i.getCurrentTokenRow(),b.start.column=i.getCurrentTokenColumn()+u.value.length,i=new c(this,o,s);var T=this.getState(i.$row);if(a!=-1){var $=-1;do if(u=i.stepForward(),$==-1){var A=this.getState(i.$row);T.toString()!==A.toString()&&($=i.$row)}else if(i.$row>$)break;while(u&&y.test(u.type));u=i.stepBackward()}else u=i.getCurrentToken();return b.end.row=i.getCurrentTokenRow(),b.end.column=i.getCurrentTokenColumn(),b}},this.foldAll=function(o,s,a,i){a==null&&(a=1e5);var u=this.foldWidgets;if(u){s=s||this.getLength(),o=o||0;for(var h=o;h<s;h++)if(u[h]==null&&(u[h]=this.getFoldWidget(h)),u[h]=="start"&&!(i&&!i(h))){var y=this.getFoldWidgetRange(h);y&&y.isMultiLine()&&y.end.row<=s&&y.start.row>=o&&(h=y.end.row,y.collapseChildren=a,this.addFold("...",y))}}},this.foldToLevel=function(o){for(this.foldAll();o-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var o=this;this.foldAll(null,null,null,function(s){for(var a=o.getTokens(s),i=0;i<a.length;i++){var u=a[i];if(!(u.type=="text"&&/^\s+$/.test(u.value)))return!!/comment/.test(u.type)}})},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(o){if(!this.$foldStyles[o])throw new Error("invalid fold style: "+o+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=o){this.$foldStyle=o,o=="manual"&&this.unfold();var s=this.$foldMode;this.$setFolding(null),this.$setFolding(s)}},this.$setFolding=function(o){if(this.$foldMode!=o){if(this.$foldMode=o,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),!o||this.$foldStyle=="manual"){this.foldWidgets=null;return}this.foldWidgets=[],this.getFoldWidget=o.getFoldWidget.bind(o,this,this.$foldStyle),this.getFoldWidgetRange=o.getFoldWidgetRange.bind(o,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)}},this.getParentFoldRangeData=function(o,s){var a=this.foldWidgets;if(!a||s&&a[o])return{};for(var i=o-1,u;i>=0;){var h=a[i];if(h==null&&(h=a[i]=this.getFoldWidget(i)),h=="start"){var y=this.getFoldWidgetRange(i);if(u||(u=y),y&&y.end.row>=o)break}i--}return{range:i!==-1&&y,firstRange:u}},this.onFoldWidgetClick=function(o,s){s instanceof f&&(s=s.domEvent);var a={children:s.shiftKey,all:s.ctrlKey||s.metaKey,siblings:s.altKey},i=this.$toggleFoldWidget(o,a);if(!i){var u=s.target||s.srcElement;u&&/ace_fold-widget/.test(u.className)&&(u.className+=" ace_invalid")}},this.$toggleFoldWidget=function(o,s){if(this.getFoldWidget){var a=this.getFoldWidget(o),i=this.getLine(o),u=a==="end"?-1:1,h=this.getFoldAt(o,u===-1?0:i.length,u);if(h)return s.children||s.all?this.removeFold(h):this.expandFold(h),h;var y=this.getFoldWidgetRange(o,!0);if(y&&!y.isMultiLine()&&(h=this.getFoldAt(y.start.row,y.start.column,1),h&&y.isEqual(h.range)))return this.removeFold(h),h;if(s.siblings){var b=this.getParentFoldRangeData(o);if(b.range)var T=b.range.start.row+1,$=b.range.end.row;this.foldAll(T,$,s.all?1e4:0)}else s.children?($=y?y.end.row:this.getLength(),this.foldAll(o+1,$,s.all?1e4:0)):y&&(s.all&&(y.collapseChildren=1e4),this.addFold("...",y));return y}},this.toggleFoldWidget=function(o){var s=this.selection.getCursor().row;s=this.getRowFoldStart(s);var a=this.$toggleFoldWidget(s,{});if(!a){var i=this.getParentFoldRangeData(s,!0);if(a=i.range||i.firstRange,a){s=a.start.row;var u=this.getFoldAt(s,this.getLine(s).length,1);u?this.removeFold(u):this.addFold("...",a)}}},this.updateFoldWidgets=function(o){var s=o.start.row,a=o.end.row-s;if(a===0)this.foldWidgets[s]=null;else if(o.action=="remove")this.foldWidgets.splice(s,a+1,null);else{var i=Array(a+1);i.unshift(s,1),this.foldWidgets.splice.apply(this.foldWidgets,i)}},this.tokenizerUpdateFoldWidgets=function(o){var s=o.data;s.first!=s.last&&this.foldWidgets.length>s.first&&this.foldWidgets.splice(s.first,this.foldWidgets.length)}}n.Folding=r}),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],function(t,n,p){var d=t("../token_iterator").TokenIterator,g=t("../range").Range;function m(){this.findMatchingBracket=function(c,f){if(c.column==0)return null;var r=f||this.getLine(c.row).charAt(c.column-1);if(r=="")return null;var o=r.match(/([\(\[\{])|([\)\]\}])/);return o?o[1]?this.$findClosingBracket(o[1],c):this.$findOpeningBracket(o[2],c):null},this.getBracketRange=function(c){var f=this.getLine(c.row),r=!0,o,s=f.charAt(c.column-1),a=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(a||(s=f.charAt(c.column),c={row:c.row,column:c.column+1},a=s&&s.match(/([\(\[\{])|([\)\]\}])/),r=!1),!a)return null;if(a[1]){var i=this.$findClosingBracket(a[1],c);if(!i)return null;o=g.fromPoints(c,i),r||(o.end.column++,o.start.column--),o.cursor=o.end}else{var i=this.$findOpeningBracket(a[2],c);if(!i)return null;o=g.fromPoints(i,c),r||(o.start.column++,o.end.column--),o.cursor=o.start}return o},this.getMatchingBracketRanges=function(c,f){var r=this.getLine(c.row),o=/([\(\[\{])|([\)\]\}])/,s=!f&&r.charAt(c.column-1),a=s&&s.match(o);if(a||(s=(f===void 0||f)&&r.charAt(c.column),c={row:c.row,column:c.column+1},a=s&&s.match(o)),!a)return null;var i=new g(c.row,c.column-1,c.row,c.column),u=a[1]?this.$findClosingBracket(a[1],c):this.$findOpeningBracket(a[2],c);if(!u)return[i];var h=new g(u.row,u.column,u.row,u.column+1);return[i,h]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(c,f,r){var o=this.$brackets[c],s=1,a=new d(this,f.row,f.column),i=a.getCurrentToken();if(i||(i=a.stepForward()),!!i){r||(r=new RegExp("(\\.?"+i.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var u=f.column-a.getCurrentTokenColumn()-2,h=i.value;;){for(;u>=0;){var y=h.charAt(u);if(y==o){if(s-=1,s==0)return{row:a.getCurrentTokenRow(),column:u+a.getCurrentTokenColumn()}}else y==c&&(s+=1);u-=1}do i=a.stepBackward();while(i&&!r.test(i.type));if(i==null)break;h=i.value,u=h.length-1}return null}},this.$findClosingBracket=function(c,f,r){var o=this.$brackets[c],s=1,a=new d(this,f.row,f.column),i=a.getCurrentToken();if(i||(i=a.stepForward()),!!i){r||(r=new RegExp("(\\.?"+i.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var u=f.column-a.getCurrentTokenColumn();;){for(var h=i.value,y=h.length;u<y;){var b=h.charAt(u);if(b==o){if(s-=1,s==0)return{row:a.getCurrentTokenRow(),column:u+a.getCurrentTokenColumn()}}else b==c&&(s+=1);u+=1}do i=a.stepForward();while(i&&!r.test(i.type));if(i==null)break;u=0}return null}},this.getMatchingTags=function(c){var f=new d(this,c.row,c.column),r=this.$findTagName(f);if(r){var o=f.stepBackward();return o.value==="<"?this.$findClosingTag(f,r):this.$findOpeningTag(f,r)}},this.$findTagName=function(c){var f=c.getCurrentToken(),r=!1,o=!1;if(f&&f.type.indexOf("tag-name")===-1)do o?f=c.stepBackward():f=c.stepForward(),f&&(f.value==="/>"?o=!0:f.type.indexOf("tag-name")!==-1&&(r=!0));while(f&&!r);return f},this.$findClosingTag=function(c,f){var r,o=f.value,s=f.value,a=0,i=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);f=c.stepForward();var u=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+f.value.length),h=!1;do{if(r=f,r.type.indexOf("tag-close")!==-1&&!h){var y=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);h=!0}if(f=c.stepForward(),f){if(f.value===">"&&!h){var y=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);h=!0}if(f.type.indexOf("tag-name")!==-1){if(o=f.value,s===o){if(r.value==="<")a++;else if(r.value==="</"&&(a--,a<0)){c.stepBackward();var b=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+2);f=c.stepForward();var T=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+f.value.length);if(f.type.indexOf("tag-close")===-1&&(f=c.stepForward()),f&&f.value===">")var $=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);else return}}}else if(s===o&&f.value==="/>"&&(a--,a<0))var b=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+2),T=b,$=T,y=new g(u.end.row,u.end.column,u.end.row,u.end.column+1)}}while(f&&a>=0);if(i&&y&&b&&$&&u&&T)return{openTag:new g(i.start.row,i.start.column,y.end.row,y.end.column),closeTag:new g(b.start.row,b.start.column,$.end.row,$.end.column),openTagName:u,closeTagName:T}},this.$findOpeningTag=function(c,f){var r=c.getCurrentToken(),o=f.value,s=0,a=c.getCurrentTokenRow(),i=c.getCurrentTokenColumn(),u=i+2,h=new g(a,i,a,u);c.stepForward();var y=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+f.value.length);if(f.type.indexOf("tag-close")===-1&&(f=c.stepForward()),!(!f||f.value!==">")){var b=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);c.stepBackward(),c.stepBackward();do if(f=r,a=c.getCurrentTokenRow(),i=c.getCurrentTokenColumn(),u=i+f.value.length,r=c.stepBackward(),f){if(f.type.indexOf("tag-name")!==-1){if(o===f.value)if(r.value==="<"){if(s++,s>0){var T=new g(a,i,a,u),$=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);do f=c.stepForward();while(f&&f.value!==">");var A=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1)}}else r.value==="</"&&s--}else if(f.value==="/>"){for(var S=0,M=r;M;){if(M.type.indexOf("tag-name")!==-1&&M.value===o){s--;break}else if(M.value==="<")break;M=c.stepBackward(),S++}for(var R=0;R<S;R++)c.stepForward()}}while(r&&s<=0);if($&&A&&h&&b&&T&&y)return{openTag:new g($.start.row,$.start.column,A.end.row,A.end.column),closeTag:new g(h.start.row,h.start.column,b.end.row,b.end.column),openTagName:T,closeTagName:y}}}}n.BracketMatch=m}),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/line_widgets","ace/document","ace/background_tokenizer","ace/search_highlight","ace/undomanager","ace/edit_session/folding","ace/edit_session/bracket_match"],function(t,n,p){var d=t("./lib/oop"),g=t("./lib/lang"),m=t("./bidihandler").BidiHandler,c=t("./config"),f=t("./lib/event_emitter").EventEmitter,r=t("./selection").Selection,o=t("./mode/text").Mode,s=t("./range").Range,a=t("./line_widgets").LineWidgets,i=t("./document").Document,u=t("./background_tokenizer").BackgroundTokenizer,h=t("./search_highlight").SearchHighlight,y=t("./undomanager").UndoManager,b=(function(){function w(v,C){this.doc,this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$editor=null,this.prevOp={},this.$foldData=[],this.id="session"+ ++w.$uid,this.$foldData.toString=function(){return this.join(`
1360
+ `)},this.bgTokenizer=new u(new o().getTokenizer(),this);var E=this;this.bgTokenizer.on("update",function(x){E._signal("tokenizerUpdate",x)}),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),(typeof v!="object"||!v.getLine)&&(v=new i(v)),this.setDocument(v),this.selection=new r(this),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.selection.on("changeCursor",this.$onSelectionChange),this.$bidiHandler=new m(this),c.resetOptions(this),this.setMode(C),c._signal("session",this),this.destroyed=!1,this.$initOperationListeners()}return w.prototype.$initOperationListeners=function(){var v=this;this.curOp=null,this.on("change",function(){v.curOp||(v.startOperation(),v.curOp.selectionBefore=v.$lastSel),v.curOp.docChanged=!0},!0),this.on("changeSelection",function(){v.curOp||(v.startOperation(),v.curOp.selectionBefore=v.$lastSel),v.curOp.selectionChanged=!0},!0),this.$operationResetTimer=g.delayedCall(this.endOperation.bind(this,!0))},w.prototype.startOperation=function(v){if(this.curOp){if(!v||this.curOp.command)return;this.prevOp=this.curOp}v||(v={}),this.$operationResetTimer.schedule(),this.curOp={command:v.command||{},args:v.args},this.curOp.selectionBefore=this.selection.toJSON(),this._signal("startOperation",v)},w.prototype.endOperation=function(v){if(this.curOp){if(v&&v.returnValue===!1){this.curOp=null,this._signal("endOperation",v);return}if(v==!0&&this.curOp.command&&this.curOp.command.name=="mouse")return;var C=this.selection.toJSON();this.curOp.selectionAfter=C,this.$lastSel=this.selection.toJSON(),this.getUndoManager().addSelection(C),this._signal("beforeEndOperation"),this.prevOp=this.curOp,this.curOp=null,this._signal("endOperation",v)}},w.prototype.setDocument=function(v){this.doc&&this.doc.off("change",this.$onChange),this.doc=v,v.on("change",this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},w.prototype.getDocument=function(){return this.doc},Object.defineProperty(w.prototype,"widgetManager",{get:function(){var v=new a(this);return this.widgetManager=v,this.$editor&&v.attach(this.$editor),v},set:function(v){Object.defineProperty(this,"widgetManager",{writable:!0,enumerable:!0,configurable:!0,value:v})},enumerable:!1,configurable:!0}),w.prototype.$resetRowCache=function(v){if(!v){this.$docRowCache=[],this.$screenRowCache=[];return}var C=this.$docRowCache.length,E=this.$getRowCacheIndex(this.$docRowCache,v)+1;C>E&&(this.$docRowCache.splice(E,C),this.$screenRowCache.splice(E,C))},w.prototype.$getRowCacheIndex=function(v,C){for(var E=0,x=v.length-1;E<=x;){var k=E+x>>1,D=v[k];if(C>D)E=k+1;else if(C<D)x=k-1;else return k}return E-1},w.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0)},w.prototype.onChangeFold=function(v){var C=v.data;this.$resetRowCache(C.start.row)},w.prototype.onChange=function(v){this.$modified=!0,this.$bidiHandler.onChange(v),this.$resetRowCache(v.start.row);var C=this.$updateInternalDataOnChange(v);!this.$fromUndo&&this.$undoManager&&(C&&C.length&&(this.$undoManager.add({action:"removeFolds",folds:C},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(v,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange(v),this._signal("change",v)},w.prototype.onSelectionChange=function(){this._signal("changeSelection")},w.prototype.setValue=function(v){this.doc.setValue(v),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},w.fromJSON=function(v){typeof v=="string"&&(v=JSON.parse(v));var C=new y;C.$undoStack=v.history.undo,C.$redoStack=v.history.redo,C.mark=v.history.mark,C.$rev=v.history.rev;var E=new w(v.value);return v.folds.forEach(function(x){E.addFold("...",s.fromPoints(x.start,x.end))}),E.setAnnotations(v.annotations),E.setBreakpoints(v.breakpoints),E.setMode(v.mode),E.setScrollLeft(v.scrollLeft),E.setScrollTop(v.scrollTop),E.setUndoManager(C),E.selection.fromJSON(v.selection),E},w.prototype.toJSON=function(){return{annotations:this.$annotations,breakpoints:this.$breakpoints,folds:this.getAllFolds().map(function(v){return v.range}),history:this.getUndoManager(),mode:this.$mode.$id,scrollLeft:this.$scrollLeft,scrollTop:this.$scrollTop,selection:this.selection.toJSON(),value:this.doc.getValue()}},w.prototype.toString=function(){return this.doc.getValue()},w.prototype.getSelection=function(){return this.selection},w.prototype.getState=function(v){return this.bgTokenizer.getState(v)},w.prototype.getTokens=function(v){return this.bgTokenizer.getTokens(v)},w.prototype.getTokenAt=function(v,C){var E=this.bgTokenizer.getTokens(v),x,k=0;if(C==null){var D=E.length-1;k=this.getLine(v).length}else for(var D=0;D<E.length&&(k+=E[D].value.length,!(k>=C));D++);return x=E[D],x?(x.index=D,x.start=k-x.value.length,x):null},w.prototype.setUndoManager=function(v){if(this.$undoManager=v,this.$informUndoManager&&this.$informUndoManager.cancel(),v){var C=this;v.addSession(this),this.$syncInformUndoManager=function(){C.$informUndoManager.cancel(),C.mergeUndoDeltas=!1},this.$informUndoManager=g.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},w.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},w.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},w.prototype.getTabString=function(){return this.getUseSoftTabs()?g.stringRepeat(" ",this.getTabSize()):" "},w.prototype.setUseSoftTabs=function(v){this.setOption("useSoftTabs",v)},w.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},w.prototype.setTabSize=function(v){this.setOption("tabSize",v)},w.prototype.getTabSize=function(){return this.$tabSize},w.prototype.isTabStop=function(v){return this.$useSoftTabs&&v.column%this.$tabSize===0},w.prototype.setNavigateWithinSoftTabs=function(v){this.setOption("navigateWithinSoftTabs",v)},w.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},w.prototype.setOverwrite=function(v){this.setOption("overwrite",v)},w.prototype.getOverwrite=function(){return this.$overwrite},w.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},w.prototype.addGutterDecoration=function(v,C){this.$decorations[v]||(this.$decorations[v]=""),this.$decorations[v]+=" "+C,this._signal("changeBreakpoint",{})},w.prototype.removeGutterDecoration=function(v,C){this.$decorations[v]=(this.$decorations[v]||"").replace(" "+C,""),this._signal("changeBreakpoint",{})},w.prototype.getBreakpoints=function(){return this.$breakpoints},w.prototype.setBreakpoints=function(v){this.$breakpoints=[];for(var C=0;C<v.length;C++)this.$breakpoints[v[C]]="ace_breakpoint";this._signal("changeBreakpoint",{})},w.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},w.prototype.setBreakpoint=function(v,C){C===void 0&&(C="ace_breakpoint"),C?this.$breakpoints[v]=C:delete this.$breakpoints[v],this._signal("changeBreakpoint",{})},w.prototype.clearBreakpoint=function(v){delete this.$breakpoints[v],this._signal("changeBreakpoint",{})},w.prototype.addMarker=function(v,C,E,x){var k=this.$markerId++,D={range:v,type:E||"line",renderer:typeof E=="function"?E:null,clazz:C,inFront:!!x,id:k};return x?(this.$frontMarkers[k]=D,this._signal("changeFrontMarker")):(this.$backMarkers[k]=D,this._signal("changeBackMarker")),k},w.prototype.addDynamicMarker=function(v,C){if(v.update){var E=this.$markerId++;return v.id=E,v.inFront=!!C,C?(this.$frontMarkers[E]=v,this._signal("changeFrontMarker")):(this.$backMarkers[E]=v,this._signal("changeBackMarker")),v}},w.prototype.removeMarker=function(v){var C=this.$frontMarkers[v]||this.$backMarkers[v];if(C){var E=C.inFront?this.$frontMarkers:this.$backMarkers;delete E[v],this._signal(C.inFront?"changeFrontMarker":"changeBackMarker")}},w.prototype.getMarkers=function(v){return v?this.$frontMarkers:this.$backMarkers},w.prototype.highlight=function(v){if(!this.$searchHighlight){var C=new h(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(C)}this.$searchHighlight.setRegexp(v)},w.prototype.highlightLines=function(v,C,E,x){typeof C!="number"&&(E=C,C=v),E||(E="ace_step");var k=new s(v,0,C,1/0);return k.id=this.addMarker(k,E,"fullLine",x),k},w.prototype.setAnnotations=function(v){this.$annotations=v,this._signal("changeAnnotation",{})},w.prototype.getAnnotations=function(){return this.$annotations||[]},w.prototype.clearAnnotations=function(){this.setAnnotations([])},w.prototype.$detectNewLine=function(v){var C=v.match(/^.*?(\r?\n)/m);C?this.$autoNewLine=C[1]:this.$autoNewLine=`
1361
+ `},w.prototype.getWordRange=function(v,C){var E=this.getLine(v),x=!1;if(C>0&&(x=!!E.charAt(C-1).match(this.tokenRe)),x||(x=!!E.charAt(C).match(this.tokenRe)),x)var k=this.tokenRe;else if(/^\s+$/.test(E.slice(C-1,C+1)))var k=/\s/;else var k=this.nonTokenRe;var D=C;if(D>0){do D--;while(D>=0&&E.charAt(D).match(k));D++}for(var I=C;I<E.length&&E.charAt(I).match(k);)I++;return new s(v,D,v,I)},w.prototype.getAWordRange=function(v,C){for(var E=this.getWordRange(v,C),x=this.getLine(E.end.row);x.charAt(E.end.column).match(/[ \t]/);)E.end.column+=1;return E},w.prototype.setNewLineMode=function(v){this.doc.setNewLineMode(v)},w.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},w.prototype.setUseWorker=function(v){this.setOption("useWorker",v)},w.prototype.getUseWorker=function(){return this.$useWorker},w.prototype.onReloadTokenizer=function(v){var C=v.data;this.bgTokenizer.start(C.first),this._signal("tokenizerUpdate",v)},w.prototype.setMode=function(v,C){if(v&&typeof v=="object"){if(v.getTokenizer)return this.$onChangeMode(v);var E=v,x=E.path}else x=v||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new o),this.$modes[x]&&!E){this.$onChangeMode(this.$modes[x]),C&&C();return}this.$modeId=x,c.loadModule(["mode",x],(function(k){if(this.$modeId!==x)return C&&C();this.$modes[x]&&!E?this.$onChangeMode(this.$modes[x]):k&&k.Mode&&(k=new k.Mode(E),E||(this.$modes[x]=k,k.$id=x),this.$onChangeMode(k)),C&&C()}).bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},w.prototype.$onChangeMode=function(v,C){if(C||(this.$modeId=v.$id),this.$mode!==v){var E=this.$mode;this.$mode=v,this.$stopWorker(),this.$useWorker&&this.$startWorker();var x=v.getTokenizer();if(x.on!==void 0){var k=this.onReloadTokenizer.bind(this);x.on("update",k)}this.bgTokenizer.setTokenizer(x),this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=v.tokenRe,this.nonTokenRe=v.nonTokenRe,C||(v.attachToSession&&v.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(v.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:E,mode:v}))}},w.prototype.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},w.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(v){c.warn("Could not load worker",v),this.$worker=null}},w.prototype.getMode=function(){return this.$mode},w.prototype.setScrollTop=function(v){this.$scrollTop===v||isNaN(v)||(this.$scrollTop=v,this._signal("changeScrollTop",v))},w.prototype.getScrollTop=function(){return this.$scrollTop},w.prototype.setScrollLeft=function(v){this.$scrollLeft===v||isNaN(v)||(this.$scrollLeft=v,this._signal("changeScrollLeft",v))},w.prototype.getScrollLeft=function(){return this.$scrollLeft},w.prototype.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},w.prototype.getLineWidgetMaxWidth=function(){if(this.lineWidgetsWidth!=null)return this.lineWidgetsWidth;var v=0;return this.lineWidgets.forEach(function(C){C&&C.screenWidth>v&&(v=C.screenWidth)}),this.lineWidgetWidth=v},w.prototype.$computeWidth=function(v){if(this.$modified||v){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var C=this.doc.getAllLines(),E=this.$rowLengthCache,x=0,k=0,D=this.$foldData[k],I=D?D.start.row:1/0,N=C.length,P=0;P<N;P++){if(P>I){if(P=D.end.row+1,P>=N)break;D=this.$foldData[k++],I=D?D.start.row:1/0}E[P]==null&&(E[P]=this.$getStringScreenWidth(C[P])[0]),E[P]>x&&(x=E[P])}this.screenWidth=x}},w.prototype.getLine=function(v){return this.doc.getLine(v)},w.prototype.getLines=function(v,C){return this.doc.getLines(v,C)},w.prototype.getLength=function(){return this.doc.getLength()},w.prototype.getTextRange=function(v){return this.doc.getTextRange(v||this.selection.getRange())},w.prototype.insert=function(v,C){return this.doc.insert(v,C)},w.prototype.remove=function(v){return this.doc.remove(v)},w.prototype.removeFullLines=function(v,C){return this.doc.removeFullLines(v,C)},w.prototype.undoChanges=function(v,C){if(v.length){this.$fromUndo=!0;for(var E=v.length-1;E!=-1;E--){var x=v[E];x.action=="insert"||x.action=="remove"?this.doc.revertDelta(x):x.folds&&this.addFolds(x.folds)}!C&&this.$undoSelect&&(v.selectionBefore?this.selection.fromJSON(v.selectionBefore):this.selection.setRange(this.$getUndoSelection(v,!0))),this.$fromUndo=!1}},w.prototype.redoChanges=function(v,C){if(v.length){this.$fromUndo=!0;for(var E=0;E<v.length;E++){var x=v[E];(x.action=="insert"||x.action=="remove")&&this.doc.$safeApplyDelta(x)}!C&&this.$undoSelect&&(v.selectionAfter?this.selection.fromJSON(v.selectionAfter):this.selection.setRange(this.$getUndoSelection(v,!1))),this.$fromUndo=!1}},w.prototype.setUndoSelect=function(v){this.$undoSelect=v},w.prototype.$getUndoSelection=function(v,C){function E(N){return C?N.action!=="insert":N.action==="insert"}for(var x,k,D=0;D<v.length;D++){var I=v[D];if(I.start){if(!x){E(I)?x=s.fromPoints(I.start,I.end):x=s.fromPoints(I.start,I.start);continue}E(I)?(k=I.start,x.compare(k.row,k.column)==-1&&x.setStart(k),k=I.end,x.compare(k.row,k.column)==1&&x.setEnd(k)):(k=I.start,x.compare(k.row,k.column)==-1&&(x=s.fromPoints(I.start,I.start)))}}return x},w.prototype.replace=function(v,C){return this.doc.replace(v,C)},w.prototype.moveText=function(v,C,E){var x=this.getTextRange(v),k=this.getFoldsInRange(v),D=s.fromPoints(C,C);if(!E){this.remove(v);var I=v.start.row-v.end.row,N=I?-v.end.column:v.start.column-v.end.column;N&&(D.start.row==v.end.row&&D.start.column>v.end.column&&(D.start.column+=N),D.end.row==v.end.row&&D.end.column>v.end.column&&(D.end.column+=N)),I&&D.start.row>=v.end.row&&(D.start.row+=I,D.end.row+=I)}if(D.end=this.insert(D.start,x),k.length){var P=v.start,z=D.start,I=z.row-P.row,N=z.column-P.column;this.addFolds(k.map(function(H){return H=H.clone(),H.start.row==P.row&&(H.start.column+=N),H.end.row==P.row&&(H.end.column+=N),H.start.row+=I,H.end.row+=I,H}))}return D},w.prototype.indentRows=function(v,C,E){E=E.replace(/\t/g,this.getTabString());for(var x=v;x<=C;x++)this.doc.insertInLine({row:x,column:0},E)},w.prototype.outdentRows=function(v){for(var C=v.collapseRows(),E=new s(0,0,0,0),x=this.getTabSize(),k=C.start.row;k<=C.end.row;++k){var D=this.getLine(k);E.start.row=k,E.end.row=k;for(var I=0;I<x&&D.charAt(I)==" ";++I);I<x&&D.charAt(I)==" "?(E.start.column=I,E.end.column=I+1):(E.start.column=0,E.end.column=I),this.remove(E)}},w.prototype.$moveLines=function(v,C,E){if(v=this.getRowFoldStart(v),C=this.getRowFoldEnd(C),E<0){var x=this.getRowFoldStart(v+E);if(x<0)return 0;var k=x-v}else if(E>0){var x=this.getRowFoldEnd(C+E);if(x>this.doc.getLength()-1)return 0;var k=x-C}else{v=this.$clipRowToDocument(v),C=this.$clipRowToDocument(C);var k=C-v+1}var D=new s(v,0,C,Number.MAX_VALUE),I=this.getFoldsInRange(D).map(function(P){return P=P.clone(),P.start.row+=k,P.end.row+=k,P}),N=E==0?this.doc.getLines(v,C):this.doc.removeFullLines(v,C);return this.doc.insertFullLines(v+k,N),I.length&&this.addFolds(I),k},w.prototype.moveLinesUp=function(v,C){return this.$moveLines(v,C,-1)},w.prototype.moveLinesDown=function(v,C){return this.$moveLines(v,C,1)},w.prototype.duplicateLines=function(v,C){return this.$moveLines(v,C,0)},w.prototype.$clipRowToDocument=function(v){return Math.max(0,Math.min(v,this.doc.getLength()-1))},w.prototype.$clipColumnToRow=function(v,C){return C<0?0:Math.min(this.doc.getLine(v).length,C)},w.prototype.$clipPositionToDocument=function(v,C){if(C=Math.max(0,C),v<0)v=0,C=0;else{var E=this.doc.getLength();v>=E?(v=E-1,C=this.doc.getLine(E-1).length):C=Math.min(this.doc.getLine(v).length,C)}return{row:v,column:C}},w.prototype.$clipRangeToDocument=function(v){v.start.row<0?(v.start.row=0,v.start.column=0):v.start.column=this.$clipColumnToRow(v.start.row,v.start.column);var C=this.doc.getLength()-1;return v.end.row>C?(v.end.row=C,v.end.column=this.doc.getLine(C).length):v.end.column=this.$clipColumnToRow(v.end.row,v.end.column),v},w.prototype.setUseWrapMode=function(v){if(v!=this.$useWrapMode){if(this.$useWrapMode=v,this.$modified=!0,this.$resetRowCache(0),v){var C=this.getLength();this.$wrapData=Array(C),this.$updateWrapData(0,C-1)}this._signal("changeWrapMode")}},w.prototype.getUseWrapMode=function(){return this.$useWrapMode},w.prototype.setWrapLimitRange=function(v,C){(this.$wrapLimitRange.min!==v||this.$wrapLimitRange.max!==C)&&(this.$wrapLimitRange={min:v,max:C},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},w.prototype.adjustWrapLimit=function(v,C){var E=this.$wrapLimitRange;E.max<0&&(E={min:C,max:C});var x=this.$constrainWrapLimit(v,E.min,E.max);return x!=this.$wrapLimit&&x>1?(this.$wrapLimit=x,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},w.prototype.$constrainWrapLimit=function(v,C,E){return C&&(v=Math.max(C,v)),E&&(v=Math.min(E,v)),v},w.prototype.getWrapLimit=function(){return this.$wrapLimit},w.prototype.setWrapLimit=function(v){this.setWrapLimitRange(v,v)},w.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},w.prototype.$updateInternalDataOnChange=function(v){var C=this.$useWrapMode,E=v.action,x=v.start,k=v.end,D=x.row,I=k.row,N=I-D,P=null;if(this.$updating=!0,N!=0)if(E==="remove"){this[C?"$wrapData":"$rowLengthCache"].splice(D,N);var z=this.$foldData;P=this.getFoldsInRange(v),this.removeFolds(P);var F=this.getFoldLine(k.row),W=0;if(F){F.addRemoveChars(k.row,k.column,x.column-k.column),F.shiftRow(-N);var H=this.getFoldLine(D);H&&H!==F&&(H.merge(F),F=H),W=z.indexOf(F)+1}for(W;W<z.length;W++){var F=z[W];F.start.row>=k.row&&F.shiftRow(-N)}I=D}else{var B=Array(N);B.unshift(D,0);var G=C?this.$wrapData:this.$rowLengthCache;G.splice.apply(G,B);var z=this.$foldData,F=this.getFoldLine(D),W=0;if(F){var q=F.range.compareInside(x.row,x.column);q==0?(F=F.split(x.row,x.column),F&&(F.shiftRow(N),F.addRemoveChars(I,0,k.column-x.column))):q==-1&&(F.addRemoveChars(D,0,k.column-x.column),F.shiftRow(N)),W=z.indexOf(F)+1}for(W;W<z.length;W++){var F=z[W];F.start.row>=D&&F.shiftRow(N)}}else{N=Math.abs(v.start.column-v.end.column),E==="remove"&&(P=this.getFoldsInRange(v),this.removeFolds(P),N=-N);var F=this.getFoldLine(D);F&&F.addRemoveChars(D,x.column,N)}return C&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,C?this.$updateWrapData(D,I):this.$updateRowLengthCache(D,I),P},w.prototype.$updateRowLengthCache=function(v,C){this.$rowLengthCache[v]=null,this.$rowLengthCache[C]=null},w.prototype.$updateWrapData=function(v,C){var E=this.doc.getAllLines(),x=this.getTabSize(),k=this.$wrapData,D=this.$wrapLimit,I,N,P=v;for(C=Math.min(C,E.length-1);P<=C;)N=this.getFoldLine(P,N),N?(I=[],N.walk((function(z,F,W,H){var B;if(z!=null){B=this.$getDisplayTokens(z,I.length),B[0]=A;for(var G=1;G<B.length;G++)B[G]=S}else B=this.$getDisplayTokens(E[F].substring(H,W),I.length);I=I.concat(B)}).bind(this),N.end.row,E[N.end.row].length+1),k[N.start.row]=this.$computeWrapSplits(I,D,x),P=N.end.row+1):(I=this.$getDisplayTokens(E[P]),k[P]=this.$computeWrapSplits(I,D,x),P++)},w.prototype.$computeWrapSplits=function(v,C,E){if(v.length==0)return[];var x=[],k=v.length,D=0,I=0,N=this.$wrapAsCode,P=this.$indentedSoftWrap,z=C<=Math.max(2*E,8)||P===!1?0:Math.floor(C/2);function F(){var q=0;if(z===0)return q;if(P)for(var Y=0;Y<v.length;Y++){var V=v[Y];if(V==R)q+=1;else if(V==L)q+=E;else{if(V==_)continue;break}}return N&&P!==!1&&(q+=E),Math.min(q,z)}function W(q){for(var Y=q-D,V=D;V<q;V++){var Z=v[V];(Z===12||Z===2)&&(Y-=1)}x.length||(H=F(),x.indent=H),I+=Y,x.push(I),D=q}for(var H=0;k-D>C-H;){var B=D+C-H;if(v[B-1]>=R&&v[B]>=R){W(B);continue}if(v[B]==A||v[B]==S){for(B;B!=D-1&&v[B]!=A;B--);if(B>D){W(B);continue}for(B=D+C,B;B<v.length&&v[B]==S;B++);if(B==v.length)break;W(B);continue}for(var G=Math.max(B-(C-(C>>2)),D-1);B>G&&v[B]<A;)B--;if(N){for(;B>G&&v[B]<A;)B--;for(;B>G&&v[B]==M;)B--}else for(;B>G&&v[B]<R;)B--;if(B>G){W(++B);continue}B=D+C,v[B]==$&&B--,W(B-H)}return x},w.prototype.$getDisplayTokens=function(v,C){var E=[],x;C=C||0;for(var k=0;k<v.length;k++){var D=v.charCodeAt(k);if(D==9){x=this.getScreenTabSize(E.length+C),E.push(L);for(var I=1;I<x;I++)E.push(_)}else D==32?E.push(R):D>39&&D<48||D>57&&D<64?E.push(M):D>=4352&&O(D)?E.push(T,$):E.push(T)}return E},w.prototype.$getStringScreenWidth=function(v,C,E){if(C==0)return[0,0];C==null&&(C=1/0),E=E||0;var x,k;for(k=0;k<v.length&&(x=v.charCodeAt(k),x==9?E+=this.getScreenTabSize(E):x>=4352&&O(x)?E+=2:E+=1,!(E>C));k++);return[E,k]},w.prototype.getRowLength=function(v){var C=1;return this.lineWidgets&&(C+=this.lineWidgets[v]&&this.lineWidgets[v].rowCount||0),!this.$useWrapMode||!this.$wrapData[v]?C:this.$wrapData[v].length+C},w.prototype.getRowLineCount=function(v){return!this.$useWrapMode||!this.$wrapData[v]?1:this.$wrapData[v].length+1},w.prototype.getRowWrapIndent=function(v){if(this.$useWrapMode){var C=this.screenToDocumentPosition(v,Number.MAX_VALUE),E=this.$wrapData[C.row];return E.length&&E[0]<C.column?E.indent:0}else return 0},w.prototype.getScreenLastRowColumn=function(v){var C=this.screenToDocumentPosition(v,Number.MAX_VALUE);return this.documentToScreenColumn(C.row,C.column)},w.prototype.getDocumentLastRowColumn=function(v,C){var E=this.documentToScreenRow(v,C);return this.getScreenLastRowColumn(E)},w.prototype.getDocumentLastRowColumnPosition=function(v,C){var E=this.documentToScreenRow(v,C);return this.screenToDocumentPosition(E,Number.MAX_VALUE/10)},w.prototype.getRowSplitData=function(v){if(this.$useWrapMode)return this.$wrapData[v]},w.prototype.getScreenTabSize=function(v){return this.$tabSize-(v%this.$tabSize|0)},w.prototype.screenToDocumentRow=function(v,C){return this.screenToDocumentPosition(v,C).row},w.prototype.screenToDocumentColumn=function(v,C){return this.screenToDocumentPosition(v,C).column},w.prototype.screenToDocumentPosition=function(v,C,E){if(v<0)return{row:0,column:0};var x,k=0,D=0,I,N=0,P=0,z=this.$screenRowCache,F=this.$getRowCacheIndex(z,v),W=z.length;if(W&&F>=0)var N=z[F],k=this.$docRowCache[F],H=v>z[W-1];else var H=!W;for(var B=this.getLength()-1,G=this.getNextFoldLine(k),q=G?G.start.row:1/0;N<=v&&(P=this.getRowLength(k),!(N+P>v||k>=B));)N+=P,k++,k>q&&(k=G.end.row+1,G=this.getNextFoldLine(k,G),q=G?G.start.row:1/0),H&&(this.$docRowCache.push(k),this.$screenRowCache.push(N));if(G&&G.start.row<=k)x=this.getFoldDisplayLine(G),k=G.start.row;else{if(N+P<=v||k>B)return{row:B,column:this.getLine(B).length};x=this.getLine(k),G=null}var Y=0,V=Math.floor(v-N);if(this.$useWrapMode){var Z=this.$wrapData[k];Z&&(I=Z[V],V>0&&Z.length&&(Y=Z.indent,D=Z[V-1]||Z[Z.length-1],x=x.substring(D)))}return E!==void 0&&this.$bidiHandler.isBidiRow(N+V,k,V)&&(C=this.$bidiHandler.offsetToCol(E)),D+=this.$getStringScreenWidth(x,C-Y)[1],this.$useWrapMode&&D>=I&&(D=I-1),G?G.idxToPosition(D):{row:k,column:D}},w.prototype.documentToScreenPosition=function(v,C){if(typeof C>"u")var E=this.$clipPositionToDocument(v.row,v.column);else E=this.$clipPositionToDocument(v,C);v=E.row,C=E.column;var x=0,k=null,D=null;D=this.getFoldAt(v,C,1),D&&(v=D.start.row,C=D.start.column);var I,N=0,P=this.$docRowCache,z=this.$getRowCacheIndex(P,v),F=P.length;if(F&&z>=0)var N=P[z],x=this.$screenRowCache[z],W=v>P[F-1];else var W=!F;for(var H=this.getNextFoldLine(N),B=H?H.start.row:1/0;N<v;){if(N>=B){if(I=H.end.row+1,I>v)break;H=this.getNextFoldLine(I,H),B=H?H.start.row:1/0}else I=N+1;x+=this.getRowLength(N),N=I,W&&(this.$docRowCache.push(N),this.$screenRowCache.push(x))}var G="";H&&N>=B?(G=this.getFoldDisplayLine(H,v,C),k=H.start.row):(G=this.getLine(v).substring(0,C),k=v);var q=0;if(this.$useWrapMode){var Y=this.$wrapData[k];if(Y){for(var V=0;G.length>=Y[V];)x++,V++;G=G.substring(Y[V-1]||0,G.length),q=V>0?Y.indent:0}}return this.lineWidgets&&this.lineWidgets[N]&&this.lineWidgets[N].rowsAbove&&(x+=this.lineWidgets[N].rowsAbove),{row:x,column:q+this.$getStringScreenWidth(G)[0]}},w.prototype.documentToScreenColumn=function(v,C){return this.documentToScreenPosition(v,C).column},w.prototype.documentToScreenRow=function(v,C){return this.documentToScreenPosition(v,C).row},w.prototype.getScreenLength=function(){var v=0,C=null;if(this.$useWrapMode)for(var k=this.$wrapData.length,D=0,x=0,C=this.$foldData[x++],I=C?C.start.row:1/0;D<k;){var N=this.$wrapData[D];v+=N?N.length+1:1,D++,D>I&&(D=C.end.row+1,C=this.$foldData[x++],I=C?C.start.row:1/0)}else{v=this.getLength();for(var E=this.$foldData,x=0;x<E.length;x++)C=E[x],v-=C.end.row-C.start.row}return this.lineWidgets&&(v+=this.$getWidgetScreenLength()),v},w.prototype.$setFontMetrics=function(v){this.$enableVarChar&&(this.$getStringScreenWidth=function(C,E,x){if(E===0)return[0,0];E||(E=1/0),x=x||0;var k,D;for(D=0;D<C.length&&(k=C.charAt(D),k===" "?x+=this.getScreenTabSize(x):x+=v.getCharacterWidth(k),!(x>E));D++);return[x,D]})},w.prototype.getPrecedingCharacter=function(){var v=this.selection.getCursor();if(v.column===0)return v.row===0?"":this.doc.getNewLineCharacter();var C=this.getLine(v.row);return C[v.column-1]},w.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.endOperation(),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection&&(this.selection.off("changeCursor",this.$onSelectionChange),this.selection.off("changeSelection",this.$onSelectionChange)),this.selection.detach()},w})();b.$uid=0,b.prototype.$modes=c.$modes,b.prototype.getValue=b.prototype.toString,b.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},b.prototype.$overwrite=!1,b.prototype.$mode=null,b.prototype.$modeId=null,b.prototype.$scrollTop=0,b.prototype.$scrollLeft=0,b.prototype.$wrapLimit=80,b.prototype.$useWrapMode=!1,b.prototype.$wrapLimitRange={min:null,max:null},b.prototype.lineWidgets=null,b.prototype.isFullWidth=O,d.implement(b.prototype,f);var T=1,$=2,A=3,S=4,M=9,R=10,L=11,_=12;function O(w){return w<4352?!1:w>=4352&&w<=4447||w>=4515&&w<=4519||w>=4602&&w<=4607||w>=9001&&w<=9002||w>=11904&&w<=11929||w>=11931&&w<=12019||w>=12032&&w<=12245||w>=12272&&w<=12283||w>=12288&&w<=12350||w>=12353&&w<=12438||w>=12441&&w<=12543||w>=12549&&w<=12589||w>=12593&&w<=12686||w>=12688&&w<=12730||w>=12736&&w<=12771||w>=12784&&w<=12830||w>=12832&&w<=12871||w>=12880&&w<=13054||w>=13056&&w<=19903||w>=19968&&w<=42124||w>=42128&&w<=42182||w>=43360&&w<=43388||w>=44032&&w<=55203||w>=55216&&w<=55238||w>=55243&&w<=55291||w>=63744&&w<=64255||w>=65040&&w<=65049||w>=65072&&w<=65106||w>=65108&&w<=65126||w>=65128&&w<=65131||w>=65281&&w<=65376||w>=65504&&w<=65510}t("./edit_session/folding").Folding.call(b.prototype),t("./edit_session/bracket_match").BracketMatch.call(b.prototype),c.defineOptions(b.prototype,"session",{wrap:{set:function(w){if(!w||w=="off"?w=!1:w=="free"?w=!0:w=="printMargin"?w=-1:typeof w=="string"&&(w=parseInt(w,10)||!1),this.$wrap!=w)if(this.$wrap=w,!w)this.setUseWrapMode(!1);else{var v=typeof w=="number"?w:null;this.setWrapLimitRange(v,v),this.setUseWrapMode(!0)}},get:function(){return this.getUseWrapMode()?this.$wrap==-1?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(w){w=w=="auto"?this.$mode.type!="text":w!="text",w!=this.$wrapAsCode&&(this.$wrapAsCode=w,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(w){this.$useWorker=w,this.$stopWorker(),w&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(w){w=parseInt(w),w>0&&this.$tabSize!==w&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=w,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(w){this.setFoldStyle(w)},handlesSet:!0},overwrite:{set:function(w){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(w){this.doc.setNewLineMode(w)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(w){this.setMode(w)},get:function(){return this.$modeId},handlesSet:!0}}),n.EditSession=b}),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],function(t,n,p){var d=t("./lib/lang"),g=t("./lib/oop"),m=t("./range").Range,c=(function(){function r(){this.$options={}}return r.prototype.set=function(o){return g.mixin(this.$options,o),this},r.prototype.getOptions=function(){return d.copyObject(this.$options)},r.prototype.setOptions=function(o){this.$options=o},r.prototype.find=function(o){var s=this.$options,a=this.$matchIterator(o,s);if(!a)return!1;var i=null;return a.forEach(function(u,h,y,b){return i=new m(u,h,y,b),h==b&&s.start&&s.start.start&&s.skipCurrent!=!1&&i.isEqual(s.start)?(i=null,!1):!0}),i},r.prototype.findAll=function(o){var s=this.$options;if(!s.needle)return[];this.$assembleRegExp(s);var a=s.range,i=a?o.getLines(a.start.row,a.end.row):o.doc.getAllLines(),u=[],h=s.re;if(s.$isMultiLine){var y=h.length,b=i.length-y,T;e:for(var $=h.offset||0;$<=b;$++){for(var A=0;A<y;A++)if(i[$+A].search(h[A])==-1)continue e;var S=i[$],M=i[$+y-1],R=S.length-S.match(h[0])[0].length,L=M.match(h[y-1])[0].length;T&&T.end.row===$&&T.end.column>R||(u.push(T=new m($,R,$+y-1,L)),y>2&&($=$+y-2))}}else for(var _=0;_<i.length;_++)for(var O=d.getMatchOffsets(i[_],h),A=0;A<O.length;A++){var w=O[A];u.push(new m(_,w.offset,_,w.offset+w.length))}if(a){for(var v=a.start.column,C=a.end.column,_=0,A=u.length-1;_<A&&u[_].start.column<v&&u[_].start.row==0;)_++;for(var E=a.end.row-a.start.row;_<A&&u[A].end.column>C&&u[A].end.row==E;)A--;for(u=u.slice(_,A+1),_=0,A=u.length;_<A;_++)u[_].start.row+=a.start.row,u[_].end.row+=a.start.row}return u},r.prototype.replace=function(o,s){var a=this.$options,i=this.$assembleRegExp(a);if(a.$isMultiLine)return s;if(i){var u=i.exec(o);if(!u||u[0].length!=o.length)return null;if(a.regExp||(s=s.replace(/\$/g,"$$$$")),s=o.replace(i,s),a.preserveCase){s=s.split("");for(var h=Math.min(o.length,o.length);h--;){var y=o[h];y&&y.toLowerCase()!=y?s[h]=s[h].toUpperCase():s[h]=s[h].toLowerCase()}s=s.join("")}return s}},r.prototype.$assembleRegExp=function(o,s){if(o.needle instanceof RegExp)return o.re=o.needle;var a=o.needle;if(!o.needle)return o.re=!1;o.regExp||(a=d.escapeRegExp(a));var i=o.caseSensitive?"gm":"gmi";try{new RegExp(a,"u"),o.$supportsUnicodeFlag=!0,i+="u"}catch{o.$supportsUnicodeFlag=!1}if(o.wholeWord&&(a=f(a,o)),o.$isMultiLine=!s&&/[\n\r]/.test(a),o.$isMultiLine)return o.re=this.$assembleMultilineRegExp(a,i);try{var u=new RegExp(a,i)}catch{u=!1}return o.re=u},r.prototype.$assembleMultilineRegExp=function(o,s){for(var a=o.replace(/\r\n|\r|\n/g,`$
1362
1362
  ^`).split(`
1363
- `),i=[],u=0;u<a.length;u++)try{i.push(new RegExp(a[u],s))}catch{return!1}return i},r.prototype.$matchIterator=function(o,s){var a=this.$assembleRegExp(s);if(!a)return!1;var i=s.backwards==!0,u=s.skipCurrent!=!1,h=a.unicode,y=s.range,b=s.start;b||(b=y?y[i?"end":"start"]:o.selection.getRange()),b.start&&(b=b[u!=i?"end":"start"]);var T=y?y.start.row:0,$=y?y.end.row:o.getLength()-1;if(i)var A=function(R){var L=b.row;if(!M(L,b.column,R)){for(L--;L>=T;L--)if(M(L,Number.MAX_VALUE,R))return;if(s.wrap!=!1){for(L=$,T=b.row;L>=T;L--)if(M(L,Number.MAX_VALUE,R))return}}};else var A=function(L){var _=b.row;if(!M(_,b.column,L)){for(_=_+1;_<=$;_++)if(M(_,0,L))return;if(s.wrap!=!1){for(_=T,$=b.row;_<=$;_++)if(M(_,0,L))return}}};if(s.$isMultiLine)var S=a.length,M=function(R,L,_){var I=i?R-S+1:R;if(!(I<0||I+S>o.getLength())){var w=o.getLine(I),v=w.search(a[0]);if(!(!i&&v<L||v===-1)){for(var C=1;C<S;C++)if(w=o.getLine(I+C),w.search(a[C])==-1)return;var E=w.match(a[S-1])[0].length;if(!(i&&E>L)&&_(I,v,I+S-1,E))return!0}}};else if(i)var M=function(L,_,I){var w=o.getLine(L),v=[],C,E=0;for(a.lastIndex=0;C=a.exec(w);){var x=C[0].length;if(E=C.index,!x){if(E>=w.length)break;a.lastIndex=E+=d.skipEmptyMatch(w,E,h)}if(C.index+x>_)break;v.push(C.index,x)}for(var k=v.length-1;k>=0;k-=2){var O=v[k-1],x=v[k];if(I(L,O,L,O+x))return!0}};else var M=function(L,_,I){var w=o.getLine(L),v,C;for(a.lastIndex=_;C=a.exec(w);){var E=C[0].length;if(v=C.index,I(L,v,L,v+E))return!0;if(!E&&(a.lastIndex=v+=d.skipEmptyMatch(w,v,h),v>=w.length))return!1}};return{forEach:A}},r})();function f(r,o){var s=d.supportsLookbehind();function a(y,b){b===void 0&&(b=!0);var T=s&&o.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return T.test(y)||o.regExp?s&&o.$supportsUnicodeFlag?b?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var i=Array.from(r),u=i[0],h=i[i.length-1];return a(u)+r+a(h,!1)}n.Search=l}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,n,p){var d=this&&this.__extends||(function(){var s=function(a,i){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,h){u.__proto__=h}||function(u,h){for(var y in h)Object.prototype.hasOwnProperty.call(h,y)&&(u[y]=h[y])},s(a,i)};return function(a,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");s(a,i);function u(){this.constructor=a}a.prototype=i===null?Object.create(i):(u.prototype=i.prototype,new u)}})(),g=t("../lib/keys"),m=t("../lib/useragent"),l=g.KEY_MODS,f=(function(){function s(a,i){this.$init(a,i,!1)}return s.prototype.$init=function(a,i,u){this.platform=i||(m.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(a),this.$singleCommand=u},s.prototype.addCommand=function(a){this.commands[a.name]&&this.removeCommand(a),this.commands[a.name]=a,a.bindKey&&this._buildKeyHash(a)},s.prototype.removeCommand=function(a,i){var u=a&&(typeof a=="string"?a:a.name);a=this.commands[u],i||delete this.commands[u];var h=this.commandKeyBinding;for(var y in h){var b=h[y];if(b==a)delete h[y];else if(Array.isArray(b)){var T=b.indexOf(a);T!=-1&&(b.splice(T,1),b.length==1&&(h[y]=b[0]))}}},s.prototype.bindKey=function(a,i,u){if(typeof a=="object"&&a&&(u==null&&(u=a.position),a=a[this.platform]),!!a){if(typeof i=="function")return this.addCommand({exec:i,bindKey:a,name:i.name||a});a.split("|").forEach(function(h){var y="";if(h.indexOf(" ")!=-1){var b=h.split(/\s+/);h=b.pop(),b.forEach(function(A){var S=this.parseKeys(A),M=l[S.hashId]+S.key;y+=(y?" ":"")+M,this._addCommandToBinding(y,"chainKeys")},this),y+=" "}var T=this.parseKeys(h),$=l[T.hashId]+T.key;this._addCommandToBinding(y+$,i,u)},this)}},s.prototype._addCommandToBinding=function(a,i,u){var h=this.commandKeyBinding,y;if(!i)delete h[a];else if(!h[a]||this.$singleCommand)h[a]=i;else{Array.isArray(h[a])?(y=h[a].indexOf(i))!=-1&&h[a].splice(y,1):h[a]=[h[a]],typeof u!="number"&&(u=r(i));var b=h[a];for(y=0;y<b.length;y++){var T=b[y],$=r(T);if($>u)break}b.splice(y,0,i)}},s.prototype.addCommands=function(a){a&&Object.keys(a).forEach(function(i){var u=a[i];if(u){if(typeof u=="string")return this.bindKey(u,i);typeof u=="function"&&(u={exec:u}),typeof u=="object"&&(u.name||(u.name=i),this.addCommand(u))}},this)},s.prototype.removeCommands=function(a){Object.keys(a).forEach(function(i){this.removeCommand(a[i])},this)},s.prototype.bindKeys=function(a){Object.keys(a).forEach(function(i){this.bindKey(i,a[i])},this)},s.prototype._buildKeyHash=function(a){this.bindKey(a.bindKey,a)},s.prototype.parseKeys=function(a){var i=a.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function($){return $}),u=i.pop(),h=g[u];if(g.FUNCTION_KEYS[h])u=g.FUNCTION_KEYS[h].toLowerCase();else if(i.length){if(i.length==1&&i[0]=="shift")return{key:u.toUpperCase(),hashId:-1}}else return{key:u,hashId:-1};for(var y=0,b=i.length;b--;){var T=g.KEY_MODS[i[b]];if(T==null)return typeof console<"u"&&console.error("invalid modifier "+i[b]+" in "+a),!1;y|=T}return{key:u,hashId:y}},s.prototype.findKeyCommand=function(a,i){var u=l[a]+i;return this.commandKeyBinding[u]},s.prototype.handleKeyboard=function(a,i,u,h){if(!(h<0)){var y=l[i]+u,b=this.commandKeyBinding[y];return a.$keyChain&&(a.$keyChain+=" "+y,b=this.commandKeyBinding[a.$keyChain]||b),b&&(b=="chainKeys"||b[b.length-1]=="chainKeys")?(a.$keyChain=a.$keyChain||y,{command:"null"}):(a.$keyChain&&((!i||i==4)&&u.length==1?a.$keyChain=a.$keyChain.slice(0,-y.length-1):(i==-1||h>0)&&(a.$keyChain="")),{command:b})}},s.prototype.getStatusText=function(a,i){return i.$keyChain||""},s})();function r(s){return typeof s=="object"&&s.bindKey&&s.bindKey.position||(s.isDefault?-100:0)}var o=(function(s){d(a,s);function a(i,u){var h=s.call(this,i,u)||this;return h.$singleCommand=!0,h}return a})(f);o.call=function(s,a,i){f.prototype.$init.call(s,a,i,!0)},f.call=function(s,a,i){f.prototype.$init.call(s,a,i,!1)},n.HashHandler=o,n.MultiHashHandler=f}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(t,n,p){var d=this&&this.__extends||(function(){var r=function(o,s){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,i){a.__proto__=i}||function(a,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(a[u]=i[u])},r(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");r(o,s);function a(){this.constructor=o}o.prototype=s===null?Object.create(s):(a.prototype=s.prototype,new a)}})(),g=t("../lib/oop"),m=t("../keyboard/hash_handler").MultiHashHandler,l=t("../lib/event_emitter").EventEmitter,f=(function(r){d(o,r);function o(s,a){var i=r.call(this,a,s)||this;return i.byName=i.commands,i.setDefaultHandler("exec",function(u){return u.args?u.command.exec(u.editor,u.args,u.event,!1):u.command.exec(u.editor,{},u.event,!0)}),i}return o.prototype.exec=function(s,a,i){if(Array.isArray(s)){for(var u=s.length;u--;)if(this.exec(s[u],a,i))return!0;return!1}if(typeof s=="string"&&(s=this.commands[s]),!this.canExecute(s,a))return!1;var h={editor:a,command:s,args:i};return h.returnValue=this._emit("exec",h),this._signal("afterExec",h),h.returnValue!==!1},o.prototype.canExecute=function(s,a){return typeof s=="string"&&(s=this.commands[s]),!(!s||a&&a.$readOnly&&!s.readOnly||this.$checkCommandState!=!1&&s.isAvailable&&!s.isAvailable(a))},o.prototype.toggleRecording=function(s){if(!this.$inReplay)return s&&s._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=(function(a){this.macro.push([a.command,a.args])}).bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},o.prototype.replay=function(s){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(s);try{this.$inReplay=!0,this.macro.forEach(function(a){typeof a=="string"?this.exec(a,s):this.exec(a[0],s,a[1])},this)}finally{this.$inReplay=!1}}},o.prototype.trimMacro=function(s){return s.map(function(a){return typeof a[0]!="string"&&(a[0]=a[0].name),a[1]||(a=a[0]),a})},o})(m);g.implement(f.prototype,l),n.CommandManager=f}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(t,n,p){var d=t("../lib/lang"),g=t("../config"),m=t("../range").Range;function l(r,o){return{win:r,mac:o}}n.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:l("Ctrl-,","Command-,"),exec:function(r){g.loadModule("ace/ext/settings_menu",function(o){o.init(r),r.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:l("Alt-E","F4"),exec:function(r){g.loadModule("ace/ext/error_marker",function(o){o.showErrorMarker(r,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:l("Alt-Shift-E","Shift-F4"),exec:function(r){g.loadModule("ace/ext/error_marker",function(o){o.showErrorMarker(r,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:l("Ctrl-A","Command-A"),exec:function(r){r.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:l(null,"Ctrl-L"),exec:function(r){r.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:l("Ctrl-L","Command-L"),exec:function(r,o){typeof o=="number"&&!isNaN(o)&&r.gotoLine(o),r.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:l("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(r){r.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:l("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(r){r.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:l("F2","F2"),exec:function(r){r.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:l("Alt-F2","Alt-F2"),exec:function(r){r.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:l(null,"Ctrl-Command-Option-0"),exec:function(r){r.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:l(null,"Ctrl-Command-Option-0"),exec:function(r){r.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:l("Alt-0","Command-Option-0"),exec:function(r){r.session.foldAll(),r.session.unfold(r.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:l("Alt-Shift-0","Command-Option-Shift-0"),exec:function(r){r.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:l("Ctrl-K","Command-G"),exec:function(r){r.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:l("Ctrl-Shift-K","Command-Shift-G"),exec:function(r){r.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:l("Alt-K","Ctrl-G"),exec:function(r){r.selection.isEmpty()?r.selection.selectWord():r.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:l("Alt-Shift-K","Ctrl-Shift-G"),exec:function(r){r.selection.isEmpty()?r.selection.selectWord():r.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:l("Ctrl-F","Command-F"),exec:function(r){g.loadModule("ace/ext/searchbox",function(o){o.Search(r)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(r){r.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:l("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(r){r.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:l("Ctrl-Home","Command-Home|Command-Up"),exec:function(r){r.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:l("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(r){r.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:l("Up","Up|Ctrl-P"),exec:function(r,o){r.navigateUp(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:l("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(r){r.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:l("Ctrl-End","Command-End|Command-Down"),exec:function(r){r.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:l("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(r){r.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:l("Down","Down|Ctrl-N"),exec:function(r,o){r.navigateDown(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:l("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(r){r.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:l("Ctrl-Left","Option-Left"),exec:function(r){r.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:l("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(r){r.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:l("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(r){r.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:l("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(r){r.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:l("Left","Left|Ctrl-B"),exec:function(r,o){r.navigateLeft(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:l("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(r){r.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:l("Ctrl-Right","Option-Right"),exec:function(r){r.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:l("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(r){r.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:l("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(r){r.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:l("Shift-Right","Shift-Right"),exec:function(r){r.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:l("Right","Right|Ctrl-F"),exec:function(r,o){r.navigateRight(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(r){r.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:l(null,"Option-PageDown"),exec:function(r){r.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:l("PageDown","PageDown|Ctrl-V"),exec:function(r){r.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(r){r.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:l(null,"Option-PageUp"),exec:function(r){r.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(r){r.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:l("Ctrl-Up",null),exec:function(r){r.renderer.scrollBy(0,-2*r.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:l("Ctrl-Down",null),exec:function(r){r.renderer.scrollBy(0,2*r.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(r){r.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(r){r.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:l("Ctrl-Alt-E","Command-Option-E"),exec:function(r){r.commands.toggleRecording(r)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:l("Ctrl-Shift-E","Command-Shift-E"),exec:function(r){r.commands.replay(r)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:l("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(r){r.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:l("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(r){r.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:l("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(r){r.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:l(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(r){},readOnly:!0},{name:"cut",description:"Cut",exec:function(r){var o=r.$copyWithEmptySelection&&r.selection.isEmpty(),s=o?r.selection.getLineRange():r.selection.getRange();r._emit("cut",s),s.isEmpty()||r.session.remove(s),r.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(r,o){r.$handlePaste(o)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:l("Ctrl-D","Command-D"),exec:function(r){r.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:l("Ctrl-Shift-D","Command-Shift-D"),exec:function(r){r.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:l("Ctrl-Alt-S","Command-Alt-S"),exec:function(r){r.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:l("Ctrl-/","Command-/"),exec:function(r){r.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:l("Ctrl-Shift-/","Command-Shift-/"),exec:function(r){r.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:l("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(r){r.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:l("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(r){r.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:l("Ctrl-H","Command-Option-F"),exec:function(r){g.loadModule("ace/ext/searchbox",function(o){o.Search(r,!0)})}},{name:"undo",description:"Undo",bindKey:l("Ctrl-Z","Command-Z"),exec:function(r){r.undo()}},{name:"redo",description:"Redo",bindKey:l("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(r){r.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:l("Alt-Shift-Up","Command-Option-Up"),exec:function(r){r.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:l("Alt-Up","Option-Up"),exec:function(r){r.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:l("Alt-Shift-Down","Command-Option-Down"),exec:function(r){r.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:l("Alt-Down","Option-Down"),exec:function(r){r.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:l("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(r){r.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:l("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(r){r.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:l("Shift-Delete",null),exec:function(r){if(r.selection.isEmpty())r.remove("left");else return!1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:l("Alt-Backspace","Command-Backspace"),exec:function(r){r.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:l("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(r){r.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:l("Ctrl-Shift-Backspace",null),exec:function(r){var o=r.selection.getRange();o.start.column=0,r.session.remove(o)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:l("Ctrl-Shift-Delete",null),exec:function(r){var o=r.selection.getRange();o.end.column=Number.MAX_VALUE,r.session.remove(o)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:l("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(r){r.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:l("Ctrl-Delete","Alt-Delete"),exec:function(r){r.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:l("Shift-Tab","Shift-Tab"),exec:function(r){r.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:l("Tab","Tab"),exec:function(r){r.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:l("Ctrl-[","Ctrl-["),exec:function(r){r.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:l("Ctrl-]","Ctrl-]"),exec:function(r){r.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(r,o){r.insert(o)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(r,o){r.insert(d.stringRepeat(o.text||"",o.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:l(null,"Ctrl-O"),exec:function(r){r.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:l("Alt-Shift-X","Ctrl-T"),exec:function(r){r.transposeLetters()},multiSelectAction:function(r){r.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:l("Ctrl-U","Ctrl-U"),exec:function(r){r.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:l("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(r){r.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:l(null,null),exec:function(r){r.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:l("Ctrl-Shift-L","Command-Shift-L"),exec:function(r){var o=r.selection.getRange();o.start.column=o.end.column=0,o.end.row++,r.selection.setRange(o,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:l("Ctrl+F3","F3"),exec:function(r){r.openLink()}},{name:"joinlines",description:"Join lines",bindKey:l(null,null),exec:function(r){for(var o=r.selection.isBackwards(),s=o?r.selection.getSelectionLead():r.selection.getSelectionAnchor(),a=o?r.selection.getSelectionAnchor():r.selection.getSelectionLead(),i=r.session.doc.getLine(s.row).length,u=r.session.doc.getTextRange(r.selection.getRange()),h=u.replace(/\n\s*/," ").length,y=r.session.doc.getLine(s.row),b=s.row+1;b<=a.row+1;b++){var T=d.stringTrimLeft(d.stringTrimRight(r.session.doc.getLine(b)));T.length!==0&&(T=" "+T),y+=T}a.row+1<r.session.doc.getLength()-1&&(y+=r.session.doc.getNewLineCharacter()),r.clearSelection(),r.session.doc.replace(new m(s.row,0,a.row+2,0),y),h>0?(r.selection.moveCursorTo(s.row,s.column),r.selection.selectTo(s.row,s.column+h)):(i=r.session.doc.getLine(s.row).length>i?i+1:i,r.selection.moveCursorTo(s.row,i))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:l(null,null),exec:function(r){var o=r.session.doc.getLength()-1,s=r.session.doc.getLine(o).length,a=r.selection.rangeList.ranges,i=[];a.length<1&&(a=[r.selection.getRange()]);for(var u=0;u<a.length;u++)u==a.length-1&&(a[u].end.row===o&&a[u].end.column===s||i.push(new m(a[u].end.row,a[u].end.column,o,s))),u===0?a[u].start.row===0&&a[u].start.column===0||i.push(new m(0,0,a[u].start.row,a[u].start.column)):i.push(new m(a[u-1].end.row,a[u-1].end.column,a[u].start.row,a[u].start.column));r.exitMultiSelectMode(),r.clearSelection();for(var u=0;u<i.length;u++)r.selection.addRange(i[u],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(r){r.selection.clearSelection(),r.navigateLineEnd(),r.insert(`
1363
+ `),i=[],u=0;u<a.length;u++)try{i.push(new RegExp(a[u],s))}catch{return!1}return i},r.prototype.$matchIterator=function(o,s){var a=this.$assembleRegExp(s);if(!a)return!1;var i=s.backwards==!0,u=s.skipCurrent!=!1,h=a.unicode,y=s.range,b=s.start;b||(b=y?y[i?"end":"start"]:o.selection.getRange()),b.start&&(b=b[u!=i?"end":"start"]);var T=y?y.start.row:0,$=y?y.end.row:o.getLength()-1;if(i)var A=function(R){var L=b.row;if(!M(L,b.column,R)){for(L--;L>=T;L--)if(M(L,Number.MAX_VALUE,R))return;if(s.wrap!=!1){for(L=$,T=b.row;L>=T;L--)if(M(L,Number.MAX_VALUE,R))return}}};else var A=function(L){var _=b.row;if(!M(_,b.column,L)){for(_=_+1;_<=$;_++)if(M(_,0,L))return;if(s.wrap!=!1){for(_=T,$=b.row;_<=$;_++)if(M(_,0,L))return}}};if(s.$isMultiLine)var S=a.length,M=function(R,L,_){var O=i?R-S+1:R;if(!(O<0||O+S>o.getLength())){var w=o.getLine(O),v=w.search(a[0]);if(!(!i&&v<L||v===-1)){for(var C=1;C<S;C++)if(w=o.getLine(O+C),w.search(a[C])==-1)return;var E=w.match(a[S-1])[0].length;if(!(i&&E>L)&&_(O,v,O+S-1,E))return!0}}};else if(i)var M=function(L,_,O){var w=o.getLine(L),v=[],C,E=0;for(a.lastIndex=0;C=a.exec(w);){var x=C[0].length;if(E=C.index,!x){if(E>=w.length)break;a.lastIndex=E+=d.skipEmptyMatch(w,E,h)}if(C.index+x>_)break;v.push(C.index,x)}for(var k=v.length-1;k>=0;k-=2){var D=v[k-1],x=v[k];if(O(L,D,L,D+x))return!0}};else var M=function(L,_,O){var w=o.getLine(L),v,C;for(a.lastIndex=_;C=a.exec(w);){var E=C[0].length;if(v=C.index,O(L,v,L,v+E))return!0;if(!E&&(a.lastIndex=v+=d.skipEmptyMatch(w,v,h),v>=w.length))return!1}};return{forEach:A}},r})();function f(r,o){var s=d.supportsLookbehind();function a(y,b){b===void 0&&(b=!0);var T=s&&o.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return T.test(y)||o.regExp?s&&o.$supportsUnicodeFlag?b?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var i=Array.from(r),u=i[0],h=i[i.length-1];return a(u)+r+a(h,!1)}n.Search=c}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,n,p){var d=this&&this.__extends||(function(){var s=function(a,i){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,h){u.__proto__=h}||function(u,h){for(var y in h)Object.prototype.hasOwnProperty.call(h,y)&&(u[y]=h[y])},s(a,i)};return function(a,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");s(a,i);function u(){this.constructor=a}a.prototype=i===null?Object.create(i):(u.prototype=i.prototype,new u)}})(),g=t("../lib/keys"),m=t("../lib/useragent"),c=g.KEY_MODS,f=(function(){function s(a,i){this.$init(a,i,!1)}return s.prototype.$init=function(a,i,u){this.platform=i||(m.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(a),this.$singleCommand=u},s.prototype.addCommand=function(a){this.commands[a.name]&&this.removeCommand(a),this.commands[a.name]=a,a.bindKey&&this._buildKeyHash(a)},s.prototype.removeCommand=function(a,i){var u=a&&(typeof a=="string"?a:a.name);a=this.commands[u],i||delete this.commands[u];var h=this.commandKeyBinding;for(var y in h){var b=h[y];if(b==a)delete h[y];else if(Array.isArray(b)){var T=b.indexOf(a);T!=-1&&(b.splice(T,1),b.length==1&&(h[y]=b[0]))}}},s.prototype.bindKey=function(a,i,u){if(typeof a=="object"&&a&&(u==null&&(u=a.position),a=a[this.platform]),!!a){if(typeof i=="function")return this.addCommand({exec:i,bindKey:a,name:i.name||a});a.split("|").forEach(function(h){var y="";if(h.indexOf(" ")!=-1){var b=h.split(/\s+/);h=b.pop(),b.forEach(function(A){var S=this.parseKeys(A),M=c[S.hashId]+S.key;y+=(y?" ":"")+M,this._addCommandToBinding(y,"chainKeys")},this),y+=" "}var T=this.parseKeys(h),$=c[T.hashId]+T.key;this._addCommandToBinding(y+$,i,u)},this)}},s.prototype._addCommandToBinding=function(a,i,u){var h=this.commandKeyBinding,y;if(!i)delete h[a];else if(!h[a]||this.$singleCommand)h[a]=i;else{Array.isArray(h[a])?(y=h[a].indexOf(i))!=-1&&h[a].splice(y,1):h[a]=[h[a]],typeof u!="number"&&(u=r(i));var b=h[a];for(y=0;y<b.length;y++){var T=b[y],$=r(T);if($>u)break}b.splice(y,0,i)}},s.prototype.addCommands=function(a){a&&Object.keys(a).forEach(function(i){var u=a[i];if(u){if(typeof u=="string")return this.bindKey(u,i);typeof u=="function"&&(u={exec:u}),typeof u=="object"&&(u.name||(u.name=i),this.addCommand(u))}},this)},s.prototype.removeCommands=function(a){Object.keys(a).forEach(function(i){this.removeCommand(a[i])},this)},s.prototype.bindKeys=function(a){Object.keys(a).forEach(function(i){this.bindKey(i,a[i])},this)},s.prototype._buildKeyHash=function(a){this.bindKey(a.bindKey,a)},s.prototype.parseKeys=function(a){var i=a.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function($){return $}),u=i.pop(),h=g[u];if(g.FUNCTION_KEYS[h])u=g.FUNCTION_KEYS[h].toLowerCase();else if(i.length){if(i.length==1&&i[0]=="shift")return{key:u.toUpperCase(),hashId:-1}}else return{key:u,hashId:-1};for(var y=0,b=i.length;b--;){var T=g.KEY_MODS[i[b]];if(T==null)return typeof console<"u"&&console.error("invalid modifier "+i[b]+" in "+a),!1;y|=T}return{key:u,hashId:y}},s.prototype.findKeyCommand=function(a,i){var u=c[a]+i;return this.commandKeyBinding[u]},s.prototype.handleKeyboard=function(a,i,u,h){if(!(h<0)){var y=c[i]+u,b=this.commandKeyBinding[y];return a.$keyChain&&(a.$keyChain+=" "+y,b=this.commandKeyBinding[a.$keyChain]||b),b&&(b=="chainKeys"||b[b.length-1]=="chainKeys")?(a.$keyChain=a.$keyChain||y,{command:"null"}):(a.$keyChain&&((!i||i==4)&&u.length==1?a.$keyChain=a.$keyChain.slice(0,-y.length-1):(i==-1||h>0)&&(a.$keyChain="")),{command:b})}},s.prototype.getStatusText=function(a,i){return i.$keyChain||""},s})();function r(s){return typeof s=="object"&&s.bindKey&&s.bindKey.position||(s.isDefault?-100:0)}var o=(function(s){d(a,s);function a(i,u){var h=s.call(this,i,u)||this;return h.$singleCommand=!0,h}return a})(f);o.call=function(s,a,i){f.prototype.$init.call(s,a,i,!0)},f.call=function(s,a,i){f.prototype.$init.call(s,a,i,!1)},n.HashHandler=o,n.MultiHashHandler=f}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(t,n,p){var d=this&&this.__extends||(function(){var r=function(o,s){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,i){a.__proto__=i}||function(a,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(a[u]=i[u])},r(o,s)};return function(o,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");r(o,s);function a(){this.constructor=o}o.prototype=s===null?Object.create(s):(a.prototype=s.prototype,new a)}})(),g=t("../lib/oop"),m=t("../keyboard/hash_handler").MultiHashHandler,c=t("../lib/event_emitter").EventEmitter,f=(function(r){d(o,r);function o(s,a){var i=r.call(this,a,s)||this;return i.byName=i.commands,i.setDefaultHandler("exec",function(u){return u.args?u.command.exec(u.editor,u.args,u.event,!1):u.command.exec(u.editor,{},u.event,!0)}),i}return o.prototype.exec=function(s,a,i){if(Array.isArray(s)){for(var u=s.length;u--;)if(this.exec(s[u],a,i))return!0;return!1}if(typeof s=="string"&&(s=this.commands[s]),!this.canExecute(s,a))return!1;var h={editor:a,command:s,args:i};return h.returnValue=this._emit("exec",h),this._signal("afterExec",h),h.returnValue!==!1},o.prototype.canExecute=function(s,a){return typeof s=="string"&&(s=this.commands[s]),!(!s||a&&a.$readOnly&&!s.readOnly||this.$checkCommandState!=!1&&s.isAvailable&&!s.isAvailable(a))},o.prototype.toggleRecording=function(s){if(!this.$inReplay)return s&&s._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=(function(a){this.macro.push([a.command,a.args])}).bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},o.prototype.replay=function(s){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(s);try{this.$inReplay=!0,this.macro.forEach(function(a){typeof a=="string"?this.exec(a,s):this.exec(a[0],s,a[1])},this)}finally{this.$inReplay=!1}}},o.prototype.trimMacro=function(s){return s.map(function(a){return typeof a[0]!="string"&&(a[0]=a[0].name),a[1]||(a=a[0]),a})},o})(m);g.implement(f.prototype,c),n.CommandManager=f}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(t,n,p){var d=t("../lib/lang"),g=t("../config"),m=t("../range").Range;function c(r,o){return{win:r,mac:o}}n.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:c("Ctrl-,","Command-,"),exec:function(r){g.loadModule("ace/ext/settings_menu",function(o){o.init(r),r.showSettingsMenu()})},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:c("Alt-E","F4"),exec:function(r){g.loadModule("ace/ext/error_marker",function(o){o.showErrorMarker(r,1)})},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:c("Alt-Shift-E","Shift-F4"),exec:function(r){g.loadModule("ace/ext/error_marker",function(o){o.showErrorMarker(r,-1)})},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:c("Ctrl-A","Command-A"),exec:function(r){r.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:c(null,"Ctrl-L"),exec:function(r){r.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:c("Ctrl-L","Command-L"),exec:function(r,o){typeof o=="number"&&!isNaN(o)&&r.gotoLine(o),r.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:c("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(r){r.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:c("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(r){r.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:c("F2","F2"),exec:function(r){r.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:c("Alt-F2","Alt-F2"),exec:function(r){r.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:c(null,"Ctrl-Command-Option-0"),exec:function(r){r.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:c(null,"Ctrl-Command-Option-0"),exec:function(r){r.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:c("Alt-0","Command-Option-0"),exec:function(r){r.session.foldAll(),r.session.unfold(r.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:c("Alt-Shift-0","Command-Option-Shift-0"),exec:function(r){r.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:c("Ctrl-K","Command-G"),exec:function(r){r.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:c("Ctrl-Shift-K","Command-Shift-G"),exec:function(r){r.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:c("Alt-K","Ctrl-G"),exec:function(r){r.selection.isEmpty()?r.selection.selectWord():r.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:c("Alt-Shift-K","Ctrl-Shift-G"),exec:function(r){r.selection.isEmpty()?r.selection.selectWord():r.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:c("Ctrl-F","Command-F"),exec:function(r){g.loadModule("ace/ext/searchbox",function(o){o.Search(r)})},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(r){r.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:c("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(r){r.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:c("Ctrl-Home","Command-Home|Command-Up"),exec:function(r){r.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:c("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(r){r.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:c("Up","Up|Ctrl-P"),exec:function(r,o){r.navigateUp(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:c("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(r){r.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:c("Ctrl-End","Command-End|Command-Down"),exec:function(r){r.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:c("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(r){r.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:c("Down","Down|Ctrl-N"),exec:function(r,o){r.navigateDown(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:c("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(r){r.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:c("Ctrl-Left","Option-Left"),exec:function(r){r.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:c("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(r){r.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:c("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(r){r.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:c("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(r){r.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:c("Left","Left|Ctrl-B"),exec:function(r,o){r.navigateLeft(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:c("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(r){r.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:c("Ctrl-Right","Option-Right"),exec:function(r){r.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:c("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(r){r.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:c("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(r){r.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:c("Shift-Right","Shift-Right"),exec:function(r){r.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:c("Right","Right|Ctrl-F"),exec:function(r,o){r.navigateRight(o.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(r){r.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:c(null,"Option-PageDown"),exec:function(r){r.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:c("PageDown","PageDown|Ctrl-V"),exec:function(r){r.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(r){r.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:c(null,"Option-PageUp"),exec:function(r){r.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(r){r.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:c("Ctrl-Up",null),exec:function(r){r.renderer.scrollBy(0,-2*r.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:c("Ctrl-Down",null),exec:function(r){r.renderer.scrollBy(0,2*r.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(r){r.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(r){r.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:c("Ctrl-Alt-E","Command-Option-E"),exec:function(r){r.commands.toggleRecording(r)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:c("Ctrl-Shift-E","Command-Shift-E"),exec:function(r){r.commands.replay(r)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:c("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(r){r.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:c("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(r){r.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:c("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(r){r.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:c(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(r){},readOnly:!0},{name:"cut",description:"Cut",exec:function(r){var o=r.$copyWithEmptySelection&&r.selection.isEmpty(),s=o?r.selection.getLineRange():r.selection.getRange();r._emit("cut",s),s.isEmpty()||r.session.remove(s),r.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(r,o){r.$handlePaste(o)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:c("Ctrl-D","Command-D"),exec:function(r){r.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:c("Ctrl-Shift-D","Command-Shift-D"),exec:function(r){r.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:c("Ctrl-Alt-S","Command-Alt-S"),exec:function(r){r.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:c("Ctrl-/","Command-/"),exec:function(r){r.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:c("Ctrl-Shift-/","Command-Shift-/"),exec:function(r){r.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:c("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(r){r.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:c("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(r){r.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:c("Ctrl-H","Command-Option-F"),exec:function(r){g.loadModule("ace/ext/searchbox",function(o){o.Search(r,!0)})}},{name:"undo",description:"Undo",bindKey:c("Ctrl-Z","Command-Z"),exec:function(r){r.undo()}},{name:"redo",description:"Redo",bindKey:c("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(r){r.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:c("Alt-Shift-Up","Command-Option-Up"),exec:function(r){r.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:c("Alt-Up","Option-Up"),exec:function(r){r.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:c("Alt-Shift-Down","Command-Option-Down"),exec:function(r){r.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:c("Alt-Down","Option-Down"),exec:function(r){r.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:c("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(r){r.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:c("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(r){r.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:c("Shift-Delete",null),exec:function(r){if(r.selection.isEmpty())r.remove("left");else return!1},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:c("Alt-Backspace","Command-Backspace"),exec:function(r){r.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:c("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(r){r.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:c("Ctrl-Shift-Backspace",null),exec:function(r){var o=r.selection.getRange();o.start.column=0,r.session.remove(o)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:c("Ctrl-Shift-Delete",null),exec:function(r){var o=r.selection.getRange();o.end.column=Number.MAX_VALUE,r.session.remove(o)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:c("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(r){r.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:c("Ctrl-Delete","Alt-Delete"),exec:function(r){r.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:c("Shift-Tab","Shift-Tab"),exec:function(r){r.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:c("Tab","Tab"),exec:function(r){r.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:c("Ctrl-[","Ctrl-["),exec:function(r){r.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:c("Ctrl-]","Ctrl-]"),exec:function(r){r.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(r,o){r.insert(o)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(r,o){r.insert(d.stringRepeat(o.text||"",o.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:c(null,"Ctrl-O"),exec:function(r){r.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:c("Alt-Shift-X","Ctrl-T"),exec:function(r){r.transposeLetters()},multiSelectAction:function(r){r.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:c("Ctrl-U","Ctrl-U"),exec:function(r){r.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:c("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(r){r.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:c(null,null),exec:function(r){r.autoIndent()},scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:c("Ctrl-Shift-L","Command-Shift-L"),exec:function(r){var o=r.selection.getRange();o.start.column=o.end.column=0,o.end.row++,r.selection.setRange(o,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:c("Ctrl+F3","F3"),exec:function(r){r.openLink()}},{name:"joinlines",description:"Join lines",bindKey:c(null,null),exec:function(r){for(var o=r.selection.isBackwards(),s=o?r.selection.getSelectionLead():r.selection.getSelectionAnchor(),a=o?r.selection.getSelectionAnchor():r.selection.getSelectionLead(),i=r.session.doc.getLine(s.row).length,u=r.session.doc.getTextRange(r.selection.getRange()),h=u.replace(/\n\s*/," ").length,y=r.session.doc.getLine(s.row),b=s.row+1;b<=a.row+1;b++){var T=d.stringTrimLeft(d.stringTrimRight(r.session.doc.getLine(b)));T.length!==0&&(T=" "+T),y+=T}a.row+1<r.session.doc.getLength()-1&&(y+=r.session.doc.getNewLineCharacter()),r.clearSelection(),r.session.doc.replace(new m(s.row,0,a.row+2,0),y),h>0?(r.selection.moveCursorTo(s.row,s.column),r.selection.selectTo(s.row,s.column+h)):(i=r.session.doc.getLine(s.row).length>i?i+1:i,r.selection.moveCursorTo(s.row,i))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:c(null,null),exec:function(r){var o=r.session.doc.getLength()-1,s=r.session.doc.getLine(o).length,a=r.selection.rangeList.ranges,i=[];a.length<1&&(a=[r.selection.getRange()]);for(var u=0;u<a.length;u++)u==a.length-1&&(a[u].end.row===o&&a[u].end.column===s||i.push(new m(a[u].end.row,a[u].end.column,o,s))),u===0?a[u].start.row===0&&a[u].start.column===0||i.push(new m(0,0,a[u].start.row,a[u].start.column)):i.push(new m(a[u-1].end.row,a[u-1].end.column,a[u].start.row,a[u].start.column));r.exitMultiSelectMode(),r.clearSelection();for(var u=0;u<i.length;u++)r.selection.addRange(i[u],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(r){r.selection.clearSelection(),r.navigateLineEnd(),r.insert(`
1364
1364
  `)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",description:"Add new line before the current line",exec:function(r){r.selection.clearSelection();var o=r.getCursorPosition();r.selection.moveTo(o.row-1,Number.MAX_VALUE),r.insert(`
1365
- `),o.row===0&&r.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",exec:function(r){console.warn("This is an obsolete command. Please use `openCommandPalette` instead."),r.prompt({$type:"commands"})},readOnly:!0},{name:"openCommandPalette",description:"Open command palette",bindKey:l("F1","F1"),exec:function(r){r.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:l(null,null),exec:function(r){r.prompt({$type:"modes"})},readOnly:!0}];for(var f=1;f<9;f++)n.commands.push({name:"foldToLevel"+f,description:"Fold To Level "+f,level:f,exec:function(r){r.session.foldToLevel(this.level)},scrollIntoView:"center",readOnly:!0})}),ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys","ace/mouse/default_gutter_handler"],function(t,n,p){var d=t("../lib/keys"),g=t("../mouse/default_gutter_handler").GutterTooltip,m=(function(){function f(r){this.editor=r,this.gutterLayer=r.renderer.$gutterLayer,this.element=r.renderer.$gutter,this.lines=r.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new g(this.editor)}return f.prototype.addListener=function(){this.element.addEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.addEventListener("focusout",this.$blurGutter.bind(this)),this.editor.on("mousewheel",this.$blurGutter.bind(this))},f.prototype.removeListener=function(){this.element.removeEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.removeEventListener("focusout",this.$blurGutter.bind(this)),this.editor.off("mousewheel",this.$blurGutter.bind(this))},f.prototype.$onGutterKeyDown=function(r){if(this.annotationTooltip.isOpen){r.preventDefault(),r.keyCode===d.escape&&this.annotationTooltip.hideTooltip();return}if(r.target===this.element){if(r.keyCode!=d.enter)return;r.preventDefault();var o=this.editor.getCursorPosition().row;this.editor.isRowVisible(o)||this.editor.scrollToLine(o,!0,!0),setTimeout((function(){var s=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),a=this.$findNearestFoldWidget(s),i=this.$findNearestAnnotation(s);if(!(a===null&&i===null)){if(a===null&&i!==null){this.activeRowIndex=i,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}if(a!==null&&i===null){this.activeRowIndex=a,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex);return}if(Math.abs(i-s)<Math.abs(a-s)){this.activeRowIndex=i,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}else{this.activeRowIndex=a,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex);return}}}).bind(this),10);return}this.$handleGutterKeyboardInteraction(r),setTimeout((function(){this.editor._signal("gutterkeydown",new l(r,this))}).bind(this),10)},f.prototype.$handleGutterKeyboardInteraction=function(r){if(r.keyCode===d.tab){r.preventDefault();return}if(r.keyCode===d.escape){r.preventDefault(),this.$blurGutter(),this.element.focus(),this.lane=null;return}if(r.keyCode===d.up){switch(r.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetUp();break;case"annotation":this.$moveAnnotationUp();break}return}if(r.keyCode===d.down){switch(r.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetDown();break;case"annotation":this.$moveAnnotationDown();break}return}if(r.keyCode===d.left){r.preventDefault(),this.$switchLane("annotation");return}if(r.keyCode===d.right){r.preventDefault(),this.$switchLane("fold");return}if(r.keyCode===d.enter||r.keyCode===d.space){switch(r.preventDefault(),this.activeLane){case"fold":if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="start"){var o=this.$rowIndexToRow(this.activeRowIndex);this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex),r),setTimeout((function(){this.$rowIndexToRow(this.activeRowIndex)!==o&&(this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=this.$rowToRowIndex(o),this.$focusFoldWidget(this.activeRowIndex))}).bind(this),10);break}else if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="end")break;return;case"annotation":var s=this.lines.cells[this.activeRowIndex].element.childNodes[2],a=s.getBoundingClientRect(),i=this.annotationTooltip.getElement().style;i.left=a.right+"px",i.top=a.bottom+"px",this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex));break}return}},f.prototype.$blurGutter=function(){if(this.activeRowIndex!==null)switch(this.activeLane){case"fold":this.$blurFoldWidget(this.activeRowIndex);break;case"annotation":this.$blurAnnotation(this.activeRowIndex);break}this.annotationTooltip.isOpen&&this.annotationTooltip.hideTooltip()},f.prototype.$isFoldWidgetVisible=function(r){var o=this.editor.isRowFullyVisible(this.$rowIndexToRow(r)),s=this.$getFoldWidget(r).style.display!=="none";return o&&s},f.prototype.$isAnnotationVisible=function(r){var o=this.editor.isRowFullyVisible(this.$rowIndexToRow(r)),s=this.$getAnnotation(r).style.display!=="none";return o&&s},f.prototype.$getFoldWidget=function(r){var o=this.lines.get(r),s=o.element;return s.childNodes[1]},f.prototype.$getAnnotation=function(r){var o=this.lines.get(r),s=o.element;return s.childNodes[2]},f.prototype.$findNearestFoldWidget=function(r){if(this.$isFoldWidgetVisible(r))return r;for(var o=0;r-o>0||r+o<this.lines.getLength()-1;){if(o++,r-o>=0&&this.$isFoldWidgetVisible(r-o))return r-o;if(r+o<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(r+o))return r+o}return null},f.prototype.$findNearestAnnotation=function(r){if(this.$isAnnotationVisible(r))return r;for(var o=0;r-o>0||r+o<this.lines.getLength()-1;){if(o++,r-o>=0&&this.$isAnnotationVisible(r-o))return r-o;if(r+o<=this.lines.getLength()-1&&this.$isAnnotationVisible(r+o))return r+o}return null},f.prototype.$focusFoldWidget=function(r){if(r!=null){var o=this.$getFoldWidget(r);o.classList.add(this.editor.renderer.keyboardFocusClassName),o.focus()}},f.prototype.$focusAnnotation=function(r){if(r!=null){var o=this.$getAnnotation(r);o.classList.add(this.editor.renderer.keyboardFocusClassName),o.focus()}},f.prototype.$blurFoldWidget=function(r){var o=this.$getFoldWidget(r);o.classList.remove(this.editor.renderer.keyboardFocusClassName),o.blur()},f.prototype.$blurAnnotation=function(r){var o=this.$getAnnotation(r);o.classList.remove(this.editor.renderer.keyboardFocusClassName),o.blur()},f.prototype.$moveFoldWidgetUp=function(){for(var r=this.activeRowIndex;r>0;)if(r--,this.$isFoldWidgetVisible(r)){this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=r,this.$focusFoldWidget(this.activeRowIndex);return}},f.prototype.$moveFoldWidgetDown=function(){for(var r=this.activeRowIndex;r<this.lines.getLength()-1;)if(r++,this.$isFoldWidgetVisible(r)){this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=r,this.$focusFoldWidget(this.activeRowIndex);return}},f.prototype.$moveAnnotationUp=function(){for(var r=this.activeRowIndex;r>0;)if(r--,this.$isAnnotationVisible(r)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=r,this.$focusAnnotation(this.activeRowIndex);return}},f.prototype.$moveAnnotationDown=function(){for(var r=this.activeRowIndex;r<this.lines.getLength()-1;)if(r++,this.$isAnnotationVisible(r)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=r,this.$focusAnnotation(this.activeRowIndex);return}},f.prototype.$switchLane=function(r){switch(r){case"annotation":if(this.activeLane==="annotation")break;var o=this.$findNearestAnnotation(this.activeRowIndex);if(o==null)break;this.activeLane="annotation",this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=o,this.$focusAnnotation(this.activeRowIndex);break;case"fold":if(this.activeLane==="fold")break;var s=this.$findNearestFoldWidget(this.activeRowIndex);if(s==null)break;this.activeLane="fold",this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=s,this.$focusFoldWidget(this.activeRowIndex);break}},f.prototype.$rowIndexToRow=function(r){var o=this.lines.get(r);return o?o.row:null},f.prototype.$rowToRowIndex=function(r){for(var o=0;o<this.lines.getLength();o++){var s=this.lines.get(o);if(s.row==r)return o}return null},f})();n.GutterKeyboardHandler=m;var l=(function(){function f(r,o){this.gutterKeyboardHandler=o,this.domEvent=r}return f.prototype.getKey=function(){return d.keyCodeToString(this.domEvent.keyCode)},f.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},f.prototype.isInAnnotationLane=function(){return this.gutterKeyboardHandler.activeLane==="annotation"},f.prototype.isInFoldLane=function(){return this.gutterKeyboardHandler.activeLane==="fold"},f})();n.GutterKeyboardEvent=l}),ace.define("ace/editor",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/keyboard/gutter_handler","ace/config","ace/clipboard","ace/lib/keys"],function(t,n,p){var d=this&&this.__values||function(w){var v=typeof Symbol=="function"&&Symbol.iterator,C=v&&w[v],E=0;if(C)return C.call(w);if(w&&typeof w.length=="number")return{next:function(){return w&&E>=w.length&&(w=void 0),{value:w&&w[E++],done:!w}}};throw new TypeError(v?"Object is not iterable.":"Symbol.iterator is not defined.")},g=t("./lib/oop"),m=t("./lib/dom"),l=t("./lib/lang"),f=t("./lib/useragent"),r=t("./keyboard/textinput").TextInput,o=t("./mouse/mouse_handler").MouseHandler,s=t("./mouse/fold_handler").FoldHandler,a=t("./keyboard/keybinding").KeyBinding,i=t("./edit_session").EditSession,u=t("./search").Search,h=t("./range").Range,y=t("./lib/event_emitter").EventEmitter,b=t("./commands/command_manager").CommandManager,T=t("./commands/default_commands").commands,$=t("./config"),A=t("./token_iterator").TokenIterator,S=t("./keyboard/gutter_handler").GutterKeyboardHandler,M=t("./config").nls,R=t("./clipboard"),L=t("./lib/keys"),_=(function(){function w(v,C,E){this.session,this.$toDestroy=[];var x=v.getContainerElement();this.container=x,this.renderer=v,this.id="editor"+ ++w.$uid,this.commands=new b(f.isMac?"mac":"win",T),typeof document=="object"&&(this.textInput=new r(v.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new o(this),new s(this)),this.keyBinding=new a(this),this.$search=new u().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=l.delayedCall((function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}).bind(this)),this.on("change",function(k,O){O._$emitInputEvent.schedule(31)}),this.setSession(C||E&&E.session||new i("")),$.resetOptions(this),E&&this.setOptions(E),$._signal("editor",this)}return w.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0)},w.prototype.startOperation=function(v){this.session.startOperation(v)},w.prototype.endOperation=function(v){this.session.endOperation(v)},w.prototype.onStartOperation=function(v){this.curOp=this.session.curOp,this.curOp.scrollTop=this.renderer.scrollTop,this.prevOp=this.session.prevOp,v||(this.previousCommand=null)},w.prototype.onEndOperation=function(v){if(this.curOp&&this.session){if(v&&v.returnValue===!1){this.curOp=null;return}if(this._signal("beforeEndOperation"),!this.curOp)return;var C=this.curOp.command,E=C&&C.scrollIntoView;if(E){switch(E){case"center-animate":E="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var x=this.selection.getRange(),k=this.renderer.layerConfig;(x.start.row>=k.lastRow||x.end.row<=k.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break}E=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}this.$lastSel=this.session.selection.toJSON(),this.prevOp=this.curOp,this.curOp=null}},w.prototype.$historyTracker=function(v){if(this.$mergeUndoDeltas){var C=this.prevOp,E=this.$mergeableCommands,x=C.command&&v.command.name==C.command.name;if(v.command.name=="insertstring"){var k=v.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),x=x&&this.mergeNextCommand&&(!/\s/.test(k)||/\s/.test(C.args)),this.mergeNextCommand=!0}else x=x&&E.indexOf(v.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(x=!1),x?this.session.mergeUndoDeltas=!0:E.indexOf(v.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},w.prototype.setKeyboardHandler=function(v,C){if(v&&typeof v=="string"&&v!="ace"){this.$keybindingId=v;var E=this;$.loadModule(["keybinding",v],function(x){E.$keybindingId==v&&E.keyBinding.setKeyboardHandler(x&&x.handler),C&&C()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(v),C&&C()},w.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},w.prototype.setSession=function(v){if(this.session!=v){this.curOp&&this.endOperation(),this.curOp={};var C=this.session;if(C){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange),this.session.off("startOperation",this.$onStartOperation),this.session.off("endOperation",this.$onEndOperation);var E=this.session.getSelection();E.off("changeCursor",this.$onCursorChange),E.off("changeSelection",this.$onSelectionChange)}this.session=v,v?(this.$onDocumentChange=this.onDocumentChange.bind(this),v.on("change",this.$onDocumentChange),this.renderer.setSession(v),this.$onChangeMode=this.onChangeMode.bind(this),v.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),v.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),v.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),v.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),v.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),v.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=v.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.$onStartOperation=this.onStartOperation.bind(this),this.session.on("startOperation",this.$onStartOperation),this.$onEndOperation=this.onEndOperation.bind(this),this.session.on("endOperation",this.$onEndOperation),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(v)),this._signal("changeSession",{session:v,oldSession:C}),this.curOp=null,C&&C._signal("changeEditor",{oldEditor:this}),C&&(C.$editor=null),v&&v._signal("changeEditor",{editor:this}),v&&(v.$editor=this),v&&!v.destroyed&&v.bgTokenizer.scheduleStart()}},w.prototype.getSession=function(){return this.session},w.prototype.setValue=function(v,C){return this.session.doc.setValue(v),C?C==1?this.navigateFileEnd():C==-1&&this.navigateFileStart():this.selectAll(),v},w.prototype.getValue=function(){return this.session.getValue()},w.prototype.getSelection=function(){return this.selection},w.prototype.resize=function(v){this.renderer.onResize(v)},w.prototype.setTheme=function(v,C){this.renderer.setTheme(v,C)},w.prototype.getTheme=function(){return this.renderer.getTheme()},w.prototype.setStyle=function(v){this.renderer.setStyle(v)},w.prototype.unsetStyle=function(v){this.renderer.unsetStyle(v)},w.prototype.getFontSize=function(){return this.getOption("fontSize")||m.computedStyle(this.container).fontSize},w.prototype.setFontSize=function(v){this.setOption("fontSize",v)},w.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var v=this;this.$highlightPending=!0,setTimeout(function(){v.$highlightPending=!1;var C=v.session;if(!(!C||C.destroyed)){C.$bracketHighlight&&(C.$bracketHighlight.markerIds.forEach(function(F){C.removeMarker(F)}),C.$bracketHighlight=null);var E=v.getCursorPosition(),x=v.getKeyboardHandler(),k=x&&x.$getDirectionForHighlight&&x.$getDirectionForHighlight(v),O=C.getMatchingBracketRanges(E,k);if(!O){var D=new A(C,E.row,E.column),N=D.getCurrentToken();if(N&&/\b(?:tag-open|tag-name)/.test(N.type)){var P=C.getMatchingTags(E);P&&(O=[P.openTagName.isEmpty()?P.openTag:P.openTagName,P.closeTagName.isEmpty()?P.closeTag:P.closeTagName])}}if(!O&&C.$mode.getMatching&&(O=C.$mode.getMatching(v.session)),!O){v.getHighlightIndentGuides()&&v.renderer.$textLayer.$highlightIndentGuide();return}var z="ace_bracket";Array.isArray(O)?O.length==1&&(z="ace_error_bracket"):O=[O],O.length==2&&(h.comparePoints(O[0].end,O[1].start)==0?O=[h.fromPoints(O[0].start,O[1].end)]:h.comparePoints(O[0].start,O[1].end)==0&&(O=[h.fromPoints(O[1].start,O[0].end)])),C.$bracketHighlight={ranges:O,markerIds:O.map(function(F){return C.addMarker(F,z,"text")})},v.getHighlightIndentGuides()&&v.renderer.$textLayer.$highlightIndentGuide()}},50)}},w.prototype.focus=function(){this.textInput.focus()},w.prototype.isFocused=function(){return this.textInput.isFocused()},w.prototype.blur=function(){this.textInput.blur()},w.prototype.onFocus=function(v){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",v))},w.prototype.onBlur=function(v){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",v))},w.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},w.prototype.onDocumentChange=function(v){var C=this.session.$useWrapMode,E=v.start.row==v.end.row?v.end.row:1/0;this.renderer.updateLines(v.start.row,E,C),this._signal("change",v),this.$cursorChange()},w.prototype.onTokenizerUpdate=function(v){var C=v.data;this.renderer.updateLines(C.first,C.last)},w.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},w.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},w.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},w.prototype.$updateHighlightActiveLine=function(){var v=this.getSession(),C;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&(C=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(C=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&(C=!1)),v.$highlightLineMarker&&!C)v.removeMarker(v.$highlightLineMarker.id),v.$highlightLineMarker=null;else if(!v.$highlightLineMarker&&C){var E=new h(C.row,C.column,C.row,1/0);E.id=v.addMarker(E,"ace_active-line","screenLine"),v.$highlightLineMarker=E}else C&&(v.$highlightLineMarker.start.row=C.row,v.$highlightLineMarker.end.row=C.row,v.$highlightLineMarker.start.column=C.column,v._signal("changeBackMarker"))},w.prototype.onSelectionChange=function(v){var C=this.session;if(C.$selectionMarker&&C.removeMarker(C.$selectionMarker),C.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var E=this.selection.getRange(),x=this.getSelectionStyle();C.$selectionMarker=C.addMarker(E,"ace_selection",x)}var k=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(k),this._signal("changeSelection")},w.prototype.$getSelectionHighLightRegexp=function(){var v=this.session,C=this.getSelectionRange();if(!(C.isEmpty()||C.isMultiLine())){var E=C.start.column,x=C.end.column,k=v.getLine(C.start.row),O=k.substring(E,x);if(!(O.length>5e3||!/[\w\d]/.test(O))){var D=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:O}),N=k.substring(E-1,x+1);if(D.test(N))return D}}},w.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},w.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},w.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},w.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},w.prototype.onChangeMode=function(v){this.renderer.updateText(),this._emit("changeMode",v)},w.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},w.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},w.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},w.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},w.prototype.getCopyText=function(){var v=this.getSelectedText(),C=this.session.doc.getNewLineCharacter(),E=!1;if(!v&&this.$copyWithEmptySelection){E=!0;for(var x=this.selection.getAllRanges(),k=0;k<x.length;k++){var O=x[k];k&&x[k-1].start.row==O.start.row||(v+=this.session.getLine(O.start.row)+C)}}var D={text:v};return this._signal("copy",D),R.lineMode=E?D.text:!1,D.text},w.prototype.onCopy=function(){this.commands.exec("copy",this)},w.prototype.onCut=function(){this.commands.exec("cut",this)},w.prototype.onPaste=function(v,C){var E={text:v,event:C};this.commands.exec("paste",this,E)},w.prototype.$handlePaste=function(v){typeof v=="string"&&(v={text:v}),this._signal("paste",v);var C=v.text,E=C===R.lineMode,x=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)E?x.insert({row:this.selection.lead.row,column:0},C):this.insert(C);else if(E)this.selection.rangeList.ranges.forEach(function(z){x.insert({row:z.start.row,column:0},C)});else{var k=C.split(/\r\n|\r|\n/),O=this.selection.rangeList.ranges,D=k.length==2&&(!k[0]||!k[1]);if(k.length!=O.length||D)return this.commands.exec("insertstring",this,C);for(var N=O.length;N--;){var P=O[N];P.isEmpty()||x.remove(P),x.insert(P.start,k[N])}}},w.prototype.execCommand=function(v,C){return this.commands.exec(v,this,C)},w.prototype.insert=function(v,C){var E=this.session,x=E.getMode(),k=this.getCursorPosition();if(this.getBehavioursEnabled()&&!C){var O=x.transformAction(E.getState(k.row),"insertion",this,E,v);O&&(v!==O.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),v=O.text)}if(v==" "&&(v=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()&&v.indexOf(`
1366
- `)==-1){var D=h.fromPoints(k,k);D.end.column+=v.length,this.session.remove(D)}}else{var D=this.getSelectionRange();k=this.session.remove(D),this.clearSelection()}if(v==`
1365
+ `),o.row===0&&r.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",exec:function(r){console.warn("This is an obsolete command. Please use `openCommandPalette` instead."),r.prompt({$type:"commands"})},readOnly:!0},{name:"openCommandPalette",description:"Open command palette",bindKey:c("F1","F1"),exec:function(r){r.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:c(null,null),exec:function(r){r.prompt({$type:"modes"})},readOnly:!0}];for(var f=1;f<9;f++)n.commands.push({name:"foldToLevel"+f,description:"Fold To Level "+f,level:f,exec:function(r){r.session.foldToLevel(this.level)},scrollIntoView:"center",readOnly:!0})}),ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys","ace/mouse/default_gutter_handler"],function(t,n,p){var d=t("../lib/keys"),g=t("../mouse/default_gutter_handler").GutterTooltip,m=(function(){function f(r){this.editor=r,this.gutterLayer=r.renderer.$gutterLayer,this.element=r.renderer.$gutter,this.lines=r.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new g(this.editor)}return f.prototype.addListener=function(){this.element.addEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.addEventListener("focusout",this.$blurGutter.bind(this)),this.editor.on("mousewheel",this.$blurGutter.bind(this))},f.prototype.removeListener=function(){this.element.removeEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.removeEventListener("focusout",this.$blurGutter.bind(this)),this.editor.off("mousewheel",this.$blurGutter.bind(this))},f.prototype.$onGutterKeyDown=function(r){if(this.annotationTooltip.isOpen){r.preventDefault(),r.keyCode===d.escape&&this.annotationTooltip.hideTooltip();return}if(r.target===this.element){if(r.keyCode!=d.enter)return;r.preventDefault();var o=this.editor.getCursorPosition().row;this.editor.isRowVisible(o)||this.editor.scrollToLine(o,!0,!0),setTimeout((function(){var s=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),a=this.$findNearestFoldWidget(s),i=this.$findNearestAnnotation(s);if(!(a===null&&i===null)){if(a===null&&i!==null){this.activeRowIndex=i,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}if(a!==null&&i===null){this.activeRowIndex=a,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex);return}if(Math.abs(i-s)<Math.abs(a-s)){this.activeRowIndex=i,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}else{this.activeRowIndex=a,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex);return}}}).bind(this),10);return}this.$handleGutterKeyboardInteraction(r),setTimeout((function(){this.editor._signal("gutterkeydown",new c(r,this))}).bind(this),10)},f.prototype.$handleGutterKeyboardInteraction=function(r){if(r.keyCode===d.tab){r.preventDefault();return}if(r.keyCode===d.escape){r.preventDefault(),this.$blurGutter(),this.element.focus(),this.lane=null;return}if(r.keyCode===d.up){switch(r.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetUp();break;case"annotation":this.$moveAnnotationUp();break}return}if(r.keyCode===d.down){switch(r.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetDown();break;case"annotation":this.$moveAnnotationDown();break}return}if(r.keyCode===d.left){r.preventDefault(),this.$switchLane("annotation");return}if(r.keyCode===d.right){r.preventDefault(),this.$switchLane("fold");return}if(r.keyCode===d.enter||r.keyCode===d.space){switch(r.preventDefault(),this.activeLane){case"fold":if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="start"){var o=this.$rowIndexToRow(this.activeRowIndex);this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex),r),setTimeout((function(){this.$rowIndexToRow(this.activeRowIndex)!==o&&(this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=this.$rowToRowIndex(o),this.$focusFoldWidget(this.activeRowIndex))}).bind(this),10);break}else if(this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]==="end")break;return;case"annotation":var s=this.lines.cells[this.activeRowIndex].element.childNodes[2],a=s.getBoundingClientRect(),i=this.annotationTooltip.getElement().style;i.left=a.right+"px",i.top=a.bottom+"px",this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex));break}return}},f.prototype.$blurGutter=function(){if(this.activeRowIndex!==null)switch(this.activeLane){case"fold":this.$blurFoldWidget(this.activeRowIndex);break;case"annotation":this.$blurAnnotation(this.activeRowIndex);break}this.annotationTooltip.isOpen&&this.annotationTooltip.hideTooltip()},f.prototype.$isFoldWidgetVisible=function(r){var o=this.editor.isRowFullyVisible(this.$rowIndexToRow(r)),s=this.$getFoldWidget(r).style.display!=="none";return o&&s},f.prototype.$isAnnotationVisible=function(r){var o=this.editor.isRowFullyVisible(this.$rowIndexToRow(r)),s=this.$getAnnotation(r).style.display!=="none";return o&&s},f.prototype.$getFoldWidget=function(r){var o=this.lines.get(r),s=o.element;return s.childNodes[1]},f.prototype.$getAnnotation=function(r){var o=this.lines.get(r),s=o.element;return s.childNodes[2]},f.prototype.$findNearestFoldWidget=function(r){if(this.$isFoldWidgetVisible(r))return r;for(var o=0;r-o>0||r+o<this.lines.getLength()-1;){if(o++,r-o>=0&&this.$isFoldWidgetVisible(r-o))return r-o;if(r+o<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(r+o))return r+o}return null},f.prototype.$findNearestAnnotation=function(r){if(this.$isAnnotationVisible(r))return r;for(var o=0;r-o>0||r+o<this.lines.getLength()-1;){if(o++,r-o>=0&&this.$isAnnotationVisible(r-o))return r-o;if(r+o<=this.lines.getLength()-1&&this.$isAnnotationVisible(r+o))return r+o}return null},f.prototype.$focusFoldWidget=function(r){if(r!=null){var o=this.$getFoldWidget(r);o.classList.add(this.editor.renderer.keyboardFocusClassName),o.focus()}},f.prototype.$focusAnnotation=function(r){if(r!=null){var o=this.$getAnnotation(r);o.classList.add(this.editor.renderer.keyboardFocusClassName),o.focus()}},f.prototype.$blurFoldWidget=function(r){var o=this.$getFoldWidget(r);o.classList.remove(this.editor.renderer.keyboardFocusClassName),o.blur()},f.prototype.$blurAnnotation=function(r){var o=this.$getAnnotation(r);o.classList.remove(this.editor.renderer.keyboardFocusClassName),o.blur()},f.prototype.$moveFoldWidgetUp=function(){for(var r=this.activeRowIndex;r>0;)if(r--,this.$isFoldWidgetVisible(r)){this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=r,this.$focusFoldWidget(this.activeRowIndex);return}},f.prototype.$moveFoldWidgetDown=function(){for(var r=this.activeRowIndex;r<this.lines.getLength()-1;)if(r++,this.$isFoldWidgetVisible(r)){this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=r,this.$focusFoldWidget(this.activeRowIndex);return}},f.prototype.$moveAnnotationUp=function(){for(var r=this.activeRowIndex;r>0;)if(r--,this.$isAnnotationVisible(r)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=r,this.$focusAnnotation(this.activeRowIndex);return}},f.prototype.$moveAnnotationDown=function(){for(var r=this.activeRowIndex;r<this.lines.getLength()-1;)if(r++,this.$isAnnotationVisible(r)){this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=r,this.$focusAnnotation(this.activeRowIndex);return}},f.prototype.$switchLane=function(r){switch(r){case"annotation":if(this.activeLane==="annotation")break;var o=this.$findNearestAnnotation(this.activeRowIndex);if(o==null)break;this.activeLane="annotation",this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=o,this.$focusAnnotation(this.activeRowIndex);break;case"fold":if(this.activeLane==="fold")break;var s=this.$findNearestFoldWidget(this.activeRowIndex);if(s==null)break;this.activeLane="fold",this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=s,this.$focusFoldWidget(this.activeRowIndex);break}},f.prototype.$rowIndexToRow=function(r){var o=this.lines.get(r);return o?o.row:null},f.prototype.$rowToRowIndex=function(r){for(var o=0;o<this.lines.getLength();o++){var s=this.lines.get(o);if(s.row==r)return o}return null},f})();n.GutterKeyboardHandler=m;var c=(function(){function f(r,o){this.gutterKeyboardHandler=o,this.domEvent=r}return f.prototype.getKey=function(){return d.keyCodeToString(this.domEvent.keyCode)},f.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},f.prototype.isInAnnotationLane=function(){return this.gutterKeyboardHandler.activeLane==="annotation"},f.prototype.isInFoldLane=function(){return this.gutterKeyboardHandler.activeLane==="fold"},f})();n.GutterKeyboardEvent=c}),ace.define("ace/editor",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/keyboard/gutter_handler","ace/config","ace/clipboard","ace/lib/keys"],function(t,n,p){var d=this&&this.__values||function(w){var v=typeof Symbol=="function"&&Symbol.iterator,C=v&&w[v],E=0;if(C)return C.call(w);if(w&&typeof w.length=="number")return{next:function(){return w&&E>=w.length&&(w=void 0),{value:w&&w[E++],done:!w}}};throw new TypeError(v?"Object is not iterable.":"Symbol.iterator is not defined.")},g=t("./lib/oop"),m=t("./lib/dom"),c=t("./lib/lang"),f=t("./lib/useragent"),r=t("./keyboard/textinput").TextInput,o=t("./mouse/mouse_handler").MouseHandler,s=t("./mouse/fold_handler").FoldHandler,a=t("./keyboard/keybinding").KeyBinding,i=t("./edit_session").EditSession,u=t("./search").Search,h=t("./range").Range,y=t("./lib/event_emitter").EventEmitter,b=t("./commands/command_manager").CommandManager,T=t("./commands/default_commands").commands,$=t("./config"),A=t("./token_iterator").TokenIterator,S=t("./keyboard/gutter_handler").GutterKeyboardHandler,M=t("./config").nls,R=t("./clipboard"),L=t("./lib/keys"),_=(function(){function w(v,C,E){this.session,this.$toDestroy=[];var x=v.getContainerElement();this.container=x,this.renderer=v,this.id="editor"+ ++w.$uid,this.commands=new b(f.isMac?"mac":"win",T),typeof document=="object"&&(this.textInput=new r(v.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new o(this),new s(this)),this.keyBinding=new a(this),this.$search=new u().set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=c.delayedCall((function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}).bind(this)),this.on("change",function(k,D){D._$emitInputEvent.schedule(31)}),this.setSession(C||E&&E.session||new i("")),$.resetOptions(this),E&&this.setOptions(E),$._signal("editor",this)}return w.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0)},w.prototype.startOperation=function(v){this.session.startOperation(v)},w.prototype.endOperation=function(v){this.session.endOperation(v)},w.prototype.onStartOperation=function(v){this.curOp=this.session.curOp,this.curOp.scrollTop=this.renderer.scrollTop,this.prevOp=this.session.prevOp,v||(this.previousCommand=null)},w.prototype.onEndOperation=function(v){if(this.curOp&&this.session){if(v&&v.returnValue===!1){this.curOp=null;return}if(this._signal("beforeEndOperation"),!this.curOp)return;var C=this.curOp.command,E=C&&C.scrollIntoView;if(E){switch(E){case"center-animate":E="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var x=this.selection.getRange(),k=this.renderer.layerConfig;(x.start.row>=k.lastRow||x.end.row<=k.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break}E=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}this.$lastSel=this.session.selection.toJSON(),this.prevOp=this.curOp,this.curOp=null}},w.prototype.$historyTracker=function(v){if(this.$mergeUndoDeltas){var C=this.prevOp,E=this.$mergeableCommands,x=C.command&&v.command.name==C.command.name;if(v.command.name=="insertstring"){var k=v.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),x=x&&this.mergeNextCommand&&(!/\s/.test(k)||/\s/.test(C.args)),this.mergeNextCommand=!0}else x=x&&E.indexOf(v.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(x=!1),x?this.session.mergeUndoDeltas=!0:E.indexOf(v.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},w.prototype.setKeyboardHandler=function(v,C){if(v&&typeof v=="string"&&v!="ace"){this.$keybindingId=v;var E=this;$.loadModule(["keybinding",v],function(x){E.$keybindingId==v&&E.keyBinding.setKeyboardHandler(x&&x.handler),C&&C()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(v),C&&C()},w.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},w.prototype.setSession=function(v){if(this.session!=v){this.curOp&&this.endOperation(),this.curOp={};var C=this.session;if(C){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange),this.session.off("startOperation",this.$onStartOperation),this.session.off("endOperation",this.$onEndOperation);var E=this.session.getSelection();E.off("changeCursor",this.$onCursorChange),E.off("changeSelection",this.$onSelectionChange)}this.session=v,v?(this.$onDocumentChange=this.onDocumentChange.bind(this),v.on("change",this.$onDocumentChange),this.renderer.setSession(v),this.$onChangeMode=this.onChangeMode.bind(this),v.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),v.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),v.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),v.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),v.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),v.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=v.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.$onStartOperation=this.onStartOperation.bind(this),this.session.on("startOperation",this.$onStartOperation),this.$onEndOperation=this.onEndOperation.bind(this),this.session.on("endOperation",this.$onEndOperation),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(v)),this._signal("changeSession",{session:v,oldSession:C}),this.curOp=null,C&&C._signal("changeEditor",{oldEditor:this}),C&&(C.$editor=null),v&&v._signal("changeEditor",{editor:this}),v&&(v.$editor=this),v&&!v.destroyed&&v.bgTokenizer.scheduleStart()}},w.prototype.getSession=function(){return this.session},w.prototype.setValue=function(v,C){return this.session.doc.setValue(v),C?C==1?this.navigateFileEnd():C==-1&&this.navigateFileStart():this.selectAll(),v},w.prototype.getValue=function(){return this.session.getValue()},w.prototype.getSelection=function(){return this.selection},w.prototype.resize=function(v){this.renderer.onResize(v)},w.prototype.setTheme=function(v,C){this.renderer.setTheme(v,C)},w.prototype.getTheme=function(){return this.renderer.getTheme()},w.prototype.setStyle=function(v){this.renderer.setStyle(v)},w.prototype.unsetStyle=function(v){this.renderer.unsetStyle(v)},w.prototype.getFontSize=function(){return this.getOption("fontSize")||m.computedStyle(this.container).fontSize},w.prototype.setFontSize=function(v){this.setOption("fontSize",v)},w.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var v=this;this.$highlightPending=!0,setTimeout(function(){v.$highlightPending=!1;var C=v.session;if(!(!C||C.destroyed)){C.$bracketHighlight&&(C.$bracketHighlight.markerIds.forEach(function(F){C.removeMarker(F)}),C.$bracketHighlight=null);var E=v.getCursorPosition(),x=v.getKeyboardHandler(),k=x&&x.$getDirectionForHighlight&&x.$getDirectionForHighlight(v),D=C.getMatchingBracketRanges(E,k);if(!D){var I=new A(C,E.row,E.column),N=I.getCurrentToken();if(N&&/\b(?:tag-open|tag-name)/.test(N.type)){var P=C.getMatchingTags(E);P&&(D=[P.openTagName.isEmpty()?P.openTag:P.openTagName,P.closeTagName.isEmpty()?P.closeTag:P.closeTagName])}}if(!D&&C.$mode.getMatching&&(D=C.$mode.getMatching(v.session)),!D){v.getHighlightIndentGuides()&&v.renderer.$textLayer.$highlightIndentGuide();return}var z="ace_bracket";Array.isArray(D)?D.length==1&&(z="ace_error_bracket"):D=[D],D.length==2&&(h.comparePoints(D[0].end,D[1].start)==0?D=[h.fromPoints(D[0].start,D[1].end)]:h.comparePoints(D[0].start,D[1].end)==0&&(D=[h.fromPoints(D[1].start,D[0].end)])),C.$bracketHighlight={ranges:D,markerIds:D.map(function(F){return C.addMarker(F,z,"text")})},v.getHighlightIndentGuides()&&v.renderer.$textLayer.$highlightIndentGuide()}},50)}},w.prototype.focus=function(){this.textInput.focus()},w.prototype.isFocused=function(){return this.textInput.isFocused()},w.prototype.blur=function(){this.textInput.blur()},w.prototype.onFocus=function(v){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",v))},w.prototype.onBlur=function(v){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",v))},w.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},w.prototype.onDocumentChange=function(v){var C=this.session.$useWrapMode,E=v.start.row==v.end.row?v.end.row:1/0;this.renderer.updateLines(v.start.row,E,C),this._signal("change",v),this.$cursorChange()},w.prototype.onTokenizerUpdate=function(v){var C=v.data;this.renderer.updateLines(C.first,C.last)},w.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},w.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},w.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},w.prototype.$updateHighlightActiveLine=function(){var v=this.getSession(),C;if(this.$highlightActiveLine&&((this.$selectionStyle!="line"||!this.selection.isMultiLine())&&(C=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(C=!1),this.renderer.$maxLines&&this.session.getLength()===1&&!(this.renderer.$minLines>1)&&(C=!1)),v.$highlightLineMarker&&!C)v.removeMarker(v.$highlightLineMarker.id),v.$highlightLineMarker=null;else if(!v.$highlightLineMarker&&C){var E=new h(C.row,C.column,C.row,1/0);E.id=v.addMarker(E,"ace_active-line","screenLine"),v.$highlightLineMarker=E}else C&&(v.$highlightLineMarker.start.row=C.row,v.$highlightLineMarker.end.row=C.row,v.$highlightLineMarker.start.column=C.column,v._signal("changeBackMarker"))},w.prototype.onSelectionChange=function(v){var C=this.session;if(C.$selectionMarker&&C.removeMarker(C.$selectionMarker),C.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var E=this.selection.getRange(),x=this.getSelectionStyle();C.$selectionMarker=C.addMarker(E,"ace_selection",x)}var k=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(k),this._signal("changeSelection")},w.prototype.$getSelectionHighLightRegexp=function(){var v=this.session,C=this.getSelectionRange();if(!(C.isEmpty()||C.isMultiLine())){var E=C.start.column,x=C.end.column,k=v.getLine(C.start.row),D=k.substring(E,x);if(!(D.length>5e3||!/[\w\d]/.test(D))){var I=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:D}),N=k.substring(E-1,x+1);if(I.test(N))return I}}},w.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},w.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},w.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},w.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},w.prototype.onChangeMode=function(v){this.renderer.updateText(),this._emit("changeMode",v)},w.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},w.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},w.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},w.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},w.prototype.getCopyText=function(){var v=this.getSelectedText(),C=this.session.doc.getNewLineCharacter(),E=!1;if(!v&&this.$copyWithEmptySelection){E=!0;for(var x=this.selection.getAllRanges(),k=0;k<x.length;k++){var D=x[k];k&&x[k-1].start.row==D.start.row||(v+=this.session.getLine(D.start.row)+C)}}var I={text:v};return this._signal("copy",I),R.lineMode=E?I.text:!1,I.text},w.prototype.onCopy=function(){this.commands.exec("copy",this)},w.prototype.onCut=function(){this.commands.exec("cut",this)},w.prototype.onPaste=function(v,C){var E={text:v,event:C};this.commands.exec("paste",this,E)},w.prototype.$handlePaste=function(v){typeof v=="string"&&(v={text:v}),this._signal("paste",v);var C=v.text,E=C===R.lineMode,x=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)E?x.insert({row:this.selection.lead.row,column:0},C):this.insert(C);else if(E)this.selection.rangeList.ranges.forEach(function(z){x.insert({row:z.start.row,column:0},C)});else{var k=C.split(/\r\n|\r|\n/),D=this.selection.rangeList.ranges,I=k.length==2&&(!k[0]||!k[1]);if(k.length!=D.length||I)return this.commands.exec("insertstring",this,C);for(var N=D.length;N--;){var P=D[N];P.isEmpty()||x.remove(P),x.insert(P.start,k[N])}}},w.prototype.execCommand=function(v,C){return this.commands.exec(v,this,C)},w.prototype.insert=function(v,C){var E=this.session,x=E.getMode(),k=this.getCursorPosition();if(this.getBehavioursEnabled()&&!C){var D=x.transformAction(E.getState(k.row),"insertion",this,E,v);D&&(v!==D.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),v=D.text)}if(v==" "&&(v=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()&&v.indexOf(`
1366
+ `)==-1){var I=h.fromPoints(k,k);I.end.column+=v.length,this.session.remove(I)}}else{var I=this.getSelectionRange();k=this.session.remove(I),this.clearSelection()}if(v==`
1367
1367
  `||v==`\r
1368
- `){var F=E.getLine(k.row);if(k.column>F.search(/\S|$/)){var N=F.substr(k.column).search(/\S|$/);E.doc.removeInLine(k.row,k.column,k.column+N)}}this.clearSelection();var P=k.column,z=E.getState(k.row),F=E.getLine(k.row),W=x.checkOutdent(z,F,v);if(E.insert(k,v),O&&O.selection&&(O.selection.length==2?this.selection.setSelectionRange(new h(k.row,P+O.selection[0],k.row,P+O.selection[1])):this.selection.setSelectionRange(new h(k.row+O.selection[0],O.selection[1],k.row+O.selection[2],O.selection[3]))),this.$enableAutoIndent){if(E.getDocument().isNewLine(v)){var H=x.getNextLineIndent(z,F.slice(0,k.column),E.getTabString());E.insert({row:k.row+1,column:0},H)}W&&x.autoOutdent(z,E,k.row)}},w.prototype.autoIndent=function(){for(var v=this.session,C=v.getMode(),E=this.selection.isEmpty()?[new h(0,0,v.doc.getLength()-1,0)]:this.selection.getAllRanges(),x="",k="",O="",D=v.getTabString(),N=0;N<E.length;N++)for(var P=E[N].start.row,z=E[N].end.row,F=P;F<=z;F++){F>0&&(x=v.getState(F-1),k=v.getLine(F-1),O=C.getNextLineIndent(x,k,D));var W=v.getLine(F),H=C.$getIndent(W);if(O!==H){if(H.length>0){var B=new h(F,0,F,H.length);v.remove(B)}O.length>0&&v.insert({row:F,column:0},O)}C.autoOutdent(x,v,F)}},w.prototype.onTextInput=function(v,C){if(!C)return this.keyBinding.onTextInput(v);this.startOperation({command:{name:"insertstring"}});var E=this.applyComposition.bind(this,v,C);this.selection.rangeCount?this.forEachSelection(E):E(),this.endOperation()},w.prototype.applyComposition=function(v,C){if(C.extendLeft||C.extendRight){var E=this.selection.getRange();E.start.column-=C.extendLeft,E.end.column+=C.extendRight,E.start.column<0&&(E.start.row--,E.start.column+=this.session.getLine(E.start.row).length+1),this.selection.setRange(E),!v&&!E.isEmpty()&&this.remove()}if((v||!this.selection.isEmpty())&&this.insert(v,!0),C.restoreStart||C.restoreEnd){var E=this.selection.getRange();E.start.column-=C.restoreStart,E.end.column-=C.restoreEnd,this.selection.setRange(E)}},w.prototype.onCommandKey=function(v,C,E){return this.keyBinding.onCommandKey(v,C,E)},w.prototype.setOverwrite=function(v){this.session.setOverwrite(v)},w.prototype.getOverwrite=function(){return this.session.getOverwrite()},w.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},w.prototype.setScrollSpeed=function(v){this.setOption("scrollSpeed",v)},w.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},w.prototype.setDragDelay=function(v){this.setOption("dragDelay",v)},w.prototype.getDragDelay=function(){return this.getOption("dragDelay")},w.prototype.setSelectionStyle=function(v){this.setOption("selectionStyle",v)},w.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},w.prototype.setHighlightActiveLine=function(v){this.setOption("highlightActiveLine",v)},w.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},w.prototype.setHighlightGutterLine=function(v){this.setOption("highlightGutterLine",v)},w.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},w.prototype.setHighlightSelectedWord=function(v){this.setOption("highlightSelectedWord",v)},w.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},w.prototype.setAnimatedScroll=function(v){this.renderer.setAnimatedScroll(v)},w.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},w.prototype.setShowInvisibles=function(v){this.renderer.setShowInvisibles(v)},w.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},w.prototype.setDisplayIndentGuides=function(v){this.renderer.setDisplayIndentGuides(v)},w.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},w.prototype.setHighlightIndentGuides=function(v){this.renderer.setHighlightIndentGuides(v)},w.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},w.prototype.setShowPrintMargin=function(v){this.renderer.setShowPrintMargin(v)},w.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},w.prototype.setPrintMarginColumn=function(v){this.renderer.setPrintMarginColumn(v)},w.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},w.prototype.setReadOnly=function(v){this.setOption("readOnly",v)},w.prototype.getReadOnly=function(){return this.getOption("readOnly")},w.prototype.setBehavioursEnabled=function(v){this.setOption("behavioursEnabled",v)},w.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},w.prototype.setWrapBehavioursEnabled=function(v){this.setOption("wrapBehavioursEnabled",v)},w.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},w.prototype.setShowFoldWidgets=function(v){this.setOption("showFoldWidgets",v)},w.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},w.prototype.setFadeFoldWidgets=function(v){this.setOption("fadeFoldWidgets",v)},w.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},w.prototype.remove=function(v){this.selection.isEmpty()&&(v=="left"?this.selection.selectLeft():this.selection.selectRight());var C=this.getSelectionRange();if(this.getBehavioursEnabled()){var E=this.session,x=E.getState(C.start.row),k=E.getMode().transformAction(x,"deletion",this,E,C);if(C.end.column===0){var O=E.getTextRange(C);if(O[O.length-1]==`
1369
- `){var D=E.getLine(C.end.row);/^\s+$/.test(D)&&(C.end.column=D.length)}}k&&(C=k)}this.session.remove(C),this.clearSelection()},w.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},w.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},w.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},w.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var v=this.getSelectionRange();v.start.column==v.end.column&&v.start.row==v.end.row&&(v.end.column=0,v.end.row++),this.session.remove(v),this.clearSelection()},w.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var v=this.getCursorPosition();this.insert(`
1370
- `),this.moveCursorToPosition(v)},w.prototype.setGhostText=function(v,C){this.renderer.setGhostText(v,C)},w.prototype.removeGhostText=function(){this.renderer.removeGhostText()},w.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var v=this.getCursorPosition(),C=v.column;if(C!==0){var E=this.session.getLine(v.row),x,k;C<E.length?(x=E.charAt(C)+E.charAt(C-1),k=new h(v.row,C-1,v.row,C+1)):(x=E.charAt(C-1)+E.charAt(C-2),k=new h(v.row,C-2,v.row,C)),this.session.replace(k,x),this.session.selection.moveToPosition(k.end)}}},w.prototype.toLowerCase=function(){var v=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var C=this.getSelectionRange(),E=this.session.getTextRange(C);this.session.replace(C,E.toLowerCase()),this.selection.setSelectionRange(v)},w.prototype.toUpperCase=function(){var v=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var C=this.getSelectionRange(),E=this.session.getTextRange(C);this.session.replace(C,E.toUpperCase()),this.selection.setSelectionRange(v)},w.prototype.indent=function(){var v=this.session,C=this.getSelectionRange();if(C.start.row<C.end.row){var E=this.$getSelectedRows();v.indentRows(E.first,E.last," ");return}else if(C.start.column<C.end.column){var x=v.getTextRange(C);if(!/^\s+$/.test(x)){var E=this.$getSelectedRows();v.indentRows(E.first,E.last," ");return}}var k=v.getLine(C.start.row),O=C.start,D=v.getTabSize(),N=v.documentToScreenColumn(O.row,O.column);if(this.session.getUseSoftTabs())var P=D-N%D,z=l.stringRepeat(" ",P);else{for(var P=N%D;k[C.start.column-1]==" "&&P;)C.start.column--,P--;this.selection.setSelectionRange(C),z=" "}return this.insert(z)},w.prototype.blockIndent=function(){var v=this.$getSelectedRows();this.session.indentRows(v.first,v.last," ")},w.prototype.blockOutdent=function(){var v=this.session.getSelection();this.session.outdentRows(v.getRange())},w.prototype.sortLines=function(){for(var v=this.$getSelectedRows(),C=this.session,E=[],x=v.first;x<=v.last;x++)E.push(C.getLine(x));E.sort(function(D,N){return D.toLowerCase()<N.toLowerCase()?-1:D.toLowerCase()>N.toLowerCase()?1:0});for(var k=new h(0,0,0,0),x=v.first;x<=v.last;x++){var O=C.getLine(x);k.start.row=x,k.end.row=x,k.end.column=O.length,C.replace(k,E[x-v.first])}},w.prototype.toggleCommentLines=function(){var v=this.session.getState(this.getCursorPosition().row),C=this.$getSelectedRows();this.session.getMode().toggleCommentLines(v,this.session,C.first,C.last)},w.prototype.toggleBlockComment=function(){var v=this.getCursorPosition(),C=this.session.getState(v.row),E=this.getSelectionRange();this.session.getMode().toggleBlockComment(C,this.session,E,v)},w.prototype.getNumberAt=function(v,C){var E=/[\-]?[0-9]+(?:\.[0-9]+)?/g;E.lastIndex=0;for(var x=this.session.getLine(v);E.lastIndex<C;){var k=E.exec(x);if(k.index<=C&&k.index+k[0].length>=C){var O={value:k[0],start:k.index,end:k.index+k[0].length};return O}}return null},w.prototype.modifyNumber=function(v){var C=this.selection.getCursor().row,E=this.selection.getCursor().column,x=new h(C,E-1,C,E),k=this.session.getTextRange(x);if(!isNaN(parseFloat(k))&&isFinite(k)){var O=this.getNumberAt(C,E);if(O){var D=O.value.indexOf(".")>=0?O.start+O.value.indexOf(".")+1:O.end,N=O.start+O.value.length-D,P=parseFloat(O.value);P*=Math.pow(10,N),D!==O.end&&E<D?v*=Math.pow(10,O.end-E-1):v*=Math.pow(10,O.end-E),P+=v,P/=Math.pow(10,N);var z=P.toFixed(N),F=new h(C,O.start,C,O.end);this.session.replace(F,z),this.moveCursorTo(C,Math.max(O.start+1,E+z.length-O.value.length))}}else this.toggleWord()},w.prototype.toggleWord=function(){var v=this.selection.getCursor().row,C=this.selection.getCursor().column;this.selection.selectWord();var E=this.getSelectedText(),x=this.selection.getWordRange().start.column,k=E.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),O=C-x-1;O<0&&(O=0);var D=0,N=0,P=this;E.match(/[A-Za-z0-9_]+/)&&k.forEach(function(V,Z){N=D+V.length,O>=D&&O<=N&&(E=V,P.selection.clearSelection(),P.moveCursorTo(v,D+x),P.selection.selectTo(v,N+x)),D=N});for(var z=this.$toggleWordPairs,F,W=0;W<z.length;W++)for(var H=z[W],B=0;B<=1;B++){var G=+!B,q=E.match(new RegExp("^\\s?_?("+l.escapeRegExp(H[B])+")\\s?$","i"));if(q){var Y=E.match(new RegExp("([_]|^|\\s)("+l.escapeRegExp(q[1])+")($|\\s)","g"));Y&&(F=E.replace(new RegExp(l.escapeRegExp(H[B]),"i"),function(V){var Z=H[G];return V.toUpperCase()==V?Z=Z.toUpperCase():V.charAt(0).toUpperCase()==V.charAt(0)&&(Z=Z.substr(0,0)+H[G].charAt(0).toUpperCase()+Z.substr(1)),Z}),this.insert(F),F="")}}},w.prototype.findLinkAt=function(v,C){var E,x,k=this.session.getLine(v),O=k.split(/((?:https?|ftp):\/\/[\S]+)/),D=C;D<0&&(D=0);var N=0,P=0,z;try{for(var F=d(O),W=F.next();!W.done;W=F.next()){var H=W.value;if(P=N+H.length,D>=N&&D<=P&&H.match(/((?:https?|ftp):\/\/[\S]+)/)){z=H.replace(/[\s:.,'";}\]]+$/,"");break}N=P}}catch(B){E={error:B}}finally{try{W&&!W.done&&(x=F.return)&&x.call(F)}finally{if(E)throw E.error}}return z},w.prototype.openLink=function(){var v=this.selection.getCursor(),C=this.findLinkAt(v.row,v.column);return C&&window.open(C,"_blank"),C!=null},w.prototype.removeLines=function(){var v=this.$getSelectedRows();this.session.removeFullLines(v.first,v.last),this.clearSelection()},w.prototype.duplicateSelection=function(){var v=this.selection,C=this.session,E=v.getRange(),x=v.isBackwards();if(E.isEmpty()){var k=E.start.row;C.duplicateLines(k,k)}else{var O=x?E.start:E.end,D=C.insert(O,C.getTextRange(E));E.start=O,E.end=D,v.setSelectionRange(E,x)}},w.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},w.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},w.prototype.moveText=function(v,C,E){return this.session.moveText(v,C,E)},w.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},w.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},w.prototype.$moveLines=function(v,C){var E,x,k=this.selection;if(!k.inMultiSelectMode||this.inVirtualSelectionMode){var O=k.toOrientedRange();E=this.$getSelectedRows(O),x=this.session.$moveLines(E.first,E.last,C?0:v),C&&v==-1&&(x=0),O.moveBy(x,0),k.fromOrientedRange(O)}else{var D=k.rangeList.ranges;k.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var N=0,P=0,z=D.length,F=0;F<z;F++){var W=F;D[F].moveBy(N,0),E=this.$getSelectedRows(D[F]);for(var H=E.first,B=E.last;++F<z;){P&&D[F].moveBy(P,0);var G=this.$getSelectedRows(D[F]);if(C&&G.first!=B)break;if(!C&&G.first>B+1)break;B=G.last}for(F--,N=this.session.$moveLines(H,B,C?0:v),C&&v==-1&&(W=F+1);W<=F;)D[W].moveBy(N,0),W++;C||(N=0),P+=N}k.fromOrientedRange(k.ranges[0]),k.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},w.prototype.$getSelectedRows=function(v){return v=(v||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(v.start.row),last:this.session.getRowFoldEnd(v.end.row)}},w.prototype.onCompositionStart=function(v){this.renderer.showComposition(v)},w.prototype.onCompositionUpdate=function(v){this.renderer.setCompositionText(v)},w.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},w.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},w.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},w.prototype.isRowVisible=function(v){return v>=this.getFirstVisibleRow()&&v<=this.getLastVisibleRow()},w.prototype.isRowFullyVisible=function(v){return v>=this.renderer.getFirstFullyVisibleRow()&&v<=this.renderer.getLastFullyVisibleRow()},w.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},w.prototype.$moveByPage=function(v,C){var E=this.renderer,x=this.renderer.layerConfig,k=v*Math.floor(x.height/x.lineHeight);C===!0?this.selection.$moveSelection(function(){this.moveCursorBy(k,0)}):C===!1&&(this.selection.moveCursorBy(k,0),this.selection.clearSelection());var O=E.scrollTop;E.scrollBy(0,k*x.lineHeight),C!=null&&E.scrollCursorIntoView(null,.5),E.animateScrolling(O)},w.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},w.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},w.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},w.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},w.prototype.scrollPageDown=function(){this.$moveByPage(1)},w.prototype.scrollPageUp=function(){this.$moveByPage(-1)},w.prototype.scrollToRow=function(v){this.renderer.scrollToRow(v)},w.prototype.scrollToLine=function(v,C,E,x){this.renderer.scrollToLine(v,C,E,x)},w.prototype.centerSelection=function(){var v=this.getSelectionRange(),C={row:Math.floor(v.start.row+(v.end.row-v.start.row)/2),column:Math.floor(v.start.column+(v.end.column-v.start.column)/2)};this.renderer.alignCursor(C,.5)},w.prototype.getCursorPosition=function(){return this.selection.getCursor()},w.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},w.prototype.getSelectionRange=function(){return this.selection.getRange()},w.prototype.selectAll=function(){this.selection.selectAll()},w.prototype.clearSelection=function(){this.selection.clearSelection()},w.prototype.moveCursorTo=function(v,C){this.selection.moveCursorTo(v,C)},w.prototype.moveCursorToPosition=function(v){this.selection.moveCursorToPosition(v)},w.prototype.jumpToMatching=function(v,C){var E=this.getCursorPosition(),x=new A(this.session,E.row,E.column),k=x.getCurrentToken(),O=0;k&&k.type.indexOf("tag-name")!==-1&&(k=x.stepBackward());var D=k||x.stepForward();if(D){var N,P=!1,z={},F=E.column-D.start,W,H={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(D.value.match(/[{}()\[\]]/g)){for(;F<D.value.length&&!P;F++)if(H[D.value[F]])switch(W=H[D.value[F]]+"."+D.type.replace("rparen","lparen"),isNaN(z[W])&&(z[W]=0),D.value[F]){case"(":case"[":case"{":z[W]++;break;case")":case"]":case"}":z[W]--,z[W]===-1&&(N="bracket",P=!0);break}}else D.type.indexOf("tag-name")!==-1&&(isNaN(z[D.value])&&(z[D.value]=0),k.value==="<"&&O>1?z[D.value]++:k.value==="</"&&z[D.value]--,z[D.value]===-1&&(N="tag",P=!0));P||(k=D,O++,D=x.stepForward(),F=0)}while(D&&!P);if(N){var B,G;if(N==="bracket")B=this.session.getBracketRange(E),B||(B=new h(x.getCurrentTokenRow(),x.getCurrentTokenColumn()+F-1,x.getCurrentTokenRow(),x.getCurrentTokenColumn()+F-1),G=B.start,(C||G.row===E.row&&Math.abs(G.column-E.column)<2)&&(B=this.session.getBracketRange(G)));else if(N==="tag"){if(!D||D.type.indexOf("tag-name")===-1)return;if(B=new h(x.getCurrentTokenRow(),x.getCurrentTokenColumn()-2,x.getCurrentTokenRow(),x.getCurrentTokenColumn()-2),B.compare(E.row,E.column)===0){var q=this.session.getMatchingTags(E);q&&(q.openTag.contains(E.row,E.column)?(B=q.closeTag,G=B.start):(B=q.openTag,q.closeTag.start.row===E.row&&q.closeTag.start.column===E.column?G=B.end:G=B.start))}G=G||B.start}G=B&&B.cursor||G,G&&(v?B&&C?this.selection.setRange(B):B&&B.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(G.row,G.column):this.selection.moveTo(G.row,G.column))}}},w.prototype.gotoLine=function(v,C,E){this.selection.clearSelection(),this.session.unfold({row:v-1,column:C||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(v-1,C||0),this.isRowFullyVisible(v-1)||this.scrollToLine(v-1,!0,E)},w.prototype.navigateTo=function(v,C){this.selection.moveTo(v,C)},w.prototype.navigateUp=function(v){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var C=this.selection.anchor.getPosition();return this.moveCursorToPosition(C)}this.selection.clearSelection(),this.selection.moveCursorBy(-v||-1,0)},w.prototype.navigateDown=function(v){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var C=this.selection.anchor.getPosition();return this.moveCursorToPosition(C)}this.selection.clearSelection(),this.selection.moveCursorBy(v||1,0)},w.prototype.navigateLeft=function(v){if(this.selection.isEmpty())for(v=v||1;v--;)this.selection.moveCursorLeft();else{var C=this.getSelectionRange().start;this.moveCursorToPosition(C)}this.clearSelection()},w.prototype.navigateRight=function(v){if(this.selection.isEmpty())for(v=v||1;v--;)this.selection.moveCursorRight();else{var C=this.getSelectionRange().end;this.moveCursorToPosition(C)}this.clearSelection()},w.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},w.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},w.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},w.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},w.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},w.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},w.prototype.replace=function(v,C){C&&this.$search.set(C);var E=this.$search.find(this.session),x=0;return E&&(this.$tryReplace(E,v)&&(x=1),this.selection.setSelectionRange(E),this.renderer.scrollSelectionIntoView(E.start,E.end)),x},w.prototype.replaceAll=function(v,C){C&&this.$search.set(C);var E=this.$search.findAll(this.session),x=0;if(!E.length)return x;var k=this.getSelectionRange();this.selection.moveTo(0,0);for(var O=E.length-1;O>=0;--O)this.$tryReplace(E[O],v)&&x++;return this.selection.setSelectionRange(k),x},w.prototype.$tryReplace=function(v,C){var E=this.session.getTextRange(v);return C=this.$search.replace(E,C),C!==null?(v.end=this.session.replace(v,C),v):null},w.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},w.prototype.find=function(v,C,E){C||(C={}),typeof v=="string"||v instanceof RegExp?C.needle=v:typeof v=="object"&&g.mixin(C,v);var x=this.selection.getRange();C.needle==null&&(v=this.session.getTextRange(x)||this.$search.$options.needle,v||(x=this.session.getWordRange(x.start.row,x.start.column),v=this.session.getTextRange(x)),this.$search.set({needle:v})),this.$search.set(C),C.start||this.$search.set({start:x});var k=this.$search.find(this.session);if(C.preventScroll)return k;if(k)return this.revealRange(k,E),k;C.backwards?x.start=x.end:x.end=x.start,this.selection.setRange(x)},w.prototype.findNext=function(v,C){this.find({skipCurrent:!0,backwards:!1},v,C)},w.prototype.findPrevious=function(v,C){this.find(v,{skipCurrent:!0,backwards:!0},C)},w.prototype.revealRange=function(v,C){this.session.unfold(v),this.selection.setSelectionRange(v);var E=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(v.start,v.end,.5),C!==!1&&this.renderer.animateScrolling(E)},w.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},w.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},w.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(v){v.destroy()}),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},w.prototype.setAutoScrollEditorIntoView=function(v){if(v){var C,E=this,x=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var k=this.$scrollAnchor;k.style.cssText="position:absolute",this.container.insertBefore(k,this.container.firstChild);var O=this.on("changeSelection",function(){x=!0}),D=this.renderer.on("beforeRender",function(){x&&(C=E.renderer.container.getBoundingClientRect())}),N=this.renderer.on("afterRender",function(){if(x&&C&&(E.isFocused()||E.searchBox&&E.searchBox.isFocused())){var P=E.renderer,z=P.$cursorLayer.$pixelPos,F=P.layerConfig,W=z.top-F.offset;z.top>=0&&W+C.top<0?x=!0:z.top<F.height&&z.top+C.top+F.lineHeight>window.innerHeight?x=!1:x=null,x!=null&&(k.style.top=W+"px",k.style.left=z.left+"px",k.style.height=F.lineHeight+"px",k.scrollIntoView(x)),x=C=null}});this.setAutoScrollEditorIntoView=function(P){P||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",O),this.renderer.off("afterRender",N),this.renderer.off("beforeRender",D))}}},w.prototype.$resetCursorStyle=function(){var v=this.$cursorStyle||"ace",C=this.renderer.$cursorLayer;C&&(C.setSmoothBlinking(/smooth/.test(v)),C.isBlinking=!this.$readOnly&&v!="wide",m.setCssClass(C.element,"ace_slim-cursors",/slim/.test(v)))},w.prototype.prompt=function(v,C,E){var x=this;$.loadModule("ace/ext/prompt",function(k){k.prompt(x,v,C,E)})},w})();_.$uid=0,_.prototype.curOp=null,_.prototype.prevOp={},_.prototype.$mergeableCommands=["backspace","del","insertstring"],_.prototype.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],g.implement(_.prototype,y),$.defineOptions(_.prototype,"editor",{selectionStyle:{set:function(w){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:w})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(w){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(w){this.textInput.setReadOnly(w),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(w){this.textInput.setCopyWithEmptySelection(w)},initialValue:!1},cursorStyle:{set:function(w){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(w){this.setAutoScrollEditorIntoView(w)}},keyboardHandler:{set:function(w){this.setKeyboardHandler(w)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(w){this.session.setValue(w)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(w){this.setSession(w)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(w){this.renderer.$gutterLayer.setShowLineNumbers(w),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),w&&this.$relativeLineNumbers?I.attach(this):I.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(w){this.$showLineNumbers&&w?I.attach(this):I.detach(this)}},placeholder:{set:function(w){this.$updatePlaceholder||(this.$updatePlaceholder=(function(){var v=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(v&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),m.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!v&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),m.addCssClass(this.container,"ace_hasPlaceholder");var C=m.createElement("div");C.className="ace_placeholder",C.textContent=this.$placeholder||"",this.renderer.placeholderNode=C,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!v&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}).bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(w){var v={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(x){x.blur(),x.renderer.scroller.focus()},readOnly:!0},C=function(x){if(x.target==this.renderer.scroller&&x.keyCode===L.enter){x.preventDefault();var k=this.getCursorPosition().row;this.isRowVisible(k)||this.scrollToLine(k,!0,!0),this.focus()}},E;w?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(f.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",M("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",M("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",C.bind(this)),this.commands.addCommand(v),this.renderer.$gutter.setAttribute("tabindex",0),this.renderer.$gutter.setAttribute("aria-hidden",!1),this.renderer.$gutter.setAttribute("role","group"),this.renderer.$gutter.setAttribute("aria-roledescription",M("editor.gutter.aria-roledescription","editor")),this.renderer.$gutter.setAttribute("aria-label",M("editor.gutter.aria-label","Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute("aria-hidden",!0),E||(E=new S(this)),E.addListener(),this.textInput.setAriaOptions({setLabel:!0})):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",C.bind(this)),this.commands.removeCommand(v),this.renderer.content.removeAttribute("aria-hidden"),this.renderer.$gutter.setAttribute("tabindex",-1),this.renderer.$gutter.setAttribute("aria-hidden",!0),this.renderer.$gutter.removeAttribute("role"),this.renderer.$gutter.removeAttribute("aria-roledescription"),this.renderer.$gutter.removeAttribute("aria-label"),this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName),E&&E.removeListener())},initialValue:!1},textInputAriaLabel:{set:function(w){this.$textInputAriaLabel=w},initialValue:""},enableMobileMenu:{set:function(w){this.$enableMobileMenu=w},initialValue:!0},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",showFoldedAnnotations:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var I={getText:function(w,v){return(Math.abs(w.selection.lead.row-v)||v+1+(v<9?"·":""))+""},getWidth:function(w,v,C){return Math.max(v.toString().length,(C.lastRow+1).toString().length,2)*C.characterWidth},update:function(w,v){v.renderer.$loop.schedule(v.renderer.CHANGE_GUTTER)},attach:function(w){w.renderer.$gutterLayer.$renderer=this,w.on("changeSelection",this.update),this.update(null,w)},detach:function(w){w.renderer.$gutterLayer.$renderer==this&&(w.renderer.$gutterLayer.$renderer=null),w.off("changeSelection",this.update),this.update(null,w)}};n.Editor=_}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(t,n,p){var d=t("../lib/dom"),g=(function(){function m(l,f){this.element=l,this.canvasHeight=f||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return m.prototype.moveContainer=function(l){d.translate(this.element,0,-(l.firstRowScreen*l.lineHeight%this.canvasHeight)-l.offset*this.$offsetCoefficient)},m.prototype.pageChanged=function(l,f){return Math.floor(l.firstRowScreen*l.lineHeight/this.canvasHeight)!==Math.floor(f.firstRowScreen*f.lineHeight/this.canvasHeight)},m.prototype.computeLineTop=function(l,f,r){var o=f.firstRowScreen*f.lineHeight,s=Math.floor(o/this.canvasHeight),a=r.documentToScreenRow(l,0)*f.lineHeight;return a-s*this.canvasHeight},m.prototype.computeLineHeight=function(l,f,r){return f.lineHeight*r.getRowLineCount(l)},m.prototype.getLength=function(){return this.cells.length},m.prototype.get=function(l){return this.cells[l]},m.prototype.shift=function(){this.$cacheCell(this.cells.shift())},m.prototype.pop=function(){this.$cacheCell(this.cells.pop())},m.prototype.push=function(l){if(Array.isArray(l)){this.cells.push.apply(this.cells,l);for(var f=d.createFragment(this.element),r=0;r<l.length;r++)f.appendChild(l[r].element);this.element.appendChild(f)}else this.cells.push(l),this.element.appendChild(l.element)},m.prototype.unshift=function(l){if(Array.isArray(l)){this.cells.unshift.apply(this.cells,l);for(var f=d.createFragment(this.element),r=0;r<l.length;r++)f.appendChild(l[r].element);this.element.firstChild?this.element.insertBefore(f,this.element.firstChild):this.element.appendChild(f)}else this.cells.unshift(l),this.element.insertAdjacentElement("afterbegin",l.element)},m.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},m.prototype.$cacheCell=function(l){l&&(l.element.remove(),this.cellCache.push(l))},m.prototype.createCell=function(l,f,r,o){var s=this.cellCache.pop();if(!s){var a=d.createElement("div");o&&o(a),this.element.appendChild(a),s={element:a,text:"",row:l}}return s.row=l,s},m})();n.Lines=g}),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines","ace/config"],function(t,n,p){var d=t("../lib/dom"),g=t("../lib/oop"),m=t("../lib/lang"),l=t("../lib/event_emitter").EventEmitter,f=t("./lines").Lines,r=t("../config").nls,o=(function(){function a(i){this.element=d.createElement("div"),this.element.className="ace_layer ace_gutter-layer",i.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new f(this.element),this.$lines.$offsetCoefficient=1}return a.prototype.setSession=function(i){this.session&&this.session.off("change",this.$updateAnnotations),this.session=i,i&&i.on("change",this.$updateAnnotations)},a.prototype.addGutterDecoration=function(i,u){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(i,u)},a.prototype.removeGutterDecoration=function(i,u){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(i,u)},a.prototype.setAnnotations=function(i){this.$annotations=[];for(var u=0;u<i.length;u++){var h=i[u],y=h.row,b=this.$annotations[y];b||(b=this.$annotations[y]={text:[],type:[],displayText:[]});var T=h.text,$=h.text,A=h.type;T=T?m.escapeHTML(T):h.html||"",$=$||h.html||"",b.text.indexOf(T)===-1&&(b.text.push(T),b.type.push(A),b.displayText.push($));var S=h.className;S?b.className=S:A==="error"?b.className=" ace_error":A==="security"&&!/\bace_error\b/.test(b.className)?b.className=" ace_security":A==="warning"&&!/\bace_(error|security)\b/.test(b.className)?b.className=" ace_warning":A==="info"&&!b.className?b.className=" ace_info":A==="hint"&&!b.className&&(b.className=" ace_hint")}},a.prototype.$updateAnnotations=function(i){if(this.$annotations.length){var u=i.start.row,h=i.end.row-u;if(h!==0)if(i.action=="remove")this.$annotations.splice(u,h+1,null);else{var y=new Array(h+1);y.unshift(u,1),this.$annotations.splice.apply(this.$annotations,y)}}},a.prototype.update=function(i){this.config=i;var u=this.session,h=i.firstRow,y=Math.min(i.lastRow+i.gutterOffset,u.getLength()-1);this.oldLastRow=y,this.config=i,this.$lines.moveContainer(i),this.$updateCursorRow();for(var b=u.getNextFoldLine(h),T=b?b.start.row:1/0,$=null,A=-1,S=h;;){if(S>T&&(S=b.end.row+1,b=u.getNextFoldLine(S,b),T=b?b.start.row:1/0),S>y){for(;this.$lines.getLength()>A+1;)this.$lines.pop();break}$=this.$lines.get(++A),$?$.row=S:($=this.$lines.createCell(S,i,this.session,s),this.$lines.push($)),this.$renderCell($,i,b,S),S++}this._signal("afterRender"),this.$updateGutterWidth(i)},a.prototype.$updateGutterWidth=function(i){var u=this.session,h=u.gutterRenderer||this.$renderer,y=u.$firstLineNumber,b=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||u.$useWrapMode)&&(b=u.getLength()+y-1);var T=h?h.getWidth(u,b,i):b.toString().length*i.characterWidth,$=this.$padding||this.$computePadding();T+=$.left+$.right,T!==this.gutterWidth&&!isNaN(T)&&(this.gutterWidth=T,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",T))},a.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var i=this.session.selection.getCursor();this.$cursorRow!==i.row&&(this.$cursorRow=i.row)}},a.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var i=this.session.selection.cursor.row;if(this.$cursorRow=i,!(this.$cursorCell&&this.$cursorCell.row==i)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var u=this.$lines.cells;this.$cursorCell=null;for(var h=0;h<u.length;h++){var y=u[h];if(y.row>=this.$cursorRow){if(y.row>this.$cursorRow){var b=this.session.getFoldLine(this.$cursorRow);if(h>0&&b&&b.start.row==u[h-1].row)y=u[h-1];else break}y.element.className="ace_gutter-active-line "+y.element.className,this.$cursorCell=y;break}}}}},a.prototype.scrollLines=function(i){var u=this.config;if(this.config=i,this.$updateCursorRow(),this.$lines.pageChanged(u,i))return this.update(i);this.$lines.moveContainer(i);var h=Math.min(i.lastRow+i.gutterOffset,this.session.getLength()-1),y=this.oldLastRow;if(this.oldLastRow=h,!u||y<i.firstRow)return this.update(i);if(h<u.firstRow)return this.update(i);if(u.firstRow<i.firstRow)for(var b=this.session.getFoldedRowCount(u.firstRow,i.firstRow-1);b>0;b--)this.$lines.shift();if(y>h)for(var b=this.session.getFoldedRowCount(h+1,y);b>0;b--)this.$lines.pop();i.firstRow<u.firstRow&&this.$lines.unshift(this.$renderLines(i,i.firstRow,u.firstRow-1)),h>y&&this.$lines.push(this.$renderLines(i,y+1,h)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(i)},a.prototype.$renderLines=function(i,u,h){for(var y=[],b=u,T=this.session.getNextFoldLine(b),$=T?T.start.row:1/0;b>$&&(b=T.end.row+1,T=this.session.getNextFoldLine(b,T),$=T?T.start.row:1/0),!(b>h);){var A=this.$lines.createCell(b,i,this.session,s);this.$renderCell(A,i,T,b),y.push(A),b++}return y},a.prototype.$renderCell=function(i,u,h,y){var b=i.element,T=this.session,$=b.childNodes[0],A=b.childNodes[1],S=b.childNodes[2],M=S.firstChild,R=T.$firstLineNumber,L=T.$breakpoints,_=T.$decorations,I=T.gutterRenderer||this.$renderer,w=this.$showFoldWidgets&&T.foldWidgets,v=h?h.start.row:Number.MAX_VALUE,C=u.lineHeight+"px",E=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",x=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",k=(I?I.getText(T,y):y+R).toString();if(this.$highlightGutterLine&&(y==this.$cursorRow||h&&y<this.$cursorRow&&y>=v&&this.$cursorRow<=h.end.row)&&(E+="ace_gutter-active-line ",this.$cursorCell!=i&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=i)),L[y]&&(E+=L[y]),_[y]&&(E+=_[y]),this.$annotations[y]&&y!==v&&(E+=this.$annotations[y].className),w){var O=w[y];O==null&&(O=w[y]=T.getFoldWidget(y))}if(O){var D="ace_fold-widget ace_"+O,N=O=="start"&&y==v&&y<h.end.row;if(N){D+=" ace_closed";for(var P="",z=!1,F=y+1;F<=h.end.row;F++)if(this.$annotations[F]){if(this.$annotations[F].className===" ace_error"){z=!0,P=" ace_error_fold";break}this.$annotations[F].className===" ace_security"?(z=!0,P=" ace_security_fold"):this.$annotations[F].className===" ace_warning"&&P!==" ace_security_fold"&&(z=!0,P=" ace_warning_fold")}E+=P}else D+=" ace_open";A.className!=D&&(A.className=D),d.setStyle(A.style,"height",C),d.setStyle(A.style,"display","inline-block"),A.setAttribute("role","button"),A.setAttribute("tabindex","-1");var W=T.getFoldWidgetRange(y);W?A.setAttribute("aria-label",r("gutter.code-folding.range.aria-label","Toggle code folding, rows $0 through $1",[W.start.row+1,W.end.row+1])):h?A.setAttribute("aria-label",r("gutter.code-folding.closed.aria-label","Toggle code folding, rows $0 through $1",[h.start.row+1,h.end.row+1])):A.setAttribute("aria-label",r("gutter.code-folding.open.aria-label","Toggle code folding, row $0",[y+1])),N?(A.setAttribute("aria-expanded","false"),A.setAttribute("title",r("gutter.code-folding.closed.title","Unfold code"))):(A.setAttribute("aria-expanded","true"),A.setAttribute("title",r("gutter.code-folding.open.title","Fold code")))}else A&&(d.setStyle(A.style,"display","none"),A.setAttribute("tabindex","0"),A.removeAttribute("role"),A.removeAttribute("aria-label"));if(z&&this.$showFoldedAnnotations){S.className="ace_gutter_annotation",M.className=x,M.className+=P,d.setStyle(M.style,"height",C),d.setStyle(S.style,"display","block"),d.setStyle(S.style,"height",C);var H;switch(P){case" ace_error_fold":H=r("gutter.annotation.aria-label.error","Error, read annotations row $0",[k]);break;case" ace_security_fold":H=r("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[k]);break;case" ace_warning_fold":H=r("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[k]);break}S.setAttribute("aria-label",H),S.setAttribute("tabindex","-1"),S.setAttribute("role","button")}else if(this.$annotations[y]){S.className="ace_gutter_annotation",M.className=x,this.$useSvgGutterIcons?M.className+=this.$annotations[y].className:b.classList.add(this.$annotations[y].className.replace(" ","")),d.setStyle(M.style,"height",C),d.setStyle(S.style,"display","block"),d.setStyle(S.style,"height",C);var H;switch(this.$annotations[y].className){case" ace_error":H=r("gutter.annotation.aria-label.error","Error, read annotations row $0",[k]);break;case" ace_security":H=r("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[k]);break;case" ace_warning":H=r("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[k]);break;case" ace_info":H=r("gutter.annotation.aria-label.info","Info, read annotations row $0",[k]);break;case" ace_hint":H=r("gutter.annotation.aria-label.hint","Suggestion, read annotations row $0",[k]);break}S.setAttribute("aria-label",H),S.setAttribute("tabindex","-1"),S.setAttribute("role","button")}else d.setStyle(S.style,"display","none"),S.removeAttribute("aria-label"),S.removeAttribute("role"),S.setAttribute("tabindex","0");return k!==$.data&&($.data=k),b.className!=E&&(b.className=E),d.setStyle(i.element.style,"height",this.$lines.computeLineHeight(y,u,T)+"px"),d.setStyle(i.element.style,"top",this.$lines.computeLineTop(y,u,T)+"px"),i.text=k,S.style.display==="none"&&A.style.display==="none"?i.element.setAttribute("aria-hidden",!0):i.element.setAttribute("aria-hidden",!1),i},a.prototype.setHighlightGutterLine=function(i){this.$highlightGutterLine=i},a.prototype.setShowLineNumbers=function(i){this.$renderer=!i&&{getWidth:function(){return 0},getText:function(){return""}}},a.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},a.prototype.setShowFoldWidgets=function(i){i?d.addCssClass(this.element,"ace_folding-enabled"):d.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=i,this.$padding=null},a.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},a.prototype.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var i=d.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(i.borderLeftWidth)||0)+(parseInt(i.paddingLeft)||0)+1,this.$padding.right=(parseInt(i.borderRightWidth)||0)+(parseInt(i.paddingRight)||0),this.$padding},a.prototype.getRegion=function(i){var u=this.$padding||this.$computePadding(),h=this.element.getBoundingClientRect();if(i.x<u.left+h.left)return"markers";if(this.$showFoldWidgets&&i.x>h.right-u.right)return"foldWidgets"},a})();o.prototype.$fixedWidth=!1,o.prototype.$highlightGutterLine=!0,o.prototype.$renderer="",o.prototype.$showLineNumbers=!0,o.prototype.$showFoldWidgets=!0,g.implement(o.prototype,l);function s(a){var i=document.createTextNode("");a.appendChild(i);var u=d.createElement("span");a.appendChild(u);var h=d.createElement("span");a.appendChild(h);var y=d.createElement("span");return h.appendChild(y),a}n.Gutter=o}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(t,n,p){var d=t("../range").Range,g=t("../lib/dom"),m=(function(){function f(r){this.element=g.createElement("div"),this.element.className="ace_layer ace_marker-layer",r.appendChild(this.element)}return f.prototype.setPadding=function(r){this.$padding=r},f.prototype.setSession=function(r){this.session=r},f.prototype.setMarkers=function(r){this.markers=r},f.prototype.elt=function(r,o){var s=this.i!=-1&&this.element.childNodes[this.i];s?this.i++:(s=document.createElement("div"),this.element.appendChild(s),this.i=-1),s.style.cssText=o,s.className=r},f.prototype.update=function(r){if(r){this.config=r,this.i=0;var o;for(var s in this.markers){var a=this.markers[s];if(!a.range){a.update(o,this,this.session,r);continue}var i=a.range.clipRows(r.firstRow,r.lastRow);if(!i.isEmpty())if(i=i.toScreenRange(this.session),a.renderer){var u=this.$getTop(i.start.row,r),h=this.$padding+i.start.column*r.characterWidth;a.renderer(o,i,h,u,r)}else a.type=="fullLine"?this.drawFullLineMarker(o,i,a.clazz,r):a.type=="screenLine"?this.drawScreenLineMarker(o,i,a.clazz,r):i.isMultiLine()?a.type=="text"?this.drawTextMarker(o,i,a.clazz,r):this.drawMultiLineMarker(o,i,a.clazz,r):this.drawSingleLineMarker(o,i,a.clazz+" ace_start ace_br15",r)}if(this.i!=-1)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},f.prototype.$getTop=function(r,o){return(r-o.firstRowScreen)*o.lineHeight},f.prototype.drawTextMarker=function(r,o,s,a,i){for(var u=this.session,h=o.start.row,y=o.end.row,b=h,T=0,$=0,A=u.getScreenLastRowColumn(b),S=new d(b,o.start.column,b,$);b<=y;b++)S.start.row=S.end.row=b,S.start.column=b==h?o.start.column:u.getRowWrapIndent(b),S.end.column=A,T=$,$=A,A=b+1<y?u.getScreenLastRowColumn(b+1):b==y?0:o.end.column,this.drawSingleLineMarker(r,S,s+(b==h?" ace_start":"")+" ace_br"+l(b==h||b==h+1&&o.start.column,T<$,$>A,b==y),a,b==y?0:1,i)},f.prototype.drawMultiLineMarker=function(r,o,s,a,i){var u=this.$padding,h=a.lineHeight,y=this.$getTop(o.start.row,a),b=u+o.start.column*a.characterWidth;if(i=i||"",this.session.$bidiHandler.isBidiRow(o.start.row)){var T=o.clone();T.end.row=T.start.row,T.end.column=this.session.getLine(T.start.row).length,this.drawBidiSingleLineMarker(r,T,s+" ace_br1 ace_start",a,null,i)}else this.elt(s+" ace_br1 ace_start","height:"+h+"px;right:"+u+"px;top:"+y+"px;left:"+b+"px;"+(i||""));if(this.session.$bidiHandler.isBidiRow(o.end.row)){var T=o.clone();T.start.row=T.end.row,T.start.column=0,this.drawBidiSingleLineMarker(r,T,s+" ace_br12",a,null,i)}else{y=this.$getTop(o.end.row,a);var $=o.end.column*a.characterWidth;this.elt(s+" ace_br12","height:"+h+"px;width:"+$+"px;top:"+y+"px;left:"+u+"px;"+(i||""))}if(h=(o.end.row-o.start.row-1)*a.lineHeight,!(h<=0)){y=this.$getTop(o.start.row+1,a);var A=(o.start.column?1:0)|(o.end.column?0:8);this.elt(s+(A?" ace_br"+A:""),"height:"+h+"px;right:"+u+"px;top:"+y+"px;left:"+u+"px;"+(i||""))}},f.prototype.drawSingleLineMarker=function(r,o,s,a,i,u){if(this.session.$bidiHandler.isBidiRow(o.start.row))return this.drawBidiSingleLineMarker(r,o,s,a,i,u);var h=a.lineHeight,y=(o.end.column+(i||0)-o.start.column)*a.characterWidth,b=this.$getTop(o.start.row,a),T=this.$padding+o.start.column*a.characterWidth;this.elt(s,"height:"+h+"px;width:"+y+"px;top:"+b+"px;left:"+T+"px;"+(u||""))},f.prototype.drawBidiSingleLineMarker=function(r,o,s,a,i,u){var h=a.lineHeight,y=this.$getTop(o.start.row,a),b=this.$padding,T=this.session.$bidiHandler.getSelections(o.start.column,o.end.column);T.forEach(function($){this.elt(s,"height:"+h+"px;width:"+($.width+(i||0))+"px;top:"+y+"px;left:"+(b+$.left)+"px;"+(u||""))},this)},f.prototype.drawFullLineMarker=function(r,o,s,a,i){var u=this.$getTop(o.start.row,a),h=a.lineHeight;o.start.row!=o.end.row&&(h+=this.$getTop(o.end.row,a)-u),this.elt(s,"height:"+h+"px;top:"+u+"px;left:0;right:0;"+(i||""))},f.prototype.drawScreenLineMarker=function(r,o,s,a,i){var u=this.$getTop(o.start.row,a),h=a.lineHeight;this.elt(s,"height:"+h+"px;top:"+u+"px;left:0;right:0;"+(i||""))},f})();m.prototype.$padding=0;function l(f,r,o,s){return(f?1:0)|(r?2:0)|(o?4:0)|(s?8:0)}n.Marker=m}),ace.define("ace/layer/text_util",["require","exports","module"],function(t,n,p){var d=new Set(["text","rparen","lparen"]);n.isTextToken=function(g){return d.has(g)}}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter","ace/config","ace/layer/text_util"],function(t,n,p){var d=t("../lib/oop"),g=t("../lib/dom"),m=t("../lib/lang"),l=t("./lines").Lines,f=t("../lib/event_emitter").EventEmitter,r=t("../config").nls,o=t("./text_util").isTextToken,s=(function(){function a(i){this.dom=g,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",i.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new l(this.element)}return a.prototype.$updateEolChar=function(){var i=this.session.doc,u=i.getNewLineCharacter()==`
1371
- `&&i.getNewLineMode()!="windows",h=u?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=h)return this.EOL_CHAR=h,!0},a.prototype.setPadding=function(i){this.$padding=i,this.element.style.margin="0 "+i+"px"},a.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},a.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},a.prototype.$setFontMetrics=function(i){this.$fontMetrics=i,this.$fontMetrics.on("changeCharacterSize",(function(u){this._signal("changeCharacterSize",u)}).bind(this)),this.$pollSizeChanges()},a.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},a.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},a.prototype.setSession=function(i){this.session=i,i&&this.$computeTabString()},a.prototype.setShowInvisibles=function(i){return this.showInvisibles==i?!1:(this.showInvisibles=i,typeof i=="string"?(this.showSpaces=/tab/i.test(i),this.showTabs=/space/i.test(i),this.showEOL=/eol/i.test(i)):this.showSpaces=this.showTabs=this.showEOL=i,this.$computeTabString(),!0)},a.prototype.setDisplayIndentGuides=function(i){return this.displayIndentGuides==i?!1:(this.displayIndentGuides=i,this.$computeTabString(),!0)},a.prototype.setHighlightIndentGuides=function(i){return this.$highlightIndentGuides===i?!1:(this.$highlightIndentGuides=i,i)},a.prototype.$computeTabString=function(){var i=this.session.getTabSize();this.tabSize=i;for(var u=this.$tabStrings=[0],h=1;h<i+1;h++)if(this.showTabs){var y=this.dom.createElement("span");y.className="ace_invisible ace_invisible_tab",y.textContent=m.stringRepeat(this.TAB_CHAR,h),u.push(y)}else u.push(this.dom.createTextNode(m.stringRepeat(" ",h),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var b="ace_indent-guide",T=this.showSpaces?" ace_invisible ace_invisible_space":"",$=this.showSpaces?m.stringRepeat(this.SPACE_CHAR,this.tabSize):m.stringRepeat(" ",this.tabSize),A=this.showTabs?" ace_invisible ace_invisible_tab":"",S=this.showTabs?m.stringRepeat(this.TAB_CHAR,this.tabSize):$,y=this.dom.createElement("span");y.className=b+T,y.textContent=$,this.$tabStrings[" "]=y;var y=this.dom.createElement("span");y.className=b+A,y.textContent=S,this.$tabStrings[" "]=y}},a.prototype.updateLines=function(i,u,h){if(this.config.lastRow!=i.lastRow||this.config.firstRow!=i.firstRow)return this.update(i);this.config=i;for(var y=Math.max(u,i.firstRow),b=Math.min(h,i.lastRow),T=this.element.childNodes,$=0,S=i.firstRow;S<y;S++){var M=this.session.getFoldLine(S);if(M)if(M.containsRow(y)){y=M.start.row;break}else S=M.end.row;$++}for(var A=!1,S=y,M=this.session.getNextFoldLine(S),R=M?M.start.row:1/0;S>R&&(S=M.end.row+1,M=this.session.getNextFoldLine(S,M),R=M?M.start.row:1/0),!(S>b);){var L=T[$++];if(L){this.dom.removeChildren(L),this.$renderLine(L,S,S==R?M:!1),A&&(L.style.top=this.$lines.computeLineTop(S,i,this.session)+"px");var _=i.lineHeight*this.session.getRowLength(S)+"px";L.style.height!=_&&(A=!0,L.style.height=_)}S++}if(A)for(;$<this.$lines.cells.length;){var I=this.$lines.cells[$++];I.element.style.top=this.$lines.computeLineTop(I.row,i,this.session)+"px"}},a.prototype.scrollLines=function(i){var u=this.config;if(this.config=i,this.$lines.pageChanged(u,i))return this.update(i);this.$lines.moveContainer(i);var h=i.lastRow,y=u?u.lastRow:-1;if(!u||y<i.firstRow)return this.update(i);if(h<u.firstRow)return this.update(i);if(!u||u.lastRow<i.firstRow)return this.update(i);if(i.lastRow<u.firstRow)return this.update(i);if(u.firstRow<i.firstRow)for(var b=this.session.getFoldedRowCount(u.firstRow,i.firstRow-1);b>0;b--)this.$lines.shift();if(u.lastRow>i.lastRow)for(var b=this.session.getFoldedRowCount(i.lastRow+1,u.lastRow);b>0;b--)this.$lines.pop();i.firstRow<u.firstRow&&this.$lines.unshift(this.$renderLinesFragment(i,i.firstRow,u.firstRow-1)),i.lastRow>u.lastRow&&this.$lines.push(this.$renderLinesFragment(i,u.lastRow+1,i.lastRow)),this.$highlightIndentGuide()},a.prototype.$renderLinesFragment=function(i,u,h){for(var y=[],b=u,T=this.session.getNextFoldLine(b),$=T?T.start.row:1/0;b>$&&(b=T.end.row+1,T=this.session.getNextFoldLine(b,T),$=T?T.start.row:1/0),!(b>h);){var A=this.$lines.createCell(b,i,this.session),S=A.element;this.dom.removeChildren(S),g.setStyle(S.style,"height",this.$lines.computeLineHeight(b,i,this.session)+"px"),g.setStyle(S.style,"top",this.$lines.computeLineTop(b,i,this.session)+"px"),this.$renderLine(S,b,b==$?T:!1),this.$useLineGroups()?S.className="ace_line_group":S.className="ace_line",y.push(A),b++}return y},a.prototype.update=function(i){this.$lines.moveContainer(i),this.config=i;for(var u=i.firstRow,h=i.lastRow,y=this.$lines;y.getLength();)y.pop();y.push(this.$renderLinesFragment(i,u,h))},a.prototype.$renderToken=function(i,u,h,y){for(var b=this,T=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069\u2060\u2061\u2062\u2063\u2064\u206A\u206B\u206B\u206C\u206D\u206E\u206F]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,$=this.dom.createFragment(this.element),A,S=0;A=T.exec(y);){var M=A[1],R=A[2],L=A[3],_=A[4],I=A[5];if(!(!b.showSpaces&&R)){var w=S!=A.index?y.slice(S,A.index):"";if(S=A.index+A[0].length,w&&$.appendChild(this.dom.createTextNode(w,this.element)),M){var v=b.session.getScreenTabSize(u+A.index);$.appendChild(b.$tabStrings[v].cloneNode(!0)),u+=v-1}else if(R)if(b.showSpaces){var C=this.dom.createElement("span");C.className="ace_invisible ace_invisible_space",C.textContent=m.stringRepeat(b.SPACE_CHAR,R.length),$.appendChild(C)}else $.appendChild(this.dom.createTextNode(R,this.element));else if(L){var C=this.dom.createElement("span");C.className="ace_invisible ace_invisible_space ace_invalid",C.textContent=m.stringRepeat(b.SPACE_CHAR,L.length),$.appendChild(C)}else if(_){u+=1;var C=this.dom.createElement("span");C.style.width=b.config.characterWidth*2+"px",C.className=b.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",C.textContent=b.showSpaces?b.SPACE_CHAR:_,$.appendChild(C)}else if(I){u+=1;var C=this.dom.createElement("span");C.style.width=b.config.characterWidth*2+"px",C.className="ace_cjk",C.textContent=I,$.appendChild(C)}}}if($.appendChild(this.dom.createTextNode(S?y.slice(S):y,this.element)),o(h.type))i.appendChild($);else{var E="ace_"+h.type.replace(/\./g," ace_"),C=this.dom.createElement("span");h.type=="fold"&&(C.style.width=h.value.length*this.config.characterWidth+"px",C.setAttribute("title",r("inline-fold.closed.title","Unfold code"))),C.className=E,C.appendChild($),i.appendChild(C)}return u+y.length},a.prototype.renderIndentGuide=function(i,u,h){var y=u.search(this.$indentGuideRe);if(y<=0||y>=h)return u;if(u[0]==" "){y-=y%this.tabSize;for(var b=y/this.tabSize,T=0;T<b;T++)i.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),u.substr(y)}else if(u[0]==" "){for(var T=0;T<y;T++)i.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),u.substr(y)}return this.$highlightIndentGuide(),u},a.prototype.$highlightIndentGuide=function(){if(!(!this.$highlightIndentGuides||!this.displayIndentGuides)){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var i=this.session.doc.$lines;if(i){var u=this.session.selection.getCursor(),h=/^\s*/.exec(this.session.doc.getLine(u.row))[0].length,y=Math.floor(h/this.tabSize);this.$highlightIndentGuideMarker={indentLevel:y,start:u.row};var b=this.session.$bracketHighlight;if(b){for(var T=this.session.$bracketHighlight.ranges,$=0;$<T.length;$++)if(u.row!==T[$].start.row){this.$highlightIndentGuideMarker.end=T[$].start.row,u.row>T[$].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&i[u.row]!==""&&u.column===i[u.row].length){this.$highlightIndentGuideMarker.dir=1;for(var $=u.row+1;$<i.length;$++){var A=i[$],S=/^\s*/.exec(A)[0].length;if(A!==""&&(this.$highlightIndentGuideMarker.end=$,S<=h))break}}this.$renderHighlightIndentGuide()}}},a.prototype.$clearActiveIndentGuide=function(){for(var i=this.$lines.cells,u=0;u<i.length;u++){var h=i[u],y=h.element.childNodes;if(y.length>0){for(var b=0;b<y.length;b++)if(y[b].classList&&y[b].classList.contains("ace_indent-guide-active")){y[b].classList.remove("ace_indent-guide-active");break}}}},a.prototype.$setIndentGuideActive=function(i,u){var h=this.session.doc.getLine(i.row);if(h!==""){var y=i.element.childNodes;if(y){var b=y[u-1];b&&b.classList&&b.classList.contains("ace_indent-guide")&&b.classList.add("ace_indent-guide-active")}}},a.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var i=this.$lines.cells;this.$clearActiveIndentGuide();var u=this.$highlightIndentGuideMarker.indentLevel;if(u!==0)if(this.$highlightIndentGuideMarker.dir===1)for(var h=0;h<i.length;h++){var y=i[h];if(this.$highlightIndentGuideMarker.end&&y.row>=this.$highlightIndentGuideMarker.start+1){if(y.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(y,u)}}else for(var h=i.length-1;h>=0;h--){var y=i[h];if(this.$highlightIndentGuideMarker.end&&y.row<this.$highlightIndentGuideMarker.start){if(y.row<=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(y,u)}}}},a.prototype.$createLineElement=function(i){var u=this.dom.createElement("div");return u.className="ace_line",u.style.height=this.config.lineHeight+"px",u},a.prototype.$renderWrappedLine=function(i,u,h){var y=0,b=0,T=h[0],$=0,A=this.$createLineElement();i.appendChild(A);for(var S=0;S<u.length;S++){var M=u[S],R=M.value;if(S==0&&this.displayIndentGuides){if(y=R.length,R=this.renderIndentGuide(A,R,T),!R)continue;y-=R.length}if(y+R.length<T)$=this.$renderToken(A,$,M,R),y+=R.length;else{for(;y+R.length>=T;)$=this.$renderToken(A,$,M,R.substring(0,T-y)),R=R.substring(T-y),y=T,A=this.$createLineElement(),i.appendChild(A),A.appendChild(this.dom.createTextNode(m.stringRepeat(" ",h.indent),this.element)),b++,$=0,T=h[b]||Number.MAX_VALUE;R.length!=0&&(y+=R.length,$=this.$renderToken(A,$,M,R))}}h[h.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(A,$,null,"",!0)},a.prototype.$renderSimpleLine=function(i,u){for(var h=0,y=0;y<u.length;y++){var b=u[y],T=b.value;if(!(y==0&&this.displayIndentGuides&&(T=this.renderIndentGuide(i,T),!T))){if(h+T.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(i,h,b,T);h=this.$renderToken(i,h,b,T)}}},a.prototype.$renderOverflowMessage=function(i,u,h,y,b){h&&this.$renderToken(i,u,h,y.slice(0,this.MAX_LINE_LENGTH-u));var T=this.dom.createElement("span");T.className="ace_inline_button ace_keyword ace_toggle_wrap",T.textContent=b?"<hide>":"<click to see more...>",i.appendChild(T)},a.prototype.$renderLine=function(i,u,h){if(!h&&h!=!1&&(h=this.session.getFoldLine(u)),h)var y=this.$getFoldLineTokens(u,h);else var y=this.session.getTokens(u);var b=i;if(y.length){var T=this.session.getRowSplitData(u);if(T&&T.length){this.$renderWrappedLine(i,y,T);var b=i.lastChild}else{var b=i;this.$useLineGroups()&&(b=this.$createLineElement(),i.appendChild(b)),this.$renderSimpleLine(b,y)}}else this.$useLineGroups()&&(b=this.$createLineElement(),i.appendChild(b));if(this.showEOL&&b){h&&(u=h.end.row);var $=this.dom.createElement("span");$.className="ace_invisible ace_invisible_eol",$.textContent=u==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,b.appendChild($)}},a.prototype.$getFoldLineTokens=function(i,u){var h=this.session,y=[];function b($,A,S){for(var M=0,R=0;R+$[M].value.length<A;)if(R+=$[M].value.length,M++,M==$.length)return;if(R!=A){var L=$[M].value.substring(A-R);L.length>S-A&&(L=L.substring(0,S-A)),y.push({type:$[M].type,value:L}),R=A+L.length,M+=1}for(;R<S&&M<$.length;){var L=$[M].value;L.length+R>S?y.push({type:$[M].type,value:L.substring(0,S-R)}):y.push($[M]),R+=L.length,M+=1}}var T=h.getTokens(i);return u.walk(function($,A,S,M,R){$!=null?y.push({type:"fold",value:$}):(R&&(T=h.getTokens(A)),T.length&&b(T,M,S))},u.end.row,this.session.getLine(u.end.row).length),y},a.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},a})();s.prototype.EOF_CHAR="¶",s.prototype.EOL_CHAR_LF="¬",s.prototype.EOL_CHAR_CRLF="¤",s.prototype.EOL_CHAR=s.prototype.EOL_CHAR_LF,s.prototype.TAB_CHAR="—",s.prototype.SPACE_CHAR="·",s.prototype.$padding=0,s.prototype.MAX_LINE_LENGTH=1e4,s.prototype.showInvisibles=!1,s.prototype.showSpaces=!1,s.prototype.showTabs=!1,s.prototype.showEOL=!1,s.prototype.displayIndentGuides=!0,s.prototype.$highlightIndentGuides=!0,s.prototype.$tabStrings=[],s.prototype.destroy={},s.prototype.onChangeTabSize=s.prototype.$computeTabString,d.implement(s.prototype,f),n.Text=s}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(t,n,p){var d=t("../lib/dom"),g=(function(){function m(l){this.element=d.createElement("div"),this.element.className="ace_layer ace_cursor-layer",l.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),d.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return m.prototype.$updateOpacity=function(l){for(var f=this.cursors,r=f.length;r--;)d.setStyle(f[r].style,"opacity",l?"":"0")},m.prototype.$startCssAnimation=function(){for(var l=this.cursors,f=l.length;f--;)l[f].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout((function(){this.$isAnimating&&d.addCssClass(this.element,"ace_animate-blinking")}).bind(this))},m.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,d.removeCssClass(this.element,"ace_animate-blinking")},m.prototype.setPadding=function(l){this.$padding=l},m.prototype.setSession=function(l){this.session=l},m.prototype.setBlinking=function(l){l!=this.isBlinking&&(this.isBlinking=l,this.restartTimer())},m.prototype.setBlinkInterval=function(l){l!=this.blinkInterval&&(this.blinkInterval=l,this.restartTimer())},m.prototype.setSmoothBlinking=function(l){l!=this.smoothBlinking&&(this.smoothBlinking=l,d.setCssClass(this.element,"ace_smooth-blinking",l),this.$updateCursors(!0),this.restartTimer())},m.prototype.addCursor=function(){var l=d.createElement("div");return l.className="ace_cursor",this.element.appendChild(l),this.cursors.push(l),l},m.prototype.removeCursor=function(){if(this.cursors.length>1){var l=this.cursors.pop();return l.parentNode.removeChild(l),l}},m.prototype.hideCursor=function(){this.isVisible=!1,d.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},m.prototype.showCursor=function(){this.isVisible=!0,d.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},m.prototype.restartTimer=function(){var l=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,d.removeCssClass(this.element,"ace_smooth-blinking")),l(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout((function(){this.$isSmoothBlinking&&d.addCssClass(this.element,"ace_smooth-blinking")}).bind(this))),d.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var f=(function(){this.timeoutId=setTimeout(function(){l(!1)},.6*this.blinkInterval)}).bind(this);this.intervalId=setInterval(function(){l(!0),f()},this.blinkInterval),f()}},m.prototype.getPixelPosition=function(l,f){if(!this.config||!this.session)return{left:0,top:0};l||(l=this.session.selection.getCursor());var r=this.session.documentToScreenPosition(l),o=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,l.row)?this.session.$bidiHandler.getPosLeft(r.column):r.column*this.config.characterWidth),s=(r.row-(f?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:o,top:s}},m.prototype.isCursorInView=function(l,f){return l.top>=0&&l.top<f.maxHeight},m.prototype.update=function(l){this.config=l;var f=this.session.$selectionMarkers,r=0,o=0;(f===void 0||f.length===0)&&(f=[{cursor:null}]);for(var r=0,s=f.length;r<s;r++){var a=this.getPixelPosition(f[r].cursor,!0);if(!((a.top>l.height+l.offset||a.top<0)&&r>1)){var i=this.cursors[o++]||this.addCursor(),u=i.style;this.drawCursor?this.drawCursor(i,a,l,f[r],this.session):this.isCursorInView(a,l)?(d.setStyle(u,"display","block"),d.translate(i,a.left,a.top),d.setStyle(u,"width",Math.round(l.characterWidth)+"px"),d.setStyle(u,"height",l.lineHeight+"px")):d.setStyle(u,"display","none")}}for(;this.cursors.length>o;)this.removeCursor();var h=this.session.getOverwrite();this.$setOverwrite(h),this.$pixelPos=a,this.restartTimer()},m.prototype.$setOverwrite=function(l){l!=this.overwrite&&(this.overwrite=l,l?d.addCssClass(this.element,"ace_overwrite-cursors"):d.removeCssClass(this.element,"ace_overwrite-cursors"))},m.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},m})();g.prototype.$padding=0,g.prototype.drawCursor=null,n.Cursor=g}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(t,n,p){var d=this&&this.__extends||(function(){var i=function(u,h){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,b){y.__proto__=b}||function(y,b){for(var T in b)Object.prototype.hasOwnProperty.call(b,T)&&(y[T]=b[T])},i(u,h)};return function(u,h){if(typeof h!="function"&&h!==null)throw new TypeError("Class extends value "+String(h)+" is not a constructor or null");i(u,h);function y(){this.constructor=u}u.prototype=h===null?Object.create(h):(y.prototype=h.prototype,new y)}})(),g=t("./lib/oop"),m=t("./lib/dom"),l=t("./lib/event"),f=t("./lib/event_emitter").EventEmitter,r=32768,o=(function(){function i(u,h){this.element=m.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+h,this.inner=m.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),u.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,l.addListener(this.element,"scroll",this.onScroll.bind(this)),l.addListener(this.element,"mousedown",l.preventDefault)}return i.prototype.setVisible=function(u){this.element.style.display=u?"":"none",this.isVisible=u,this.coeff=1},i})();g.implement(o.prototype,f);var s=(function(i){d(u,i);function u(h,y){var b=i.call(this,h,"-v")||this;return b.scrollTop=0,b.scrollHeight=0,y.$scrollbarWidth=b.width=m.scrollbarWidth(h.ownerDocument),b.inner.style.width=b.element.style.width=(b.width||15)+5+"px",b.$minWidth=0,b}return u.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var h=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-h)/(this.coeff-h)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},u.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},u.prototype.setHeight=function(h){this.element.style.height=h+"px"},u.prototype.setScrollHeight=function(h){this.scrollHeight=h,h>r?(this.coeff=r/h,h=r):this.coeff!=1&&(this.coeff=1),this.inner.style.height=h+"px"},u.prototype.setScrollTop=function(h){this.scrollTop!=h&&(this.skipEvent=!0,this.scrollTop=h,this.element.scrollTop=h*this.coeff)},u})(o);s.prototype.setInnerHeight=s.prototype.setScrollHeight;var a=(function(i){d(u,i);function u(h,y){var b=i.call(this,h,"-h")||this;return b.scrollLeft=0,b.height=y.$scrollbarWidth,b.inner.style.height=b.element.style.height=(b.height||15)+5+"px",b}return u.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},u.prototype.getHeight=function(){return this.isVisible?this.height:0},u.prototype.setWidth=function(h){this.element.style.width=h+"px"},u.prototype.setInnerWidth=function(h){this.inner.style.width=h+"px"},u.prototype.setScrollWidth=function(h){this.inner.style.width=h+"px"},u.prototype.setScrollLeft=function(h){this.scrollLeft!=h&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=h)},u})(o);n.ScrollBar=s,n.ScrollBarV=s,n.ScrollBarH=a,n.VScrollBar=s,n.HScrollBar=a}),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(t,n,p){var d=this&&this.__extends||(function(){var a=function(i,u){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,y){h.__proto__=y}||function(h,y){for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])},a(i,u)};return function(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");a(i,u);function h(){this.constructor=i}i.prototype=u===null?Object.create(u):(h.prototype=u.prototype,new h)}})(),g=t("./lib/oop"),m=t("./lib/dom"),l=t("./lib/event"),f=t("./lib/event_emitter").EventEmitter;m.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{
1368
+ `){var F=E.getLine(k.row);if(k.column>F.search(/\S|$/)){var N=F.substr(k.column).search(/\S|$/);E.doc.removeInLine(k.row,k.column,k.column+N)}}this.clearSelection();var P=k.column,z=E.getState(k.row),F=E.getLine(k.row),W=x.checkOutdent(z,F,v);if(E.insert(k,v),D&&D.selection&&(D.selection.length==2?this.selection.setSelectionRange(new h(k.row,P+D.selection[0],k.row,P+D.selection[1])):this.selection.setSelectionRange(new h(k.row+D.selection[0],D.selection[1],k.row+D.selection[2],D.selection[3]))),this.$enableAutoIndent){if(E.getDocument().isNewLine(v)){var H=x.getNextLineIndent(z,F.slice(0,k.column),E.getTabString());E.insert({row:k.row+1,column:0},H)}W&&x.autoOutdent(z,E,k.row)}},w.prototype.autoIndent=function(){for(var v=this.session,C=v.getMode(),E=this.selection.isEmpty()?[new h(0,0,v.doc.getLength()-1,0)]:this.selection.getAllRanges(),x="",k="",D="",I=v.getTabString(),N=0;N<E.length;N++)for(var P=E[N].start.row,z=E[N].end.row,F=P;F<=z;F++){F>0&&(x=v.getState(F-1),k=v.getLine(F-1),D=C.getNextLineIndent(x,k,I));var W=v.getLine(F),H=C.$getIndent(W);if(D!==H){if(H.length>0){var B=new h(F,0,F,H.length);v.remove(B)}D.length>0&&v.insert({row:F,column:0},D)}C.autoOutdent(x,v,F)}},w.prototype.onTextInput=function(v,C){if(!C)return this.keyBinding.onTextInput(v);this.startOperation({command:{name:"insertstring"}});var E=this.applyComposition.bind(this,v,C);this.selection.rangeCount?this.forEachSelection(E):E(),this.endOperation()},w.prototype.applyComposition=function(v,C){if(C.extendLeft||C.extendRight){var E=this.selection.getRange();E.start.column-=C.extendLeft,E.end.column+=C.extendRight,E.start.column<0&&(E.start.row--,E.start.column+=this.session.getLine(E.start.row).length+1),this.selection.setRange(E),!v&&!E.isEmpty()&&this.remove()}if((v||!this.selection.isEmpty())&&this.insert(v,!0),C.restoreStart||C.restoreEnd){var E=this.selection.getRange();E.start.column-=C.restoreStart,E.end.column-=C.restoreEnd,this.selection.setRange(E)}},w.prototype.onCommandKey=function(v,C,E){return this.keyBinding.onCommandKey(v,C,E)},w.prototype.setOverwrite=function(v){this.session.setOverwrite(v)},w.prototype.getOverwrite=function(){return this.session.getOverwrite()},w.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},w.prototype.setScrollSpeed=function(v){this.setOption("scrollSpeed",v)},w.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},w.prototype.setDragDelay=function(v){this.setOption("dragDelay",v)},w.prototype.getDragDelay=function(){return this.getOption("dragDelay")},w.prototype.setSelectionStyle=function(v){this.setOption("selectionStyle",v)},w.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},w.prototype.setHighlightActiveLine=function(v){this.setOption("highlightActiveLine",v)},w.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},w.prototype.setHighlightGutterLine=function(v){this.setOption("highlightGutterLine",v)},w.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},w.prototype.setHighlightSelectedWord=function(v){this.setOption("highlightSelectedWord",v)},w.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},w.prototype.setAnimatedScroll=function(v){this.renderer.setAnimatedScroll(v)},w.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},w.prototype.setShowInvisibles=function(v){this.renderer.setShowInvisibles(v)},w.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},w.prototype.setDisplayIndentGuides=function(v){this.renderer.setDisplayIndentGuides(v)},w.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},w.prototype.setHighlightIndentGuides=function(v){this.renderer.setHighlightIndentGuides(v)},w.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},w.prototype.setShowPrintMargin=function(v){this.renderer.setShowPrintMargin(v)},w.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},w.prototype.setPrintMarginColumn=function(v){this.renderer.setPrintMarginColumn(v)},w.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},w.prototype.setReadOnly=function(v){this.setOption("readOnly",v)},w.prototype.getReadOnly=function(){return this.getOption("readOnly")},w.prototype.setBehavioursEnabled=function(v){this.setOption("behavioursEnabled",v)},w.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},w.prototype.setWrapBehavioursEnabled=function(v){this.setOption("wrapBehavioursEnabled",v)},w.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},w.prototype.setShowFoldWidgets=function(v){this.setOption("showFoldWidgets",v)},w.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},w.prototype.setFadeFoldWidgets=function(v){this.setOption("fadeFoldWidgets",v)},w.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},w.prototype.remove=function(v){this.selection.isEmpty()&&(v=="left"?this.selection.selectLeft():this.selection.selectRight());var C=this.getSelectionRange();if(this.getBehavioursEnabled()){var E=this.session,x=E.getState(C.start.row),k=E.getMode().transformAction(x,"deletion",this,E,C);if(C.end.column===0){var D=E.getTextRange(C);if(D[D.length-1]==`
1369
+ `){var I=E.getLine(C.end.row);/^\s+$/.test(I)&&(C.end.column=I.length)}}k&&(C=k)}this.session.remove(C),this.clearSelection()},w.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},w.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},w.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},w.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var v=this.getSelectionRange();v.start.column==v.end.column&&v.start.row==v.end.row&&(v.end.column=0,v.end.row++),this.session.remove(v),this.clearSelection()},w.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var v=this.getCursorPosition();this.insert(`
1370
+ `),this.moveCursorToPosition(v)},w.prototype.setGhostText=function(v,C){this.renderer.setGhostText(v,C)},w.prototype.removeGhostText=function(){this.renderer.removeGhostText()},w.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var v=this.getCursorPosition(),C=v.column;if(C!==0){var E=this.session.getLine(v.row),x,k;C<E.length?(x=E.charAt(C)+E.charAt(C-1),k=new h(v.row,C-1,v.row,C+1)):(x=E.charAt(C-1)+E.charAt(C-2),k=new h(v.row,C-2,v.row,C)),this.session.replace(k,x),this.session.selection.moveToPosition(k.end)}}},w.prototype.toLowerCase=function(){var v=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var C=this.getSelectionRange(),E=this.session.getTextRange(C);this.session.replace(C,E.toLowerCase()),this.selection.setSelectionRange(v)},w.prototype.toUpperCase=function(){var v=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var C=this.getSelectionRange(),E=this.session.getTextRange(C);this.session.replace(C,E.toUpperCase()),this.selection.setSelectionRange(v)},w.prototype.indent=function(){var v=this.session,C=this.getSelectionRange();if(C.start.row<C.end.row){var E=this.$getSelectedRows();v.indentRows(E.first,E.last," ");return}else if(C.start.column<C.end.column){var x=v.getTextRange(C);if(!/^\s+$/.test(x)){var E=this.$getSelectedRows();v.indentRows(E.first,E.last," ");return}}var k=v.getLine(C.start.row),D=C.start,I=v.getTabSize(),N=v.documentToScreenColumn(D.row,D.column);if(this.session.getUseSoftTabs())var P=I-N%I,z=c.stringRepeat(" ",P);else{for(var P=N%I;k[C.start.column-1]==" "&&P;)C.start.column--,P--;this.selection.setSelectionRange(C),z=" "}return this.insert(z)},w.prototype.blockIndent=function(){var v=this.$getSelectedRows();this.session.indentRows(v.first,v.last," ")},w.prototype.blockOutdent=function(){var v=this.session.getSelection();this.session.outdentRows(v.getRange())},w.prototype.sortLines=function(){for(var v=this.$getSelectedRows(),C=this.session,E=[],x=v.first;x<=v.last;x++)E.push(C.getLine(x));E.sort(function(I,N){return I.toLowerCase()<N.toLowerCase()?-1:I.toLowerCase()>N.toLowerCase()?1:0});for(var k=new h(0,0,0,0),x=v.first;x<=v.last;x++){var D=C.getLine(x);k.start.row=x,k.end.row=x,k.end.column=D.length,C.replace(k,E[x-v.first])}},w.prototype.toggleCommentLines=function(){var v=this.session.getState(this.getCursorPosition().row),C=this.$getSelectedRows();this.session.getMode().toggleCommentLines(v,this.session,C.first,C.last)},w.prototype.toggleBlockComment=function(){var v=this.getCursorPosition(),C=this.session.getState(v.row),E=this.getSelectionRange();this.session.getMode().toggleBlockComment(C,this.session,E,v)},w.prototype.getNumberAt=function(v,C){var E=/[\-]?[0-9]+(?:\.[0-9]+)?/g;E.lastIndex=0;for(var x=this.session.getLine(v);E.lastIndex<C;){var k=E.exec(x);if(k.index<=C&&k.index+k[0].length>=C){var D={value:k[0],start:k.index,end:k.index+k[0].length};return D}}return null},w.prototype.modifyNumber=function(v){var C=this.selection.getCursor().row,E=this.selection.getCursor().column,x=new h(C,E-1,C,E),k=this.session.getTextRange(x);if(!isNaN(parseFloat(k))&&isFinite(k)){var D=this.getNumberAt(C,E);if(D){var I=D.value.indexOf(".")>=0?D.start+D.value.indexOf(".")+1:D.end,N=D.start+D.value.length-I,P=parseFloat(D.value);P*=Math.pow(10,N),I!==D.end&&E<I?v*=Math.pow(10,D.end-E-1):v*=Math.pow(10,D.end-E),P+=v,P/=Math.pow(10,N);var z=P.toFixed(N),F=new h(C,D.start,C,D.end);this.session.replace(F,z),this.moveCursorTo(C,Math.max(D.start+1,E+z.length-D.value.length))}}else this.toggleWord()},w.prototype.toggleWord=function(){var v=this.selection.getCursor().row,C=this.selection.getCursor().column;this.selection.selectWord();var E=this.getSelectedText(),x=this.selection.getWordRange().start.column,k=E.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),D=C-x-1;D<0&&(D=0);var I=0,N=0,P=this;E.match(/[A-Za-z0-9_]+/)&&k.forEach(function(V,Z){N=I+V.length,D>=I&&D<=N&&(E=V,P.selection.clearSelection(),P.moveCursorTo(v,I+x),P.selection.selectTo(v,N+x)),I=N});for(var z=this.$toggleWordPairs,F,W=0;W<z.length;W++)for(var H=z[W],B=0;B<=1;B++){var G=+!B,q=E.match(new RegExp("^\\s?_?("+c.escapeRegExp(H[B])+")\\s?$","i"));if(q){var Y=E.match(new RegExp("([_]|^|\\s)("+c.escapeRegExp(q[1])+")($|\\s)","g"));Y&&(F=E.replace(new RegExp(c.escapeRegExp(H[B]),"i"),function(V){var Z=H[G];return V.toUpperCase()==V?Z=Z.toUpperCase():V.charAt(0).toUpperCase()==V.charAt(0)&&(Z=Z.substr(0,0)+H[G].charAt(0).toUpperCase()+Z.substr(1)),Z}),this.insert(F),F="")}}},w.prototype.findLinkAt=function(v,C){var E,x,k=this.session.getLine(v),D=k.split(/((?:https?|ftp):\/\/[\S]+)/),I=C;I<0&&(I=0);var N=0,P=0,z;try{for(var F=d(D),W=F.next();!W.done;W=F.next()){var H=W.value;if(P=N+H.length,I>=N&&I<=P&&H.match(/((?:https?|ftp):\/\/[\S]+)/)){z=H.replace(/[\s:.,'";}\]]+$/,"");break}N=P}}catch(B){E={error:B}}finally{try{W&&!W.done&&(x=F.return)&&x.call(F)}finally{if(E)throw E.error}}return z},w.prototype.openLink=function(){var v=this.selection.getCursor(),C=this.findLinkAt(v.row,v.column);return C&&window.open(C,"_blank"),C!=null},w.prototype.removeLines=function(){var v=this.$getSelectedRows();this.session.removeFullLines(v.first,v.last),this.clearSelection()},w.prototype.duplicateSelection=function(){var v=this.selection,C=this.session,E=v.getRange(),x=v.isBackwards();if(E.isEmpty()){var k=E.start.row;C.duplicateLines(k,k)}else{var D=x?E.start:E.end,I=C.insert(D,C.getTextRange(E));E.start=D,E.end=I,v.setSelectionRange(E,x)}},w.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},w.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},w.prototype.moveText=function(v,C,E){return this.session.moveText(v,C,E)},w.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},w.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},w.prototype.$moveLines=function(v,C){var E,x,k=this.selection;if(!k.inMultiSelectMode||this.inVirtualSelectionMode){var D=k.toOrientedRange();E=this.$getSelectedRows(D),x=this.session.$moveLines(E.first,E.last,C?0:v),C&&v==-1&&(x=0),D.moveBy(x,0),k.fromOrientedRange(D)}else{var I=k.rangeList.ranges;k.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var N=0,P=0,z=I.length,F=0;F<z;F++){var W=F;I[F].moveBy(N,0),E=this.$getSelectedRows(I[F]);for(var H=E.first,B=E.last;++F<z;){P&&I[F].moveBy(P,0);var G=this.$getSelectedRows(I[F]);if(C&&G.first!=B)break;if(!C&&G.first>B+1)break;B=G.last}for(F--,N=this.session.$moveLines(H,B,C?0:v),C&&v==-1&&(W=F+1);W<=F;)I[W].moveBy(N,0),W++;C||(N=0),P+=N}k.fromOrientedRange(k.ranges[0]),k.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},w.prototype.$getSelectedRows=function(v){return v=(v||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(v.start.row),last:this.session.getRowFoldEnd(v.end.row)}},w.prototype.onCompositionStart=function(v){this.renderer.showComposition(v)},w.prototype.onCompositionUpdate=function(v){this.renderer.setCompositionText(v)},w.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},w.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},w.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},w.prototype.isRowVisible=function(v){return v>=this.getFirstVisibleRow()&&v<=this.getLastVisibleRow()},w.prototype.isRowFullyVisible=function(v){return v>=this.renderer.getFirstFullyVisibleRow()&&v<=this.renderer.getLastFullyVisibleRow()},w.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},w.prototype.$moveByPage=function(v,C){var E=this.renderer,x=this.renderer.layerConfig,k=v*Math.floor(x.height/x.lineHeight);C===!0?this.selection.$moveSelection(function(){this.moveCursorBy(k,0)}):C===!1&&(this.selection.moveCursorBy(k,0),this.selection.clearSelection());var D=E.scrollTop;E.scrollBy(0,k*x.lineHeight),C!=null&&E.scrollCursorIntoView(null,.5),E.animateScrolling(D)},w.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},w.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},w.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},w.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},w.prototype.scrollPageDown=function(){this.$moveByPage(1)},w.prototype.scrollPageUp=function(){this.$moveByPage(-1)},w.prototype.scrollToRow=function(v){this.renderer.scrollToRow(v)},w.prototype.scrollToLine=function(v,C,E,x){this.renderer.scrollToLine(v,C,E,x)},w.prototype.centerSelection=function(){var v=this.getSelectionRange(),C={row:Math.floor(v.start.row+(v.end.row-v.start.row)/2),column:Math.floor(v.start.column+(v.end.column-v.start.column)/2)};this.renderer.alignCursor(C,.5)},w.prototype.getCursorPosition=function(){return this.selection.getCursor()},w.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},w.prototype.getSelectionRange=function(){return this.selection.getRange()},w.prototype.selectAll=function(){this.selection.selectAll()},w.prototype.clearSelection=function(){this.selection.clearSelection()},w.prototype.moveCursorTo=function(v,C){this.selection.moveCursorTo(v,C)},w.prototype.moveCursorToPosition=function(v){this.selection.moveCursorToPosition(v)},w.prototype.jumpToMatching=function(v,C){var E=this.getCursorPosition(),x=new A(this.session,E.row,E.column),k=x.getCurrentToken(),D=0;k&&k.type.indexOf("tag-name")!==-1&&(k=x.stepBackward());var I=k||x.stepForward();if(I){var N,P=!1,z={},F=E.column-I.start,W,H={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(I.value.match(/[{}()\[\]]/g)){for(;F<I.value.length&&!P;F++)if(H[I.value[F]])switch(W=H[I.value[F]]+"."+I.type.replace("rparen","lparen"),isNaN(z[W])&&(z[W]=0),I.value[F]){case"(":case"[":case"{":z[W]++;break;case")":case"]":case"}":z[W]--,z[W]===-1&&(N="bracket",P=!0);break}}else I.type.indexOf("tag-name")!==-1&&(isNaN(z[I.value])&&(z[I.value]=0),k.value==="<"&&D>1?z[I.value]++:k.value==="</"&&z[I.value]--,z[I.value]===-1&&(N="tag",P=!0));P||(k=I,D++,I=x.stepForward(),F=0)}while(I&&!P);if(N){var B,G;if(N==="bracket")B=this.session.getBracketRange(E),B||(B=new h(x.getCurrentTokenRow(),x.getCurrentTokenColumn()+F-1,x.getCurrentTokenRow(),x.getCurrentTokenColumn()+F-1),G=B.start,(C||G.row===E.row&&Math.abs(G.column-E.column)<2)&&(B=this.session.getBracketRange(G)));else if(N==="tag"){if(!I||I.type.indexOf("tag-name")===-1)return;if(B=new h(x.getCurrentTokenRow(),x.getCurrentTokenColumn()-2,x.getCurrentTokenRow(),x.getCurrentTokenColumn()-2),B.compare(E.row,E.column)===0){var q=this.session.getMatchingTags(E);q&&(q.openTag.contains(E.row,E.column)?(B=q.closeTag,G=B.start):(B=q.openTag,q.closeTag.start.row===E.row&&q.closeTag.start.column===E.column?G=B.end:G=B.start))}G=G||B.start}G=B&&B.cursor||G,G&&(v?B&&C?this.selection.setRange(B):B&&B.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(G.row,G.column):this.selection.moveTo(G.row,G.column))}}},w.prototype.gotoLine=function(v,C,E){this.selection.clearSelection(),this.session.unfold({row:v-1,column:C||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(v-1,C||0),this.isRowFullyVisible(v-1)||this.scrollToLine(v-1,!0,E)},w.prototype.navigateTo=function(v,C){this.selection.moveTo(v,C)},w.prototype.navigateUp=function(v){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var C=this.selection.anchor.getPosition();return this.moveCursorToPosition(C)}this.selection.clearSelection(),this.selection.moveCursorBy(-v||-1,0)},w.prototype.navigateDown=function(v){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var C=this.selection.anchor.getPosition();return this.moveCursorToPosition(C)}this.selection.clearSelection(),this.selection.moveCursorBy(v||1,0)},w.prototype.navigateLeft=function(v){if(this.selection.isEmpty())for(v=v||1;v--;)this.selection.moveCursorLeft();else{var C=this.getSelectionRange().start;this.moveCursorToPosition(C)}this.clearSelection()},w.prototype.navigateRight=function(v){if(this.selection.isEmpty())for(v=v||1;v--;)this.selection.moveCursorRight();else{var C=this.getSelectionRange().end;this.moveCursorToPosition(C)}this.clearSelection()},w.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},w.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},w.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},w.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},w.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},w.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},w.prototype.replace=function(v,C){C&&this.$search.set(C);var E=this.$search.find(this.session),x=0;return E&&(this.$tryReplace(E,v)&&(x=1),this.selection.setSelectionRange(E),this.renderer.scrollSelectionIntoView(E.start,E.end)),x},w.prototype.replaceAll=function(v,C){C&&this.$search.set(C);var E=this.$search.findAll(this.session),x=0;if(!E.length)return x;var k=this.getSelectionRange();this.selection.moveTo(0,0);for(var D=E.length-1;D>=0;--D)this.$tryReplace(E[D],v)&&x++;return this.selection.setSelectionRange(k),x},w.prototype.$tryReplace=function(v,C){var E=this.session.getTextRange(v);return C=this.$search.replace(E,C),C!==null?(v.end=this.session.replace(v,C),v):null},w.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},w.prototype.find=function(v,C,E){C||(C={}),typeof v=="string"||v instanceof RegExp?C.needle=v:typeof v=="object"&&g.mixin(C,v);var x=this.selection.getRange();C.needle==null&&(v=this.session.getTextRange(x)||this.$search.$options.needle,v||(x=this.session.getWordRange(x.start.row,x.start.column),v=this.session.getTextRange(x)),this.$search.set({needle:v})),this.$search.set(C),C.start||this.$search.set({start:x});var k=this.$search.find(this.session);if(C.preventScroll)return k;if(k)return this.revealRange(k,E),k;C.backwards?x.start=x.end:x.end=x.start,this.selection.setRange(x)},w.prototype.findNext=function(v,C){this.find({skipCurrent:!0,backwards:!1},v,C)},w.prototype.findPrevious=function(v,C){this.find(v,{skipCurrent:!0,backwards:!0},C)},w.prototype.revealRange=function(v,C){this.session.unfold(v),this.selection.setSelectionRange(v);var E=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(v.start,v.end,.5),C!==!1&&this.renderer.animateScrolling(E)},w.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},w.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},w.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(v){v.destroy()}),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},w.prototype.setAutoScrollEditorIntoView=function(v){if(v){var C,E=this,x=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var k=this.$scrollAnchor;k.style.cssText="position:absolute",this.container.insertBefore(k,this.container.firstChild);var D=this.on("changeSelection",function(){x=!0}),I=this.renderer.on("beforeRender",function(){x&&(C=E.renderer.container.getBoundingClientRect())}),N=this.renderer.on("afterRender",function(){if(x&&C&&(E.isFocused()||E.searchBox&&E.searchBox.isFocused())){var P=E.renderer,z=P.$cursorLayer.$pixelPos,F=P.layerConfig,W=z.top-F.offset;z.top>=0&&W+C.top<0?x=!0:z.top<F.height&&z.top+C.top+F.lineHeight>window.innerHeight?x=!1:x=null,x!=null&&(k.style.top=W+"px",k.style.left=z.left+"px",k.style.height=F.lineHeight+"px",k.scrollIntoView(x)),x=C=null}});this.setAutoScrollEditorIntoView=function(P){P||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",D),this.renderer.off("afterRender",N),this.renderer.off("beforeRender",I))}}},w.prototype.$resetCursorStyle=function(){var v=this.$cursorStyle||"ace",C=this.renderer.$cursorLayer;C&&(C.setSmoothBlinking(/smooth/.test(v)),C.isBlinking=!this.$readOnly&&v!="wide",m.setCssClass(C.element,"ace_slim-cursors",/slim/.test(v)))},w.prototype.prompt=function(v,C,E){var x=this;$.loadModule("ace/ext/prompt",function(k){k.prompt(x,v,C,E)})},w})();_.$uid=0,_.prototype.curOp=null,_.prototype.prevOp={},_.prototype.$mergeableCommands=["backspace","del","insertstring"],_.prototype.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],g.implement(_.prototype,y),$.defineOptions(_.prototype,"editor",{selectionStyle:{set:function(w){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:w})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(w){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(w){this.textInput.setReadOnly(w),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(w){this.textInput.setCopyWithEmptySelection(w)},initialValue:!1},cursorStyle:{set:function(w){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(w){this.setAutoScrollEditorIntoView(w)}},keyboardHandler:{set:function(w){this.setKeyboardHandler(w)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(w){this.session.setValue(w)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(w){this.setSession(w)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(w){this.renderer.$gutterLayer.setShowLineNumbers(w),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),w&&this.$relativeLineNumbers?O.attach(this):O.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(w){this.$showLineNumbers&&w?O.attach(this):O.detach(this)}},placeholder:{set:function(w){this.$updatePlaceholder||(this.$updatePlaceholder=(function(){var v=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(v&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),m.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!v&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),m.addCssClass(this.container,"ace_hasPlaceholder");var C=m.createElement("div");C.className="ace_placeholder",C.textContent=this.$placeholder||"",this.renderer.placeholderNode=C,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!v&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}).bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(w){var v={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(x){x.blur(),x.renderer.scroller.focus()},readOnly:!0},C=function(x){if(x.target==this.renderer.scroller&&x.keyCode===L.enter){x.preventDefault();var k=this.getCursorPosition().row;this.isRowVisible(k)||this.scrollToLine(k,!0,!0),this.focus()}},E;w?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(f.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",M("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",M("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",C.bind(this)),this.commands.addCommand(v),this.renderer.$gutter.setAttribute("tabindex",0),this.renderer.$gutter.setAttribute("aria-hidden",!1),this.renderer.$gutter.setAttribute("role","group"),this.renderer.$gutter.setAttribute("aria-roledescription",M("editor.gutter.aria-roledescription","editor")),this.renderer.$gutter.setAttribute("aria-label",M("editor.gutter.aria-label","Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute("aria-hidden",!0),E||(E=new S(this)),E.addListener(),this.textInput.setAriaOptions({setLabel:!0})):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",C.bind(this)),this.commands.removeCommand(v),this.renderer.content.removeAttribute("aria-hidden"),this.renderer.$gutter.setAttribute("tabindex",-1),this.renderer.$gutter.setAttribute("aria-hidden",!0),this.renderer.$gutter.removeAttribute("role"),this.renderer.$gutter.removeAttribute("aria-roledescription"),this.renderer.$gutter.removeAttribute("aria-label"),this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName),E&&E.removeListener())},initialValue:!1},textInputAriaLabel:{set:function(w){this.$textInputAriaLabel=w},initialValue:""},enableMobileMenu:{set:function(w){this.$enableMobileMenu=w},initialValue:!0},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",showFoldedAnnotations:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var O={getText:function(w,v){return(Math.abs(w.selection.lead.row-v)||v+1+(v<9?"·":""))+""},getWidth:function(w,v,C){return Math.max(v.toString().length,(C.lastRow+1).toString().length,2)*C.characterWidth},update:function(w,v){v.renderer.$loop.schedule(v.renderer.CHANGE_GUTTER)},attach:function(w){w.renderer.$gutterLayer.$renderer=this,w.on("changeSelection",this.update),this.update(null,w)},detach:function(w){w.renderer.$gutterLayer.$renderer==this&&(w.renderer.$gutterLayer.$renderer=null),w.off("changeSelection",this.update),this.update(null,w)}};n.Editor=_}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(t,n,p){var d=t("../lib/dom"),g=(function(){function m(c,f){this.element=c,this.canvasHeight=f||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return m.prototype.moveContainer=function(c){d.translate(this.element,0,-(c.firstRowScreen*c.lineHeight%this.canvasHeight)-c.offset*this.$offsetCoefficient)},m.prototype.pageChanged=function(c,f){return Math.floor(c.firstRowScreen*c.lineHeight/this.canvasHeight)!==Math.floor(f.firstRowScreen*f.lineHeight/this.canvasHeight)},m.prototype.computeLineTop=function(c,f,r){var o=f.firstRowScreen*f.lineHeight,s=Math.floor(o/this.canvasHeight),a=r.documentToScreenRow(c,0)*f.lineHeight;return a-s*this.canvasHeight},m.prototype.computeLineHeight=function(c,f,r){return f.lineHeight*r.getRowLineCount(c)},m.prototype.getLength=function(){return this.cells.length},m.prototype.get=function(c){return this.cells[c]},m.prototype.shift=function(){this.$cacheCell(this.cells.shift())},m.prototype.pop=function(){this.$cacheCell(this.cells.pop())},m.prototype.push=function(c){if(Array.isArray(c)){this.cells.push.apply(this.cells,c);for(var f=d.createFragment(this.element),r=0;r<c.length;r++)f.appendChild(c[r].element);this.element.appendChild(f)}else this.cells.push(c),this.element.appendChild(c.element)},m.prototype.unshift=function(c){if(Array.isArray(c)){this.cells.unshift.apply(this.cells,c);for(var f=d.createFragment(this.element),r=0;r<c.length;r++)f.appendChild(c[r].element);this.element.firstChild?this.element.insertBefore(f,this.element.firstChild):this.element.appendChild(f)}else this.cells.unshift(c),this.element.insertAdjacentElement("afterbegin",c.element)},m.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},m.prototype.$cacheCell=function(c){c&&(c.element.remove(),this.cellCache.push(c))},m.prototype.createCell=function(c,f,r,o){var s=this.cellCache.pop();if(!s){var a=d.createElement("div");o&&o(a),this.element.appendChild(a),s={element:a,text:"",row:c}}return s.row=c,s},m})();n.Lines=g}),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines","ace/config"],function(t,n,p){var d=t("../lib/dom"),g=t("../lib/oop"),m=t("../lib/lang"),c=t("../lib/event_emitter").EventEmitter,f=t("./lines").Lines,r=t("../config").nls,o=(function(){function a(i){this.element=d.createElement("div"),this.element.className="ace_layer ace_gutter-layer",i.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new f(this.element),this.$lines.$offsetCoefficient=1}return a.prototype.setSession=function(i){this.session&&this.session.off("change",this.$updateAnnotations),this.session=i,i&&i.on("change",this.$updateAnnotations)},a.prototype.addGutterDecoration=function(i,u){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(i,u)},a.prototype.removeGutterDecoration=function(i,u){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(i,u)},a.prototype.setAnnotations=function(i){this.$annotations=[];for(var u=0;u<i.length;u++){var h=i[u],y=h.row,b=this.$annotations[y];b||(b=this.$annotations[y]={text:[],type:[],displayText:[]});var T=h.text,$=h.text,A=h.type;T=T?m.escapeHTML(T):h.html||"",$=$||h.html||"",b.text.indexOf(T)===-1&&(b.text.push(T),b.type.push(A),b.displayText.push($));var S=h.className;S?b.className=S:A==="error"?b.className=" ace_error":A==="security"&&!/\bace_error\b/.test(b.className)?b.className=" ace_security":A==="warning"&&!/\bace_(error|security)\b/.test(b.className)?b.className=" ace_warning":A==="info"&&!b.className?b.className=" ace_info":A==="hint"&&!b.className&&(b.className=" ace_hint")}},a.prototype.$updateAnnotations=function(i){if(this.$annotations.length){var u=i.start.row,h=i.end.row-u;if(h!==0)if(i.action=="remove")this.$annotations.splice(u,h+1,null);else{var y=new Array(h+1);y.unshift(u,1),this.$annotations.splice.apply(this.$annotations,y)}}},a.prototype.update=function(i){this.config=i;var u=this.session,h=i.firstRow,y=Math.min(i.lastRow+i.gutterOffset,u.getLength()-1);this.oldLastRow=y,this.config=i,this.$lines.moveContainer(i),this.$updateCursorRow();for(var b=u.getNextFoldLine(h),T=b?b.start.row:1/0,$=null,A=-1,S=h;;){if(S>T&&(S=b.end.row+1,b=u.getNextFoldLine(S,b),T=b?b.start.row:1/0),S>y){for(;this.$lines.getLength()>A+1;)this.$lines.pop();break}$=this.$lines.get(++A),$?$.row=S:($=this.$lines.createCell(S,i,this.session,s),this.$lines.push($)),this.$renderCell($,i,b,S),S++}this._signal("afterRender"),this.$updateGutterWidth(i)},a.prototype.$updateGutterWidth=function(i){var u=this.session,h=u.gutterRenderer||this.$renderer,y=u.$firstLineNumber,b=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||u.$useWrapMode)&&(b=u.getLength()+y-1);var T=h?h.getWidth(u,b,i):b.toString().length*i.characterWidth,$=this.$padding||this.$computePadding();T+=$.left+$.right,T!==this.gutterWidth&&!isNaN(T)&&(this.gutterWidth=T,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",T))},a.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var i=this.session.selection.getCursor();this.$cursorRow!==i.row&&(this.$cursorRow=i.row)}},a.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var i=this.session.selection.cursor.row;if(this.$cursorRow=i,!(this.$cursorCell&&this.$cursorCell.row==i)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var u=this.$lines.cells;this.$cursorCell=null;for(var h=0;h<u.length;h++){var y=u[h];if(y.row>=this.$cursorRow){if(y.row>this.$cursorRow){var b=this.session.getFoldLine(this.$cursorRow);if(h>0&&b&&b.start.row==u[h-1].row)y=u[h-1];else break}y.element.className="ace_gutter-active-line "+y.element.className,this.$cursorCell=y;break}}}}},a.prototype.scrollLines=function(i){var u=this.config;if(this.config=i,this.$updateCursorRow(),this.$lines.pageChanged(u,i))return this.update(i);this.$lines.moveContainer(i);var h=Math.min(i.lastRow+i.gutterOffset,this.session.getLength()-1),y=this.oldLastRow;if(this.oldLastRow=h,!u||y<i.firstRow)return this.update(i);if(h<u.firstRow)return this.update(i);if(u.firstRow<i.firstRow)for(var b=this.session.getFoldedRowCount(u.firstRow,i.firstRow-1);b>0;b--)this.$lines.shift();if(y>h)for(var b=this.session.getFoldedRowCount(h+1,y);b>0;b--)this.$lines.pop();i.firstRow<u.firstRow&&this.$lines.unshift(this.$renderLines(i,i.firstRow,u.firstRow-1)),h>y&&this.$lines.push(this.$renderLines(i,y+1,h)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(i)},a.prototype.$renderLines=function(i,u,h){for(var y=[],b=u,T=this.session.getNextFoldLine(b),$=T?T.start.row:1/0;b>$&&(b=T.end.row+1,T=this.session.getNextFoldLine(b,T),$=T?T.start.row:1/0),!(b>h);){var A=this.$lines.createCell(b,i,this.session,s);this.$renderCell(A,i,T,b),y.push(A),b++}return y},a.prototype.$renderCell=function(i,u,h,y){var b=i.element,T=this.session,$=b.childNodes[0],A=b.childNodes[1],S=b.childNodes[2],M=S.firstChild,R=T.$firstLineNumber,L=T.$breakpoints,_=T.$decorations,O=T.gutterRenderer||this.$renderer,w=this.$showFoldWidgets&&T.foldWidgets,v=h?h.start.row:Number.MAX_VALUE,C=u.lineHeight+"px",E=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",x=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",k=(O?O.getText(T,y):y+R).toString();if(this.$highlightGutterLine&&(y==this.$cursorRow||h&&y<this.$cursorRow&&y>=v&&this.$cursorRow<=h.end.row)&&(E+="ace_gutter-active-line ",this.$cursorCell!=i&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=i)),L[y]&&(E+=L[y]),_[y]&&(E+=_[y]),this.$annotations[y]&&y!==v&&(E+=this.$annotations[y].className),w){var D=w[y];D==null&&(D=w[y]=T.getFoldWidget(y))}if(D){var I="ace_fold-widget ace_"+D,N=D=="start"&&y==v&&y<h.end.row;if(N){I+=" ace_closed";for(var P="",z=!1,F=y+1;F<=h.end.row;F++)if(this.$annotations[F]){if(this.$annotations[F].className===" ace_error"){z=!0,P=" ace_error_fold";break}this.$annotations[F].className===" ace_security"?(z=!0,P=" ace_security_fold"):this.$annotations[F].className===" ace_warning"&&P!==" ace_security_fold"&&(z=!0,P=" ace_warning_fold")}E+=P}else I+=" ace_open";A.className!=I&&(A.className=I),d.setStyle(A.style,"height",C),d.setStyle(A.style,"display","inline-block"),A.setAttribute("role","button"),A.setAttribute("tabindex","-1");var W=T.getFoldWidgetRange(y);W?A.setAttribute("aria-label",r("gutter.code-folding.range.aria-label","Toggle code folding, rows $0 through $1",[W.start.row+1,W.end.row+1])):h?A.setAttribute("aria-label",r("gutter.code-folding.closed.aria-label","Toggle code folding, rows $0 through $1",[h.start.row+1,h.end.row+1])):A.setAttribute("aria-label",r("gutter.code-folding.open.aria-label","Toggle code folding, row $0",[y+1])),N?(A.setAttribute("aria-expanded","false"),A.setAttribute("title",r("gutter.code-folding.closed.title","Unfold code"))):(A.setAttribute("aria-expanded","true"),A.setAttribute("title",r("gutter.code-folding.open.title","Fold code")))}else A&&(d.setStyle(A.style,"display","none"),A.setAttribute("tabindex","0"),A.removeAttribute("role"),A.removeAttribute("aria-label"));if(z&&this.$showFoldedAnnotations){S.className="ace_gutter_annotation",M.className=x,M.className+=P,d.setStyle(M.style,"height",C),d.setStyle(S.style,"display","block"),d.setStyle(S.style,"height",C);var H;switch(P){case" ace_error_fold":H=r("gutter.annotation.aria-label.error","Error, read annotations row $0",[k]);break;case" ace_security_fold":H=r("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[k]);break;case" ace_warning_fold":H=r("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[k]);break}S.setAttribute("aria-label",H),S.setAttribute("tabindex","-1"),S.setAttribute("role","button")}else if(this.$annotations[y]){S.className="ace_gutter_annotation",M.className=x,this.$useSvgGutterIcons?M.className+=this.$annotations[y].className:b.classList.add(this.$annotations[y].className.replace(" ","")),d.setStyle(M.style,"height",C),d.setStyle(S.style,"display","block"),d.setStyle(S.style,"height",C);var H;switch(this.$annotations[y].className){case" ace_error":H=r("gutter.annotation.aria-label.error","Error, read annotations row $0",[k]);break;case" ace_security":H=r("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[k]);break;case" ace_warning":H=r("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[k]);break;case" ace_info":H=r("gutter.annotation.aria-label.info","Info, read annotations row $0",[k]);break;case" ace_hint":H=r("gutter.annotation.aria-label.hint","Suggestion, read annotations row $0",[k]);break}S.setAttribute("aria-label",H),S.setAttribute("tabindex","-1"),S.setAttribute("role","button")}else d.setStyle(S.style,"display","none"),S.removeAttribute("aria-label"),S.removeAttribute("role"),S.setAttribute("tabindex","0");return k!==$.data&&($.data=k),b.className!=E&&(b.className=E),d.setStyle(i.element.style,"height",this.$lines.computeLineHeight(y,u,T)+"px"),d.setStyle(i.element.style,"top",this.$lines.computeLineTop(y,u,T)+"px"),i.text=k,S.style.display==="none"&&A.style.display==="none"?i.element.setAttribute("aria-hidden",!0):i.element.setAttribute("aria-hidden",!1),i},a.prototype.setHighlightGutterLine=function(i){this.$highlightGutterLine=i},a.prototype.setShowLineNumbers=function(i){this.$renderer=!i&&{getWidth:function(){return 0},getText:function(){return""}}},a.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},a.prototype.setShowFoldWidgets=function(i){i?d.addCssClass(this.element,"ace_folding-enabled"):d.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=i,this.$padding=null},a.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},a.prototype.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var i=d.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(i.borderLeftWidth)||0)+(parseInt(i.paddingLeft)||0)+1,this.$padding.right=(parseInt(i.borderRightWidth)||0)+(parseInt(i.paddingRight)||0),this.$padding},a.prototype.getRegion=function(i){var u=this.$padding||this.$computePadding(),h=this.element.getBoundingClientRect();if(i.x<u.left+h.left)return"markers";if(this.$showFoldWidgets&&i.x>h.right-u.right)return"foldWidgets"},a})();o.prototype.$fixedWidth=!1,o.prototype.$highlightGutterLine=!0,o.prototype.$renderer="",o.prototype.$showLineNumbers=!0,o.prototype.$showFoldWidgets=!0,g.implement(o.prototype,c);function s(a){var i=document.createTextNode("");a.appendChild(i);var u=d.createElement("span");a.appendChild(u);var h=d.createElement("span");a.appendChild(h);var y=d.createElement("span");return h.appendChild(y),a}n.Gutter=o}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(t,n,p){var d=t("../range").Range,g=t("../lib/dom"),m=(function(){function f(r){this.element=g.createElement("div"),this.element.className="ace_layer ace_marker-layer",r.appendChild(this.element)}return f.prototype.setPadding=function(r){this.$padding=r},f.prototype.setSession=function(r){this.session=r},f.prototype.setMarkers=function(r){this.markers=r},f.prototype.elt=function(r,o){var s=this.i!=-1&&this.element.childNodes[this.i];s?this.i++:(s=document.createElement("div"),this.element.appendChild(s),this.i=-1),s.style.cssText=o,s.className=r},f.prototype.update=function(r){if(r){this.config=r,this.i=0;var o;for(var s in this.markers){var a=this.markers[s];if(!a.range){a.update(o,this,this.session,r);continue}var i=a.range.clipRows(r.firstRow,r.lastRow);if(!i.isEmpty())if(i=i.toScreenRange(this.session),a.renderer){var u=this.$getTop(i.start.row,r),h=this.$padding+i.start.column*r.characterWidth;a.renderer(o,i,h,u,r)}else a.type=="fullLine"?this.drawFullLineMarker(o,i,a.clazz,r):a.type=="screenLine"?this.drawScreenLineMarker(o,i,a.clazz,r):i.isMultiLine()?a.type=="text"?this.drawTextMarker(o,i,a.clazz,r):this.drawMultiLineMarker(o,i,a.clazz,r):this.drawSingleLineMarker(o,i,a.clazz+" ace_start ace_br15",r)}if(this.i!=-1)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},f.prototype.$getTop=function(r,o){return(r-o.firstRowScreen)*o.lineHeight},f.prototype.drawTextMarker=function(r,o,s,a,i){for(var u=this.session,h=o.start.row,y=o.end.row,b=h,T=0,$=0,A=u.getScreenLastRowColumn(b),S=new d(b,o.start.column,b,$);b<=y;b++)S.start.row=S.end.row=b,S.start.column=b==h?o.start.column:u.getRowWrapIndent(b),S.end.column=A,T=$,$=A,A=b+1<y?u.getScreenLastRowColumn(b+1):b==y?0:o.end.column,this.drawSingleLineMarker(r,S,s+(b==h?" ace_start":"")+" ace_br"+c(b==h||b==h+1&&o.start.column,T<$,$>A,b==y),a,b==y?0:1,i)},f.prototype.drawMultiLineMarker=function(r,o,s,a,i){var u=this.$padding,h=a.lineHeight,y=this.$getTop(o.start.row,a),b=u+o.start.column*a.characterWidth;if(i=i||"",this.session.$bidiHandler.isBidiRow(o.start.row)){var T=o.clone();T.end.row=T.start.row,T.end.column=this.session.getLine(T.start.row).length,this.drawBidiSingleLineMarker(r,T,s+" ace_br1 ace_start",a,null,i)}else this.elt(s+" ace_br1 ace_start","height:"+h+"px;right:"+u+"px;top:"+y+"px;left:"+b+"px;"+(i||""));if(this.session.$bidiHandler.isBidiRow(o.end.row)){var T=o.clone();T.start.row=T.end.row,T.start.column=0,this.drawBidiSingleLineMarker(r,T,s+" ace_br12",a,null,i)}else{y=this.$getTop(o.end.row,a);var $=o.end.column*a.characterWidth;this.elt(s+" ace_br12","height:"+h+"px;width:"+$+"px;top:"+y+"px;left:"+u+"px;"+(i||""))}if(h=(o.end.row-o.start.row-1)*a.lineHeight,!(h<=0)){y=this.$getTop(o.start.row+1,a);var A=(o.start.column?1:0)|(o.end.column?0:8);this.elt(s+(A?" ace_br"+A:""),"height:"+h+"px;right:"+u+"px;top:"+y+"px;left:"+u+"px;"+(i||""))}},f.prototype.drawSingleLineMarker=function(r,o,s,a,i,u){if(this.session.$bidiHandler.isBidiRow(o.start.row))return this.drawBidiSingleLineMarker(r,o,s,a,i,u);var h=a.lineHeight,y=(o.end.column+(i||0)-o.start.column)*a.characterWidth,b=this.$getTop(o.start.row,a),T=this.$padding+o.start.column*a.characterWidth;this.elt(s,"height:"+h+"px;width:"+y+"px;top:"+b+"px;left:"+T+"px;"+(u||""))},f.prototype.drawBidiSingleLineMarker=function(r,o,s,a,i,u){var h=a.lineHeight,y=this.$getTop(o.start.row,a),b=this.$padding,T=this.session.$bidiHandler.getSelections(o.start.column,o.end.column);T.forEach(function($){this.elt(s,"height:"+h+"px;width:"+($.width+(i||0))+"px;top:"+y+"px;left:"+(b+$.left)+"px;"+(u||""))},this)},f.prototype.drawFullLineMarker=function(r,o,s,a,i){var u=this.$getTop(o.start.row,a),h=a.lineHeight;o.start.row!=o.end.row&&(h+=this.$getTop(o.end.row,a)-u),this.elt(s,"height:"+h+"px;top:"+u+"px;left:0;right:0;"+(i||""))},f.prototype.drawScreenLineMarker=function(r,o,s,a,i){var u=this.$getTop(o.start.row,a),h=a.lineHeight;this.elt(s,"height:"+h+"px;top:"+u+"px;left:0;right:0;"+(i||""))},f})();m.prototype.$padding=0;function c(f,r,o,s){return(f?1:0)|(r?2:0)|(o?4:0)|(s?8:0)}n.Marker=m}),ace.define("ace/layer/text_util",["require","exports","module"],function(t,n,p){var d=new Set(["text","rparen","lparen"]);n.isTextToken=function(g){return d.has(g)}}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter","ace/config","ace/layer/text_util"],function(t,n,p){var d=t("../lib/oop"),g=t("../lib/dom"),m=t("../lib/lang"),c=t("./lines").Lines,f=t("../lib/event_emitter").EventEmitter,r=t("../config").nls,o=t("./text_util").isTextToken,s=(function(){function a(i){this.dom=g,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",i.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new c(this.element)}return a.prototype.$updateEolChar=function(){var i=this.session.doc,u=i.getNewLineCharacter()==`
1371
+ `&&i.getNewLineMode()!="windows",h=u?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=h)return this.EOL_CHAR=h,!0},a.prototype.setPadding=function(i){this.$padding=i,this.element.style.margin="0 "+i+"px"},a.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},a.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},a.prototype.$setFontMetrics=function(i){this.$fontMetrics=i,this.$fontMetrics.on("changeCharacterSize",(function(u){this._signal("changeCharacterSize",u)}).bind(this)),this.$pollSizeChanges()},a.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},a.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},a.prototype.setSession=function(i){this.session=i,i&&this.$computeTabString()},a.prototype.setShowInvisibles=function(i){return this.showInvisibles==i?!1:(this.showInvisibles=i,typeof i=="string"?(this.showSpaces=/tab/i.test(i),this.showTabs=/space/i.test(i),this.showEOL=/eol/i.test(i)):this.showSpaces=this.showTabs=this.showEOL=i,this.$computeTabString(),!0)},a.prototype.setDisplayIndentGuides=function(i){return this.displayIndentGuides==i?!1:(this.displayIndentGuides=i,this.$computeTabString(),!0)},a.prototype.setHighlightIndentGuides=function(i){return this.$highlightIndentGuides===i?!1:(this.$highlightIndentGuides=i,i)},a.prototype.$computeTabString=function(){var i=this.session.getTabSize();this.tabSize=i;for(var u=this.$tabStrings=[0],h=1;h<i+1;h++)if(this.showTabs){var y=this.dom.createElement("span");y.className="ace_invisible ace_invisible_tab",y.textContent=m.stringRepeat(this.TAB_CHAR,h),u.push(y)}else u.push(this.dom.createTextNode(m.stringRepeat(" ",h),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var b="ace_indent-guide",T=this.showSpaces?" ace_invisible ace_invisible_space":"",$=this.showSpaces?m.stringRepeat(this.SPACE_CHAR,this.tabSize):m.stringRepeat(" ",this.tabSize),A=this.showTabs?" ace_invisible ace_invisible_tab":"",S=this.showTabs?m.stringRepeat(this.TAB_CHAR,this.tabSize):$,y=this.dom.createElement("span");y.className=b+T,y.textContent=$,this.$tabStrings[" "]=y;var y=this.dom.createElement("span");y.className=b+A,y.textContent=S,this.$tabStrings[" "]=y}},a.prototype.updateLines=function(i,u,h){if(this.config.lastRow!=i.lastRow||this.config.firstRow!=i.firstRow)return this.update(i);this.config=i;for(var y=Math.max(u,i.firstRow),b=Math.min(h,i.lastRow),T=this.element.childNodes,$=0,S=i.firstRow;S<y;S++){var M=this.session.getFoldLine(S);if(M)if(M.containsRow(y)){y=M.start.row;break}else S=M.end.row;$++}for(var A=!1,S=y,M=this.session.getNextFoldLine(S),R=M?M.start.row:1/0;S>R&&(S=M.end.row+1,M=this.session.getNextFoldLine(S,M),R=M?M.start.row:1/0),!(S>b);){var L=T[$++];if(L){this.dom.removeChildren(L),this.$renderLine(L,S,S==R?M:!1),A&&(L.style.top=this.$lines.computeLineTop(S,i,this.session)+"px");var _=i.lineHeight*this.session.getRowLength(S)+"px";L.style.height!=_&&(A=!0,L.style.height=_)}S++}if(A)for(;$<this.$lines.cells.length;){var O=this.$lines.cells[$++];O.element.style.top=this.$lines.computeLineTop(O.row,i,this.session)+"px"}},a.prototype.scrollLines=function(i){var u=this.config;if(this.config=i,this.$lines.pageChanged(u,i))return this.update(i);this.$lines.moveContainer(i);var h=i.lastRow,y=u?u.lastRow:-1;if(!u||y<i.firstRow)return this.update(i);if(h<u.firstRow)return this.update(i);if(!u||u.lastRow<i.firstRow)return this.update(i);if(i.lastRow<u.firstRow)return this.update(i);if(u.firstRow<i.firstRow)for(var b=this.session.getFoldedRowCount(u.firstRow,i.firstRow-1);b>0;b--)this.$lines.shift();if(u.lastRow>i.lastRow)for(var b=this.session.getFoldedRowCount(i.lastRow+1,u.lastRow);b>0;b--)this.$lines.pop();i.firstRow<u.firstRow&&this.$lines.unshift(this.$renderLinesFragment(i,i.firstRow,u.firstRow-1)),i.lastRow>u.lastRow&&this.$lines.push(this.$renderLinesFragment(i,u.lastRow+1,i.lastRow)),this.$highlightIndentGuide()},a.prototype.$renderLinesFragment=function(i,u,h){for(var y=[],b=u,T=this.session.getNextFoldLine(b),$=T?T.start.row:1/0;b>$&&(b=T.end.row+1,T=this.session.getNextFoldLine(b,T),$=T?T.start.row:1/0),!(b>h);){var A=this.$lines.createCell(b,i,this.session),S=A.element;this.dom.removeChildren(S),g.setStyle(S.style,"height",this.$lines.computeLineHeight(b,i,this.session)+"px"),g.setStyle(S.style,"top",this.$lines.computeLineTop(b,i,this.session)+"px"),this.$renderLine(S,b,b==$?T:!1),this.$useLineGroups()?S.className="ace_line_group":S.className="ace_line",y.push(A),b++}return y},a.prototype.update=function(i){this.$lines.moveContainer(i),this.config=i;for(var u=i.firstRow,h=i.lastRow,y=this.$lines;y.getLength();)y.pop();y.push(this.$renderLinesFragment(i,u,h))},a.prototype.$renderToken=function(i,u,h,y){for(var b=this,T=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069\u2060\u2061\u2062\u2063\u2064\u206A\u206B\u206B\u206C\u206D\u206E\u206F]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,$=this.dom.createFragment(this.element),A,S=0;A=T.exec(y);){var M=A[1],R=A[2],L=A[3],_=A[4],O=A[5];if(!(!b.showSpaces&&R)){var w=S!=A.index?y.slice(S,A.index):"";if(S=A.index+A[0].length,w&&$.appendChild(this.dom.createTextNode(w,this.element)),M){var v=b.session.getScreenTabSize(u+A.index);$.appendChild(b.$tabStrings[v].cloneNode(!0)),u+=v-1}else if(R)if(b.showSpaces){var C=this.dom.createElement("span");C.className="ace_invisible ace_invisible_space",C.textContent=m.stringRepeat(b.SPACE_CHAR,R.length),$.appendChild(C)}else $.appendChild(this.dom.createTextNode(R,this.element));else if(L){var C=this.dom.createElement("span");C.className="ace_invisible ace_invisible_space ace_invalid",C.textContent=m.stringRepeat(b.SPACE_CHAR,L.length),$.appendChild(C)}else if(_){u+=1;var C=this.dom.createElement("span");C.style.width=b.config.characterWidth*2+"px",C.className=b.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",C.textContent=b.showSpaces?b.SPACE_CHAR:_,$.appendChild(C)}else if(O){u+=1;var C=this.dom.createElement("span");C.style.width=b.config.characterWidth*2+"px",C.className="ace_cjk",C.textContent=O,$.appendChild(C)}}}if($.appendChild(this.dom.createTextNode(S?y.slice(S):y,this.element)),o(h.type))i.appendChild($);else{var E="ace_"+h.type.replace(/\./g," ace_"),C=this.dom.createElement("span");h.type=="fold"&&(C.style.width=h.value.length*this.config.characterWidth+"px",C.setAttribute("title",r("inline-fold.closed.title","Unfold code"))),C.className=E,C.appendChild($),i.appendChild(C)}return u+y.length},a.prototype.renderIndentGuide=function(i,u,h){var y=u.search(this.$indentGuideRe);if(y<=0||y>=h)return u;if(u[0]==" "){y-=y%this.tabSize;for(var b=y/this.tabSize,T=0;T<b;T++)i.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),u.substr(y)}else if(u[0]==" "){for(var T=0;T<y;T++)i.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),u.substr(y)}return this.$highlightIndentGuide(),u},a.prototype.$highlightIndentGuide=function(){if(!(!this.$highlightIndentGuides||!this.displayIndentGuides)){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var i=this.session.doc.$lines;if(i){var u=this.session.selection.getCursor(),h=/^\s*/.exec(this.session.doc.getLine(u.row))[0].length,y=Math.floor(h/this.tabSize);this.$highlightIndentGuideMarker={indentLevel:y,start:u.row};var b=this.session.$bracketHighlight;if(b){for(var T=this.session.$bracketHighlight.ranges,$=0;$<T.length;$++)if(u.row!==T[$].start.row){this.$highlightIndentGuideMarker.end=T[$].start.row,u.row>T[$].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&i[u.row]!==""&&u.column===i[u.row].length){this.$highlightIndentGuideMarker.dir=1;for(var $=u.row+1;$<i.length;$++){var A=i[$],S=/^\s*/.exec(A)[0].length;if(A!==""&&(this.$highlightIndentGuideMarker.end=$,S<=h))break}}this.$renderHighlightIndentGuide()}}},a.prototype.$clearActiveIndentGuide=function(){for(var i=this.$lines.cells,u=0;u<i.length;u++){var h=i[u],y=h.element.childNodes;if(y.length>0){for(var b=0;b<y.length;b++)if(y[b].classList&&y[b].classList.contains("ace_indent-guide-active")){y[b].classList.remove("ace_indent-guide-active");break}}}},a.prototype.$setIndentGuideActive=function(i,u){var h=this.session.doc.getLine(i.row);if(h!==""){var y=i.element.childNodes;if(y){var b=y[u-1];b&&b.classList&&b.classList.contains("ace_indent-guide")&&b.classList.add("ace_indent-guide-active")}}},a.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var i=this.$lines.cells;this.$clearActiveIndentGuide();var u=this.$highlightIndentGuideMarker.indentLevel;if(u!==0)if(this.$highlightIndentGuideMarker.dir===1)for(var h=0;h<i.length;h++){var y=i[h];if(this.$highlightIndentGuideMarker.end&&y.row>=this.$highlightIndentGuideMarker.start+1){if(y.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(y,u)}}else for(var h=i.length-1;h>=0;h--){var y=i[h];if(this.$highlightIndentGuideMarker.end&&y.row<this.$highlightIndentGuideMarker.start){if(y.row<=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(y,u)}}}},a.prototype.$createLineElement=function(i){var u=this.dom.createElement("div");return u.className="ace_line",u.style.height=this.config.lineHeight+"px",u},a.prototype.$renderWrappedLine=function(i,u,h){var y=0,b=0,T=h[0],$=0,A=this.$createLineElement();i.appendChild(A);for(var S=0;S<u.length;S++){var M=u[S],R=M.value;if(S==0&&this.displayIndentGuides){if(y=R.length,R=this.renderIndentGuide(A,R,T),!R)continue;y-=R.length}if(y+R.length<T)$=this.$renderToken(A,$,M,R),y+=R.length;else{for(;y+R.length>=T;)$=this.$renderToken(A,$,M,R.substring(0,T-y)),R=R.substring(T-y),y=T,A=this.$createLineElement(),i.appendChild(A),A.appendChild(this.dom.createTextNode(m.stringRepeat(" ",h.indent),this.element)),b++,$=0,T=h[b]||Number.MAX_VALUE;R.length!=0&&(y+=R.length,$=this.$renderToken(A,$,M,R))}}h[h.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(A,$,null,"",!0)},a.prototype.$renderSimpleLine=function(i,u){for(var h=0,y=0;y<u.length;y++){var b=u[y],T=b.value;if(!(y==0&&this.displayIndentGuides&&(T=this.renderIndentGuide(i,T),!T))){if(h+T.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(i,h,b,T);h=this.$renderToken(i,h,b,T)}}},a.prototype.$renderOverflowMessage=function(i,u,h,y,b){h&&this.$renderToken(i,u,h,y.slice(0,this.MAX_LINE_LENGTH-u));var T=this.dom.createElement("span");T.className="ace_inline_button ace_keyword ace_toggle_wrap",T.textContent=b?"<hide>":"<click to see more...>",i.appendChild(T)},a.prototype.$renderLine=function(i,u,h){if(!h&&h!=!1&&(h=this.session.getFoldLine(u)),h)var y=this.$getFoldLineTokens(u,h);else var y=this.session.getTokens(u);var b=i;if(y.length){var T=this.session.getRowSplitData(u);if(T&&T.length){this.$renderWrappedLine(i,y,T);var b=i.lastChild}else{var b=i;this.$useLineGroups()&&(b=this.$createLineElement(),i.appendChild(b)),this.$renderSimpleLine(b,y)}}else this.$useLineGroups()&&(b=this.$createLineElement(),i.appendChild(b));if(this.showEOL&&b){h&&(u=h.end.row);var $=this.dom.createElement("span");$.className="ace_invisible ace_invisible_eol",$.textContent=u==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,b.appendChild($)}},a.prototype.$getFoldLineTokens=function(i,u){var h=this.session,y=[];function b($,A,S){for(var M=0,R=0;R+$[M].value.length<A;)if(R+=$[M].value.length,M++,M==$.length)return;if(R!=A){var L=$[M].value.substring(A-R);L.length>S-A&&(L=L.substring(0,S-A)),y.push({type:$[M].type,value:L}),R=A+L.length,M+=1}for(;R<S&&M<$.length;){var L=$[M].value;L.length+R>S?y.push({type:$[M].type,value:L.substring(0,S-R)}):y.push($[M]),R+=L.length,M+=1}}var T=h.getTokens(i);return u.walk(function($,A,S,M,R){$!=null?y.push({type:"fold",value:$}):(R&&(T=h.getTokens(A)),T.length&&b(T,M,S))},u.end.row,this.session.getLine(u.end.row).length),y},a.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},a})();s.prototype.EOF_CHAR="¶",s.prototype.EOL_CHAR_LF="¬",s.prototype.EOL_CHAR_CRLF="¤",s.prototype.EOL_CHAR=s.prototype.EOL_CHAR_LF,s.prototype.TAB_CHAR="—",s.prototype.SPACE_CHAR="·",s.prototype.$padding=0,s.prototype.MAX_LINE_LENGTH=1e4,s.prototype.showInvisibles=!1,s.prototype.showSpaces=!1,s.prototype.showTabs=!1,s.prototype.showEOL=!1,s.prototype.displayIndentGuides=!0,s.prototype.$highlightIndentGuides=!0,s.prototype.$tabStrings=[],s.prototype.destroy={},s.prototype.onChangeTabSize=s.prototype.$computeTabString,d.implement(s.prototype,f),n.Text=s}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(t,n,p){var d=t("../lib/dom"),g=(function(){function m(c){this.element=d.createElement("div"),this.element.className="ace_layer ace_cursor-layer",c.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),d.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return m.prototype.$updateOpacity=function(c){for(var f=this.cursors,r=f.length;r--;)d.setStyle(f[r].style,"opacity",c?"":"0")},m.prototype.$startCssAnimation=function(){for(var c=this.cursors,f=c.length;f--;)c[f].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout((function(){this.$isAnimating&&d.addCssClass(this.element,"ace_animate-blinking")}).bind(this))},m.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,d.removeCssClass(this.element,"ace_animate-blinking")},m.prototype.setPadding=function(c){this.$padding=c},m.prototype.setSession=function(c){this.session=c},m.prototype.setBlinking=function(c){c!=this.isBlinking&&(this.isBlinking=c,this.restartTimer())},m.prototype.setBlinkInterval=function(c){c!=this.blinkInterval&&(this.blinkInterval=c,this.restartTimer())},m.prototype.setSmoothBlinking=function(c){c!=this.smoothBlinking&&(this.smoothBlinking=c,d.setCssClass(this.element,"ace_smooth-blinking",c),this.$updateCursors(!0),this.restartTimer())},m.prototype.addCursor=function(){var c=d.createElement("div");return c.className="ace_cursor",this.element.appendChild(c),this.cursors.push(c),c},m.prototype.removeCursor=function(){if(this.cursors.length>1){var c=this.cursors.pop();return c.parentNode.removeChild(c),c}},m.prototype.hideCursor=function(){this.isVisible=!1,d.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},m.prototype.showCursor=function(){this.isVisible=!0,d.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},m.prototype.restartTimer=function(){var c=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,d.removeCssClass(this.element,"ace_smooth-blinking")),c(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout((function(){this.$isSmoothBlinking&&d.addCssClass(this.element,"ace_smooth-blinking")}).bind(this))),d.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var f=(function(){this.timeoutId=setTimeout(function(){c(!1)},.6*this.blinkInterval)}).bind(this);this.intervalId=setInterval(function(){c(!0),f()},this.blinkInterval),f()}},m.prototype.getPixelPosition=function(c,f){if(!this.config||!this.session)return{left:0,top:0};c||(c=this.session.selection.getCursor());var r=this.session.documentToScreenPosition(c),o=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,c.row)?this.session.$bidiHandler.getPosLeft(r.column):r.column*this.config.characterWidth),s=(r.row-(f?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:o,top:s}},m.prototype.isCursorInView=function(c,f){return c.top>=0&&c.top<f.maxHeight},m.prototype.update=function(c){this.config=c;var f=this.session.$selectionMarkers,r=0,o=0;(f===void 0||f.length===0)&&(f=[{cursor:null}]);for(var r=0,s=f.length;r<s;r++){var a=this.getPixelPosition(f[r].cursor,!0);if(!((a.top>c.height+c.offset||a.top<0)&&r>1)){var i=this.cursors[o++]||this.addCursor(),u=i.style;this.drawCursor?this.drawCursor(i,a,c,f[r],this.session):this.isCursorInView(a,c)?(d.setStyle(u,"display","block"),d.translate(i,a.left,a.top),d.setStyle(u,"width",Math.round(c.characterWidth)+"px"),d.setStyle(u,"height",c.lineHeight+"px")):d.setStyle(u,"display","none")}}for(;this.cursors.length>o;)this.removeCursor();var h=this.session.getOverwrite();this.$setOverwrite(h),this.$pixelPos=a,this.restartTimer()},m.prototype.$setOverwrite=function(c){c!=this.overwrite&&(this.overwrite=c,c?d.addCssClass(this.element,"ace_overwrite-cursors"):d.removeCssClass(this.element,"ace_overwrite-cursors"))},m.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},m})();g.prototype.$padding=0,g.prototype.drawCursor=null,n.Cursor=g}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(t,n,p){var d=this&&this.__extends||(function(){var i=function(u,h){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,b){y.__proto__=b}||function(y,b){for(var T in b)Object.prototype.hasOwnProperty.call(b,T)&&(y[T]=b[T])},i(u,h)};return function(u,h){if(typeof h!="function"&&h!==null)throw new TypeError("Class extends value "+String(h)+" is not a constructor or null");i(u,h);function y(){this.constructor=u}u.prototype=h===null?Object.create(h):(y.prototype=h.prototype,new y)}})(),g=t("./lib/oop"),m=t("./lib/dom"),c=t("./lib/event"),f=t("./lib/event_emitter").EventEmitter,r=32768,o=(function(){function i(u,h){this.element=m.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+h,this.inner=m.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),u.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,c.addListener(this.element,"scroll",this.onScroll.bind(this)),c.addListener(this.element,"mousedown",c.preventDefault)}return i.prototype.setVisible=function(u){this.element.style.display=u?"":"none",this.isVisible=u,this.coeff=1},i})();g.implement(o.prototype,f);var s=(function(i){d(u,i);function u(h,y){var b=i.call(this,h,"-v")||this;return b.scrollTop=0,b.scrollHeight=0,y.$scrollbarWidth=b.width=m.scrollbarWidth(h.ownerDocument),b.inner.style.width=b.element.style.width=(b.width||15)+5+"px",b.$minWidth=0,b}return u.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var h=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-h)/(this.coeff-h)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},u.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},u.prototype.setHeight=function(h){this.element.style.height=h+"px"},u.prototype.setScrollHeight=function(h){this.scrollHeight=h,h>r?(this.coeff=r/h,h=r):this.coeff!=1&&(this.coeff=1),this.inner.style.height=h+"px"},u.prototype.setScrollTop=function(h){this.scrollTop!=h&&(this.skipEvent=!0,this.scrollTop=h,this.element.scrollTop=h*this.coeff)},u})(o);s.prototype.setInnerHeight=s.prototype.setScrollHeight;var a=(function(i){d(u,i);function u(h,y){var b=i.call(this,h,"-h")||this;return b.scrollLeft=0,b.height=y.$scrollbarWidth,b.inner.style.height=b.element.style.height=(b.height||15)+5+"px",b}return u.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},u.prototype.getHeight=function(){return this.isVisible?this.height:0},u.prototype.setWidth=function(h){this.element.style.width=h+"px"},u.prototype.setInnerWidth=function(h){this.inner.style.width=h+"px"},u.prototype.setScrollWidth=function(h){this.inner.style.width=h+"px"},u.prototype.setScrollLeft=function(h){this.scrollLeft!=h&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=h)},u})(o);n.ScrollBar=s,n.ScrollBarV=s,n.ScrollBarH=a,n.VScrollBar=s,n.HScrollBar=a}),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(t,n,p){var d=this&&this.__extends||(function(){var a=function(i,u){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,y){h.__proto__=y}||function(h,y){for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(h[b]=y[b])},a(i,u)};return function(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");a(i,u);function h(){this.constructor=i}i.prototype=u===null?Object.create(u):(h.prototype=u.prototype,new h)}})(),g=t("./lib/oop"),m=t("./lib/dom"),c=t("./lib/event"),f=t("./lib/event_emitter").EventEmitter;m.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{
1372
1372
  position: absolute;
1373
1373
  background: rgba(128, 128, 128, 0.6);
1374
1374
  -moz-box-sizing: border-box;
@@ -1406,7 +1406,7 @@ export const FormManager: React.FC = () => {
1406
1406
  .ace_editor>.ace_sb_grabbed {
1407
1407
  z-index: 8;
1408
1408
  background: #000;
1409
- }`,"ace_scrollbar.css",!1);var r=(function(){function a(i,u){this.element=m.createElement("div"),this.element.className="ace_sb"+u,this.inner=m.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,i.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,l.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return a.prototype.setVisible=function(i){this.element.style.display=i?"":"none",this.isVisible=i,this.coeff=1},a})();g.implement(r.prototype,f);var o=(function(a){d(i,a);function i(u,h){var y=a.call(this,u,"-v")||this;return y.scrollTop=0,y.scrollHeight=0,y.parent=u,y.width=y.VScrollWidth,y.renderer=h,y.inner.style.width=y.element.style.width=(y.width||15)+"px",y.$minWidth=0,y}return i.prototype.onMouseDown=function(u,h){if(u==="mousedown"&&!(l.getButton(h)!==0||h.detail===2)){if(h.target===this.inner){var y=this,b=h.clientY,T=function(_){b=_.clientY},$=function(){clearInterval(R)},A=h.clientY,S=this.thumbTop,M=function(){if(b!==void 0){var _=y.scrollTopFromThumbTop(S+b-A);_!==y.scrollTop&&y._emit("scroll",{data:_})}};l.capture(this.inner,T,$);var R=setInterval(M,20);return l.preventDefault(h)}var L=h.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(L)}),l.preventDefault(h)}},i.prototype.getHeight=function(){return this.height},i.prototype.scrollTopFromThumbTop=function(u){var h=u*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return h=h>>0,h<0?h=0:h>this.pageHeight-this.viewHeight&&(h=this.pageHeight-this.viewHeight),h},i.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},i.prototype.setHeight=function(u){this.height=Math.max(0,u),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},i.prototype.setScrollHeight=function(u,h){this.pageHeight===u&&!h||(this.pageHeight=u,this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight,this.thumbHeight>this.slideHeight&&(this.thumbHeight=this.slideHeight),this.thumbHeight<15&&(this.thumbHeight=15),this.inner.style.height=this.thumbHeight+"px",this.scrollTop>this.pageHeight-this.viewHeight&&(this.scrollTop=this.pageHeight-this.viewHeight,this.scrollTop<0&&(this.scrollTop=0),this._emit("scroll",{data:this.scrollTop})))},i.prototype.setScrollTop=function(u){this.scrollTop=u,u<0&&(u=0),this.thumbTop=u*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},i})(r);o.prototype.setInnerHeight=o.prototype.setScrollHeight;var s=(function(a){d(i,a);function i(u,h){var y=a.call(this,u,"-h")||this;return y.scrollLeft=0,y.scrollWidth=0,y.height=y.HScrollHeight,y.inner.style.height=y.element.style.height=(y.height||12)+"px",y.renderer=h,y}return i.prototype.onMouseDown=function(u,h){if(u==="mousedown"&&!(l.getButton(h)!==0||h.detail===2)){if(h.target===this.inner){var y=this,b=h.clientX,T=function(_){b=_.clientX},$=function(){clearInterval(R)},A=h.clientX,S=this.thumbLeft,M=function(){if(b!==void 0){var _=y.scrollLeftFromThumbLeft(S+b-A);_!==y.scrollLeft&&y._emit("scroll",{data:_})}};l.capture(this.inner,T,$);var R=setInterval(M,20);return l.preventDefault(h)}var L=h.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(L)}),l.preventDefault(h)}},i.prototype.getHeight=function(){return this.isVisible?this.height:0},i.prototype.scrollLeftFromThumbLeft=function(u){var h=u*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return h=h>>0,h<0?h=0:h>this.pageWidth-this.viewWidth&&(h=this.pageWidth-this.viewWidth),h},i.prototype.setWidth=function(u){this.width=Math.max(0,u),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},i.prototype.setScrollWidth=function(u,h){this.pageWidth===u&&!h||(this.pageWidth=u,this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth,this.thumbWidth>this.slideWidth&&(this.thumbWidth=this.slideWidth),this.thumbWidth<15&&(this.thumbWidth=15),this.inner.style.width=this.thumbWidth+"px",this.scrollLeft>this.pageWidth-this.viewWidth&&(this.scrollLeft=this.pageWidth-this.viewWidth,this.scrollLeft<0&&(this.scrollLeft=0),this._emit("scroll",{data:this.scrollLeft})))},i.prototype.setScrollLeft=function(u){this.scrollLeft=u,u<0&&(u=0),this.thumbLeft=u*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},i})(r);s.prototype.setInnerWidth=s.prototype.setScrollWidth,n.ScrollBar=o,n.ScrollBarV=o,n.ScrollBarH=s,n.VScrollBar=o,n.HScrollBar=s}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(t,n,p){var d=t("./lib/event"),g=(function(){function m(l,f){this.onRender=l,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=f||window;var r=this;this._flush=function(o){r.pending=!1;var s=r.changes;if(s&&(d.blockIdle(100),r.changes=0,r.onRender(s)),r.changes){if(r.$recursionLimit--<0)return;r.schedule()}else r.$recursionLimit=2}}return m.prototype.schedule=function(l){this.changes=this.changes|l,this.changes&&!this.pending&&(d.nextFrame(this._flush),this.pending=!0)},m.prototype.clear=function(l){var f=this.changes;return this.changes=0,f},m})();n.RenderLoop=g}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(t,n,p){var d=t("../lib/oop"),g=t("../lib/dom"),m=t("../lib/lang"),l=t("../lib/event"),f=t("../lib/useragent"),r=t("../lib/event_emitter").EventEmitter,o=512,s=typeof ResizeObserver=="function",a=200,i=(function(){function u(h){this.el=g.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=g.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=g.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),h.appendChild(this.el),this.$measureNode.textContent=m.stringRepeat("X",o),this.$characterSize={width:0,height:0},s?this.$addObserver():this.checkForSizeChanges()}return u.prototype.$setMeasureNodeStyles=function(h,y){h.width=h.height="auto",h.left=h.top="0px",h.visibility="hidden",h.position="absolute",h.whiteSpace="pre",f.isIE<8?h["font-family"]="inherit":h.font="inherit",h.overflow=y?"hidden":"visible"},u.prototype.checkForSizeChanges=function(h){if(h===void 0&&(h=this.$measureSizes()),h&&(this.$characterSize.width!==h.width||this.$characterSize.height!==h.height)){this.$measureNode.style.fontWeight="bold";var y=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=h,this.charSizes=Object.create(null),this.allowBoldFonts=y&&y.width===h.width&&y.height===h.height,this._emit("changeCharacterSize",{data:h})}},u.prototype.$addObserver=function(){var h=this;this.$observer=new window.ResizeObserver(function(y){h.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},u.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var h=this;return this.$pollSizeChangesTimer=l.onIdle(function y(){h.checkForSizeChanges(),l.onIdle(y,500)},500)},u.prototype.setPolling=function(h){h?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},u.prototype.$measureSizes=function(h){var y={height:(h||this.$measureNode).clientHeight,width:(h||this.$measureNode).clientWidth/o};return y.width===0||y.height===0?null:y},u.prototype.$measureCharWidth=function(h){this.$main.textContent=m.stringRepeat(h,o);var y=this.$main.getBoundingClientRect();return y.width/o},u.prototype.getCharacterWidth=function(h){var y=this.charSizes[h];return y===void 0&&(y=this.charSizes[h]=this.$measureCharWidth(h)/this.$characterSize.width),y},u.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},u.prototype.$getZoom=function(h){return!h||!h.parentElement?1:(Number(window.getComputedStyle(h).zoom)||1)*this.$getZoom(h.parentElement)},u.prototype.$initTransformMeasureNodes=function(){var h=function(y,b){return["div",{style:"position: absolute;top:"+y+"px;left:"+b+"px;"}]};this.els=g.buildDom([h(0,0),h(a,0),h(0,a),h(a,a)],this.el)},u.prototype.transformCoordinates=function(h,y){if(h){var b=this.$getZoom(this.el);h=S(1/b,h)}function T(N,P,z){var F=N[1]*P[0]-N[0]*P[1];return[(-P[1]*z[0]+P[0]*z[1])/F,(+N[1]*z[0]-N[0]*z[1])/F]}function $(N,P){return[N[0]-P[0],N[1]-P[1]]}function A(N,P){return[N[0]+P[0],N[1]+P[1]]}function S(N,P){return[N*P[0],N*P[1]]}this.els||this.$initTransformMeasureNodes();function M(N){var P=N.getBoundingClientRect();return[P.left,P.top]}var R=M(this.els[0]),L=M(this.els[1]),_=M(this.els[2]),I=M(this.els[3]),w=T($(I,L),$(I,_),$(A(L,_),A(I,R))),v=S(1+w[0],$(L,R)),C=S(1+w[1],$(_,R));if(y){var E=y,x=w[0]*E[0]/a+w[1]*E[1]/a+1,k=A(S(E[0],v),S(E[1],C));return A(S(1/x/a,k),R)}var O=$(h,R),D=T($(v,S(w[0],O)),$(C,S(w[1],O)),O);return S(a,D)},u})();i.prototype.$characterSize={width:0,height:0},d.implement(i.prototype,r),n.FontMetrics=i}),ace.define("ace/css/editor-css",["require","exports","module"],function(t,n,p){p.exports=`
1409
+ }`,"ace_scrollbar.css",!1);var r=(function(){function a(i,u){this.element=m.createElement("div"),this.element.className="ace_sb"+u,this.inner=m.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,i.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,c.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return a.prototype.setVisible=function(i){this.element.style.display=i?"":"none",this.isVisible=i,this.coeff=1},a})();g.implement(r.prototype,f);var o=(function(a){d(i,a);function i(u,h){var y=a.call(this,u,"-v")||this;return y.scrollTop=0,y.scrollHeight=0,y.parent=u,y.width=y.VScrollWidth,y.renderer=h,y.inner.style.width=y.element.style.width=(y.width||15)+"px",y.$minWidth=0,y}return i.prototype.onMouseDown=function(u,h){if(u==="mousedown"&&!(c.getButton(h)!==0||h.detail===2)){if(h.target===this.inner){var y=this,b=h.clientY,T=function(_){b=_.clientY},$=function(){clearInterval(R)},A=h.clientY,S=this.thumbTop,M=function(){if(b!==void 0){var _=y.scrollTopFromThumbTop(S+b-A);_!==y.scrollTop&&y._emit("scroll",{data:_})}};c.capture(this.inner,T,$);var R=setInterval(M,20);return c.preventDefault(h)}var L=h.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(L)}),c.preventDefault(h)}},i.prototype.getHeight=function(){return this.height},i.prototype.scrollTopFromThumbTop=function(u){var h=u*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return h=h>>0,h<0?h=0:h>this.pageHeight-this.viewHeight&&(h=this.pageHeight-this.viewHeight),h},i.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},i.prototype.setHeight=function(u){this.height=Math.max(0,u),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},i.prototype.setScrollHeight=function(u,h){this.pageHeight===u&&!h||(this.pageHeight=u,this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight,this.thumbHeight>this.slideHeight&&(this.thumbHeight=this.slideHeight),this.thumbHeight<15&&(this.thumbHeight=15),this.inner.style.height=this.thumbHeight+"px",this.scrollTop>this.pageHeight-this.viewHeight&&(this.scrollTop=this.pageHeight-this.viewHeight,this.scrollTop<0&&(this.scrollTop=0),this._emit("scroll",{data:this.scrollTop})))},i.prototype.setScrollTop=function(u){this.scrollTop=u,u<0&&(u=0),this.thumbTop=u*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},i})(r);o.prototype.setInnerHeight=o.prototype.setScrollHeight;var s=(function(a){d(i,a);function i(u,h){var y=a.call(this,u,"-h")||this;return y.scrollLeft=0,y.scrollWidth=0,y.height=y.HScrollHeight,y.inner.style.height=y.element.style.height=(y.height||12)+"px",y.renderer=h,y}return i.prototype.onMouseDown=function(u,h){if(u==="mousedown"&&!(c.getButton(h)!==0||h.detail===2)){if(h.target===this.inner){var y=this,b=h.clientX,T=function(_){b=_.clientX},$=function(){clearInterval(R)},A=h.clientX,S=this.thumbLeft,M=function(){if(b!==void 0){var _=y.scrollLeftFromThumbLeft(S+b-A);_!==y.scrollLeft&&y._emit("scroll",{data:_})}};c.capture(this.inner,T,$);var R=setInterval(M,20);return c.preventDefault(h)}var L=h.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(L)}),c.preventDefault(h)}},i.prototype.getHeight=function(){return this.isVisible?this.height:0},i.prototype.scrollLeftFromThumbLeft=function(u){var h=u*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return h=h>>0,h<0?h=0:h>this.pageWidth-this.viewWidth&&(h=this.pageWidth-this.viewWidth),h},i.prototype.setWidth=function(u){this.width=Math.max(0,u),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},i.prototype.setScrollWidth=function(u,h){this.pageWidth===u&&!h||(this.pageWidth=u,this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth,this.thumbWidth>this.slideWidth&&(this.thumbWidth=this.slideWidth),this.thumbWidth<15&&(this.thumbWidth=15),this.inner.style.width=this.thumbWidth+"px",this.scrollLeft>this.pageWidth-this.viewWidth&&(this.scrollLeft=this.pageWidth-this.viewWidth,this.scrollLeft<0&&(this.scrollLeft=0),this._emit("scroll",{data:this.scrollLeft})))},i.prototype.setScrollLeft=function(u){this.scrollLeft=u,u<0&&(u=0),this.thumbLeft=u*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},i})(r);s.prototype.setInnerWidth=s.prototype.setScrollWidth,n.ScrollBar=o,n.ScrollBarV=o,n.ScrollBarH=s,n.VScrollBar=o,n.HScrollBar=s}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(t,n,p){var d=t("./lib/event"),g=(function(){function m(c,f){this.onRender=c,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=f||window;var r=this;this._flush=function(o){r.pending=!1;var s=r.changes;if(s&&(d.blockIdle(100),r.changes=0,r.onRender(s)),r.changes){if(r.$recursionLimit--<0)return;r.schedule()}else r.$recursionLimit=2}}return m.prototype.schedule=function(c){this.changes=this.changes|c,this.changes&&!this.pending&&(d.nextFrame(this._flush),this.pending=!0)},m.prototype.clear=function(c){var f=this.changes;return this.changes=0,f},m})();n.RenderLoop=g}),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],function(t,n,p){var d=t("../lib/oop"),g=t("../lib/dom"),m=t("../lib/lang"),c=t("../lib/event"),f=t("../lib/useragent"),r=t("../lib/event_emitter").EventEmitter,o=512,s=typeof ResizeObserver=="function",a=200,i=(function(){function u(h){this.el=g.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=g.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=g.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),h.appendChild(this.el),this.$measureNode.textContent=m.stringRepeat("X",o),this.$characterSize={width:0,height:0},s?this.$addObserver():this.checkForSizeChanges()}return u.prototype.$setMeasureNodeStyles=function(h,y){h.width=h.height="auto",h.left=h.top="0px",h.visibility="hidden",h.position="absolute",h.whiteSpace="pre",f.isIE<8?h["font-family"]="inherit":h.font="inherit",h.overflow=y?"hidden":"visible"},u.prototype.checkForSizeChanges=function(h){if(h===void 0&&(h=this.$measureSizes()),h&&(this.$characterSize.width!==h.width||this.$characterSize.height!==h.height)){this.$measureNode.style.fontWeight="bold";var y=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=h,this.charSizes=Object.create(null),this.allowBoldFonts=y&&y.width===h.width&&y.height===h.height,this._emit("changeCharacterSize",{data:h})}},u.prototype.$addObserver=function(){var h=this;this.$observer=new window.ResizeObserver(function(y){h.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},u.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var h=this;return this.$pollSizeChangesTimer=c.onIdle(function y(){h.checkForSizeChanges(),c.onIdle(y,500)},500)},u.prototype.setPolling=function(h){h?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},u.prototype.$measureSizes=function(h){var y={height:(h||this.$measureNode).clientHeight,width:(h||this.$measureNode).clientWidth/o};return y.width===0||y.height===0?null:y},u.prototype.$measureCharWidth=function(h){this.$main.textContent=m.stringRepeat(h,o);var y=this.$main.getBoundingClientRect();return y.width/o},u.prototype.getCharacterWidth=function(h){var y=this.charSizes[h];return y===void 0&&(y=this.charSizes[h]=this.$measureCharWidth(h)/this.$characterSize.width),y},u.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},u.prototype.$getZoom=function(h){return!h||!h.parentElement?1:(Number(window.getComputedStyle(h).zoom)||1)*this.$getZoom(h.parentElement)},u.prototype.$initTransformMeasureNodes=function(){var h=function(y,b){return["div",{style:"position: absolute;top:"+y+"px;left:"+b+"px;"}]};this.els=g.buildDom([h(0,0),h(a,0),h(0,a),h(a,a)],this.el)},u.prototype.transformCoordinates=function(h,y){if(h){var b=this.$getZoom(this.el);h=S(1/b,h)}function T(N,P,z){var F=N[1]*P[0]-N[0]*P[1];return[(-P[1]*z[0]+P[0]*z[1])/F,(+N[1]*z[0]-N[0]*z[1])/F]}function $(N,P){return[N[0]-P[0],N[1]-P[1]]}function A(N,P){return[N[0]+P[0],N[1]+P[1]]}function S(N,P){return[N*P[0],N*P[1]]}this.els||this.$initTransformMeasureNodes();function M(N){var P=N.getBoundingClientRect();return[P.left,P.top]}var R=M(this.els[0]),L=M(this.els[1]),_=M(this.els[2]),O=M(this.els[3]),w=T($(O,L),$(O,_),$(A(L,_),A(O,R))),v=S(1+w[0],$(L,R)),C=S(1+w[1],$(_,R));if(y){var E=y,x=w[0]*E[0]/a+w[1]*E[1]/a+1,k=A(S(E[0],v),S(E[1],C));return A(S(1/x/a,k),R)}var D=$(h,R),I=T($(v,S(w[0],D)),$(C,S(w[1],D)),D);return S(a,I)},u})();i.prototype.$characterSize={width:0,height:0},d.implement(i.prototype,r),n.FontMetrics=i}),ace.define("ace/css/editor-css",["require","exports","module"],function(t,n,p){p.exports=`
1410
1410
  .ace_br1 {border-top-left-radius : 3px;}
1411
1411
  .ace_br2 {border-top-right-radius : 3px;}
1412
1412
  .ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}
@@ -2095,9 +2095,9 @@ export const FormManager: React.FC = () => {
2095
2095
 
2096
2096
  .ace_hidden_token {
2097
2097
  display: none;
2098
- }`}),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(t,n,p){var d=t("../lib/dom"),g=t("../lib/oop"),m=t("../lib/event_emitter").EventEmitter,l=(function(){function f(r,o){this.canvas=d.createElement("canvas"),this.renderer=o,this.pixelRatio=1,this.maxHeight=o.layerConfig.maxHeight,this.lineHeight=o.layerConfig.lineHeight,this.canvasHeight=r.parent.scrollHeight,this.heightRatio=this.canvasHeight/this.maxHeight,this.canvasWidth=r.width,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.canvas.style.top="0px",this.canvas.style.right="0px",this.canvas.style.zIndex="7px",this.canvas.style.position="absolute",this.colors={},this.colors.dark={error:"rgba(255, 18, 18, 1)",warning:"rgba(18, 136, 18, 1)",info:"rgba(18, 18, 136, 1)"},this.colors.light={error:"rgb(255,51,51)",warning:"rgb(32,133,72)",info:"rgb(35,68,138)"},r.element.appendChild(this.canvas)}return f.prototype.$updateDecorators=function(r){var o=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;if(r){this.maxHeight=r.maxHeight,this.lineHeight=r.lineHeight,this.canvasHeight=r.height;var s=(r.lastRow+1)*this.lineHeight;s<this.canvasHeight?this.heightRatio=1:this.heightRatio=this.canvasHeight/this.maxHeight}var a=this.canvas.getContext("2d");function i(I,w){return I.priority<w.priority?-1:I.priority>w.priority?1:0}var u=this.renderer.session.$annotations;if(a.clearRect(0,0,this.canvas.width,this.canvas.height),u){var h={info:1,warning:2,error:3};u.forEach(function(I){I.priority=h[I.type]||null}),u=u.sort(i);for(var y=this.renderer.session.$foldData,b=0;b<u.length;b++){var T=u[b].row,$=this.compensateFoldRows(T,y),A=Math.round((T-$)*this.lineHeight*this.heightRatio),S=Math.round((T-$)*this.lineHeight*this.heightRatio),M=Math.round(((T-$)*this.lineHeight+this.lineHeight)*this.heightRatio),R=M-S;if(R<this.minDecorationHeight){var L=(S+M)/2|0;L<this.halfMinDecorationHeight?L=this.halfMinDecorationHeight:L+this.halfMinDecorationHeight>this.canvasHeight&&(L=this.canvasHeight-this.halfMinDecorationHeight),S=Math.round(L-this.halfMinDecorationHeight),M=Math.round(L+this.halfMinDecorationHeight)}a.fillStyle=o[u[b].type]||null,a.fillRect(0,A,this.canvasWidth,M-S)}}var _=this.renderer.session.selection.getCursor();if(_){var $=this.compensateFoldRows(_.row,y),A=Math.round((_.row-$)*this.lineHeight*this.heightRatio);a.fillStyle="rgba(0, 0, 0, 0.5)",a.fillRect(0,A,this.canvasWidth,2)}},f.prototype.compensateFoldRows=function(r,o){var s=0;if(o&&o.length>0)for(var a=0;a<o.length;a++)r>o[a].start.row&&r<o[a].end.row?s+=r-o[a].start.row:r>=o[a].end.row&&(s+=o[a].end.row-o[a].start.row);return s},f})();g.implement(l.prototype,m),n.Decorator=l}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent","ace/layer/text_util"],function(t,n,p){var d=t("./lib/oop"),g=t("./lib/dom"),m=t("./lib/lang"),l=t("./config"),f=t("./layer/gutter").Gutter,r=t("./layer/marker").Marker,o=t("./layer/text").Text,s=t("./layer/cursor").Cursor,a=t("./scrollbar").HScrollBar,i=t("./scrollbar").VScrollBar,u=t("./scrollbar_custom").HScrollBar,h=t("./scrollbar_custom").VScrollBar,y=t("./renderloop").RenderLoop,b=t("./layer/font_metrics").FontMetrics,T=t("./lib/event_emitter").EventEmitter,$=t("./css/editor-css"),A=t("./layer/decorators").Decorator,S=t("./lib/useragent"),M=t("./layer/text_util").isTextToken;g.importCssString($,"ace_editor.css",!1);var R=(function(){function L(_,I){var w=this;this.container=_||g.createElement("div"),g.addCssClass(this.container,"ace_editor"),g.HI_DPI&&g.addCssClass(this.container,"ace_hidpi"),this.setTheme(I),l.get("useStrictCSP")==null&&l.set("useStrictCSP",!1),this.$gutter=g.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=g.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=g.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new f(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new r(this.content);var v=this.$textLayer=new o(this.content);this.canvas=v.element,this.$markerFront=new r(this.content),this.$cursorLayer=new s(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new i(this.container,this),this.scrollBarH=new a(this.container,this),this.scrollBarV.on("scroll",function(C){w.$scrollAnimation||w.session.setScrollTop(C.data-w.scrollMargin.top)}),this.scrollBarH.on("scroll",function(C){w.$scrollAnimation||w.session.setScrollLeft(C.data-w.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new b(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(C){w.updateCharacterSize(),w.onResize(!0,w.gutterWidth,w.$size.width,w.$size.height),w._signal("changeCharacterSize",C)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!S.isIOS,this.$loop=new y(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),l.resetOptions(this),l._signal("renderer",this)}return L.prototype.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),g.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},L.prototype.setSession=function(_){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=_,_&&this.scrollMargin.top&&_.getScrollTop()<=0&&_.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(_),this.$markerBack.setSession(_),this.$markerFront.setSession(_),this.$gutterLayer.setSession(_),this.$textLayer.setSession(_),_&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},L.prototype.updateLines=function(_,I,w){if(I===void 0&&(I=1/0),this.$changedLines?(this.$changedLines.firstRow>_&&(this.$changedLines.firstRow=_),this.$changedLines.lastRow<I&&(this.$changedLines.lastRow=I)):this.$changedLines={firstRow:_,lastRow:I},this.$changedLines.lastRow<this.layerConfig.firstRow)if(w)this.$changedLines.lastRow=this.layerConfig.lastRow;else return;this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},L.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},L.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},L.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},L.prototype.updateFull=function(_){_?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},L.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},L.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},L.prototype.onResize=function(_,I,w,v){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=_?1:0;var C=this.container;v||(v=C.clientHeight||C.scrollHeight),!v&&this.$maxLines&&this.lineHeight>1&&(!C.style.height||C.style.height=="0px")&&(C.style.height="1px",v=C.clientHeight||C.scrollHeight),w||(w=C.clientWidth||C.scrollWidth);var E=this.$updateCachedSize(_,I,w,v);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!w&&!v)return this.resizing=0;_&&(this.$gutterLayer.$padding=null),_?this.$renderChanges(E|this.$changes,!0):this.$loop.schedule(E|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},L.prototype.$updateCachedSize=function(_,I,w,v){v-=this.$extraHeight||0;var C=0,E=this.$size,x={width:E.width,height:E.height,scrollerHeight:E.scrollerHeight,scrollerWidth:E.scrollerWidth};if(v&&(_||E.height!=v)&&(E.height=v,C|=this.CHANGE_SIZE,E.scrollerHeight=E.height,this.$horizScroll&&(E.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(E.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",C=C|this.CHANGE_SCROLL),w&&(_||E.width!=w)){C|=this.CHANGE_SIZE,E.width=w,I==null&&(I=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=I,g.setStyle(this.scrollBarH.element.style,"left",I+"px"),g.setStyle(this.scroller.style,"left",I+this.margin.left+"px"),E.scrollerWidth=Math.max(0,w-I-this.scrollBarV.getWidth()-this.margin.h),g.setStyle(this.$gutter.style,"left",this.margin.left+"px");var k=this.scrollBarV.getWidth()+"px";g.setStyle(this.scrollBarH.element.style,"right",k),g.setStyle(this.scroller.style,"right",k),g.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(E.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||_)&&(C|=this.CHANGE_FULL)}return E.$dirty=!w||!v,C&&this._signal("resize",x),C},L.prototype.onGutterResize=function(_){var I=this.$showGutter?_:0;I!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,I,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()?this.$loop.schedule(this.CHANGE_FULL):this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},L.prototype.adjustWrapLimit=function(){var _=this.$size.scrollerWidth-this.$padding*2,I=Math.floor(_/this.characterWidth);return this.session.adjustWrapLimit(I,this.$showPrintMargin&&this.$printMarginColumn)},L.prototype.setAnimatedScroll=function(_){this.setOption("animatedScroll",_)},L.prototype.getAnimatedScroll=function(){return this.$animatedScroll},L.prototype.setShowInvisibles=function(_){this.setOption("showInvisibles",_),this.session.$bidiHandler.setShowInvisibles(_)},L.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},L.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},L.prototype.setDisplayIndentGuides=function(_){this.setOption("displayIndentGuides",_)},L.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},L.prototype.setHighlightIndentGuides=function(_){this.setOption("highlightIndentGuides",_)},L.prototype.setShowPrintMargin=function(_){this.setOption("showPrintMargin",_)},L.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},L.prototype.setPrintMarginColumn=function(_){this.setOption("printMarginColumn",_)},L.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},L.prototype.getShowGutter=function(){return this.getOption("showGutter")},L.prototype.setShowGutter=function(_){return this.setOption("showGutter",_)},L.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},L.prototype.setFadeFoldWidgets=function(_){this.setOption("fadeFoldWidgets",_)},L.prototype.setHighlightGutterLine=function(_){this.setOption("highlightGutterLine",_)},L.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},L.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var _=g.createElement("div");_.className="ace_layer ace_print-margin-layer",this.$printMarginEl=g.createElement("div"),this.$printMarginEl.className="ace_print-margin",_.appendChild(this.$printMarginEl),this.content.insertBefore(_,this.content.firstChild)}var I=this.$printMarginEl.style;I.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",I.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},L.prototype.getContainerElement=function(){return this.container},L.prototype.getMouseEventTarget=function(){return this.scroller},L.prototype.getTextAreaContainer=function(){return this.container},L.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var _=this.textarea.style,I=this.$composition;if(!this.$keepTextAreaAtCursor&&!I){g.translate(this.textarea,-100,0);return}var w=this.$cursorLayer.$pixelPos;if(w){I&&I.markerRange&&(w=this.$cursorLayer.getPixelPosition(I.markerRange.start,!0));var v=this.layerConfig,C=w.top,E=w.left;C-=v.offset;var x=I&&I.useTextareaForIME||S.isMobile?this.lineHeight:1;if(C<0||C>v.height-x){g.translate(this.textarea,0,0);return}var k=1,O=this.$size.height-x;if(!I)C+=this.lineHeight;else if(I.useTextareaForIME){var D=this.textarea.value;k=this.characterWidth*this.session.$getStringScreenWidth(D)[0]}else C+=this.lineHeight+2;E-=this.scrollLeft,E>this.$size.scrollerWidth-k&&(E=this.$size.scrollerWidth-k),E+=this.gutterWidth+this.margin.left,g.setStyle(_,"height",x+"px"),g.setStyle(_,"width",k+"px"),g.translate(this.textarea,Math.min(E,this.$size.scrollerWidth-k),Math.min(C,O))}}},L.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},L.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},L.prototype.getLastFullyVisibleRow=function(){var _=this.layerConfig,I=_.lastRow,w=this.session.documentToScreenRow(I,0)*_.lineHeight;return w-this.session.getScrollTop()>_.height-_.lineHeight?I-1:I},L.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},L.prototype.setPadding=function(_){this.$padding=_,this.$textLayer.setPadding(_),this.$cursorLayer.setPadding(_),this.$markerFront.setPadding(_),this.$markerBack.setPadding(_),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},L.prototype.setScrollMargin=function(_,I,w,v){var C=this.scrollMargin;C.top=_|0,C.bottom=I|0,C.right=v|0,C.left=w|0,C.v=C.top+C.bottom,C.h=C.left+C.right,C.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-C.top),this.updateFull()},L.prototype.setMargin=function(_,I,w,v){var C=this.margin;C.top=_|0,C.bottom=I|0,C.right=v|0,C.left=w|0,C.v=C.top+C.bottom,C.h=C.left+C.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},L.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},L.prototype.setHScrollBarAlwaysVisible=function(_){this.setOption("hScrollBarAlwaysVisible",_)},L.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},L.prototype.setVScrollBarAlwaysVisible=function(_){this.setOption("vScrollBarAlwaysVisible",_)},L.prototype.$updateScrollBarV=function(){var _=this.layerConfig.maxHeight,I=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(_-=(I-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>_-I&&(_=this.scrollTop+I,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(_+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},L.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},L.prototype.freeze=function(){this.$frozen=!0},L.prototype.unfreeze=function(){this.$frozen=!1},L.prototype.$renderChanges=function(_,I){if(this.$changes&&(_|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!_&&!I){this.$changes|=_;return}if(this.$size.$dirty)return this.$changes|=_,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",_),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var w=this.layerConfig;if(_&this.CHANGE_FULL||_&this.CHANGE_SIZE||_&this.CHANGE_TEXT||_&this.CHANGE_LINES||_&this.CHANGE_SCROLL||_&this.CHANGE_H_SCROLL){if(_|=this.$computeLayerConfig()|this.$loop.clear(),w.firstRow!=this.layerConfig.firstRow&&w.firstRowScreen==this.layerConfig.firstRowScreen){var v=this.scrollTop+(w.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;v>0&&(this.scrollTop=v,_=_|this.CHANGE_SCROLL,_|=this.$computeLayerConfig()|this.$loop.clear())}w=this.layerConfig,this.$updateScrollBarV(),_&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),g.translate(this.content,-this.scrollLeft,-w.offset);var C=w.width+2*this.$padding+"px",E=w.minHeight+"px";g.setStyle(this.content.style,"width",C),g.setStyle(this.content.style,"height",E)}if(_&this.CHANGE_H_SCROLL&&(g.translate(this.content,-this.scrollLeft,-w.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),_&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(w),this.$showGutter&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w),this.$markerBack.update(w),this.$markerFront.update(w),this.$cursorLayer.update(w),this.$moveTextAreaToCursor(),this._signal("afterRender",_);return}if(_&this.CHANGE_SCROLL){this.$changedLines=null,_&this.CHANGE_TEXT||_&this.CHANGE_LINES?this.$textLayer.update(w):this.$textLayer.scrollLines(w),this.$showGutter&&(_&this.CHANGE_GUTTER||_&this.CHANGE_LINES?this.$gutterLayer.update(w):this.$gutterLayer.scrollLines(w)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w),this.$markerBack.update(w),this.$markerFront.update(w),this.$cursorLayer.update(w),this.$moveTextAreaToCursor(),this._signal("afterRender",_);return}_&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(w),this.$showGutter&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)):_&this.CHANGE_LINES?((this.$updateLines()||_&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)):_&this.CHANGE_TEXT||_&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)):_&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)),_&this.CHANGE_CURSOR&&(this.$cursorLayer.update(w),this.$moveTextAreaToCursor()),_&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(w),_&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(w),this._signal("afterRender",_)},L.prototype.$autosize=function(){var _=this.session.getScreenLength()*this.lineHeight,I=this.$maxLines*this.lineHeight,w=Math.min(I,Math.max((this.$minLines||1)*this.lineHeight,_))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(w+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&w>this.$maxPixelHeight&&(w=this.$maxPixelHeight);var v=w<=2*this.lineHeight,C=!v&&_>I;if(w!=this.desiredHeight||this.$size.height!=this.desiredHeight||C!=this.$vScroll){C!=this.$vScroll&&(this.$vScroll=C,this.scrollBarV.setVisible(C));var E=this.container.clientWidth;this.container.style.height=w+"px",this.$updateCachedSize(!0,this.$gutterWidth,E,w),this.desiredHeight=w,this._signal("autosize")}},L.prototype.$computeLayerConfig=function(){var _=this.session,I=this.$size,w=I.height<=2*this.lineHeight,v=this.session.getScreenLength(),C=v*this.lineHeight,E=this.$getLongestLine(),x=!w&&(this.$hScrollBarAlwaysVisible||I.scrollerWidth-E-2*this.$padding<0),k=this.$horizScroll!==x;k&&(this.$horizScroll=x,this.scrollBarH.setVisible(x));var O=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var D=I.scrollerHeight+this.lineHeight,N=!this.$maxLines&&this.$scrollPastEnd?(I.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;C+=N;var P=this.scrollMargin;this.session.setScrollTop(Math.max(-P.top,Math.min(this.scrollTop,C-I.scrollerHeight+P.bottom))),this.session.setScrollLeft(Math.max(-P.left,Math.min(this.scrollLeft,E+2*this.$padding-I.scrollerWidth+P.right)));var z=!w&&(this.$vScrollBarAlwaysVisible||I.scrollerHeight-C+N<0||this.scrollTop>P.top),F=O!==z;F&&(this.$vScroll=z,this.scrollBarV.setVisible(z));var W=this.scrollTop%this.lineHeight,H=Math.ceil(D/this.lineHeight)-1,B=Math.max(0,Math.round((this.scrollTop-W)/this.lineHeight)),G=B+H,q,Y,V=this.lineHeight;B=_.screenToDocumentRow(B,0);var Z=_.getFoldLine(B);Z&&(B=Z.start.row),q=_.documentToScreenRow(B,0),Y=_.getRowLength(B)*V,G=Math.min(_.screenToDocumentRow(G,0),_.getLength()-1),D=I.scrollerHeight+_.getRowLength(G)*V+Y,W=this.scrollTop-q*V;var ue=0;return(this.layerConfig.width!=E||k)&&(ue=this.CHANGE_H_SCROLL),(k||F)&&(ue|=this.$updateCachedSize(!0,this.gutterWidth,I.width,I.height),this._signal("scrollbarVisibilityChanged"),F&&(E=this.$getLongestLine())),this.layerConfig={width:E,padding:this.$padding,firstRow:B,firstRowScreen:q,lastRow:G,lineHeight:V,characterWidth:this.characterWidth,minHeight:D,maxHeight:C,offset:W,gutterOffset:V?Math.max(0,Math.ceil((W+I.height-I.scrollerHeight)/V)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(E-this.$padding),ue},L.prototype.$updateLines=function(){if(this.$changedLines){var _=this.$changedLines.firstRow,I=this.$changedLines.lastRow;this.$changedLines=null;var w=this.layerConfig;if(!(_>w.lastRow+1)&&!(I<w.firstRow)){if(I===1/0){this.$showGutter&&this.$gutterLayer.update(w),this.$textLayer.update(w);return}return this.$textLayer.updateLines(w,_,I),!0}}},L.prototype.$getLongestLine=function(){var _=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(_+=1),this.$textLayer&&_>this.$textLayer.MAX_LINE_LENGTH&&(_=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(_*this.characterWidth))},L.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},L.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},L.prototype.addGutterDecoration=function(_,I){this.$gutterLayer.addGutterDecoration(_,I)},L.prototype.removeGutterDecoration=function(_,I){this.$gutterLayer.removeGutterDecoration(_,I)},L.prototype.updateBreakpoints=function(_){this._rows=_,this.$loop.schedule(this.CHANGE_GUTTER)},L.prototype.setAnnotations=function(_){this.$gutterLayer.setAnnotations(_),this.$loop.schedule(this.CHANGE_GUTTER)},L.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},L.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},L.prototype.showCursor=function(){this.$cursorLayer.showCursor()},L.prototype.scrollSelectionIntoView=function(_,I,w){this.scrollCursorIntoView(_,w),this.scrollCursorIntoView(I,w)},L.prototype.scrollCursorIntoView=function(_,I,w){if(this.$size.scrollerHeight!==0){var v=this.$cursorLayer.getPixelPosition(_),C=v.left,E=v.top,x=w&&w.top||0,k=w&&w.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var O=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;O+x>E?(I&&O+x>E+this.lineHeight&&(E-=I*this.$size.scrollerHeight),E===0&&(E=-this.scrollMargin.top),this.session.setScrollTop(E)):O+this.$size.scrollerHeight-k<E+this.lineHeight&&(I&&O+this.$size.scrollerHeight-k<E-this.lineHeight&&(E+=I*this.$size.scrollerHeight),this.session.setScrollTop(E+this.lineHeight+k-this.$size.scrollerHeight));var D=this.scrollLeft,N=2*this.layerConfig.characterWidth;C-N<D?(C-=N,C<this.$padding+N&&(C=-this.scrollMargin.left),this.session.setScrollLeft(C)):(C+=N,D+this.$size.scrollerWidth<C+this.characterWidth?this.session.setScrollLeft(Math.round(C+this.characterWidth-this.$size.scrollerWidth)):D<=this.$padding&&C-D<this.characterWidth&&this.session.setScrollLeft(0))}},L.prototype.getScrollTop=function(){return this.session.getScrollTop()},L.prototype.getScrollLeft=function(){return this.session.getScrollLeft()},L.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},L.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},L.prototype.scrollToRow=function(_){this.session.setScrollTop(_*this.lineHeight)},L.prototype.alignCursor=function(_,I){typeof _=="number"&&(_={row:_,column:0});var w=this.$cursorLayer.getPixelPosition(_),v=this.$size.scrollerHeight-this.lineHeight,C=w.top-v*(I||0);return this.session.setScrollTop(C),C},L.prototype.$calcSteps=function(_,I){var w=0,v=this.STEPS,C=[],E=function(x,k,O){return O*(Math.pow(x-1,3)+1)+k};for(w=0;w<v;++w)C.push(E(w/this.STEPS,_,I-_));return C},L.prototype.scrollToLine=function(_,I,w,v){var C=this.$cursorLayer.getPixelPosition({row:_,column:0}),E=C.top;I&&(E-=this.$size.scrollerHeight/2);var x=this.scrollTop;this.session.setScrollTop(E),w!==!1&&this.animateScrolling(x,v)},L.prototype.animateScrolling=function(_,I){var w=this.scrollTop;if(!this.$animatedScroll)return;var v=this;if(_==w)return;if(this.$scrollAnimation){var C=this.$scrollAnimation.steps;if(C.length&&(_=C[0],_==w))return}var E=v.$calcSteps(_,w);this.$scrollAnimation={from:_,to:w,steps:E},clearInterval(this.$timer),v.session.setScrollTop(E.shift()),v.session.$scrollTop=w;function x(){v.$timer=clearInterval(v.$timer),v.$scrollAnimation=null,v.$stopAnimation=!1,I&&I()}this.$timer=setInterval(function(){if(v.$stopAnimation){x();return}if(!v.session)return clearInterval(v.$timer);E.length?(v.session.setScrollTop(E.shift()),v.session.$scrollTop=w):w!=null?(v.session.$scrollTop=-1,v.session.setScrollTop(w),w=null):x()},10)},L.prototype.scrollToY=function(_){this.scrollTop!==_&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=_)},L.prototype.scrollToX=function(_){this.scrollLeft!==_&&(this.scrollLeft=_),this.$loop.schedule(this.CHANGE_H_SCROLL)},L.prototype.scrollTo=function(_,I){this.session.setScrollTop(I),this.session.setScrollLeft(_)},L.prototype.scrollBy=function(_,I){I&&this.session.setScrollTop(this.session.getScrollTop()+I),_&&this.session.setScrollLeft(this.session.getScrollLeft()+_)},L.prototype.isScrollableBy=function(_,I){if(I<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||I>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||_<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||_>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},L.prototype.pixelToScreenCoordinates=function(_,I){var w;if(this.$hasCssTransforms){w={top:0,left:0};var v=this.$fontMetrics.transformCoordinates([_,I]);_=v[1]-this.gutterWidth-this.margin.left,I=v[0]}else w=this.scroller.getBoundingClientRect();var C=_+this.scrollLeft-w.left-this.$padding,E=C/this.characterWidth,x=Math.floor((I+this.scrollTop-w.top)/this.lineHeight),k=this.$blockCursor?Math.floor(E):Math.round(E);return{row:x,column:k,side:E-k>0?1:-1,offsetX:C}},L.prototype.screenToTextCoordinates=function(_,I){var w;if(this.$hasCssTransforms){w={top:0,left:0};var v=this.$fontMetrics.transformCoordinates([_,I]);_=v[1]-this.gutterWidth-this.margin.left,I=v[0]}else w=this.scroller.getBoundingClientRect();var C=_+this.scrollLeft-w.left-this.$padding,E=C/this.characterWidth,x=this.$blockCursor?Math.floor(E):Math.round(E),k=Math.floor((I+this.scrollTop-w.top)/this.lineHeight);return this.session.screenToDocumentPosition(k,Math.max(x,0),C)},L.prototype.textToScreenCoordinates=function(_,I){var w=this.scroller.getBoundingClientRect(),v=this.session.documentToScreenPosition(_,I),C=this.$padding+(this.session.$bidiHandler.isBidiRow(v.row,_)?this.session.$bidiHandler.getPosLeft(v.column):Math.round(v.column*this.characterWidth)),E=v.row*this.lineHeight;return{pageX:w.left+C-this.scrollLeft,pageY:w.top+E-this.scrollTop}},L.prototype.visualizeFocus=function(){g.addCssClass(this.container,"ace_focus")},L.prototype.visualizeBlur=function(){g.removeCssClass(this.container,"ace_focus")},L.prototype.showComposition=function(_){this.$composition=_,_.cssText||(_.cssText=this.textarea.style.cssText),_.useTextareaForIME==null&&(_.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(g.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):_.markerId=this.session.addMarker(_.markerRange,"ace_composition_marker","text")},L.prototype.setCompositionText=function(_){var I=this.session.selection.cursor;this.addToken(_,"composition_placeholder",I.row,I.column),this.$moveTextAreaToCursor()},L.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),g.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var _=this.session.selection.cursor;this.removeExtraToken(_.row,_.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},L.prototype.setGhostText=function(_,I){var w=this.session.selection.cursor,v=I||{row:w.row,column:w.column};this.removeGhostText();var C=this.$calculateWrappedTextChunks(_,v);this.addToken(C[0].text,"ghost_text",v.row,v.column),this.$ghostText={text:_,position:{row:v.row,column:v.column}};var E=g.createElement("div");if(C.length>1){var x=this.hideTokensAfterPosition(v.row,v.column),k;C.slice(1).forEach(function(F){var W=g.createElement("div"),H=g.createElement("span");H.className="ace_ghost_text",F.wrapped&&(W.className="ghost_text_line_wrapped"),F.text.length===0&&(F.text=" "),H.appendChild(g.createTextNode(F.text)),W.appendChild(H),E.appendChild(W),k=W}),x.forEach(function(F){var W=g.createElement("span");M(F.type)||(W.className="ace_"+F.type.replace(/\./g," ace_")),W.appendChild(g.createTextNode(F.value)),k.appendChild(W)}),this.$ghostTextWidget={el:E,row:v.row,column:v.column,className:"ace_ghost_text_container"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var O=this.$cursorLayer.getPixelPosition(v,!0),D=this.container,N=D.getBoundingClientRect().height,P=C.length*this.lineHeight,z=P<N-O.top;if(z)return;P<N?this.scrollBy(0,(C.length-1)*this.lineHeight):this.scrollToRow(v.row)}},L.prototype.$calculateWrappedTextChunks=function(_,I){var w=this.$size.scrollerWidth-this.$padding*2,v=Math.floor(w/this.characterWidth)-2;v=v<=0?60:v;for(var C=_.split(/\r?\n/),E=[],x=0;x<C.length;x++){var k=this.session.$getDisplayTokens(C[x],I.column),O=this.session.$computeWrapSplits(k,v,this.session.$tabSize);if(O.length>0){var D=0;O.push(C[x].length);for(var N=0;N<O.length;N++){var P=C[x].slice(D,O[N]);E.push({text:P,wrapped:!0}),D=O[N]}}else E.push({text:C[x],wrapped:!1})}return E},L.prototype.removeGhostText=function(){if(this.$ghostText){var _=this.$ghostText.position;this.removeExtraToken(_.row,_.column),this.$ghostTextWidget&&(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),this.$ghostTextWidget=null),this.$ghostText=null}},L.prototype.addToken=function(_,I,w,v){var C=this.session;C.bgTokenizer.lines[w]=null;var E={type:I,value:_},x=C.getTokens(w);if(v==null||!x.length)x.push(E);else for(var k=0,O=0;O<x.length;O++){var D=x[O];if(k+=D.value.length,v<=k){var N=D.value.length-(k-v),P=D.value.slice(0,N),z=D.value.slice(N);x.splice(O,1,{type:D.type,value:P},E,{type:D.type,value:z});break}}this.updateLines(w,w)},L.prototype.hideTokensAfterPosition=function(_,I){for(var w=this.session.getTokens(_),v=0,C=!1,E=[],x=0;x<w.length;x++){var k=w[x];if(v+=k.value.length,k.type!=="ghost_text"){if(C){E.push({type:k.type,value:k.value}),k.type="hidden_token";continue}v===I&&(C=!0)}}return this.updateLines(_,_),E},L.prototype.removeExtraToken=function(_,I){this.session.bgTokenizer.lines[_]=null,this.updateLines(_,_)},L.prototype.setTheme=function(_,I){var w=this;if(this.$themeId=_,w._dispatchEvent("themeChange",{theme:_}),!_||typeof _=="string"){var v=_||this.$options.theme.initialValue;l.loadModule(["theme",v],C)}else C(_);function C(E){if(w.$themeId!=_)return I&&I();if(!E||!E.cssClass)throw new Error("couldn't load module "+_+" or it didn't call define");E.$id&&(w.$themeId=E.$id),g.importCssString(E.cssText,E.cssClass,w.container),w.theme&&g.removeCssClass(w.container,w.theme.cssClass);var x="padding"in E?E.padding:"padding"in(w.theme||{})?4:w.$padding;w.$padding&&x!=w.$padding&&w.setPadding(x),w.$theme=E.cssClass,w.theme=E,g.addCssClass(w.container,E.cssClass),g.setCssClass(w.container,"ace_dark",E.isDark),w.$size&&(w.$size.width=0,w.$updateSizeAsync()),w._dispatchEvent("themeLoaded",{theme:E}),I&&I(),S.isSafari&&w.scroller&&(w.scroller.style.background="red",w.scroller.style.background="")}},L.prototype.getTheme=function(){return this.$themeId},L.prototype.setStyle=function(_,I){g.setCssClass(this.container,_,I!==!1)},L.prototype.unsetStyle=function(_){g.removeCssClass(this.container,_)},L.prototype.setCursorStyle=function(_){g.setStyle(this.scroller.style,"cursor",_)},L.prototype.setMouseCursor=function(_){g.setStyle(this.scroller.style,"cursor",_)},L.prototype.attachToShadowRoot=function(){g.importCssString($,"ace_editor.css",this.container)},L.prototype.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent="",this.setOption("useResizeObserver",!1)},L.prototype.$updateCustomScrollbar=function(_){var I=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),this.$scrollDecorator&&delete this.$scrollDecorator,_===!0?(this.scrollBarV=new h(this.container,this),this.scrollBarH=new u(this.container,this),this.scrollBarV.setHeight(this.$size.scrollerHeight),this.scrollBarH.setWidth(this.$size.scrollerWidth),this.scrollBarV.addEventListener("scroll",function(w){I.$scrollAnimation||I.session.setScrollTop(w.data-I.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(w){I.$scrollAnimation||I.session.setScrollLeft(w.data-I.scrollMargin.left)}),this.$scrollDecorator=new A(this.scrollBarV,this),this.$scrollDecorator.$updateDecorators()):(this.scrollBarV=new i(this.container,this),this.scrollBarH=new a(this.container,this),this.scrollBarV.addEventListener("scroll",function(w){I.$scrollAnimation||I.session.setScrollTop(w.data-I.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(w){I.$scrollAnimation||I.session.setScrollLeft(w.data-I.scrollMargin.left)}))},L.prototype.$addResizeObserver=function(){if(!(!window.ResizeObserver||this.$resizeObserver)){var _=this;this.$resizeTimer=m.delayedCall(function(){_.destroyed||_.onResize()},50),this.$resizeObserver=new window.ResizeObserver(function(I){var w=I[0].contentRect.width,v=I[0].contentRect.height;Math.abs(_.$size.width-w)>1||Math.abs(_.$size.height-v)>1?_.$resizeTimer.delay():_.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)}},L})();R.prototype.CHANGE_CURSOR=1,R.prototype.CHANGE_MARKER=2,R.prototype.CHANGE_GUTTER=4,R.prototype.CHANGE_SCROLL=8,R.prototype.CHANGE_LINES=16,R.prototype.CHANGE_TEXT=32,R.prototype.CHANGE_SIZE=64,R.prototype.CHANGE_MARKER_BACK=128,R.prototype.CHANGE_MARKER_FRONT=256,R.prototype.CHANGE_FULL=512,R.prototype.CHANGE_H_SCROLL=1024,R.prototype.$changes=0,R.prototype.$padding=null,R.prototype.$frozen=!1,R.prototype.STEPS=8,d.implement(R.prototype,T),l.defineOptions(R.prototype,"renderer",{useResizeObserver:{set:function(L){!L&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):L&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(L){this.$textLayer.setShowInvisibles(L)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(L){typeof L=="number"&&(this.$printMarginColumn=L),this.$showPrintMargin=!!L,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(L){this.$gutter.style.display=L?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(L){this.$gutterLayer.$useSvgGutterIcons=L},initialValue:!1},showFoldedAnnotations:{set:function(L){this.$gutterLayer.$showFoldedAnnotations=L},initialValue:!1},fadeFoldWidgets:{set:function(L){g.setCssClass(this.$gutter,"ace_fade-fold-widgets",L)},initialValue:!1},showFoldWidgets:{set:function(L){this.$gutterLayer.setShowFoldWidgets(L),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(L){this.$textLayer.setDisplayIndentGuides(L)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(L){this.$textLayer.setHighlightIndentGuides(L)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(L){this.$gutterLayer.setHighlightGutterLine(L),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(L){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(L){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(L){typeof L=="number"&&(L=L+"px"),this.container.style.fontSize=L,this.updateFontSize()},initialValue:12},fontFamily:{set:function(L){this.container.style.fontFamily=L,this.updateFontSize()}},maxLines:{set:function(L){this.updateFull()}},minLines:{set:function(L){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(L){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(L){L=+L||0,this.$scrollPastEnd!=L&&(this.$scrollPastEnd=L,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(L){this.$gutterLayer.$fixedWidth=!!L,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(L){this.$updateCustomScrollbar(L)},initialValue:!1},theme:{set:function(L){this.setTheme(L)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!S.isMobile&&!S.isIE}}),n.VirtualRenderer=R}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(t,n,p){var d=t("../lib/oop"),g=t("../lib/net"),m=t("../lib/event_emitter").EventEmitter,l=t("../config");function f(a){var i="importScripts('"+g.qualifyURL(a)+"');";try{return new Blob([i],{type:"application/javascript"})}catch{var u=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,h=new u;return h.append(i),h.getBlob("application/javascript")}}function r(a){if(typeof Worker>"u")return{postMessage:function(){},terminate:function(){}};if(l.get("loadWorkerFromBlob")){var i=f(a),u=window.URL||window.webkitURL,h=u.createObjectURL(i);return new Worker(h)}return new Worker(a)}var o=function(a){a.postMessage||(a=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=a,this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){d.implement(this,m),this.$createWorkerFromOldConfig=function(a,i,u,h,y){if(t.nameToUrl&&!t.toUrl&&(t.toUrl=t.nameToUrl),l.get("packaged")||!t.toUrl)h=h||l.moduleUrl(i,"worker");else{var b=this.$normalizePath;h=h||b(t.toUrl("ace/worker/worker.js",null,"_"));var T={};a.forEach(function($){T[$]=b(t.toUrl($,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=r(h),y&&this.send("importScripts",y),this.$worker.postMessage({init:!0,tlns:T,module:i,classname:u}),this.$worker},this.onMessage=function(a){var i=a.data;switch(i.type){case"event":this._signal(i.name,{data:i.data});break;case"call":var u=this.callbacks[i.id];u&&(u(i.data),delete this.callbacks[i.id]);break;case"error":this.reportError(i.data);break;case"log":window.console&&console.log&&console.log.apply(console,i.data);break}},this.reportError=function(a){window.console&&console.error&&console.error(a)},this.$normalizePath=function(a){return g.qualifyURL(a)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(a){a.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(a,i){this.$worker.postMessage({command:a,args:i})},this.call=function(a,i,u){if(u){var h=this.callbackId++;this.callbacks[h]=u,i.push(h)}this.send(a,i)},this.emit=function(a,i){try{i.data&&i.data.err&&(i.data.err={message:i.data.err.message,stack:i.data.err.stack,code:i.data.err.code}),this.$worker&&this.$worker.postMessage({event:a,data:{data:i.data}})}catch(u){console.error(u.stack)}},this.attachToDocument=function(a){this.$doc&&this.terminate(),this.$doc=a,this.call("setValue",[a.getValue()]),a.on("change",this.changeListener,!0)},this.changeListener=function(a){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),a.action=="insert"?this.deltaQueue.push(a.start,a.lines):this.deltaQueue.push(a.start,a.end)},this.$sendDeltaQueue=function(){var a=this.deltaQueue;a&&(this.deltaQueue=null,a.length>50&&a.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:a}))}}).call(o.prototype);var s=function(a,i,u){var h=null,y=!1,b=Object.create(m),T=[],$=new o({messageBuffer:T,terminate:function(){},postMessage:function(S){T.push(S),h&&(y?setTimeout(A):A())}});$.setEmitSync=function(S){y=S};var A=function(){var S=T.shift();S.command?h[S.command].apply(h,S.args):S.event&&b._signal(S.event,S.data)};return b.postMessage=function(S){$.onMessage({data:S})},b.callback=function(S,M){this.postMessage({type:"call",id:M,data:S})},b.emit=function(S,M){this.postMessage({type:"event",name:S,data:M})},l.loadModule(["worker",i],function(S){for(h=new S[u](b);T.length;)A()}),$};n.UIWorkerClient=s,n.WorkerClient=o,n.createWorker=r}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(t,n,p){var d=t("./range").Range,g=t("./lib/event_emitter").EventEmitter,m=t("./lib/oop"),l=(function(){function f(r,o,s,a,i,u){var h=this;this.length=o,this.session=r,this.doc=r.getDocument(),this.mainClass=i,this.othersClass=u,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=a,this.$onCursorChange=function(){setTimeout(function(){h.onCursorChange()})},this.$pos=s;var y=r.getUndoManager().$undoStack||r.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=y.length,this.setup(),r.selection.on("changeCursor",this.$onCursorChange)}return f.prototype.setup=function(){var r=this,o=this.doc,s=this.session;this.selectionBefore=s.selection.toJSON(),s.selection.inMultiSelectMode&&s.selection.toSingleRange(),this.pos=o.createAnchor(this.$pos.row,this.$pos.column);var a=this.pos;a.$insertRight=!0,a.detach(),a.markerId=s.addMarker(new d(a.row,a.column,a.row,a.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(i){var u=o.createAnchor(i.row,i.column);u.$insertRight=!0,u.detach(),r.others.push(u)}),s.setUndoSelect(!1)},f.prototype.showOtherMarkers=function(){if(!this.othersActive){var r=this.session,o=this;this.othersActive=!0,this.others.forEach(function(s){s.markerId=r.addMarker(new d(s.row,s.column,s.row,s.column+o.length),o.othersClass,null,!1)})}},f.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var r=0;r<this.others.length;r++)this.session.removeMarker(this.others[r].markerId)}},f.prototype.onUpdate=function(r){if(this.$updating)return this.updateAnchors(r);var o=r;if(o.start.row===o.end.row&&o.start.row===this.pos.row){this.$updating=!0;var s=r.action==="insert"?o.end.column-o.start.column:o.start.column-o.end.column,a=o.start.column>=this.pos.column&&o.start.column<=this.pos.column+this.length+1,i=o.start.column-this.pos.column;if(this.updateAnchors(r),a&&(this.length+=s),a&&!this.session.$fromUndo){if(r.action==="insert")for(var u=this.others.length-1;u>=0;u--){var h=this.others[u],y={row:h.row,column:h.column+i};this.doc.insertMergedLines(y,r.lines)}else if(r.action==="remove")for(var u=this.others.length-1;u>=0;u--){var h=this.others[u],y={row:h.row,column:h.column+i};this.doc.remove(new d(y.row,y.column,y.row,y.column-s))}}this.$updating=!1,this.updateMarkers()}},f.prototype.updateAnchors=function(r){this.pos.onChange(r);for(var o=this.others.length;o--;)this.others[o].onChange(r);this.updateMarkers()},f.prototype.updateMarkers=function(){if(!this.$updating){var r=this,o=this.session,s=function(i,u){o.removeMarker(i.markerId),i.markerId=o.addMarker(new d(i.row,i.column,i.row,i.column+r.length),u,null,!1)};s(this.pos,this.mainClass);for(var a=this.others.length;a--;)s(this.others[a],this.othersClass)}},f.prototype.onCursorChange=function(r){if(!(this.$updating||!this.session)){var o=this.session.selection.getCursor();o.row===this.pos.row&&o.column>=this.pos.column&&o.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",r)):(this.hideOtherMarkers(),this._emit("cursorLeave",r))}},f.prototype.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},f.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var r=this.session.getUndoManager(),o=(r.$undoStack||r.$undostack).length-this.$undoStackDepth,s=0;s<o;s++)r.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},f})();m.implement(l.prototype,g),n.PlaceHolder=l}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(t,n,p){var d=t("../lib/event"),g=t("../lib/useragent");function m(f,r){return f.row==r.row&&f.column==r.column}function l(f){var r=f.domEvent,o=r.altKey,s=r.shiftKey,a=r.ctrlKey,i=f.getAccelKey(),u=f.getButton();if(a&&g.isMac&&(u=r.button),f.editor.inMultiSelectMode&&u==2){f.editor.textInput.onContextMenu(f.domEvent);return}if(!a&&!o&&!i){u===0&&f.editor.inMultiSelectMode&&f.editor.exitMultiSelectMode();return}if(u===0){var h=f.editor,y=h.selection,b=h.inMultiSelectMode,T=f.getDocumentPosition(),$=y.getCursor(),A=f.inSelection()||y.isEmpty()&&m(T,$),S=f.x,M=f.y,R=function(P){S=P.clientX,M=P.clientY},L=h.session,_=h.renderer.pixelToScreenCoordinates(S,M),I=_,w;if(h.$mouseHandler.$enableJumpToDef)a&&o||i&&o?w=s?"block":"add":o&&h.$blockSelectEnabled&&(w="block");else if(i&&!o){if(w="add",!b&&s)return}else o&&h.$blockSelectEnabled&&(w="block");if(w&&g.isMac&&r.ctrlKey&&h.$mouseHandler.cancelContextMenu(),w=="add"){if(!b&&A)return;if(!b){var v=y.toOrientedRange();h.addSelectionMarker(v)}var C=y.rangeList.rangeAtPoint(T);h.inVirtualSelectionMode=!0,s&&(C=null,v=y.ranges[0]||v,h.removeSelectionMarker(v)),h.once("mouseup",function(){var P=y.toOrientedRange();C&&P.isEmpty()&&m(C.cursor,P.cursor)?y.substractPoint(P.cursor):(s?y.substractPoint(v.cursor):v&&(h.removeSelectionMarker(v),y.addRange(v)),y.addRange(P)),h.inVirtualSelectionMode=!1})}else if(w=="block"){f.stop(),h.inVirtualSelectionMode=!0;var E,x=[],k=function(){var P=h.renderer.pixelToScreenCoordinates(S,M),z=L.screenToDocumentPosition(P.row,P.column,P.offsetX);m(I,P)&&m(z,y.lead)||(I=P,h.selection.moveToPosition(z),h.renderer.scrollCursorIntoView(),h.removeSelectionMarkers(x),x=y.rectangularRangeBlock(I,_),h.$mouseHandler.$clickSelection&&x.length==1&&x[0].isEmpty()&&(x[0]=h.$mouseHandler.$clickSelection.clone()),x.forEach(h.addSelectionMarker,h),h.updateSelectionMarkers())};b&&!i?y.toSingleRange():!b&&i&&(E=y.toOrientedRange(),h.addSelectionMarker(E)),s?_=L.documentToScreenPosition(y.lead):y.moveToPosition(T),I={row:-1,column:-1};var O=function(P){k(),clearInterval(N),h.removeSelectionMarkers(x),x.length||(x=[y.toOrientedRange()]),E&&(h.removeSelectionMarker(E),y.toSingleRange(E));for(var z=0;z<x.length;z++)y.addRange(x[z]);h.inVirtualSelectionMode=!1,h.$mouseHandler.$clickSelection=null},D=k;d.capture(h.container,R,O);var N=setInterval(function(){D()},20);return f.preventDefault()}}}n.onMouseDown=l}),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(t,n,p){n.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(g){g.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(g){g.selectMoreLines(1)},bindKey:{win:"Ctrl-Alt-Down",mac:"Ctrl-Alt-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorAboveSkipCurrent",description:"Add cursor above (skip current)",exec:function(g){g.selectMoreLines(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Up",mac:"Ctrl-Alt-Shift-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelowSkipCurrent",description:"Add cursor below (skip current)",exec:function(g){g.selectMoreLines(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Down",mac:"Ctrl-Alt-Shift-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreBefore",description:"Select more before",exec:function(g){g.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(g){g.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(g){g.selectMore(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Left",mac:"Ctrl-Alt-Shift-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextAfter",description:"Select next after",exec:function(g){g.selectMore(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"toggleSplitSelectionIntoLines",description:"Split selection into lines",exec:function(g){g.multiSelect.rangeCount>1?g.multiSelect.joinSelections():g.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(g){g.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(g){g.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(g){g.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],n.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(g){g.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(g){return g&&g.inMultiSelectMode}}];var d=t("../keyboard/hash_handler").HashHandler;n.keyboardHandler=new d(n.multiSelectCommands)}),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],function(t,n,p){var d=t("./range_list").RangeList,g=t("./range").Range,m=t("./selection").Selection,l=t("./mouse/multi_select_handler").onMouseDown,f=t("./lib/event"),r=t("./lib/lang"),o=t("./commands/multi_select_commands");n.commands=o.defaultCommands.concat(o.multiSelectCommands);var s=t("./search").Search,a=new s;function i($,A,S){return a.$options.wrap=!0,a.$options.needle=A,a.$options.backwards=S==-1,a.find($)}var u=t("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(u.prototype),(function(){this.ranges=null,this.rangeList=null,this.addRange=function($,A){if($){if(!this.inMultiSelectMode&&this.rangeCount===0){var S=this.toOrientedRange();if(this.rangeList.add(S),this.rangeList.add($),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),A||this.fromOrientedRange($);this.rangeList.removeAll(),this.rangeList.add(S),this.$onAddRange(S)}$.cursor||($.cursor=$.end);var M=this.rangeList.add($);return this.$onAddRange($),M.length&&this.$onRemoveRange(M),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),A||this.fromOrientedRange($)}},this.toSingleRange=function($){$=$||this.ranges[0];var A=this.rangeList.removeAll();A.length&&this.$onRemoveRange(A),$&&this.fromOrientedRange($)},this.substractPoint=function($){var A=this.rangeList.substractPoint($);if(A)return this.$onRemoveRange(A),A[0]},this.mergeOverlappingRanges=function(){var $=this.rangeList.merge();$.length&&this.$onRemoveRange($)},this.$onAddRange=function($){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift($),this._signal("addRange",{range:$})},this.$onRemoveRange=function($){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var A=this.rangeList.ranges.pop();$.push(A),this.rangeCount=0}for(var S=$.length;S--;){var M=this.ranges.indexOf($[S]);this.ranges.splice(M,1)}this._signal("removeRange",{ranges:$}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),A=A||this.ranges[0],A&&!A.isEqual(this.getRange())&&this.fromOrientedRange(A)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new d,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var $=this.ranges.length?this.ranges:[this.getRange()],A=[],S=0;S<$.length;S++){var M=$[S],R=M.start.row,L=M.end.row;if(R===L)A.push(M.clone());else{for(A.push(new g(R,M.start.column,R,this.session.getLine(R).length));++R<L;)A.push(this.getLineRange(R,!0));A.push(new g(L,0,L,M.end.column))}S==0&&!this.isBackwards()&&(A=A.reverse())}this.toSingleRange();for(var S=A.length;S--;)this.addRange(A[S])},this.joinSelections=function(){var $=this.rangeList.ranges,A=$[$.length-1],S=g.fromPoints($[0].start,A.end);this.toSingleRange(),this.setSelectionRange(S,A.cursor==A.start)},this.toggleBlockSelection=function(){if(this.rangeCount>1){var $=this.rangeList.ranges,A=$[$.length-1],S=g.fromPoints($[0].start,A.end);this.toSingleRange(),this.setSelectionRange(S,A.cursor==A.start)}else{var M=this.session.documentToScreenPosition(this.cursor),R=this.session.documentToScreenPosition(this.anchor),L=this.rectangularRangeBlock(M,R);L.forEach(this.addRange,this)}},this.rectangularRangeBlock=function($,A,S){var M=[],R=$.column<A.column;if(R)var L=$.column,_=A.column,I=$.offsetX,w=A.offsetX;else var L=A.column,_=$.column,I=A.offsetX,w=$.offsetX;var v=$.row<A.row;if(v)var C=$.row,E=A.row;else var C=A.row,E=$.row;L<0&&(L=0),C<0&&(C=0),C==E&&(S=!0);for(var x,k=C;k<=E;k++){var O=g.fromPoints(this.session.screenToDocumentPosition(k,L,I),this.session.screenToDocumentPosition(k,_,w));if(O.isEmpty()){if(x&&y(O.end,x))break;x=O.end}O.cursor=R?O.start:O.end,M.push(O)}if(v&&M.reverse(),!S){for(var D=M.length-1;M[D].isEmpty()&&D>0;)D--;if(D>0)for(var N=0;M[N].isEmpty();)N++;for(var P=D;P>=N;P--)M[P].isEmpty()&&M.splice(P,1)}return M}}).call(m.prototype);var h=t("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function($){$.cursor||($.cursor=$.end);var A=this.getSelectionStyle();return $.marker=this.session.addMarker($,"ace_selection",A),this.session.$selectionMarkers.push($),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,$},this.removeSelectionMarker=function($){if($.marker){this.session.removeMarker($.marker);var A=this.session.$selectionMarkers.indexOf($);A!=-1&&this.session.$selectionMarkers.splice(A,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function($){for(var A=this.session.$selectionMarkers,S=$.length;S--;){var M=$[S];if(M.marker){this.session.removeMarker(M.marker);var R=A.indexOf(M);R!=-1&&A.splice(R,1)}}this.session.selectionMarkerCount=A.length},this.$onAddRange=function($){this.addSelectionMarker($.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function($){this.removeSelectionMarkers($.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function($){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(o.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function($){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(o.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function($){var A=$.command,S=$.editor;if(S.multiSelect){if(A.multiSelectAction)A.multiSelectAction=="forEach"?M=S.forEachSelection(A,$.args):A.multiSelectAction=="forEachLine"?M=S.forEachSelection(A,$.args,!0):A.multiSelectAction=="single"?(S.exitMultiSelectMode(),M=A.exec(S,$.args||{})):M=A.multiSelectAction(S,$.args||{});else{var M=A.exec(S,$.args||{});S.multiSelect.addRange(S.multiSelect.toOrientedRange()),S.multiSelect.mergeOverlappingRanges()}return M}},this.forEachSelection=function($,A,S){if(!this.inVirtualSelectionMode){var M=S&&S.keepOrder,R=S==!0||S&&S.$byLines,L=this.session,_=this.selection,I=_.rangeList,w=(M?_:I).ranges,v;if(!w.length)return $.exec?$.exec(this,A||{}):$(this,A||{});var C=_._eventRegistry;_._eventRegistry={};var E=new m(L);this.inVirtualSelectionMode=!0;for(var x=w.length;x--;){if(R)for(;x>0&&w[x].start.row==w[x-1].end.row;)x--;E.fromOrientedRange(w[x]),E.index=x,this.selection=L.selection=E;var k=$.exec?$.exec(this,A||{}):$(this,A||{});!v&&k!==void 0&&(v=k),E.toOrientedRange(w[x])}E.detach(),this.selection=L.selection=_,this.inVirtualSelectionMode=!1,_._eventRegistry=C,_.mergeOverlappingRanges(),_.ranges[0]&&_.fromOrientedRange(_.ranges[0]);var O=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),O&&O.from==O.to&&this.renderer.animateScrolling(O.from),v}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var $="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var A=this.multiSelect.rangeList.ranges,S=[],M=0;M<A.length;M++)S.push(this.session.getTextRange(A[M]));var R=this.session.getDocument().getNewLineCharacter();$=S.join(R),$.length==(S.length-1)*R.length&&($="")}else this.selection.isEmpty()||($=this.session.getTextRange(this.getSelectionRange()));return $},this.$checkMultiselectChange=function($,A){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var S=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&A==this.multiSelect.anchor)return;var M=A==this.multiSelect.anchor?S.cursor==S.start?S.end:S.start:S.cursor;M.row!=A.row||this.session.$clipPositionToDocument(M.row,M.column).column!=A.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function($,A,S){if(A=A||{},A.needle=$||A.needle,A.needle==null){var M=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();A.needle=this.session.getTextRange(M)}this.$search.set(A);var R=this.$search.findAll(this.session);if(!R.length)return 0;var L=this.multiSelect;S||L.toSingleRange(R[0]);for(var _=R.length;_--;)L.addRange(R[_],!0);return M&&L.rangeList.rangeAtPoint(M.start)&&L.addRange(M,!0),R.length},this.selectMoreLines=function($,A){var S=this.selection.toOrientedRange(),M=S.cursor==S.end,R=this.session.documentToScreenPosition(S.cursor);this.selection.$desiredColumn&&(R.column=this.selection.$desiredColumn);var L=this.session.screenToDocumentPosition(R.row+$,R.column);if(S.isEmpty())var I=L;else var _=this.session.documentToScreenPosition(M?S.end:S.start),I=this.session.screenToDocumentPosition(_.row+$,_.column);if(M){var w=g.fromPoints(L,I);w.cursor=w.start}else{var w=g.fromPoints(I,L);w.cursor=w.end}if(w.desiredColumn=R.column,!this.selection.inMultiSelectMode)this.selection.addRange(S);else if(A)var v=S.cursor;this.selection.addRange(w),v&&this.selection.substractPoint(v)},this.transposeSelections=function($){for(var A=this.session,S=A.multiSelect,M=S.ranges,R=M.length;R--;){var L=M[R];if(L.isEmpty()){var _=A.getWordRange(L.start.row,L.start.column);L.start.row=_.start.row,L.start.column=_.start.column,L.end.row=_.end.row,L.end.column=_.end.column}}S.mergeOverlappingRanges();for(var I=[],R=M.length;R--;){var L=M[R];I.unshift(A.getTextRange(L))}$<0?I.unshift(I.pop()):I.push(I.shift());for(var R=M.length;R--;){var L=M[R],w=L.clone();A.replace(L,I[R]),L.start.row=w.start.row,L.start.column=w.start.column}S.fromOrientedRange(S.ranges[0])},this.selectMore=function($,A,S){var M=this.session,R=M.multiSelect,L=R.toOrientedRange();if(!(L.isEmpty()&&(L=M.getWordRange(L.start.row,L.start.column),L.cursor=$==-1?L.start:L.end,this.multiSelect.addRange(L),S))){var _=M.getTextRange(L),I=i(M,_,$);I&&(I.cursor=$==-1?I.start:I.end,this.session.unfold(I),this.multiSelect.addRange(I),this.renderer.scrollCursorIntoView(null,.5)),A&&this.multiSelect.substractPoint(L.cursor)}},this.alignCursors=function(){var $=this.session,A=$.multiSelect,S=A.ranges,M=-1,R=S.filter(function(D){if(D.cursor.row==M)return!0;M=D.cursor.row});if(!S.length||R.length==S.length-1){var L=this.selection.getRange(),_=L.start.row,I=L.end.row,w=_==I;if(w){var v=this.session.getLength(),C;do C=this.session.getLine(I);while(/[=:]/.test(C)&&++I<v);do C=this.session.getLine(_);while(/[=:]/.test(C)&&--_>0);_<0&&(_=0),I>=v&&(I=v-1)}var E=this.session.removeFullLines(_,I);E=this.$reAlignText(E,w),this.session.insert({row:_,column:0},E.join(`
2098
+ }`}),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(t,n,p){var d=t("../lib/dom"),g=t("../lib/oop"),m=t("../lib/event_emitter").EventEmitter,c=(function(){function f(r,o){this.canvas=d.createElement("canvas"),this.renderer=o,this.pixelRatio=1,this.maxHeight=o.layerConfig.maxHeight,this.lineHeight=o.layerConfig.lineHeight,this.canvasHeight=r.parent.scrollHeight,this.heightRatio=this.canvasHeight/this.maxHeight,this.canvasWidth=r.width,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.canvas.style.top="0px",this.canvas.style.right="0px",this.canvas.style.zIndex="7px",this.canvas.style.position="absolute",this.colors={},this.colors.dark={error:"rgba(255, 18, 18, 1)",warning:"rgba(18, 136, 18, 1)",info:"rgba(18, 18, 136, 1)"},this.colors.light={error:"rgb(255,51,51)",warning:"rgb(32,133,72)",info:"rgb(35,68,138)"},r.element.appendChild(this.canvas)}return f.prototype.$updateDecorators=function(r){var o=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light;if(r){this.maxHeight=r.maxHeight,this.lineHeight=r.lineHeight,this.canvasHeight=r.height;var s=(r.lastRow+1)*this.lineHeight;s<this.canvasHeight?this.heightRatio=1:this.heightRatio=this.canvasHeight/this.maxHeight}var a=this.canvas.getContext("2d");function i(O,w){return O.priority<w.priority?-1:O.priority>w.priority?1:0}var u=this.renderer.session.$annotations;if(a.clearRect(0,0,this.canvas.width,this.canvas.height),u){var h={info:1,warning:2,error:3};u.forEach(function(O){O.priority=h[O.type]||null}),u=u.sort(i);for(var y=this.renderer.session.$foldData,b=0;b<u.length;b++){var T=u[b].row,$=this.compensateFoldRows(T,y),A=Math.round((T-$)*this.lineHeight*this.heightRatio),S=Math.round((T-$)*this.lineHeight*this.heightRatio),M=Math.round(((T-$)*this.lineHeight+this.lineHeight)*this.heightRatio),R=M-S;if(R<this.minDecorationHeight){var L=(S+M)/2|0;L<this.halfMinDecorationHeight?L=this.halfMinDecorationHeight:L+this.halfMinDecorationHeight>this.canvasHeight&&(L=this.canvasHeight-this.halfMinDecorationHeight),S=Math.round(L-this.halfMinDecorationHeight),M=Math.round(L+this.halfMinDecorationHeight)}a.fillStyle=o[u[b].type]||null,a.fillRect(0,A,this.canvasWidth,M-S)}}var _=this.renderer.session.selection.getCursor();if(_){var $=this.compensateFoldRows(_.row,y),A=Math.round((_.row-$)*this.lineHeight*this.heightRatio);a.fillStyle="rgba(0, 0, 0, 0.5)",a.fillRect(0,A,this.canvasWidth,2)}},f.prototype.compensateFoldRows=function(r,o){var s=0;if(o&&o.length>0)for(var a=0;a<o.length;a++)r>o[a].start.row&&r<o[a].end.row?s+=r-o[a].start.row:r>=o[a].end.row&&(s+=o[a].end.row-o[a].start.row);return s},f})();g.implement(c.prototype,m),n.Decorator=c}),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent","ace/layer/text_util"],function(t,n,p){var d=t("./lib/oop"),g=t("./lib/dom"),m=t("./lib/lang"),c=t("./config"),f=t("./layer/gutter").Gutter,r=t("./layer/marker").Marker,o=t("./layer/text").Text,s=t("./layer/cursor").Cursor,a=t("./scrollbar").HScrollBar,i=t("./scrollbar").VScrollBar,u=t("./scrollbar_custom").HScrollBar,h=t("./scrollbar_custom").VScrollBar,y=t("./renderloop").RenderLoop,b=t("./layer/font_metrics").FontMetrics,T=t("./lib/event_emitter").EventEmitter,$=t("./css/editor-css"),A=t("./layer/decorators").Decorator,S=t("./lib/useragent"),M=t("./layer/text_util").isTextToken;g.importCssString($,"ace_editor.css",!1);var R=(function(){function L(_,O){var w=this;this.container=_||g.createElement("div"),g.addCssClass(this.container,"ace_editor"),g.HI_DPI&&g.addCssClass(this.container,"ace_hidpi"),this.setTheme(O),c.get("useStrictCSP")==null&&c.set("useStrictCSP",!1),this.$gutter=g.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden","true"),this.scroller=g.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=g.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new f(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new r(this.content);var v=this.$textLayer=new o(this.content);this.canvas=v.element,this.$markerFront=new r(this.content),this.$cursorLayer=new s(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new i(this.container,this),this.scrollBarH=new a(this.container,this),this.scrollBarV.on("scroll",function(C){w.$scrollAnimation||w.session.setScrollTop(C.data-w.scrollMargin.top)}),this.scrollBarH.on("scroll",function(C){w.$scrollAnimation||w.session.setScrollLeft(C.data-w.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new b(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(C){w.updateCharacterSize(),w.onResize(!0,w.gutterWidth,w.$size.width,w.$size.height),w._signal("changeCharacterSize",C)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!S.isIOS,this.$loop=new y(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),c.resetOptions(this),c._signal("renderer",this)}return L.prototype.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),g.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},L.prototype.setSession=function(_){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=_,_&&this.scrollMargin.top&&_.getScrollTop()<=0&&_.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(_),this.$markerBack.setSession(_),this.$markerFront.setSession(_),this.$gutterLayer.setSession(_),this.$textLayer.setSession(_),_&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},L.prototype.updateLines=function(_,O,w){if(O===void 0&&(O=1/0),this.$changedLines?(this.$changedLines.firstRow>_&&(this.$changedLines.firstRow=_),this.$changedLines.lastRow<O&&(this.$changedLines.lastRow=O)):this.$changedLines={firstRow:_,lastRow:O},this.$changedLines.lastRow<this.layerConfig.firstRow)if(w)this.$changedLines.lastRow=this.layerConfig.lastRow;else return;this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},L.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},L.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},L.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},L.prototype.updateFull=function(_){_?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},L.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},L.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},L.prototype.onResize=function(_,O,w,v){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=_?1:0;var C=this.container;v||(v=C.clientHeight||C.scrollHeight),!v&&this.$maxLines&&this.lineHeight>1&&(!C.style.height||C.style.height=="0px")&&(C.style.height="1px",v=C.clientHeight||C.scrollHeight),w||(w=C.clientWidth||C.scrollWidth);var E=this.$updateCachedSize(_,O,w,v);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!w&&!v)return this.resizing=0;_&&(this.$gutterLayer.$padding=null),_?this.$renderChanges(E|this.$changes,!0):this.$loop.schedule(E|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},L.prototype.$updateCachedSize=function(_,O,w,v){v-=this.$extraHeight||0;var C=0,E=this.$size,x={width:E.width,height:E.height,scrollerHeight:E.scrollerHeight,scrollerWidth:E.scrollerWidth};if(v&&(_||E.height!=v)&&(E.height=v,C|=this.CHANGE_SIZE,E.scrollerHeight=E.height,this.$horizScroll&&(E.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(E.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",C=C|this.CHANGE_SCROLL),w&&(_||E.width!=w)){C|=this.CHANGE_SIZE,E.width=w,O==null&&(O=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=O,g.setStyle(this.scrollBarH.element.style,"left",O+"px"),g.setStyle(this.scroller.style,"left",O+this.margin.left+"px"),E.scrollerWidth=Math.max(0,w-O-this.scrollBarV.getWidth()-this.margin.h),g.setStyle(this.$gutter.style,"left",this.margin.left+"px");var k=this.scrollBarV.getWidth()+"px";g.setStyle(this.scrollBarH.element.style,"right",k),g.setStyle(this.scroller.style,"right",k),g.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(E.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||_)&&(C|=this.CHANGE_FULL)}return E.$dirty=!w||!v,C&&this._signal("resize",x),C},L.prototype.onGutterResize=function(_){var O=this.$showGutter?_:0;O!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,O,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()?this.$loop.schedule(this.CHANGE_FULL):this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},L.prototype.adjustWrapLimit=function(){var _=this.$size.scrollerWidth-this.$padding*2,O=Math.floor(_/this.characterWidth);return this.session.adjustWrapLimit(O,this.$showPrintMargin&&this.$printMarginColumn)},L.prototype.setAnimatedScroll=function(_){this.setOption("animatedScroll",_)},L.prototype.getAnimatedScroll=function(){return this.$animatedScroll},L.prototype.setShowInvisibles=function(_){this.setOption("showInvisibles",_),this.session.$bidiHandler.setShowInvisibles(_)},L.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},L.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},L.prototype.setDisplayIndentGuides=function(_){this.setOption("displayIndentGuides",_)},L.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},L.prototype.setHighlightIndentGuides=function(_){this.setOption("highlightIndentGuides",_)},L.prototype.setShowPrintMargin=function(_){this.setOption("showPrintMargin",_)},L.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},L.prototype.setPrintMarginColumn=function(_){this.setOption("printMarginColumn",_)},L.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},L.prototype.getShowGutter=function(){return this.getOption("showGutter")},L.prototype.setShowGutter=function(_){return this.setOption("showGutter",_)},L.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},L.prototype.setFadeFoldWidgets=function(_){this.setOption("fadeFoldWidgets",_)},L.prototype.setHighlightGutterLine=function(_){this.setOption("highlightGutterLine",_)},L.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},L.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var _=g.createElement("div");_.className="ace_layer ace_print-margin-layer",this.$printMarginEl=g.createElement("div"),this.$printMarginEl.className="ace_print-margin",_.appendChild(this.$printMarginEl),this.content.insertBefore(_,this.content.firstChild)}var O=this.$printMarginEl.style;O.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",O.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&this.session.$wrap==-1&&this.adjustWrapLimit()}},L.prototype.getContainerElement=function(){return this.container},L.prototype.getMouseEventTarget=function(){return this.scroller},L.prototype.getTextAreaContainer=function(){return this.container},L.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var _=this.textarea.style,O=this.$composition;if(!this.$keepTextAreaAtCursor&&!O){g.translate(this.textarea,-100,0);return}var w=this.$cursorLayer.$pixelPos;if(w){O&&O.markerRange&&(w=this.$cursorLayer.getPixelPosition(O.markerRange.start,!0));var v=this.layerConfig,C=w.top,E=w.left;C-=v.offset;var x=O&&O.useTextareaForIME||S.isMobile?this.lineHeight:1;if(C<0||C>v.height-x){g.translate(this.textarea,0,0);return}var k=1,D=this.$size.height-x;if(!O)C+=this.lineHeight;else if(O.useTextareaForIME){var I=this.textarea.value;k=this.characterWidth*this.session.$getStringScreenWidth(I)[0]}else C+=this.lineHeight+2;E-=this.scrollLeft,E>this.$size.scrollerWidth-k&&(E=this.$size.scrollerWidth-k),E+=this.gutterWidth+this.margin.left,g.setStyle(_,"height",x+"px"),g.setStyle(_,"width",k+"px"),g.translate(this.textarea,Math.min(E,this.$size.scrollerWidth-k),Math.min(C,D))}}},L.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},L.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(this.layerConfig.offset===0?0:1)},L.prototype.getLastFullyVisibleRow=function(){var _=this.layerConfig,O=_.lastRow,w=this.session.documentToScreenRow(O,0)*_.lineHeight;return w-this.session.getScrollTop()>_.height-_.lineHeight?O-1:O},L.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},L.prototype.setPadding=function(_){this.$padding=_,this.$textLayer.setPadding(_),this.$cursorLayer.setPadding(_),this.$markerFront.setPadding(_),this.$markerBack.setPadding(_),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},L.prototype.setScrollMargin=function(_,O,w,v){var C=this.scrollMargin;C.top=_|0,C.bottom=O|0,C.right=v|0,C.left=w|0,C.v=C.top+C.bottom,C.h=C.left+C.right,C.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-C.top),this.updateFull()},L.prototype.setMargin=function(_,O,w,v){var C=this.margin;C.top=_|0,C.bottom=O|0,C.right=v|0,C.left=w|0,C.v=C.top+C.bottom,C.h=C.left+C.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},L.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},L.prototype.setHScrollBarAlwaysVisible=function(_){this.setOption("hScrollBarAlwaysVisible",_)},L.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},L.prototype.setVScrollBarAlwaysVisible=function(_){this.setOption("vScrollBarAlwaysVisible",_)},L.prototype.$updateScrollBarV=function(){var _=this.layerConfig.maxHeight,O=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(_-=(O-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>_-O&&(_=this.scrollTop+O,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(_+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},L.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},L.prototype.freeze=function(){this.$frozen=!0},L.prototype.unfreeze=function(){this.$frozen=!1},L.prototype.$renderChanges=function(_,O){if(this.$changes&&(_|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!_&&!O){this.$changes|=_;return}if(this.$size.$dirty)return this.$changes|=_,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",_),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var w=this.layerConfig;if(_&this.CHANGE_FULL||_&this.CHANGE_SIZE||_&this.CHANGE_TEXT||_&this.CHANGE_LINES||_&this.CHANGE_SCROLL||_&this.CHANGE_H_SCROLL){if(_|=this.$computeLayerConfig()|this.$loop.clear(),w.firstRow!=this.layerConfig.firstRow&&w.firstRowScreen==this.layerConfig.firstRowScreen){var v=this.scrollTop+(w.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;v>0&&(this.scrollTop=v,_=_|this.CHANGE_SCROLL,_|=this.$computeLayerConfig()|this.$loop.clear())}w=this.layerConfig,this.$updateScrollBarV(),_&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),g.translate(this.content,-this.scrollLeft,-w.offset);var C=w.width+2*this.$padding+"px",E=w.minHeight+"px";g.setStyle(this.content.style,"width",C),g.setStyle(this.content.style,"height",E)}if(_&this.CHANGE_H_SCROLL&&(g.translate(this.content,-this.scrollLeft,-w.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),_&this.CHANGE_FULL){this.$changedLines=null,this.$textLayer.update(w),this.$showGutter&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w),this.$markerBack.update(w),this.$markerFront.update(w),this.$cursorLayer.update(w),this.$moveTextAreaToCursor(),this._signal("afterRender",_);return}if(_&this.CHANGE_SCROLL){this.$changedLines=null,_&this.CHANGE_TEXT||_&this.CHANGE_LINES?this.$textLayer.update(w):this.$textLayer.scrollLines(w),this.$showGutter&&(_&this.CHANGE_GUTTER||_&this.CHANGE_LINES?this.$gutterLayer.update(w):this.$gutterLayer.scrollLines(w)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w),this.$markerBack.update(w),this.$markerFront.update(w),this.$cursorLayer.update(w),this.$moveTextAreaToCursor(),this._signal("afterRender",_);return}_&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(w),this.$showGutter&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)):_&this.CHANGE_LINES?((this.$updateLines()||_&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)):_&this.CHANGE_TEXT||_&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)):_&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)),_&this.CHANGE_CURSOR&&(this.$cursorLayer.update(w),this.$moveTextAreaToCursor()),_&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(w),_&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(w),this._signal("afterRender",_)},L.prototype.$autosize=function(){var _=this.session.getScreenLength()*this.lineHeight,O=this.$maxLines*this.lineHeight,w=Math.min(O,Math.max((this.$minLines||1)*this.lineHeight,_))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(w+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&w>this.$maxPixelHeight&&(w=this.$maxPixelHeight);var v=w<=2*this.lineHeight,C=!v&&_>O;if(w!=this.desiredHeight||this.$size.height!=this.desiredHeight||C!=this.$vScroll){C!=this.$vScroll&&(this.$vScroll=C,this.scrollBarV.setVisible(C));var E=this.container.clientWidth;this.container.style.height=w+"px",this.$updateCachedSize(!0,this.$gutterWidth,E,w),this.desiredHeight=w,this._signal("autosize")}},L.prototype.$computeLayerConfig=function(){var _=this.session,O=this.$size,w=O.height<=2*this.lineHeight,v=this.session.getScreenLength(),C=v*this.lineHeight,E=this.$getLongestLine(),x=!w&&(this.$hScrollBarAlwaysVisible||O.scrollerWidth-E-2*this.$padding<0),k=this.$horizScroll!==x;k&&(this.$horizScroll=x,this.scrollBarH.setVisible(x));var D=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var I=O.scrollerHeight+this.lineHeight,N=!this.$maxLines&&this.$scrollPastEnd?(O.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;C+=N;var P=this.scrollMargin;this.session.setScrollTop(Math.max(-P.top,Math.min(this.scrollTop,C-O.scrollerHeight+P.bottom))),this.session.setScrollLeft(Math.max(-P.left,Math.min(this.scrollLeft,E+2*this.$padding-O.scrollerWidth+P.right)));var z=!w&&(this.$vScrollBarAlwaysVisible||O.scrollerHeight-C+N<0||this.scrollTop>P.top),F=D!==z;F&&(this.$vScroll=z,this.scrollBarV.setVisible(z));var W=this.scrollTop%this.lineHeight,H=Math.ceil(I/this.lineHeight)-1,B=Math.max(0,Math.round((this.scrollTop-W)/this.lineHeight)),G=B+H,q,Y,V=this.lineHeight;B=_.screenToDocumentRow(B,0);var Z=_.getFoldLine(B);Z&&(B=Z.start.row),q=_.documentToScreenRow(B,0),Y=_.getRowLength(B)*V,G=Math.min(_.screenToDocumentRow(G,0),_.getLength()-1),I=O.scrollerHeight+_.getRowLength(G)*V+Y,W=this.scrollTop-q*V;var ue=0;return(this.layerConfig.width!=E||k)&&(ue=this.CHANGE_H_SCROLL),(k||F)&&(ue|=this.$updateCachedSize(!0,this.gutterWidth,O.width,O.height),this._signal("scrollbarVisibilityChanged"),F&&(E=this.$getLongestLine())),this.layerConfig={width:E,padding:this.$padding,firstRow:B,firstRowScreen:q,lastRow:G,lineHeight:V,characterWidth:this.characterWidth,minHeight:I,maxHeight:C,offset:W,gutterOffset:V?Math.max(0,Math.ceil((W+O.height-O.scrollerHeight)/V)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(E-this.$padding),ue},L.prototype.$updateLines=function(){if(this.$changedLines){var _=this.$changedLines.firstRow,O=this.$changedLines.lastRow;this.$changedLines=null;var w=this.layerConfig;if(!(_>w.lastRow+1)&&!(O<w.firstRow)){if(O===1/0){this.$showGutter&&this.$gutterLayer.update(w),this.$textLayer.update(w);return}return this.$textLayer.updateLines(w,_,O),!0}}},L.prototype.$getLongestLine=function(){var _=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(_+=1),this.$textLayer&&_>this.$textLayer.MAX_LINE_LENGTH&&(_=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(_*this.characterWidth))},L.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},L.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},L.prototype.addGutterDecoration=function(_,O){this.$gutterLayer.addGutterDecoration(_,O)},L.prototype.removeGutterDecoration=function(_,O){this.$gutterLayer.removeGutterDecoration(_,O)},L.prototype.updateBreakpoints=function(_){this._rows=_,this.$loop.schedule(this.CHANGE_GUTTER)},L.prototype.setAnnotations=function(_){this.$gutterLayer.setAnnotations(_),this.$loop.schedule(this.CHANGE_GUTTER)},L.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},L.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},L.prototype.showCursor=function(){this.$cursorLayer.showCursor()},L.prototype.scrollSelectionIntoView=function(_,O,w){this.scrollCursorIntoView(_,w),this.scrollCursorIntoView(O,w)},L.prototype.scrollCursorIntoView=function(_,O,w){if(this.$size.scrollerHeight!==0){var v=this.$cursorLayer.getPixelPosition(_),C=v.left,E=v.top,x=w&&w.top||0,k=w&&w.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var D=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;D+x>E?(O&&D+x>E+this.lineHeight&&(E-=O*this.$size.scrollerHeight),E===0&&(E=-this.scrollMargin.top),this.session.setScrollTop(E)):D+this.$size.scrollerHeight-k<E+this.lineHeight&&(O&&D+this.$size.scrollerHeight-k<E-this.lineHeight&&(E+=O*this.$size.scrollerHeight),this.session.setScrollTop(E+this.lineHeight+k-this.$size.scrollerHeight));var I=this.scrollLeft,N=2*this.layerConfig.characterWidth;C-N<I?(C-=N,C<this.$padding+N&&(C=-this.scrollMargin.left),this.session.setScrollLeft(C)):(C+=N,I+this.$size.scrollerWidth<C+this.characterWidth?this.session.setScrollLeft(Math.round(C+this.characterWidth-this.$size.scrollerWidth)):I<=this.$padding&&C-I<this.characterWidth&&this.session.setScrollLeft(0))}},L.prototype.getScrollTop=function(){return this.session.getScrollTop()},L.prototype.getScrollLeft=function(){return this.session.getScrollLeft()},L.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},L.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},L.prototype.scrollToRow=function(_){this.session.setScrollTop(_*this.lineHeight)},L.prototype.alignCursor=function(_,O){typeof _=="number"&&(_={row:_,column:0});var w=this.$cursorLayer.getPixelPosition(_),v=this.$size.scrollerHeight-this.lineHeight,C=w.top-v*(O||0);return this.session.setScrollTop(C),C},L.prototype.$calcSteps=function(_,O){var w=0,v=this.STEPS,C=[],E=function(x,k,D){return D*(Math.pow(x-1,3)+1)+k};for(w=0;w<v;++w)C.push(E(w/this.STEPS,_,O-_));return C},L.prototype.scrollToLine=function(_,O,w,v){var C=this.$cursorLayer.getPixelPosition({row:_,column:0}),E=C.top;O&&(E-=this.$size.scrollerHeight/2);var x=this.scrollTop;this.session.setScrollTop(E),w!==!1&&this.animateScrolling(x,v)},L.prototype.animateScrolling=function(_,O){var w=this.scrollTop;if(!this.$animatedScroll)return;var v=this;if(_==w)return;if(this.$scrollAnimation){var C=this.$scrollAnimation.steps;if(C.length&&(_=C[0],_==w))return}var E=v.$calcSteps(_,w);this.$scrollAnimation={from:_,to:w,steps:E},clearInterval(this.$timer),v.session.setScrollTop(E.shift()),v.session.$scrollTop=w;function x(){v.$timer=clearInterval(v.$timer),v.$scrollAnimation=null,v.$stopAnimation=!1,O&&O()}this.$timer=setInterval(function(){if(v.$stopAnimation){x();return}if(!v.session)return clearInterval(v.$timer);E.length?(v.session.setScrollTop(E.shift()),v.session.$scrollTop=w):w!=null?(v.session.$scrollTop=-1,v.session.setScrollTop(w),w=null):x()},10)},L.prototype.scrollToY=function(_){this.scrollTop!==_&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=_)},L.prototype.scrollToX=function(_){this.scrollLeft!==_&&(this.scrollLeft=_),this.$loop.schedule(this.CHANGE_H_SCROLL)},L.prototype.scrollTo=function(_,O){this.session.setScrollTop(O),this.session.setScrollLeft(_)},L.prototype.scrollBy=function(_,O){O&&this.session.setScrollTop(this.session.getScrollTop()+O),_&&this.session.setScrollLeft(this.session.getScrollLeft()+_)},L.prototype.isScrollableBy=function(_,O){if(O<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||O>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||_<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||_>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},L.prototype.pixelToScreenCoordinates=function(_,O){var w;if(this.$hasCssTransforms){w={top:0,left:0};var v=this.$fontMetrics.transformCoordinates([_,O]);_=v[1]-this.gutterWidth-this.margin.left,O=v[0]}else w=this.scroller.getBoundingClientRect();var C=_+this.scrollLeft-w.left-this.$padding,E=C/this.characterWidth,x=Math.floor((O+this.scrollTop-w.top)/this.lineHeight),k=this.$blockCursor?Math.floor(E):Math.round(E);return{row:x,column:k,side:E-k>0?1:-1,offsetX:C}},L.prototype.screenToTextCoordinates=function(_,O){var w;if(this.$hasCssTransforms){w={top:0,left:0};var v=this.$fontMetrics.transformCoordinates([_,O]);_=v[1]-this.gutterWidth-this.margin.left,O=v[0]}else w=this.scroller.getBoundingClientRect();var C=_+this.scrollLeft-w.left-this.$padding,E=C/this.characterWidth,x=this.$blockCursor?Math.floor(E):Math.round(E),k=Math.floor((O+this.scrollTop-w.top)/this.lineHeight);return this.session.screenToDocumentPosition(k,Math.max(x,0),C)},L.prototype.textToScreenCoordinates=function(_,O){var w=this.scroller.getBoundingClientRect(),v=this.session.documentToScreenPosition(_,O),C=this.$padding+(this.session.$bidiHandler.isBidiRow(v.row,_)?this.session.$bidiHandler.getPosLeft(v.column):Math.round(v.column*this.characterWidth)),E=v.row*this.lineHeight;return{pageX:w.left+C-this.scrollLeft,pageY:w.top+E-this.scrollTop}},L.prototype.visualizeFocus=function(){g.addCssClass(this.container,"ace_focus")},L.prototype.visualizeBlur=function(){g.removeCssClass(this.container,"ace_focus")},L.prototype.showComposition=function(_){this.$composition=_,_.cssText||(_.cssText=this.textarea.style.cssText),_.useTextareaForIME==null&&(_.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(g.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):_.markerId=this.session.addMarker(_.markerRange,"ace_composition_marker","text")},L.prototype.setCompositionText=function(_){var O=this.session.selection.cursor;this.addToken(_,"composition_placeholder",O.row,O.column),this.$moveTextAreaToCursor()},L.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),g.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var _=this.session.selection.cursor;this.removeExtraToken(_.row,_.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},L.prototype.setGhostText=function(_,O){var w=this.session.selection.cursor,v=O||{row:w.row,column:w.column};this.removeGhostText();var C=this.$calculateWrappedTextChunks(_,v);this.addToken(C[0].text,"ghost_text",v.row,v.column),this.$ghostText={text:_,position:{row:v.row,column:v.column}};var E=g.createElement("div");if(C.length>1){var x=this.hideTokensAfterPosition(v.row,v.column),k;C.slice(1).forEach(function(F){var W=g.createElement("div"),H=g.createElement("span");H.className="ace_ghost_text",F.wrapped&&(W.className="ghost_text_line_wrapped"),F.text.length===0&&(F.text=" "),H.appendChild(g.createTextNode(F.text)),W.appendChild(H),E.appendChild(W),k=W}),x.forEach(function(F){var W=g.createElement("span");M(F.type)||(W.className="ace_"+F.type.replace(/\./g," ace_")),W.appendChild(g.createTextNode(F.value)),k.appendChild(W)}),this.$ghostTextWidget={el:E,row:v.row,column:v.column,className:"ace_ghost_text_container"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var D=this.$cursorLayer.getPixelPosition(v,!0),I=this.container,N=I.getBoundingClientRect().height,P=C.length*this.lineHeight,z=P<N-D.top;if(z)return;P<N?this.scrollBy(0,(C.length-1)*this.lineHeight):this.scrollToRow(v.row)}},L.prototype.$calculateWrappedTextChunks=function(_,O){var w=this.$size.scrollerWidth-this.$padding*2,v=Math.floor(w/this.characterWidth)-2;v=v<=0?60:v;for(var C=_.split(/\r?\n/),E=[],x=0;x<C.length;x++){var k=this.session.$getDisplayTokens(C[x],O.column),D=this.session.$computeWrapSplits(k,v,this.session.$tabSize);if(D.length>0){var I=0;D.push(C[x].length);for(var N=0;N<D.length;N++){var P=C[x].slice(I,D[N]);E.push({text:P,wrapped:!0}),I=D[N]}}else E.push({text:C[x],wrapped:!1})}return E},L.prototype.removeGhostText=function(){if(this.$ghostText){var _=this.$ghostText.position;this.removeExtraToken(_.row,_.column),this.$ghostTextWidget&&(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),this.$ghostTextWidget=null),this.$ghostText=null}},L.prototype.addToken=function(_,O,w,v){var C=this.session;C.bgTokenizer.lines[w]=null;var E={type:O,value:_},x=C.getTokens(w);if(v==null||!x.length)x.push(E);else for(var k=0,D=0;D<x.length;D++){var I=x[D];if(k+=I.value.length,v<=k){var N=I.value.length-(k-v),P=I.value.slice(0,N),z=I.value.slice(N);x.splice(D,1,{type:I.type,value:P},E,{type:I.type,value:z});break}}this.updateLines(w,w)},L.prototype.hideTokensAfterPosition=function(_,O){for(var w=this.session.getTokens(_),v=0,C=!1,E=[],x=0;x<w.length;x++){var k=w[x];if(v+=k.value.length,k.type!=="ghost_text"){if(C){E.push({type:k.type,value:k.value}),k.type="hidden_token";continue}v===O&&(C=!0)}}return this.updateLines(_,_),E},L.prototype.removeExtraToken=function(_,O){this.session.bgTokenizer.lines[_]=null,this.updateLines(_,_)},L.prototype.setTheme=function(_,O){var w=this;if(this.$themeId=_,w._dispatchEvent("themeChange",{theme:_}),!_||typeof _=="string"){var v=_||this.$options.theme.initialValue;c.loadModule(["theme",v],C)}else C(_);function C(E){if(w.$themeId!=_)return O&&O();if(!E||!E.cssClass)throw new Error("couldn't load module "+_+" or it didn't call define");E.$id&&(w.$themeId=E.$id),g.importCssString(E.cssText,E.cssClass,w.container),w.theme&&g.removeCssClass(w.container,w.theme.cssClass);var x="padding"in E?E.padding:"padding"in(w.theme||{})?4:w.$padding;w.$padding&&x!=w.$padding&&w.setPadding(x),w.$theme=E.cssClass,w.theme=E,g.addCssClass(w.container,E.cssClass),g.setCssClass(w.container,"ace_dark",E.isDark),w.$size&&(w.$size.width=0,w.$updateSizeAsync()),w._dispatchEvent("themeLoaded",{theme:E}),O&&O(),S.isSafari&&w.scroller&&(w.scroller.style.background="red",w.scroller.style.background="")}},L.prototype.getTheme=function(){return this.$themeId},L.prototype.setStyle=function(_,O){g.setCssClass(this.container,_,O!==!1)},L.prototype.unsetStyle=function(_){g.removeCssClass(this.container,_)},L.prototype.setCursorStyle=function(_){g.setStyle(this.scroller.style,"cursor",_)},L.prototype.setMouseCursor=function(_){g.setStyle(this.scroller.style,"cursor",_)},L.prototype.attachToShadowRoot=function(){g.importCssString($,"ace_editor.css",this.container)},L.prototype.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent="",this.setOption("useResizeObserver",!1)},L.prototype.$updateCustomScrollbar=function(_){var O=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),this.$scrollDecorator&&delete this.$scrollDecorator,_===!0?(this.scrollBarV=new h(this.container,this),this.scrollBarH=new u(this.container,this),this.scrollBarV.setHeight(this.$size.scrollerHeight),this.scrollBarH.setWidth(this.$size.scrollerWidth),this.scrollBarV.addEventListener("scroll",function(w){O.$scrollAnimation||O.session.setScrollTop(w.data-O.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(w){O.$scrollAnimation||O.session.setScrollLeft(w.data-O.scrollMargin.left)}),this.$scrollDecorator=new A(this.scrollBarV,this),this.$scrollDecorator.$updateDecorators()):(this.scrollBarV=new i(this.container,this),this.scrollBarH=new a(this.container,this),this.scrollBarV.addEventListener("scroll",function(w){O.$scrollAnimation||O.session.setScrollTop(w.data-O.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(w){O.$scrollAnimation||O.session.setScrollLeft(w.data-O.scrollMargin.left)}))},L.prototype.$addResizeObserver=function(){if(!(!window.ResizeObserver||this.$resizeObserver)){var _=this;this.$resizeTimer=m.delayedCall(function(){_.destroyed||_.onResize()},50),this.$resizeObserver=new window.ResizeObserver(function(O){var w=O[0].contentRect.width,v=O[0].contentRect.height;Math.abs(_.$size.width-w)>1||Math.abs(_.$size.height-v)>1?_.$resizeTimer.delay():_.$resizeTimer.cancel()}),this.$resizeObserver.observe(this.container)}},L})();R.prototype.CHANGE_CURSOR=1,R.prototype.CHANGE_MARKER=2,R.prototype.CHANGE_GUTTER=4,R.prototype.CHANGE_SCROLL=8,R.prototype.CHANGE_LINES=16,R.prototype.CHANGE_TEXT=32,R.prototype.CHANGE_SIZE=64,R.prototype.CHANGE_MARKER_BACK=128,R.prototype.CHANGE_MARKER_FRONT=256,R.prototype.CHANGE_FULL=512,R.prototype.CHANGE_H_SCROLL=1024,R.prototype.$changes=0,R.prototype.$padding=null,R.prototype.$frozen=!1,R.prototype.STEPS=8,d.implement(R.prototype,T),c.defineOptions(R.prototype,"renderer",{useResizeObserver:{set:function(L){!L&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):L&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(L){this.$textLayer.setShowInvisibles(L)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(L){typeof L=="number"&&(this.$printMarginColumn=L),this.$showPrintMargin=!!L,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(L){this.$gutter.style.display=L?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(L){this.$gutterLayer.$useSvgGutterIcons=L},initialValue:!1},showFoldedAnnotations:{set:function(L){this.$gutterLayer.$showFoldedAnnotations=L},initialValue:!1},fadeFoldWidgets:{set:function(L){g.setCssClass(this.$gutter,"ace_fade-fold-widgets",L)},initialValue:!1},showFoldWidgets:{set:function(L){this.$gutterLayer.setShowFoldWidgets(L),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(L){this.$textLayer.setDisplayIndentGuides(L)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(L){this.$textLayer.setHighlightIndentGuides(L)==!0?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(L){this.$gutterLayer.setHighlightGutterLine(L),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(L){(!this.$hScrollBarAlwaysVisible||!this.$horizScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(L){(!this.$vScrollBarAlwaysVisible||!this.$vScroll)&&this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(L){typeof L=="number"&&(L=L+"px"),this.container.style.fontSize=L,this.updateFontSize()},initialValue:12},fontFamily:{set:function(L){this.container.style.fontFamily=L,this.updateFontSize()}},maxLines:{set:function(L){this.updateFull()}},minLines:{set:function(L){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(L){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(L){L=+L||0,this.$scrollPastEnd!=L&&(this.$scrollPastEnd=L,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(L){this.$gutterLayer.$fixedWidth=!!L,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(L){this.$updateCustomScrollbar(L)},initialValue:!1},theme:{set:function(L){this.setTheme(L)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!S.isMobile&&!S.isIE}}),n.VirtualRenderer=R}),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],function(t,n,p){var d=t("../lib/oop"),g=t("../lib/net"),m=t("../lib/event_emitter").EventEmitter,c=t("../config");function f(a){var i="importScripts('"+g.qualifyURL(a)+"');";try{return new Blob([i],{type:"application/javascript"})}catch{var u=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,h=new u;return h.append(i),h.getBlob("application/javascript")}}function r(a){if(typeof Worker>"u")return{postMessage:function(){},terminate:function(){}};if(c.get("loadWorkerFromBlob")){var i=f(a),u=window.URL||window.webkitURL,h=u.createObjectURL(i);return new Worker(h)}return new Worker(a)}var o=function(a){a.postMessage||(a=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=a,this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){d.implement(this,m),this.$createWorkerFromOldConfig=function(a,i,u,h,y){if(t.nameToUrl&&!t.toUrl&&(t.toUrl=t.nameToUrl),c.get("packaged")||!t.toUrl)h=h||c.moduleUrl(i,"worker");else{var b=this.$normalizePath;h=h||b(t.toUrl("ace/worker/worker.js",null,"_"));var T={};a.forEach(function($){T[$]=b(t.toUrl($,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=r(h),y&&this.send("importScripts",y),this.$worker.postMessage({init:!0,tlns:T,module:i,classname:u}),this.$worker},this.onMessage=function(a){var i=a.data;switch(i.type){case"event":this._signal(i.name,{data:i.data});break;case"call":var u=this.callbacks[i.id];u&&(u(i.data),delete this.callbacks[i.id]);break;case"error":this.reportError(i.data);break;case"log":window.console&&console.log&&console.log.apply(console,i.data);break}},this.reportError=function(a){window.console&&console.error&&console.error(a)},this.$normalizePath=function(a){return g.qualifyURL(a)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(a){a.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(a,i){this.$worker.postMessage({command:a,args:i})},this.call=function(a,i,u){if(u){var h=this.callbackId++;this.callbacks[h]=u,i.push(h)}this.send(a,i)},this.emit=function(a,i){try{i.data&&i.data.err&&(i.data.err={message:i.data.err.message,stack:i.data.err.stack,code:i.data.err.code}),this.$worker&&this.$worker.postMessage({event:a,data:{data:i.data}})}catch(u){console.error(u.stack)}},this.attachToDocument=function(a){this.$doc&&this.terminate(),this.$doc=a,this.call("setValue",[a.getValue()]),a.on("change",this.changeListener,!0)},this.changeListener=function(a){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),a.action=="insert"?this.deltaQueue.push(a.start,a.lines):this.deltaQueue.push(a.start,a.end)},this.$sendDeltaQueue=function(){var a=this.deltaQueue;a&&(this.deltaQueue=null,a.length>50&&a.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:a}))}}).call(o.prototype);var s=function(a,i,u){var h=null,y=!1,b=Object.create(m),T=[],$=new o({messageBuffer:T,terminate:function(){},postMessage:function(S){T.push(S),h&&(y?setTimeout(A):A())}});$.setEmitSync=function(S){y=S};var A=function(){var S=T.shift();S.command?h[S.command].apply(h,S.args):S.event&&b._signal(S.event,S.data)};return b.postMessage=function(S){$.onMessage({data:S})},b.callback=function(S,M){this.postMessage({type:"call",id:M,data:S})},b.emit=function(S,M){this.postMessage({type:"event",name:S,data:M})},c.loadModule(["worker",i],function(S){for(h=new S[u](b);T.length;)A()}),$};n.UIWorkerClient=s,n.WorkerClient=o,n.createWorker=r}),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],function(t,n,p){var d=t("./range").Range,g=t("./lib/event_emitter").EventEmitter,m=t("./lib/oop"),c=(function(){function f(r,o,s,a,i,u){var h=this;this.length=o,this.session=r,this.doc=r.getDocument(),this.mainClass=i,this.othersClass=u,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=a,this.$onCursorChange=function(){setTimeout(function(){h.onCursorChange()})},this.$pos=s;var y=r.getUndoManager().$undoStack||r.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=y.length,this.setup(),r.selection.on("changeCursor",this.$onCursorChange)}return f.prototype.setup=function(){var r=this,o=this.doc,s=this.session;this.selectionBefore=s.selection.toJSON(),s.selection.inMultiSelectMode&&s.selection.toSingleRange(),this.pos=o.createAnchor(this.$pos.row,this.$pos.column);var a=this.pos;a.$insertRight=!0,a.detach(),a.markerId=s.addMarker(new d(a.row,a.column,a.row,a.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(i){var u=o.createAnchor(i.row,i.column);u.$insertRight=!0,u.detach(),r.others.push(u)}),s.setUndoSelect(!1)},f.prototype.showOtherMarkers=function(){if(!this.othersActive){var r=this.session,o=this;this.othersActive=!0,this.others.forEach(function(s){s.markerId=r.addMarker(new d(s.row,s.column,s.row,s.column+o.length),o.othersClass,null,!1)})}},f.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var r=0;r<this.others.length;r++)this.session.removeMarker(this.others[r].markerId)}},f.prototype.onUpdate=function(r){if(this.$updating)return this.updateAnchors(r);var o=r;if(o.start.row===o.end.row&&o.start.row===this.pos.row){this.$updating=!0;var s=r.action==="insert"?o.end.column-o.start.column:o.start.column-o.end.column,a=o.start.column>=this.pos.column&&o.start.column<=this.pos.column+this.length+1,i=o.start.column-this.pos.column;if(this.updateAnchors(r),a&&(this.length+=s),a&&!this.session.$fromUndo){if(r.action==="insert")for(var u=this.others.length-1;u>=0;u--){var h=this.others[u],y={row:h.row,column:h.column+i};this.doc.insertMergedLines(y,r.lines)}else if(r.action==="remove")for(var u=this.others.length-1;u>=0;u--){var h=this.others[u],y={row:h.row,column:h.column+i};this.doc.remove(new d(y.row,y.column,y.row,y.column-s))}}this.$updating=!1,this.updateMarkers()}},f.prototype.updateAnchors=function(r){this.pos.onChange(r);for(var o=this.others.length;o--;)this.others[o].onChange(r);this.updateMarkers()},f.prototype.updateMarkers=function(){if(!this.$updating){var r=this,o=this.session,s=function(i,u){o.removeMarker(i.markerId),i.markerId=o.addMarker(new d(i.row,i.column,i.row,i.column+r.length),u,null,!1)};s(this.pos,this.mainClass);for(var a=this.others.length;a--;)s(this.others[a],this.othersClass)}},f.prototype.onCursorChange=function(r){if(!(this.$updating||!this.session)){var o=this.session.selection.getCursor();o.row===this.pos.row&&o.column>=this.pos.column&&o.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",r)):(this.hideOtherMarkers(),this._emit("cursorLeave",r))}},f.prototype.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},f.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var r=this.session.getUndoManager(),o=(r.$undoStack||r.$undostack).length-this.$undoStackDepth,s=0;s<o;s++)r.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},f})();m.implement(c.prototype,g),n.PlaceHolder=c}),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(t,n,p){var d=t("../lib/event"),g=t("../lib/useragent");function m(f,r){return f.row==r.row&&f.column==r.column}function c(f){var r=f.domEvent,o=r.altKey,s=r.shiftKey,a=r.ctrlKey,i=f.getAccelKey(),u=f.getButton();if(a&&g.isMac&&(u=r.button),f.editor.inMultiSelectMode&&u==2){f.editor.textInput.onContextMenu(f.domEvent);return}if(!a&&!o&&!i){u===0&&f.editor.inMultiSelectMode&&f.editor.exitMultiSelectMode();return}if(u===0){var h=f.editor,y=h.selection,b=h.inMultiSelectMode,T=f.getDocumentPosition(),$=y.getCursor(),A=f.inSelection()||y.isEmpty()&&m(T,$),S=f.x,M=f.y,R=function(P){S=P.clientX,M=P.clientY},L=h.session,_=h.renderer.pixelToScreenCoordinates(S,M),O=_,w;if(h.$mouseHandler.$enableJumpToDef)a&&o||i&&o?w=s?"block":"add":o&&h.$blockSelectEnabled&&(w="block");else if(i&&!o){if(w="add",!b&&s)return}else o&&h.$blockSelectEnabled&&(w="block");if(w&&g.isMac&&r.ctrlKey&&h.$mouseHandler.cancelContextMenu(),w=="add"){if(!b&&A)return;if(!b){var v=y.toOrientedRange();h.addSelectionMarker(v)}var C=y.rangeList.rangeAtPoint(T);h.inVirtualSelectionMode=!0,s&&(C=null,v=y.ranges[0]||v,h.removeSelectionMarker(v)),h.once("mouseup",function(){var P=y.toOrientedRange();C&&P.isEmpty()&&m(C.cursor,P.cursor)?y.substractPoint(P.cursor):(s?y.substractPoint(v.cursor):v&&(h.removeSelectionMarker(v),y.addRange(v)),y.addRange(P)),h.inVirtualSelectionMode=!1})}else if(w=="block"){f.stop(),h.inVirtualSelectionMode=!0;var E,x=[],k=function(){var P=h.renderer.pixelToScreenCoordinates(S,M),z=L.screenToDocumentPosition(P.row,P.column,P.offsetX);m(O,P)&&m(z,y.lead)||(O=P,h.selection.moveToPosition(z),h.renderer.scrollCursorIntoView(),h.removeSelectionMarkers(x),x=y.rectangularRangeBlock(O,_),h.$mouseHandler.$clickSelection&&x.length==1&&x[0].isEmpty()&&(x[0]=h.$mouseHandler.$clickSelection.clone()),x.forEach(h.addSelectionMarker,h),h.updateSelectionMarkers())};b&&!i?y.toSingleRange():!b&&i&&(E=y.toOrientedRange(),h.addSelectionMarker(E)),s?_=L.documentToScreenPosition(y.lead):y.moveToPosition(T),O={row:-1,column:-1};var D=function(P){k(),clearInterval(N),h.removeSelectionMarkers(x),x.length||(x=[y.toOrientedRange()]),E&&(h.removeSelectionMarker(E),y.toSingleRange(E));for(var z=0;z<x.length;z++)y.addRange(x[z]);h.inVirtualSelectionMode=!1,h.$mouseHandler.$clickSelection=null},I=k;d.capture(h.container,R,D);var N=setInterval(function(){I()},20);return f.preventDefault()}}}n.onMouseDown=c}),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(t,n,p){n.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(g){g.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(g){g.selectMoreLines(1)},bindKey:{win:"Ctrl-Alt-Down",mac:"Ctrl-Alt-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorAboveSkipCurrent",description:"Add cursor above (skip current)",exec:function(g){g.selectMoreLines(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Up",mac:"Ctrl-Alt-Shift-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelowSkipCurrent",description:"Add cursor below (skip current)",exec:function(g){g.selectMoreLines(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Down",mac:"Ctrl-Alt-Shift-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreBefore",description:"Select more before",exec:function(g){g.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(g){g.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(g){g.selectMore(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Left",mac:"Ctrl-Alt-Shift-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextAfter",description:"Select next after",exec:function(g){g.selectMore(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"toggleSplitSelectionIntoLines",description:"Split selection into lines",exec:function(g){g.multiSelect.rangeCount>1?g.multiSelect.joinSelections():g.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(g){g.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(g){g.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(g){g.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],n.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(g){g.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(g){return g&&g.inMultiSelectMode}}];var d=t("../keyboard/hash_handler").HashHandler;n.keyboardHandler=new d(n.multiSelectCommands)}),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],function(t,n,p){var d=t("./range_list").RangeList,g=t("./range").Range,m=t("./selection").Selection,c=t("./mouse/multi_select_handler").onMouseDown,f=t("./lib/event"),r=t("./lib/lang"),o=t("./commands/multi_select_commands");n.commands=o.defaultCommands.concat(o.multiSelectCommands);var s=t("./search").Search,a=new s;function i($,A,S){return a.$options.wrap=!0,a.$options.needle=A,a.$options.backwards=S==-1,a.find($)}var u=t("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(u.prototype),(function(){this.ranges=null,this.rangeList=null,this.addRange=function($,A){if($){if(!this.inMultiSelectMode&&this.rangeCount===0){var S=this.toOrientedRange();if(this.rangeList.add(S),this.rangeList.add($),this.rangeList.ranges.length!=2)return this.rangeList.removeAll(),A||this.fromOrientedRange($);this.rangeList.removeAll(),this.rangeList.add(S),this.$onAddRange(S)}$.cursor||($.cursor=$.end);var M=this.rangeList.add($);return this.$onAddRange($),M.length&&this.$onRemoveRange(M),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),A||this.fromOrientedRange($)}},this.toSingleRange=function($){$=$||this.ranges[0];var A=this.rangeList.removeAll();A.length&&this.$onRemoveRange(A),$&&this.fromOrientedRange($)},this.substractPoint=function($){var A=this.rangeList.substractPoint($);if(A)return this.$onRemoveRange(A),A[0]},this.mergeOverlappingRanges=function(){var $=this.rangeList.merge();$.length&&this.$onRemoveRange($)},this.$onAddRange=function($){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift($),this._signal("addRange",{range:$})},this.$onRemoveRange=function($){if(this.rangeCount=this.rangeList.ranges.length,this.rangeCount==1&&this.inMultiSelectMode){var A=this.rangeList.ranges.pop();$.push(A),this.rangeCount=0}for(var S=$.length;S--;){var M=this.ranges.indexOf($[S]);this.ranges.splice(M,1)}this._signal("removeRange",{ranges:$}),this.rangeCount===0&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),A=A||this.ranges[0],A&&!A.isEqual(this.getRange())&&this.fromOrientedRange(A)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new d,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var $=this.ranges.length?this.ranges:[this.getRange()],A=[],S=0;S<$.length;S++){var M=$[S],R=M.start.row,L=M.end.row;if(R===L)A.push(M.clone());else{for(A.push(new g(R,M.start.column,R,this.session.getLine(R).length));++R<L;)A.push(this.getLineRange(R,!0));A.push(new g(L,0,L,M.end.column))}S==0&&!this.isBackwards()&&(A=A.reverse())}this.toSingleRange();for(var S=A.length;S--;)this.addRange(A[S])},this.joinSelections=function(){var $=this.rangeList.ranges,A=$[$.length-1],S=g.fromPoints($[0].start,A.end);this.toSingleRange(),this.setSelectionRange(S,A.cursor==A.start)},this.toggleBlockSelection=function(){if(this.rangeCount>1){var $=this.rangeList.ranges,A=$[$.length-1],S=g.fromPoints($[0].start,A.end);this.toSingleRange(),this.setSelectionRange(S,A.cursor==A.start)}else{var M=this.session.documentToScreenPosition(this.cursor),R=this.session.documentToScreenPosition(this.anchor),L=this.rectangularRangeBlock(M,R);L.forEach(this.addRange,this)}},this.rectangularRangeBlock=function($,A,S){var M=[],R=$.column<A.column;if(R)var L=$.column,_=A.column,O=$.offsetX,w=A.offsetX;else var L=A.column,_=$.column,O=A.offsetX,w=$.offsetX;var v=$.row<A.row;if(v)var C=$.row,E=A.row;else var C=A.row,E=$.row;L<0&&(L=0),C<0&&(C=0),C==E&&(S=!0);for(var x,k=C;k<=E;k++){var D=g.fromPoints(this.session.screenToDocumentPosition(k,L,O),this.session.screenToDocumentPosition(k,_,w));if(D.isEmpty()){if(x&&y(D.end,x))break;x=D.end}D.cursor=R?D.start:D.end,M.push(D)}if(v&&M.reverse(),!S){for(var I=M.length-1;M[I].isEmpty()&&I>0;)I--;if(I>0)for(var N=0;M[N].isEmpty();)N++;for(var P=I;P>=N;P--)M[P].isEmpty()&&M.splice(P,1)}return M}}).call(m.prototype);var h=t("./editor").Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function($){$.cursor||($.cursor=$.end);var A=this.getSelectionStyle();return $.marker=this.session.addMarker($,"ace_selection",A),this.session.$selectionMarkers.push($),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,$},this.removeSelectionMarker=function($){if($.marker){this.session.removeMarker($.marker);var A=this.session.$selectionMarkers.indexOf($);A!=-1&&this.session.$selectionMarkers.splice(A,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function($){for(var A=this.session.$selectionMarkers,S=$.length;S--;){var M=$[S];if(M.marker){this.session.removeMarker(M.marker);var R=A.indexOf(M);R!=-1&&A.splice(R,1)}}this.session.selectionMarkerCount=A.length},this.$onAddRange=function($){this.addSelectionMarker($.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function($){this.removeSelectionMarkers($.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function($){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(o.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function($){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(o.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function($){var A=$.command,S=$.editor;if(S.multiSelect){if(A.multiSelectAction)A.multiSelectAction=="forEach"?M=S.forEachSelection(A,$.args):A.multiSelectAction=="forEachLine"?M=S.forEachSelection(A,$.args,!0):A.multiSelectAction=="single"?(S.exitMultiSelectMode(),M=A.exec(S,$.args||{})):M=A.multiSelectAction(S,$.args||{});else{var M=A.exec(S,$.args||{});S.multiSelect.addRange(S.multiSelect.toOrientedRange()),S.multiSelect.mergeOverlappingRanges()}return M}},this.forEachSelection=function($,A,S){if(!this.inVirtualSelectionMode){var M=S&&S.keepOrder,R=S==!0||S&&S.$byLines,L=this.session,_=this.selection,O=_.rangeList,w=(M?_:O).ranges,v;if(!w.length)return $.exec?$.exec(this,A||{}):$(this,A||{});var C=_._eventRegistry;_._eventRegistry={};var E=new m(L);this.inVirtualSelectionMode=!0;for(var x=w.length;x--;){if(R)for(;x>0&&w[x].start.row==w[x-1].end.row;)x--;E.fromOrientedRange(w[x]),E.index=x,this.selection=L.selection=E;var k=$.exec?$.exec(this,A||{}):$(this,A||{});!v&&k!==void 0&&(v=k),E.toOrientedRange(w[x])}E.detach(),this.selection=L.selection=_,this.inVirtualSelectionMode=!1,_._eventRegistry=C,_.mergeOverlappingRanges(),_.ranges[0]&&_.fromOrientedRange(_.ranges[0]);var D=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),D&&D.from==D.to&&this.renderer.animateScrolling(D.from),v}},this.exitMultiSelectMode=function(){!this.inMultiSelectMode||this.inVirtualSelectionMode||this.multiSelect.toSingleRange()},this.getSelectedText=function(){var $="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var A=this.multiSelect.rangeList.ranges,S=[],M=0;M<A.length;M++)S.push(this.session.getTextRange(A[M]));var R=this.session.getDocument().getNewLineCharacter();$=S.join(R),$.length==(S.length-1)*R.length&&($="")}else this.selection.isEmpty()||($=this.session.getTextRange(this.getSelectionRange()));return $},this.$checkMultiselectChange=function($,A){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var S=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&A==this.multiSelect.anchor)return;var M=A==this.multiSelect.anchor?S.cursor==S.start?S.end:S.start:S.cursor;M.row!=A.row||this.session.$clipPositionToDocument(M.row,M.column).column!=A.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function($,A,S){if(A=A||{},A.needle=$||A.needle,A.needle==null){var M=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();A.needle=this.session.getTextRange(M)}this.$search.set(A);var R=this.$search.findAll(this.session);if(!R.length)return 0;var L=this.multiSelect;S||L.toSingleRange(R[0]);for(var _=R.length;_--;)L.addRange(R[_],!0);return M&&L.rangeList.rangeAtPoint(M.start)&&L.addRange(M,!0),R.length},this.selectMoreLines=function($,A){var S=this.selection.toOrientedRange(),M=S.cursor==S.end,R=this.session.documentToScreenPosition(S.cursor);this.selection.$desiredColumn&&(R.column=this.selection.$desiredColumn);var L=this.session.screenToDocumentPosition(R.row+$,R.column);if(S.isEmpty())var O=L;else var _=this.session.documentToScreenPosition(M?S.end:S.start),O=this.session.screenToDocumentPosition(_.row+$,_.column);if(M){var w=g.fromPoints(L,O);w.cursor=w.start}else{var w=g.fromPoints(O,L);w.cursor=w.end}if(w.desiredColumn=R.column,!this.selection.inMultiSelectMode)this.selection.addRange(S);else if(A)var v=S.cursor;this.selection.addRange(w),v&&this.selection.substractPoint(v)},this.transposeSelections=function($){for(var A=this.session,S=A.multiSelect,M=S.ranges,R=M.length;R--;){var L=M[R];if(L.isEmpty()){var _=A.getWordRange(L.start.row,L.start.column);L.start.row=_.start.row,L.start.column=_.start.column,L.end.row=_.end.row,L.end.column=_.end.column}}S.mergeOverlappingRanges();for(var O=[],R=M.length;R--;){var L=M[R];O.unshift(A.getTextRange(L))}$<0?O.unshift(O.pop()):O.push(O.shift());for(var R=M.length;R--;){var L=M[R],w=L.clone();A.replace(L,O[R]),L.start.row=w.start.row,L.start.column=w.start.column}S.fromOrientedRange(S.ranges[0])},this.selectMore=function($,A,S){var M=this.session,R=M.multiSelect,L=R.toOrientedRange();if(!(L.isEmpty()&&(L=M.getWordRange(L.start.row,L.start.column),L.cursor=$==-1?L.start:L.end,this.multiSelect.addRange(L),S))){var _=M.getTextRange(L),O=i(M,_,$);O&&(O.cursor=$==-1?O.start:O.end,this.session.unfold(O),this.multiSelect.addRange(O),this.renderer.scrollCursorIntoView(null,.5)),A&&this.multiSelect.substractPoint(L.cursor)}},this.alignCursors=function(){var $=this.session,A=$.multiSelect,S=A.ranges,M=-1,R=S.filter(function(I){if(I.cursor.row==M)return!0;M=I.cursor.row});if(!S.length||R.length==S.length-1){var L=this.selection.getRange(),_=L.start.row,O=L.end.row,w=_==O;if(w){var v=this.session.getLength(),C;do C=this.session.getLine(O);while(/[=:]/.test(C)&&++O<v);do C=this.session.getLine(_);while(/[=:]/.test(C)&&--_>0);_<0&&(_=0),O>=v&&(O=v-1)}var E=this.session.removeFullLines(_,O);E=this.$reAlignText(E,w),this.session.insert({row:_,column:0},E.join(`
2099
2099
  `)+`
2100
- `),w||(L.start.column=0,L.end.column=E[E.length-1].length),this.selection.setRange(L)}else{R.forEach(function(D){A.substractPoint(D.cursor)});var x=0,k=1/0,O=S.map(function(D){var N=D.cursor,P=$.getLine(N.row),z=P.substr(N.column).search(/\S/g);return z==-1&&(z=0),N.column>x&&(x=N.column),z<k&&(k=z),z});S.forEach(function(D,N){var P=D.cursor,z=x-P.column,F=O[N]-k;z>F?$.insert(P,r.stringRepeat(" ",z-F)):$.remove(new g(P.row,P.column,P.row,P.column-z+F)),D.start.column=D.end.column=x,D.start.row=D.end.row=P.row,D.cursor=D.end}),A.fromOrientedRange(S[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function($,A){var S=!0,M=!0,R,L,_;return $.map(function(E){var x=E.match(/(\s*)(.*?)(\s*)([=:].*)/);return x?R==null?(R=x[1].length,L=x[2].length,_=x[3].length,x):(R+L+_!=x[1].length+x[2].length+x[3].length&&(M=!1),R!=x[1].length&&(S=!1),R>x[1].length&&(R=x[1].length),L<x[2].length&&(L=x[2].length),_>x[3].length&&(_=x[3].length),x):[E]}).map(A?w:S?M?v:w:C);function I(E){return r.stringRepeat(" ",E)}function w(E){return E[2]?I(R)+E[2]+I(L-E[2].length+_)+E[4].replace(/^([=:])\s+/,"$1 "):E[0]}function v(E){return E[2]?I(R+L-E[2].length)+E[2]+I(_)+E[4].replace(/^([=:])\s+/,"$1 "):E[0]}function C(E){return E[2]?I(R)+E[2]+I(_)+E[4].replace(/^([=:])\s+/,"$1 "):E[0]}}}).call(h.prototype);function y($,A){return $.row==A.row&&$.column==A.column}n.onSessionChange=function($){var A=$.session;A&&!A.multiSelect&&(A.$selectionMarkers=[],A.selection.$initRangeList(),A.multiSelect=A.selection),this.multiSelect=A&&A.multiSelect;var S=$.oldSession;S&&(S.multiSelect.off("addRange",this.$onAddRange),S.multiSelect.off("removeRange",this.$onRemoveRange),S.multiSelect.off("multiSelect",this.$onMultiSelect),S.multiSelect.off("singleSelect",this.$onSingleSelect),S.multiSelect.lead.off("change",this.$checkMultiselectChange),S.multiSelect.anchor.off("change",this.$checkMultiselectChange)),A&&(A.multiSelect.on("addRange",this.$onAddRange),A.multiSelect.on("removeRange",this.$onRemoveRange),A.multiSelect.on("multiSelect",this.$onMultiSelect),A.multiSelect.on("singleSelect",this.$onSingleSelect),A.multiSelect.lead.on("change",this.$checkMultiselectChange),A.multiSelect.anchor.on("change",this.$checkMultiselectChange)),A&&this.inMultiSelectMode!=A.selection.inMultiSelectMode&&(A.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())};function b($){$.$multiselectOnSessionChange||($.$onAddRange=$.$onAddRange.bind($),$.$onRemoveRange=$.$onRemoveRange.bind($),$.$onMultiSelect=$.$onMultiSelect.bind($),$.$onSingleSelect=$.$onSingleSelect.bind($),$.$multiselectOnSessionChange=n.onSessionChange.bind($),$.$checkMultiselectChange=$.$checkMultiselectChange.bind($),$.$multiselectOnSessionChange($),$.on("changeSession",$.$multiselectOnSessionChange),$.on("mousedown",l),$.commands.addCommands(o.defaultCommands),T($))}function T($){if(!$.textInput)return;var A=$.textInput.getElement(),S=!1;f.addListener(A,"keydown",function(R){var L=R.keyCode==18&&!(R.ctrlKey||R.shiftKey||R.metaKey);$.$blockSelectEnabled&&L?S||($.renderer.setMouseCursor("crosshair"),S=!0):S&&M()},$),f.addListener(A,"keyup",M,$),f.addListener(A,"blur",M,$);function M(R){S&&($.renderer.setMouseCursor(""),S=!1)}}n.MultiSelect=b,t("./config").defineOptions(h.prototype,"editor",{enableMultiselect:{set:function($){b(this),$?this.on("mousedown",l):this.off("mousedown",l)},value:!0},enableBlockSelect:{set:function($){this.$blockSelectEnabled=$},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(t,n,p){var d=t("../../range").Range,g=n.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(m,l,f){var r=m.getLine(f);return this.foldingStartMarker.test(r)?"start":l=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(m,l,f){return null},this.indentationBlock=function(m,l,f){var r=/\S/,o=m.getLine(l),s=o.search(r);if(s!=-1){for(var a=f||o.length,i=m.getLength(),u=l,h=l;++l<i;){var y=m.getLine(l).search(r);if(y!=-1){if(y<=s){var b=m.getTokenAt(l,0);if(!b||b.type!=="string")break}h=l}}if(h>u){var T=m.getLine(h).length;return new d(u,a,h,T)}}},this.openingBracketBlock=function(m,l,f,r,o){var s={row:f,column:r+1},a=m.$findClosingBracket(l,s,o);if(a){var i=m.foldWidgets[a.row];return i==null&&(i=m.getFoldWidget(a.row)),i=="start"&&a.row>s.row&&(a.row--,a.column=m.getLine(a.row).length),d.fromPoints(s,a)}},this.closingBracketBlock=function(m,l,f,r,o){var s={row:f,column:r},a=m.$findOpeningBracket(l,s);if(a)return a.column++,s.column--,d.fromPoints(a,s)}}).call(g.prototype)}),ace.define("ace/ext/error_marker",["require","exports","module","ace/lib/dom","ace/range","ace/config"],function(t,n,p){var d=t("../lib/dom"),g=t("../range").Range,m=t("../config").nls;function l(r,o,s){for(var a=0,i=r.length-1;a<=i;){var u=a+i>>1,h=s(o,r[u]);if(h>0)a=u+1;else if(h<0)i=u-1;else return u}return-(a+1)}function f(r,o,s){var a=r.getAnnotations().sort(g.comparePoints);if(a.length){var i=l(a,{row:o,column:-1},g.comparePoints);i<0&&(i=-i-1),i>=a.length?i=s>0?0:a.length-1:i===0&&s<0&&(i=a.length-1);var u=a[i];if(!(!u||!s)){if(u.row===o){do u=a[i+=s];while(u&&u.row===o);if(!u)return a.slice()}var h=[];o=u.row;do h[s<0?"unshift":"push"](u),u=a[i+=s];while(u&&u.row==o);return h.length&&h}}}n.showErrorMarker=function(r,o){var s=r.session,a=r.getCursorPosition(),i=a.row,u=s.widgetManager.getWidgetsAtRow(i).filter(function(R){return R.type=="errorMarker"})[0];u?u.destroy():i-=o;var h=f(s,i,o),y;if(h){var b=h[0];a.column=(b.pos&&typeof b.column!="number"?b.pos.sc:b.column)||0,a.row=b.row,y=r.renderer.$gutterLayer.$annotations[a.row]}else{if(u)return;y={displayText:[m("error-marker.good-state","Looks good!")],className:"ace_ok"}}r.session.unfold(a.row),r.selection.moveToPosition(a);var T={row:a.row,fixedWidth:!0,coverGutter:!0,el:d.createElement("div"),type:"errorMarker"},$=T.el.appendChild(d.createElement("div")),A=T.el.appendChild(d.createElement("div"));A.className="error_widget_arrow "+y.className;var S=r.renderer.$cursorLayer.getPixelPosition(a).left;A.style.left=S+r.renderer.gutterWidth-5+"px",T.el.className="error_widget_wrapper",$.className="error_widget "+y.className,y.displayText.forEach(function(R,L){$.appendChild(d.createTextNode(R)),L<y.displayText.length-1&&$.appendChild(d.createElement("br"))}),$.appendChild(d.createElement("div"));var M=function(R,L,_){if(L===0&&(_==="esc"||_==="return"))return T.destroy(),{command:"null"}};T.destroy=function(){r.$mouseHandler.isMousePressed||(r.keyBinding.removeKeyboardHandler(M),s.widgetManager.removeLineWidget(T),r.off("changeSelection",T.destroy),r.off("changeSession",T.destroy),r.off("mouseup",T.destroy),r.off("change",T.destroy))},r.keyBinding.addKeyboardHandler(M),r.on("changeSelection",T.destroy),r.on("changeSession",T.destroy),r.on("mouseup",T.destroy),r.on("change",T.destroy),r.session.widgetManager.addLineWidget(T),T.el.onmousedown=r.focus.bind(r),r.renderer.scrollCursorIntoView(null,.5,{bottom:T.el.offsetHeight})},d.importCssString(`
2100
+ `),w||(L.start.column=0,L.end.column=E[E.length-1].length),this.selection.setRange(L)}else{R.forEach(function(I){A.substractPoint(I.cursor)});var x=0,k=1/0,D=S.map(function(I){var N=I.cursor,P=$.getLine(N.row),z=P.substr(N.column).search(/\S/g);return z==-1&&(z=0),N.column>x&&(x=N.column),z<k&&(k=z),z});S.forEach(function(I,N){var P=I.cursor,z=x-P.column,F=D[N]-k;z>F?$.insert(P,r.stringRepeat(" ",z-F)):$.remove(new g(P.row,P.column,P.row,P.column-z+F)),I.start.column=I.end.column=x,I.start.row=I.end.row=P.row,I.cursor=I.end}),A.fromOrientedRange(S[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function($,A){var S=!0,M=!0,R,L,_;return $.map(function(E){var x=E.match(/(\s*)(.*?)(\s*)([=:].*)/);return x?R==null?(R=x[1].length,L=x[2].length,_=x[3].length,x):(R+L+_!=x[1].length+x[2].length+x[3].length&&(M=!1),R!=x[1].length&&(S=!1),R>x[1].length&&(R=x[1].length),L<x[2].length&&(L=x[2].length),_>x[3].length&&(_=x[3].length),x):[E]}).map(A?w:S?M?v:w:C);function O(E){return r.stringRepeat(" ",E)}function w(E){return E[2]?O(R)+E[2]+O(L-E[2].length+_)+E[4].replace(/^([=:])\s+/,"$1 "):E[0]}function v(E){return E[2]?O(R+L-E[2].length)+E[2]+O(_)+E[4].replace(/^([=:])\s+/,"$1 "):E[0]}function C(E){return E[2]?O(R)+E[2]+O(_)+E[4].replace(/^([=:])\s+/,"$1 "):E[0]}}}).call(h.prototype);function y($,A){return $.row==A.row&&$.column==A.column}n.onSessionChange=function($){var A=$.session;A&&!A.multiSelect&&(A.$selectionMarkers=[],A.selection.$initRangeList(),A.multiSelect=A.selection),this.multiSelect=A&&A.multiSelect;var S=$.oldSession;S&&(S.multiSelect.off("addRange",this.$onAddRange),S.multiSelect.off("removeRange",this.$onRemoveRange),S.multiSelect.off("multiSelect",this.$onMultiSelect),S.multiSelect.off("singleSelect",this.$onSingleSelect),S.multiSelect.lead.off("change",this.$checkMultiselectChange),S.multiSelect.anchor.off("change",this.$checkMultiselectChange)),A&&(A.multiSelect.on("addRange",this.$onAddRange),A.multiSelect.on("removeRange",this.$onRemoveRange),A.multiSelect.on("multiSelect",this.$onMultiSelect),A.multiSelect.on("singleSelect",this.$onSingleSelect),A.multiSelect.lead.on("change",this.$checkMultiselectChange),A.multiSelect.anchor.on("change",this.$checkMultiselectChange)),A&&this.inMultiSelectMode!=A.selection.inMultiSelectMode&&(A.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())};function b($){$.$multiselectOnSessionChange||($.$onAddRange=$.$onAddRange.bind($),$.$onRemoveRange=$.$onRemoveRange.bind($),$.$onMultiSelect=$.$onMultiSelect.bind($),$.$onSingleSelect=$.$onSingleSelect.bind($),$.$multiselectOnSessionChange=n.onSessionChange.bind($),$.$checkMultiselectChange=$.$checkMultiselectChange.bind($),$.$multiselectOnSessionChange($),$.on("changeSession",$.$multiselectOnSessionChange),$.on("mousedown",c),$.commands.addCommands(o.defaultCommands),T($))}function T($){if(!$.textInput)return;var A=$.textInput.getElement(),S=!1;f.addListener(A,"keydown",function(R){var L=R.keyCode==18&&!(R.ctrlKey||R.shiftKey||R.metaKey);$.$blockSelectEnabled&&L?S||($.renderer.setMouseCursor("crosshair"),S=!0):S&&M()},$),f.addListener(A,"keyup",M,$),f.addListener(A,"blur",M,$);function M(R){S&&($.renderer.setMouseCursor(""),S=!1)}}n.MultiSelect=b,t("./config").defineOptions(h.prototype,"editor",{enableMultiselect:{set:function($){b(this),$?this.on("mousedown",c):this.off("mousedown",c)},value:!0},enableBlockSelect:{set:function($){this.$blockSelectEnabled=$},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(t,n,p){var d=t("../../range").Range,g=n.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(m,c,f){var r=m.getLine(f);return this.foldingStartMarker.test(r)?"start":c=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(m,c,f){return null},this.indentationBlock=function(m,c,f){var r=/\S/,o=m.getLine(c),s=o.search(r);if(s!=-1){for(var a=f||o.length,i=m.getLength(),u=c,h=c;++c<i;){var y=m.getLine(c).search(r);if(y!=-1){if(y<=s){var b=m.getTokenAt(c,0);if(!b||b.type!=="string")break}h=c}}if(h>u){var T=m.getLine(h).length;return new d(u,a,h,T)}}},this.openingBracketBlock=function(m,c,f,r,o){var s={row:f,column:r+1},a=m.$findClosingBracket(c,s,o);if(a){var i=m.foldWidgets[a.row];return i==null&&(i=m.getFoldWidget(a.row)),i=="start"&&a.row>s.row&&(a.row--,a.column=m.getLine(a.row).length),d.fromPoints(s,a)}},this.closingBracketBlock=function(m,c,f,r,o){var s={row:f,column:r},a=m.$findOpeningBracket(c,s);if(a)return a.column++,s.column--,d.fromPoints(a,s)}}).call(g.prototype)}),ace.define("ace/ext/error_marker",["require","exports","module","ace/lib/dom","ace/range","ace/config"],function(t,n,p){var d=t("../lib/dom"),g=t("../range").Range,m=t("../config").nls;function c(r,o,s){for(var a=0,i=r.length-1;a<=i;){var u=a+i>>1,h=s(o,r[u]);if(h>0)a=u+1;else if(h<0)i=u-1;else return u}return-(a+1)}function f(r,o,s){var a=r.getAnnotations().sort(g.comparePoints);if(a.length){var i=c(a,{row:o,column:-1},g.comparePoints);i<0&&(i=-i-1),i>=a.length?i=s>0?0:a.length-1:i===0&&s<0&&(i=a.length-1);var u=a[i];if(!(!u||!s)){if(u.row===o){do u=a[i+=s];while(u&&u.row===o);if(!u)return a.slice()}var h=[];o=u.row;do h[s<0?"unshift":"push"](u),u=a[i+=s];while(u&&u.row==o);return h.length&&h}}}n.showErrorMarker=function(r,o){var s=r.session,a=r.getCursorPosition(),i=a.row,u=s.widgetManager.getWidgetsAtRow(i).filter(function(R){return R.type=="errorMarker"})[0];u?u.destroy():i-=o;var h=f(s,i,o),y;if(h){var b=h[0];a.column=(b.pos&&typeof b.column!="number"?b.pos.sc:b.column)||0,a.row=b.row,y=r.renderer.$gutterLayer.$annotations[a.row]}else{if(u)return;y={displayText:[m("error-marker.good-state","Looks good!")],className:"ace_ok"}}r.session.unfold(a.row),r.selection.moveToPosition(a);var T={row:a.row,fixedWidth:!0,coverGutter:!0,el:d.createElement("div"),type:"errorMarker"},$=T.el.appendChild(d.createElement("div")),A=T.el.appendChild(d.createElement("div"));A.className="error_widget_arrow "+y.className;var S=r.renderer.$cursorLayer.getPixelPosition(a).left;A.style.left=S+r.renderer.gutterWidth-5+"px",T.el.className="error_widget_wrapper",$.className="error_widget "+y.className,y.displayText.forEach(function(R,L){$.appendChild(d.createTextNode(R)),L<y.displayText.length-1&&$.appendChild(d.createElement("br"))}),$.appendChild(d.createElement("div"));var M=function(R,L,_){if(L===0&&(_==="esc"||_==="return"))return T.destroy(),{command:"null"}};T.destroy=function(){r.$mouseHandler.isMousePressed||(r.keyBinding.removeKeyboardHandler(M),s.widgetManager.removeLineWidget(T),r.off("changeSelection",T.destroy),r.off("changeSession",T.destroy),r.off("mouseup",T.destroy),r.off("change",T.destroy))},r.keyBinding.addKeyboardHandler(M),r.on("changeSelection",T.destroy),r.on("changeSession",T.destroy),r.on("mouseup",T.destroy),r.on("change",T.destroy),r.session.widgetManager.addLineWidget(T),T.el.onmousedown=r.focus.bind(r),r.renderer.scrollCursorIntoView(null,.5,{bottom:T.el.offsetHeight})},d.importCssString(`
2101
2101
  .error_widget_wrapper {
2102
2102
  background: inherit;
2103
2103
  color: inherit;
@@ -2130,10 +2130,10 @@ export const FormManager: React.FC = () => {
2130
2130
  border-left-color: transparent!important;
2131
2131
  top: -5px;
2132
2132
  }
2133
- `,"error_marker.css",!1)}),ace.define("ace/ace",["require","exports","module","ace/lib/dom","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config","ace/loader_build"],function(t,n,p){t("./loader_build")(n);var d=t("./lib/dom"),g=t("./range").Range,m=t("./editor").Editor,l=t("./edit_session").EditSession,f=t("./undomanager").UndoManager,r=t("./virtual_renderer").VirtualRenderer;t("./worker/worker_client"),t("./keyboard/hash_handler"),t("./placeholder"),t("./multi_select"),t("./mode/folding/fold_mode"),t("./theme/textmate"),t("./ext/error_marker"),n.config=t("./config"),n.edit=function(s,a){if(typeof s=="string"){var i=s;if(s=document.getElementById(i),!s)throw new Error("ace.edit can't find div #"+i)}if(s&&s.env&&s.env.editor instanceof m)return s.env.editor;var u="";if(s&&/input|textarea/i.test(s.tagName)){var h=s;u=h.value,s=d.createElement("pre"),h.parentNode.replaceChild(s,h)}else s&&(u=s.textContent,s.innerHTML="");var y=n.createEditSession(u),b=new m(new r(s),y,a),T={document:y,editor:b,onResize:b.resize.bind(b,null)};return h&&(T.textarea=h),b.on("destroy",function(){T.editor.container.env=null}),b.container.env=b.env=T,b},n.createEditSession=function(s,a){var i=new l(s,a);return i.setUndoManager(new f),i},n.Range=g,n.Editor=m,n.EditSession=l,n.UndoManager=f,n.VirtualRenderer=r;var o=n.config.version;n.version=o}),(function(){ace.require(["ace/ace"],function(t){t&&(t.config.init(!0),t.define=ace.define);var n=(function(){return this})();!n&&typeof window<"u"&&(n=window),!n&&typeof self<"u"&&(n=self),n.ace||(n.ace=t);for(var p in t)t.hasOwnProperty(p)&&(n.ace[p]=t[p]);n.ace.default=n.ace,c&&(c.exports=n.ace)})})()})(Jo)),Jo.exports}var ta=iv();const rv=Lt(ta),ov="/formeo/assets/js/mode-json.min.js",sv="/formeo/assets/js/theme-github_light_default.min.js";var es,pu;function av(){if(pu)return es;pu=1;function c(e,t,n,p){var d=-1,g=e==null?0:e.length;for(p&&g&&(n=e[++d]);++d<g;)n=t(n,e[d],d,e);return n}return es=c,es}var ts,gu;function lv(){if(gu)return ts;gu=1;function c(e){return function(t){return e?.[t]}}return ts=c,ts}var ns,mu;function cv(){if(mu)return ns;mu=1;var c=lv(),e={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},t=c(e);return ns=t,ns}var is,vu;function uv(){if(vu)return is;vu=1;var c=cv(),e=Un(),t=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,n="\\u0300-\\u036f",p="\\ufe20-\\ufe2f",d="\\u20d0-\\u20ff",g=n+p+d,m="["+g+"]",l=RegExp(m,"g");function f(r){return r=e(r),r&&r.replace(t,c).replace(l,"")}return is=f,is}var rs,yu;function hv(){if(yu)return rs;yu=1;var c=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function e(t){return t.match(c)||[]}return rs=e,rs}var os,bu;function dv(){if(bu)return os;bu=1;var c=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function e(t){return c.test(t)}return os=e,os}var ss,wu;function fv(){if(wu)return ss;wu=1;var c="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",p=e+t+n,d="\\u2700-\\u27bf",g="a-z\\xdf-\\xf6\\xf8-\\xff",m="\\xac\\xb1\\xd7\\xf7",l="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",f="\\u2000-\\u206f",r=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",o="A-Z\\xc0-\\xd6\\xd8-\\xde",s="\\ufe0e\\ufe0f",a=m+l+f+r,i="['’]",u="["+a+"]",h="["+p+"]",y="\\d+",b="["+d+"]",T="["+g+"]",$="[^"+c+a+y+d+g+o+"]",A="\\ud83c[\\udffb-\\udfff]",S="(?:"+h+"|"+A+")",M="[^"+c+"]",R="(?:\\ud83c[\\udde6-\\uddff]){2}",L="[\\ud800-\\udbff][\\udc00-\\udfff]",_="["+o+"]",I="\\u200d",w="(?:"+T+"|"+$+")",v="(?:"+_+"|"+$+")",C="(?:"+i+"(?:d|ll|m|re|s|t|ve))?",E="(?:"+i+"(?:D|LL|M|RE|S|T|VE))?",x=S+"?",k="["+s+"]?",O="(?:"+I+"(?:"+[M,R,L].join("|")+")"+k+x+")*",D="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",N="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",P=k+x+O,z="(?:"+[b,R,L].join("|")+")"+P,F=RegExp([_+"?"+T+"+"+C+"(?="+[u,_,"$"].join("|")+")",v+"+"+E+"(?="+[u,_+w,"$"].join("|")+")",_+"?"+w+"+"+C,_+"+"+E,N,D,y,z].join("|"),"g");function W(H){return H.match(F)||[]}return ss=W,ss}var as,Cu;function pv(){if(Cu)return as;Cu=1;var c=hv(),e=dv(),t=Un(),n=fv();function p(d,g,m){return d=t(d),g=m?void 0:g,g===void 0?e(d)?n(d):c(d):d.match(g)||[]}return as=p,as}var ls,Su;function gv(){if(Su)return ls;Su=1;var c=av(),e=uv(),t=pv(),n="['’]",p=RegExp(n,"g");function d(g){return function(m){return c(t(e(m).replace(p,"")),g,"")}}return ls=d,ls}var cs,Au;function mv(){if(Au)return cs;Au=1;function c(e,t,n){var p=-1,d=e.length;t<0&&(t=-t>d?0:d+t),n=n>d?d:n,n<0&&(n+=d),d=t>n?0:n-t>>>0,t>>>=0;for(var g=Array(d);++p<d;)g[p]=e[p+t];return g}return cs=c,cs}var us,$u;function vv(){if($u)return us;$u=1;var c=mv();function e(t,n,p){var d=t.length;return p=p===void 0?d:p,!n&&p>=d?t:c(t,n,p)}return us=e,us}var hs,Eu;function Jh(){if(Eu)return hs;Eu=1;var c="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",p=e+t+n,d="\\ufe0e\\ufe0f",g="\\u200d",m=RegExp("["+g+c+p+d+"]");function l(f){return m.test(f)}return hs=l,hs}var ds,Tu;function yv(){if(Tu)return ds;Tu=1;function c(e){return e.split("")}return ds=c,ds}var fs,Mu;function bv(){if(Mu)return fs;Mu=1;var c="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",p=e+t+n,d="\\ufe0e\\ufe0f",g="["+c+"]",m="["+p+"]",l="\\ud83c[\\udffb-\\udfff]",f="(?:"+m+"|"+l+")",r="[^"+c+"]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",a="\\u200d",i=f+"?",u="["+d+"]?",h="(?:"+a+"(?:"+[r,o,s].join("|")+")"+u+i+")*",y=u+i+h,b="(?:"+[r+m+"?",m,o,s,g].join("|")+")",T=RegExp(l+"(?="+l+")|"+b+y,"g");function $(A){return A.match(T)||[]}return fs=$,fs}var ps,_u;function wv(){if(_u)return ps;_u=1;var c=yv(),e=Jh(),t=bv();function n(p){return e(p)?t(p):c(p)}return ps=n,ps}var gs,xu;function Cv(){if(xu)return gs;xu=1;var c=vv(),e=Jh(),t=wv(),n=Un();function p(d){return function(g){g=n(g);var m=e(g)?t(g):void 0,l=m?m[0]:g.charAt(0),f=m?c(m,1).join(""):g.slice(1);return l[d]()+f}}return gs=p,gs}var ms,Lu;function Sv(){if(Lu)return ms;Lu=1;var c=Cv(),e=c("toUpperCase");return ms=e,ms}var vs,Ru;function Av(){if(Ru)return vs;Ru=1;var c=gv(),e=Sv(),t=c(function(n,p,d){return n+(d?" ":"")+e(p)});return vs=t,vs}var $v=Av();const Ev=Lt($v);ta.config.setModuleUrl("ace/mode/json",ov);ta.config.setModuleUrl("ace/theme/github_light_default",sv);const Je=rv.edit("formData-editor");Je.session.setOption("useWorker",!1);Je.setOptions({theme:"ace/theme/github_light_default",mode:"ace/mode/json"});const Tv=document.getElementById("submit-formData"),Mv=document.getElementById("formData-popover"),_v=document.getElementById("editor-action-buttons"),xv=(c,e)=>({renderForm:()=>{const t=document.querySelector(".render-form");t.style.display="block",e.render(c.formData)},getHtml:()=>{e.formData=c.formData;const t=e.html,n=window.open("","_blank");n.document.body.innerHTML=t},getUserData:()=>{console.log(e.userData)},resetEditor:()=>{window.sessionStorage.removeItem("formeo-formData"),window.location.reload()},editData:()=>{Je.setValue(JSON.stringify(c.formData,null,2),1)}}),Lv={editData:{popovertarget:"formData-popover"}},Rv=c=>{const e=Lv[c]||{};return{id:c,type:"button",...e}},kv=(c,e)=>{Tv.addEventListener("click",()=>{c.formData=Je.session.getValue(),Mv.hidePopover()});const t=xv(c,e);return Object.entries(t).map(([p,d])=>{const g=Rv(p),m=Object.assign(document.createElement("button"),g);for(const[f,r]of Object.entries(g))m.setAttribute(f,r);const l=document.createTextNode(Ev(p));return m.appendChild(l),m.addEventListener("click",d,!1),_v.appendChild(m),m})};document.getElementById("format-json").addEventListener("click",Iv);document.getElementById("collapse-json").addEventListener("click",Ov);document.getElementById("copy-json").addEventListener("click",Dv);function Iv(){const c=Je.session.getValue(),e=JSON.parse(c);Je.setValue(JSON.stringify(e,null,2),1)}function Ov(){const c=Je.session.getValue(),e=JSON.parse(c);Je.setValue(JSON.stringify(e,null,0),1)}async function Dv({target:c}){const e=c.textContent;c.textContent="Copied!";const t=setTimeout(()=>{c.textContent=e,clearTimeout(t)},3e3);try{await navigator.clipboard.writeText(Je.session.getValue()),console.log("Text copied to clipboard")}catch(n){console.error("Failed to copy: ",n)}}const Nv=c=>{const e=document.getElementById("control-filter"),t=document.getElementById("locale"),n=window.sessionStorage.getItem("formeo-locale"),p=({target:{value:g}})=>c.controls.actions.filter(g),d=({target:{value:g}})=>{window.sessionStorage.setItem("formeo-locale",g),c.i18n.setLang(g)};e.addEventListener("input",p),t.value=n||"en-US",t.addEventListener("change",d,!1)};async function Fv(c){c.innerHTML=`
2133
+ `,"error_marker.css",!1)}),ace.define("ace/ace",["require","exports","module","ace/lib/dom","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config","ace/loader_build"],function(t,n,p){t("./loader_build")(n);var d=t("./lib/dom"),g=t("./range").Range,m=t("./editor").Editor,c=t("./edit_session").EditSession,f=t("./undomanager").UndoManager,r=t("./virtual_renderer").VirtualRenderer;t("./worker/worker_client"),t("./keyboard/hash_handler"),t("./placeholder"),t("./multi_select"),t("./mode/folding/fold_mode"),t("./theme/textmate"),t("./ext/error_marker"),n.config=t("./config"),n.edit=function(s,a){if(typeof s=="string"){var i=s;if(s=document.getElementById(i),!s)throw new Error("ace.edit can't find div #"+i)}if(s&&s.env&&s.env.editor instanceof m)return s.env.editor;var u="";if(s&&/input|textarea/i.test(s.tagName)){var h=s;u=h.value,s=d.createElement("pre"),h.parentNode.replaceChild(s,h)}else s&&(u=s.textContent,s.innerHTML="");var y=n.createEditSession(u),b=new m(new r(s),y,a),T={document:y,editor:b,onResize:b.resize.bind(b,null)};return h&&(T.textarea=h),b.on("destroy",function(){T.editor.container.env=null}),b.container.env=b.env=T,b},n.createEditSession=function(s,a){var i=new c(s,a);return i.setUndoManager(new f),i},n.Range=g,n.Editor=m,n.EditSession=c,n.UndoManager=f,n.VirtualRenderer=r;var o=n.config.version;n.version=o}),(function(){ace.require(["ace/ace"],function(t){t&&(t.config.init(!0),t.define=ace.define);var n=(function(){return this})();!n&&typeof window<"u"&&(n=window),!n&&typeof self<"u"&&(n=self),n.ace||(n.ace=t);for(var p in t)t.hasOwnProperty(p)&&(n.ace[p]=t[p]);n.ace.default=n.ace,l&&(l.exports=n.ace)})})()})(Jo)),Jo.exports}var aa=uv();const hv=Rt(aa),dv="/formeo/assets/js/mode-json.min.js",fv="/formeo/assets/js/theme-github_light_default.min.js";var es,wu;function pv(){if(wu)return es;wu=1;function l(e,t,n,p){var d=-1,g=e==null?0:e.length;for(p&&g&&(n=e[++d]);++d<g;)n=t(n,e[d],d,e);return n}return es=l,es}var ts,Cu;function gv(){if(Cu)return ts;Cu=1;function l(e){return function(t){return e?.[t]}}return ts=l,ts}var ns,Su;function mv(){if(Su)return ns;Su=1;var l=gv(),e={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},t=l(e);return ns=t,ns}var is,Au;function vv(){if(Au)return is;Au=1;var l=mv(),e=Un(),t=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,n="\\u0300-\\u036f",p="\\ufe20-\\ufe2f",d="\\u20d0-\\u20ff",g=n+p+d,m="["+g+"]",c=RegExp(m,"g");function f(r){return r=e(r),r&&r.replace(t,l).replace(c,"")}return is=f,is}var rs,$u;function yv(){if($u)return rs;$u=1;var l=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function e(t){return t.match(l)||[]}return rs=e,rs}var os,Eu;function bv(){if(Eu)return os;Eu=1;var l=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function e(t){return l.test(t)}return os=e,os}var ss,Tu;function wv(){if(Tu)return ss;Tu=1;var l="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",p=e+t+n,d="\\u2700-\\u27bf",g="a-z\\xdf-\\xf6\\xf8-\\xff",m="\\xac\\xb1\\xd7\\xf7",c="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",f="\\u2000-\\u206f",r=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",o="A-Z\\xc0-\\xd6\\xd8-\\xde",s="\\ufe0e\\ufe0f",a=m+c+f+r,i="['’]",u="["+a+"]",h="["+p+"]",y="\\d+",b="["+d+"]",T="["+g+"]",$="[^"+l+a+y+d+g+o+"]",A="\\ud83c[\\udffb-\\udfff]",S="(?:"+h+"|"+A+")",M="[^"+l+"]",R="(?:\\ud83c[\\udde6-\\uddff]){2}",L="[\\ud800-\\udbff][\\udc00-\\udfff]",_="["+o+"]",O="\\u200d",w="(?:"+T+"|"+$+")",v="(?:"+_+"|"+$+")",C="(?:"+i+"(?:d|ll|m|re|s|t|ve))?",E="(?:"+i+"(?:D|LL|M|RE|S|T|VE))?",x=S+"?",k="["+s+"]?",D="(?:"+O+"(?:"+[M,R,L].join("|")+")"+k+x+")*",I="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",N="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",P=k+x+D,z="(?:"+[b,R,L].join("|")+")"+P,F=RegExp([_+"?"+T+"+"+C+"(?="+[u,_,"$"].join("|")+")",v+"+"+E+"(?="+[u,_+w,"$"].join("|")+")",_+"?"+w+"+"+C,_+"+"+E,N,I,y,z].join("|"),"g");function W(H){return H.match(F)||[]}return ss=W,ss}var as,Mu;function Cv(){if(Mu)return as;Mu=1;var l=yv(),e=bv(),t=Un(),n=wv();function p(d,g,m){return d=t(d),g=m?void 0:g,g===void 0?e(d)?n(d):l(d):d.match(g)||[]}return as=p,as}var ls,_u;function Sv(){if(_u)return ls;_u=1;var l=pv(),e=vv(),t=Cv(),n="['’]",p=RegExp(n,"g");function d(g){return function(m){return l(t(e(m).replace(p,"")),g,"")}}return ls=d,ls}var cs,xu;function Av(){if(xu)return cs;xu=1;function l(e,t,n){var p=-1,d=e.length;t<0&&(t=-t>d?0:d+t),n=n>d?d:n,n<0&&(n+=d),d=t>n?0:n-t>>>0,t>>>=0;for(var g=Array(d);++p<d;)g[p]=e[p+t];return g}return cs=l,cs}var us,Lu;function $v(){if(Lu)return us;Lu=1;var l=Av();function e(t,n,p){var d=t.length;return p=p===void 0?d:p,!n&&p>=d?t:l(t,n,p)}return us=e,us}var hs,Ru;function ld(){if(Ru)return hs;Ru=1;var l="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",p=e+t+n,d="\\ufe0e\\ufe0f",g="\\u200d",m=RegExp("["+g+l+p+d+"]");function c(f){return m.test(f)}return hs=c,hs}var ds,ku;function Ev(){if(ku)return ds;ku=1;function l(e){return e.split("")}return ds=l,ds}var fs,Ou;function Tv(){if(Ou)return fs;Ou=1;var l="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",p=e+t+n,d="\\ufe0e\\ufe0f",g="["+l+"]",m="["+p+"]",c="\\ud83c[\\udffb-\\udfff]",f="(?:"+m+"|"+c+")",r="[^"+l+"]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",a="\\u200d",i=f+"?",u="["+d+"]?",h="(?:"+a+"(?:"+[r,o,s].join("|")+")"+u+i+")*",y=u+i+h,b="(?:"+[r+m+"?",m,o,s,g].join("|")+")",T=RegExp(c+"(?="+c+")|"+b+y,"g");function $(A){return A.match(T)||[]}return fs=$,fs}var ps,Du;function Mv(){if(Du)return ps;Du=1;var l=Ev(),e=ld(),t=Tv();function n(p){return e(p)?t(p):l(p)}return ps=n,ps}var gs,Iu;function _v(){if(Iu)return gs;Iu=1;var l=$v(),e=ld(),t=Mv(),n=Un();function p(d){return function(g){g=n(g);var m=e(g)?t(g):void 0,c=m?m[0]:g.charAt(0),f=m?l(m,1).join(""):g.slice(1);return c[d]()+f}}return gs=p,gs}var ms,Nu;function xv(){if(Nu)return ms;Nu=1;var l=_v(),e=l("toUpperCase");return ms=e,ms}var vs,Fu;function Lv(){if(Fu)return vs;Fu=1;var l=Sv(),e=xv(),t=l(function(n,p,d){return n+(d?" ":"")+e(p)});return vs=t,vs}var Rv=Lv();const kv=Rt(Rv);aa.config.setModuleUrl("ace/mode/json",dv);aa.config.setModuleUrl("ace/theme/github_light_default",fv);const et=hv.edit("formData-editor");et.session.setOption("useWorker",!1);et.setOptions({theme:"ace/theme/github_light_default",mode:"ace/mode/json"});const Ov=document.getElementById("submit-formData"),Dv=document.getElementById("formData-popover"),Iv=document.getElementById("editor-action-buttons"),Nv=(l,e)=>({renderForm:()=>{const t=document.querySelector(".render-form");t.style.display="block",e.render(l.formData)},getHtml:()=>{e.formData=l.formData;const t=e.html,n=window.open("","_blank");n.document.body.innerHTML=t},getUserData:()=>{console.log(e.userData)},resetEditor:()=>{window.sessionStorage.removeItem("formeo-formData"),window.location.reload()},editData:()=>{et.setValue(JSON.stringify(l.formData,null,2),1)}}),Fv={editData:{popovertarget:"formData-popover"}},Pv=l=>{const e=Fv[l]||{};return{id:l,type:"button",...e}},Wv=(l,e)=>{Ov.addEventListener("click",()=>{l.formData=et.session.getValue(),Dv.hidePopover()});const t=Nv(l,e);return Object.entries(t).map(([p,d])=>{const g=Pv(p),m=Object.assign(document.createElement("button"),g);for(const[f,r]of Object.entries(g))m.setAttribute(f,r);const c=document.createTextNode(kv(p));return m.appendChild(c),m.addEventListener("click",d,!1),Iv.appendChild(m),m})};document.getElementById("format-json").addEventListener("click",Bv);document.getElementById("collapse-json").addEventListener("click",Hv);document.getElementById("copy-json").addEventListener("click",zv);function Bv(){const l=et.session.getValue(),e=JSON.parse(l);et.setValue(JSON.stringify(e,null,2),1)}function Hv(){const l=et.session.getValue(),e=JSON.parse(l);et.setValue(JSON.stringify(e,null,0),1)}async function zv({target:l}){const e=l.textContent;l.textContent="Copied!";const t=setTimeout(()=>{l.textContent=e,clearTimeout(t)},3e3);try{await navigator.clipboard.writeText(et.session.getValue()),console.log("Text copied to clipboard")}catch(n){console.error("Failed to copy: ",n)}}const jv=l=>{const e=document.getElementById("control-filter"),t=document.getElementById("locale"),n=window.sessionStorage.getItem("formeo-locale"),p=({target:{value:g}})=>l.controls.actions.filter(g),d=({target:{value:g}})=>{window.sessionStorage.setItem("formeo-locale",g),l.i18n.setLang(g)};e.addEventListener("input",p),t.value=n||"en-US",t.addEventListener("change",d,!1)};async function Uv(l){l.innerHTML=`
2134
2134
  <form class="build-form"></form>
2135
2135
  <div class="render-form"></div>
2136
- `;const e=new Zs(en),t=new Js(ea);return kv(e,t),Nv(e),{editor:e,renderer:t,cleanup:()=>{e?.destroy&&e.destroy(),t?.destroy&&t.destroy();const n=document.getElementById("editor-action-buttons");n&&(n.innerHTML="")}}}class Pv{constructor(){if(this.currentFramework=null,this.frameworkContainer=document.getElementById("framework-container"),this.frameworkSelect=document.getElementById("framework-select"),this.currentDemo=null,this.isLoading=!1,this.validFrameworks=["vanilla","angular","react"],!this.frameworkContainer){console.error("Framework container not found");return}if(!this.frameworkSelect){console.error("Framework selector not found");return}this.init()}init(){this.frameworkSelect.addEventListener("change",t=>{this.switchFramework(t.target.value)}),window.addEventListener("popstate",()=>{const t=this.getFrameworkFromURL();this.switchFramework(t,{updateURL:!1})});const e=this.getFrameworkFromURL();this.switchFramework(e)}async switchFramework(e,t={}){const{updateURL:n=!0}=t;if(this.isLoading){console.warn("Framework switch already in progress");return}if(!(this.currentFramework===e&&this.currentDemo!==null)){this.isLoading=!0,this.showLoadingState();try{switch(await this.cleanupCurrentDemo(),this.frameworkContainer.innerHTML="",e){case"vanilla":this.currentDemo=await Fv(this.frameworkContainer);break;case"angular":this.currentDemo=await Hm(this.frameworkContainer);break;case"react":this.currentDemo=await Ym(this.frameworkContainer);break;default:throw new Error(`Unknown framework: ${e}`)}this.currentFramework=e,this.syncFrameworkSelector(e),n&&this.updateURL(e),console.log(`Loaded ${e} demo successfully`)}catch(p){console.error(`Failed to load ${e} demo:`,p),this.showErrorState(e,p)}finally{this.isLoading=!1}}}async cleanupCurrentDemo(){if(this.currentDemo?.cleanup)try{await Promise.resolve(this.currentDemo.cleanup())}catch(e){console.warn("Error during demo cleanup:",e)}this.currentDemo=null}syncFrameworkSelector(e){this.frameworkSelect.value!==e&&(this.frameworkSelect.value=e)}getFrameworkFromURL(){const t=new URLSearchParams(window.location.search).get("framework");return t&&this.validFrameworks.includes(t)?t:"vanilla"}updateURL(e){const t=new URL(window.location);e==="vanilla"?t.searchParams.delete("framework"):t.searchParams.set("framework",e),window.history.pushState({framework:e},"",t.toString())}showLoadingState(){this.frameworkContainer.innerHTML=`
2136
+ `;const e=new ra(tn),t=new oa(sa);return Wv(e,t),jv(e),{editor:e,renderer:t,cleanup:()=>{e?.destroy&&e.destroy(),t?.destroy&&t.destroy();const n=document.getElementById("editor-action-buttons");n&&(n.innerHTML="")}}}class Gv{constructor(){if(this.currentFramework=null,this.frameworkContainer=document.getElementById("framework-container"),this.frameworkSelect=document.getElementById("framework-select"),this.currentDemo=null,this.isLoading=!1,this.validFrameworks=["vanilla","angular","react"],!this.frameworkContainer){console.error("Framework container not found");return}if(!this.frameworkSelect){console.error("Framework selector not found");return}this.init()}init(){this.frameworkSelect.addEventListener("change",t=>{this.switchFramework(t.target.value)}),window.addEventListener("popstate",()=>{const t=this.getFrameworkFromURL();this.switchFramework(t,{updateURL:!1})});const e=this.getFrameworkFromURL();this.switchFramework(e)}async switchFramework(e,t={}){const{updateURL:n=!0}=t;if(this.isLoading){console.warn("Framework switch already in progress");return}if(!(this.currentFramework===e&&this.currentDemo!==null)){this.isLoading=!0,this.showLoadingState();try{switch(await this.cleanupCurrentDemo(),this.frameworkContainer.innerHTML="",e){case"vanilla":this.currentDemo=await Uv(this.frameworkContainer);break;case"angular":this.currentDemo=await qm(this.frameworkContainer);break;case"react":this.currentDemo=await nv(this.frameworkContainer);break;default:throw new Error(`Unknown framework: ${e}`)}this.currentFramework=e,this.syncFrameworkSelector(e),n&&this.updateURL(e),console.log(`Loaded ${e} demo successfully`)}catch(p){console.error(`Failed to load ${e} demo:`,p),this.showErrorState(e,p)}finally{this.isLoading=!1}}}async cleanupCurrentDemo(){if(this.currentDemo?.cleanup)try{await Promise.resolve(this.currentDemo.cleanup())}catch(e){console.warn("Error during demo cleanup:",e)}this.currentDemo=null}syncFrameworkSelector(e){this.frameworkSelect.value!==e&&(this.frameworkSelect.value=e)}getFrameworkFromURL(){const t=new URLSearchParams(window.location.search).get("framework");return t&&this.validFrameworks.includes(t)?t:"vanilla"}updateURL(e){const t=new URL(window.location);e==="vanilla"?t.searchParams.delete("framework"):t.searchParams.set("framework",e),window.history.pushState({framework:e},"",t.toString())}showLoadingState(){this.frameworkContainer.innerHTML=`
2137
2137
  <div class="loading-message">
2138
2138
  <p>Loading ${this.frameworkSelect.options[this.frameworkSelect.selectedIndex]?.text||"framework"} demo...</p>
2139
2139
  </div>
@@ -2143,4 +2143,4 @@ export const FormManager: React.FC = () => {
2143
2143
  <p>${t.message}</p>
2144
2144
  <button class="retry-button" onclick="window.frameworkLoader?.switchFramework('${e}')">Retry</button>
2145
2145
  </div>
2146
- `}}document.addEventListener("DOMContentLoaded",()=>{window.frameworkLoader=new Pv});export{pm as C,ze as a,Q as m,st as t};
2146
+ `}}document.addEventListener("DOMContentLoaded",()=>{window.frameworkLoader=new Gv});export{wm as C,je as a,Q as m,at as t};