formeo 4.2.1 → 4.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/demo/assets/css/demo.min.css +1 -1
- package/dist/demo/assets/css/demo.min.css.gz +0 -0
- package/dist/demo/assets/css/formeo.min.css +1 -1
- package/dist/demo/assets/js/demo.min.js +54 -54
- package/dist/demo/assets/js/demo.min.js.gz +0 -0
- package/dist/demo/assets/js/formeo.cjs.js +3 -7
- package/dist/demo/assets/js/formeo.es.js +3 -7
- package/dist/demo/assets/js/formeo.min.cjs.js +2 -2
- package/dist/demo/assets/js/formeo.min.es.js +3 -3
- package/dist/demo/assets/js/formeo.min.js +3 -7
- package/dist/demo/assets/js/formeo.min.umd.js +2 -2
- package/dist/demo/assets/js/formeo.umd.js +3 -7
- package/dist/demo/assets/js/index.min.js +1 -1
- package/dist/demo/assets/js/index.min2.js +1 -1
- package/dist/demo/assets/js/index.min3.js +1 -1
- package/dist/demo/assets/js/mode-json.min.js +1 -1
- package/dist/demo/assets/js/mode-json.min.js.gz +0 -0
- package/dist/demo/assets/js/theme-github_light_default.min.js +1 -1
- package/dist/demo/index.html +1 -1
- package/dist/formeo.cjs.js +3 -7
- package/dist/formeo.css +1 -1
- package/dist/formeo.es.js +3 -7
- package/dist/formeo.min.cjs.js +2 -2
- package/dist/formeo.min.css +1 -1
- package/dist/formeo.min.es.js +3 -3
- package/dist/formeo.min.js +3 -7
- package/dist/formeo.min.umd.js +2 -2
- package/dist/formeo.umd.js +3 -7
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
formeo - https://formeo.io
|
|
4
|
-
Version: 4.2.
|
|
4
|
+
Version: 4.2.2
|
|
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
|
|
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 ad(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 ca={extension:".lang",location:"assets/lang/",langs:["en-US"],locale:"en-US",override:{}};class Ut{constructor(e=ca){this.langs=Object.create(null),this.loaded=[],this.processConfig(e)}processConfig(e){const{location:t,...n}={...ca,...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"?Ut.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 Ut.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 ld(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 cd=Object.defineProperty,ud=(l,e,t)=>e in l?cd(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t,qe=(l,e,t)=>ud(l,typeof e!="symbol"?e+"":e,t);const hd="_3x4ZIcu-",dd="JIt36hCJ",Nt={tooltip:hd,visible:dd},fd={triggerName:"tooltip"};class Nu{constructor(e=fd){qe(this,"triggerName"),qe(this,"tooltip"),qe(this,"activeTriggerType",null),qe(this,"spacing",12),qe(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()}),qe(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")}}),qe(this,"handleMouseOut",t=>{const n=this.triggerName,p=t.target.closest(`[${n}]`);this.activeTriggerType!=="click"&&p?.getAttribute(`${n}-type`)!=="click"&&this.hide()}),qe(this,"handleResize",()=>{this.isVisible()&&this.hide()}),qe(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=Nu);const pd="formeo",gd="4.2.0",Fu={name:pd,version:gd};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 Zn,ua;function md(){if(ua)return Zn;ua=1;function l(){this.__data__=[],this.size=0}return Zn=l,Zn}var Jn,ha;function nn(){if(ha)return Jn;ha=1;function l(e,t){return e===t||e!==e&&t!==t}return Jn=l,Jn}var ei,da;function In(){if(da)return ei;da=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 ei=e,ei}var ti,fa;function vd(){if(fa)return ti;fa=1;var l=In(),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 ti=n,ti}var ni,pa;function yd(){if(pa)return ni;pa=1;var l=In();function e(t){var n=this.__data__,p=l(n,t);return p<0?void 0:n[p][1]}return ni=e,ni}var ii,ga;function bd(){if(ga)return ii;ga=1;var l=In();function e(t){return l(this.__data__,t)>-1}return ii=e,ii}var ri,ma;function wd(){if(ma)return ri;ma=1;var l=In();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 ri=e,ri}var oi,va;function Nn(){if(va)return oi;va=1;var l=md(),e=vd(),t=yd(),n=bd(),p=wd();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,oi=d,oi}var si,ya;function Cd(){if(ya)return si;ya=1;var l=Nn();function e(){this.__data__=new l,this.size=0}return si=e,si}var ai,ba;function Sd(){if(ba)return ai;ba=1;function l(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}return ai=l,ai}var li,wa;function Ad(){if(wa)return li;wa=1;function l(e){return this.__data__.get(e)}return li=l,li}var ci,Ca;function $d(){if(Ca)return ci;Ca=1;function l(e){return this.__data__.has(e)}return ci=l,ci}var ui,Sa;function Pu(){if(Sa)return ui;Sa=1;var l=typeof an=="object"&&an&&an.Object===Object&&an;return ui=l,ui}var hi,Aa;function Ke(){if(Aa)return hi;Aa=1;var l=Pu(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=l||e||Function("return this")();return hi=t,hi}var di,$a;function Fn(){if($a)return di;$a=1;var l=Ke(),e=l.Symbol;return di=e,di}var fi,Ea;function Ed(){if(Ea)return fi;Ea=1;var l=Fn(),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 fi=d,fi}var pi,Ta;function Td(){if(Ta)return pi;Ta=1;var l=Object.prototype,e=l.toString;function t(n){return e.call(n)}return pi=t,pi}var gi,Ma;function kt(){if(Ma)return gi;Ma=1;var l=Fn(),e=Ed(),t=Td(),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 gi=g,gi}var mi,_a;function ct(){if(_a)return mi;_a=1;function l(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return mi=l,mi}var vi,xa;function _s(){if(xa)return vi;xa=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 vi=g,vi}var yi,La;function Md(){if(La)return yi;La=1;var l=Ke(),e=l["__core-js_shared__"];return yi=e,yi}var bi,Ra;function _d(){if(Ra)return bi;Ra=1;var l=Md(),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 bi=t,bi}var wi,ka;function Wu(){if(ka)return wi;ka=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 wi=t,wi}var Ci,Da;function xd(){if(Da)return Ci;Da=1;var l=_s(),e=_d(),t=ct(),n=Wu(),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 Ci=o,Ci}var Si,Oa;function Ld(){if(Oa)return Si;Oa=1;function l(e,t){return e?.[t]}return Si=l,Si}var Ai,Ia;function yt(){if(Ia)return Ai;Ia=1;var l=xd(),e=Ld();function t(n,p){var d=e(n,p);return l(d)?d:void 0}return Ai=t,Ai}var $i,Na;function xs(){if(Na)return $i;Na=1;var l=yt(),e=Ke(),t=l(e,"Map");return $i=t,$i}var Ei,Fa;function Pn(){if(Fa)return Ei;Fa=1;var l=yt(),e=l(Object,"create");return Ei=e,Ei}var Ti,Pa;function Rd(){if(Pa)return Ti;Pa=1;var l=Pn();function e(){this.__data__=l?l(null):{},this.size=0}return Ti=e,Ti}var Mi,Wa;function kd(){if(Wa)return Mi;Wa=1;function l(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return Mi=l,Mi}var _i,Ba;function Dd(){if(Ba)return _i;Ba=1;var l=Pn(),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 _i=p,_i}var xi,Ha;function Od(){if(Ha)return xi;Ha=1;var l=Pn(),e=Object.prototype,t=e.hasOwnProperty;function n(p){var d=this.__data__;return l?d[p]!==void 0:t.call(d,p)}return xi=n,xi}var Li,za;function Id(){if(za)return Li;za=1;var l=Pn(),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 Li=t,Li}var Ri,ja;function Nd(){if(ja)return Ri;ja=1;var l=Rd(),e=kd(),t=Dd(),n=Od(),p=Id();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,Ri=d,Ri}var ki,Ua;function Fd(){if(Ua)return ki;Ua=1;var l=Nd(),e=Nn(),t=xs();function n(){this.size=0,this.__data__={hash:new l,map:new(t||e),string:new l}}return ki=n,ki}var Di,Ga;function Pd(){if(Ga)return Di;Ga=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 Oi,Va;function Wn(){if(Va)return Oi;Va=1;var l=Pd();function e(t,n){var p=t.__data__;return l(n)?p[typeof n=="string"?"string":"hash"]:p.map}return Oi=e,Oi}var Ii,Ka;function Wd(){if(Ka)return Ii;Ka=1;var l=Wn();function e(t){var n=l(this,t).delete(t);return this.size-=n?1:0,n}return Ii=e,Ii}var Ni,qa;function Bd(){if(qa)return Ni;qa=1;var l=Wn();function e(t){return l(this,t).get(t)}return Ni=e,Ni}var Fi,Ya;function Hd(){if(Ya)return Fi;Ya=1;var l=Wn();function e(t){return l(this,t).has(t)}return Fi=e,Fi}var Pi,Xa;function zd(){if(Xa)return Pi;Xa=1;var l=Wn();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 Pi=e,Pi}var Wi,Qa;function Ls(){if(Qa)return Wi;Qa=1;var l=Fd(),e=Wd(),t=Bd(),n=Hd(),p=zd();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,Wi=d,Wi}var Bi,Za;function jd(){if(Za)return Bi;Za=1;var l=Nn(),e=xs(),t=Ls(),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 Bi=p,Bi}var Hi,Ja;function Bu(){if(Ja)return Hi;Ja=1;var l=Nn(),e=Cd(),t=Sd(),n=Ad(),p=$d(),d=jd();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,Hi=g,Hi}var zi,el;function Hu(){if(el)return zi;el=1;var l=yt(),e=(function(){try{var t=l(Object,"defineProperty");return t({},"",{}),t}catch{}})();return zi=e,zi}var ji,tl;function Rs(){if(tl)return ji;tl=1;var l=Hu();function e(t,n,p){n=="__proto__"&&l?l(t,n,{configurable:!0,enumerable:!0,value:p,writable:!0}):t[n]=p}return ji=e,ji}var Ui,nl;function zu(){if(nl)return Ui;nl=1;var l=Rs(),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 Ui=t,Ui}var Gi,il;function Ud(){if(il)return Gi;il=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 Gi=l,Gi}var Vi,rl;function Gd(){if(rl)return Vi;rl=1;var l=Ud(),e=l();return Vi=e,Vi}var Wt={exports:{}};Wt.exports;var ol;function Vd(){return ol||(ol=1,(function(l,e){var t=Ke(),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 Ki,sl;function ju(){if(sl)return Ki;sl=1;var l=Ke(),e=l.Uint8Array;return Ki=e,Ki}var qi,al;function Kd(){if(al)return qi;al=1;var l=ju();function e(t){var n=new t.constructor(t.byteLength);return new l(n).set(new l(t)),n}return qi=e,qi}var Yi,ll;function qd(){if(ll)return Yi;ll=1;var l=Kd();function e(t,n){var p=n?l(t.buffer):t.buffer;return new t.constructor(p,t.byteOffset,t.length)}return Yi=e,Yi}var Xi,cl;function Yd(){if(cl)return Xi;cl=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 Xi=l,Xi}var Qi,ul;function Xd(){if(ul)return Qi;ul=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 Qi=t,Qi}var Zi,hl;function Uu(){if(hl)return Zi;hl=1;function l(e,t){return function(n){return e(t(n))}}return Zi=l,Zi}var Ji,dl;function Gu(){if(dl)return Ji;dl=1;var l=Uu(),e=l(Object.getPrototypeOf,Object);return Ji=e,Ji}var er,fl;function ks(){if(fl)return er;fl=1;var l=Object.prototype;function e(t){var n=t&&t.constructor,p=typeof n=="function"&&n.prototype||l;return t===p}return er=e,er}var tr,pl;function Qd(){if(pl)return tr;pl=1;var l=Xd(),e=Gu(),t=ks();function n(p){return typeof p.constructor=="function"&&!t(p)?l(e(p)):{}}return tr=n,tr}var nr,gl;function bt(){if(gl)return nr;gl=1;function l(e){return e!=null&&typeof e=="object"}return nr=l,nr}var ir,ml;function Zd(){if(ml)return ir;ml=1;var l=kt(),e=bt(),t="[object Arguments]";function n(p){return e(p)&&l(p)==t}return ir=n,ir}var rr,vl;function Vu(){if(vl)return rr;vl=1;var l=Zd(),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 rr=d,rr}var or,yl;function wt(){if(yl)return or;yl=1;var l=Array.isArray;return or=l,or}var sr,bl;function Ku(){if(bl)return sr;bl=1;var l=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=l}return sr=e,sr}var ar,wl;function Bn(){if(wl)return ar;wl=1;var l=_s(),e=Ku();function t(n){return n!=null&&e(n.length)&&!l(n)}return ar=t,ar}var lr,Cl;function Jd(){if(Cl)return lr;Cl=1;var l=Bn(),e=bt();function t(n){return e(n)&&l(n)}return lr=t,lr}var Bt={exports:{}},cr,Sl;function ef(){if(Sl)return cr;Sl=1;function l(){return!1}return cr=l,cr}Bt.exports;var Al;function Ds(){return Al||(Al=1,(function(l,e){var t=Ke(),n=ef(),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 ur,$l;function tf(){if($l)return ur;$l=1;var l=kt(),e=Gu(),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 ur=f,ur}var hr,El;function nf(){if(El)return hr;El=1;var l=kt(),e=Ku(),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]",D={};D[b]=D[T]=D[$]=D[A]=D[S]=D[M]=D[R]=D[L]=D[_]=!0,D[n]=D[p]=D[h]=D[d]=D[y]=D[g]=D[m]=D[c]=D[f]=D[r]=D[o]=D[s]=D[a]=D[i]=D[u]=!1;function w(v){return t(v)&&e(v.length)&&!!D[l(v)]}return hr=w,hr}var dr,Tl;function rf(){if(Tl)return dr;Tl=1;function l(e){return function(t){return e(t)}}return dr=l,dr}var Ht={exports:{}};Ht.exports;var Ml;function of(){return Ml||(Ml=1,(function(l,e){var t=Pu(),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 fr,_l;function Os(){if(_l)return fr;_l=1;var l=nf(),e=rf(),t=of(),n=t&&t.isTypedArray,p=n?e(n):l;return fr=p,fr}var pr,xl;function qu(){if(xl)return pr;xl=1;function l(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return pr=l,pr}var gr,Ll;function Yu(){if(Ll)return gr;Ll=1;var l=Rs(),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 gr=p,gr}var mr,Rl;function sf(){if(Rl)return mr;Rl=1;var l=Yu(),e=Rs();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 mr=t,mr}var vr,kl;function af(){if(kl)return vr;kl=1;function l(e,t){for(var n=-1,p=Array(e);++n<e;)p[n]=t(n);return p}return vr=l,vr}var yr,Dl;function Is(){if(Dl)return yr;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 yr=t,yr}var br,Ol;function Xu(){if(Ol)return br;Ol=1;var l=af(),e=Vu(),t=wt(),n=Ds(),p=Is(),d=Os(),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 br=c,br}var wr,Il;function lf(){if(Il)return wr;Il=1;function l(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}return wr=l,wr}var Cr,Nl;function cf(){if(Nl)return Cr;Nl=1;var l=ct(),e=ks(),t=lf(),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 Cr=d,Cr}var Sr,Fl;function Qu(){if(Fl)return Sr;Fl=1;var l=Xu(),e=cf(),t=Bn();function n(p){return t(p)?l(p,!0):e(p)}return Sr=n,Sr}var Ar,Pl;function uf(){if(Pl)return Ar;Pl=1;var l=sf(),e=Qu();function t(n){return l(n,e(n))}return Ar=t,Ar}var $r,Wl;function hf(){if(Wl)return $r;Wl=1;var l=zu(),e=Vd(),t=qd(),n=Yd(),p=Qd(),d=Vu(),g=wt(),m=Jd(),c=Ds(),f=_s(),r=ct(),o=tf(),s=Os(),a=qu(),i=uf();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,D=_===void 0;if(D){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?(D=!1,_=e(R,!0)):C?(D=!1,_=t(R,!0)):_=[]:o(R)||d(R)?(_=M,d(M)?_=i(M):(!r(M)||f(M))&&(_=p(R))):D=!1}D&&(S.set(R,_),$(_,R,T,A,S),S.delete(R)),l(h,b,_)}return $r=u,$r}var Er,Bl;function df(){if(Bl)return Er;Bl=1;var l=Bu(),e=zu(),t=Gd(),n=hf(),p=ct(),d=Qu(),g=qu();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 Er=m,Er}var Tr,Hl;function Zu(){if(Hl)return Tr;Hl=1;function l(e){return e}return Tr=l,Tr}var Mr,zl;function ff(){if(zl)return Mr;zl=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 Mr=l,Mr}var _r,jl;function pf(){if(jl)return _r;jl=1;var l=ff(),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 _r=t,_r}var xr,Ul;function gf(){if(Ul)return xr;Ul=1;function l(e){return function(){return e}}return xr=l,xr}var Lr,Gl;function mf(){if(Gl)return Lr;Gl=1;var l=gf(),e=Hu(),t=Zu(),n=e?function(p,d){return e(p,"toString",{configurable:!0,enumerable:!1,value:l(d),writable:!0})}:t;return Lr=n,Lr}var Rr,Vl;function vf(){if(Vl)return Rr;Vl=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 Rr=n,Rr}var kr,Kl;function yf(){if(Kl)return kr;Kl=1;var l=mf(),e=vf(),t=e(l);return kr=t,kr}var Dr,ql;function bf(){if(ql)return Dr;ql=1;var l=Zu(),e=pf(),t=yf();function n(p,d){return t(e(p,d,l),p+"")}return Dr=n,Dr}var Or,Yl;function wf(){if(Yl)return Or;Yl=1;var l=nn(),e=Bn(),t=Is(),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 Or=p,Or}var Ir,Xl;function Cf(){if(Xl)return Ir;Xl=1;var l=bf(),e=wf();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 Ir=t,Ir}var Nr,Ql;function Sf(){if(Ql)return Nr;Ql=1;var l=df(),e=Cf(),t=e(function(n,p,d,g){l(n,p,d,g)});return Nr=t,Nr}var Af=Sf();const $f=Rt(Af),Ef=()=>crypto.randomUUID().slice(0,8),Tf=()=>Ef().slice(0,8),Zl=(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},Mf=(l,e)=>{const t=l.indexOf(e);t!==-1&&l.splice(t,1)},Le=l=>{const e=l.className?.match(Hf);return e&&Wf[e[0]]},gt=l=>Array.from(new Set(l)),We=l=>l?.attrs?.id||l?.id||Tf(),je=(l,e)=>$f({},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}),Qe=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]=Qe(l[p]);return e}if(l instanceof Object){e={};for(const p in l)Object.hasOwn(l,p)&&(e[p]=Qe(l[p]));return e}throw new Error("Unable to copy Object, type not supported.")},Fr=(l,e)=>l/e*100,vs=l=>`${l.toString()}%`,Ju=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),_f=l=>If.test(l);function xf(l,e=Hs){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 ys(l){return l}function bs(){}function Hn(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?Qe(Hn(l)):En();function eh(l,e,t,n={}){if(!e||!l[t][e])return n;const p=`${t}.${e}`;n[p]=l[t][e];const d=Uf.get(t);if(d){const g=l[t][e].data?.children||[];for(const m of g)eh(l,m,d,n)}return n}let th=null;try{th=require("../../lib/icons/formeo-sprite.svg?raw")}catch{}const Ns=Fu.name,Fs=Fu.version,zn=Ns,Lf="formeo-sprite",Rf=null,kf=`https://cdn.jsdelivr.net/npm/formeo@${Fs}/dist/${Lf}.svg`,Df=`https://cdn.jsdelivr.net/npm/formeo@${Fs}/dist/formeo.min.css`,Jl="https://draggable.github.io/formeo/assets/css/formeo.min.css",nh="f-panel",st="control-group",Dt=`${zn}-stage`,Ze=`${zn}-row`,Je=`${zn}-column`,Ot=`${zn}-field`,ws="custom-column-widths",ih="column-preset",Pr="resizing-columns",Of=new Map([[Dt,Ze],[Ze,Je],[Je,Ot]]),Ps=["stage","row","column","field"],Ws=Ps.map(l=>`${l}s`);new Map(Ws.map((l,e)=>[l,Ps[e]]));const If=new RegExp(`^${Ws.join("|")}.`),rh=[...Ps],Nf=[...Ws],Ff=new Map(Nf.map((l,e)=>[l,rh[e]])),Wr=rh.reduce((l,e)=>(l[e]=e,l),{}),Pf=[{name:"controls",className:st},{name:"stage",className:Dt},{name:"row",className:Ze},{name:"column",className:Je},{name:"field",className:Ot}],Bs={controls:st,stage:Dt,row:Ze,column:Je,field:Ot},Wf=Object.entries(Bs).reduce((l,[e,t])=>(l[t]=e,l),{}),Bf=Object.values(Bs),Hf=new RegExp(`${Bf.join("|")}`,"g"),{childTypeMapVals:oh,childTypeIndexMapVals:zf}=Pf.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:[]}),jf=oh.slice().map(l=>l.slice().reverse()).reverse(),ec=new Map(oh),Uf=new Map(zf),Gf=new Map(jf.slice()),Vf=[[{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"}]],Kf=new Map(Vf.reduce((l,e,t)=>(l.push([t,e]),l),[])),sh=`${Ns}-formData`,tc=`${Ns}-locale`,Ye=333,mt=Math.round(Ye/2),Hs=Math.round(Ye*2),ah="formeoSaved",Jt="formeoUpdated",qf="formeoChanged",lh="formeoUpdatedStage",ch="formeoUpdatedRow",uh="formeoUpdatedColumn",hh="formeoUpdatedField",Yf="formeoCleared",dh="formeoOnRender",Xf="formeoConditionUpdated",zs="formeoAddedRow",js="formeoAddedColumn",Us="formeoAddedField",Gs="formeoRemovedRow",Vs="formeoRemovedColumn",Ks="formeoRemovedField",fh={equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},Qf={and:"&&",or:"||"},ph={equals:"="},Zf=["logical","source","sourceProperty","comparison","target","targetProperty","assignment","value"],nc=["isChecked","isNotChecked"],ic=["isVisible","isNotVisible"],pn=["value"],Jf={comparison:fh,assignment:ph,logical:Qf},gh="if",ep="then",qs=()=>({[gh]:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],[ep]:[{target:"",targetProperty:"",assignment:"",value:""}]}),tp=/(\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,Cs=/\bcol-\w+-\d+/g,mh="f-i-",En=()=>({id:We(),stages:{[We()]:{}},rows:{},columns:{},fields:{}}),Tn=["selected","checked"],np=Tn.toReversed(),ip="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`),rp=new RegExp(`(?!${ip.join("|")})\\w\\S*`,"g"),op=/\s+/g;function at(l){return typeof l!="string"||l.trim().match(op)?l:l.replace(rp,t=>t.charAt(0).toUpperCase()+t.substring(1).replace(/[A-Z]/g,n=>` ${n}`))}const vh=(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)},rc=(l,e="-")=>vt(l).join(e),sp=l=>{const e=document.createElement("div");return e.innerHTML=l,e.textContent||e.innerText||""},ap=(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 Br,oc;function Ys(){if(oc)return Br;oc=1;var l=kt(),e=bt(),t="[object Symbol]";function n(p){return typeof p=="symbol"||e(p)&&l(p)==t}return Br=n,Br}var Hr,sc;function lp(){if(sc)return Hr;sc=1;var l=wt(),e=Ys(),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 Hr=p,Hr}var zr,ac;function cp(){if(ac)return zr;ac=1;var l=Ls(),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,zr=t,zr}var jr,lc;function up(){if(lc)return jr;lc=1;var l=cp(),e=500;function t(n){var p=l(n,function(g){return d.size===e&&d.clear(),g}),d=p.cache;return p}return jr=t,jr}var Ur,cc;function hp(){if(cc)return Ur;cc=1;var l=up(),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 Ur=n,Ur}var Gr,uc;function dp(){if(uc)return Gr;uc=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 Gr=l,Gr}var Vr,hc;function fp(){if(hc)return Vr;hc=1;var l=Fn(),e=dp(),t=wt(),n=Ys(),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 Vr=g,Vr}var Kr,dc;function jn(){if(dc)return Kr;dc=1;var l=fp();function e(t){return t==null?"":l(t)}return Kr=e,Kr}var qr,fc;function yh(){if(fc)return qr;fc=1;var l=wt(),e=lp(),t=hp(),n=jn();function p(d,g){return l(d)?d:e(d,g)?[d]:t(n(d))}return qr=p,qr}var Yr,pc;function bh(){if(pc)return Yr;pc=1;var l=Ys();function e(t){if(typeof t=="string"||l(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return Yr=e,Yr}var Xr,gc;function pp(){if(gc)return Xr;gc=1;var l=yh(),e=bh();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 Xr=t,Xr}var Qr,mc;function gp(){if(mc)return Qr;mc=1;var l=pp();function e(t,n,p){var d=t==null?void 0:l(t,n);return d===void 0?p:d}return Qr=e,Qr}var mp=gp();const vp=Rt(mp);var Zr,vc;function yp(){if(vc)return Zr;vc=1;var l=Yu(),e=yh(),t=Is(),n=ct(),p=bh();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 Zr=d,Zr}var Jr,yc;function bp(){if(yc)return Jr;yc=1;var l=yp();function e(t,n,p){return t==null?t:l(t,n,p)}return Jr=e,Jr}var wp=bp();const Cp=Rt(wp),Ie=vp,Un=Cp;function Sp(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 eo,bc;function Ap(){if(bc)return eo;bc=1;var l="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,l),this}return eo=e,eo}var to,wc;function $p(){if(wc)return to;wc=1;function l(e){return this.__data__.has(e)}return to=l,to}var no,Cc;function Ep(){if(Cc)return no;Cc=1;var l=Ls(),e=Ap(),t=$p();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,no=n,no}var io,Sc;function Tp(){if(Sc)return io;Sc=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 io=l,io}var ro,Ac;function Mp(){if(Ac)return ro;Ac=1;function l(e,t){return e.has(t)}return ro=l,ro}var oo,$c;function wh(){if($c)return oo;$c=1;var l=Ep(),e=Tp(),t=Mp(),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 oo=d,oo}var so,Ec;function _p(){if(Ec)return so;Ec=1;function l(e){var t=-1,n=Array(e.size);return e.forEach(function(p,d){n[++t]=[d,p]}),n}return so=l,so}var ao,Tc;function xp(){if(Tc)return ao;Tc=1;function l(e){var t=-1,n=Array(e.size);return e.forEach(function(p){n[++t]=p}),n}return ao=l,ao}var lo,Mc;function Lp(){if(Mc)return lo;Mc=1;var l=Fn(),e=ju(),t=nn(),n=wh(),p=_p(),d=xp(),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,_,D,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||!D(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,_,D,w);return w.delete(S),x;case h:if($)return $.call(S)==$.call(M)}return!1}return lo=A,lo}var co,_c;function Rp(){if(_c)return co;_c=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 co=l,co}var uo,xc;function kp(){if(xc)return uo;xc=1;var l=Rp(),e=wt();function t(n,p,d){var g=p(n);return e(n)?g:l(g,d(n))}return uo=t,uo}var ho,Lc;function Dp(){if(Lc)return ho;Lc=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 ho=l,ho}var fo,Rc;function Op(){if(Rc)return fo;Rc=1;function l(){return[]}return fo=l,fo}var po,kc;function Ip(){if(kc)return po;kc=1;var l=Dp(),e=Op(),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 po=d,po}var go,Dc;function Np(){if(Dc)return go;Dc=1;var l=Uu(),e=l(Object.keys,Object);return go=e,go}var mo,Oc;function Fp(){if(Oc)return mo;Oc=1;var l=ks(),e=Np(),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 mo=p,mo}var vo,Ic;function Pp(){if(Ic)return vo;Ic=1;var l=Xu(),e=Fp(),t=Bn();function n(p){return t(p)?l(p):e(p)}return vo=n,vo}var yo,Nc;function Wp(){if(Nc)return yo;Nc=1;var l=kp(),e=Ip(),t=Pp();function n(p){return l(p,t,e)}return yo=n,yo}var bo,Fc;function Bp(){if(Fc)return bo;Fc=1;var l=Wp(),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 bo=p,bo}var wo,Pc;function Hp(){if(Pc)return wo;Pc=1;var l=yt(),e=Ke(),t=l(e,"DataView");return wo=t,wo}var Co,Wc;function zp(){if(Wc)return Co;Wc=1;var l=yt(),e=Ke(),t=l(e,"Promise");return Co=t,Co}var So,Bc;function jp(){if(Bc)return So;Bc=1;var l=yt(),e=Ke(),t=l(e,"Set");return So=t,So}var Ao,Hc;function Up(){if(Hc)return Ao;Hc=1;var l=yt(),e=Ke(),t=l(e,"WeakMap");return Ao=t,Ao}var $o,zc;function Gp(){if(zc)return $o;zc=1;var l=Hp(),e=xs(),t=zp(),n=jp(),p=Up(),d=kt(),g=Wu(),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 $}),$o=b,$o}var Eo,jc;function Vp(){if(jc)return Eo;jc=1;var l=Bu(),e=wh(),t=Lp(),n=Bp(),p=Gp(),d=wt(),g=Ds(),m=Os(),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,D=M==R;if(D&&g(u)){if(!g(h))return!1;A=!0,L=!1}if(D&&!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 D?($||($=new l),n(u,h,y,b,T,$)):!1}return Eo=i,Eo}var To,Uc;function Kp(){if(Uc)return To;Uc=1;var l=Vp(),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 To=t,To}var Mo,Gc;function qp(){if(Gc)return Mo;Gc=1;var l=Kp();function e(t,n){return l(t,n)}return Mo=e,Mo}var Yp=qp();const Ss=Rt(Yp),Xp=(l,e)=>l===void 0?"added":e===void 0?"removed":Ss(l,e)?"unchanged":"changed";class Xs{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=Un(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:Xp(n,t),src:this.dom};if(n&&(c.previousValue=n),J.formeoUpdated(c),this.name){const r={stage:lh,row:ch,column:uh,field:hh}[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 Gn extends Xs{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?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:zs,column:js,field:Us}[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,Qe(e))}get config(){return this.configVal}conditionMap=new Map}function Vc(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 Ve(l){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Vc(Object(t),!0).forEach(function(n){Qp(l,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(t)):Vc(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 Qp(l,e,t){return e in l?Object.defineProperty(l,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):l[e]=t,l}function et(){return et=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},et.apply(this,arguments)}function Zp(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 Jp(l,e){if(l==null)return{};var t=Zp(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 eg="1.15.3";function Xe(l){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(l)}var nt=Xe(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),rn=Xe(/Edge/i),Kc=Xe(/firefox/i),Kt=Xe(/safari/i)&&!Xe(/chrome/i)&&!Xe(/android/i),Ch=Xe(/iP(ad|od|hone)/i),Sh=Xe(/chrome/i)&&Xe(/android/i),Ah={capture:!1,passive:!1};function se(l,e,t){l.addEventListener(e,t,!nt&&Ah)}function oe(l,e,t){l.removeEventListener(e,t,!nt&&Ah)}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 $h(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=$h(l))}return null}var qc=/\s+/g;function De(l,e,t){if(l&&e)if(l.classList)l.classList[t?"add":"remove"](e);else{var n=(" "+l.className+" ").replace(qc," ").replace(" "+e+" "," ");l.className=(n+(t?" "+e:"")).replace(qc," ")}}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 Eh(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 Ge(){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!==Ge()?(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,!nt))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 Yc(l,e,t){for(var n=ot(l,!0),p=we(l)[e];n;){var d=we(n)[t],g=void 0;if(g=p>=d,!g)return n;if(n===Ge())break;n=ot(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 Qs(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 Xc(l){var e=0,t=0,n=Ge();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 tg(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 ot(l,e){if(!l||!l.getBoundingClientRect)return Ge();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 Ge();if(n||e)return t;n=!0}}while(t=t.parentNode);return Ge()}function ng(l,e){if(l&&e)for(var t in e)e.hasOwnProperty(t)&&(l[t]=e[t]);return l}function _o(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 Th(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 ig(){clearTimeout(qt),qt=void 0}function Mh(l,e,t){l.scrollLeft+=e,l.scrollTop+=t}function _h(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 xh(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 rg(){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=Ve({},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(tg(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&&_o(s,o)&&!_o(r,o)&&(i.top-o.top)/(i.left-o.left)===(r.top-o.top)/(r.left-o.left)&&(c=sg(i,s,a,p.options)),_o(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=og(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 og(l){return l.offsetWidth}function sg(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=[],xo={initializeByDefault:!0},on={mount:function(e){for(var t in xo)xo.hasOwnProperty(t)&&!(t in e)&&(e[t]=xo[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](Ve({sortable:t},n)),t.options[g.pluginName]&&t[g.pluginName][e]&&t[g.pluginName][e](Ve({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,et(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"&&et(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 ag(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&&!nt&&!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=Ve(Ve({},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 lg=["evt"],xe=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p=n.evt,d=Jp(n,lg);on.pluginEvent.bind(te)(e,t,Ve({dragEl:K,parentEl:ve,ghostEl:ie,rootEl:fe,nextEl:pt,lastDownEl:vn,cloneEl:pe,cloneHidden:rt,dragStarted:zt,putSortable:Se,activeSortable:te.active,originalEvent:p,oldIndex:Et,oldDraggableIndex:Yt,newIndex:Oe,newDraggableIndex:it,hideGhostForTarget:Dh,unhideGhostForTarget:Oh,cloneNowHidden:function(){rt=!0},cloneNowShown:function(){rt=!1},dispatchSortableEvent:function(m){Ee({sortable:t,name:m,originalEvent:p})}},d))};function Ee(l){ag(Ve({putSortable:Se,cloneEl:pe,targetEl:K,rootEl:fe,oldIndex:Et,oldDraggableIndex:Yt,newIndex:Oe,newDraggableIndex:it},l))}var K,ve,ie,fe,pt,vn,pe,rt,Et,Oe,Yt,it,ln,Se,At=!1,_n=!1,xn=[],dt,Be,Lo,Ro,Qc,Zc,zt,St,Xt,Qt=!1,cn=!1,yn,Ae,ko=[],As=!1,Ln=[],Vn=typeof document<"u",un=Ch,Jc=rn||nt?"cssFloat":"float",cg=Vn&&!Sh&&!Ch&&"draggable"in document.createElement("div"),Lh=(function(){if(Vn){if(nt)return!1;var l=document.createElement("x");return l.style.cssText="pointer-events:auto",l.style.pointerEvents==="auto"}})(),Rh=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[Jc]==="none"||g&&n[Jc]==="none"&&f+r>p)?"vertical":"horizontal"},ug=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},hg=function(e,t){var n;return xn.some(function(p){var d=p[Re].options.emptyInsertThreshold;if(!(!d||Qs(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},kh=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},Dh=function(){!Lh&&ie&&ne(ie,"display","none")},Oh=function(){!Lh&&ie&&ne(ie,"display","")};Vn&&!Sh&&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=hg(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)}}},dg=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=et({},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 Rh(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]);kh(e);for(var p in this)p.charAt(0)==="_"&&typeof this[p]=="function"&&(this[p]=this[p].bind(this));this.nativeDraggable=e.forceFallback?!1:cg,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)||[]),et(this,rg())}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(wg(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},Qc=dt.clientX-f.left,Zc=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(),!Kc&&p.nativeDraggable&&(K.draggable=!0),p._triggerDragStart(e,t),Ee({sortable:p,name:"choose",originalEvent:e}),De(K,g.chosenClass,!0)},g.ignore.split(",").forEach(function(r){Eh(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),Kc&&this.nativeDraggable&&(this.options.touchStartThreshold=4,K.draggable=!0),xe("delayStart",this,{evt:e}),g.delay&&(!g.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(rn||nt))){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",dg);var n=this.options;!e&&De(K,n.dragClass,!1),De(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,Dh();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=$h(t));Oh()}},_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&&Xc(Ae),r=(d.clientX-dt.clientX+p.x)/(m||1)+(f?f[0]-ko[0]:0)/(m||1),o=(d.clientY-dt.clientY+p.y)/(c||1)+(f?f[1]-ko[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-(Lo||0),g.f+=o-(Ro||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),Lo=r,Ro=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=Ge()),t.top+=Ae.scrollTop,t.left+=Ae.scrollLeft):Ae=Ge(),ko=Xc(Ae)}ie=K.cloneNode(!0),De(ie,n.ghostClass,!1),De(ie,n.fallbackClass,!0),De(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",Qc/parseInt(ie.style.width)*100+"% "+Zc/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=_h(K),pe.removeAttribute("id"),pe.draggable=!1,pe.style["will-change"]="",this._hideClone(),De(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&&De(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(As)return;function h(O,I){xe(O,i,Ve({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(O){return h("dragOverCompleted",{insertion:O}),O&&(r?f._hideClone():f._showClone(i),i!==s&&(De(K,Se?Se.options.ghostClass:f.options.ghostClass,!1),De(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),!O&&ft(e)),!m.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),u=!0}function T(){Oe=Fe(K),it=Fe(K,m.draggable),Ee({sortable:i,name:"change",toEl:t,newIndex:Oe,newDraggableIndex:it,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 $=Qs(t,m.draggable);if(!$||mg(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($&&gg(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=!ug(K.animated&&K.toRect||p,n.animated&&n.toRect||d,a),_=a?"top":"left",D=Yc(n,"top","top")||Yc(K,"top","top"),w=D?D.scrollTop:void 0;St!==n&&(M=d[_],Qt=!1,cn=!L&&m.invertSwap||R),S=vg(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),As=!0,setTimeout(pg,30),y(),x&&!E?t.appendChild(K):n.parentNode.insertBefore(K,x?E:n),D&&Mh(D,0,w-D.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(Oe=Fe(K),it=Fe(K,n.draggable),xe("drop",this,{evt:e}),ve=K&&K.parentNode,Oe=Fe(K),it=Fe(K,n.draggable),te.eventCanceled){this._nulling();return}At=!1,cn=!1,Qt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),$s(this.cloneId),$s(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&&De(K,Se?Se.options.ghostClass:this.options.ghostClass,!1),De(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!==Et&&Oe>=0&&(Ee({sortable:this,name:"update",toEl:ve,originalEvent:e}),Ee({sortable:this,name:"sort",toEl:ve,originalEvent:e})),te.active&&((Oe==null||Oe===-1)&&(Oe=Et,it=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=rt=dt=Be=zt=Oe=it=Et=Yt=St=Xt=Se=ln=te.dragged=te.ghost=te.clone=te.active=null,Ln.forEach(function(e){e.checked=!0}),Ln.length=Lo=Ro=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":K&&(this._onDragOver(e),fg(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)||bg(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"&&kh(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(!rt){if(xe("hideClone",this),te.eventCanceled)return;ne(pe,"display","none"),this.options.removeCloneOnHide&&pe.parentNode&&pe.parentNode.removeChild(pe),rt=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(rt){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",""),rt=!1}}};function fg(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&&!nt&&!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 pg(){As=!1}function gg(l,e,t){var n=we(_t(t.el,0,t.options,!0)),p=xh(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 mg(l,e,t){var n=we(Qs(t.el,t.options.draggable)),p=xh(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 vg(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 yg(e)}return s=s||g,s&&(c<r+f*d/2||c>o-f*d/2)?c>r+f/2?1:-1:0}function yg(l){return Fe(K)<Fe(l)?1:-1}function bg(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 wg(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 $s(l){return clearTimeout(l)}Vn&&se(document,"touchmove",function(l){(te.active||At)&&l.cancelable&&l.preventDefault()});te.utils={on:se,off:oe,css:ne,find:Eh,is:function(e,t){return!!ze(e,t,e,!1)},extend:ng,throttle:Th,closest:ze,toggleClass:De,clone:_h,index:Fe,nextTick:bn,cancelNextTick:$s,detectDirection:Rh,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=Ve(Ve({},te.utils),n.utils)),on.mount(n)})};te.create=function(l,e){return new te(l,e)};te.version=eg;var be=[],jt,Es,Ts=!1,Oo,Io,Rn,Ut;function Cg(){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)),eu(),wn(),ig()},nulling:function(){Rn=Es=jt=Ts=Ut=Oo=Io=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||nt||Kt){No(t,this.options,m,n);var c=ot(m,!0);Ts&&(!Ut||d!==Oo||g!==Io)&&(Ut&&eu(),Ut=setInterval(function(){var f=ot(document.elementFromPoint(d,g),!0);f!==c&&(c=f,wn()),No(t,p.options,f,n)},10),Oo=d,Io=g)}else{if(!this.options.bubbleScroll||ot(m,!0)===Ge()){wn();return}No(t,this.options,ot(m,!1),!1)}}},et(l,{pluginName:"scroll",initializeByDefault:!0})}function wn(){be.forEach(function(l){clearInterval(l.pid)}),be=[]}function eu(){clearInterval(Ut)}var No=Th(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=Ge(),f=!1,r;Es!==t&&(Es=t,wn(),jt=e.scroll,r=e.scrollFn,jt===!0&&(jt=ot(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,D=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&&D+$<R)-(Math.abs(u-d)<=g&&!!D);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"||Mh(be[this.layer].el,x,E)}).bind({layer:o}),24))),o++}while(e.bubbleScroll&&s!==c&&(s=ot(s,!1)));Ts=f}},30),Ih=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 Zs(){}Zs.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:Ih};et(Zs,{pluginName:"revertOnSpill"});function Js(){}Js.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:Ih};et(Js,{pluginName:"removeOnSpill"});te.mount(new Cg);te.mount(Js,Zs);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)}},Nh=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)},Kn=(l,e,t)=>{for(let n=0;n<l.length;n++)e.call(t,l[n],n)},ea=(l,e)=>{const t=[];return Kn(l,(n,p)=>t.push(e(n,p))),t},Fo={},Fh=l=>{const e={className:"class"};if(Fo[l])return Fo[l];const n=(e[l]||l).replace(/^\d+/,"").replace(/[^a-zA-Z0-9-:]/g,"");return Fo[l]=n,n},Ph=l=>l.replace(/\b\w/g,e=>e.toUpperCase()),Sg=l=>window.JSON.parse(window.JSON.stringify(l)),Ag=(l,e)=>e.filter(t=>!~l.indexOf(t)),Ne={capitalize:Ph,safeAttrName:Fh,forEach:Kn,copyObj:Sg,map:ea,subtract:Ag,indexOfNode:lt,isInt:Nh,get:Ie,orderObjectsBy:kn},Ue={js:new Set,css:new Set,formeoSprite:null},tu=(l,e,t=bs)=>new Promise(n=>fetch(l).then(p=>{if(!p.ok)return n(t(p));n(e?e(p):p)}).catch(p=>t(p))),Wh=(l,e)=>{l.removeEventListener("load",Wh),e(l.src)},Bh=(l,e)=>{l.removeEventListener("load",Bh),e(l.src)},$g=l=>new Promise((e,t)=>{if(Ue.js.has(l))return e(l);Ue.js.add(l);const n=U.create({tag:"script",attrs:{type:"text/javascript",async:!0,src:l},action:{load:()=>Bh(n,e),error:()=>t(new Error(`${l} failed to load.`))}});document.head.appendChild(n)}),Ms=l=>{l=Array.isArray(l)?l:[l];const e=l.map(t=>new Promise((n,p)=>{if(Ue.css.has(t))return n(t);Ue.css.add(t);const d=U.create({tag:"link",attrs:{rel:"stylesheet",href:t},action:{load:()=>Wh(d,n),error:()=>p(new Error(`${(void 0).src} failed to load.`))}});document.head.appendChild(d)}));return Promise.all(e)},Eg=l=>{l=Array.isArray(l)?l:[l];const e=l.map(t=>$g(t));return Promise.all(e)},Tg=l=>{l=Array.isArray(l)?l:[l];const e=l.map(t=>Ms(t));return Promise.all(e)},nu=l=>{const t=new DOMParser().parseFromString(l,"image/svg+xml");return Ue.formeoSprite=t.documentElement,Ue.formeoSprite},Mg=async(l=Rf)=>{if(Ue.formeoSprite)return Ue.formeoSprite;if(!l)return nu(th);const e=async t=>nu(await t.text());return tu(l,e,()=>tu(kf,e))},_g={js:Eg,css:Tg},Hh=l=>{const e=Object.entries(l).map(([t,n])=>_g[t](n));return Promise.all(e)},xg=async l=>{if(!Ue.css.has(l)&&(await Ms(l),!Ue.css.has(Jl)))return await Ms(Jl)},Lg={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="${mh}${l}">${l}</i>`},Rg=new Set(["input","textarea","select"]),kg=(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=sp(n)),e=`${t}-${vh(ap(n,24,null))}`),e||t};class Dg{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=Ye)=>{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=Ue.formeoSprite.querySelectorAll("svg symbol"),t=n=>{const p=n.getAttribute("viewBox")||"0 0 24 24",d=Array.from(n.children).map(g=>g.cloneNode(!0).outerHTML).join("");return{tag:"svg",attrs:{className:["svg-icon",n.id],viewBox:p,xmlns:"http://www.w3.org/2000/svg"},children:d}};return this.iconSymbols=Array.from(e).reduce((n,p)=>{const d=p.id.replace(mh,"");return n[d]=t(p),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 Lg[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=kg(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 Kn(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),Rg.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(Of.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)===st;isStage=e=>Le(e)===Dt;isRow=e=>Le(e)===Ze;isColumn=e=>Le(e)===Je;isField=e=>Le(e)===Ot;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 Dg,Og="modulepreload",Ig=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=Ig(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":Og,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",Ng=`${Tt}-display-field`,ta=`${Tt}-list`,Ft="highlight-component",Dn=`${ta}-item`,Fg=(l,e)=>{const t=l.reduce((n,p)=>n+(p===e),0);return t>1?`(${t})`:""},zh=["config.label","config.controlId"],Pg=["config.legend","name"],Wg=[...zh,...Pg],Po=l=>zh.reduce((e,t)=>e||l.get(t),null),ru=l=>Wg.reduce((e,t)=>e||l.get(t),null)||at(l.name),Bg=new Map([["condition.source",Po],["if.condition.source",Po],["if.condition.target",Po],["then.condition.target",ru],["condition.target",ru]]),jh=({id:l,...e},t)=>{const{name:n,label:p}=e;return n?Bg.get(t)(e):p},Hg=({selectedId:l,...e})=>(e.value===l&&(e.selected=!0),e),Wo=l=>(l.classList.contains(Dn)||(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:[Dn,`${Dn}-depth-${p}`,`component-type-${n}`],action:{mousedown:({target:m})=>{m=Wo(m),d.setValue(m),d.selectOption(m),d.hideList()},mouseover:({target:m})=>{m=Wo(m),d.removeHighlight(),d.highlightComponent(m)},mouseleave:({target:m})=>{m=Wo(m),d.removeHighlight()}}};return U.create(g)},zg=(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:[ta,"options-list"]},children:t})},jg=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=Fg(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=zg(m,l);i.push(y)}const h=Hg({value:g,textLabel:u,htmlLabel:i,componentType:f,selectedId:e});d.push(Uh(h,l))}return d},[])};class Ug{lastCache=Date.now();optionsCache=null;constructor({key:e,value:t,className:n,onChange:p=bs}){this.key=e,this.className=[n||this.key.replace(/\./g,"-")].flat(),this.value=t,this.onChange=p||bs,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(`.${Dn}-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:Ng,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:ta}}),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>Hs*5||!e)&&(U.empty(this.list),e=this.generateOptions(),this.lastCache=t),this.list.children.length||this.list.append(...e)}generateOptions(){return this.optionsCache=jg(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 Bo({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 Ug(...l).createProxy(),string:({key:l,value:e})=>Bo({key:l,value:e}),boolean:({key:l,value:e})=>Bo({key:l,value:e,type:l==="selected"?"radio":"checkbox",checked:!!e}),number:({key:l,value:e})=>Bo({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}))},Gg={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",Vg="hidden-option",Ho=/\.options\[\d+\]$/,Kg={"if-sourceProperty":gn(pn,nc,ic),"if-targetProperty":gn(pn),"then-targetProperty":gn(pn,nc,ic),...Object.entries(Jf).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 qg({key:l,value:e,conditionType:t}){const n=`${t}-${l}`,p=Kg[n];return Object.entries(p||{}).map(([d,g])=>Yg({fieldName:l,fieldValue:e,key:d,optionValue:g}))}function Yg({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=qg({key:l,value:e,conditionType:n}),d=xt.array({key:`condition.${l}`,value:p});return d.action={change:t},d}const Xg=l=>!l?.classList.contains(Vh),Qg={sourceProperty:l=>{const e=l.get("source"),t=l.get("sourceProperty"),n=!!e.value,p=!!e.value.match(Ho);return su(p,t),!n},comparison:l=>{const e=l.get("source"),t=l.get("sourceProperty"),n=!!e.value,p=!!e.value.match(Ho);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(Ho);return su(n,t),!_f(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||!Xg(l.get("comparison"))||t.value===qh?!0:t.value.startsWith("is")}},ou=l=>{for(const[e,t]of l){const n=!!Qg[e]?.(l)||!1;t.classList.toggle(Vh,n)}},qh="isChecked",zo=l=>l.value.endsWith("Checked"),su=(l,e)=>{if(l&&zo(e))return null;const t=Array.from(e.querySelectorAll("option")),n=[];for(const p of t){const d=zo(p),g=l?!d:d;g&&n.push(p.value),p.classList.toggle(Vg,g)}n.includes(e.value)&&(e.value=l?qh:t.find(p=>!zo(p))?.value||e.value)};function Zg(l,e=Zf){return e.reduce((t,n)=>(l[n]!==void 0&&t.push([n,l[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,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 em=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:np,d=t.data.map(({[n]:g,...m})=>({[p]:g,...m}));t.setData(d)}},tm=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=rc(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]=qs()[e],m=n.children.length;e===gh&&(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,Ye,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=em.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}-${rc(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=tm.get(this.itemSlug)?.(this),o=Sp(Gg[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 nm={multiple:(l,e)=>{Yh(!!l,e)}};class im{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:`${nh} ${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=Fh(e),d=`attrs.${p}`;Q.current[d]||Q.put(d,Ph(e)),typeof n=="string"&&["true","false"].includes(n)&&(n=JSON.parse(n)),this.component.set(`attrs.${e}`,n),nm[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=vh(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)},Hs)}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 jo=null;const Uo=gn(pn);class qn extends Xs{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)?Nh(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]}),Kn(n,g=>g.remove()),this.dom.parentElement.removeChild(this.dom),Mf(ce.getAddress(`${t.name}s.${t.id}.children`),this.id),t.children.length||t.emptyClass(),t.name==="row"&&t.autoColumnWidths();const d={row:Gs,column:Vs,field:Ks}[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:[U.icon(`handle-${this.name}`),at(this.name)].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,Ye,e),this.name==="field"&&($e.slideToggle(this.preview,Ye,!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,Ye,()=>{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 Gf.get(this.name)}get parent(){const e=this.parentType;if(!this.dom||!e)return null;const t=this.dom.closest(`.${Bs[e]}`);return t&&U.asComponent(t)}get children(){if(!this.dom)return[];const e=this.domChildren,t=ec.get(this.name);return ea(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=ec.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(st)||(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(!jo){const{default:b}=await $t(async()=>{const{default:T}=await Promise.resolve().then(()=>bm);return{default:T}},void 0);jo=b}const{controlData:{meta:{id:o},...s}}=jo.get(n.id);Un(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])||ys)()?.({id:n.id},p)},column:()=>{const o={stage:-2,row:-1};return(c.get(o[g])||ys)()?.(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(Je)&&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,!Uo[d]].some(Boolean)?e:t?p.set(Uo[d],t):p.get(Uo[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={...Qe(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===Wr.row}get isColumn(){return this.name===Wr.column}get isField(){return this.name===Wr.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 im(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 rm{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(`.${Ze}`);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(Pr),this.columnPreset=p.querySelector(`.${ih}`),this.originalColumnClass=t.className,this.originalSiblingClass=n.className,t.className=t.className.replace(Cs,""),n.className=n.className.replace(Cs,""),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(Fr(t,this.rowWidth)),d=parseFloat(Fr(n,this.rowWidth));return p<10||d<10?null:{colWidth:vs(p.toFixed(1)),siblingColWidth:vs(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(Pr),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(Pr),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const e=this.columnPreset;let t=e.querySelector(`.${ws}`);const n=this.row.querySelector(".children").children,p=ea(n,m=>Fr(m.clientWidth,this.rowWidth).toFixed(1)),d=p.join(","),g=p.join(" | ");return t||(t=U.create({tag:"option",attrs:{className:ws,value:d,selected:!0},content:g}),e.append(t)),t.value=d,t.textContent=g,d}}const om=()=>Object.freeze({config:{width:"100%"},children:[],className:[Je]}),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 sm extends qn{constructor(e){super("column",{...om(),...e});const t=this.createChildWrap();this.dom=U.create({tag:"li",className:[Je,"empty"],dataset:{hoverTag:Q.get("column")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),lu.editWindow(),lu.resizeHandle(new rm),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:`.${Ot}`,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 am={actionButtons:{buttons:["clone","move","remove"],disabled:[]}};let lm=class extends Gn{constructor(e){super("columns",e),this.config={all:am}}Component(e){return new sm(e)}};const Qh=new lm,cm=()=>Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[Ze]});class um extends qn{constructor(e){super("row",{...cm(),...e});const t=this.createChildWrap();this.dom=U.create({tag:"li",className:[Ze,"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:`.${Je}`,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(Cs);const p=n.dom,d=vs(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=Kf.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:ws}),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:ih},action:{change:({target:t})=>{const{value:n}=t;this.setColumnWidths(n)}},options:this.getColumnPresetOptions}}}const hm={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}};let dm=class extends Gn{constructor(e){super("rows",e),this.config={all:hm}}Component(e){return new um(e)}};const na=new dm,fm=()=>({conditions:[qs()],children:[]});class pm extends qn{constructor(e){super("stage",{...fm(),...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:[Dt,"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:`.${Ze}`,handle:".item-move"})}empty(e=!0){return new Promise(t=>{e?(this.dom.classList.add("removing-all-fields"),$e.slideUp(this.dom,Ye,()=>{t(super.empty(e)),this.dom.classList.remove("removing-all-fields"),$e.slideDown(this.dom,Ye)})):t(super.empty())})}onAdd(...e){const t=super.onAdd(...e);t?.name==="column"&&t.parent.autoColumnWidths()}}const gm=()=>({actionButtons:{buttons:["edit"],disabled:[]},panels:{disabled:[],order:["attrs","options","conditions"]}});let mm=class extends Gn{constructor(e){super("stages",e),this.config={all:gm()}}Component(e){return new pm(e)}};const en=new mm;class vm{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(`.${st}`);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 Hh(this.dependencies)}i18n(e,t){const n=Q.locale,d=this.definition?.i18n?.[n]||{};return(d[e]?.()??d[e])||Q.get(e,t)}}const ym=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 Zh=class{constructor(){this.data=new Map,this.buttonActions={focus:({target:e})=>{const t=e.closest(`.${st}`);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 vm(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=>Zl(d.id,this.options.disable.groups)),n=e.map(d=>{const g={tag:"ul",attrs:{className:[st,nh],id:`${d.id}-${st}`},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=[Zl(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=Qe(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 Qe(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=>{na.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(()=>Mm);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(()=>Am);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 Un(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(ym,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 Zh,bm=Object.freeze(Object.defineProperty({__proto__:null,Controls:Zh,default:Lt},Symbol.toStringTag,{value:"Module"})),wm=()=>({}),Cm=new Set(["checkbox","radio"]),Sm=new Set(["radio","checkbox","select-one","select-multiple"]);class Jh extends qn{constructor(e=Object.create(null)){super("field",{...wm(),...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:Ot},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(Sm.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}=Qe(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 Cm.has(this.get("config.controlId"))}}const Am=Object.freeze(Object.defineProperty({__proto__:null,default:Jh},Symbol.toStringTag,{value:"Module"})),$m=()=>({actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}});let Em=class extends Gn{constructor(e){super("fields",e),this.config={all:$m()}}Component(e){return new Jh(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=Hn(e);this.empty();for(const[n,p]of Object.entries(t)){const{meta:d,...g}=p;d?.id&&Un(g,"config.controlId",d?.id),this.add(n,g)}return this.data}};const ed=new Em,Cn=en,Sn=na,Zt=Qh,An=ed,On=Lt,Tm=(l,e=!1)=>l?Qe(Hn(l)):e&&Ju.get(sh)||En();class td extends Xs{constructor(){super("components"),this.disableEvents=!0,this.stages=Cn,this.rows=Sn,this.columns=Zt,this.fields=An,this.controls=On}load=(e,t)=>{this.empty();const n=Tm(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))eh(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@${Fs}/dist/formData_schema.json`,...this.formData})}get formData(){return{id:this.get("id"),stages:en.getData(),rows:na.getData(),columns:Qh.getData(),fields:ed.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[Ff.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 td,Mm=Object.freeze(Object.defineProperty({__proto__:null,Columns:Zt,Components:td,Controls:On,Fields:An,Rows:Sn,Stages:Cn,default:ce},Symbol.toStringTag,{value:"Module"})),cu="no-transition",_m={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(qf,{detail:e,bubbles:J.opts?.debug||J.opts?.bubbles});(l||document).dispatchEvent(p)}return n},J={init:function(l){return this.opts={..._m,...l},this},formeoSaved:l=>He(l,ah),formeoUpdated:(l,e)=>He(l,e||Jt),formeoCleared:l=>He(l,Yf),formeoOnRender:l=>He(l,dh),formeoConditionUpdated:l=>He(l,Xf),formeoAddedRow:l=>He(l,zs),formeoAddedColumn:l=>He(l,js),formeoAddedField:l=>He(l,Us),formeoRemovedRow:l=>He(l,Gs),formeoRemovedColumn:l=>He(l,Vs),formeoRemovedField:l=>He(l,Ks)},xm=xf(()=>{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,xm);document.addEventListener(lh,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(ch,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(uh,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(hh,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(zs,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onAddRow(p)});document.addEventListener(js,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onAddColumn(p)});document.addEventListener(Us,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onAddField(p)});document.addEventListener(Gs,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onRemoveRow(p)});document.addEventListener(Vs,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onRemoveColumn(p)});document.addEventListener(Ks,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onRemoveField(p)});document.addEventListener(dh,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(ah,({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 Go;function Lm(){Go=Go||window.requestAnimationFrame(()=>{Go=!1;for(const l of Object.values(Zt.data))l.dom.classList.add(cu),On.dom.classList.add(cu),On.panels.nav.refresh(),l.refreshFieldPanels()})}window.addEventListener("resize",Lm);const uu={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:ys}},Te={init:function(l){const e=Object.keys(uu);return this.opts=e.reduce((t,n)=>(t[n]={...uu[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||qs(),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&&Ju.set(sh,l),J.formeoSaved({formData:l}),Te.opts.save.form(l))}},Rm={"en-US":{"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 <fieldset> tag","row.settings.fieldsetWrap.aria":"Wrap Row in Fieldset",save:"Save",secondary:"Secondary",select:"Select",selectColor:"Select Color",selectionsMessage:"Allow Multiple Selections",selectOptions:"Options",separator:"Separator",settings:"Settings",size:"Size",sizes:"Sizes","sizes.lg":"Large","sizes.m":"Default","sizes.sm":"Small","sizes.xs":"Extra Small",style:"Style",styles:"Styles","styles.btn":"Button Style","styles.btn.danger":"Danger","styles.btn.default":"Default","styles.btn.info":"Info","styles.btn.primary":"Primary","styles.btn.success":"Success","styles.btn.warning":"Warning",subtype:"Type",success:"Success",text:"Text Field",then:"Then","then.condition.target.placeholder":"target",toggle:"Toggle",ungrouped:"Un-Grouped",warning:"Warning",yes:"Yes"}},km=Rm["en-US"],nd="en-US";Q.addLanguage(nd,km);Q.setCurrent(nd);const Dm={get editor(){return{stickyControls:!1,allowEdit:!0,dataType:"json",debug:!1,sessionStorage:!1,editorContainer:null,svgSprite:null,style:Df,iconFont:null,config:{},events:{},actions:{},controls:{},i18n:{location:"https://draggable.github.io/formeo/assets/lang/"},onLoad:()=>{}}}};new Nu;let id=class{constructor({formData:e,...t},n){const p=je(Dm.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}),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=[];e.push(Mg(this.opts.svgSprite),xg(this.opts.style),Q.init({...this.opts.i18n,locale:globalThis.sessionStorage?.getItem(tc)})),await Promise.all(e),this.opts.allowEdit&&this.init()}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(tc,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 globalThis.CustomEvent("formeoLoaded",{detail:{formeo:this}}),document.dispatchEvent(J.formeoLoaded)}};const Vo="f-",hu=l=>typeof l=="string"?document.querySelector(l):l,Om=({editorContainer:l,renderContainer:e,formData:t,...n})=>{const p={renderContainer:hu(e),editorContainer:hu(l),formData:Vt(t)};return{elements:{},...n,...p}},Ko=l=>l.match(tp)?.[0]||l``,du=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")},Im={isChecked:l=>l.checked,isNotChecked:l=>!l.checked,value:l=>l.value,isVisible:l=>du(l),isNotVisible:l=>!du(l)},Nm=()=>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()}}),fu={equals:Ss,notEquals:(l,e)=>!Ss(l,e),contains:(l,e)=>l.includes(e),notContains:(l,e)=>!l.includes(e)},Fm=Object.entries(fh).reduce((l,[e,t])=>(l[t]=fu[e],l[e]=fu[e],l),{}),pu={equals:(l,{targetProperty:e,value:t})=>{l[`_${e}`]=l[e],l[e]=t}},Pm=Object.entries(ph).reduce((l,[e,t])=>(l[t]=pu[e],l[e]=pu[e],l),{}),Wm={isChecked:l=>{l.checked=!0},isNotChecked:l=>{l.checked=!1},value:(l,{assignment:e,...t})=>{const n=Pm[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 rd=class{constructor(e,t){const{renderContainer:n,elements:p,formData:d}=Om(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=>Vo+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[Ko(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(`${Vo}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(Ko(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(Nm());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&&Hh(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=Dt,this.components[Ko(e.id)]=e,e))}handleComponentCondition=(e,t,n)=>{if(e.length){for(const g of e)this.handleComponentCondition(g,t,n);return}const p=Bm(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 Fm[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;Wm[t]?.(m,{targetProperty:t,assignment:n,value:p})}};getComponentProperty=(e,t)=>{const{component:n,option:p}=this.getComponent(e),d=p||n;return Im[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(`#${Vo}${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 Bm=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=id,window.FormeoRenderer=rd);const ia=id,ra=rd,Hm={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}}}}},zm={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"]}},jm=".build-form",Um=".render-form",tn={editorContainer:jm,actions:{},controls:zm,config:Hm,events:{onSave:console.log,onChange:console.log},sessionStorage:!0,editPanelOrder:["attrs","options"],onLoad:()=>{console.log("demo loaded")}},oa={renderContainer:Um,elements:{tinymce:{action:{onRender:l=>{if(l.id){const e=`#${l.id}`;window.tinymce.remove(e),window.tinymce.init({selector:e})}}}}}};async function Gm(l){l.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 ad(g).then(m=>{const c=Ut.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 X=new Ut;(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 ld=Object.defineProperty,cd=(l,e,t)=>e in l?ld(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t,Ke=(l,e,t)=>cd(l,typeof e!="symbol"?e+"":e,t);const ud="_3x4ZIcu-",hd="JIt36hCJ",Nt={tooltip:ud,visible:hd},dd={triggerName:"tooltip"};class Nu{constructor(e=dd){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=Nu);const fd="formeo",pd="4.2.2",Fu={name:fd,version:pd};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 Qn,ua;function gd(){if(ua)return Qn;ua=1;function l(){this.__data__=[],this.size=0}return Qn=l,Qn}var Jn,ha;function nn(){if(ha)return Jn;ha=1;function l(e,t){return e===t||e!==e&&t!==t}return Jn=l,Jn}var ei,da;function In(){if(da)return ei;da=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 ei=e,ei}var ti,fa;function md(){if(fa)return ti;fa=1;var l=In(),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 ti=n,ti}var ni,pa;function vd(){if(pa)return ni;pa=1;var l=In();function e(t){var n=this.__data__,p=l(n,t);return p<0?void 0:n[p][1]}return ni=e,ni}var ii,ga;function yd(){if(ga)return ii;ga=1;var l=In();function e(t){return l(this.__data__,t)>-1}return ii=e,ii}var ri,ma;function wd(){if(ma)return ri;ma=1;var l=In();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 ri=e,ri}var oi,va;function Nn(){if(va)return oi;va=1;var l=gd(),e=md(),t=vd(),n=yd(),p=wd();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,oi=d,oi}var si,ya;function bd(){if(ya)return si;ya=1;var l=Nn();function e(){this.__data__=new l,this.size=0}return si=e,si}var ai,wa;function Cd(){if(wa)return ai;wa=1;function l(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}return ai=l,ai}var li,ba;function Sd(){if(ba)return li;ba=1;function l(e){return this.__data__.get(e)}return li=l,li}var ci,Ca;function Ad(){if(Ca)return ci;Ca=1;function l(e){return this.__data__.has(e)}return ci=l,ci}var ui,Sa;function Pu(){if(Sa)return ui;Sa=1;var l=typeof an=="object"&&an&&an.Object===Object&&an;return ui=l,ui}var hi,Aa;function qe(){if(Aa)return hi;Aa=1;var l=Pu(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=l||e||Function("return this")();return hi=t,hi}var di,$a;function Fn(){if($a)return di;$a=1;var l=qe(),e=l.Symbol;return di=e,di}var fi,Ma;function $d(){if(Ma)return fi;Ma=1;var l=Fn(),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 fi=d,fi}var pi,xa;function Md(){if(xa)return pi;xa=1;var l=Object.prototype,e=l.toString;function t(n){return e.call(n)}return pi=t,pi}var gi,Ea;function kt(){if(Ea)return gi;Ea=1;var l=Fn(),e=$d(),t=Md(),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 gi=g,gi}var mi,_a;function ct(){if(_a)return mi;_a=1;function l(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return mi=l,mi}var vi,Ta;function _s(){if(Ta)return vi;Ta=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 vi=g,vi}var yi,La;function xd(){if(La)return yi;La=1;var l=qe(),e=l["__core-js_shared__"];return yi=e,yi}var wi,Ra;function Ed(){if(Ra)return wi;Ra=1;var l=xd(),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 bi,ka;function Hu(){if(ka)return bi;ka=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 bi=t,bi}var Ci,Da;function _d(){if(Da)return Ci;Da=1;var l=_s(),e=Ed(),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 Ci=o,Ci}var Si,Oa;function Td(){if(Oa)return Si;Oa=1;function l(e,t){return e?.[t]}return Si=l,Si}var Ai,Ia;function yt(){if(Ia)return Ai;Ia=1;var l=_d(),e=Td();function t(n,p){var d=e(n,p);return l(d)?d:void 0}return Ai=t,Ai}var $i,Na;function Ts(){if(Na)return $i;Na=1;var l=yt(),e=qe(),t=l(e,"Map");return $i=t,$i}var Mi,Fa;function Pn(){if(Fa)return Mi;Fa=1;var l=yt(),e=l(Object,"create");return Mi=e,Mi}var xi,Pa;function Ld(){if(Pa)return xi;Pa=1;var l=Pn();function e(){this.__data__=l?l(null):{},this.size=0}return xi=e,xi}var Ei,Ha;function Rd(){if(Ha)return Ei;Ha=1;function l(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return Ei=l,Ei}var _i,Wa;function kd(){if(Wa)return _i;Wa=1;var l=Pn(),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 _i=p,_i}var Ti,za;function Dd(){if(za)return Ti;za=1;var l=Pn(),e=Object.prototype,t=e.hasOwnProperty;function n(p){var d=this.__data__;return l?d[p]!==void 0:t.call(d,p)}return Ti=n,Ti}var Li,Ba;function Od(){if(Ba)return Li;Ba=1;var l=Pn(),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 Li=t,Li}var Ri,ja;function Id(){if(ja)return Ri;ja=1;var l=Ld(),e=Rd(),t=kd(),n=Dd(),p=Od();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,Ri=d,Ri}var ki,Va;function Nd(){if(Va)return ki;Va=1;var l=Id(),e=Nn(),t=Ts();function n(){this.size=0,this.__data__={hash:new l,map:new(t||e),string:new l}}return ki=n,ki}var Di,Ua;function Fd(){if(Ua)return Di;Ua=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 Oi,Ga;function Hn(){if(Ga)return Oi;Ga=1;var l=Fd();function e(t,n){var p=t.__data__;return l(n)?p[typeof n=="string"?"string":"hash"]:p.map}return Oi=e,Oi}var Ii,qa;function Pd(){if(qa)return Ii;qa=1;var l=Hn();function e(t){var n=l(this,t).delete(t);return this.size-=n?1:0,n}return Ii=e,Ii}var Ni,Ka;function Hd(){if(Ka)return Ni;Ka=1;var l=Hn();function e(t){return l(this,t).get(t)}return Ni=e,Ni}var Fi,Ya;function Wd(){if(Ya)return Fi;Ya=1;var l=Hn();function e(t){return l(this,t).has(t)}return Fi=e,Fi}var Pi,Za;function zd(){if(Za)return Pi;Za=1;var l=Hn();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 Pi=e,Pi}var Hi,Xa;function Ls(){if(Xa)return Hi;Xa=1;var l=Nd(),e=Pd(),t=Hd(),n=Wd(),p=zd();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,Hi=d,Hi}var Wi,Qa;function Bd(){if(Qa)return Wi;Qa=1;var l=Nn(),e=Ts(),t=Ls(),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 Wi=p,Wi}var zi,Ja;function Wu(){if(Ja)return zi;Ja=1;var l=Nn(),e=bd(),t=Cd(),n=Sd(),p=Ad(),d=Bd();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 Bi,el;function zu(){if(el)return Bi;el=1;var l=yt(),e=(function(){try{var t=l(Object,"defineProperty");return t({},"",{}),t}catch{}})();return Bi=e,Bi}var ji,tl;function Rs(){if(tl)return ji;tl=1;var l=zu();function e(t,n,p){n=="__proto__"&&l?l(t,n,{configurable:!0,enumerable:!0,value:p,writable:!0}):t[n]=p}return ji=e,ji}var Vi,nl;function Bu(){if(nl)return Vi;nl=1;var l=Rs(),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 Vi=t,Vi}var Ui,il;function jd(){if(il)return Ui;il=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 Ui=l,Ui}var Gi,rl;function Vd(){if(rl)return Gi;rl=1;var l=jd(),e=l();return Gi=e,Gi}var Ht={exports:{}};Ht.exports;var ol;function Ud(){return ol||(ol=1,(function(l,e){var t=qe(),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})(Ht,Ht.exports)),Ht.exports}var qi,sl;function ju(){if(sl)return qi;sl=1;var l=qe(),e=l.Uint8Array;return qi=e,qi}var Ki,al;function Gd(){if(al)return Ki;al=1;var l=ju();function e(t){var n=new t.constructor(t.byteLength);return new l(n).set(new l(t)),n}return Ki=e,Ki}var Yi,ll;function qd(){if(ll)return Yi;ll=1;var l=Gd();function e(t,n){var p=n?l(t.buffer):t.buffer;return new t.constructor(p,t.byteOffset,t.length)}return Yi=e,Yi}var Zi,cl;function Kd(){if(cl)return Zi;cl=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 Zi=l,Zi}var Xi,ul;function Yd(){if(ul)return Xi;ul=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 Xi=t,Xi}var Qi,hl;function Vu(){if(hl)return Qi;hl=1;function l(e,t){return function(n){return e(t(n))}}return Qi=l,Qi}var Ji,dl;function Uu(){if(dl)return Ji;dl=1;var l=Vu(),e=l(Object.getPrototypeOf,Object);return Ji=e,Ji}var er,fl;function ks(){if(fl)return er;fl=1;var l=Object.prototype;function e(t){var n=t&&t.constructor,p=typeof n=="function"&&n.prototype||l;return t===p}return er=e,er}var tr,pl;function Zd(){if(pl)return tr;pl=1;var l=Yd(),e=Uu(),t=ks();function n(p){return typeof p.constructor=="function"&&!t(p)?l(e(p)):{}}return tr=n,tr}var nr,gl;function wt(){if(gl)return nr;gl=1;function l(e){return e!=null&&typeof e=="object"}return nr=l,nr}var ir,ml;function Xd(){if(ml)return ir;ml=1;var l=kt(),e=wt(),t="[object Arguments]";function n(p){return e(p)&&l(p)==t}return ir=n,ir}var rr,vl;function Gu(){if(vl)return rr;vl=1;var l=Xd(),e=wt(),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 rr=d,rr}var or,yl;function bt(){if(yl)return or;yl=1;var l=Array.isArray;return or=l,or}var sr,wl;function qu(){if(wl)return sr;wl=1;var l=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=l}return sr=e,sr}var ar,bl;function Wn(){if(bl)return ar;bl=1;var l=_s(),e=qu();function t(n){return n!=null&&e(n.length)&&!l(n)}return ar=t,ar}var lr,Cl;function Qd(){if(Cl)return lr;Cl=1;var l=Wn(),e=wt();function t(n){return e(n)&&l(n)}return lr=t,lr}var Wt={exports:{}},cr,Sl;function Jd(){if(Sl)return cr;Sl=1;function l(){return!1}return cr=l,cr}Wt.exports;var Al;function Ds(){return Al||(Al=1,(function(l,e){var t=qe(),n=Jd(),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})(Wt,Wt.exports)),Wt.exports}var ur,$l;function ef(){if($l)return ur;$l=1;var l=kt(),e=Uu(),t=wt(),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 ur=f,ur}var hr,Ml;function tf(){if(Ml)return hr;Ml=1;var l=kt(),e=qu(),t=wt(),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]",w="[object Float32Array]",x="[object Float64Array]",$="[object Int8Array]",A="[object Int16Array]",S="[object Int32Array]",E="[object Uint8Array]",R="[object Uint8ClampedArray]",L="[object Uint16Array]",_="[object Uint32Array]",D={};D[w]=D[x]=D[$]=D[A]=D[S]=D[E]=D[R]=D[L]=D[_]=!0,D[n]=D[p]=D[h]=D[d]=D[y]=D[g]=D[m]=D[c]=D[f]=D[r]=D[o]=D[s]=D[a]=D[i]=D[u]=!1;function b(v){return t(v)&&e(v.length)&&!!D[l(v)]}return hr=b,hr}var dr,xl;function nf(){if(xl)return dr;xl=1;function l(e){return function(t){return e(t)}}return dr=l,dr}var zt={exports:{}};zt.exports;var El;function rf(){return El||(El=1,(function(l,e){var t=Pu(),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})(zt,zt.exports)),zt.exports}var fr,_l;function Os(){if(_l)return fr;_l=1;var l=tf(),e=nf(),t=rf(),n=t&&t.isTypedArray,p=n?e(n):l;return fr=p,fr}var pr,Tl;function Ku(){if(Tl)return pr;Tl=1;function l(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return pr=l,pr}var gr,Ll;function Yu(){if(Ll)return gr;Ll=1;var l=Rs(),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 gr=p,gr}var mr,Rl;function of(){if(Rl)return mr;Rl=1;var l=Yu(),e=Rs();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 mr=t,mr}var vr,kl;function sf(){if(kl)return vr;kl=1;function l(e,t){for(var n=-1,p=Array(e);++n<e;)p[n]=t(n);return p}return vr=l,vr}var yr,Dl;function Is(){if(Dl)return yr;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 yr=t,yr}var wr,Ol;function Zu(){if(Ol)return wr;Ol=1;var l=sf(),e=Gu(),t=bt(),n=Ds(),p=Is(),d=Os(),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 w in f)(r||m.call(f,w))&&!(u&&(w=="length"||a&&(w=="offset"||w=="parent")||i&&(w=="buffer"||w=="byteLength"||w=="byteOffset")||p(w,y)))&&h.push(w);return h}return wr=c,wr}var br,Il;function af(){if(Il)return br;Il=1;function l(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}return br=l,br}var Cr,Nl;function lf(){if(Nl)return Cr;Nl=1;var l=ct(),e=ks(),t=af(),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 Cr=d,Cr}var Sr,Fl;function Xu(){if(Fl)return Sr;Fl=1;var l=Zu(),e=lf(),t=Wn();function n(p){return t(p)?l(p,!0):e(p)}return Sr=n,Sr}var Ar,Pl;function cf(){if(Pl)return Ar;Pl=1;var l=of(),e=Xu();function t(n){return l(n,e(n))}return Ar=t,Ar}var $r,Hl;function uf(){if(Hl)return $r;Hl=1;var l=Bu(),e=Ud(),t=qd(),n=Kd(),p=Zd(),d=Gu(),g=bt(),m=Qd(),c=Ds(),f=_s(),r=ct(),o=ef(),s=Os(),a=Ku(),i=cf();function u(h,y,w,x,$,A,S){var E=a(h,w),R=a(y,w),L=S.get(R);if(L){l(h,w,L);return}var _=A?A(E,R,w+"",h,y,S):void 0,D=_===void 0;if(D){var b=g(R),v=!b&&c(R),C=!b&&!v&&s(R);_=R,b||v||C?g(E)?_=E:m(E)?_=n(E):v?(D=!1,_=e(R,!0)):C?(D=!1,_=t(R,!0)):_=[]:o(R)||d(R)?(_=E,d(E)?_=i(E):(!r(E)||f(E))&&(_=p(R))):D=!1}D&&(S.set(R,_),$(_,R,x,A,S),S.delete(R)),l(h,w,_)}return $r=u,$r}var Mr,Wl;function hf(){if(Wl)return Mr;Wl=1;var l=Wu(),e=Bu(),t=Vd(),n=uf(),p=ct(),d=Xu(),g=Ku();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 Mr=m,Mr}var xr,zl;function Qu(){if(zl)return xr;zl=1;function l(e){return e}return xr=l,xr}var Er,Bl;function df(){if(Bl)return Er;Bl=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 Er=l,Er}var _r,jl;function ff(){if(jl)return _r;jl=1;var l=df(),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 _r=t,_r}var Tr,Vl;function pf(){if(Vl)return Tr;Vl=1;function l(e){return function(){return e}}return Tr=l,Tr}var Lr,Ul;function gf(){if(Ul)return Lr;Ul=1;var l=pf(),e=zu(),t=Qu(),n=e?function(p,d){return e(p,"toString",{configurable:!0,enumerable:!1,value:l(d),writable:!0})}:t;return Lr=n,Lr}var Rr,Gl;function mf(){if(Gl)return Rr;Gl=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 Rr=n,Rr}var kr,ql;function vf(){if(ql)return kr;ql=1;var l=gf(),e=mf(),t=e(l);return kr=t,kr}var Dr,Kl;function yf(){if(Kl)return Dr;Kl=1;var l=Qu(),e=ff(),t=vf();function n(p,d){return t(e(p,d,l),p+"")}return Dr=n,Dr}var Or,Yl;function wf(){if(Yl)return Or;Yl=1;var l=nn(),e=Wn(),t=Is(),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 Or=p,Or}var Ir,Zl;function bf(){if(Zl)return Ir;Zl=1;var l=yf(),e=wf();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 Ir=t,Ir}var Nr,Xl;function Cf(){if(Xl)return Nr;Xl=1;var l=hf(),e=bf(),t=e(function(n,p,d,g){l(n,p,d,g)});return Nr=t,Nr}var Sf=Cf();const Af=Rt(Sf),$f=()=>crypto.randomUUID().slice(0,8),Mf=()=>$f().slice(0,8),Ql=(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},xf=(l,e)=>{const t=l.indexOf(e);t!==-1&&l.splice(t,1)},Le=l=>{const e=l.className?.match(zf);return e&&Hf[e[0]]},gt=l=>Array.from(new Set(l)),He=l=>l?.attrs?.id||l?.id||Mf(),je=(l,e)=>Af({},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.")},Fr=(l,e)=>l/e*100,vs=l=>`${l.toString()}%`,Ju=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),Ef=l=>If.test(l);function _f(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 ys(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 Gt=l=>l?Xe(zn(l)):Mn();function eh(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)eh(l,m,d,n)}return n}const Tf='<?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><symbol id="f-i-autocomplete" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M6,5h1v1H6V5z M4,4H3v1h1V4z M6,4H5v1h1V4z M2,5v1h1V5H2z M3,7h1V6H3V7z M5,7h1V6H5V7z M4,5v1h1V5H4z M2,14h1v-1H2V14z M4,14h1v-1H4V14z M6,14h1v-1H6V14z M9,13H8v1h1V13z M16,3.5v4C16,8.3,15.3,9,14.5,9H14v3v3c0,0.6-0.4,1-1,1H1c-0.6,0-1-0.4-1-1V3.5 C0,2.7,0.7,2,1.5,2h3H8V1.5V1H7H6V0.5V0h2.5H11v0.5V1h-1H9v0.5V2h3h2.5C15.3,2,16,2.7,16,3.5z M13,12H7H1v3h12V12z M3,11v-1H2v1H3z M5,11v-1H4v1H5z M15,3.5C15,3.2,14.8,3,14.5,3H9v2.5V8H8.5H8V7.5V7H7V6h1V5.5V5H7V4h1V3.5V3H1.5C1.2,3,1,3.2,1,3.5v4 C1,7.8,1.2,8,1.5,8H8v1H6v0.5V10h2.5H11V9.5V9H9V8h5.5C14.8,8,15,7.8,15,7.5V3.5z"/></symbol><symbol viewBox="0 0 32 32" id="f-i-bin" xmlns="http://www.w3.org/2000/svg"><path d="M4 10v20c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2v-20h-22zM10 28h-2v-14h2v14zM14 28h-2v-14h2v14zM18 28h-2v-14h2v14zM22 28h-2v-14h2v14zM26.5 4h-6.5v-2.5c0-.825-.675-1.5-1.5-1.5h-7c-.825 0-1.5.675-1.5 1.5v2.5h-6.5c-.825 0-1.5.675-1.5 1.5v2.5h26v-2.5c0-.825-.675-1.5-1.5-1.5zM18 4h-6v-1.975h6v1.975z"/></symbol><symbol id="f-i-button" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><metadata id="acprefix__metadata8"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><path id="acprefix__rect4140" d="M 0.4765625,4 A 0.47706934,0.47706934 0 0 0 0,4.4765625 L 0,11.523438 A 0.47706934,0.47706934 0 0 0 0.4765625,12 L 15.523438,12 A 0.47706934,0.47706934 0 0 0 16,11.523438 L 16,4.4765625 A 0.47706934,0.47706934 0 0 0 15.523438,4 L 0.4765625,4 Z m 0.4765625,0.953125 14.09375,0 0,6.09375 -14.09375,0 0,-6.09375 z"/><g id="acprefix__layer1"><g id="acprefix__text4203"><g id="acprefix__g4212" transform="translate(0.10112835,0.1001358)"><path id="acprefix__path4208" d="m 6.0690374,6.4093857 q -0.5371093,0 -0.8544922,0.4003906 -0.3149414,0.4003906 -0.3149414,1.0913086 0,0.6884766 0.3149414,1.0888672 0.3173829,0.4003906 0.8544922,0.4003906 0.5371094,0 0.8496094,-0.4003906 0.3149414,-0.4003906 0.3149414,-1.0888672 0,-0.690918 -0.3149414,-1.0913086 -0.3125,-0.4003906 -0.8496094,-0.4003906 z m 0,-0.4003906 q 0.7666016,0 1.225586,0.5151367 0.4589843,0.5126953 0.4589843,1.3769531 0,0.8618164 -0.4589843,1.3769531 -0.4589844,0.5126953 -1.225586,0.5126953 -0.7690429,0 -1.2304687,-0.5126953 -0.4589844,-0.5126953 -0.4589844,-1.3769531 0,-0.8642578 0.4589844,-1.3769531 0.4614258,-0.5151367 1.2304687,-0.5151367 z"/><path id="acprefix__path4210" d="m 8.5250921,6.074913 0.4931641,0 0,1.5405274 1.6357418,-1.5405274 0.634766,0 -1.809082,1.6992188 1.938477,1.9458008 -0.649415,0 -1.7504878,-1.7553711 0,1.7553711 -0.4931641,0 0,-3.6450196 z"/></g></g></g></symbol><symbol viewBox="0 0 32 32" id="f-i-calendar" xmlns="http://www.w3.org/2000/svg"><path d="M12.048 16.961c-0.178 0.257-0.395 0.901-0.652 1.059-0.257 0.157-0.547 0.267-0.869 0.328-0.323 0.062-0.657 0.089-1.002 0.079v1.527h2.467v6.046h1.991v-9.996h-1.584c-0.056 0.381-0.173 0.7-0.351 0.957zM23 8h2c0.553 0 1-0.448 1-1v-6c0-0.552-0.447-1-1-1h-2c-0.553 0-1 0.448-1 1v6c0 0.552 0.447 1 1 1zM7 8h2c0.552 0 1-0.448 1-1v-6c0-0.552-0.448-1-1-1h-2c-0.552 0-1 0.448-1 1v6c0 0.552 0.448 1 1 1zM30 4h-2v5c0 0.552-0.447 1-1 1h-6c-0.553 0-1-0.448-1-1v-5h-8v5c0 0.552-0.448 1-1 1h-6c-0.552 0-1-0.448-1-1v-5h-2c-1.104 0-2 0.896-2 2v24c0 1.104 0.896 2 2 2h28c1.104 0 2-0.896 2-2v-24c0-1.104-0.896-2-2-2zM30 29c0 0.553-0.447 1-1 1h-26c-0.552 0-1-0.447-1-1v-16c0-0.552 0.448-1 1-1h26c0.553 0 1 0.448 1 1v16zM15.985 17.982h4.968c-0.936 1.152-1.689 2.325-2.265 3.705-0.575 1.381-0.638 2.818-0.749 4.312h2.131c0.009-0.666-0.195-1.385-0.051-2.156 0.146-0.771 0.352-1.532 0.617-2.285 0.267-0.752 0.598-1.461 0.996-2.127 0.396-0.667 0.853-1.229 1.367-1.686v-1.742h-7.015v1.979z"/></symbol><symbol id="f-i-checkbox" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M13.5,5v8c0,0.8-0.7,1.5-1.5,1.5H3c-0.8,0-1.5-0.7-1.5-1.5V4c0-0.8,0.7-1.5,1.5-1.5h9c0.7,0,1.3,0.5,1.5,1.2l2.4-1.4L13.5,5 z M12.5,6.2L7.7,12L2.8,5.5l4.9,1.6l4.8-2.9V4c0-0.3-0.2-0.5-0.5-0.5H3C2.7,3.5,2.5,3.7,2.5,4v9c0,0.3,0.2,0.5,0.5,0.5h9 c0.3,0,0.5-0.2,0.5-0.5V6.2z"/></symbol><symbol id="f-i-checkbox-group" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M0,1h16V0H0V1z M0,3h16V2H0V3z M6,5v1h9V5H6z M15,14v-1H6v1H15z M6,10h9V9H6V10z M4,12l-2.5,1.5L0,13l1.5,2L4,12z M4,8 L1.5,9.5L0,9l1.5,2L4,8z M4,4L1.5,5.5L0,5l1.5,2L4,4z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-columns" xmlns="http://www.w3.org/2000/svg"><metadata id="agprefix__metadata4318"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><path id="agprefix__rect4860-3-5" d="M 16,0.5 A 0.50004997,0.50004997 0 0 0 15.5,0 l -5,0 -5,0 -5,0 A 0.50004997,0.50004997 0 0 0 0,0.5 l 0,15 A 0.50004997,0.50004997 0 0 0 0.5,16 l 5,0 5,0 5,0 A 0.50004997,0.50004997 0 0 0 16,15.5 l 0,-15 z M 15,1 15,15 11,15 11,1 15,1 Z M 10,1 10,15 6,15 6,1 10,1 Z M 5,1 5,15 1,15 1,1 5,1 Z"/></symbol><symbol viewBox="0 0 32 32" id="f-i-copy" xmlns="http://www.w3.org/2000/svg"><path d="M20 8v-8h-14l-6 6v18h12v8h20v-24h-12zM6 2.828v3.172h-3.172l3.172-3.172zM2 22v-14h6v-6h10v6l-6 6v8h-10zM18 10.828v3.172h-3.172l3.172-3.172zM30 30h-16v-14h6v-6h10v20z"/></symbol><symbol id="f-i-divider" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg"><metadata id="aiprefix__metadata10"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><rect y="7" x="0" height="1" width="15" id="aiprefix__rect4182"/></symbol><symbol viewBox="0 0 28 32" id="f-i-edit" xmlns="http://www.w3.org/2000/svg"><path d="M22 2l-4 4 6 6 4-4-6-6zM0 24l0.021 6.018 5.979-0.018 16-16-6-6-16 16zM6 28h-4v-4h2v2h2v2z"/></symbol><symbol fill="#000000" viewBox="0 0 24 24" id="f-i-email" xmlns="http://www.w3.org/2000/svg"><path d="M12,2 C17.4292399,2 21.8479317,6.32667079 21.9961582,11.7200952 L22,12 L22,13 C22,15.1729208 20.477434,17 18.5,17 C17.3269391,17 16.3139529,16.3570244 15.6839382,15.3803024 C14.770593,16.3757823 13.4581934,17 12,17 C9.23857625,17 7,14.7614237 7,12 C7,9.23857625 9.23857625,7 12,7 C14.6887547,7 16.8818181,9.12230671 16.9953805,11.7831104 L17,12 L17,13 C17,14.1407877 17.7160103,15 18.5,15 C19.2447902,15 19.928229,14.2245609 19.9947109,13.1689341 L20,13 L20,12 C20,7.581722 16.418278,4 12,4 C7.581722,4 4,7.581722 4,12 C4,16.418278 7.581722,20 12,20 C13.1630948,20 14.2892822,19.7522618 15.3225159,19.2798331 C15.8247876,19.0501777 16.4181317,19.271177 16.647787,19.7734487 C16.8774423,20.2757205 16.656443,20.8690646 16.1541713,21.0987199 C14.861218,21.689901 13.4515463,22 12,22 C6.4771525,22 2,17.5228475 2,12 C2,6.4771525 6.4771525,2 12,2 Z M12,9 C10.3431458,9 9,10.3431458 9,12 C9,13.6568542 10.3431458,15 12,15 C13.6568542,15 15,13.6568542 15,12 C15,10.3431458 13.6568542,9 12,9 Z"/></symbol><symbol viewBox="0 0 32 32" id="f-i-floppy-disk" xmlns="http://www.w3.org/2000/svg"><path d="M28 0h-28v32h32v-28l-4-4zM16 4h4v8h-4v-8zM28 28h-24v-24h2v10h18v-10h2.343l1.657 1.657v22.343z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle" xmlns="http://www.w3.org/2000/svg"><metadata id="aqprefix__metadata8"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><g transform="translate(0,-2)" id="aqprefix__g4220"><rect id="aqprefix__rect4191" width="2" height="2" x="2" y="7"/><rect id="aqprefix__rect4191-2" width="2" height="2" x="7" y="7"/><rect id="aqprefix__rect4191-4" width="2" height="2" x="12" y="7"/></g><g transform="translate(0,2)" id="aqprefix__g4220-6"><rect id="aqprefix__rect4191-40" width="2" height="2" x="2" y="7"/><rect id="aqprefix__rect4191-2-3" width="2" height="2" x="7" y="7"/><rect id="aqprefix__rect4191-4-9" width="2" height="2" x="12" y="7"/></g></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-column" xmlns="http://www.w3.org/2000/svg"><path d="M2 7h2v2H2zM7 7h2v2H7zM12 7h2v2h-2zM2 12h2v2H2zM7 12h2v2H7zM12 12h2v2h-2z" transform="rotate(90 9.25 9.25)"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-field" xmlns="http://www.w3.org/2000/svg"><path d="M9.5-6.5h2v2h-2zm-5 0h2v2h-2zm5-5h2v2h-2zm-5 0h2v2h-2z" transform="rotate(90)"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-row" xmlns="http://www.w3.org/2000/svg"><path d="M12 9.5h2v2h-2zm-5 0h2v2H7Zm-5 0h2v2H2Zm10-5h2v2h-2zm-5 0h2v2H7Zm-5 0h2v2H2Z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-handle-stage" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5h2v2H2zM7 4.5h2v2H7zM12 4.5h2v2h-2zM2 9.5h2v2H2zM7 9.5h2v2H7zM12 9.5h2v2h-2zM2-.5h2v2H2zM7-.5h2v2H7zM12-.5h2v2h-2z" transform="translate(0 2.5)"/></symbol><symbol viewBox="0 0 448 512" id="f-i-hash" xmlns="http://www.w3.org/2000/svg"><g id="arprefix__icomoon-ignore"/><path fill="#000" d="M448 192v-64h-80.064l16-128h-64l-16 128h-127.968l16-128h-64l-16 128h-111.968v64h103.968l-15.968 128h-88v64h80l-16 128h64l16-128h127.968l-16 128h64.032l16-128h112v-64h-104l15.936-128h88.064zM279.968 320h-127.968l15.968-128h127.968l-15.968 128z"/></symbol><symbol viewBox="0 0 28 28" id="f-i-header" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M26.281 26q-0.688 0-2.070-0.055t-2.086-0.055q-0.688 0-2.063 0.055t-2.063 0.055q-0.375 0-0.578-0.32t-0.203-0.711q0-0.484 0.266-0.719t0.609-0.266 0.797-0.109 0.703-0.234q0.516-0.328 0.516-2.188l-0.016-6.109q0-0.328-0.016-0.484-0.203-0.063-0.781-0.063h-10.547q-0.594 0-0.797 0.063-0.016 0.156-0.016 0.484l-0.016 5.797q0 2.219 0.578 2.562 0.25 0.156 0.75 0.203t0.891 0.055 0.703 0.234 0.313 0.711q0 0.406-0.195 0.75t-0.57 0.344q-0.734 0-2.18-0.055t-2.164-0.055q-0.672 0-2 0.055t-1.984 0.055q-0.359 0-0.555-0.328t-0.195-0.703q0-0.469 0.242-0.703t0.562-0.273 0.742-0.117 0.656-0.234q0.516-0.359 0.516-2.234l-0.016-0.891v-12.703q0-0.047 0.008-0.406t0-0.57-0.023-0.602-0.055-0.656-0.102-0.57-0.172-0.492-0.25-0.281q-0.234-0.156-0.703-0.187t-0.828-0.031-0.641-0.219-0.281-0.703q0-0.406 0.187-0.75t0.562-0.344q0.719 0 2.164 0.055t2.164 0.055q0.656 0 1.977-0.055t1.977-0.055q0.391 0 0.586 0.344t0.195 0.75q0 0.469-0.266 0.68t-0.602 0.227-0.773 0.063-0.672 0.203q-0.547 0.328-0.547 2.5l0.016 5q0 0.328 0.016 0.5 0.203 0.047 0.609 0.047h10.922q0.391 0 0.594-0.047 0.016-0.172 0.016-0.5l0.016-5q0-2.172-0.547-2.5-0.281-0.172-0.914-0.195t-1.031-0.203-0.398-0.773q0-0.406 0.195-0.75t0.586-0.344q0.688 0 2.063 0.055t2.063 0.055q0.672 0 2.016-0.055t2.016-0.055q0.391 0 0.586 0.344t0.195 0.75q0 0.469-0.273 0.688t-0.625 0.227-0.805 0.047-0.688 0.195q-0.547 0.359-0.547 2.516l0.016 14.734q0 1.859 0.531 2.188 0.25 0.156 0.719 0.211t0.836 0.070 0.648 0.242 0.281 0.695q0 0.406-0.187 0.75t-0.562 0.344z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-hidden" xmlns="http://www.w3.org/2000/svg"><path d="M0 12h1v-1H0Zm15-7h1V4h-1zm-1 7h1v-1h-1zm-2 0h1v-1h-1zm-2 0h1v-1h-1Zm-2 0h1v-1H8Zm-2 0h1v-1H6Zm-2 0h1v-1H4Zm-2 0h1v-1H2Zm13-1h1v-1h-1ZM0 10h1V9H0Zm15-1h1V8h-1ZM0 8h1V7H0Zm15-1h1V6h-1ZM0 6h1V5H0Zm13-1h1V4h-1zm-2 0h1V4h-1ZM9 5h1V4H9ZM7 5h1V4H7ZM5 5h1V4H5ZM3 5h1V4H3ZM1 5h1V4H1Z"/></symbol><symbol viewBox="0 0 384 512" id="f-i-menu" xmlns="http://www.w3.org/2000/svg"><g id="auprefix__icomoon-ignore"/><path d="M0 96v64h384v-64h-384zM0 288h384v-64h-384v64zM0 416h384v-64h-384v64z"/></symbol><symbol viewBox="0 0 24 24" fill="none" id="f-i-minus" xmlns="http://www.w3.org/2000/svg"><path d="M6 12L18 12" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></symbol><symbol viewBox="0 0 512 512" id="f-i-move" xmlns="http://www.w3.org/2000/svg"><path d="M287.744 94.736v129.008h128v-64l96.256 96.256-96.256 96.24v-65.488h-128v129.008h64.496l-96.24 96.24-96.256-96.24h64v-129.008h-128v64.992l-95.744-95.744 95.744-95.744v63.488h128v-129.008h-62.496l94.752-94.736 94.752 94.736h-63.008z"/></symbol><symbol viewBox="0 0 512 512" id="f-i-move-vertical" xmlns="http://www.w3.org/2000/svg"><metadata id="awprefix__metadata10"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="3440" inkscape:window-height="1416" id="awprefix__namedview6" showgrid="false" inkscape:zoom="1.84375" inkscape:cx="421.4312" inkscape:cy="218.56484" inkscape:window-x="0" inkscape:window-y="24" inkscape:window-maximized="1" inkscape:current-layer="svg2" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"/><path d="m 287.744,94.736 0,321.024 64.496,0 L 256,512 l -96.256,-96.24 64,0 0,-321.024 -62.496,0 L 256,0 350.752,94.736 Z" id="awprefix__path4" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" inkscape:connector-curvature="0" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" sodipodi:nodetypes="ccccccccccc"/></symbol><symbol viewBox="0 0 20 28" id="f-i-paragraph" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M19.969 2.953v1.141q0 0.453-0.289 0.953t-0.664 0.5q-0.781 0-0.844 0.016-0.406 0.094-0.5 0.484-0.047 0.172-0.047 1v18q0 0.391-0.281 0.672t-0.672 0.281h-1.687q-0.391 0-0.672-0.281t-0.281-0.672v-19.031h-2.234v19.031q0 0.391-0.273 0.672t-0.68 0.281h-1.687q-0.406 0-0.68-0.281t-0.273-0.672v-7.75q-2.297-0.187-3.828-0.922-1.969-0.906-3-2.797-1-1.828-1-4.047 0-2.594 1.375-4.469 1.375-1.844 3.266-2.484 1.734-0.578 6.516-0.578h7.484q0.391 0 0.672 0.281t0.281 0.672z"/></symbol><symbol id="f-i-phone-receiver" viewBox="0 0 578.106 578.106" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><g><g><path d="M577.83,456.128c1.225,9.385-1.635,17.545-8.568,24.48l-81.396,80.781 c-3.672,4.08-8.465,7.551-14.381,10.404c-5.916,2.857-11.729,4.693-17.439,5.508c-0.408,0-1.635,0.105-3.676,0.309 c-2.037,0.203-4.689,0.307-7.953,0.307c-7.754,0-20.301-1.326-37.641-3.979s-38.555-9.182-63.645-19.584 c-25.096-10.404-53.553-26.012-85.376-46.818c-31.823-20.805-65.688-49.367-101.592-85.68 c-28.56-28.152-52.224-55.08-70.992-80.783c-18.768-25.705-33.864-49.471-45.288-71.299 c-11.425-21.828-19.993-41.616-25.705-59.364S4.59,177.362,2.55,164.51s-2.856-22.95-2.448-30.294 c0.408-7.344,0.612-11.424,0.612-12.24c0.816-5.712,2.652-11.526,5.508-17.442s6.324-10.71,10.404-14.382L98.022,8.756 c5.712-5.712,12.24-8.568,19.584-8.568c5.304,0,9.996,1.53,14.076,4.59s7.548,6.834,10.404,11.322l65.484,124.236 c3.672,6.528,4.692,13.668,3.06,21.42c-1.632,7.752-5.1,14.28-10.404,19.584l-29.988,29.988c-0.816,0.816-1.53,2.142-2.142,3.978 s-0.918,3.366-0.918,4.59c1.632,8.568,5.304,18.36,11.016,29.376c4.896,9.792,12.444,21.726,22.644,35.802 s24.684,30.293,43.452,48.653c18.36,18.77,34.68,33.354,48.96,43.76c14.277,10.4,26.215,18.053,35.803,22.949 c9.588,4.896,16.932,7.854,22.031,8.871l7.648,1.531c0.816,0,2.145-0.307,3.979-0.918c1.836-0.613,3.162-1.326,3.979-2.143 l34.883-35.496c7.348-6.527,15.912-9.791,25.705-9.791c6.938,0,12.443,1.223,16.523,3.672h0.611l118.115,69.768 C571.098,441.238,576.197,447.968,577.83,456.128z"/></g></g><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/></symbol><symbol viewBox="0 0 24 24" fill="none" id="f-i-plus" xmlns="http://www.w3.org/2000/svg"><path d="M6 12H18M12 6V18" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></symbol><symbol id="f-i-radio-group" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M0,1h16V0H0V1z M0,3h16V2H0V3z M5,6h10V5H5V6z M15,9H5v1h10V9z M15,14v-1H5v1H15z M1.5,7C0.7,7,0,6.3,0,5.5S0.7,4,1.5,4 S3,4.7,3,5.5S2.3,7,1.5,7z M1.5,5C1.2,5,1,5.2,1,5.5S1.2,6,1.5,6S2,5.8,2,5.5S1.8,5,1.5,5z M1.5,11.1C0.7,11.1,0,10.4,0,9.6 s0.7-1.5,1.5-1.5S3,8.7,3,9.6S2.3,11.1,1.5,11.1z M1.5,9.1C1.2,9.1,1,9.3,1,9.6s0.2,0.5,0.5,0.5S2,9.8,2,9.6S1.8,9.1,1.5,9.1z M1.5,15C0.7,15,0,14.3,0,13.5S0.7,12,1.5,12S3,12.7,3,13.5S2.3,15,1.5,15z M1.5,13C1.2,13,1,13.2,1,13.5S1.2,14,1.5,14 S2,13.8,2,13.5S1.8,13,1.5,13z"/></symbol><symbol viewBox="0 0 512 512" id="f-i-remove" xmlns="http://www.w3.org/2000/svg"><path d="M193.694-139.2h87.322v510.916h-87.322zM-18.103 159.92V72.597h510.915v87.322z" transform="rotate(45 77.994 208.636)"/></symbol><symbol id="f-i-rich-text" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M15,1H1C0.4,1,0,1.4,0,2v12c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1V2C16,1.4,15.6,1,15,1z M1,3.1h0.8v0.3H1V3.1z M1,3.6h0.8 v0.3H1V3.6z M15,14H1V5.1h14V14z M15,4.9H1V4.6h14V4.9z M15,4.4H1V4.1h0.8v0.2h1.5V4.1h1.3v0.2H6V4.1h1.3v0.2h1.5V4.1H10v0.2h1.5 V4.1h1.3v0.2h1.5V4.1H15V4.4z M4.5,3.6v0.3H3.3V3.6H4.5z M3.3,3.4V3.1h1.3v0.3H3.3z M7.3,3.6v0.3H6V3.6H7.3z M6,3.4V3.1h1.3v0.3H6z M10,3.6v0.3H8.8V3.6H10z M8.8,3.4V3.1H10v0.3H8.8z M12.8,3.6v0.3h-1.3V3.6H12.8z M11.5,3.4V3.1h1.3v0.3H11.5z M15,3.9h-0.8V3.6H15 V3.9z M15,3.4h-0.8V3.1H15V3.4z M15,2.9h-0.8V2.8h-1.5v0.2h-1.3V2.8H10v0.2H8.8V2.8H7.3v0.2H6V2.8H4.5v0.2H3.3V2.8H1.8v0.2H1V2.6h14 V2.9z M15,2.4H1V2.1h14V2.4z M3,12v-1h10v1H3z M13,10H3V9h10V10z M11,8H3V7h8V8z"/></symbol><symbol xml:space="preserve" viewBox="0 0 16 16" id="f-i-rows" xmlns="http://www.w3.org/2000/svg"><metadata id="beprefix__metadata4318"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><cc:Work rdf:about="" xmlns:cc="http://creativecommons.org/ns#"><dc:format xmlns:dc="http://purl.org/dc/elements/1.1/">image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" xmlns:dc="http://purl.org/dc/elements/1.1/"/><dc:title xmlns:dc="http://purl.org/dc/elements/1.1/"/></cc:Work></rdf:RDF></metadata><g transform="matrix(0,1,-1,0,3.0984025,11.835155)" id="beprefix__g7209"><path id="beprefix__rect4860-3-5" d="m 4.1640625,-12.402344 a 0.50004997,0.50004997 0 0 0 -0.5,-0.5 l -5,0 -5,0 -5.0000005,0 a 0.50004997,0.50004997 0 0 0 -0.5,0.5 l 0,15.0000002 a 0.50004997,0.50004997 0 0 0 0.5,0.5 l 4.9648442,0 a 0.50004997,0.50004997 0 0 0 0.035156,0 l 4.9648437,0 a 0.50004997,0.50004997 0 0 0 0.035156,0 l 5,0 a 0.50004997,0.50004997 0 0 0 0.5,-0.5 l 0,-15.0000002 z m -1,0.5 0,14.0000002 -4,0 0,-14.0000002 4,0 z m -5,0 0,14.0000002 -4,0 0,-14.0000002 4,0 z m -5,0 0,14.0000002 -4.0000005,0 0,-14.0000002 4.0000005,0 z"/></g></symbol><symbol id="f-i-select" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path id="bfprefix__XMLID_1_" d="M0,0v14h0c0,0.6,0.4,1,1,1h10c0.6,0,1-0.4,1-1h0V5h4V0H0z M1,1h10v3H1V1z M1,7h10v3H1V7z M1,14v-3h10v3H1z M15,4h-3V1h3V4z M2,2h1v1H2V2z M2,12h1v1H2V12z M4,12h1v1H4V12z M6,12h1v1H6V12z M9,12v1H8v-1H9z M2,8h1v1H2V8z M4,8h1v1H4V8z M6,8 h1v1H6V8z M13.5,3.1l-1-1.1h1.9L13.5,3.1z M2,6V5h1v1H2L2,6z M4,6V5h1v1H4L4,6z"/></symbol><symbol viewBox="0 0 448 512" id="f-i-settings" xmlns="http://www.w3.org/2000/svg"><g id="bgprefix__icomoon-ignore"/><path d="M223.969 175c-44.703 0-80.969 36.266-80.969 81 0 44.688 36.266 81.031 80.969 81.031 44.719 0 80.719-36.344 80.719-81.031-0-44.734-36-81-80.719-81zM386.313 302.531l-14.594 35.156 29.469 57.875-36.094 36.094-59.218-27.969-35.156 14.438-17.844 54.625-2.281 7.25h-51.016l-22.078-61.656-35.156-14.5-57.952 29.344-36.078-36.063 27.938-59.25-14.484-35.125-61.767-20.156v-50.984l61.703-22.109 14.485-35.094-25.953-51.234-3.422-6.719 36.031-36.031 59.297 27.922 35.109-14.516 17.828-54.594 2.297-7.234h51l22.094 61.734 35.063 14.516 58.031-29.406 36.063 36.031-27.938 59.203 14.438 35.172 61.875 20.125v50.969l-61.688 22.187z"/></symbol><symbol id="f-i-text-input" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path id="bhprefix__XMLID_10_" d="M15,4H4.5V3H6V2H4.5h-1H2v1h1.5v1H1C0.4,4,0,4.5,0,5v6c0,0.6,0.4,1,1,1h2.5v1H2v1h4v-1H4.5v-1H15 c0.6,0,1-0.4,1-1V5C16,4.5,15.6,4,15,4z M1,11V5h2.5v6H1z M15,11H4.5V5H15V11z"/></symbol><symbol id="f-i-textarea" viewBox="0 0 16 16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path id="biprefix__XMLID_1_" d="M3,11v-1h8v1H3L3,11z M3,7h10V6H3V7L3,7z M3,8v1h10V8H3L3,8z M13,4H3v1h10V4L13,4z M16,14V2c0-0.6-0.4-1-1-1 H1C0.4,1,0,1.4,0,2v12c0,0.6,0.4,1,1,1h14C15.6,15,16,14.6,16,14z M15,2v12H1V2H15z"/></symbol><symbol viewBox="0 0 24 32" id="f-i-triangle-down" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M0 12l11.992 11.992 11.992-11.992h-23.984z"/></symbol><symbol viewBox="0 0 12 32" id="f-i-triangle-left" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M0 15.996l11.992 11.992v-23.984l-11.992 11.992z"/></symbol><symbol viewBox="0 0 12 32" id="f-i-triangle-right" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M0.002 4.008l11.992 11.992-11.992 11.992v-23.984z"/></symbol><symbol viewBox="0 0 24 32" id="f-i-triangle-up" xmlns="http://www.w3.org/2000/svg"><path fill="#444" d="M11.992 8l-11.992 11.992h23.984l-11.992-11.992z"/></symbol><symbol viewBox="0 0 512 512" id="f-i-upload" xmlns="http://www.w3.org/2000/svg"><g id="bnprefix__icomoon-ignore"/><path d="M240 352h-240v128h480v-128h-240zM448 416h-64v-32h64v32zM112 160l128-128 128 128h-80v160h-96v-160z"/></symbol></svg>',Ns=Fu.name,Fs=Fu.version,Bn=Ns,Lf="formeo-sprite",Rf=null,kf=`https://cdn.jsdelivr.net/npm/formeo@${Fs}/dist/${Lf}.svg`,Df=`https://cdn.jsdelivr.net/npm/formeo@${Fs}/dist/formeo.min.css`,Jl="https://draggable.github.io/formeo/assets/css/formeo.min.css",th="f-panel",st="control-group",Dt=`${Bn}-stage`,Qe=`${Bn}-row`,Je=`${Bn}-column`,Ot=`${Bn}-field`,bs="custom-column-widths",nh="column-preset",Pr="resizing-columns",Of=new Map([[Dt,Qe],[Qe,Je],[Je,Ot]]),Ps=["stage","row","column","field"],Hs=Ps.map(l=>`${l}s`);new Map(Hs.map((l,e)=>[l,Ps[e]]));const If=new RegExp(`^${Hs.join("|")}.`),ih=[...Ps],Nf=[...Hs],Ff=new Map(Nf.map((l,e)=>[l,ih[e]])),Hr=ih.reduce((l,e)=>(l[e]=e,l),{}),Pf=[{name:"controls",className:st},{name:"stage",className:Dt},{name:"row",className:Qe},{name:"column",className:Je},{name:"field",className:Ot}],Ws={controls:st,stage:Dt,row:Qe,column:Je,field:Ot},Hf=Object.entries(Ws).reduce((l,[e,t])=>(l[t]=e,l),{}),Wf=Object.values(Ws),zf=new RegExp(`${Wf.join("|")}`,"g"),{childTypeMapVals:rh,childTypeIndexMapVals:Bf}=Pf.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:[]}),jf=rh.slice().map(l=>l.slice().reverse()).reverse(),ec=new Map(rh),Vf=new Map(Bf),Uf=new Map(jf.slice()),Gf=[[{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"}]],qf=new Map(Gf.reduce((l,e,t)=>(l.push([t,e]),l),[])),oh=`${Ns}-formData`,tc=`${Ns}-locale`,Ye=333,mt=Math.round(Ye/2),zs=Math.round(Ye*2),sh="formeoSaved",Jt="formeoUpdated",Kf="formeoChanged",ah="formeoUpdatedStage",lh="formeoUpdatedRow",ch="formeoUpdatedColumn",uh="formeoUpdatedField",Yf="formeoCleared",hh="formeoOnRender",Zf="formeoConditionUpdated",Bs="formeoAddedRow",js="formeoAddedColumn",Vs="formeoAddedField",Us="formeoRemovedRow",Gs="formeoRemovedColumn",qs="formeoRemovedField",dh={equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},Xf={and:"&&",or:"||"},fh={equals:"="},Qf=["logical","source","sourceProperty","comparison","target","targetProperty","assignment","value"],nc=["isChecked","isNotChecked"],ic=["isVisible","isNotVisible"],pn=["value"],Jf={comparison:dh,assignment:fh,logical:Xf},ph="if",ep="then",Ks=()=>({[ph]:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],[ep]:[{target:"",targetProperty:"",assignment:"",value:""}]}),tp=/(\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,Cs=/\bcol-\w+-\d+/g,gh="f-i-",Mn=()=>({id:He(),stages:{[He()]:{}},rows:{},columns:{},fields:{}}),xn=["selected","checked"],np=xn.toReversed(),ip="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`),rp=new RegExp(`(?!${ip.join("|")})\\w\\S*`,"g"),op=/\s+/g;function at(l){return typeof l!="string"||l.trim().match(op)?l:l.replace(rp,t=>t.charAt(0).toUpperCase()+t.substring(1).replace(/[A-Z]/g,n=>` ${n}`))}const mh=(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)},rc=(l,e="-")=>vt(l).join(e),sp=l=>{const e=document.createElement("div");return e.innerHTML=l,e.textContent||e.innerText||""},ap=(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 Wr,oc;function Ys(){if(oc)return Wr;oc=1;var l=kt(),e=wt(),t="[object Symbol]";function n(p){return typeof p=="symbol"||e(p)&&l(p)==t}return Wr=n,Wr}var zr,sc;function lp(){if(sc)return zr;sc=1;var l=bt(),e=Ys(),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 Br,ac;function cp(){if(ac)return Br;ac=1;var l=Ls(),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,Br=t,Br}var jr,lc;function up(){if(lc)return jr;lc=1;var l=cp(),e=500;function t(n){var p=l(n,function(g){return d.size===e&&d.clear(),g}),d=p.cache;return p}return jr=t,jr}var Vr,cc;function hp(){if(cc)return Vr;cc=1;var l=up(),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 Vr=n,Vr}var Ur,uc;function dp(){if(uc)return Ur;uc=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 Ur=l,Ur}var Gr,hc;function fp(){if(hc)return Gr;hc=1;var l=Fn(),e=dp(),t=bt(),n=Ys(),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 Gr=g,Gr}var qr,dc;function jn(){if(dc)return qr;dc=1;var l=fp();function e(t){return t==null?"":l(t)}return qr=e,qr}var Kr,fc;function vh(){if(fc)return Kr;fc=1;var l=bt(),e=lp(),t=hp(),n=jn();function p(d,g){return l(d)?d:e(d,g)?[d]:t(n(d))}return Kr=p,Kr}var Yr,pc;function yh(){if(pc)return Yr;pc=1;var l=Ys();function e(t){if(typeof t=="string"||l(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return Yr=e,Yr}var Zr,gc;function pp(){if(gc)return Zr;gc=1;var l=vh(),e=yh();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 Zr=t,Zr}var Xr,mc;function gp(){if(mc)return Xr;mc=1;var l=pp();function e(t,n,p){var d=t==null?void 0:l(t,n);return d===void 0?p:d}return Xr=e,Xr}var mp=gp();const vp=Rt(mp);var Qr,vc;function yp(){if(vc)return Qr;vc=1;var l=Yu(),e=vh(),t=Is(),n=ct(),p=yh();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 Qr=d,Qr}var Jr,yc;function wp(){if(yc)return Jr;yc=1;var l=yp();function e(t,n,p){return t==null?t:l(t,n,p)}return Jr=e,Jr}var bp=wp();const Cp=Rt(bp),Ie=vp,Vn=Cp;function Sp(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 eo,wc;function Ap(){if(wc)return eo;wc=1;var l="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,l),this}return eo=e,eo}var to,bc;function $p(){if(bc)return to;bc=1;function l(e){return this.__data__.has(e)}return to=l,to}var no,Cc;function Mp(){if(Cc)return no;Cc=1;var l=Ls(),e=Ap(),t=$p();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,no=n,no}var io,Sc;function xp(){if(Sc)return io;Sc=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 io=l,io}var ro,Ac;function Ep(){if(Ac)return ro;Ac=1;function l(e,t){return e.has(t)}return ro=l,ro}var oo,$c;function wh(){if($c)return oo;$c=1;var l=Mp(),e=xp(),t=Ep(),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,w=!0,x=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;w=!1;break}if(x){if(!e(m,function(E,R){if(!t(x,R)&&($===E||r($,E,c,f,o)))return x.push(R)})){w=!1;break}}else if(!($===A||r($,A,c,f,o))){w=!1;break}}return o.delete(g),o.delete(m),w}return oo=d,oo}var so,Mc;function _p(){if(Mc)return so;Mc=1;function l(e){var t=-1,n=Array(e.size);return e.forEach(function(p,d){n[++t]=[d,p]}),n}return so=l,so}var ao,xc;function Tp(){if(xc)return ao;xc=1;function l(e){var t=-1,n=Array(e.size);return e.forEach(function(p){n[++t]=p}),n}return ao=l,ao}var lo,Ec;function Lp(){if(Ec)return lo;Ec=1;var l=Fn(),e=ju(),t=nn(),n=wh(),p=_p(),d=Tp(),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]",w="[object DataView]",x=l?l.prototype:void 0,$=x?x.valueOf:void 0;function A(S,E,R,L,_,D,b){switch(R){case w:if(S.byteLength!=E.byteLength||S.byteOffset!=E.byteOffset)return!1;S=S.buffer,E=E.buffer;case y:return!(S.byteLength!=E.byteLength||!D(new e(S),new e(E)));case c:case f:case s:return t(+S,+E);case r:return S.name==E.name&&S.message==E.message;case a:case u:return S==E+"";case o:var v=p;case i:var C=L&g;if(v||(v=d),S.size!=E.size&&!C)return!1;var M=b.get(S);if(M)return M==E;L|=m,b.set(S,E);var T=n(v(S),v(E),L,_,D,b);return b.delete(S),T;case h:if($)return $.call(S)==$.call(E)}return!1}return lo=A,lo}var co,_c;function Rp(){if(_c)return co;_c=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 co=l,co}var uo,Tc;function kp(){if(Tc)return uo;Tc=1;var l=Rp(),e=bt();function t(n,p,d){var g=p(n);return e(n)?g:l(g,d(n))}return uo=t,uo}var ho,Lc;function Dp(){if(Lc)return ho;Lc=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 ho=l,ho}var fo,Rc;function Op(){if(Rc)return fo;Rc=1;function l(){return[]}return fo=l,fo}var po,kc;function Ip(){if(kc)return po;kc=1;var l=Dp(),e=Op(),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 po=d,po}var go,Dc;function Np(){if(Dc)return go;Dc=1;var l=Vu(),e=l(Object.keys,Object);return go=e,go}var mo,Oc;function Fp(){if(Oc)return mo;Oc=1;var l=ks(),e=Np(),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 mo=p,mo}var vo,Ic;function Pp(){if(Ic)return vo;Ic=1;var l=Zu(),e=Fp(),t=Wn();function n(p){return t(p)?l(p):e(p)}return vo=n,vo}var yo,Nc;function Hp(){if(Nc)return yo;Nc=1;var l=kp(),e=Ip(),t=Pp();function n(p){return l(p,t,e)}return yo=n,yo}var wo,Fc;function Wp(){if(Fc)return wo;Fc=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 w=r.get(d),x=r.get(g);if(w&&x)return w==g&&x==d;var $=!0;r.set(d,g),r.set(g,d);for(var A=o;++h<a;){y=s[h];var S=d[y],E=g[y];if(c)var R=o?c(E,S,y,g,d,r):c(S,E,y,d,g,r);if(!(R===void 0?S===E||f(S,E,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 bo,Pc;function zp(){if(Pc)return bo;Pc=1;var l=yt(),e=qe(),t=l(e,"DataView");return bo=t,bo}var Co,Hc;function Bp(){if(Hc)return Co;Hc=1;var l=yt(),e=qe(),t=l(e,"Promise");return Co=t,Co}var So,Wc;function jp(){if(Wc)return So;Wc=1;var l=yt(),e=qe(),t=l(e,"Set");return So=t,So}var Ao,zc;function Vp(){if(zc)return Ao;zc=1;var l=yt(),e=qe(),t=l(e,"WeakMap");return Ao=t,Ao}var $o,Bc;function Up(){if(Bc)return $o;Bc=1;var l=zp(),e=Ts(),t=Bp(),n=jp(),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),w=d;return(l&&w(new l(new ArrayBuffer(1)))!=s||e&&w(new e)!=m||t&&w(t.resolve())!=f||n&&w(new n)!=r||p&&w(new p)!=o)&&(w=function(x){var $=d(x),A=$==c?x.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 $}),$o=w,$o}var Mo,jc;function Gp(){if(jc)return Mo;jc=1;var l=Wu(),e=wh(),t=Lp(),n=Wp(),p=Up(),d=bt(),g=Ds(),m=Os(),c=1,f="[object Arguments]",r="[object Array]",o="[object Object]",s=Object.prototype,a=s.hasOwnProperty;function i(u,h,y,w,x,$){var A=d(u),S=d(h),E=A?r:p(u),R=S?r:p(h);E=E==f?o:E,R=R==f?o:R;var L=E==o,_=R==o,D=E==R;if(D&&g(u)){if(!g(h))return!1;A=!0,L=!1}if(D&&!L)return $||($=new l),A||m(u)?e(u,h,y,w,x,$):t(u,h,E,y,w,x,$);if(!(y&c)){var b=L&&a.call(u,"__wrapped__"),v=_&&a.call(h,"__wrapped__");if(b||v){var C=b?u.value():u,M=v?h.value():h;return $||($=new l),x(C,M,y,w,$)}}return D?($||($=new l),n(u,h,y,w,x,$)):!1}return Mo=i,Mo}var xo,Vc;function qp(){if(Vc)return xo;Vc=1;var l=Gp(),e=wt();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 xo=t,xo}var Eo,Uc;function Kp(){if(Uc)return Eo;Uc=1;var l=qp();function e(t,n){return l(t,n)}return Eo=e,Eo}var Yp=Kp();const Ss=Rt(Yp),Zp=(l,e)=>l===void 0?"added":e===void 0?"removed":Ss(l,e)?"unchanged":"changed";class Zs{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=Vn(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:ah,row:lh,column:ch,field:uh}[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||He();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 Un extends Zs{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||He(),p=this.Component({...t,id:n});this.data[n]=p,this.active=p;const g={row:Bs,column:js,field:Vs}[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 Gc(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?Gc(Object(t),!0).forEach(function(n){Xp(l,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(t)):Gc(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 Xp(l,e,t){return e in l?Object.defineProperty(l,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):l[e]=t,l}function et(){return et=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},et.apply(this,arguments)}function Qp(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 Jp(l,e){if(l==null)return{};var t=Qp(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 eg="1.15.3";function Ze(l){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(l)}var nt=Ze(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),rn=Ze(/Edge/i),qc=Ze(/firefox/i),qt=Ze(/safari/i)&&!Ze(/chrome/i)&&!Ze(/android/i),bh=Ze(/iP(ad|od|hone)/i),Ch=Ze(/chrome/i)&&Ze(/android/i),Sh={capture:!1,passive:!1};function se(l,e,t){l.addEventListener(e,t,!nt&&Sh)}function oe(l,e,t){l.removeEventListener(e,t,!nt&&Sh)}function En(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 Ah(l){return l.host&&l!==document&&l.host.nodeType?l.host:l.parentNode}function Be(l,e,t,n){if(l){t=t||document;do{if(e!=null&&(e[0]===">"?l.parentNode===t&&En(l,e):En(l,e))||n&&l===t)return l;if(l===t)break}while(l=Ah(l))}return null}var Kc=/\s+/g;function De(l,e,t){if(l&&e)if(l.classList)l.classList[t?"add":"remove"](e);else{var n=(" "+l.className+" ").replace(Kc," ").replace(" "+e+" "," ");l.className=(n+(t?" "+e:"")).replace(Kc," ")}}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 Et(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 $h(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 be(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,!nt))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=Et(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 Yc(l,e,t){for(var n=ot(l,!0),p=be(l)[e];n;){var d=be(n)[t],g=void 0;if(g=p>=d,!g)return n;if(n===Ue())break;n=ot(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)&&Be(g[d],t.draggable,l,!1)){if(p===e)return g[d];p++}d++}return null}function Xs(l,e){for(var t=l.lastElementChild;t&&(t===te.ghost||ne(t,"display")==="none"||e&&!En(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||En(l,e))&&t++;return t}function Zc(l){var e=0,t=0,n=Ue();if(l)do{var p=Et(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 tg(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 ot(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 ng(l,e){if(l&&e)for(var t in e)e.hasOwnProperty(t)&&(l[t]=e[t]);return l}function _o(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 Kt;function Mh(l,e){return function(){if(!Kt){var t=arguments,n=this;t.length===1?l.call(n,t[0]):l.apply(n,t),Kt=setTimeout(function(){Kt=void 0},e)}}}function ig(){clearTimeout(Kt),Kt=void 0}function xh(l,e,t){l.scrollLeft+=e,l.scrollTop+=t}function Eh(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 _h(l,e,t){var n={};return Array.from(l.children).forEach(function(p){var d,g,m,c;if(!(!Be(p,e.draggable,l,!1)||p.animated||p===t)){var f=be(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 rg(){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:be(p)});var d=Ge({},l[l.length-1].rect);if(p.thisAnimationDuration){var g=Et(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(tg(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=be(f),s=f.prevFromRect,a=f.prevToRect,i=m.rect,u=Et(f,!0);u&&(o.top-=u.f,o.left-=u.e),f.toRect=o,f.thisAnimationDuration&&_o(s,o)&&!_o(r,o)&&(i.top-o.top)/(i.left-o.left)===(r.top-o.top)/(r.left-o.left)&&(c=sg(i,s,a,p.options)),_o(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=Et(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=og(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 og(l){return l.offsetWidth}function sg(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=[],To={initializeByDefault:!0},on={mount:function(e){for(var t in To)To.hasOwnProperty(t)&&!(t in e)&&(e[t]=To[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,et(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"&&et(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 ag(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&&!nt&&!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 w=Ge(Ge({},i),on.getEventProperties(n,e));for(var x in w)u[x]=w[x];t&&t.dispatchEvent(u),h[y]&&h[y].call(e,u)}}var lg=["evt"],Te=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p=n.evt,d=Jp(n,lg);on.pluginEvent.bind(te)(e,t,Ge({dragEl:q,parentEl:ve,ghostEl:ie,rootEl:fe,nextEl:pt,lastDownEl:vn,cloneEl:pe,cloneHidden:rt,dragStarted:Bt,putSortable:Se,activeSortable:te.active,originalEvent:p,oldIndex:Mt,oldDraggableIndex:Yt,newIndex:Oe,newDraggableIndex:it,hideGhostForTarget:kh,unhideGhostForTarget:Dh,cloneNowHidden:function(){rt=!0},cloneNowShown:function(){rt=!1},dispatchSortableEvent:function(m){Me({sortable:t,name:m,originalEvent:p})}},d))};function Me(l){ag(Ge({putSortable:Se,cloneEl:pe,targetEl:q,rootEl:fe,oldIndex:Mt,oldDraggableIndex:Yt,newIndex:Oe,newDraggableIndex:it},l))}var q,ve,ie,fe,pt,vn,pe,rt,Mt,Oe,Yt,it,ln,Se,At=!1,_n=!1,Tn=[],dt,We,Lo,Ro,Xc,Qc,Bt,St,Zt,Xt=!1,cn=!1,yn,Ae,ko=[],As=!1,Ln=[],Gn=typeof document<"u",un=bh,Jc=rn||nt?"cssFloat":"float",cg=Gn&&!Ch&&!bh&&"draggable"in document.createElement("div"),Th=(function(){if(Gn){if(nt)return!1;var l=document.createElement("x");return l.style.cssText="pointer-events:auto",l.style.pointerEvents==="auto"}})(),Lh=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)+be(d).width,r=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+be(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[Jc]==="none"||g&&n[Jc]==="none"&&f+r>p)?"vertical":"horizontal"},ug=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},hg=function(e,t){var n;return Tn.some(function(p){var d=p[Re].options.emptyInsertThreshold;if(!(!d||Xs(p))){var g=be(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},Rh=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},kh=function(){!Th&&ie&&ne(ie,"display","none")},Dh=function(){!Th&&ie&&ne(ie,"display","")};Gn&&!Ch&&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(q){e=e.touches?e.touches[0]:e;var t=hg(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)}}},dg=function(e){q&&q.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=et({},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 Lh(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&&!qt,emptyInsertThreshold:5};on.initializePlugins(this,l,t);for(var n in t)!(n in e)&&(e[n]=t[n]);Rh(e);for(var p in this)p.charAt(0)==="_"&&typeof this[p]=="function"&&(this[p]=this[p].bind(this));this.nativeDraggable=e.forceFallback?!1:cg,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)),Tn.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),et(this,rg())}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,q):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(bg(n),!q&&!(/mousedown|pointerdown/.test(g)&&e.button!==0||p.disabled)&&!f.isContentEditable&&!(!this.nativeDraggable&&qt&&c&&c.tagName.toUpperCase()==="SELECT")&&(c=Be(c,p.draggable,n,!1),!(c&&c.animated)&&vn!==c)){if(Mt=Fe(c),Yt=Fe(c,p.draggable),typeof r=="function"){if(r.call(this,e,c,this)){Me({sortable:t,rootEl:f,name:"filter",targetEl:c,toEl:n,fromEl:n}),Te("filter",t,{evt:e}),d&&e.cancelable&&e.preventDefault();return}}else if(r&&(r=r.split(",").some(function(o){if(o=Be(f,o.trim(),n,!1),o)return Me({sortable:t,rootEl:o,name:"filter",targetEl:c,fromEl:n,toEl:n}),Te("filter",t,{evt:e}),!0}),r)){d&&e.cancelable&&e.preventDefault();return}p.handle&&!Be(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&&!q&&n.parentNode===d){var f=be(n);if(fe=d,q=n,ve=q.parentNode,pt=q.nextSibling,vn=n,ln=g.group,te.dragged=q,dt={target:q,clientX:(t||e).clientX,clientY:(t||e).clientY},Xc=dt.clientX-f.left,Qc=dt.clientY-f.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,q.style["will-change"]="all",c=function(){if(Te("delayEnded",p,{evt:e}),te.eventCanceled){p._onDrop();return}p._disableDelayedDragEvents(),!qc&&p.nativeDraggable&&(q.draggable=!0),p._triggerDragStart(e,t),Me({sortable:p,name:"choose",originalEvent:e}),De(q,g.chosenClass,!0)},g.ignore.split(",").forEach(function(r){$h(q,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),qc&&this.nativeDraggable&&(this.options.touchStartThreshold=4,q.draggable=!0),Te("delayStart",this,{evt:e}),g.delay&&(!g.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(rn||nt))){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(){q&&Do(q),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(q,"dragend",this),se(fe,"dragstart",this._onDragStart));try{document.selection?wn(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(At=!1,fe&&q){Te("dragStarted",this,{evt:t}),this.nativeDraggable&&se(document,"dragover",dg);var n=this.options;!e&&De(q,n.dragClass,!1),De(q,n.ghostClass,!0),te.active=this,e&&this._appendGhost(),Me({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(We){this._lastX=We.clientX,this._lastY=We.clientY,kh();for(var e=document.elementFromPoint(We.clientX,We.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(We.clientX,We.clientY),e!==t);)t=e;if(q.parentNode[Re]._isOutsideThisEl(e),t)do{if(t[Re]){var n=void 0;if(n=t[Re]._onDragOver({clientX:We.clientX,clientY:We.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=Ah(t));Dh()}},_onTouchMove:function(e){if(dt){var t=this.options,n=t.fallbackTolerance,p=t.fallbackOffset,d=e.touches?e.touches[0]:e,g=ie&&Et(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]-ko[0]:0)/(m||1),o=(d.clientY-dt.clientY+p.y)/(c||1)+(f?f[1]-ko[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-(Lo||0),g.f+=o-(Ro||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),Lo=r,Ro=o,We=d}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!ie){var e=this.options.fallbackOnBody?document.body:fe,t=be(q,!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(),ko=Zc(Ae)}ie=q.cloneNode(!0),De(ie,n.ghostClass,!1),De(ie,n.fallbackClass,!0),De(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",Xc/parseInt(ie.style.width)*100+"% "+Qc/parseInt(ie.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,p=e.dataTransfer,d=n.options;if(Te("dragStart",this,{evt:e}),te.eventCanceled){this._onDrop();return}Te("setupClone",this),te.eventCanceled||(pe=Eh(q),pe.removeAttribute("id"),pe.draggable=!1,pe.style["will-change"]="",this._hideClone(),De(pe,this.options.chosenClass,!1),te.clone=pe),n.cloneId=wn(function(){Te("clone",n),!te.eventCanceled&&(n.options.removeCloneOnHide||fe.insertBefore(pe,q),n._hideClone(),Me({sortable:n,name:"clone"}))}),!t&&De(q,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,q)),se(document,"drop",n),ne(q,"transform","translateZ(0)")),At=!0,n._dragStartId=wn(n._dragStarted.bind(n,t,e)),se(document,"selectstart",n),Bt=!0,qt&&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(As)return;function h(O,I){Te(O,i,Ge({evt:e,isOwner:r,axis:a?"vertical":"horizontal",revert:g,dragRect:p,targetRect:d,canSort:o,fromSortable:s,target:n,completed:w,onMove:function(P,B){return hn(fe,t,q,p,P,be(P),e,B)},changed:x},I))}function y(){h("dragOverAnimationCapture"),i.captureAnimationState(),i!==s&&s.captureAnimationState()}function w(O){return h("dragOverCompleted",{insertion:O}),O&&(r?f._hideClone():f._showClone(i),i!==s&&(De(q,Se?Se.options.ghostClass:f.options.ghostClass,!1),De(q,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===q&&!q.animated||n===t&&!n.animated)&&(St=null),!m.dragoverBubble&&!e.rootEl&&n!==document&&(q.parentNode[Re]._isOutsideThisEl(e.target),!O&&ft(e)),!m.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),u=!0}function x(){Oe=Fe(q),it=Fe(q,m.draggable),Me({sortable:i,name:"change",toEl:t,newIndex:Oe,newDraggableIndex:it,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=Be(n,m.draggable,t,!0),h("dragOver"),te.eventCanceled)return u;if(q.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||i._ignoreWhileAnimating===n)return w(!1);if(_n=!1,f&&!m.disabled&&(r?o||(g=ve!==fe):Se===this||(this.lastPutMode=ln.checkPull(this,f,q,e))&&c.checkPut(this,f,q,e))){if(a=this._getDirection(e,n)==="vertical",p=be(q),h("dragOverValid"),te.eventCanceled)return u;if(g)return ve=fe,y(),this._hideClone(),h("revert"),te.eventCanceled||(pt?fe.insertBefore(q,pt):fe.appendChild(q)),w(!0);var $=Xs(t,m.draggable);if(!$||mg(e,a,this)&&!$.animated){if($===q)return w(!1);if($&&t===e.target&&(n=$),n&&(d=be(n)),hn(fe,t,q,p,n,d,e,!!n)!==!1)return y(),$&&$.nextSibling?t.insertBefore(q,$.nextSibling):t.appendChild(q),ve=t,x(),w(!0)}else if($&&gg(e,a,this)){var A=_t(t,0,m,!0);if(A===q)return w(!1);if(n=A,d=be(n),hn(fe,t,q,p,n,d,e,!1)!==!1)return y(),t.insertBefore(q,A),ve=t,x(),w(!0)}else if(n.parentNode===t){d=be(n);var S=0,E,R=q.parentNode!==t,L=!ug(q.animated&&q.toRect||p,n.animated&&n.toRect||d,a),_=a?"top":"left",D=Yc(n,"top","top")||Yc(q,"top","top"),b=D?D.scrollTop:void 0;St!==n&&(E=d[_],Xt=!1,cn=!L&&m.invertSwap||R),S=vg(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(q);do C-=S,v=ve.children[C];while(v&&(ne(v,"display")==="none"||v===ie))}if(S===0||v===n)return w(!1);St=n,Zt=S;var M=n.nextElementSibling,T=!1;T=S===1;var k=hn(fe,t,q,p,n,d,e,T);if(k!==!1)return(k===1||k===-1)&&(T=k===1),As=!0,setTimeout(pg,30),y(),T&&!M?t.appendChild(q):n.parentNode.insertBefore(q,T?M:n),D&&xh(D,0,b-D.scrollTop),ve=q.parentNode,E!==void 0&&!cn&&(yn=Math.abs(E-be(n)[_])),x(),w(!0)}if(t.contains(q))return w(!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(Oe=Fe(q),it=Fe(q,n.draggable),Te("drop",this,{evt:e}),ve=q&&q.parentNode,Oe=Fe(q),it=Fe(q,n.draggable),te.eventCanceled){this._nulling();return}At=!1,cn=!1,Xt=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),$s(this.cloneId),$s(this._dragStartId),this.nativeDraggable&&(oe(document,"drop",this),oe(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),qt&&ne(document.body,"user-select",""),ne(q,"transform",""),e&&(Bt&&(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),q&&(this.nativeDraggable&&oe(q,"dragend",this),Do(q),q.style["will-change"]="",Bt&&!At&&De(q,Se?Se.options.ghostClass:this.options.ghostClass,!1),De(q,this.options.chosenClass,!1),Me({sortable:this,name:"unchoose",toEl:ve,newIndex:null,newDraggableIndex:null,originalEvent:e}),fe!==ve?(Oe>=0&&(Me({rootEl:ve,name:"add",toEl:ve,fromEl:fe,originalEvent:e}),Me({sortable:this,name:"remove",toEl:ve,originalEvent:e}),Me({rootEl:ve,name:"sort",toEl:ve,fromEl:fe,originalEvent:e}),Me({sortable:this,name:"sort",toEl:ve,originalEvent:e})),Se&&Se.save()):Oe!==Mt&&Oe>=0&&(Me({sortable:this,name:"update",toEl:ve,originalEvent:e}),Me({sortable:this,name:"sort",toEl:ve,originalEvent:e})),te.active&&((Oe==null||Oe===-1)&&(Oe=Mt,it=Yt),Me({sortable:this,name:"end",toEl:ve,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Te("nulling",this),fe=q=ve=ie=pt=pe=vn=rt=dt=We=Bt=Oe=it=Mt=Yt=St=Zt=Se=ln=te.dragged=te.ghost=te.clone=te.active=null,Ln.forEach(function(e){e.checked=!0}),Ln.length=Lo=Ro=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":q&&(this._onDragOver(e),fg(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],Be(t,g.draggable,this.el,!1)&&e.push(t.getAttribute(g.dataIdAttr)||wg(t));return e},sort:function(e,t){var n={},p=this.el;this.toArray().forEach(function(d,g){var m=p.children[g];Be(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 Be(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"&&Rh(n)},destroy:function(){Te("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(),Tn.splice(Tn.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!rt){if(Te("hideClone",this),te.eventCanceled)return;ne(pe,"display","none"),this.options.removeCloneOnHide&&pe.parentNode&&pe.parentNode.removeChild(pe),rt=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(rt){if(Te("showClone",this),te.eventCanceled)return;q.parentNode==fe&&!this.options.group.revertClone?fe.insertBefore(pe,q):pt?fe.insertBefore(pe,pt):fe.appendChild(pe),this.options.group.revertClone&&this.animate(q,pe),ne(pe,"display",""),rt=!1}}};function fg(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&&!nt&&!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||be(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 pg(){As=!1}function gg(l,e,t){var n=be(_t(t.el,0,t.options,!0)),p=_h(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 mg(l,e,t){var n=be(Xs(t.el,t.options.draggable)),p=_h(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 vg(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(!Xt&&(Zt===1?c>r+f*d/2:c<o-f*d/2)&&(Xt=!0),Xt)s=!0;else if(Zt===1?c<r+yn:c>o-yn)return-Zt}else if(c>r+f*(1-p)/2&&c<o-f*(1-p)/2)return yg(e)}return s=s||g,s&&(c<r+f*d/2||c>o-f*d/2)?c>r+f/2?1:-1:0}function yg(l){return Fe(q)<Fe(l)?1:-1}function wg(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 bg(l){Ln.length=0;for(var e=l.getElementsByTagName("input"),t=e.length;t--;){var n=e[t];n.checked&&Ln.push(n)}}function wn(l){return setTimeout(l,0)}function $s(l){return clearTimeout(l)}Gn&&se(document,"touchmove",function(l){(te.active||At)&&l.cancelable&&l.preventDefault()});te.utils={on:se,off:oe,css:ne,find:$h,is:function(e,t){return!!Be(e,t,e,!1)},extend:ng,throttle:Mh,closest:Be,toggleClass:De,clone:Eh,index:Fe,nextTick:wn,cancelNextTick:$s,detectDirection:Lh,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=eg;var we=[],jt,Ms,xs=!1,Oo,Io,Rn,Vt;function Cg(){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)),eu(),bn(),ig()},nulling:function(){Rn=Ms=jt=xs=Vt=Oo=Io=null,we.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||nt||qt){No(t,this.options,m,n);var c=ot(m,!0);xs&&(!Vt||d!==Oo||g!==Io)&&(Vt&&eu(),Vt=setInterval(function(){var f=ot(document.elementFromPoint(d,g),!0);f!==c&&(c=f,bn()),No(t,p.options,f,n)},10),Oo=d,Io=g)}else{if(!this.options.bubbleScroll||ot(m,!0)===Ue()){bn();return}No(t,this.options,ot(m,!1),!1)}}},et(l,{pluginName:"scroll",initializeByDefault:!0})}function bn(){we.forEach(function(l){clearInterval(l.pid)}),we=[]}function eu(){clearInterval(Vt)}var No=Mh(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;Ms!==t&&(Ms=t,bn(),jt=e.scroll,r=e.scrollFn,jt===!0&&(jt=ot(t,!0)));var o=0,s=jt;do{var a=s,i=be(a),u=i.top,h=i.bottom,y=i.left,w=i.right,x=i.width,$=i.height,A=void 0,S=void 0,E=a.scrollWidth,R=a.scrollHeight,L=ne(a),_=a.scrollLeft,D=a.scrollTop;a===c?(A=x<E&&(L.overflowX==="auto"||L.overflowX==="scroll"||L.overflowX==="visible"),S=$<R&&(L.overflowY==="auto"||L.overflowY==="scroll"||L.overflowY==="visible")):(A=x<E&&(L.overflowX==="auto"||L.overflowX==="scroll"),S=$<R&&(L.overflowY==="auto"||L.overflowY==="scroll"));var b=A&&(Math.abs(w-p)<=g&&_+x<E)-(Math.abs(y-p)<=g&&!!_),v=S&&(Math.abs(h-d)<=g&&D+$<R)-(Math.abs(u-d)<=g&&!!D);if(!we[o])for(var C=0;C<=o;C++)we[C]||(we[C]={});(we[o].vx!=b||we[o].vy!=v||we[o].el!==a)&&(we[o].el=a,we[o].vx=b,we[o].vy=v,clearInterval(we[o].pid),(b!=0||v!=0)&&(f=!0,we[o].pid=setInterval((function(){n&&this.layer===0&&te.active._onTouchMove(Rn);var M=we[this.layer].vy?we[this.layer].vy*m:0,T=we[this.layer].vx?we[this.layer].vx*m:0;typeof r=="function"&&r.call(te.dragged.parentNode[Re],T,M,l,Rn,we[this.layer].el)!=="continue"||xh(we[this.layer].el,T,M)}).bind({layer:o}),24))),o++}while(e.bubbleScroll&&s!==c&&(s=ot(s,!1)));xs=f}},30),Oh=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 Qs(){}Qs.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:Oh};et(Qs,{pluginName:"revertOnSpill"});function Js(){}Js.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:Oh};et(Js,{pluginName:"removeOnSpill"});te.mount(new Cg);te.mount(Js,Qs);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)}},Ih=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)},ea=(l,e)=>{const t=[];return qn(l,(n,p)=>t.push(e(n,p))),t},Fo={},Nh=l=>{const e={className:"class"};if(Fo[l])return Fo[l];const n=(e[l]||l).replace(/^\d+/,"").replace(/[^a-zA-Z0-9-:]/g,"");return Fo[l]=n,n},Fh=l=>l.replace(/\b\w/g,e=>e.toUpperCase()),Sg=l=>window.JSON.parse(window.JSON.stringify(l)),Ag=(l,e)=>e.filter(t=>!~l.indexOf(t)),Ne={capitalize:Fh,safeAttrName:Nh,forEach:qn,copyObj:Sg,map:ea,subtract:Ag,indexOfNode:lt,isInt:Ih,get:Ie,orderObjectsBy:kn},Ve={js:new Set,css:new Set,formeoSprite:null},tu=(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))),Ph=(l,e)=>{l.removeEventListener("load",Ph),e(l.src)},Hh=(l,e)=>{l.removeEventListener("load",Hh),e(l.src)},$g=l=>new Promise((e,t)=>{if(Ve.js.has(l))return e(l);Ve.js.add(l);const n=V.create({tag:"script",attrs:{type:"text/javascript",async:!0,src:l},action:{load:()=>Hh(n,e),error:()=>t(new Error(`${l} failed to load.`))}});document.head.appendChild(n)}),Es=l=>{l=Array.isArray(l)?l:[l];const e=l.map(t=>new Promise((n,p)=>{if(Ve.css.has(t))return n(t);Ve.css.add(t);const d=V.create({tag:"link",attrs:{rel:"stylesheet",href:t},action:{load:()=>Ph(d,n),error:()=>p(new Error(`${(void 0).src} failed to load.`))}});document.head.appendChild(d)}));return Promise.all(e)},Mg=l=>{l=Array.isArray(l)?l:[l];const e=l.map(t=>$g(t));return Promise.all(e)},xg=l=>{l=Array.isArray(l)?l:[l];const e=l.map(t=>Es(t));return Promise.all(e)},nu=l=>{const t=new DOMParser().parseFromString(l,"image/svg+xml");return Ve.formeoSprite=t.documentElement,Ve.formeoSprite},Eg=async(l=Rf)=>{if(Ve.formeoSprite)return Ve.formeoSprite;if(!l)return nu(Tf);const e=async t=>nu(await t.text());return tu(l,e,()=>tu(kf,e))},_g={js:Mg,css:xg},Wh=l=>{const e=Object.entries(l).map(([t,n])=>_g[t](n));return Promise.all(e)},Tg=async l=>{if(!Ve.css.has(l)&&(await Es(l),!Ve.css.has(Jl)))return await Es(Jl)},Lg={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="${gh}${l}">${l}</i>`},Rg=new Set(["input","textarea","select"]),kg=(l={})=>{let e=l?.attrs?.name||l?.name;if(e)return e;const t=He(l);let n=l.config?.label||l.attrs?.label||l?.label;return n&&(typeof n=="object"&&(n=V.create(n).textContent),/^<.+>.+<.+>$/gim.test(n)&&(n=sp(n)),e=`${t}-${mh(ap(n,24,null))}`),e||t};class Dg{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||He()}`,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=Ye)=>{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:V.onRender,render:V.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=Ve.formeoSprite.querySelectorAll("svg symbol"),t=n=>{const p=n.getAttribute("viewBox")||"0 0 24 24",d=Array.from(n.children).map(g=>g.cloneNode(!0).outerHTML).join("");return{tag:"svg",attrs:{className:["svg-icon",n.id],viewBox:p,xmlns:"http://www.w3.org/2000/svg"},children:d}};return this.iconSymbols=Array.from(e).reduce((n,p)=>{const d=p.id.replace(gh,"");return n[d]=t(p),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]=V.create(d).outerHTML,this.cachedIcons[n]}return this.cachedIcons[n]=V.create(p).outerHTML,this.cachedIcons[n]}return Lg[V.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=kg(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 V.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||X.get("labelCount",{label:X.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},w={tag:"label",attrs:{for:`${m}-${o}`},children:s},x={children:[y,w],className:[`f-${g}`]};return d.className&&(t.config.inputWrap=d.className),t.config.inline&&x.className.push(`f-${g}-inline`),r.selected&&(y.attrs.checked=!0),n&&(w.attrs.contenteditable=!0),x};return{select:()=>{const y=r.attrs||r,w={attrs:y,...r,...y},{label:x,checked:$,selected:A,attrs:S}=w;return{tag:"option",attrs:{...S,selected:!!($||A)},children:x}},button:y=>{const{type:w,label:x,className:$,id:A}=y;return{...t,attrs:{type:w},className:$,id:A||He(),options:void 0,children:x,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),Rg.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=()=>{V.empty(e),e.classList.remove("removing-all-fields"),V.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=V[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(Of.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)===st;isStage=e=>Le(e)===Dt;isRow=e=>Le(e)===Qe;isColumn=e=>Le(e)===Je;isField=e=>Le(e)===Ot;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 V=new Dg,Og="modulepreload",Ig=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=Ig(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":Og,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)})},xt="f-autocomplete",Ng=`${xt}-display-field`,ta=`${xt}-list`,Ft="highlight-component",Dn=`${ta}-item`,Fg=(l,e)=>{const t=l.reduce((n,p)=>n+(p===e),0);return t>1?`(${t})`:""},zh=["config.label","config.controlId"],Pg=["config.legend","name"],Hg=[...zh,...Pg],Po=l=>zh.reduce((e,t)=>e||l.get(t),null),ru=l=>Hg.reduce((e,t)=>e||l.get(t),null)||at(l.name),Wg=new Map([["condition.source",Po],["if.condition.source",Po],["if.condition.target",Po],["then.condition.target",ru],["condition.target",ru]]),Bh=({id:l,...e},t)=>{const{name:n,label:p}=e;return n?Wg.get(t)(e):p},zg=({selectedId:l,...e})=>(e.value===l&&(e.selected=!0),e),Ho=l=>(l.classList.contains(Dn)||(l=l.parentElement),l),jh=({value:l,textLabel:e,htmlLabel:t,componentType:n,depth:p=0},d)=>{const g={tag:"li",children:t,dataset:{value:l,label:e},className:[Dn,`${Dn}-depth-${p}`,`component-type-${n}`],action:{mousedown:({target:m})=>{m=Ho(m),d.setValue(m),d.selectOption(m),d.hideList()},mouseover:({target:m})=>{m=Ho(m),d.removeHighlight(),d.highlightComponent(m)},mouseleave:({target:m})=>{m=Ho(m),d.removeHighlight()}}};return V.create(g)},Bg=(l,e)=>{const t=l.data.options.map((p,d)=>{const g=`${l.address}.options[${d}]`,m=p.label,c=p.label;return jh({value:g,textLabel:m,htmlLabel:c,componentType:"option",depth:1},e)});return V.create({tag:"ul",attrs:{className:[ta,"options-list"]},children:t})},jg=l=>{const e=l.value,t=[],n=ce.flatList();return Object.entries(n).reduce((d,[g,m])=>{const c=Bh(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=Fg(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=Bg(m,l);i.push(y)}const h=zg({value:g,textLabel:u,htmlLabel:i,componentType:f,selectedId:e});d.push(jh(h,l))}return d},[])};class Vg{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(`${xt}-focused`);const p=V.toggleElementsByStr(this.list.querySelectorAll(`.${Dn}-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(`${xt}-focused`),n.removeEventListener("keydown",e),this.hideList()},input:n=>{const{value:p}=n.target,d=V.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=V.create({tag:"input",autocomplete:"off",action:t,attrs:{type:"text",className:Ng,value:this.label||this.value,placeholder:X.get(`${this.key}.placeholder`)}}),this.hiddenField=V.create({tag:"input",attrs:{type:"hidden",className:xt,value:this.value}}),this.list=V.create({tag:"ul",attrs:{className:ta}}),this.clearButton=V.create({tag:"span",content:V.icon("remove"),className:"clear-button hidden",action:{click:()=>this.clearValue()}}),this.dom=V.create({children:[this.displayField,this.clearButton,this.hiddenField],className:[xt,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&&Bh(e,`${this.key}`)||this.value}updateOptions(){let e=this.optionsCache;const t=Date.now();(t-this.lastCache>zs*5||!e)&&(V.empty(this.list),e=this.generateOptions(),this.lastCache=t),this.list.children.length||this.list.append(...e)}generateOptions(){return this.optionsCache=jg(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 Wo({key:l,value:e,type:t="text",checked:n}){const p={tag:"input",attrs:{type:t,value:e,placeholder:X.get(`${l}.placeholder`)||at(l)},className:[l.replace(/\./g,"-")],config:{}};return n&&(p.attrs.checked=!0),p}function Vh(l){const e=X.get(l);if(e)return e;const t=l.split(".");return X.get(t[t.length-1])}const Tt={autocomplete:(...l)=>new Vg(...l).createProxy(),string:({key:l,value:e})=>Wo({key:l,value:e}),boolean:({key:l,value:e})=>Wo({key:l,value:e,type:l==="selected"?"radio":"checkbox",checked:!!e}),number:({key:l,value:e})=>Wo({key:l,value:e,type:"number"}),array:({key:l,value:e})=>({tag:"select",attrs:{placeholder:Vh(`placeholder.${l}`)},className:[l.replace(/\./g,"-")],options:e}),object:l=>Object.entries(l).map(([e,t])=>Tt[V.childType(t)]({key:e,value:t}))},Ug={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:()=>({})},Uh="hidden-property",Gg="hidden-option",zo=/\.options\[\d+\]$/,qg={"if-sourceProperty":gn(pn,nc,ic),"if-targetProperty":gn(pn),"then-targetProperty":gn(pn,nc,ic),...Object.entries(Jf).reduce((l,[e,t])=>(l[`if-${e}`]=t,l[`then-${e}`]=t,l),{})},Gh={assignment:Pt,comparison:Pt,logical:Pt,source:({key:l,value:e,onChange:t,conditionType:n})=>Tt.autocomplete({key:`${n}.condition.${l}`,value:e,onChange:t,className:`condition-${l}`}),sourceProperty:Pt,targetProperty:Pt,target:l=>Gh.source(l),value:({key:l,value:e,onChange:t},n)=>{const p=Tt.string({key:`condition.${l}`,value:e});return p.action={input:t},p}};function Kg({key:l,value:e,conditionType:t}){const n=`${t}-${l}`,p=qg[n];return Object.entries(p||{}).map(([d,g])=>Yg({fieldName:l,fieldValue:e,key:d,optionValue:g}))}function Yg({fieldName:l,fieldValue:e,key:t,optionValue:n}){return{label:X.get(`${l}.${t}`)||at(t).toLowerCase(),value:n,selected:n===e}}function Pt({key:l,value:e,onChange:t,conditionType:n}){const p=Kg({key:l,value:e,conditionType:n}),d=Tt.array({key:`condition.${l}`,value:p});return d.action={change:t},d}const Zg=l=>!l?.classList.contains(Uh),Xg={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),!Ef(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||!Zg(l.get("comparison"))||t.value===qh?!0:t.value.startsWith("is")}},ou=l=>{for(const[e,t]of l){const n=!!Xg[e]?.(l)||!1;t.classList.toggle(Uh,n)}},qh="isChecked",Bo=l=>l.value.endsWith("Checked"),su=(l,e)=>{if(l&&Bo(e))return null;const t=Array.from(e.querySelectorAll("option")),n=[];for(const p of t){const d=Bo(p),g=l?!d:d;g&&n.push(p.value),p.classList.toggle(Gg,g)}n.includes(e.value)&&(e.value=l?qh:t.find(p=>!Bo(p))?.value||e.value)};function Qg(l,e=Qf){return e.reduce((t,n)=>(l[n]!==void 0&&t.push([n,l[n]]),t),[])}class Jg{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:X.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=Gh[p](m,this.values),f=c.dom||V.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 V.create(n)}generateConditionTypeActionButtons(){const e=[],t="manage-condition-type",n=g=>`${g}-condition-type`,p=V.btnTemplate({title:X.get(`remove${this.conditionType}Condition`),className:[t,n("remove")],content:V.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=V.btnTemplate({title:X.get(`add${this.conditionType}Condition`),className:[t,n("add")],content:V.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 em=new Map([["attrs",({itemKey:l})=>l],["options",({itemKey:l,key:e})=>`${l}.${e}`]]),Kh=(l,e)=>{if(e.controlId==="select"){const t=e.editPanels.get("options"),[n,p]=l?xn:np,d=t.data.map(({[n]:g,...m})=>({[p]:g,...m}));t.setData(d)}},tm=new Map([["attrs-multiple",l=>({change:({target:e})=>{l.field.controlId==="select"&&Kh(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=rc(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=V.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),xn,"0"):[[this.itemKey,e]]}findOrCreateConditionTypeWrap(e){let t=this.conditionTypeWrap.get(e);return t||(t=V.create({className:`type-conditions-wrap ${e}-conditions-wrap`}),this.conditionTypeWrap.set(e,t),t)}itemInputs(){const e=V.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]=Ks()[e],m=n.children.length;e===ph&&(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,Ye,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:V.icon("remove")};return{className:`${this.panelName}-prop-controls prop-controls`,content:[e]}}itemInput(e,t){const n=V.childType(t)||"string",p=em.get(this.panelName)?.({itemKey:this.itemKey,key:e})||this.itemKey,d=p.split(".").filter(Number.isNaN).join(".")||e,g=Tt[n]({key:e,value:t}),m=`${this.field.shortId}-${rc(p).replace(/-\d+-(selected)/g,"-$1")}`,c={label:this.panelName!=="options"&&(Vh(d)||at(d)),labelAfter:!1},f={name:g.attrs.type==="checkbox"?`${m}[]`:m};f.disabled=this.isDisabled,f.locked=this.isLocked;const r=tm.get(this.itemSlug)?.(this),o=Sp(Ug[n](p,this.field),r||{}),s=je(Tt[n]({key:e,value:t}),{action:o,attrs:f,config:c});return xn.includes(e)?{className:"f-addon",children:s}:s}}const nm={multiple:(l,e)=>{Kh(!!l,e)}};class im{constructor(e,t,n){this.type=V.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:X.get(`panel.label.${this.name}`)},attrs:{className:`${th} ${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 V.create(t)}updateProps(){const e=this.createProps();this.props.replaceWith(e),this.props=e}createEditButtons(){const e=this.name,t=X.get(`panelEditButtons.${e}`),n={attrs:this.addAttribute,options:this.addOption,conditions:this.addCondition},p=[];if(e==="conditions"){X.current&&!X.current.clearAll&&X.put("clearAll","Clear All");const m={...V.btnTemplate({content:[V.icon("bin"),X.get("clearAll")],title:X.get("clearAll")}),className:`clear-all-${e}`,action:{click:()=>{this.clearAllItems()}}};p.push(m)}const d={...V.btnTemplate({content:t,title:t}),className:`add-${e}`,action:{click:m=>{const c={btnCoords:V.coords(m.target),addAction:n[e]};e==="attrs"&&(c.isDisabled=this.component.isDisabledProp,c.isLocked=this.component.isLockedProp,c.message={attr:X.get(`action.add.${e}.attr`),value:X.get(`action.add.${e}.value`)});const f=at(e),r=new window.CustomEvent(`onAdd${f}`,{detail:c});xe.add[e](c),document.dispatchEvent(r)}}};return p.push(d),{className:"panel-action-buttons",content:p}}addAttribute=(e,t)=>{let n=t;const p=Nh(e),d=`attrs.${p}`;X.current[d]||X.put(d,Fh(e)),typeof n=="string"&&["true","false"].includes(n)&&(n=JSON.parse(n)),this.component.set(`attrs.${e}`,n),nm[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=X.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=mh(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()}};xe.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 Yh{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(V.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=V.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",V.create(t)}createPanelNav(){this.labels=this.createPanelNavLabels();const e={tag:"button",attrs:{className:"next-group",title:X.get("controlGroups.nextGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:n=>this.nav.nextGroup(n)},content:V.icon("triangle-right")},t={tag:"button",attrs:{className:"prev-group",title:X.get("controlGroups.prevGroup"),type:"button"},dataset:{toggle:"tooltip",placement:"top"},action:{click:n=>this.nav.prevGroup(n)},content:V.icon("triangle-left")};return V.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],V.removeClasses(d,"active-panel"),V.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[x]=i,[$]=u;i.push(x),u.push($)}const h={easing:"ease-in-out",duration:a?s:0,fill:"forwards"},y=t.animate(i,h);n.animate(u,h);const w=()=>{y.removeEventListener("finish",w),o||(m=r)};y.addEventListener("finish",w)};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 jo=null;const Vo=gn(pn);class Kn extends Zs{constructor(e,t={}){const n={...t,id:t.id||He()};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)?Ih(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),xf(ce.getAddress(`${t.name}s.${t.id}.children`),this.id),t.children.length||t.emptyClass(),t.name==="row"&&t.autoColumnWidths();const d={row:Us,column:Gs,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:[{...V.btnTemplate({content:V.icon(`handle-${this.name}`)}),className:["component-handle",`${this.name}-handle`]},{className:["action-btn-wrap",`${this.name}-action-btn-wrap`],children:this.buttons}]}}getComponentTag=()=>V.create({tag:"span",className:["component-tag",`${this.name}-tag`],children:[V.icon(`handle-${this.name}`),at(this.name)].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,Ye,e),this.name==="field"&&($e.slideToggle(this.preview,Ye,!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}`)=>({...V.btnTemplate({content:V.icon(g)}),className:["component-handle"]}),move:(g="move")=>({...V.btnTemplate({content:V.icon(g)}),className:["item-move"],meta:{id:"move"}}),edit:(g="edit")=>({...V.btnTemplate({content:V.icon(g)}),className:["edit-toggle"],meta:{id:"edit"},action:{click:()=>{this.toggleEdit()}}}),remove:(g="remove")=>({...V.btnTemplate({content:V.icon(g)}),className:["item-remove"],meta:{id:"remove"},action:{click:()=>{$e.slideUp(this.dom,Ye,()=>{this.name==="column"?(this.parent.autoColumnWidths(),this.remove()):this.remove()})}}}),clone:(g="copy")=>({...V.btnTemplate({content:V.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[V.childType(e)](this.dom)};get parentType(){return Uf.get(this.name)}get parent(){const e=this.parentType;if(!this.dom||!e)return null;const t=this.dom.closest(`.${Ws[e]}`);return t&&V.asComponent(t)}get children(){if(!this.dom)return[];const e=this.domChildren,t=ec.get(this.name);return ea(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=He()}=n,g=ec.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(st)||(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(!jo){const{default:w}=await $t(async()=>{const{default:x}=await Promise.resolve().then(()=>wm);return{default:x}},void 0);jo=w}const{controlData:{meta:{id:o},...s}}=jo.get(n.id);Vn(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 V.remove(n),h(s,p)},row:()=>{const o={stage:-1,row:0,column:1};return(c.get(o[g])||ys)()?.({id:n.id},p)},column:()=>{const o={stage:-2,row:-1};return(c.get(o[g])||ys)()?.(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(Je)&&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&&V.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,!Vo[d]].some(Boolean)?e:t?p.set(Vo[d],t):p.get(Vo[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:He()};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=>V.create({tag:"ul",attrs:{className:"children"},children:e});get isRow(){return this.name===Hr.row}get isColumn(){return this.name===Hr.column}get isField(){return this.name===Hr.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`,V.remove(n)}else this.resizePanelWrap()}},V.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=V.childType(m);if(e.includes(c)){const f=new im(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 Yh(d),this.dom&&(this.dom.querySelector(".panel-nav").replaceWith(this.panels.panelNav),this.dom.querySelector(".panels").replaceWith(this.panels.panelsWrap))}}class rm{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=V.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(Pr),this.columnPreset=p.querySelector(`.${nh}`),this.originalColumnClass=t.className,this.originalSiblingClass=n.className,t.className=t.className.replace(Cs,""),n.className=n.className.replace(Cs,""),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(Fr(t,this.rowWidth)),d=parseFloat(Fr(n,this.rowWidth));return p<10||d<10?null:{colWidth:vs(p.toFixed(1)),siblingColWidth:vs(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(Pr),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(Pr),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const e=this.columnPreset;let t=e.querySelector(`.${bs}`);const n=this.row.querySelector(".children").children,p=ea(n,m=>Fr(m.clientWidth,this.rowWidth).toFixed(1)),d=p.join(","),g=p.join(" | ");return t||(t=V.create({tag:"option",attrs:{className:bs,value:d,selected:!0},content:g}),e.append(t)),t.value=d,t.textContent=g,d}}const om=()=>Object.freeze({config:{width:"100%"},children:[],className:[Je]}),lu={resizeHandle:l=>({className:"resize-x-handle",action:{pointerdown:l.onStart.bind(l)},content:[V.icon("triangle-down"),V.icon("triangle-up")]}),editWindow:()=>({className:"column-edit group-config"})};class sm extends Kn{constructor(e){super("column",{...om(),...e});const t=this.createChildWrap();this.dom=V.create({tag:"li",className:[Je,"empty"],dataset:{hoverTag:X.get("column")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),lu.editWindow(),lu.resizeHandle(new rm),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:`.${Ot}`,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 am={actionButtons:{buttons:["clone","move","remove"],disabled:[]}};let lm=class extends Un{constructor(e){super("columns",e),this.config={all:am}}Component(e){return new sm(e)}};const Zh=new lm,cm=()=>Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[Qe]});class um extends Kn{constructor(e){super("row",{...cm(),...e});const t=this.createChildWrap();this.dom=V.create({tag:"li",className:[Qe,"empty"],dataset:{hoverTag:X.get("row"),editingHoverTag:X.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:`.${Je}`,handle:".item-move"})}get editWindow(){const e={tag:"input",id:`${this.id}-fieldset`,attrs:{type:"checkbox",checked:this.get("config.fieldset"),ariaLabel:X.get("row.settings.fieldsetWrap.aria")},action:{click:({target:{checked:s}})=>{this.set("config.fieldset",!!s)}},config:{label:X.get("row.settings.fieldsetWrap")}},t={tag:"input",id:`${this.id}-inputGroup`,attrs:{type:"checkbox",checked:this.get("config.inputGroup"),ariaLabel:X.get("row.settings.inputGroup.aria")},action:{click:({target:{checked:s}})=>this.set("config.inputGroup",s)},config:{label:X.get("row.makeInputGroup"),description:X.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=V.formGroup([e,d]),m={tag:"label",content:X.get("defineColumnWidths"),className:"col-sm-4 form-control-label"};this.columnPresetControl=V.create(this.columnPresetControlConfig);const c={className:"col-sm-8",content:this.columnPresetControl,action:{onRender:()=>{this.updateColumnPreset()}}},f=V.formGroup([m,c],"row"),r=[t,"hr",g,"hr",f];return V.create({className:`${this.name}-edit group-config`,action:{onRender:s=>{const a=r.map(i=>V.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(Cs);const p=n.dom,d=vs(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})=>V.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=qf.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:bs}),d.map(m=>{const c={...m};return c.selected=m.value===p,c})}return[]}get columnPresetControlConfig(){return{tag:"select",attrs:{ariaLabel:X.get("defineColumnLayout"),className:nh},action:{change:({target:t})=>{const{value:n}=t;this.setColumnWidths(n)}},options:this.getColumnPresetOptions}}}const hm={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}};let dm=class extends Un{constructor(e){super("rows",e),this.config={all:hm}}Component(e){return new um(e)}};const na=new dm,fm=()=>({conditions:[Ks()],children:[]});class pm extends Kn{constructor(e){super("stage",{...fm(),...e}),this.updateEditPanels(),this.debouncedUpdateEditPanels=$n(this.updateEditPanels),X.get("Untitled Form"),X.get("Untitled Form"),X.get("Form Title"),X.get("Form novalidate"),X.get("Tags");const t=this.createChildWrap();this.dom=V.create({attrs:{className:[Dt,"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,Ye,()=>{t(super.empty(e)),this.dom.classList.remove("removing-all-fields"),$e.slideDown(this.dom,Ye)})):t(super.empty())})}onAdd(...e){const t=super.onAdd(...e);t?.name==="column"&&t.parent.autoColumnWidths()}}const gm=()=>({actionButtons:{buttons:["edit"],disabled:[]},panels:{disabled:[],order:["attrs","options","conditions"]}});let mm=class extends Un{constructor(e){super("stages",e),this.config={all:gm()}}Component(e){return new pm(e)}};const en=new mm;class vm{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||He()}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:V.icon(e.icon)},{tag:"span",className:"control-label",content:n}],action:{focus:({target:d})=>{const g=d.closest(`.${st}`);return g&&Lt.panels.nav.refresh(lt(g))},click:({target:d})=>{const g=d.closest(".field-control")?.id;g&&Lt.addElement(g)}}};return V.create({tag:"li",id:this.id,className:["field-control",`${e.group}-control`,`${e.id}-control`],content:p,meta:e,action:this.controlAction})}promise(){return Wh(this.dependencies)}i18n(e,t){const n=X.locale,d=this.definition?.i18n?.[n]||{};return(d[e]?.()??d[e])||X.get(e,t)}}const ym=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 Xh=class{constructor(){this.data=new Map,this.buttonActions={focus:({target:e})=>{const t=e.closest(`.${st}`);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 vm(t);return this.add(p),this.controls.push(p.dom),p.promise()})}groupLabel=e=>X.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=>Ql(d.id,this.options.disable.groups)),n=e.map(d=>{const g={tag:"ul",attrs:{className:[st,th],id:`${d.id}-${st}`},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=[Ql(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={...V.btnTemplate({content:[V.icon("bin"),X.get("clear")],title:X.get("clearAll")}),className:["clear-form"],action:{click:p=>{na.size?(J.confirmClearAll=new window.CustomEvent("confirmClearAll",{detail:{confirmationMessage:X.get("confirmClearAll"),clearAllAction:()=>{en.clearAll().then(()=>{const d={src:p.target};J.formeoCleared(d)})},btnCoords:V.coords(p.target)}}),document.dispatchEvent(J.confirmClearAll)):window.alert(X.get("cannotClearFields"))}}},t={...V.btnTemplate({content:[V.icon("floppy-disk"),X.get("save")],title:X.get("save")}),className:["save-form"],action:{click:async({target:p})=>{const{default:d}=await $t(async()=>{const{default:c}=await Promise.resolve().then(()=>Em);return{default:c}},void 0),{formData:g}=d,m={action:()=>{},coords:V.coords(p),message:"",button:p};return xe.click.btn(m),xe.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 Yh({panels:t,type:"controls",displayType:p});const d=["control-groups","formeo-panels-wrap",`panel-count-${t.length}`],g=V.create({className:d,content:[this.panels.panelNav,this.panels.panelsWrap]}),m=["formeo-controls"];e&&m.push("formeo-sticky");const c=V.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(V.toggleElementsByStr(a,o),s){const u=X.get("controls.filteringTerm",o);c.classList.add("filtered"),i?i.textContent=u:(i=V.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(()=>Am);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 Vn(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(ym,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 Xh,wm=Object.freeze(Object.defineProperty({__proto__:null,Controls:Xh,default:Lt},Symbol.toStringTag,{value:"Module"})),bm=()=>({}),Cm=new Set(["checkbox","radio"]),Sm=new Set(["radio","checkbox","select-one","select-multiple"]);class Qh extends Kn{constructor(e=Object.create(null)){super("field",{...bm(),...e}),this.debouncedUpdateEditPanels=$n(this.updateEditPanels),this.debouncedUpdatePreview=$n(this.updatePreview),this.label=V.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=V.create({tag:"li",attrs:{className:Ot},id:this.id,children:[this.label,this.getComponentTag(),t,n&&this.editWindow,this.preview].filter(Boolean),panelNav:this.panelNav,dataset:{hoverTag:X.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&&V.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=V.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(Sm.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:V.create(t,!0),action:this.defaultPreviewActions};return V.create(n,!0)}get isCheckable(){return Cm.has(this.get("config.controlId"))}}const Am=Object.freeze(Object.defineProperty({__proto__:null,default:Qh},Symbol.toStringTag,{value:"Module"})),$m=()=>({actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}});let Mm=class extends Un{constructor(e){super("fields",e),this.config={all:$m()}}Component(e){return new Qh(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&&Vn(g,"config.controlId",d?.id),this.add(n,g)}return this.data}};const Jh=new Mm,Cn=en,Sn=na,Qt=Zh,An=Jh,On=Lt,xm=(l,e=!1)=>l?Xe(zn(l)):e&&Ju.get(oh)||Mn();class ed extends Zs{constructor(){super("components"),this.disableEvents=!0,this.stages=Cn,this.rows=Sn,this.columns=Qt,this.fields=An,this.controls=On}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",Qt.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))eh(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@${Fs}/dist/formData_schema.json`,...this.formData})}get formData(){return{id:this.get("id"),stages:en.getData(),rows:na.getData(),columns:Zh.getData(),fields:Jh.getData()}}set config(e){const{stages:t,rows:n,columns:p,fields:d}=e;Cn.config=t,Sn.config=n,Qt.config=p,An.config=d}getIndex(e){return this[e]||this[Ff.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 ed,Em=Object.freeze(Object.defineProperty({__proto__:null,Columns:Qt,Components:ed,Controls:On,Fields:An,Rows:Sn,Stages:Cn,default:ce},Symbol.toStringTag,{value:"Module"})),cu="no-transition",_m={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)}},ze=({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(Kf,{detail:e,bubbles:J.opts?.debug||J.opts?.bubbles});(l||document).dispatchEvent(p)}return n},J={init:function(l){return this.opts={..._m,...l},this},formeoSaved:l=>ze(l,sh),formeoUpdated:(l,e)=>ze(l,e||Jt),formeoCleared:l=>ze(l,Yf),formeoOnRender:l=>ze(l,hh),formeoConditionUpdated:l=>ze(l,Zf),formeoAddedRow:l=>ze(l,Bs),formeoAddedColumn:l=>ze(l,js),formeoAddedField:l=>ze(l,Vs),formeoRemovedRow:l=>ze(l,Us),formeoRemovedColumn:l=>ze(l,Gs),formeoRemovedField:l=>ze(l,qs)},Tm=_f(()=>{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,Tm);document.addEventListener(ah,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(lh,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(ch,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(uh,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(Bs,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onAddRow(p)});document.addEventListener(js,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onAddColumn(p)});document.addEventListener(Vs,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onAddField(p)});document.addEventListener(Us,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onRemoveRow(p)});document.addEventListener(Gs,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(hh,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(sh,({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 Uo;function Lm(){Uo=Uo||window.requestAnimationFrame(()=>{Uo=!1;for(const l of Object.values(Qt.data))l.dom.classList.add(cu),On.dom.classList.add(cu),On.panels.nav.refresh(),l.refreshFieldPanels()})}window.addEventListener("resize",Lm);const uu={add:{attr:l=>{const e=window.prompt(l.message.attr);if(e&&l.isDisabled(e))return window.alert(X.get("attributeNotPermitted",e||"")),xe.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:ys}},xe={init:function(l){const e=Object.keys(uu);return this.opts=e.reduce((t,n)=>(t[n]={...uu[n],...l[n]},t),l),this},add:{attrs:l=>xe.opts.add.attr(l),options:l=>xe.opts.add.option(l),conditions:l=>(l.template=l.template||Ks(),xe.opts.add.condition(l))},remove:{attrs:l=>xe.opts.remove.attrs(l),options:l=>xe.opts.remove.options(l),conditions:l=>xe.opts.remove.conditions(l)},click:{btn:l=>xe.opts.click.btn(l)},save:{form:l=>(xe.opts.sessionStorage&&Ju.set(oh,l),J.formeoSaved({formData:l}),xe.opts.save.form(l))}},Rm={"en-US":{"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 <fieldset> tag","row.settings.fieldsetWrap.aria":"Wrap Row in Fieldset",save:"Save",secondary:"Secondary",select:"Select",selectColor:"Select Color",selectionsMessage:"Allow Multiple Selections",selectOptions:"Options",separator:"Separator",settings:"Settings",size:"Size",sizes:"Sizes","sizes.lg":"Large","sizes.m":"Default","sizes.sm":"Small","sizes.xs":"Extra Small",style:"Style",styles:"Styles","styles.btn":"Button Style","styles.btn.danger":"Danger","styles.btn.default":"Default","styles.btn.info":"Info","styles.btn.primary":"Primary","styles.btn.success":"Success","styles.btn.warning":"Warning",subtype:"Type",success:"Success",text:"Text Field",then:"Then","then.condition.target.placeholder":"target",toggle:"Toggle",ungrouped:"Un-Grouped",warning:"Warning",yes:"Yes"}},km=Rm["en-US"],td="en-US";X.addLanguage(td,km);X.setCurrent(td);const Dm={get editor(){return{stickyControls:!1,allowEdit:!0,dataType:"json",debug:!1,sessionStorage:!1,editorContainer:null,svgSprite:null,style:Df,iconFont:null,config:{},events:{},actions:{},controls:{},i18n:{location:"https://draggable.github.io/formeo/assets/lang/"},onLoad:()=>{}}}};new Nu;let nd=class{constructor({formData:e,...t},n){const p=je(Dm.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,V.setOptions=r,ce.config=c,this.userFormData=n||e,this.Components=ce,this.dom=V,J.init({debug:m,...g}),xe.init({debug:m,sessionStorage:r.sessionStorage,...d}),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",this.loadResources.bind(this)):this.loadResources()}get formData(){return this.Components.formData}set formData(e={}){this.userFormData=Gt(e),this.load(this.userFormData,this.opts)}loadData(e={}){this.formData=e}get json(){return this.Components.json}clear(){this.userFormData=Mn(),this.Components.load(this.userFormData,this.opts),this.render()}async loadResources(){document.removeEventListener("DOMContentLoaded",this.loadResources);const e=[];e.push(Eg(this.opts.svgSprite),Tg(this.opts.style),X.init({...this.opts.i18n,locale:globalThis.sessionStorage?.getItem(tc)})),await Promise.all(e),this.opts.allowEdit&&this.init()}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(tc,t),X.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)]};X.current.dir&&(e.attrs.dir=X.current.dir,V.dir=X.current.dir),this.editor=V.create(e),(this.controls.container||this.editor).appendChild(this.controls.dom),this.editorContainer&&(V.empty(this.editorContainer),this.editorContainer.appendChild(this.editor)),J.formeoLoaded=new globalThis.CustomEvent("formeoLoaded",{detail:{formeo:this}}),document.dispatchEvent(J.formeoLoaded)}};const Go="f-",hu=l=>typeof l=="string"?document.querySelector(l):l,Om=({editorContainer:l,renderContainer:e,formData:t,...n})=>{const p={renderContainer:hu(e),editorContainer:hu(l),formData:Gt(t)};return{elements:{},...n,...p}},qo=l=>l.match(tp)?.[0]||l``,du=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")},Im={isChecked:l=>l.checked,isNotChecked:l=>!l.checked,value:l=>l.value,isVisible:l=>du(l),isNotVisible:l=>!du(l)},Nm=()=>V.btnTemplate({className:"remove-input-group",children:V.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()}}),fu={equals:Ss,notEquals:(l,e)=>!Ss(l,e),contains:(l,e)=>l.includes(e),notContains:(l,e)=>!l.includes(e)},Fm=Object.entries(dh).reduce((l,[e,t])=>(l[t]=fu[e],l[e]=fu[e],l),{}),pu={equals:(l,{targetProperty:e,value:t})=>{l[`_${e}`]=l[e],l[e]=t}},Pm=Object.entries(fh).reduce((l,[e,t])=>(l[t]=pu[e],l[e]=pu[e],l),{}),Hm={isChecked:l=>{l.checked=!0},isNotChecked:l=>{l.checked=!1},value:(l,{assignment:e,...t})=>{const n=Pm[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 id=class{constructor(e,t){const{renderContainer:n,elements:p,formData:d}=Om(e);this.container=n,this.form=Gt(t||d),this.dom=V,this.components=Object.create(null),this.elements=p}get formData(){return this.form}set formData(e){this.form=Gt(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=Gt(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=V.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=>Go+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(`${Go}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:He(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=V.create(this.cloneComponentData(e));n.insertBefore(p,n.lastChild);const d=V.create(Nm());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&&Wh(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=Dt,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=Wm(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 Fm[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;Hm[t]?.(m,{targetProperty:t,assignment:n,value:p})}};getComponentProperty=(e,t)=>{const{component:n,option:p}=this.getComponent(e),d=p||n;return Im[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(`#${Go}${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 Wm=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=nd,window.FormeoRenderer=id);const ia=nd,ra=id,zm={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}}}}},Bm={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"]}},jm=".build-form",Vm=".render-form",tn={editorContainer:jm,actions:{},controls:Bm,config:zm,events:{onSave:console.log,onChange:console.log},sessionStorage:!0,editPanelOrder:["attrs","options"],onLoad:()=>{console.log("demo loaded")}},oa={renderContainer:Vm,elements:{tinymce:{action:{onRender:l=>{if(l.id){const e=`#${l.id}`;window.tinymce.remove(e),window.tinymce.init({selector:e})}}}}}};async function Um(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
|
|
18
|
+
`;try{await Gm(),await qm()&&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">${Yo(
|
|
54
|
+
<pre><code class="language-typescript">${Yo(Zm)}</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">${Yo(
|
|
59
|
+
<pre><code class="language-typescript">${Yo(Xm)}</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">${Yo(
|
|
64
|
+
<pre><code class="language-typescript">${Yo(Qm)}</code></pre>
|
|
65
65
|
</div>
|
|
66
66
|
</div>
|
|
67
67
|
|
|
@@ -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
|
|
83
|
+
`,{cleanup:()=>{}}}}async function Gm(){await new Promise(l=>setTimeout(l,500)),console.log("Angular-style demo environment ready")}async function qm(){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),Km(),await Ko("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"),await Ko("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/typescript.min.js"),await Ko("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 Km(){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(l)}function
|
|
149
|
+
`,document.head.appendChild(l)}function Ko(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 gu(){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 Ym(){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=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={...oa,renderContainer:".render-form-angular-real"},m=new ia(d),c=new ra(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 Yo(l){const e=document.createElement("div");return e.textContent=l,e.innerHTML}const
|
|
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={...oa,renderContainer:".render-form-angular-real"},m=new ia(d),c=new ra(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 Yo(l){const e=document.createElement("div");return e.textContent=l,e.innerHTML}const Zm=`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
|
-
}`,
|
|
356
|
+
}`,Xm=`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
|
-
}`,
|
|
476
|
+
}`,Qm=`// 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';
|
|
@@ -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">${
|
|
556
|
+
<pre><code class="language-typescript">${Xo(rv)}</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">${
|
|
561
|
+
<pre><code class="language-typescript">${Xo(ov)}</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">${
|
|
566
|
+
<pre><code class="language-typescript">${Xo(sv)}</code></pre>
|
|
567
567
|
</div>
|
|
568
568
|
</div>
|
|
569
569
|
|
|
@@ -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 ev(){await new Promise(l=>setTimeout(l,500)),console.log("React-style demo environment ready")}async function tv(){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),nv(),await
|
|
585
|
+
`,{cleanup:()=>{}}}}async function ev(){await new Promise(l=>setTimeout(l,500)),console.log("React-style demo environment ready")}async function tv(){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),nv(),await Zo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"),await Zo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/typescript.min.js"),await Zo("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 nv(){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(l)}function
|
|
659
|
+
`,document.head.appendChild(l)}function Zo(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 mu(){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 iv(){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=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={...oa,renderContainer:".render-form-react-real"},m=new ia(d),c=new ra(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
|
|
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={...oa,renderContainer:".render-form-react-real"},m=new ia(d),c=new ra(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 Xo(l){const e=document.createElement("div");return e.textContent=l,e.innerHTML}const rv=`import { useEffect, useRef, useCallback } from 'react';
|
|
679
679
|
import { FormeoEditor, FormeoRenderer } from 'formeo';
|
|
680
680
|
|
|
681
681
|
// Custom hook for Formeo Editor
|
|
@@ -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
|
|
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 {
|
|
1170
|
+
};`;var Qo={exports:{}},vu;function av(){return vu||(vu=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,w){return d(o,y,w)},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,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<")},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=[],w=0;w<a.length;w++){var x=s(a[w],i,u);x&&y.push(x)}return y}var $=document.createElement(a[0]),A=a[1],S=1;A&&typeof A=="object"&&!Array.isArray(A)&&(S=2);for(var w=S;w<a.length;w++)s(a[w],$,u);return S==2&&Object.keys(A).forEach(function(E){var R=A[E];E==="class"?$.className=Array.isArray(R)?R.join(" "):R:typeof R=="function"||E=="value"||E[0]=="$"?$[E]=R:E==="ref"?u&&(u[R]=$):E==="style"?typeof R=="string"&&($.style.cssText=R):R!=null&&$.setAttribute(E,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 w=a.offsetWidth;return y===w&&(w=i.clientWidth),h.removeChild(i),y-w},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(w){var x=y[w];typeof x=="string"&&(x={forwardTo:x}),x.name||(x.name=w),u.$options[x.name]=x,"initialValue"in x&&(u["$"+x.name]=x.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 w=this.$defaultOptions[u]||(this.$defaultOptions[u]={});w[h]&&(w.forwardTo?this.setDefaultValue(w.forwardTo,h,y):w[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 w=o[u]||o[h]||h;return y&&(s==="dollarSigns"&&(w=w.replace(/\$(\$|[\d]+)/g,function(x,$){return $=="$"?"$":y[$]})),s==="curlyBrackets"&&(w=w.replace(/\{([^\}]+)\}/g,function(x,$){return y[$]}))),w},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"),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 D=150;S.wheelX=R*D,S.wheelY=L*D;break}$(S)},A)},n.addMultiMouseDownListener=function(T,$,A,S,M){var R=0,L,_,D,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;(!D||E)&&(R=1),D&&clearTimeout(D),D=setTimeout(function(){D=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,D=!1,w="";T||(M.style.fontSize="1px");var v=!1,C=!1,E="",x=0,k=0,O=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||D)){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 w=new RegExp("^"+i+"[\\-_]|[\\-_]"+i+"$","g");y=y.replace(w,"")}(!y||y==i)&&u.length>1&&(y=u[u.length-2]);var x=f[i+"Path"];return x==null?x=f.basePath:h=="/"&&(i=h=""),x&&x.slice(-1)!="/"&&(x+="/"),x+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 w=function(x){if(x&&!n.$loading[y])return i&&i(x);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 E=n.$loading[y];n.$loading[y]=null,E.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(x){x.default?w(x.default):w(x)});else{try{u=this.$require(y)}catch{}w(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 w=h.attributes,x=0,$=w.length;x<$;x++){var A=w[x];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 E in r)typeof r[E]<"u"&&d.set(E,r[E])}}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(x,$,A){this.elem=x,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(x,$,A,S){x.addEventListener($,A,o()),S&&S.$toDestroy.push(new s(x,$,A))},i=n.removeListener=function(x,$,A){x.removeEventListener($,A,o())};n.stopEvent=function(x){return n.stopPropagation(x),n.preventDefault(x),!1},n.stopPropagation=function(x){x.stopPropagation&&x.stopPropagation()},n.preventDefault=function(x){x.preventDefault&&x.preventDefault()},n.getButton=function(x){return x.type=="dblclick"?0:x.type=="contextmenu"||g.isMac&&x.ctrlKey&&!x.altKey&&!x.shiftKey?2:x.button},n.capture=function(x,$,A){var S=x&&x.ownerDocument||document;function E(R){$&&$(R),A&&A(R),i(S,"mousemove",$),i(S,"mouseup",E),i(S,"dragstart",E)}return a(S,"mousemove",$),a(S,"mouseup",E),a(S,"dragstart",E),E},n.addMouseWheelListener=function(x,$,A){a(x,"wheel",function(S){var E=.15,R=S.deltaX||0,L=S.deltaY||0;switch(S.deltaMode){case S.DOM_DELTA_PIXEL:S.wheelX=R*E,S.wheelY=L*E;break;case S.DOM_DELTA_LINE:var _=15;S.wheelX=R*_,S.wheelY=L*_;break;case S.DOM_DELTA_PAGE:var D=150;S.wheelX=R*D,S.wheelY=L*D;break}$(S)},A)},n.addMultiMouseDownListener=function(x,$,A,S,E){var R=0,L,_,D,b={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 M=Math.abs(C.clientX-L)>5||Math.abs(C.clientY-_)>5;(!D||M)&&(R=1),D&&clearTimeout(D),D=setTimeout(function(){D=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](b[R],C)}Array.isArray(x)||(x=[x]),x.forEach(function(C){a(C,"mousedown",v,E)})};function u(x){return 0|(x.ctrlKey?1:0)|(x.altKey?2:0)|(x.shiftKey?4:0)|(x.metaKey?8:0)}n.getModifierString=function(x){return d.KEY_MODS[u(x)]};function h(x,$,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 E=$.location;if(A===17&&E===1)m[A]==1&&(c=$.timeStamp);else if(A===18&&S===3&&E===2){var R=$.timeStamp-c;R<50&&(m.altGr=!0)}}}if(A in d.MODIFIER_KEYS&&(A=-1),!(!S&&A===13&&$.location===3&&(x($,S,-A),$.defaultPrevented))){if(g.isChromeOS&&S&8){if(x($,S,A),$.defaultPrevented)return;S&=-9}return!S&&!(A in d.FUNCTION_KEYS)&&!(A in d.PRINTABLE_KEYS)?!1:x($,S,A)}}n.addCommandKeyListener=function(x,$,A){var S=null;a(x,"keydown",function(E){m[E.keyCode]=(m[E.keyCode]||0)+1;var R=h($,E,E.keyCode);return S=E.defaultPrevented,R},A),a(x,"keypress",function(E){S&&(E.ctrlKey||E.altKey||E.shiftKey||E.metaKey)&&(n.stopEvent(E),S=null)},A),a(x,"keyup",function(E){m[E.keyCode]=null},A),m||(y(),a(window,"focus",y))};function y(){m=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!g.isOldIE){var w=1;n.nextTick=function(x,$){$=$||window;var A="zero-timeout-message-"+w++,S=function(E){E.data==A&&(n.stopPropagation(E),i($,"message",S),x())};a($,"message",S),$.postMessage(A,"*")}}n.$idleBlocked=!1,n.onIdle=function(x,$){return setTimeout(function A(){n.$idleBlocked?setTimeout(A,100):x()},$)},n.$idleBlockId=null,n.blockIdle=function(x){n.$idleBlockId&&clearTimeout(n.$idleBlockId),n.$idleBlocked=!0,n.$idleBlockId=setTimeout(function(){n.$idleBlocked=!1},x||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(x){setTimeout(x,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,w=y?/\s/:/\n/,x=m.isMobile,$;$=function(A,S){var E=c.createElement("textarea");E.className="ace_text-input",E.setAttribute("wrap","off"),E.setAttribute("autocorrect","off"),E.setAttribute("autocapitalize","off"),E.setAttribute("spellcheck","false"),E.style.opacity="0",A.insertBefore(E,A.firstChild);var R=!1,L=!1,_=!1,D=!1,b="";x||(E.style.fontSize="1px");var v=!1,C=!1,M="",T=0,k=0,O=0,I=Number.MAX_SAFE_INTEGER,N=Number.MIN_SAFE_INTEGER,P=0;try{var B=document.activeElement===E}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 Z=S.session.selection.cursor.row;j+=g("text-input.aria-label","Cursor at row $0",[Z+1])}E.setAttribute("aria-label",j)},this.setAriaOptions=function(j){j.activeDescendant?(E.setAttribute("aria-haspopup","true"),E.setAttribute("aria-autocomplete",j.inline?"both":"list"),E.setAttribute("aria-activedescendant",j.activeDescendant)):(E.setAttribute("aria-haspopup","false"),E.setAttribute("aria-autocomplete","both"),E.removeAttribute("aria-activedescendant")),j.role&&E.setAttribute("role",j.role),j.setLabel&&(E.setAttribute("aria-roledescription",g("text-input.aria-roledescription","editor")),this.setAriaLabel())},this.setAriaOptions({role:"textbox"}),d.addListener(E,"blur",function(j){C||(S.onBlur(j),B=!1)},S),d.addListener(E,"focus",function(j){if(!C){if(B=!0,m.isEdge)try{if(!document.hasFocus())return}catch{}S.onFocus(j),m.isEdge?setTimeout(H):H()}},S),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:S.renderer.enableKeyboardAccessibility}),b||a||this.$focusScroll=="browser")return E.focus({preventScroll:!0});var j=E.style.top;E.style.position="fixed",E.style.top="0px";try{var Z=E.getBoundingClientRect().top!=0}catch{return}var ee=[];if(Z)for(var re=E.parentElement;re&&re.nodeType==1;)ee.push(re),re.setAttribute("ace_nocontext","true"),!re.parentElement&&re.getRootNode?re=re.getRootNode().host:re=re.parentElement;E.focus({preventScroll:!0}),Z&&ee.forEach(function(ae){ae.removeAttribute("ace_nocontext")}),setTimeout(function(){E.style.position="",E.style.top=="0px"&&(E.style.top=j)},0)},this.blur=function(){E.blur()},this.isFocused=function(){return B},S.on("beforeEndOperation",function(){var j=S.curOp,Z=j&&j.command&&j.command.name;if(Z!="insertstring"){var ee=Z&&(j.docChanged||j.selectionChanged);_&&ee&&(M=E.value="",ht()),H()}}),S.on("changeSelection",this.setAriaLabel);var F=function(j,Z){for(var ee=Z,re=1;re<=j-I&&re<2*P+1;re++)ee+=S.session.getLine(j-re).length+1;return ee},H=y?function(j){if(!(!B||R&&!j||D)){j||(j="");var Z=`
|
|
1330
1330
|
ab`+j+`cde fg
|
|
1331
|
-
`;
|
|
1332
|
-
`),j=F(ae.start.row,ae.start.column),
|
|
1333
|
-
`+ee}else if(ae.end.row>N){var le=S.session.getLine(N+1);
|
|
1334
|
-
`+le}else
|
|
1335
|
-
`+ee,
|
|
1336
|
-
`,j==
|
|
1337
|
-
|
|
1338
|
-
`;_e!=
|
|
1339
|
-
`:ye},
|
|
1340
|
-
`?le=u.end:me<
|
|
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 la=X.commands.findKeyCommand(_e,le);la&&X.execCommand(la)}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 D=_.value;if(this.doPopupsOverlap(D,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,D=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-D-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(),D=u.$lines.get(_);if(D){var w=D.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 D="".concat(i.annotationsToSummaryString(A)," in folded code.");T.displayText.push(D),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,_,D,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 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?D?H-D>=c&&i.renderer.scrollCursorIntoView(ue):D=H:D=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,D=null,w=null,g.removeListener(document,"mousemove",N)}var I=null;function N(){I==null&&(I=setTimeout(function(){I!=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(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)},O=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(),O(I)},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 D(){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,O=C.timeStamp;i=O;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(),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(D,450)}a=O},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,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 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=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,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,D=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,D,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 D: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,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]<D||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),D=A.getTokenAt(M.row,M.column);if(_!==""&&_!=="{"&&$.getWrapBehavioursEnabled())return u(L,_,"{","}");if(D&&/(?:string)\.quasi|\.xml/.test(D.type)){var w=[/tag\-(?:open|name)/,/attribute\-name/];return w.some(function(I){return I.test(D.type)})||/(string)\.quasi/.test(D.type)&&D.value[M.column-D.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
|
+
`;Z!=E.value&&(E.value=M=Z);var ee=4,re=4+(j.length||(S.selection.isEmpty()?0:1));(T!=ee||k!=re)&&E.setSelectionRange(ee,re),T=ee,k=re}}:function(){if(!(_||D)&&!(!B&&!K)){_=!0;var j=0,Z=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),Z=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,Z+=de.length+1,ee=de+`
|
|
1333
|
+
`+ee}else if(ae.end.row>N){var le=S.session.getLine(N+1);Z=ae.end.row>N+1?le.length:ae.end.column,Z+=ee.length+1,ee=ee+`
|
|
1334
|
+
`+le}else x&&ge>0&&(ee=`
|
|
1335
|
+
`+ee,Z+=1,j+=1);ee.length>i&&(j<i&&Z<i?ee=ee.slice(0,i):(ee=`
|
|
1336
|
+
`,j==Z?j=Z=0:(j=0,Z=1)));var _e=ee+`
|
|
1337
|
+
|
|
1338
|
+
`;_e!=M&&(E.value=M=_e,T=k=_e.length)}if(K&&(T=E.selectionStart,k=E.selectionEnd),k!=Z||T!=j||E.selectionEnd!=k)try{E.setSelectionRange(j,Z),T=j,k=Z}catch{}_=!1}};this.resetSelection=H,B&&S.onFocus();var z=function(j){return j.selectionStart===0&&j.selectionEnd>=M.length&&j.value===M&&M&&j.selectionEnd!==k},W=function(j){_||(R?R=!1:z(E)?(S.selectAll(),H()):x&&E.selectionStart!=T&&H())},U=null;this.setInputHandler=function(j){U=j},this.getInputHandler=function(){return U};var K=!1,Y=function(j,Z){if(K&&(K=!1),L)return H(),j&&S.onPaste(j),L=!1,"";for(var ee=E.selectionStart,re=E.selectionEnd,ae=T,ge=M.length-k,ye=j,me=j.length-ee,de=j.length-re,le=0;ae>0&&M[le]==j[le];)le++,ae--;for(ye=ye.slice(le),le=1;ge>0&&M.length-le>T-1&&M[M.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),!Z&&!ye&&!me&&!ae&&!ge&&!de)return"";D=!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}),D=!1,M=j,T=ee,k=re,O=de,It?`
|
|
1339
|
+
`:ye},G=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 Z=E.value,ee=Y(Z,!0);(Z.length>i+100||w.test(ee)||x&&T<1&&T==k)&&H()},Q=function(j,Z,ee){var re=j.clipboardData||window.clipboardData;if(!(!re||o)){var ae=s||ee?"Text":"text/plain";try{return Z?re.setData(ae,Z)!==!1:re.getData(ae)}catch(ge){if(!ee)return Q(ge,Z,!0)}}},ue=function(j,Z){var ee=S.getCopyText();if(!ee)return d.preventDefault(j);Q(j,ee)?(y&&(H(ee),R=ee,setTimeout(function(){R=!1},10)),Z?S.onCut():S.onCopy(),d.preventDefault(j)):(R=!0,E.value=ee,E.select(),setTimeout(function(){R=!1,H(),Z?S.onCut():S.onCopy()}))},Ee=function(j){ue(j,!0)},Ce=function(j){ue(j,!1)},he=function(j){var Z=Q(j);r.pasteCancelled()||(typeof Z=="string"?(Z&&S.onPaste(Z,j),m.isIE&&setTimeout(H),d.preventDefault(j)):(E.value="",L=!0))};d.addCommandKeyListener(E,function(j,Z,ee){if(!_)return S.onCommandKey(j,Z,ee)},S),d.addListener(E,"select",W,S),d.addListener(E,"input",G,S),d.addListener(E,"cut",Ee,S),d.addListener(E,"copy",Ce,S),d.addListener(E,"paste",he,S),(!("oncut"in E)||!("oncopy"in E)||!("onpaste"in E))&&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:Ee(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",Yn);var Z=S.getSelectionRange();Z.end.row=Z.start.row,Z.end.column=Z.start.column,_.markerRange=Z,_.selectionStart=T,S.onCompositionStart(_),_.useTextareaForIME?(M=E.value="",T=0,k=0):(E.msGetInputContext&&(_.context=E.msGetInputContext()),E.getInputContext&&(_.context=E.getInputContext()))}},ut=function(){if(!(!_||!S.onCompositionUpdate||S.$readOnly)){if(v)return Yn();if(_.useTextareaForIME)S.onCompositionUpdate(E.value);else{var j=E.value;Y(j),_.markerRange&&(_.context&&(_.markerRange.start.column=_.selectionStart=_.context.compositionStartOffset),_.markerRange.end.column=_.markerRange.start.column+k-_.selectionStart+O)}}},ht=function(j){!S.onCompositionEnd||S.$readOnly||(_=!1,S.onCompositionEnd(),S.off("mousedown",Yn),j&&G())};function Yn(){C=!0,E.blur(),E.focus(),C=!1}var aa=f.delayedCall(ut,50).schedule.bind(null,null);function od(j){j.keyCode==27&&E.value.length<E.selectionStart&&(_||(M=E.value),T=k=-1,H()),aa()}d.addListener(E,"compositionstart",ke,S),d.addListener(E,"compositionupdate",ut,S),d.addListener(E,"keyup",od,S),d.addListener(E,"keydown",aa,S),d.addListener(E,"compositionend",ht,S),this.getElement=function(){return E},this.setCommandMode=function(j){v=j,E.readOnly=!1},this.setReadOnly=function(j){v||(E.readOnly=j)},this.setCopyWithEmptySelection=function(j){},this.onContextMenu=function(j){K=!0,H(),S._emit("nativecontextmenu",{target:S,domEvent:j}),this.moveToMouse(j,!0)},this.moveToMouse=function(j,Z){b||(b=E.style.cssText),E.style.cssText=(Z?"z-index:100000;":"")+(m.isIE?"opacity:0.1;":"")+"text-indent: -"+(T+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-E.clientHeight-2,me=function(de){c.translate(E,de.clientX-ge-2,Math.min(de.clientY-ae-2,ye))};me(j),j.type=="mousedown"&&(S.renderer.$isMousePressed=!0,clearTimeout(Zn),m.isWin&&d.capture(S.container,me,sn))},this.onContextMenuClose=sn;var Zn;function sn(){clearTimeout(Zn),Zn=setTimeout(function(){b&&(E.style.cssText=b,b=""),S.renderer.$isMousePressed=!1,S.renderer.$keepTextAreaAtCursor&&S.renderer.$moveTextAreaToCursor()},0)}var Xn=function(j){S.textInput.onContextMenu(j),sn()};d.addListener(E,"mouseup",Xn,S),d.addListener(E,"mousedown",function(j){j.preventDefault(),sn()},S),d.addListener(S.renderer.scroller,"contextmenu",Xn,S),d.addListener(E,"contextmenu",Xn,S),y&&sd(A,S,E);function sd(j,Z,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||_||Z.$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&&M[de]==`
|
|
1340
|
+
`?le=u.end:me<T&&M[me-1]==" "?(le=u.left,_e=h.option):me<T||me==T&&k!=T&&me==de?le=u.left:de>k&&M.slice(0,de).split(`
|
|
1341
|
+
`).length>2?le=u.down:de>k&&M[de-1]==" "?(le=u.right,_e=h.option):(de>k||de==k&&k!=T&&me==de)&&(le=u.right),me!==de&&(_e|=h.shift),le){var It=Z.onCommandKey({},_e,le);if(!It&&Z.commands){le=u.keyCodeToString(le);var la=Z.commands.findKeyCommand(_e,le);la&&Z.execCommand(la)}T=me,k=de,H("")}}};document.addEventListener("selectionchange",ge),Z.on("destroy",function(){document.removeEventListener("selectionchange",ge)})}this.destroy=function(){E.parentElement&&E.parentElement.removeChild(E)}},n.TextInput=$,n.$setUserAgentForTests=function(A,S){x=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(),w=y.isEmpty();(w||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),w=this.$clickSelection.comparePoint(h.end);if(y==-1&&w<=0)a=this.$clickSelection.end,(h.end.row!=u.row||h.end.column!=u.column)&&(u=h.start);else if(w==1&&y>=0)a=this.$clickSelection.start,(h.start.row!=u.row||h.start.column!=u.column)&&(u=h.end);else if(y==-1&&w==1)u=h.end,a=h.start;else{var x=r(this.$clickSelection,u);u=x.cursor,a=x.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,w=h?s.wheelY/h:i.vy;h<m&&(y=(y+i.vx)/2,w=(w+i.vy)/2);var x=Math.abs(y/w),$=!1;if(x>=1&&a.renderer.isScrollableBy(s.wheelX*s.speed,0)&&($=!0),x<=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(w)<=1.5*Math.abs(i.vy);A?($=!0,i.allowed=u):i.allowed=0}if(i.t=u,i.vx=y,i.vy=w,$)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(w,x){w.__proto__=x}||function(w,x){for(var $ in x)Object.prototype.hasOwnProperty.call(x,$)&&(w[$]=x[$])},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 w(){this.constructor=h}h.prototype=y===null?Object.create(y):(w.prototype=y.prototype,new w)}})(),g=this&&this.__values||function(u){var h=typeof Symbol=="function"&&Symbol.iterator,y=h&&u[h],w=0;if(y)return y.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&w>=u.length&&(u=void 0),{value:u&&u[w++],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,w){h!=null&&this.setText(h),y!=null&&w!=null&&this.setPosition(y,w),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,w,x;this.popups.sort(function(b,v){return v.priority-b.priority});var $=[];try{for(var A=g(this.popups),S=A.next();!S.done;S=A.next()){var E=S.value,R=!0;try{for(var L=(w=void 0,g($)),_=L.next();!_.done;_=L.next()){var D=_.value;if(this.doPopupsOverlap(D,E)){R=!1;break}}}catch(b){w={error:b}}finally{try{_&&!_.done&&(x=L.return)&&x.call(L)}finally{if(w)throw w.error}}R?$.push(E):E.hide()}}catch(b){h={error:b}}finally{try{S&&!S.done&&(y=A.return)&&y.call(A)}finally{if(h)throw h.error}}},u.prototype.doPopupsOverlap=function(h,y){var w=h.getElement().getBoundingClientRect(),x=y.getElement().getBoundingClientRect();return w.left<x.right&&w.right>x.left&&w.top<x.bottom&&w.bottom>x.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 w=u.call(this,y)||this;w.timeout=void 0,w.lastT=0,w.idleTime=350,w.lastEvent=void 0,w.onMouseOut=w.onMouseOut.bind(w),w.onMouseMove=w.onMouseMove.bind(w),w.waitForHover=w.waitForHover.bind(w),w.hide=w.hide.bind(w);var x=w.getElement();return x.style.whiteSpace="pre-wrap",x.style.pointerEvents="auto",x.addEventListener("mouseout",w.onMouseOut),x.tabIndex=-1,x.addEventListener("blur",(function(){x.contains(document.activeElement)||this.hide()}).bind(w)),x.addEventListener("wheel",f),w}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,w){this.lastEvent=y,this.lastT=Date.now();var x=w.$mouseHandler.isMousePressed;if(this.isOpen){var $=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains($.row,$.column)||x||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||x||(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 w=y.editor,x=y.getDocumentPosition(),$=w.session.getLine(x.row);if(x.column==$.length){var A=w.renderer.pixelToScreenCoordinates(y.clientX,y.clientY),S=w.session.documentToScreenPosition(x.row,x.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,w,x,$){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(w,y.session),this.range=c.fromPoints(w.start,w.end);var E=S.textToScreenCoordinates(w.start.row,w.start.column),R=S.scroller.getBoundingClientRect();E.pageX<R.left&&(E.pageX=R.left);var L=this.getElement();L.innerHTML="",L.appendChild(x),L.style.maxHeight="",L.style.display="block";var _=L.clientHeight,D=L.clientWidth,b=window.innerHeight-E.pageY-S.lineHeight,v=!0;E.pageY-_<0&&E.pageY<b&&(v=!1),L.style.maxHeight=(v?E.pageY:b)-A+"px",L.style.top=v?"":E.pageY+S.lineHeight+"px",L.style.bottom=v?window.innerHeight-E.pageY+"px":"",L.style.left=Math.min(E.pageX,window.innerWidth-D-A)+"px"}},h.prototype.addMarker=function(y,w){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=w,this.marker=w&&w.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 w in y)Object.prototype.hasOwnProperty.call(y,w)&&(h[w]=y[w])},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 E=u.getRegion(S);if(E!="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,w;function x(){var S=w.getDocumentPosition().row,E=i.session.getLength();if(S==E){var R=i.renderer.pixelToScreenCoordinates(0,w.y).row,L=w.$pos;if(R>i.session.documentToScreenRow(L.row,L.column))return $()}if(h.showTooltip(S),!!h.isOpen)if(i.on("mousewheel",$),a.$tooltipFollowsMouse)A(w);else{var _=w.getGutterRow(),D=u.$lines.get(_);if(D){var b=D.element.querySelector(".ace_gutter_annotation"),v=b.getBoundingClientRect(),C=h.getElement().style;C.left=v.right+"px",C.top=v.bottom+"px"}else A(w)}}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 E=S.domEvent.target||S.domEvent.srcElement;if(m.hasCssClass(E,"ace_fold-widget"))return $();h.isOpen&&a.$tooltipFollowsMouse&&A(S),w=S,!y&&(y=setTimeout(function(){y=null,w&&!a.isMousePressed?x():$()},50))}),c.addListener(i.renderer.$gutter,"mouseout",function(S){w=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,w=window.innerHeight||document.documentElement.clientHeight,x=this.getWidth(),$=this.getHeight();u+=15,h+=15,u+x>y&&(u-=u+x-y),h+$>w&&(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,w=y.$annotations[u],x;w?x={displayText:Array.from(w.displayText),type:Array.from(w.type)}:x={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},E,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]),(!E||S[_]<S[E])&&(E=_)}if(["error","security","warning"].includes(E)){var D="".concat(i.annotationsToSummaryString(A)," in folded code.");x.displayText.push(D),x.type.push(E+"_fold")}}if(x.displayText.length===0)return this.hide();for(var b={error:[],security:[],warning:[],info:[],hint:[]},v=y.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",R=0;R<x.displayText.length;R++){var C=m.createElement("span"),M=m.createElement("span");(h=M.classList).add.apply(h,["ace_".concat(x.type[R]),v]),M.setAttribute("aria-label","".concat(i.annotationLabels[x.type[R].replace("_fold","")].singular)),M.setAttribute("role","img"),M.appendChild(m.createTextNode(" ")),C.appendChild(M),C.appendChild(m.createTextNode(x.displayText[R])),C.appendChild(m.createElement("br")),b[x.type[R].replace("_fold","")].push(C)}var T=this.getElement();m.removeChildren(T),b.error.forEach(function(k){return T.appendChild(k)}),b.security.forEach(function(k){return T.appendChild(k)}),b.warning.forEach(function(k){return T.appendChild(k)}),b.info.forEach(function(k){return T.appendChild(k)}),b.hint.forEach(function(k){return T.appendChild(k)}),T.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,w=[],x=["error","security","warning","info","hint"];try{for(var $=g(x),A=$.next();!A.done;A=$.next()){var S=A.value;if(u[S].length){var E=u[S].length===1?i.annotationLabels[S].singular:i.annotationLabels[S].plural;w.push("".concat(u[S].length," ").concat(E))}}}catch(R){h={error:R}}finally{try{A&&!A.done&&(y=$.return)&&y.call($)}finally{if(h)throw h.error}}return w.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,w,x,$,A,S,E,R=0,L,_,D,b,v;this.onDragStart=function(F){if(this.cancelDrag||!y.draggable){var H=this;return setTimeout(function(){H.startSelect(),H.captureMouse(F)},0),F.preventDefault()}S=i.getSelectionRange();var z=F.dataTransfer;z.effectAllowed=i.getReadOnly()?"copy":"copyMove",i.container.appendChild(u),z.setDragImage&&z.setDragImage(u,0,0),setTimeout(function(){i.container.removeChild(u)}),z.clearData(),z.setData("Text",i.session.getTextRange()),_=!0,this.setState("drag")},this.onDragEnd=function(F){if(y.draggable=!1,_=!1,this.setState(null),!i.getReadOnly()){var H=F.dataTransfer.dropEffect;!L&&H=="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 x=F.clientX,$=F.clientY,w||k(),R++,F.dataTransfer.dropEffect=L=B(F),g.preventDefault(F)},this.onDragOver=function(F){if(!(i.getReadOnly()||!P(F.dataTransfer)))return x=F.clientX,$=F.clientY,w||(k(),R++),I!==null&&(I=null),F.dataTransfer.dropEffect=L=B(F),g.preventDefault(F)},this.onDragLeave=function(F){if(R--,R<=0&&w)return O(),L=null,g.preventDefault(F)},this.onDrop=function(F){if(E){var H=F.dataTransfer;if(_)switch(L){case"move":S.contains(E.row,E.column)?S={start:E,end:E}:S=i.moveText(S,E);break;case"copy":S=i.moveText(S,E,!0);break}else{var z=H.getData("Text");S={start:E,end:i.session.insert(E,z)},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,H){var z=Date.now(),W=!H||F.row!=H.row,U=!H||F.column!=H.column;if(!b||W||U)i.moveCursorToPosition(F),b=z,v={x,y:$};else{var K=s(v.x,v.y,x,$);K>r?b=null:z-b>=f&&(i.renderer.scrollCursorIntoView(),b=null)}}function M(F,H){var z=Date.now(),W=i.renderer.layerConfig.lineHeight,U=i.renderer.layerConfig.characterWidth,K=i.renderer.scroller.getBoundingClientRect(),Y={x:{left:x-K.left,right:K.right-x},y:{top:$-K.top,bottom:K.bottom-$}},G=Math.min(Y.x.left,Y.x.right),Q=Math.min(Y.y.top,Y.y.bottom),ue={row:F.row,column:F.column};G/U<=2&&(ue.column+=Y.x.left<Y.x.right?-3:2),Q/W<=1&&(ue.row+=Y.y.top<Y.y.bottom?-1:1);var Ee=F.row!=ue.row,Ce=F.column!=ue.column,he=!H||F.row!=H.row;Ee||Ce&&!he?D?z-D>=c&&i.renderer.scrollCursorIntoView(ue):D=z:D=null}function T(){var F=E;E=i.renderer.screenToTextCoordinates(x,$),C(E,F),M(E,F)}function k(){S=i.selection.toOrientedRange(),w=i.session.addMarker(S,"ace_selection",i.getSelectionStyle()),i.clearSelection(),i.isFocused()&&i.renderer.$cursorLayer.setBlinking(!1),clearInterval(A),T(),A=setInterval(T,20),R=0,g.addListener(document,"mousemove",N)}function O(){clearInterval(A),i.session.removeMarker(w),w=null,i.selection.fromOrientedRange(S),i.isFocused()&&!_&&i.$resetCursorStyle(),S=null,E=null,R=0,D=null,b=null,g.removeListener(document,"mousemove",N)}var I=null;function N(){I==null&&(I=setTimeout(function(){I!=null&&w&&O()},20))}function P(F){var H=F.types;return!H||Array.prototype.some.call(H,function(z){return z=="text/plain"||z=="Text"})}function B(F){var H=["copy","copymove","all","uninitialized"],z=["move","copymove","linkmove","all","uninitialized"],W=m.isMac?F.altKey:F.ctrlKey,U="uninitialized";try{U=F.dataTransfer.effectAllowed.toLowerCase()}catch{}var K="none";return W&&H.indexOf(U)>=0?K="copy":z.indexOf(U)>=0?K="move":H.indexOf(U)>=0&&(K="copy"),K}}(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 w=a.domEvent.target||a.domEvent.srcElement;if("unselectable"in w&&(w.unselectable="on"),i.getDragDelay()){if(m.isWebKit){this.cancelDrag=!0;var x=i.container;x.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,w,x=0,$=0,A=0,S,E;function R(){var C=window.navigator&&window.navigator.clipboard,M=!1,T=function(){var I=f.getCopyText(),N=f.session.getUndoManager().hasUndo();E.replaceChild(m.buildDom(M?["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"]),E.firstChild)},k=function(I){return f.commands.canExecute(I,f)},O=function(I){var N=I.target.getAttribute("action");if(N=="more"||!M)return M=!M,T();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)),E.firstChild.style.display="none",M=!1,N!="openCommandPalette"&&f.focus()};E=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(),O(I)},onclick:O},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],f.container)}function L(){if(!f.getOption("enableMobileMenu")){E&&_();return}E||R();var C=f.selection.cursor,M=f.renderer.textToScreenCoordinates(C.row,C.column),T=f.renderer.textToScreenCoordinates(0,0).pageX,k=f.renderer.scrollLeft,O=f.container.getBoundingClientRect();E.style.top=M.pageY-O.top-3+"px",M.pageX-O.left<O.width-70?(E.style.left="",E.style.right="10px"):(E.style.right="",E.style.left=T+k-O.left+"px"),E.style.display="",E.firstChild.style.display="none",f.on("input",_)}function _(C){E&&(E.style.display="none"),f.off("input",_)}function D(){u=null,clearTimeout(u);var C=f.selection.getRange(),M=C.contains(w.row,w.column);(C.isEmpty()||!M)&&(f.selection.moveToPosition(w),f.selection.selectWord()),r="wait",L()}function b(){u=null,clearTimeout(u),f.selection.moveToPosition(w);var C=x>=2?f.selection.getLineRange(w.row):f.session.getBracketRange(w);C&&!C.isEmpty()?f.selection.setRange(C):f.selection.selectWord(),r="wait"}g.addListener(c,"contextmenu",function(C){if(S){var M=f.textInput.getElement();M.focus()}},f),g.addListener(c,"touchstart",function(C){var M=C.touches;if(u||M.length>1){clearTimeout(u),u=null,a=-1,r="zoom";return}S=f.$mouseHandler.isMousePressed=!0;var T=f.renderer.layerConfig.lineHeight,k=f.renderer.layerConfig.lineHeight,O=C.timeStamp;i=O;var I=M[0],N=I.clientX,P=I.clientY;Math.abs(o-N)+Math.abs(s-P)>T&&(a=-1),o=C.clientX=N,s=C.clientY=P,$=A=0;var B=new d(C,f);if(w=B.getDocumentPosition(),O-a<500&&M.length==1&&!y)x++,C.preventDefault(),C.button=0,b();else{x=0;var F=f.selection.cursor,H=f.selection.isEmpty()?F:f.selection.anchor,z=f.renderer.$cursorLayer.getPixelPosition(F,!0),W=f.renderer.$cursorLayer.getPixelPosition(H,!0),U=f.renderer.scroller.getBoundingClientRect(),K=f.renderer.layerConfig.offset,Y=f.renderer.scrollLeft,G=function(Ee,Ce){return Ee=Ee/k,Ce=Ce/T-.75,Ee*Ee+Ce*Ce};if(C.clientX<U.left){r="zoom";return}var Q=G(C.clientX-U.left-z.left+Y,C.clientY-U.top-z.top+K),ue=G(C.clientX-U.left-W.left+Y,C.clientY-U.top-W.top+K);Q<3.5&&ue<3.5&&(r=Q>ue?"cursor":"anchor"),ue<3.5?r="anchor":Q<3.5?r="cursor":r="scroll",u=setTimeout(D,450)}a=O},f),g.addListener(c,"touchend",function(C){S=f.$mouseHandler.isMousePressed=!1,h&&clearInterval(h),r=="zoom"?(r="",y=0):u?(f.selection.moveToPosition(w),y=0,L()):r=="scroll"?(v(),_()):L(),clearTimeout(u),u=null},f),g.addListener(c,"touchmove",function(C){u&&(clearTimeout(u),u=null);var M=C.touches;if(!(M.length>1||r=="zoom")){var T=M[0],k=o-T.clientX,O=s-T.clientY;if(r=="wait")if(k*k+O*O>4)r="cursor";else return C.preventDefault();o=T.clientX,s=T.clientY,C.clientX=T.clientX,C.clientY=T.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=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 B=new d(C,f),F=B.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()})},w=u.renderer.getMouseEventTarget();d.addListener(w,"click",this.onMouseEvent.bind(this,"click"),u),d.addListener(w,"mousemove",this.onMouseMove.bind(this,"mousemove"),u),d.addMultiMouseDownListener([w,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 x=u.renderer.$gutter;d.addListener(x,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),u),d.addListener(x,"click",this.onMouseEvent.bind(this,"gutterclick"),u),d.addListener(x,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),u),d.addListener(x,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),u),d.addListener(w,"mousedown",y,u),d.addListener(x,"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(),E=u.renderer;!S.isEmpty()&&S.insideStart(A.row,A.column)?E.setCursorStyle("default"):E.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,w=this.editor.renderer;w.$isMousePressed=!0;var x=this,$=function(L){if(L){if(g.isWebKit&&!L.which&&x.releaseMouse)return x.releaseMouse();x.x=L.clientX,x.y=L.clientY,h&&h(L),x.mouseEvent=new f(L,x.editor),x.$mouseMoved=!0}},A=function(L){y.off("beforeEndOperation",E),clearInterval(R),y.session&&S(),x[x.state+"End"]&&x[x.state+"End"](L),x.state="",x.isMousePressed=w.$isMousePressed=!1,w.$keepTextAreaAtCursor&&w.$moveTextAreaToCursor(),x.$onCaptureMouseMove=x.releaseMouse=null,L&&x.onMouseEvent("mouseup",L),y.endOperation()},S=function(){x[x.state]&&x[x.state](),x.$mouseMoved=!1};if(g.isOldIE&&u.domEvent.type=="dblclick")return setTimeout(function(){A(u)});var E=function(L){x.releaseMouse&&y.curOp.command.name&&y.curOp.selectionChanged&&(x[x.state+"End"]&&x[x.state+"End"](),x.state="",x.releaseMouse())};y.on("beforeEndOperation",E),y.startOperation({command:{name:"mouse"}}),x.$onCaptureMouseMove=$,x.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,w=4,x=5,$=6,A=7,S=8,E=9,R=10,L=11,_=12,D=13,b=14,v=15,C=16,M=17,T=18,k=[T,T,T,T,T,T,T,T,T,$,x,$,S,x,T,T,T,T,T,T,T,T,T,T,T,T,T,T,x,x,x,$,S,w,w,L,L,L,w,w,w,w,w,R,E,R,E,E,h,h,h,h,h,h,h,h,h,h,E,w,w,w,w,w,w,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,w,w,w,w,w,w,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,w,w,w,w,T,T,T,T,T,T,x,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,E,w,L,L,L,L,w,w,w,w,i,w,w,T,w,w,L,L,h,h,w,i,w,w,w,h,i,w,w,w,w,w],O=[S,S,S,S,S,S,S,S,S,S,S,T,T,T,i,u,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,S,x,D,b,v,C,M,E,L,L,L,L,L,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,E,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,S];function I(F,H,z,W){var U=d?o:r,K=null,Y=null,G=null,Q=0,ue=null,Ee=null,Ce=-1,he=null,ke=null,ut=[];if(!W)for(he=0,W=[];he<z;he++)W[he]=B(F[he]);for(g=d,m=!1,c=!1,f=!1,ke=0;ke<z;ke++){if(K=Q,ut[ke]=Y=P(F,W,ut,ke),Q=U[K][Y],ue=Q&240,Q&=15,H[ke]=G=U[Q][5],ue>0)if(ue==16){for(he=Ce;he<ke;he++)H[he]=1;Ce=-1}else Ce=-1;if(Ee=U[Q][6],Ee)Ce==-1&&(Ce=ke);else if(Ce>-1){for(he=Ce;he<ke;he++)H[he]=G;Ce=-1}W[ke]==x&&(H[ke]=0),g|=G}if(f){for(he=0;he<z;he++)if(W[he]==$){H[he]=d;for(var ht=he-1;ht>=0&&W[ht]==S;ht--)H[ht]=d}}}function N(F,H,z){if(!(g<F)){if(F==1&&d==a&&!c){z.reverse();return}for(var W=z.length,U=0,K,Y,G,Q;U<W;){if(H[U]>=F){for(K=U+1;K<W&&H[K]>=F;)K++;for(Y=U,G=K-1;Y<G;Y++,G--)Q=z[Y],z[Y]=z[G],z[G]=Q;U=K}U++}}}function P(F,H,z,W){var U=H[W],K,Y,G,Q;switch(U){case i:case u:m=!1;case w:case y:return U;case h:return m?y:h;case A:return m=!0,u;case S:return w;case E:return W<1||W+1>=H.length||(K=z[W-1])!=h&&K!=y||(Y=H[W+1])!=h&&Y!=y?w:(m&&(Y=y),Y==K?Y:w);case R:return K=W>0?z[W-1]:x,K==h&&W+1<H.length&&H[W+1]==h?h:w;case L:if(W>0&&z[W-1]==h)return h;if(m)return w;for(Q=W+1,G=H.length;Q<G&&H[Q]==L;)Q++;return Q<G&&H[Q]==h?h:w;case _:for(G=H.length,Q=W+1;Q<G&&H[Q]==_;)Q++;if(Q<G){var ue=F[W],Ee=ue>=1425&&ue<=2303||ue==64286;if(K=H[Q],Ee&&(K==u||K==A))return u}return W<1||(K=H[W-1])==x?w:z[W-1];case x:return m=!1,c=!0,d;case $:return f=!0,w;case D:case b:case C:case M:case v:m=!1;case T:return w}}function B(F){var H=F.charCodeAt(0),z=H>>8;return z==0?H>191?i:k[H]:z==5?/[\u0591-\u05f4]/.test(F)?u:i:z==6?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(F)?_:/[\u0660-\u0669\u066b-\u066c]/.test(F)?y:H==1642?L:/[\u06f0-\u06f9]/.test(F)?h:A:z==32&&H<=8287?O[H&255]:z==254&&H>=65136?A:w}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,H,z){if(F.length<2)return{};var W=F.split(""),U=new Array(W.length),K=new Array(W.length),Y=[];d=z?a:s,I(W,Y,W.length,H);for(var G=0;G<U.length;U[G]=G,G++);N(2,Y,U),N(1,Y,U);for(var G=0;G<U.length-1;G++)H[G]===y?Y[G]=n.AN:Y[G]===u&&(H[G]>A&&H[G]<D||H[G]===w||H[G]===T)?Y[G]=n.ON_R:G>0&&W[G-1]==="ل"&&/\u0622|\u0623|\u0625|\u0627/.test(W[G])&&(Y[G-1]=Y[G]=n.R_H,G++);W[W.length-1]===n.DOT&&(Y[W.length-1]=n.B),W[0]===""&&(Y[0]=n.RLE);for(var G=0;G<U.length;G++)K[G]=Y[U[G]];return{logicalFromVisual:U,bidiLevels:K}},n.hasBidiCharacters=function(F,H){for(var z=!1,W=0;W<F.length;W++)H[W]=B(F.charAt(W)),!z&&(H[W]==u||H[W]==A||H[W]==y)&&(z=!0);return z},n.getVisualFromLogicalIdx=function(F,H){for(var z=0;z<H.logicalFromVisual.length;z++)if(H.logicalFromVisual[z]==F)return z;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(w,x){return w===" "||u.isFullWidth(w.charCodeAt(0))?(y=w===" "?u.getScreenTabSize(x+h):2,h+=y-1,g.stringRepeat(d.DOT,y)):w}),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,w=Math.max(r,o)-this.wrapIndent,x=!1,$=!1,A=0;this.wrapIndent&&(h+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var S,E=0;E<a.length;E++)S=s.logicalFromVisual[E],i=a[E],x=S>=y&&S<w,x&&!$?A=h:!x&&$&&u.push({left:A,width:h-A}),h+=this.charWidths[i],$=x;if(x&&E===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 w=o[y];if(w.defaultToken&&(i.defaultToken=w.defaultToken),w.caseInsensitive&&u.indexOf("i")===-1&&(u+="i"),w.unicode&&u.indexOf("u")===-1&&(u+="u"),w.regex!=null){w.regex instanceof RegExp&&(w.regex=w.regex.toString().slice(1,-1));var x=w.regex,$=new RegExp("(?:("+x+")|(.))").exec("a").length-2;Array.isArray(w.token)?w.token.length==1||$==1?w.token=w.token[0]:$-1!=w.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:w,groupCount:$-1}),w.token=w.token[0]):(w.tokenArray=w.token,w.token=null,w.onMatch=this.$arrayTokens):typeof w.token=="function"&&!w.onMatch&&($>1?w.onMatch=this.$applyToken:w.onMatch=w.token),$>1&&(/\\\d/.test(w.regex)?x=w.regex.replace(/\\([0-9]+)/g,function(A,S){return"\\"+(parseInt(S,10)+a+1)}):($=1,x=this.removeCapturingGroups(w.regex)),!w.splitRegex&&typeof w.token!="string"&&h.push(w)),i[a]=y,a+=$,s.push(x),w.onMatch||(w.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,w,x){return s?s=w!="]":w?s=!0:y?(o==a.stack&&(a.end=x+1,a.stack=-1),o--):h&&(o++,h.length!=1&&(a.stack=o,a.start=x)),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=[],w=0,x=0,$={type:null,value:""};h=u.exec(f);){var A=i.defaultToken,S=null,E=h[0],R=u.lastIndex;if(R-E.length>w){var L=f.substring(w,R-E.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(E,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],w=R,u=this.regExps[s],u.lastIndex=R),S.consumeLineEnd&&(w=R);break}if(E){if(typeof A=="string")(!S||S.merge!==!1)&&$.type===A?$.value+=E:($.type&&y.push($),$={type:A,value:E});else if(A){$.type&&y.push($),$={type:null,value:""};for(var _=0;_<A.length;_++)y.push(A[_])}}if(w==f.length)break;if(w=R,x++>g){for(x>2*f.length&&this.reportError("infinite loop with in ace tokenizer",{startState:r,line:f});w<f.length;)$.type&&y.push($),$={value:f.substring(w,w+=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 w=u.stateName;w||(w=u.token,typeof w!="string"&&(w=w[0]||""),r[w]&&(w+=f++)),r[w]=y,u.next=w,o(w)}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 x in u.rules)r[x]?r[x].push&&r[x].push.apply(r[x],u.rules[x]):r[x]=u.rules[x];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 w=h[y];this.$keywordList.push(w),o&&(w=w.toLowerCase()),a[w]=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 w=-1;if(y.multiSelect&&(w=y.selection.index,s.rangeCount!=y.multiSelect.rangeCount&&(s={rangeCount:y.multiSelect.rangeCount})),s[w])return o=s[w];o=s[w]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},u=function(y,w,x,$){var A=y.end.row-y.start.row;return{text:x+w+$,selection:[0,y.start.column+1,A,y.end.column+(A?0:1)]}},h;h=function(y){y=y||{},this.add("braces","insertion",function(w,x,$,A,S){var E=$.getCursorPosition(),R=A.doc.getLine(E.row);if(S=="{"){i($);var L=$.getSelectionRange(),_=A.doc.getTextRange(L),D=A.getTokenAt(E.row,E.column);if(_!==""&&_!=="{"&&$.getWrapBehavioursEnabled())return u(L,_,"{","}");if(D&&/(?:string)\.quasi|\.xml/.test(D.type)){var b=[/tag\-(?:open|name)/,/attribute\-name/];return b.some(function(I){return I.test(D.type)})||/(string)\.quasi/.test(D.type)&&D.value[E.column-D.start-1]!=="$"?void 0:(h.recordAutoInsert($,A,"}"),{text:"{}",selection:[1,1]})}else if(h.isSaneInsertion($,A))return/[\]\}\)]/.test(R[E.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(E.column,E.column+1);if(v=="}"){var C=A.$findOpeningBracket("}",{column:E.column+1,row:E.row});if(C!==null&&h.isAutoInsertedClosing(E,R,S))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(S==`
|
|
1343
1343
|
`||S==`\r
|
|
1344
|
-
`){i($);var
|
|
1344
|
+
`){i($);var M="";h.isMaybeInsertedClosing(E,R)&&(M=c.stringRepeat("}",o.maybeInsertedBrackets),h.clearMaybeInsertedClosing());var v=R.substring(E.column,E.column+1);if(v==="}"){var T=A.findMatchingBracket({row:E.row,column:E.column+1},"}");if(!T)return null;var k=this.$getIndent(A.getLine(T.row))}else if(M)var k=this.$getIndent(R);else{h.clearMaybeInsertedClosing();return}var O=k+A.getTabString();return{text:`
|
|
1345
1345
|
`+O+`
|
|
1346
|
-
`+k+
|
|
1346
|
+
`+k+M,selection:[1,O.length,1,O.length]}}else h.clearMaybeInsertedClosing()}),this.add("braces","deletion",function(w,x,$,A,S){var E=A.doc.getTextRange(S);if(!S.isMultiLine()&&E=="{"){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(w,x,$,A,S){if(S=="("){i($);var E=$.getSelectionRange(),R=A.doc.getTextRange(E);if(R!==""&&$.getWrapBehavioursEnabled())return u(E,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),D=_.substring(L.column,L.column+1);if(D==")"){var b=A.$findOpeningBracket(")",{column:L.column+1,row:L.row});if(b!==null&&h.isAutoInsertedClosing(L,_,S))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(w,x,$,A,S){var E=A.doc.getTextRange(S);if(!S.isMultiLine()&&E=="("){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(w,x,$,A,S){if(S=="["){i($);var E=$.getSelectionRange(),R=A.doc.getTextRange(E);if(R!==""&&$.getWrapBehavioursEnabled())return u(E,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),D=_.substring(L.column,L.column+1);if(D=="]"){var b=A.$findOpeningBracket("]",{column:L.column+1,row:L.row});if(b!==null&&h.isAutoInsertedClosing(L,_,S))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(w,x,$,A,S){var E=A.doc.getTextRange(S);if(!S.isMultiLine()&&E=="["){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(w,x,$,A,S){var E=A.$mode.$quotes||a;if(S.length==1&&E[S]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(S)!=-1)return;i($);var R=S,L=$.getSelectionRange(),_=A.doc.getTextRange(L);if(_!==""&&(_.length!=1||!E[_])&&$.getWrapBehavioursEnabled())return u(L,_,R,R);if(!_){var D=$.getCursorPosition(),b=A.doc.getLine(D.row),v=b.substring(D.column-1,D.column),C=b.substring(D.column,D.column+1),M=A.getTokenAt(D.row,D.column),T=A.getTokenAt(D.row,D.column+1);if(v=="\\"&&M&&/escape/.test(M.type))return null;var k=M&&/string|escape/.test(M.type),O=!T||/string|escape/.test(T.type),I;if(C==R)I=k!==O,I&&/string\.end/.test(T.type)&&(I=!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 B=N.test(C),F=A.$mode.$pairQuotesAfter,H=F&&F[R]&&F[R].test(v);if(!H&&P||B||C&&!/[\s;,.})\]\\]/.test(C))return null;var z=b[D.column-2];if(v==R&&(z==R||N.test(z)))return null;I=!0}return{text:I?R+R:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(w,x,$,A,S){var E=A.$mode.$quotes||a,R=A.doc.getTextRange(S);if(!S.isMultiLine()&&E.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(w,x,$,A,S){if(w==="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),D=0,w=0;w<_.length;w++){D+=_[w].value.length;var v=_[w];if(D>=M.column){if(D===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-(D-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=[],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)+")"),D=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(D))&&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 O=1/0;k(function(I,N){var P=I.search(/\S/);P!==-1?(P<A&&(A=P),$&&!C(I,N)&&($=!1)):O>I.length&&(O=I.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 D=T.getCurrentTokenRow(),w=T.getCurrentTokenColumn()+_;R=new s(D,w,D,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 D=T.getCurrentTokenRow(),w=T.getCurrentTokenColumn()+_;L=new s(D,w,D,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]:`
|
|
1348
|
+
`)&&$.selection.isEmpty()){var E=$.getCursorPosition();if(E.column===0)return;for(var R=A.doc.getLine(E.row),L=A.doc.getLine(E.row+1),_=A.getTokens(E.row),D=0,b=0;b<_.length;b++){D+=_[b].value.length;var v=_[b];if(D>=E.column){if(D===E.column){if(!/\.doc/.test(v.type))return;if(/\*\//.test(v.value)){var C=_[b+1];if(!C||!/\.doc/.test(C.type))return}}var M=E.column-(D-v.value.length),T=v.value.indexOf("*/"),k=v.value.indexOf("/**",T>-1?T+2:0);if(k!==-1&&M>k&&M<k+3||T!==-1&&k!==-1&&M>=T&&M<=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,E.column)))return{text:S+O+" * "+S+" "+O+"*/",selection:[1,4+O.length,1,4+O.length]}}})},h.isSaneInsertion=function(y,w){var x=y.getCursorPosition(),$=new m(w,x.row,x.column);if(!this.$matchTokenType($.getCurrentToken()||"text",f)){if(/[)}\]]/.test(y.session.getLine(x.row)[x.column]))return!0;var A=new m(w,x.row,x.column+1);if(!this.$matchTokenType(A.getCurrentToken()||"text",f))return!1}return $.stepForward(),$.getCurrentTokenRow()!==x.row||this.$matchTokenType($.getCurrentToken()||"text",r)},h.$matchTokenType=function(y,w){return w.indexOf(y.type||y)>-1},h.recordAutoInsert=function(y,w,x){var $=y.getCursorPosition(),A=w.doc.getLine($.row);this.isAutoInsertedClosing($,A,o.autoInsertedLineEnd[0])||(o.autoInsertedBrackets=0),o.autoInsertedRow=$.row,o.autoInsertedLineEnd=x+A.substr($.column),o.autoInsertedBrackets++},h.recordMaybeInsert=function(y,w,x){var $=y.getCursorPosition(),A=w.doc.getLine($.row);this.isMaybeInsertedClosing($,A)||(o.maybeInsertedBrackets=0),o.maybeInsertedRow=$.row,o.maybeInsertedLineStart=A.substr(0,$.column)+x,o.maybeInsertedLineEnd=A.substr($.column),o.maybeInsertedBrackets++},h.isAutoInsertedClosing=function(y,w,x){return o.autoInsertedBrackets>0&&y.row===o.autoInsertedRow&&x===o.autoInsertedLineEnd[0]&&w.substr(y.column)===o.autoInsertedLineEnd},h.isMaybeInsertedClosing=function(y,w){return o.maybeInsertedBrackets>0&&y.row===o.maybeInsertedRow&&w.substr(y.column)===o.maybeInsertedLineEnd&&w.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 w=u.doc,x=!0,$=!0,A=1/0,S=u.getTabSize(),E=!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*)(?:"+_+") ?"),E=u.getUseSoftTabs();var v=function(B,F){var H=B.match(_);if(H){var z=H[1].length,W=H[0].length;!T(B,z,W)&&H[0][W-1]==" "&&W--,w.removeInLine(F,z,W)}},M=R+" ",b=function(B,F){(!x||/\S/.test(B))&&(T(B,A,A)?w.insertInLine({row:F,column:A},M):w.insertInLine({row:F,column:A},R))},C=function(B,F){return _.test(B)},T=function(B,F,H){for(var z=0;F--&&B.charAt(F)==" ";)z++;if(z%S!=0)return!1;for(var z=0;B.charAt(H++)==" ";)z++;return S>2?z%S!=S-1:z%S==0}}else{if(!this.blockComment)return!1;var R=this.blockComment.start,L=this.blockComment.end,_=new RegExp("^(\\s*)(?:"+r.escapeRegExp(R)+")"),D=new RegExp("(?:"+r.escapeRegExp(L)+")\\s*$"),b=function(I,N){C(I,N)||(!x||/\S/.test(I))&&(w.insertInLine({row:N,column:I.length},L),w.insertInLine({row:N,column:A},R))},v=function(I,N){var P;(P=I.match(D))&&w.removeInLine(N,I.length-P[0].length,I.length),(P=I.match(_))&&w.removeInLine(N,P[1].length,P[0].length)},C=function(I,N){if(_.test(I))return!0;for(var P=u.getTokens(N),B=0;B<P.length;B++)if(P[B].type==="comment")return!0}}function k(I){for(var N=h;N<=y;N++)I(w.getLine(N),N)}var O=1/0;k(function(I,N){var P=I.search(/\S/);P!==-1?(P<A&&(A=P),$&&!C(I,N)&&($=!1)):O>I.length&&(O=I.length)}),A==1/0&&(A=O,x=!1,$=!1),E&&A%S!=0&&(A=Math.floor(A/S)*S),k($?v:b)},this.toggleBlockComment=function(i,u,h,y){var w=this.blockComment;if(w){!w.start&&w[0]&&(w=w[0]);var x=new o(u,y.row,y.column),$=x.getCurrentToken();u.selection;var A=u.selection.toOrientedRange(),S,E;if($&&/comment/.test($.type)){for(var R,L;$&&/comment/.test($.type);){var _=$.value.indexOf(w.start);if(_!=-1){var D=x.getCurrentTokenRow(),b=x.getCurrentTokenColumn()+_;R=new s(D,b,D,b+w.start.length);break}$=x.stepBackward()}for(var x=new o(u,y.row,y.column),$=x.getCurrentToken();$&&/comment/.test($.type);){var _=$.value.indexOf(w.end);if(_!=-1){var D=x.getCurrentTokenRow(),b=x.getCurrentTokenColumn()+_;L=new s(D,b,D,b+w.end.length);break}$=x.stepForward()}L&&u.remove(L),R&&(u.remove(R),S=R.start.row,E=-w.start.length)}else E=w.start.length,S=h.start.row,u.insert(h.end,w.end),u.insert(h.start,w.start);A.start.row==S&&(A.start.column+=E),A.end.row==S&&(A.end.column+=E),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,w=d.$modes[y];w||(d.$modes[y]=w=new h),d.$modes[u]||(d.$modes[u]=w),this.$embeds.push(u),this.$modes[u]=w}for(var x=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],$=function(S){(function(E){var R=x[S],L=E[R];E[x[S]]=function(){return this.$delegator(R,arguments,L)}})(A)},A=this,u=0;u<x.length;u++)$(u)},this.$delegator=function(i,u,h){var y=u[0]||"start";if(typeof y!="string"){if(Array.isArray(y[2])){var w=y[2][y[2].length-1],x=this.$modes[w];if(x)return x[i].apply(x,[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 x=this.$modes[this.$embeds[$]];return x[i].apply(x,u)}}var S=h.apply(this,u);return h?S:void 0},this.transformAction=function(i,u,h,y,w){if(this.$behaviour){var x=this.$behaviour.getBehaviours();for(var $ in x)if(x[$][u]){var A=x[$][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 w=u[y],x=0,$=w.length;x<$;x++)if(typeof w[x].token=="string")/keyword|support|storage/.test(w[x].token)&&h.push(w[x].regex);else if(typeof w[x].token=="object"){for(var A=0,S=w[x].token.length;A<S;A++)if(/keyword|support|storage/.test(w[x].token[A])){var y=w[x].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 w=this.$keywordList||this.$createKeywordList();return w.map(function(x){return{name:x,value:x,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 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,D=R.length;D--;){var w=R[D][0];if(w.id<M&&!L&&(L=D+1),w.id<=S){_=D+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(D){D[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,w=u?a+1:a,x=u?0:this.getLine(w).length,$=new c(h,y,w,x),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,w=0,x=0;w<u;w=x){x+=a-1;var $=i.slice(w,x);$.push(""),this.applyDelta({start:this.pos(h+w,y),end:this.pos(h+x,y=0),action:s.action,lines:$},!0)}s.lines=i.slice(w),s.start.row=h+w,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),w=a||0;w<y;++w)h+=i[w].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(),w=0;for(o.running=!1;a<y;){o.$tokenizeRow(a),i=a;do a++;while(o.lines[a]);if(w++,w%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 w=y.length;w--;){var x=y[w].toScreenRange(o),$=x.toString();u[$]||(u[$]=!0,r.drawSingleLineMarker(f,x,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,E,R){if(!this.$fromUndo&&S!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),E===!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,E){this.selections.push({value:S,rev:E||this.$rev})},A.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},A.prototype.markIgnored=function(S,E){E==null&&(E=this.$rev+1);for(var R=this.$undoStack,L=R.length;L--;){var _=R[L][0];if(_.id<=S)break;_.id<E&&(_.ignore=!0)}this.lastDeltas=null},A.prototype.getSelection=function(S,E){for(var R=this.selections,L=R.length;L--;){var _=R[L];if(_.rev<S)return E&&(_=R[L+1]),_}},A.prototype.getRevision=function(){return this.$rev},A.prototype.getDeltas=function(S,E){E==null&&(E=this.$rev+1);for(var R=this.$undoStack,L=null,_=0,D=R.length;D--;){var b=R[D][0];if(b.id<E&&!L&&(L=D+1),b.id<=S){_=D+1;break}}return R.slice(_,L)},A.prototype.getChangedRanges=function(S,E){E==null&&(E=this.$rev+1)},A.prototype.getChangedLines=function(S,E){E==null&&(E=this.$rev+1)},A.prototype.undo=function(S,E){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,E),this.$redoStack.push(L),this.$syncRev()),this.$fromUndo=!1,_}},A.prototype.redo=function(S,E){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(D){D[0].id=++this.$maxRev},this)}var L=this.$redoStack.pop(),_=null;return L&&(_=S.redoChanges(L,E),this.$undoStack.push(L),this.$syncRev()),this.$fromUndo=!1,_},A.prototype.$syncRev=function(){var S=this.$undoStack,E=S[S.length-1],R=E&&E[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
|
|
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 E=S;E--;){var R=A[E];if(R&&!R[0].ignore){for(;E<S-1;){var L=i(A[E],A[E+1]);A[E]=L[0],A[E+1]=L[1],E++}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
|
|
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
|
|
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 I=C;I<E.length&&E.charAt(I).match(k);)I++;return new s(v,O,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,O=this.$foldData[k],I=O?O.start.row:1/0,N=C.length,P=0;P<N;P++){if(P>I){if(P=O.end.row+1,P>=N)break;O=this.$foldData[k++],I=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 I=v[O];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),O=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&&(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)),I&&O.start.row>=v.end.row&&(O.start.row+=I,O.end.row+=I)}if(O.end=this.insert(O.start,x),k.length){var P=v.start,z=O.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 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 I=0;I<x&&O.charAt(I)==" ";++I);I<x&&O.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 O=new s(v,0,C,Number.MAX_VALUE),I=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),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,O=x.row,I=k.row,N=I-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)}I=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(I,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,I):this.$updateRowLengthCache(O,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,O=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,O,x),P=N.end.row+1):(I=this.$getDisplayTokens(E[P]),k[P]=this.$computeWrapSplits(I,O,x),P++)},w.prototype.$computeWrapSplits=function(v,C,E){if(v.length==0)return[];var x=[],k=v.length,O=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-O,V=O;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),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 I=1;I<x;I++)E.push(_)}else O==32?E.push(R):O>39&&O<48||O>57&&O<64?E.push(M):O>=4352&&D(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&&D(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,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,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>=I&&(O=I-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 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,O=0,x=0,C=this.$foldData[x++],I=C?C.start.row:1/0;O<k;){var N=this.$wrapData[O];v+=N?N.length+1:1,O++,O>I&&(O=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,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=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=D,d.implement(b.prototype,f);var T=1,$=2,A=3,S=4,M=9,R=10,L=11,_=12;function D(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 D=d.getMatchOffsets(i[_],h),A=0;A<D.length;A++){var w=D[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 E=A.action=="insert",R=S.action=="insert";if(E&&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(E&&!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(!E&&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(!E&&!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 E=A.length;E--;)for(var R=0;R<S.length;R++)if(!a(A[E],S[R])){for(;E<A.length;){for(;R--;)a(S[R],A[E]);R=S.length,E++}return[A,S]}return A.selectionBefore=S.selectionBefore=A.selectionAfter=S.selectionAfter=null,[S,A]}function u(A,S){var E=A.action=="insert",R=S.action=="insert";if(E&&R)c(A.start,S.start)<0?h(S,A,1):h(A,S,1);else if(E&&!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(!E&&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(!E&&!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=w(A,S.start)),c(A.end,S.end)>0&&(_=w(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,E){y(A.start,S.start,S.end,E),y(A.end,S.start,S.end,E)}function y(A,S,E,R){A.row==(R==1?S:E).row&&(A.column+=R*(E.column-S.column)),A.row+=R*(E.row-S.row)}function w(A,S){var E=A.lines,R=A.end;A.end=f(S);var L=A.end.row-A.start.row,_=E.splice(L,E.length),D=L?S.column:S.column-A.start.column;E.push(_[0].substring(0,D)),_[0]=_[0].substr(D);var b={start:f(S),end:R,lines:_,action:A.action};return b}function x(A,S){S=r(S);for(var E=A.length;E--;){for(var R=A[E],L=0;L<R.length;L++){var _=R[L],D=u(_,S);S=D[0],D.length!=2&&(D[2]?(R.splice(L+1,1,D[1],D[2]),L++):D[1]||(R.splice(L,1),L--))}R.length||A.splice(E,1)}return A}function $(A,S){for(var E=0;E<S.length;E++)for(var R=S[E],L=0;L<R.length;L++)x(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 w=a-s,x=-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+=x,y.start.row+=w)),y.end.row==s&&y.end.column>=r.column){if(y.end.column==r.column&&this.$bias<0)continue;y.end.column==r.column&&x>0&&u<h-1&&y.end.column>y.start.column&&y.end.column==i[u+1].start.column&&(y.end.column-=x),y.end.column+=x,y.end.row+=w}}else for(var w=s-a,x=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?(w||y.end.column>r.column)&&(y.end.column=r.column,y.end.row=r.row):(y.end.column+=x,y.end.row+=w):y.end.row>a&&(y.end.row+=w),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?(w||y.start.column>r.column)&&(y.start.column=r.column,y.start.row=r.row):(y.start.column+=x,y.start.row+=w):y.start.row>a&&(y.start.row+=w)}if(w!=0&&u<h)for(;u<h;u++){var y=i[u];y.start.row+=w,y.end.row+=w}},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 x=i.start.row,$=i.start.column,u=0,h=-1;u<this.subFolds.length&&(h=this.subFolds[u].range.compare(x,$),h==1);u++);var y=this.subFolds[u],w=0;if(h==0){if(y.range.containsRange(i))return y.addSubFold(i);w=1}for(var x=i.range.end.row,$=i.range.end.column,A=u,h=-1;A<this.subFolds.length&&(h=this.subFolds[A].range.compare(x,$),h==1);A++);h==0&&A++;for(var S=this.subFolds.splice(u,A-u,i),E=h==0?S.length-1:S.length,R=w;R<E;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 w=i[h].folds,x=0;x<w.length;x++){var $=w[x];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,w=0;w<i.folds.length;w++){y=i.folds[w];var x=y.range.compareEnd(o,s);if(x==-1){h=this.getLine(y.start.row).substring(u.end.column,y.start.column);break}else if(x===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,w=h.start.row;if(y>=s){w<s&&(w>=o?i-=s-w:i=0);break}else y>=o&&(w>=o?i-=y-w: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,w=u.end.row,x=u.end.column,$=this.getFoldAt(h,y,1),A=this.getFoldAt(w,x,-1);if($&&A==$)return $.addSubFold(u);$&&!$.range.isStart(h,y)&&this.removeFold($),A&&!A.range.isEnd(w,x)&&this.removeFold(A);var S=this.getFoldsInRange(u.range);S.length>0&&(this.removeFolds(S),u.collapseChildren||S.forEach(function(_){u.addSubFold(_)}));for(var E=0;E<a.length;E++){var R=a[E];if(w==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[E+1];if(L&&L.start.row==w){R.merge(L);break}}break}else if(w<=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(w,x,$,A){if(!(x<i)){if(x==i){if($<u)return;A=Math.max(u,A)}w!=null?y+=w:y+=h.getLine(x).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 w="...";if(!a.isMultiLine()){if(w=this.getTextRange(a),w.length<4)return;w=w.trim().substring(0,2)+".."}this.addFold(w,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),w=new d;if(a!=1){do u=i.stepBackward();while(u&&y.test(u.type));u=i.stepForward()}w.start.row=i.getCurrentTokenRow(),w.start.column=i.getCurrentTokenColumn()+u.value.length,i=new c(this,o,s);var x=this.getState(i.$row);if(a!=-1){var $=-1;do if(u=i.stepForward(),$==-1){var A=this.getState(i.$row);x.toString()!==A.toString()&&($=i.$row)}else if(i.$row>$)break;while(u&&y.test(u.type));u=i.stepBackward()}else u=i.getCurrentToken();return w.end.row=i.getCurrentTokenRow(),w.end.column=i.getCurrentTokenColumn(),w}},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 w=this.getParentFoldRangeData(o);if(w.range)var x=w.range.start.row+1,$=w.range.end.row;this.foldAll(x,$,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 w=h.charAt(u);if(w==o){if(s-=1,s==0)return{row:a.getCurrentTokenRow(),column:u+a.getCurrentTokenColumn()}}else w==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 w=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+2);f=c.stepForward();var x=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 w=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+2),x=w,$=x,y=new g(u.end.row,u.end.column,u.end.row,u.end.column+1)}}while(f&&a>=0);if(i&&y&&w&&$&&u&&x)return{openTag:new g(i.start.row,i.start.column,y.end.row,y.end.column),closeTag:new g(w.start.row,w.start.column,$.end.row,$.end.column),openTagName:u,closeTagName:x}},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 w=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 x=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,E=r;E;){if(E.type.indexOf("tag-name")!==-1&&E.value===o){s--;break}else if(E.value==="<")break;E=c.stepBackward(),S++}for(var R=0;R<S;R++)c.stepForward()}}while(r&&s<=0);if($&&A&&h&&w&&x&&y)return{openTag:new g($.start.row,$.start.column,A.end.row,A.end.column),closeTag:new g(h.start.row,h.start.column,w.end.row,w.end.column),openTagName:x,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,w=(function(){function b(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"+ ++b.$uid,this.$foldData.toString=function(){return this.join(`
|
|
1360
|
+
`)},this.bgTokenizer=new u(new o().getTokenizer(),this);var M=this;this.bgTokenizer.on("update",function(T){M._signal("tokenizerUpdate",T)}),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 b.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))},b.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)},b.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)}},b.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()},b.prototype.getDocument=function(){return this.doc},Object.defineProperty(b.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}),b.prototype.$resetRowCache=function(v){if(!v){this.$docRowCache=[],this.$screenRowCache=[];return}var C=this.$docRowCache.length,M=this.$getRowCacheIndex(this.$docRowCache,v)+1;C>M&&(this.$docRowCache.splice(M,C),this.$screenRowCache.splice(M,C))},b.prototype.$getRowCacheIndex=function(v,C){for(var M=0,T=v.length-1;M<=T;){var k=M+T>>1,O=v[k];if(C>O)M=k+1;else if(C<O)T=k-1;else return k}return M-1},b.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0)},b.prototype.onChangeFold=function(v){var C=v.data;this.$resetRowCache(C.start.row)},b.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)},b.prototype.onSelectionChange=function(){this._signal("changeSelection")},b.prototype.setValue=function(v){this.doc.setValue(v),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},b.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 M=new b(v.value);return v.folds.forEach(function(T){M.addFold("...",s.fromPoints(T.start,T.end))}),M.setAnnotations(v.annotations),M.setBreakpoints(v.breakpoints),M.setMode(v.mode),M.setScrollLeft(v.scrollLeft),M.setScrollTop(v.scrollTop),M.setUndoManager(C),M.selection.fromJSON(v.selection),M},b.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()}},b.prototype.toString=function(){return this.doc.getValue()},b.prototype.getSelection=function(){return this.selection},b.prototype.getState=function(v){return this.bgTokenizer.getState(v)},b.prototype.getTokens=function(v){return this.bgTokenizer.getTokens(v)},b.prototype.getTokenAt=function(v,C){var M=this.bgTokenizer.getTokens(v),T,k=0;if(C==null){var O=M.length-1;k=this.getLine(v).length}else for(var O=0;O<M.length&&(k+=M[O].value.length,!(k>=C));O++);return T=M[O],T?(T.index=O,T.start=k-T.value.length,T):null},b.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(){}},b.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},b.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},b.prototype.getTabString=function(){return this.getUseSoftTabs()?g.stringRepeat(" ",this.getTabSize()):" "},b.prototype.setUseSoftTabs=function(v){this.setOption("useSoftTabs",v)},b.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},b.prototype.setTabSize=function(v){this.setOption("tabSize",v)},b.prototype.getTabSize=function(){return this.$tabSize},b.prototype.isTabStop=function(v){return this.$useSoftTabs&&v.column%this.$tabSize===0},b.prototype.setNavigateWithinSoftTabs=function(v){this.setOption("navigateWithinSoftTabs",v)},b.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},b.prototype.setOverwrite=function(v){this.setOption("overwrite",v)},b.prototype.getOverwrite=function(){return this.$overwrite},b.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},b.prototype.addGutterDecoration=function(v,C){this.$decorations[v]||(this.$decorations[v]=""),this.$decorations[v]+=" "+C,this._signal("changeBreakpoint",{})},b.prototype.removeGutterDecoration=function(v,C){this.$decorations[v]=(this.$decorations[v]||"").replace(" "+C,""),this._signal("changeBreakpoint",{})},b.prototype.getBreakpoints=function(){return this.$breakpoints},b.prototype.setBreakpoints=function(v){this.$breakpoints=[];for(var C=0;C<v.length;C++)this.$breakpoints[v[C]]="ace_breakpoint";this._signal("changeBreakpoint",{})},b.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},b.prototype.setBreakpoint=function(v,C){C===void 0&&(C="ace_breakpoint"),C?this.$breakpoints[v]=C:delete this.$breakpoints[v],this._signal("changeBreakpoint",{})},b.prototype.clearBreakpoint=function(v){delete this.$breakpoints[v],this._signal("changeBreakpoint",{})},b.prototype.addMarker=function(v,C,M,T){var k=this.$markerId++,O={range:v,type:M||"line",renderer:typeof M=="function"?M:null,clazz:C,inFront:!!T,id:k};return T?(this.$frontMarkers[k]=O,this._signal("changeFrontMarker")):(this.$backMarkers[k]=O,this._signal("changeBackMarker")),k},b.prototype.addDynamicMarker=function(v,C){if(v.update){var M=this.$markerId++;return v.id=M,v.inFront=!!C,C?(this.$frontMarkers[M]=v,this._signal("changeFrontMarker")):(this.$backMarkers[M]=v,this._signal("changeBackMarker")),v}},b.prototype.removeMarker=function(v){var C=this.$frontMarkers[v]||this.$backMarkers[v];if(C){var M=C.inFront?this.$frontMarkers:this.$backMarkers;delete M[v],this._signal(C.inFront?"changeFrontMarker":"changeBackMarker")}},b.prototype.getMarkers=function(v){return v?this.$frontMarkers:this.$backMarkers},b.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)},b.prototype.highlightLines=function(v,C,M,T){typeof C!="number"&&(M=C,C=v),M||(M="ace_step");var k=new s(v,0,C,1/0);return k.id=this.addMarker(k,M,"fullLine",T),k},b.prototype.setAnnotations=function(v){this.$annotations=v,this._signal("changeAnnotation",{})},b.prototype.getAnnotations=function(){return this.$annotations||[]},b.prototype.clearAnnotations=function(){this.setAnnotations([])},b.prototype.$detectNewLine=function(v){var C=v.match(/^.*?(\r?\n)/m);C?this.$autoNewLine=C[1]:this.$autoNewLine=`
|
|
1361
|
+
`},b.prototype.getWordRange=function(v,C){var M=this.getLine(v),T=!1;if(C>0&&(T=!!M.charAt(C-1).match(this.tokenRe)),T||(T=!!M.charAt(C).match(this.tokenRe)),T)var k=this.tokenRe;else if(/^\s+$/.test(M.slice(C-1,C+1)))var k=/\s/;else var k=this.nonTokenRe;var O=C;if(O>0){do O--;while(O>=0&&M.charAt(O).match(k));O++}for(var I=C;I<M.length&&M.charAt(I).match(k);)I++;return new s(v,O,v,I)},b.prototype.getAWordRange=function(v,C){for(var M=this.getWordRange(v,C),T=this.getLine(M.end.row);T.charAt(M.end.column).match(/[ \t]/);)M.end.column+=1;return M},b.prototype.setNewLineMode=function(v){this.doc.setNewLineMode(v)},b.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},b.prototype.setUseWorker=function(v){this.setOption("useWorker",v)},b.prototype.getUseWorker=function(){return this.$useWorker},b.prototype.onReloadTokenizer=function(v){var C=v.data;this.bgTokenizer.start(C.first),this._signal("tokenizerUpdate",v)},b.prototype.setMode=function(v,C){if(v&&typeof v=="object"){if(v.getTokenizer)return this.$onChangeMode(v);var M=v,T=M.path}else T=v||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new o),this.$modes[T]&&!M){this.$onChangeMode(this.$modes[T]),C&&C();return}this.$modeId=T,c.loadModule(["mode",T],(function(k){if(this.$modeId!==T)return C&&C();this.$modes[T]&&!M?this.$onChangeMode(this.$modes[T]):k&&k.Mode&&(k=new k.Mode(M),M||(this.$modes[T]=k,k.$id=T),this.$onChangeMode(k)),C&&C()}).bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},b.prototype.$onChangeMode=function(v,C){if(C||(this.$modeId=v.$id),this.$mode!==v){var M=this.$mode;this.$mode=v,this.$stopWorker(),this.$useWorker&&this.$startWorker();var T=v.getTokenizer();if(T.on!==void 0){var k=this.onReloadTokenizer.bind(this);T.on("update",k)}this.bgTokenizer.setTokenizer(T),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:M,mode:v}))}},b.prototype.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},b.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(v){c.warn("Could not load worker",v),this.$worker=null}},b.prototype.getMode=function(){return this.$mode},b.prototype.setScrollTop=function(v){this.$scrollTop===v||isNaN(v)||(this.$scrollTop=v,this._signal("changeScrollTop",v))},b.prototype.getScrollTop=function(){return this.$scrollTop},b.prototype.setScrollLeft=function(v){this.$scrollLeft===v||isNaN(v)||(this.$scrollLeft=v,this._signal("changeScrollLeft",v))},b.prototype.getScrollLeft=function(){return this.$scrollLeft},b.prototype.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},b.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},b.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(),M=this.$rowLengthCache,T=0,k=0,O=this.$foldData[k],I=O?O.start.row:1/0,N=C.length,P=0;P<N;P++){if(P>I){if(P=O.end.row+1,P>=N)break;O=this.$foldData[k++],I=O?O.start.row:1/0}M[P]==null&&(M[P]=this.$getStringScreenWidth(C[P])[0]),M[P]>T&&(T=M[P])}this.screenWidth=T}},b.prototype.getLine=function(v){return this.doc.getLine(v)},b.prototype.getLines=function(v,C){return this.doc.getLines(v,C)},b.prototype.getLength=function(){return this.doc.getLength()},b.prototype.getTextRange=function(v){return this.doc.getTextRange(v||this.selection.getRange())},b.prototype.insert=function(v,C){return this.doc.insert(v,C)},b.prototype.remove=function(v){return this.doc.remove(v)},b.prototype.removeFullLines=function(v,C){return this.doc.removeFullLines(v,C)},b.prototype.undoChanges=function(v,C){if(v.length){this.$fromUndo=!0;for(var M=v.length-1;M!=-1;M--){var T=v[M];T.action=="insert"||T.action=="remove"?this.doc.revertDelta(T):T.folds&&this.addFolds(T.folds)}!C&&this.$undoSelect&&(v.selectionBefore?this.selection.fromJSON(v.selectionBefore):this.selection.setRange(this.$getUndoSelection(v,!0))),this.$fromUndo=!1}},b.prototype.redoChanges=function(v,C){if(v.length){this.$fromUndo=!0;for(var M=0;M<v.length;M++){var T=v[M];(T.action=="insert"||T.action=="remove")&&this.doc.$safeApplyDelta(T)}!C&&this.$undoSelect&&(v.selectionAfter?this.selection.fromJSON(v.selectionAfter):this.selection.setRange(this.$getUndoSelection(v,!1))),this.$fromUndo=!1}},b.prototype.setUndoSelect=function(v){this.$undoSelect=v},b.prototype.$getUndoSelection=function(v,C){function M(N){return C?N.action!=="insert":N.action==="insert"}for(var T,k,O=0;O<v.length;O++){var I=v[O];if(I.start){if(!T){M(I)?T=s.fromPoints(I.start,I.end):T=s.fromPoints(I.start,I.start);continue}M(I)?(k=I.start,T.compare(k.row,k.column)==-1&&T.setStart(k),k=I.end,T.compare(k.row,k.column)==1&&T.setEnd(k)):(k=I.start,T.compare(k.row,k.column)==-1&&(T=s.fromPoints(I.start,I.start)))}}return T},b.prototype.replace=function(v,C){return this.doc.replace(v,C)},b.prototype.moveText=function(v,C,M){var T=this.getTextRange(v),k=this.getFoldsInRange(v),O=s.fromPoints(C,C);if(!M){this.remove(v);var I=v.start.row-v.end.row,N=I?-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)),I&&O.start.row>=v.end.row&&(O.start.row+=I,O.end.row+=I)}if(O.end=this.insert(O.start,T),k.length){var P=v.start,B=O.start,I=B.row-P.row,N=B.column-P.column;this.addFolds(k.map(function(z){return z=z.clone(),z.start.row==P.row&&(z.start.column+=N),z.end.row==P.row&&(z.end.column+=N),z.start.row+=I,z.end.row+=I,z}))}return O},b.prototype.indentRows=function(v,C,M){M=M.replace(/\t/g,this.getTabString());for(var T=v;T<=C;T++)this.doc.insertInLine({row:T,column:0},M)},b.prototype.outdentRows=function(v){for(var C=v.collapseRows(),M=new s(0,0,0,0),T=this.getTabSize(),k=C.start.row;k<=C.end.row;++k){var O=this.getLine(k);M.start.row=k,M.end.row=k;for(var I=0;I<T&&O.charAt(I)==" ";++I);I<T&&O.charAt(I)==" "?(M.start.column=I,M.end.column=I+1):(M.start.column=0,M.end.column=I),this.remove(M)}},b.prototype.$moveLines=function(v,C,M){if(v=this.getRowFoldStart(v),C=this.getRowFoldEnd(C),M<0){var T=this.getRowFoldStart(v+M);if(T<0)return 0;var k=T-v}else if(M>0){var T=this.getRowFoldEnd(C+M);if(T>this.doc.getLength()-1)return 0;var k=T-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),I=this.getFoldsInRange(O).map(function(P){return P=P.clone(),P.start.row+=k,P.end.row+=k,P}),N=M==0?this.doc.getLines(v,C):this.doc.removeFullLines(v,C);return this.doc.insertFullLines(v+k,N),I.length&&this.addFolds(I),k},b.prototype.moveLinesUp=function(v,C){return this.$moveLines(v,C,-1)},b.prototype.moveLinesDown=function(v,C){return this.$moveLines(v,C,1)},b.prototype.duplicateLines=function(v,C){return this.$moveLines(v,C,0)},b.prototype.$clipRowToDocument=function(v){return Math.max(0,Math.min(v,this.doc.getLength()-1))},b.prototype.$clipColumnToRow=function(v,C){return C<0?0:Math.min(this.doc.getLine(v).length,C)},b.prototype.$clipPositionToDocument=function(v,C){if(C=Math.max(0,C),v<0)v=0,C=0;else{var M=this.doc.getLength();v>=M?(v=M-1,C=this.doc.getLine(M-1).length):C=Math.min(this.doc.getLine(v).length,C)}return{row:v,column:C}},b.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},b.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")}},b.prototype.getUseWrapMode=function(){return this.$useWrapMode},b.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"))},b.prototype.adjustWrapLimit=function(v,C){var M=this.$wrapLimitRange;M.max<0&&(M={min:C,max:C});var T=this.$constrainWrapLimit(v,M.min,M.max);return T!=this.$wrapLimit&&T>1?(this.$wrapLimit=T,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0):!1},b.prototype.$constrainWrapLimit=function(v,C,M){return C&&(v=Math.max(C,v)),M&&(v=Math.min(M,v)),v},b.prototype.getWrapLimit=function(){return this.$wrapLimit},b.prototype.setWrapLimit=function(v){this.setWrapLimitRange(v,v)},b.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},b.prototype.$updateInternalDataOnChange=function(v){var C=this.$useWrapMode,M=v.action,T=v.start,k=v.end,O=T.row,I=k.row,N=I-O,P=null;if(this.$updating=!0,N!=0)if(M==="remove"){this[C?"$wrapData":"$rowLengthCache"].splice(O,N);var B=this.$foldData;P=this.getFoldsInRange(v),this.removeFolds(P);var F=this.getFoldLine(k.row),H=0;if(F){F.addRemoveChars(k.row,k.column,T.column-k.column),F.shiftRow(-N);var z=this.getFoldLine(O);z&&z!==F&&(z.merge(F),F=z),H=B.indexOf(F)+1}for(H;H<B.length;H++){var F=B[H];F.start.row>=k.row&&F.shiftRow(-N)}I=O}else{var W=Array(N);W.unshift(O,0);var U=C?this.$wrapData:this.$rowLengthCache;U.splice.apply(U,W);var B=this.$foldData,F=this.getFoldLine(O),H=0;if(F){var K=F.range.compareInside(T.row,T.column);K==0?(F=F.split(T.row,T.column),F&&(F.shiftRow(N),F.addRemoveChars(I,0,k.column-T.column))):K==-1&&(F.addRemoveChars(O,0,k.column-T.column),F.shiftRow(N)),H=B.indexOf(F)+1}for(H;H<B.length;H++){var F=B[H];F.start.row>=O&&F.shiftRow(N)}}else{N=Math.abs(v.start.column-v.end.column),M==="remove"&&(P=this.getFoldsInRange(v),this.removeFolds(P),N=-N);var F=this.getFoldLine(O);F&&F.addRemoveChars(O,T.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,I):this.$updateRowLengthCache(O,I),P},b.prototype.$updateRowLengthCache=function(v,C){this.$rowLengthCache[v]=null,this.$rowLengthCache[C]=null},b.prototype.$updateWrapData=function(v,C){var M=this.doc.getAllLines(),T=this.getTabSize(),k=this.$wrapData,O=this.$wrapLimit,I,N,P=v;for(C=Math.min(C,M.length-1);P<=C;)N=this.getFoldLine(P,N),N?(I=[],N.walk((function(B,F,H,z){var W;if(B!=null){W=this.$getDisplayTokens(B,I.length),W[0]=A;for(var U=1;U<W.length;U++)W[U]=S}else W=this.$getDisplayTokens(M[F].substring(z,H),I.length);I=I.concat(W)}).bind(this),N.end.row,M[N.end.row].length+1),k[N.start.row]=this.$computeWrapSplits(I,O,T),P=N.end.row+1):(I=this.$getDisplayTokens(M[P]),k[P]=this.$computeWrapSplits(I,O,T),P++)},b.prototype.$computeWrapSplits=function(v,C,M){if(v.length==0)return[];var T=[],k=v.length,O=0,I=0,N=this.$wrapAsCode,P=this.$indentedSoftWrap,B=C<=Math.max(2*M,8)||P===!1?0:Math.floor(C/2);function F(){var K=0;if(B===0)return K;if(P)for(var Y=0;Y<v.length;Y++){var G=v[Y];if(G==R)K+=1;else if(G==L)K+=M;else{if(G==_)continue;break}}return N&&P!==!1&&(K+=M),Math.min(K,B)}function H(K){for(var Y=K-O,G=O;G<K;G++){var Q=v[G];(Q===12||Q===2)&&(Y-=1)}T.length||(z=F(),T.indent=z),I+=Y,T.push(I),O=K}for(var z=0;k-O>C-z;){var W=O+C-z;if(v[W-1]>=R&&v[W]>=R){H(W);continue}if(v[W]==A||v[W]==S){for(W;W!=O-1&&v[W]!=A;W--);if(W>O){H(W);continue}for(W=O+C,W;W<v.length&&v[W]==S;W++);if(W==v.length)break;H(W);continue}for(var U=Math.max(W-(C-(C>>2)),O-1);W>U&&v[W]<A;)W--;if(N){for(;W>U&&v[W]<A;)W--;for(;W>U&&v[W]==E;)W--}else for(;W>U&&v[W]<R;)W--;if(W>U){H(++W);continue}W=O+C,v[W]==$&&W--,H(W-z)}return T},b.prototype.$getDisplayTokens=function(v,C){var M=[],T;C=C||0;for(var k=0;k<v.length;k++){var O=v.charCodeAt(k);if(O==9){T=this.getScreenTabSize(M.length+C),M.push(L);for(var I=1;I<T;I++)M.push(_)}else O==32?M.push(R):O>39&&O<48||O>57&&O<64?M.push(E):O>=4352&&D(O)?M.push(x,$):M.push(x)}return M},b.prototype.$getStringScreenWidth=function(v,C,M){if(C==0)return[0,0];C==null&&(C=1/0),M=M||0;var T,k;for(k=0;k<v.length&&(T=v.charCodeAt(k),T==9?M+=this.getScreenTabSize(M):T>=4352&&D(T)?M+=2:M+=1,!(M>C));k++);return[M,k]},b.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},b.prototype.getRowLineCount=function(v){return!this.$useWrapMode||!this.$wrapData[v]?1:this.$wrapData[v].length+1},b.prototype.getRowWrapIndent=function(v){if(this.$useWrapMode){var C=this.screenToDocumentPosition(v,Number.MAX_VALUE),M=this.$wrapData[C.row];return M.length&&M[0]<C.column?M.indent:0}else return 0},b.prototype.getScreenLastRowColumn=function(v){var C=this.screenToDocumentPosition(v,Number.MAX_VALUE);return this.documentToScreenColumn(C.row,C.column)},b.prototype.getDocumentLastRowColumn=function(v,C){var M=this.documentToScreenRow(v,C);return this.getScreenLastRowColumn(M)},b.prototype.getDocumentLastRowColumnPosition=function(v,C){var M=this.documentToScreenRow(v,C);return this.screenToDocumentPosition(M,Number.MAX_VALUE/10)},b.prototype.getRowSplitData=function(v){if(this.$useWrapMode)return this.$wrapData[v]},b.prototype.getScreenTabSize=function(v){return this.$tabSize-(v%this.$tabSize|0)},b.prototype.screenToDocumentRow=function(v,C){return this.screenToDocumentPosition(v,C).row},b.prototype.screenToDocumentColumn=function(v,C){return this.screenToDocumentPosition(v,C).column},b.prototype.screenToDocumentPosition=function(v,C,M){if(v<0)return{row:0,column:0};var T,k=0,O=0,I,N=0,P=0,B=this.$screenRowCache,F=this.$getRowCacheIndex(B,v),H=B.length;if(H&&F>=0)var N=B[F],k=this.$docRowCache[F],z=v>B[H-1];else var z=!H;for(var W=this.getLength()-1,U=this.getNextFoldLine(k),K=U?U.start.row:1/0;N<=v&&(P=this.getRowLength(k),!(N+P>v||k>=W));)N+=P,k++,k>K&&(k=U.end.row+1,U=this.getNextFoldLine(k,U),K=U?U.start.row:1/0),z&&(this.$docRowCache.push(k),this.$screenRowCache.push(N));if(U&&U.start.row<=k)T=this.getFoldDisplayLine(U),k=U.start.row;else{if(N+P<=v||k>W)return{row:W,column:this.getLine(W).length};T=this.getLine(k),U=null}var Y=0,G=Math.floor(v-N);if(this.$useWrapMode){var Q=this.$wrapData[k];Q&&(I=Q[G],G>0&&Q.length&&(Y=Q.indent,O=Q[G-1]||Q[Q.length-1],T=T.substring(O)))}return M!==void 0&&this.$bidiHandler.isBidiRow(N+G,k,G)&&(C=this.$bidiHandler.offsetToCol(M)),O+=this.$getStringScreenWidth(T,C-Y)[1],this.$useWrapMode&&O>=I&&(O=I-1),U?U.idxToPosition(O):{row:k,column:O}},b.prototype.documentToScreenPosition=function(v,C){if(typeof C>"u")var M=this.$clipPositionToDocument(v.row,v.column);else M=this.$clipPositionToDocument(v,C);v=M.row,C=M.column;var T=0,k=null,O=null;O=this.getFoldAt(v,C,1),O&&(v=O.start.row,C=O.start.column);var I,N=0,P=this.$docRowCache,B=this.$getRowCacheIndex(P,v),F=P.length;if(F&&B>=0)var N=P[B],T=this.$screenRowCache[B],H=v>P[F-1];else var H=!F;for(var z=this.getNextFoldLine(N),W=z?z.start.row:1/0;N<v;){if(N>=W){if(I=z.end.row+1,I>v)break;z=this.getNextFoldLine(I,z),W=z?z.start.row:1/0}else I=N+1;T+=this.getRowLength(N),N=I,H&&(this.$docRowCache.push(N),this.$screenRowCache.push(T))}var U="";z&&N>=W?(U=this.getFoldDisplayLine(z,v,C),k=z.start.row):(U=this.getLine(v).substring(0,C),k=v);var K=0;if(this.$useWrapMode){var Y=this.$wrapData[k];if(Y){for(var G=0;U.length>=Y[G];)T++,G++;U=U.substring(Y[G-1]||0,U.length),K=G>0?Y.indent:0}}return this.lineWidgets&&this.lineWidgets[N]&&this.lineWidgets[N].rowsAbove&&(T+=this.lineWidgets[N].rowsAbove),{row:T,column:K+this.$getStringScreenWidth(U)[0]}},b.prototype.documentToScreenColumn=function(v,C){return this.documentToScreenPosition(v,C).column},b.prototype.documentToScreenRow=function(v,C){return this.documentToScreenPosition(v,C).row},b.prototype.getScreenLength=function(){var v=0,C=null;if(this.$useWrapMode)for(var k=this.$wrapData.length,O=0,T=0,C=this.$foldData[T++],I=C?C.start.row:1/0;O<k;){var N=this.$wrapData[O];v+=N?N.length+1:1,O++,O>I&&(O=C.end.row+1,C=this.$foldData[T++],I=C?C.start.row:1/0)}else{v=this.getLength();for(var M=this.$foldData,T=0;T<M.length;T++)C=M[T],v-=C.end.row-C.start.row}return this.lineWidgets&&(v+=this.$getWidgetScreenLength()),v},b.prototype.$setFontMetrics=function(v){this.$enableVarChar&&(this.$getStringScreenWidth=function(C,M,T){if(M===0)return[0,0];M||(M=1/0),T=T||0;var k,O;for(O=0;O<C.length&&(k=C.charAt(O),k===" "?T+=this.getScreenTabSize(T):T+=v.getCharacterWidth(k),!(T>M));O++);return[T,O]})},b.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]},b.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()},b})();w.$uid=0,w.prototype.$modes=c.$modes,w.prototype.getValue=w.prototype.toString,w.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},w.prototype.$overwrite=!1,w.prototype.$mode=null,w.prototype.$modeId=null,w.prototype.$scrollTop=0,w.prototype.$scrollLeft=0,w.prototype.$wrapLimit=80,w.prototype.$useWrapMode=!1,w.prototype.$wrapLimitRange={min:null,max:null},w.prototype.lineWidgets=null,w.prototype.isFullWidth=D,d.implement(w.prototype,f);var x=1,$=2,A=3,S=4,E=9,R=10,L=11,_=12;function D(b){return b<4352?!1:b>=4352&&b<=4447||b>=4515&&b<=4519||b>=4602&&b<=4607||b>=9001&&b<=9002||b>=11904&&b<=11929||b>=11931&&b<=12019||b>=12032&&b<=12245||b>=12272&&b<=12283||b>=12288&&b<=12350||b>=12353&&b<=12438||b>=12441&&b<=12543||b>=12549&&b<=12589||b>=12593&&b<=12686||b>=12688&&b<=12730||b>=12736&&b<=12771||b>=12784&&b<=12830||b>=12832&&b<=12871||b>=12880&&b<=13054||b>=13056&&b<=19903||b>=19968&&b<=42124||b>=42128&&b<=42182||b>=43360&&b<=43388||b>=44032&&b<=55203||b>=55216&&b<=55238||b>=55243&&b<=55291||b>=63744&&b<=64255||b>=65040&&b<=65049||b>=65072&&b<=65106||b>=65108&&b<=65126||b>=65128&&b<=65131||b>=65281&&b<=65376||b>=65504&&b<=65510}t("./edit_session/folding").Folding.call(w.prototype),t("./edit_session/bracket_match").BracketMatch.call(w.prototype),c.defineOptions(w.prototype,"session",{wrap:{set:function(b){if(!b||b=="off"?b=!1:b=="free"?b=!0:b=="printMargin"?b=-1:typeof b=="string"&&(b=parseInt(b,10)||!1),this.$wrap!=b)if(this.$wrap=b,!b)this.setUseWrapMode(!1);else{var v=typeof b=="number"?b: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(b){b=b=="auto"?this.$mode.type!="text":b!="text",b!=this.$wrapAsCode&&(this.$wrapAsCode=b,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(b){this.$useWorker=b,this.$stopWorker(),b&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(b){b=parseInt(b),b>0&&this.$tabSize!==b&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=b,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(b){this.setFoldStyle(b)},handlesSet:!0},overwrite:{set:function(b){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(b){this.doc.setNewLineMode(b)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(b){this.setMode(b)},get:function(){return this.$modeId},handlesSet:!0}}),n.EditSession=w}),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,w){return i=new m(u,h,y,w),h==w&&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,w=i.length-y,x;e:for(var $=h.offset||0;$<=w;$++){for(var A=0;A<y;A++)if(i[$+A].search(h[A])==-1)continue e;var S=i[$],E=i[$+y-1],R=S.length-S.match(h[0])[0].length,L=E.match(h[y-1])[0].length;x&&x.end.row===$&&x.end.column>R||(u.push(x=new m($,R,$+y-1,L)),y>2&&($=$+y-2))}}else for(var _=0;_<i.length;_++)for(var D=d.getMatchOffsets(i[_],h),A=0;A<D.length;A++){var b=D[A];u.push(new m(_,b.offset,_,b.offset+b.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 M=a.end.row-a.start.row;_<A&&u[A].end.column>C&&u[A].end.row==M;)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 D=i?R-S+1:R;if(!(D<0||D+S>o.getLength())){var w=o.getLine(D),v=w.search(a[0]);if(!(!i&&v<L||v===-1)){for(var C=1;C<S;C++)if(w=o.getLine(D+C),w.search(a[C])==-1)return;var E=w.match(a[S-1])[0].length;if(!(i&&E>L)&&_(D,v,D+S-1,E))return!0}}};else if(i)var M=function(L,_,D){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(D(L,O,L,O+x))return!0}};else var M=function(L,_,D){var w=o.getLine(L),v,C;for(a.lastIndex=_;C=a.exec(w);){var E=C[0].length;if(v=C.index,D(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(`
|
|
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,w=s.start;w||(w=y?y[i?"end":"start"]:o.selection.getRange()),w.start&&(w=w[u!=i?"end":"start"]);var x=y?y.start.row:0,$=y?y.end.row:o.getLength()-1;if(i)var A=function(R){var L=w.row;if(!E(L,w.column,R)){for(L--;L>=x;L--)if(E(L,Number.MAX_VALUE,R))return;if(s.wrap!=!1){for(L=$,x=w.row;L>=x;L--)if(E(L,Number.MAX_VALUE,R))return}}};else var A=function(L){var _=w.row;if(!E(_,w.column,L)){for(_=_+1;_<=$;_++)if(E(_,0,L))return;if(s.wrap!=!1){for(_=x,$=w.row;_<=$;_++)if(E(_,0,L))return}}};if(s.$isMultiLine)var S=a.length,E=function(R,L,_){var D=i?R-S+1:R;if(!(D<0||D+S>o.getLength())){var b=o.getLine(D),v=b.search(a[0]);if(!(!i&&v<L||v===-1)){for(var C=1;C<S;C++)if(b=o.getLine(D+C),b.search(a[C])==-1)return;var M=b.match(a[S-1])[0].length;if(!(i&&M>L)&&_(D,v,D+S-1,M))return!0}}};else if(i)var E=function(L,_,D){var b=o.getLine(L),v=[],C,M=0;for(a.lastIndex=0;C=a.exec(b);){var T=C[0].length;if(M=C.index,!T){if(M>=b.length)break;a.lastIndex=M+=d.skipEmptyMatch(b,M,h)}if(C.index+T>_)break;v.push(C.index,T)}for(var k=v.length-1;k>=0;k-=2){var O=v[k-1],T=v[k];if(D(L,O,L,O+T))return!0}};else var E=function(L,_,D){var b=o.getLine(L),v,C;for(a.lastIndex=_;C=a.exec(b);){var M=C[0].length;if(v=C.index,D(L,v,L,v+M))return!0;if(!M&&(a.lastIndex=v+=d.skipEmptyMatch(b,v,h),v>=b.length))return!1}};return{forEach:A}},r})();function f(r,o){var s=d.supportsLookbehind();function a(y,w){w===void 0&&(w=!0);var x=s&&o.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return x.test(y)||o.regExp?s&&o.$supportsUnicodeFlag?w?"(?<=^|[^\\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 w=h[y];if(w==a)delete h[y];else if(Array.isArray(w)){var x=w.indexOf(a);x!=-1&&(w.splice(x,1),w.length==1&&(h[y]=w[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 w=h.split(/\s+/);h=w.pop(),w.forEach(function(A){var S=this.parseKeys(A),E=c[S.hashId]+S.key;y+=(y?" ":"")+E,this._addCommandToBinding(y,"chainKeys")},this),y+=" "}var x=this.parseKeys(h),$=c[x.hashId]+x.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 w=h[a];for(y=0;y<w.length;y++){var x=w[y],$=r(x);if($>u)break}w.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,w=i.length;w--;){var x=g.KEY_MODS[i[w]];if(x==null)return typeof console<"u"&&console.error("invalid modifier "+i[w]+" in "+a),!1;y|=x}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,w=this.commandKeyBinding[y];return a.$keyChain&&(a.$keyChain+=" "+y,w=this.commandKeyBinding[a.$keyChain]||w),w&&(w=="chainKeys"||w[w.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:w})}},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),w=s.row+1;w<=a.row+1;w++){var x=d.stringTrimLeft(d.stringTrimRight(r.session.doc.getLine(w)));x.length!==0&&(x=" "+x),y+=x}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: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,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 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&&(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 I=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:O}),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 O=x[k];k&&x[k-1].start.row==O.start.row||(v+=this.session.getLine(O.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/),O=this.selection.rangeList.ranges,I=k.length==2&&(!k[0]||!k[1]);if(k.length!=O.length||I)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(`
|
|
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(b){var v=typeof Symbol=="function"&&Symbol.iterator,C=v&&b[v],M=0;if(C)return C.call(b);if(b&&typeof b.length=="number")return{next:function(){return b&&M>=b.length&&(b=void 0),{value:b&&b[M++],done:!b}}};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,w=t("./commands/command_manager").CommandManager,x=t("./commands/default_commands").commands,$=t("./config"),A=t("./token_iterator").TokenIterator,S=t("./keyboard/gutter_handler").GutterKeyboardHandler,E=t("./config").nls,R=t("./clipboard"),L=t("./lib/keys"),_=(function(){function b(v,C,M){this.session,this.$toDestroy=[];var T=v.getContainerElement();this.container=T,this.renderer=v,this.id="editor"+ ++b.$uid,this.commands=new w(f.isMac?"mac":"win",x),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,O){O._$emitInputEvent.schedule(31)}),this.setSession(C||M&&M.session||new i("")),$.resetOptions(this),M&&this.setOptions(M),$._signal("editor",this)}return b.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0)},b.prototype.startOperation=function(v){this.session.startOperation(v)},b.prototype.endOperation=function(v){this.session.endOperation(v)},b.prototype.onStartOperation=function(v){this.curOp=this.session.curOp,this.curOp.scrollTop=this.renderer.scrollTop,this.prevOp=this.session.prevOp,v||(this.previousCommand=null)},b.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,M=C&&C.scrollIntoView;if(M){switch(M){case"center-animate":M="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var T=this.selection.getRange(),k=this.renderer.layerConfig;(T.start.row>=k.lastRow||T.end.row<=k.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break}M=="animate"&&this.renderer.animateScrolling(this.curOp.scrollTop)}this.$lastSel=this.session.selection.toJSON(),this.prevOp=this.curOp,this.curOp=null}},b.prototype.$historyTracker=function(v){if(this.$mergeUndoDeltas){var C=this.prevOp,M=this.$mergeableCommands,T=C.command&&v.command.name==C.command.name;if(v.command.name=="insertstring"){var k=v.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),T=T&&this.mergeNextCommand&&(!/\s/.test(k)||/\s/.test(C.args)),this.mergeNextCommand=!0}else T=T&&M.indexOf(v.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(T=!1),T?this.session.mergeUndoDeltas=!0:M.indexOf(v.command.name)!==-1&&(this.sequenceStartTime=Date.now())}},b.prototype.setKeyboardHandler=function(v,C){if(v&&typeof v=="string"&&v!="ace"){this.$keybindingId=v;var M=this;$.loadModule(["keybinding",v],function(T){M.$keybindingId==v&&M.keyBinding.setKeyboardHandler(T&&T.handler),C&&C()})}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(v),C&&C()},b.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},b.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 M=this.session.getSelection();M.off("changeCursor",this.$onCursorChange),M.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()}},b.prototype.getSession=function(){return this.session},b.prototype.setValue=function(v,C){return this.session.doc.setValue(v),C?C==1?this.navigateFileEnd():C==-1&&this.navigateFileStart():this.selectAll(),v},b.prototype.getValue=function(){return this.session.getValue()},b.prototype.getSelection=function(){return this.selection},b.prototype.resize=function(v){this.renderer.onResize(v)},b.prototype.setTheme=function(v,C){this.renderer.setTheme(v,C)},b.prototype.getTheme=function(){return this.renderer.getTheme()},b.prototype.setStyle=function(v){this.renderer.setStyle(v)},b.prototype.unsetStyle=function(v){this.renderer.unsetStyle(v)},b.prototype.getFontSize=function(){return this.getOption("fontSize")||m.computedStyle(this.container).fontSize},b.prototype.setFontSize=function(v){this.setOption("fontSize",v)},b.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 M=v.getCursorPosition(),T=v.getKeyboardHandler(),k=T&&T.$getDirectionForHighlight&&T.$getDirectionForHighlight(v),O=C.getMatchingBracketRanges(M,k);if(!O){var I=new A(C,M.row,M.column),N=I.getCurrentToken();if(N&&/\b(?:tag-open|tag-name)/.test(N.type)){var P=C.getMatchingTags(M);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 B="ace_bracket";Array.isArray(O)?O.length==1&&(B="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,B,"text")})},v.getHighlightIndentGuides()&&v.renderer.$textLayer.$highlightIndentGuide()}},50)}},b.prototype.focus=function(){this.textInput.focus()},b.prototype.isFocused=function(){return this.textInput.isFocused()},b.prototype.blur=function(){this.textInput.blur()},b.prototype.onFocus=function(v){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",v))},b.prototype.onBlur=function(v){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",v))},b.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},b.prototype.onDocumentChange=function(v){var C=this.session.$useWrapMode,M=v.start.row==v.end.row?v.end.row:1/0;this.renderer.updateLines(v.start.row,M,C),this._signal("change",v),this.$cursorChange()},b.prototype.onTokenizerUpdate=function(v){var C=v.data;this.renderer.updateLines(C.first,C.last)},b.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},b.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},b.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},b.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 M=new h(C.row,C.column,C.row,1/0);M.id=v.addMarker(M,"ace_active-line","screenLine"),v.$highlightLineMarker=M}else C&&(v.$highlightLineMarker.start.row=C.row,v.$highlightLineMarker.end.row=C.row,v.$highlightLineMarker.start.column=C.column,v._signal("changeBackMarker"))},b.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 M=this.selection.getRange(),T=this.getSelectionStyle();C.$selectionMarker=C.addMarker(M,"ace_selection",T)}var k=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(k),this._signal("changeSelection")},b.prototype.$getSelectionHighLightRegexp=function(){var v=this.session,C=this.getSelectionRange();if(!(C.isEmpty()||C.isMultiLine())){var M=C.start.column,T=C.end.column,k=v.getLine(C.start.row),O=k.substring(M,T);if(!(O.length>5e3||!/[\w\d]/.test(O))){var I=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:O}),N=k.substring(M-1,T+1);if(I.test(N))return I}}},b.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},b.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},b.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},b.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},b.prototype.onChangeMode=function(v){this.renderer.updateText(),this._emit("changeMode",v)},b.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},b.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},b.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},b.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},b.prototype.getCopyText=function(){var v=this.getSelectedText(),C=this.session.doc.getNewLineCharacter(),M=!1;if(!v&&this.$copyWithEmptySelection){M=!0;for(var T=this.selection.getAllRanges(),k=0;k<T.length;k++){var O=T[k];k&&T[k-1].start.row==O.start.row||(v+=this.session.getLine(O.start.row)+C)}}var I={text:v};return this._signal("copy",I),R.lineMode=M?I.text:!1,I.text},b.prototype.onCopy=function(){this.commands.exec("copy",this)},b.prototype.onCut=function(){this.commands.exec("cut",this)},b.prototype.onPaste=function(v,C){var M={text:v,event:C};this.commands.exec("paste",this,M)},b.prototype.$handlePaste=function(v){typeof v=="string"&&(v={text:v}),this._signal("paste",v);var C=v.text,M=C===R.lineMode,T=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)M?T.insert({row:this.selection.lead.row,column:0},C):this.insert(C);else if(M)this.selection.rangeList.ranges.forEach(function(B){T.insert({row:B.start.row,column:0},C)});else{var k=C.split(/\r\n|\r|\n/),O=this.selection.rangeList.ranges,I=k.length==2&&(!k[0]||!k[1]);if(k.length!=O.length||I)return this.commands.exec("insertstring",this,C);for(var N=O.length;N--;){var P=O[N];P.isEmpty()||T.remove(P),T.insert(P.start,k[N])}}},b.prototype.execCommand=function(v,C){return this.commands.exec(v,this,C)},b.prototype.insert=function(v,C){var M=this.session,T=M.getMode(),k=this.getCursorPosition();if(this.getBehavioursEnabled()&&!C){var O=T.transformAction(M.getState(k.row),"insertion",this,M,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
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=
|
|
1369
|
-
`){var I=
|
|
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,I=v.getTabSize(),N=v.documentToScreenColumn(O.row,O.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 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 I=O.value.indexOf(".")>=0?O.start+O.value.indexOf(".")+1:O.end,N=O.start+O.value.length-I,P=parseFloat(O.value);P*=Math.pow(10,N),I!==O.end&&E<I?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 I=0,N=0,P=this;E.match(/[A-Za-z0-9_]+/)&&k.forEach(function(V,Z){N=I+V.length,O>=I&&O<=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),O=k.split(/((?:https?|ftp):\/\/[\S]+)/),I=C;I<0&&(I=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,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 O=x?E.start:E.end,I=C.insert(O,C.getTextRange(E));E.start=O,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 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 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 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 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==="<"&&O>1?z[I.value]++:k.value==="</"&&z[I.value]--,z[I.value]===-1&&(N="tag",P=!0));P||(k=I,O++,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 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}),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",O),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?D.attach(this):D.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(w){this.$showLineNumbers&&w?D.attach(this):D.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 D={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,D=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=(D?D.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 I="ace_fold-widget ace_"+O,N=O=="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 D=this.$lines.cells[$++];D.element.style.top=this.$lines.computeLineTop(D.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],D=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(D){u+=1;var C=this.dom.createElement("span");C.style.width=b.config.characterWidth*2+"px",C.className="ace_cjk",C.textContent=D,$.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{
|
|
1368
|
+
`){var F=M.getLine(k.row);if(k.column>F.search(/\S|$/)){var N=F.substr(k.column).search(/\S|$/);M.doc.removeInLine(k.row,k.column,k.column+N)}}this.clearSelection();var P=k.column,B=M.getState(k.row),F=M.getLine(k.row),H=T.checkOutdent(B,F,v);if(M.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(M.getDocument().isNewLine(v)){var z=T.getNextLineIndent(B,F.slice(0,k.column),M.getTabString());M.insert({row:k.row+1,column:0},z)}H&&T.autoOutdent(B,M,k.row)}},b.prototype.autoIndent=function(){for(var v=this.session,C=v.getMode(),M=this.selection.isEmpty()?[new h(0,0,v.doc.getLength()-1,0)]:this.selection.getAllRanges(),T="",k="",O="",I=v.getTabString(),N=0;N<M.length;N++)for(var P=M[N].start.row,B=M[N].end.row,F=P;F<=B;F++){F>0&&(T=v.getState(F-1),k=v.getLine(F-1),O=C.getNextLineIndent(T,k,I));var H=v.getLine(F),z=C.$getIndent(H);if(O!==z){if(z.length>0){var W=new h(F,0,F,z.length);v.remove(W)}O.length>0&&v.insert({row:F,column:0},O)}C.autoOutdent(T,v,F)}},b.prototype.onTextInput=function(v,C){if(!C)return this.keyBinding.onTextInput(v);this.startOperation({command:{name:"insertstring"}});var M=this.applyComposition.bind(this,v,C);this.selection.rangeCount?this.forEachSelection(M):M(),this.endOperation()},b.prototype.applyComposition=function(v,C){if(C.extendLeft||C.extendRight){var M=this.selection.getRange();M.start.column-=C.extendLeft,M.end.column+=C.extendRight,M.start.column<0&&(M.start.row--,M.start.column+=this.session.getLine(M.start.row).length+1),this.selection.setRange(M),!v&&!M.isEmpty()&&this.remove()}if((v||!this.selection.isEmpty())&&this.insert(v,!0),C.restoreStart||C.restoreEnd){var M=this.selection.getRange();M.start.column-=C.restoreStart,M.end.column-=C.restoreEnd,this.selection.setRange(M)}},b.prototype.onCommandKey=function(v,C,M){return this.keyBinding.onCommandKey(v,C,M)},b.prototype.setOverwrite=function(v){this.session.setOverwrite(v)},b.prototype.getOverwrite=function(){return this.session.getOverwrite()},b.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},b.prototype.setScrollSpeed=function(v){this.setOption("scrollSpeed",v)},b.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},b.prototype.setDragDelay=function(v){this.setOption("dragDelay",v)},b.prototype.getDragDelay=function(){return this.getOption("dragDelay")},b.prototype.setSelectionStyle=function(v){this.setOption("selectionStyle",v)},b.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},b.prototype.setHighlightActiveLine=function(v){this.setOption("highlightActiveLine",v)},b.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},b.prototype.setHighlightGutterLine=function(v){this.setOption("highlightGutterLine",v)},b.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},b.prototype.setHighlightSelectedWord=function(v){this.setOption("highlightSelectedWord",v)},b.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},b.prototype.setAnimatedScroll=function(v){this.renderer.setAnimatedScroll(v)},b.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},b.prototype.setShowInvisibles=function(v){this.renderer.setShowInvisibles(v)},b.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},b.prototype.setDisplayIndentGuides=function(v){this.renderer.setDisplayIndentGuides(v)},b.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},b.prototype.setHighlightIndentGuides=function(v){this.renderer.setHighlightIndentGuides(v)},b.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},b.prototype.setShowPrintMargin=function(v){this.renderer.setShowPrintMargin(v)},b.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},b.prototype.setPrintMarginColumn=function(v){this.renderer.setPrintMarginColumn(v)},b.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},b.prototype.setReadOnly=function(v){this.setOption("readOnly",v)},b.prototype.getReadOnly=function(){return this.getOption("readOnly")},b.prototype.setBehavioursEnabled=function(v){this.setOption("behavioursEnabled",v)},b.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},b.prototype.setWrapBehavioursEnabled=function(v){this.setOption("wrapBehavioursEnabled",v)},b.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},b.prototype.setShowFoldWidgets=function(v){this.setOption("showFoldWidgets",v)},b.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},b.prototype.setFadeFoldWidgets=function(v){this.setOption("fadeFoldWidgets",v)},b.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},b.prototype.remove=function(v){this.selection.isEmpty()&&(v=="left"?this.selection.selectLeft():this.selection.selectRight());var C=this.getSelectionRange();if(this.getBehavioursEnabled()){var M=this.session,T=M.getState(C.start.row),k=M.getMode().transformAction(T,"deletion",this,M,C);if(C.end.column===0){var O=M.getTextRange(C);if(O[O.length-1]==`
|
|
1369
|
+
`){var I=M.getLine(C.end.row);/^\s+$/.test(I)&&(C.end.column=I.length)}}k&&(C=k)}this.session.remove(C),this.clearSelection()},b.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},b.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},b.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},b.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()},b.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var v=this.getCursorPosition();this.insert(`
|
|
1370
|
+
`),this.moveCursorToPosition(v)},b.prototype.setGhostText=function(v,C){this.renderer.setGhostText(v,C)},b.prototype.removeGhostText=function(){this.renderer.removeGhostText()},b.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var v=this.getCursorPosition(),C=v.column;if(C!==0){var M=this.session.getLine(v.row),T,k;C<M.length?(T=M.charAt(C)+M.charAt(C-1),k=new h(v.row,C-1,v.row,C+1)):(T=M.charAt(C-1)+M.charAt(C-2),k=new h(v.row,C-2,v.row,C)),this.session.replace(k,T),this.session.selection.moveToPosition(k.end)}}},b.prototype.toLowerCase=function(){var v=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var C=this.getSelectionRange(),M=this.session.getTextRange(C);this.session.replace(C,M.toLowerCase()),this.selection.setSelectionRange(v)},b.prototype.toUpperCase=function(){var v=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var C=this.getSelectionRange(),M=this.session.getTextRange(C);this.session.replace(C,M.toUpperCase()),this.selection.setSelectionRange(v)},b.prototype.indent=function(){var v=this.session,C=this.getSelectionRange();if(C.start.row<C.end.row){var M=this.$getSelectedRows();v.indentRows(M.first,M.last," ");return}else if(C.start.column<C.end.column){var T=v.getTextRange(C);if(!/^\s+$/.test(T)){var M=this.$getSelectedRows();v.indentRows(M.first,M.last," ");return}}var k=v.getLine(C.start.row),O=C.start,I=v.getTabSize(),N=v.documentToScreenColumn(O.row,O.column);if(this.session.getUseSoftTabs())var P=I-N%I,B=c.stringRepeat(" ",P);else{for(var P=N%I;k[C.start.column-1]==" "&&P;)C.start.column--,P--;this.selection.setSelectionRange(C),B=" "}return this.insert(B)},b.prototype.blockIndent=function(){var v=this.$getSelectedRows();this.session.indentRows(v.first,v.last," ")},b.prototype.blockOutdent=function(){var v=this.session.getSelection();this.session.outdentRows(v.getRange())},b.prototype.sortLines=function(){for(var v=this.$getSelectedRows(),C=this.session,M=[],T=v.first;T<=v.last;T++)M.push(C.getLine(T));M.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),T=v.first;T<=v.last;T++){var O=C.getLine(T);k.start.row=T,k.end.row=T,k.end.column=O.length,C.replace(k,M[T-v.first])}},b.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)},b.prototype.toggleBlockComment=function(){var v=this.getCursorPosition(),C=this.session.getState(v.row),M=this.getSelectionRange();this.session.getMode().toggleBlockComment(C,this.session,M,v)},b.prototype.getNumberAt=function(v,C){var M=/[\-]?[0-9]+(?:\.[0-9]+)?/g;M.lastIndex=0;for(var T=this.session.getLine(v);M.lastIndex<C;){var k=M.exec(T);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},b.prototype.modifyNumber=function(v){var C=this.selection.getCursor().row,M=this.selection.getCursor().column,T=new h(C,M-1,C,M),k=this.session.getTextRange(T);if(!isNaN(parseFloat(k))&&isFinite(k)){var O=this.getNumberAt(C,M);if(O){var I=O.value.indexOf(".")>=0?O.start+O.value.indexOf(".")+1:O.end,N=O.start+O.value.length-I,P=parseFloat(O.value);P*=Math.pow(10,N),I!==O.end&&M<I?v*=Math.pow(10,O.end-M-1):v*=Math.pow(10,O.end-M),P+=v,P/=Math.pow(10,N);var B=P.toFixed(N),F=new h(C,O.start,C,O.end);this.session.replace(F,B),this.moveCursorTo(C,Math.max(O.start+1,M+B.length-O.value.length))}}else this.toggleWord()},b.prototype.toggleWord=function(){var v=this.selection.getCursor().row,C=this.selection.getCursor().column;this.selection.selectWord();var M=this.getSelectedText(),T=this.selection.getWordRange().start.column,k=M.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),O=C-T-1;O<0&&(O=0);var I=0,N=0,P=this;M.match(/[A-Za-z0-9_]+/)&&k.forEach(function(G,Q){N=I+G.length,O>=I&&O<=N&&(M=G,P.selection.clearSelection(),P.moveCursorTo(v,I+T),P.selection.selectTo(v,N+T)),I=N});for(var B=this.$toggleWordPairs,F,H=0;H<B.length;H++)for(var z=B[H],W=0;W<=1;W++){var U=+!W,K=M.match(new RegExp("^\\s?_?("+c.escapeRegExp(z[W])+")\\s?$","i"));if(K){var Y=M.match(new RegExp("([_]|^|\\s)("+c.escapeRegExp(K[1])+")($|\\s)","g"));Y&&(F=M.replace(new RegExp(c.escapeRegExp(z[W]),"i"),function(G){var Q=z[U];return G.toUpperCase()==G?Q=Q.toUpperCase():G.charAt(0).toUpperCase()==G.charAt(0)&&(Q=Q.substr(0,0)+z[U].charAt(0).toUpperCase()+Q.substr(1)),Q}),this.insert(F),F="")}}},b.prototype.findLinkAt=function(v,C){var M,T,k=this.session.getLine(v),O=k.split(/((?:https?|ftp):\/\/[\S]+)/),I=C;I<0&&(I=0);var N=0,P=0,B;try{for(var F=d(O),H=F.next();!H.done;H=F.next()){var z=H.value;if(P=N+z.length,I>=N&&I<=P&&z.match(/((?:https?|ftp):\/\/[\S]+)/)){B=z.replace(/[\s:.,'";}\]]+$/,"");break}N=P}}catch(W){M={error:W}}finally{try{H&&!H.done&&(T=F.return)&&T.call(F)}finally{if(M)throw M.error}}return B},b.prototype.openLink=function(){var v=this.selection.getCursor(),C=this.findLinkAt(v.row,v.column);return C&&window.open(C,"_blank"),C!=null},b.prototype.removeLines=function(){var v=this.$getSelectedRows();this.session.removeFullLines(v.first,v.last),this.clearSelection()},b.prototype.duplicateSelection=function(){var v=this.selection,C=this.session,M=v.getRange(),T=v.isBackwards();if(M.isEmpty()){var k=M.start.row;C.duplicateLines(k,k)}else{var O=T?M.start:M.end,I=C.insert(O,C.getTextRange(M));M.start=O,M.end=I,v.setSelectionRange(M,T)}},b.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},b.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},b.prototype.moveText=function(v,C,M){return this.session.moveText(v,C,M)},b.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},b.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},b.prototype.$moveLines=function(v,C){var M,T,k=this.selection;if(!k.inMultiSelectMode||this.inVirtualSelectionMode){var O=k.toOrientedRange();M=this.$getSelectedRows(O),T=this.session.$moveLines(M.first,M.last,C?0:v),C&&v==-1&&(T=0),O.moveBy(T,0),k.fromOrientedRange(O)}else{var I=k.rangeList.ranges;k.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var N=0,P=0,B=I.length,F=0;F<B;F++){var H=F;I[F].moveBy(N,0),M=this.$getSelectedRows(I[F]);for(var z=M.first,W=M.last;++F<B;){P&&I[F].moveBy(P,0);var U=this.$getSelectedRows(I[F]);if(C&&U.first!=W)break;if(!C&&U.first>W+1)break;W=U.last}for(F--,N=this.session.$moveLines(z,W,C?0:v),C&&v==-1&&(H=F+1);H<=F;)I[H].moveBy(N,0),H++;C||(N=0),P+=N}k.fromOrientedRange(k.ranges[0]),k.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},b.prototype.$getSelectedRows=function(v){return v=(v||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(v.start.row),last:this.session.getRowFoldEnd(v.end.row)}},b.prototype.onCompositionStart=function(v){this.renderer.showComposition(v)},b.prototype.onCompositionUpdate=function(v){this.renderer.setCompositionText(v)},b.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},b.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},b.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},b.prototype.isRowVisible=function(v){return v>=this.getFirstVisibleRow()&&v<=this.getLastVisibleRow()},b.prototype.isRowFullyVisible=function(v){return v>=this.renderer.getFirstFullyVisibleRow()&&v<=this.renderer.getLastFullyVisibleRow()},b.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},b.prototype.$moveByPage=function(v,C){var M=this.renderer,T=this.renderer.layerConfig,k=v*Math.floor(T.height/T.lineHeight);C===!0?this.selection.$moveSelection(function(){this.moveCursorBy(k,0)}):C===!1&&(this.selection.moveCursorBy(k,0),this.selection.clearSelection());var O=M.scrollTop;M.scrollBy(0,k*T.lineHeight),C!=null&&M.scrollCursorIntoView(null,.5),M.animateScrolling(O)},b.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},b.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},b.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},b.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},b.prototype.scrollPageDown=function(){this.$moveByPage(1)},b.prototype.scrollPageUp=function(){this.$moveByPage(-1)},b.prototype.scrollToRow=function(v){this.renderer.scrollToRow(v)},b.prototype.scrollToLine=function(v,C,M,T){this.renderer.scrollToLine(v,C,M,T)},b.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)},b.prototype.getCursorPosition=function(){return this.selection.getCursor()},b.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},b.prototype.getSelectionRange=function(){return this.selection.getRange()},b.prototype.selectAll=function(){this.selection.selectAll()},b.prototype.clearSelection=function(){this.selection.clearSelection()},b.prototype.moveCursorTo=function(v,C){this.selection.moveCursorTo(v,C)},b.prototype.moveCursorToPosition=function(v){this.selection.moveCursorToPosition(v)},b.prototype.jumpToMatching=function(v,C){var M=this.getCursorPosition(),T=new A(this.session,M.row,M.column),k=T.getCurrentToken(),O=0;k&&k.type.indexOf("tag-name")!==-1&&(k=T.stepBackward());var I=k||T.stepForward();if(I){var N,P=!1,B={},F=M.column-I.start,H,z={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(I.value.match(/[{}()\[\]]/g)){for(;F<I.value.length&&!P;F++)if(z[I.value[F]])switch(H=z[I.value[F]]+"."+I.type.replace("rparen","lparen"),isNaN(B[H])&&(B[H]=0),I.value[F]){case"(":case"[":case"{":B[H]++;break;case")":case"]":case"}":B[H]--,B[H]===-1&&(N="bracket",P=!0);break}}else I.type.indexOf("tag-name")!==-1&&(isNaN(B[I.value])&&(B[I.value]=0),k.value==="<"&&O>1?B[I.value]++:k.value==="</"&&B[I.value]--,B[I.value]===-1&&(N="tag",P=!0));P||(k=I,O++,I=T.stepForward(),F=0)}while(I&&!P);if(N){var W,U;if(N==="bracket")W=this.session.getBracketRange(M),W||(W=new h(T.getCurrentTokenRow(),T.getCurrentTokenColumn()+F-1,T.getCurrentTokenRow(),T.getCurrentTokenColumn()+F-1),U=W.start,(C||U.row===M.row&&Math.abs(U.column-M.column)<2)&&(W=this.session.getBracketRange(U)));else if(N==="tag"){if(!I||I.type.indexOf("tag-name")===-1)return;if(W=new h(T.getCurrentTokenRow(),T.getCurrentTokenColumn()-2,T.getCurrentTokenRow(),T.getCurrentTokenColumn()-2),W.compare(M.row,M.column)===0){var K=this.session.getMatchingTags(M);K&&(K.openTag.contains(M.row,M.column)?(W=K.closeTag,U=W.start):(W=K.openTag,K.closeTag.start.row===M.row&&K.closeTag.start.column===M.column?U=W.end:U=W.start))}U=U||W.start}U=W&&W.cursor||U,U&&(v?W&&C?this.selection.setRange(W):W&&W.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(U.row,U.column):this.selection.moveTo(U.row,U.column))}}},b.prototype.gotoLine=function(v,C,M){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,M)},b.prototype.navigateTo=function(v,C){this.selection.moveTo(v,C)},b.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)},b.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)},b.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()},b.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()},b.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},b.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},b.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},b.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},b.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},b.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},b.prototype.replace=function(v,C){C&&this.$search.set(C);var M=this.$search.find(this.session),T=0;return M&&(this.$tryReplace(M,v)&&(T=1),this.selection.setSelectionRange(M),this.renderer.scrollSelectionIntoView(M.start,M.end)),T},b.prototype.replaceAll=function(v,C){C&&this.$search.set(C);var M=this.$search.findAll(this.session),T=0;if(!M.length)return T;var k=this.getSelectionRange();this.selection.moveTo(0,0);for(var O=M.length-1;O>=0;--O)this.$tryReplace(M[O],v)&&T++;return this.selection.setSelectionRange(k),T},b.prototype.$tryReplace=function(v,C){var M=this.session.getTextRange(v);return C=this.$search.replace(M,C),C!==null?(v.end=this.session.replace(v,C),v):null},b.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},b.prototype.find=function(v,C,M){C||(C={}),typeof v=="string"||v instanceof RegExp?C.needle=v:typeof v=="object"&&g.mixin(C,v);var T=this.selection.getRange();C.needle==null&&(v=this.session.getTextRange(T)||this.$search.$options.needle,v||(T=this.session.getWordRange(T.start.row,T.start.column),v=this.session.getTextRange(T)),this.$search.set({needle:v})),this.$search.set(C),C.start||this.$search.set({start:T});var k=this.$search.find(this.session);if(C.preventScroll)return k;if(k)return this.revealRange(k,M),k;C.backwards?T.start=T.end:T.end=T.start,this.selection.setRange(T)},b.prototype.findNext=function(v,C){this.find({skipCurrent:!0,backwards:!1},v,C)},b.prototype.findPrevious=function(v,C){this.find(v,{skipCurrent:!0,backwards:!0},C)},b.prototype.revealRange=function(v,C){this.session.unfold(v),this.selection.setSelectionRange(v);var M=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(v.start,v.end,.5),C!==!1&&this.renderer.animateScrolling(M)},b.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},b.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},b.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()},b.prototype.setAutoScrollEditorIntoView=function(v){if(v){var C,M=this,T=!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(){T=!0}),I=this.renderer.on("beforeRender",function(){T&&(C=M.renderer.container.getBoundingClientRect())}),N=this.renderer.on("afterRender",function(){if(T&&C&&(M.isFocused()||M.searchBox&&M.searchBox.isFocused())){var P=M.renderer,B=P.$cursorLayer.$pixelPos,F=P.layerConfig,H=B.top-F.offset;B.top>=0&&H+C.top<0?T=!0:B.top<F.height&&B.top+C.top+F.lineHeight>window.innerHeight?T=!1:T=null,T!=null&&(k.style.top=H+"px",k.style.left=B.left+"px",k.style.height=F.lineHeight+"px",k.scrollIntoView(T)),T=C=null}});this.setAutoScrollEditorIntoView=function(P){P||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",O),this.renderer.off("afterRender",N),this.renderer.off("beforeRender",I))}}},b.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)))},b.prototype.prompt=function(v,C,M){var T=this;$.loadModule("ace/ext/prompt",function(k){k.prompt(T,v,C,M)})},b})();_.$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(b){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:b})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(b){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(b){this.textInput.setReadOnly(b),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(b){this.textInput.setCopyWithEmptySelection(b)},initialValue:!1},cursorStyle:{set:function(b){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(b){this.setAutoScrollEditorIntoView(b)}},keyboardHandler:{set:function(b){this.setKeyboardHandler(b)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(b){this.session.setValue(b)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(b){this.setSession(b)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(b){this.renderer.$gutterLayer.setShowLineNumbers(b),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),b&&this.$relativeLineNumbers?D.attach(this):D.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(b){this.$showLineNumbers&&b?D.attach(this):D.detach(this)}},placeholder:{set:function(b){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(b){var v={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(T){T.blur(),T.renderer.scroller.focus()},readOnly:!0},C=function(T){if(T.target==this.renderer.scroller&&T.keyCode===L.enter){T.preventDefault();var k=this.getCursorPosition().row;this.isRowVisible(k)||this.scrollToLine(k,!0,!0),this.focus()}},M;b?(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",E("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",E("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",E("editor.gutter.aria-roledescription","editor")),this.renderer.$gutter.setAttribute("aria-label",E("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),M||(M=new S(this)),M.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),M&&M.removeListener())},initialValue:!1},textInputAriaLabel:{set:function(b){this.$textInputAriaLabel=b},initialValue:""},enableMobileMenu:{set:function(b){this.$enableMobileMenu=b},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 D={getText:function(b,v){return(Math.abs(b.selection.lead.row-v)||v+1+(v<9?"·":""))+""},getWidth:function(b,v,C){return Math.max(v.toString().length,(C.lastRow+1).toString().length,2)*C.characterWidth},update:function(b,v){v.renderer.$loop.schedule(v.renderer.CHANGE_GUTTER)},attach:function(b){b.renderer.$gutterLayer.$renderer=this,b.on("changeSelection",this.update),this.update(null,b)},detach:function(b){b.renderer.$gutterLayer.$renderer==this&&(b.renderer.$gutterLayer.$renderer=null),b.off("changeSelection",this.update),this.update(null,b)}};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,w=this.$annotations[y];w||(w=this.$annotations[y]={text:[],type:[],displayText:[]});var x=h.text,$=h.text,A=h.type;x=x?m.escapeHTML(x):h.html||"",$=$||h.html||"",w.text.indexOf(x)===-1&&(w.text.push(x),w.type.push(A),w.displayText.push($));var S=h.className;S?w.className=S:A==="error"?w.className=" ace_error":A==="security"&&!/\bace_error\b/.test(w.className)?w.className=" ace_security":A==="warning"&&!/\bace_(error|security)\b/.test(w.className)?w.className=" ace_warning":A==="info"&&!w.className?w.className=" ace_info":A==="hint"&&!w.className&&(w.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 w=u.getNextFoldLine(h),x=w?w.start.row:1/0,$=null,A=-1,S=h;;){if(S>x&&(S=w.end.row+1,w=u.getNextFoldLine(S,w),x=w?w.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,w,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,w=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||u.$useWrapMode)&&(w=u.getLength()+y-1);var x=h?h.getWidth(u,w,i):w.toString().length*i.characterWidth,$=this.$padding||this.$computePadding();x+=$.left+$.right,x!==this.gutterWidth&&!isNaN(x)&&(this.gutterWidth=x,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",x))},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 w=this.session.getFoldLine(this.$cursorRow);if(h>0&&w&&w.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 w=this.session.getFoldedRowCount(u.firstRow,i.firstRow-1);w>0;w--)this.$lines.shift();if(y>h)for(var w=this.session.getFoldedRowCount(h+1,y);w>0;w--)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=[],w=u,x=this.session.getNextFoldLine(w),$=x?x.start.row:1/0;w>$&&(w=x.end.row+1,x=this.session.getNextFoldLine(w,x),$=x?x.start.row:1/0),!(w>h);){var A=this.$lines.createCell(w,i,this.session,s);this.$renderCell(A,i,x,w),y.push(A),w++}return y},a.prototype.$renderCell=function(i,u,h,y){var w=i.element,x=this.session,$=w.childNodes[0],A=w.childNodes[1],S=w.childNodes[2],E=S.firstChild,R=x.$firstLineNumber,L=x.$breakpoints,_=x.$decorations,D=x.gutterRenderer||this.$renderer,b=this.$showFoldWidgets&&x.foldWidgets,v=h?h.start.row:Number.MAX_VALUE,C=u.lineHeight+"px",M=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",T=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",k=(D?D.getText(x,y):y+R).toString();if(this.$highlightGutterLine&&(y==this.$cursorRow||h&&y<this.$cursorRow&&y>=v&&this.$cursorRow<=h.end.row)&&(M+="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]&&(M+=L[y]),_[y]&&(M+=_[y]),this.$annotations[y]&&y!==v&&(M+=this.$annotations[y].className),b){var O=b[y];O==null&&(O=b[y]=x.getFoldWidget(y))}if(O){var I="ace_fold-widget ace_"+O,N=O=="start"&&y==v&&y<h.end.row;if(N){I+=" ace_closed";for(var P="",B=!1,F=y+1;F<=h.end.row;F++)if(this.$annotations[F]){if(this.$annotations[F].className===" ace_error"){B=!0,P=" ace_error_fold";break}this.$annotations[F].className===" ace_security"?(B=!0,P=" ace_security_fold"):this.$annotations[F].className===" ace_warning"&&P!==" ace_security_fold"&&(B=!0,P=" ace_warning_fold")}M+=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 H=x.getFoldWidgetRange(y);H?A.setAttribute("aria-label",r("gutter.code-folding.range.aria-label","Toggle code folding, rows $0 through $1",[H.start.row+1,H.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(B&&this.$showFoldedAnnotations){S.className="ace_gutter_annotation",E.className=T,E.className+=P,d.setStyle(E.style,"height",C),d.setStyle(S.style,"display","block"),d.setStyle(S.style,"height",C);var z;switch(P){case" ace_error_fold":z=r("gutter.annotation.aria-label.error","Error, read annotations row $0",[k]);break;case" ace_security_fold":z=r("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[k]);break;case" ace_warning_fold":z=r("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[k]);break}S.setAttribute("aria-label",z),S.setAttribute("tabindex","-1"),S.setAttribute("role","button")}else if(this.$annotations[y]){S.className="ace_gutter_annotation",E.className=T,this.$useSvgGutterIcons?E.className+=this.$annotations[y].className:w.classList.add(this.$annotations[y].className.replace(" ","")),d.setStyle(E.style,"height",C),d.setStyle(S.style,"display","block"),d.setStyle(S.style,"height",C);var z;switch(this.$annotations[y].className){case" ace_error":z=r("gutter.annotation.aria-label.error","Error, read annotations row $0",[k]);break;case" ace_security":z=r("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[k]);break;case" ace_warning":z=r("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[k]);break;case" ace_info":z=r("gutter.annotation.aria-label.info","Info, read annotations row $0",[k]);break;case" ace_hint":z=r("gutter.annotation.aria-label.hint","Suggestion, read annotations row $0",[k]);break}S.setAttribute("aria-label",z),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),w.className!=M&&(w.className=M),d.setStyle(i.element.style,"height",this.$lines.computeLineHeight(y,u,x)+"px"),d.setStyle(i.element.style,"top",this.$lines.computeLineTop(y,u,x)+"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,w=h,x=0,$=0,A=u.getScreenLastRowColumn(w),S=new d(w,o.start.column,w,$);w<=y;w++)S.start.row=S.end.row=w,S.start.column=w==h?o.start.column:u.getRowWrapIndent(w),S.end.column=A,x=$,$=A,A=w+1<y?u.getScreenLastRowColumn(w+1):w==y?0:o.end.column,this.drawSingleLineMarker(r,S,s+(w==h?" ace_start":"")+" ace_br"+c(w==h||w==h+1&&o.start.column,x<$,$>A,w==y),a,w==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),w=u+o.start.column*a.characterWidth;if(i=i||"",this.session.$bidiHandler.isBidiRow(o.start.row)){var x=o.clone();x.end.row=x.start.row,x.end.column=this.session.getLine(x.start.row).length,this.drawBidiSingleLineMarker(r,x,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:"+w+"px;"+(i||""));if(this.session.$bidiHandler.isBidiRow(o.end.row)){var x=o.clone();x.start.row=x.end.row,x.start.column=0,this.drawBidiSingleLineMarker(r,x,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,w=this.$getTop(o.start.row,a),x=this.$padding+o.start.column*a.characterWidth;this.elt(s,"height:"+h+"px;width:"+y+"px;top:"+w+"px;left:"+x+"px;"+(u||""))},f.prototype.drawBidiSingleLineMarker=function(r,o,s,a,i,u){var h=a.lineHeight,y=this.$getTop(o.start.row,a),w=this.$padding,x=this.session.$bidiHandler.getSelections(o.start.column,o.end.column);x.forEach(function($){this.elt(s,"height:"+h+"px;width:"+($.width+(i||0))+"px;top:"+y+"px;left:"+(w+$.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 w="ace_indent-guide",x=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=w+x,y.textContent=$,this.$tabStrings[" "]=y;var y=this.dom.createElement("span");y.className=w+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),w=Math.min(h,i.lastRow),x=this.element.childNodes,$=0,S=i.firstRow;S<y;S++){var E=this.session.getFoldLine(S);if(E)if(E.containsRow(y)){y=E.start.row;break}else S=E.end.row;$++}for(var A=!1,S=y,E=this.session.getNextFoldLine(S),R=E?E.start.row:1/0;S>R&&(S=E.end.row+1,E=this.session.getNextFoldLine(S,E),R=E?E.start.row:1/0),!(S>w);){var L=x[$++];if(L){this.dom.removeChildren(L),this.$renderLine(L,S,S==R?E:!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 D=this.$lines.cells[$++];D.element.style.top=this.$lines.computeLineTop(D.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 w=this.session.getFoldedRowCount(u.firstRow,i.firstRow-1);w>0;w--)this.$lines.shift();if(u.lastRow>i.lastRow)for(var w=this.session.getFoldedRowCount(i.lastRow+1,u.lastRow);w>0;w--)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=[],w=u,x=this.session.getNextFoldLine(w),$=x?x.start.row:1/0;w>$&&(w=x.end.row+1,x=this.session.getNextFoldLine(w,x),$=x?x.start.row:1/0),!(w>h);){var A=this.$lines.createCell(w,i,this.session),S=A.element;this.dom.removeChildren(S),g.setStyle(S.style,"height",this.$lines.computeLineHeight(w,i,this.session)+"px"),g.setStyle(S.style,"top",this.$lines.computeLineTop(w,i,this.session)+"px"),this.$renderLine(S,w,w==$?x:!1),this.$useLineGroups()?S.className="ace_line_group":S.className="ace_line",y.push(A),w++}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 w=this,x=/(\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=x.exec(y);){var E=A[1],R=A[2],L=A[3],_=A[4],D=A[5];if(!(!w.showSpaces&&R)){var b=S!=A.index?y.slice(S,A.index):"";if(S=A.index+A[0].length,b&&$.appendChild(this.dom.createTextNode(b,this.element)),E){var v=w.session.getScreenTabSize(u+A.index);$.appendChild(w.$tabStrings[v].cloneNode(!0)),u+=v-1}else if(R)if(w.showSpaces){var C=this.dom.createElement("span");C.className="ace_invisible ace_invisible_space",C.textContent=m.stringRepeat(w.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(w.SPACE_CHAR,L.length),$.appendChild(C)}else if(_){u+=1;var C=this.dom.createElement("span");C.style.width=w.config.characterWidth*2+"px",C.className=w.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",C.textContent=w.showSpaces?w.SPACE_CHAR:_,$.appendChild(C)}else if(D){u+=1;var C=this.dom.createElement("span");C.style.width=w.config.characterWidth*2+"px",C.className="ace_cjk",C.textContent=D,$.appendChild(C)}}}if($.appendChild(this.dom.createTextNode(S?y.slice(S):y,this.element)),o(h.type))i.appendChild($);else{var M="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=M,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 w=y/this.tabSize,x=0;x<w;x++)i.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),u.substr(y)}else if(u[0]==" "){for(var x=0;x<y;x++)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 w=this.session.$bracketHighlight;if(w){for(var x=this.session.$bracketHighlight.ranges,$=0;$<x.length;$++)if(u.row!==x[$].start.row){this.$highlightIndentGuideMarker.end=x[$].start.row,u.row>x[$].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 w=0;w<y.length;w++)if(y[w].classList&&y[w].classList.contains("ace_indent-guide-active")){y[w].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 w=y[u-1];w&&w.classList&&w.classList.contains("ace_indent-guide")&&w.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,w=0,x=h[0],$=0,A=this.$createLineElement();i.appendChild(A);for(var S=0;S<u.length;S++){var E=u[S],R=E.value;if(S==0&&this.displayIndentGuides){if(y=R.length,R=this.renderIndentGuide(A,R,x),!R)continue;y-=R.length}if(y+R.length<x)$=this.$renderToken(A,$,E,R),y+=R.length;else{for(;y+R.length>=x;)$=this.$renderToken(A,$,E,R.substring(0,x-y)),R=R.substring(x-y),y=x,A=this.$createLineElement(),i.appendChild(A),A.appendChild(this.dom.createTextNode(m.stringRepeat(" ",h.indent),this.element)),w++,$=0,x=h[w]||Number.MAX_VALUE;R.length!=0&&(y+=R.length,$=this.$renderToken(A,$,E,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 w=u[y],x=w.value;if(!(y==0&&this.displayIndentGuides&&(x=this.renderIndentGuide(i,x),!x))){if(h+x.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(i,h,w,x);h=this.$renderToken(i,h,w,x)}}},a.prototype.$renderOverflowMessage=function(i,u,h,y,w){h&&this.$renderToken(i,u,h,y.slice(0,this.MAX_LINE_LENGTH-u));var x=this.dom.createElement("span");x.className="ace_inline_button ace_keyword ace_toggle_wrap",x.textContent=w?"<hide>":"<click to see more...>",i.appendChild(x)},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 w=i;if(y.length){var x=this.session.getRowSplitData(u);if(x&&x.length){this.$renderWrappedLine(i,y,x);var w=i.lastChild}else{var w=i;this.$useLineGroups()&&(w=this.$createLineElement(),i.appendChild(w)),this.$renderSimpleLine(w,y)}}else this.$useLineGroups()&&(w=this.$createLineElement(),i.appendChild(w));if(this.showEOL&&w){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,w.appendChild($)}},a.prototype.$getFoldLineTokens=function(i,u){var h=this.session,y=[];function w($,A,S){for(var E=0,R=0;R+$[E].value.length<A;)if(R+=$[E].value.length,E++,E==$.length)return;if(R!=A){var L=$[E].value.substring(A-R);L.length>S-A&&(L=L.substring(0,S-A)),y.push({type:$[E].type,value:L}),R=A+L.length,E+=1}for(;R<S&&E<$.length;){var L=$[E].value;L.length+R>S?y.push({type:$[E].type,value:L.substring(0,S-R)}):y.push($[E]),R+=L.length,E+=1}}var x=h.getTokens(i);return u.walk(function($,A,S,E,R){$!=null?y.push({type:"fold",value:$}):(R&&(x=h.getTokens(A)),x.length&&w(x,E,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,w){y.__proto__=w}||function(y,w){for(var x in w)Object.prototype.hasOwnProperty.call(w,x)&&(y[x]=w[x])},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 w=i.call(this,h,"-v")||this;return w.scrollTop=0,w.scrollHeight=0,y.$scrollbarWidth=w.width=m.scrollbarWidth(h.ownerDocument),w.inner.style.width=w.element.style.width=(w.width||15)+5+"px",w.$minWidth=0,w}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 w=i.call(this,h,"-h")||this;return w.scrollLeft=0,w.height=y.$scrollbarWidth,w.inner.style.height=w.element.style.height=(w.height||15)+5+"px",w}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 w in y)Object.prototype.hasOwnProperty.call(y,w)&&(h[w]=y[w])},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,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,
|
|
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,w=h.clientY,x=function(_){w=_.clientY},$=function(){clearInterval(R)},A=h.clientY,S=this.thumbTop,E=function(){if(w!==void 0){var _=y.scrollTopFromThumbTop(S+w-A);_!==y.scrollTop&&y._emit("scroll",{data:_})}};c.capture(this.inner,x,$);var R=setInterval(E,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,w=h.clientX,x=function(_){w=_.clientX},$=function(){clearInterval(R)},A=h.clientX,S=this.thumbLeft,E=function(){if(w!==void 0){var _=y.scrollLeftFromThumbLeft(S+w-A);_!==y.scrollLeft&&y._emit("scroll",{data:_})}};c.capture(this.inner,x,$);var R=setInterval(E,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,w){return["div",{style:"position: absolute;top:"+y+"px;left:"+w+"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 w=this.$getZoom(this.el);h=S(1/w,h)}function x(N,P,B){var F=N[1]*P[0]-N[0]*P[1];return[(-P[1]*B[0]+P[0]*B[1])/F,(+N[1]*B[0]-N[0]*B[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 E(N){var P=N.getBoundingClientRect();return[P.left,P.top]}var R=E(this.els[0]),L=E(this.els[1]),_=E(this.els[2]),D=E(this.els[3]),b=x($(D,L),$(D,_),$(A(L,_),A(D,R))),v=S(1+b[0],$(L,R)),C=S(1+b[1],$(_,R));if(y){var M=y,T=b[0]*M[0]/a+b[1]*M[1]/a+1,k=A(S(M[0],v),S(M[1],C));return A(S(1/T/a,k),R)}var O=$(h,R),I=x($(v,S(b[0],O)),$(C,S(b[1],O)),O);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,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(D,w){return D.priority<w.priority?-1:D.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(D){D.priority=h[D.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(_,D){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(D),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(_,D,w){if(D===void 0&&(D=1/0),this.$changedLines?(this.$changedLines.firstRow>_&&(this.$changedLines.firstRow=_),this.$changedLines.lastRow<D&&(this.$changedLines.lastRow=D)):this.$changedLines={firstRow:_,lastRow:D},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(_,D,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(_,D,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(_,D,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,D==null&&(D=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=D,g.setStyle(this.scrollBarH.element.style,"left",D+"px"),g.setStyle(this.scroller.style,"left",D+this.margin.left+"px"),E.scrollerWidth=Math.max(0,w-D-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 D=this.$showGutter?_:0;D!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,D,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,D=Math.floor(_/this.characterWidth);return this.session.adjustWrapLimit(D,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 D=this.$printMarginEl.style;D.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",D.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,D=this.$composition;if(!this.$keepTextAreaAtCursor&&!D){g.translate(this.textarea,-100,0);return}var w=this.$cursorLayer.$pixelPos;if(w){D&&D.markerRange&&(w=this.$cursorLayer.getPixelPosition(D.markerRange.start,!0));var v=this.layerConfig,C=w.top,E=w.left;C-=v.offset;var x=D&&D.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(!D)C+=this.lineHeight;else if(D.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,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,D=_.lastRow,w=this.session.documentToScreenRow(D,0)*_.lineHeight;return w-this.session.getScrollTop()>_.height-_.lineHeight?D-1:D},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(_,D,w,v){var C=this.scrollMargin;C.top=_|0,C.bottom=D|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(_,D,w,v){var C=this.margin;C.top=_|0,C.bottom=D|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,D=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(_-=(D-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>_-D&&(_=this.scrollTop+D,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(_,D){if(this.$changes&&(_|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!_&&!D){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,D=this.$maxLines*this.lineHeight,w=Math.min(D,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&&_>D;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,D=this.$size,w=D.height<=2*this.lineHeight,v=this.session.getScreenLength(),C=v*this.lineHeight,E=this.$getLongestLine(),x=!w&&(this.$hScrollBarAlwaysVisible||D.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 I=D.scrollerHeight+this.lineHeight,N=!this.$maxLines&&this.$scrollPastEnd?(D.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;C+=N;var P=this.scrollMargin;this.session.setScrollTop(Math.max(-P.top,Math.min(this.scrollTop,C-D.scrollerHeight+P.bottom))),this.session.setScrollLeft(Math.max(-P.left,Math.min(this.scrollLeft,E+2*this.$padding-D.scrollerWidth+P.right)));var z=!w&&(this.$vScrollBarAlwaysVisible||D.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(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=D.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,D.width,D.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+D.height-D.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,D=this.$changedLines.lastRow;this.$changedLines=null;var w=this.layerConfig;if(!(_>w.lastRow+1)&&!(D<w.firstRow)){if(D===1/0){this.$showGutter&&this.$gutterLayer.update(w),this.$textLayer.update(w);return}return this.$textLayer.updateLines(w,_,D),!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(_,D){this.$gutterLayer.addGutterDecoration(_,D)},L.prototype.removeGutterDecoration=function(_,D){this.$gutterLayer.removeGutterDecoration(_,D)},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(_,D,w){this.scrollCursorIntoView(_,w),this.scrollCursorIntoView(D,w)},L.prototype.scrollCursorIntoView=function(_,D,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?(D&&O+x>E+this.lineHeight&&(E-=D*this.$size.scrollerHeight),E===0&&(E=-this.scrollMargin.top),this.session.setScrollTop(E)):O+this.$size.scrollerHeight-k<E+this.lineHeight&&(D&&O+this.$size.scrollerHeight-k<E-this.lineHeight&&(E+=D*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(_,D){typeof _=="number"&&(_={row:_,column:0});var w=this.$cursorLayer.getPixelPosition(_),v=this.$size.scrollerHeight-this.lineHeight,C=w.top-v*(D||0);return this.session.setScrollTop(C),C},L.prototype.$calcSteps=function(_,D){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,_,D-_));return C},L.prototype.scrollToLine=function(_,D,w,v){var C=this.$cursorLayer.getPixelPosition({row:_,column:0}),E=C.top;D&&(E-=this.$size.scrollerHeight/2);var x=this.scrollTop;this.session.setScrollTop(E),w!==!1&&this.animateScrolling(x,v)},L.prototype.animateScrolling=function(_,D){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,D&&D()}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(_,D){this.session.setScrollTop(D),this.session.setScrollLeft(_)},L.prototype.scrollBy=function(_,D){D&&this.session.setScrollTop(this.session.getScrollTop()+D),_&&this.session.setScrollLeft(this.session.getScrollLeft()+_)},L.prototype.isScrollableBy=function(_,D){if(D<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||D>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(_,D){var w;if(this.$hasCssTransforms){w={top:0,left:0};var v=this.$fontMetrics.transformCoordinates([_,D]);_=v[1]-this.gutterWidth-this.margin.left,D=v[0]}else w=this.scroller.getBoundingClientRect();var C=_+this.scrollLeft-w.left-this.$padding,E=C/this.characterWidth,x=Math.floor((D+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(_,D){var w;if(this.$hasCssTransforms){w={top:0,left:0};var v=this.$fontMetrics.transformCoordinates([_,D]);_=v[1]-this.gutterWidth-this.margin.left,D=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((D+this.scrollTop-w.top)/this.lineHeight);return this.session.screenToDocumentPosition(k,Math.max(x,0),C)},L.prototype.textToScreenCoordinates=function(_,D){var w=this.scroller.getBoundingClientRect(),v=this.session.documentToScreenPosition(_,D),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 D=this.session.selection.cursor;this.addToken(_,"composition_placeholder",D.row,D.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(_,D){var w=this.session.selection.cursor,v=D||{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),I=this.container,N=I.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(_,D){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],D.column),O=this.session.$computeWrapSplits(k,v,this.session.$tabSize);if(O.length>0){var I=0;O.push(C[x].length);for(var N=0;N<O.length;N++){var P=C[x].slice(I,O[N]);E.push({text:P,wrapped:!0}),I=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(_,D,w,v){var C=this.session;C.bgTokenizer.lines[w]=null;var E={type:D,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 I=x[O];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(O,1,{type:I.type,value:P},E,{type:I.type,value:z});break}}this.updateLines(w,w)},L.prototype.hideTokensAfterPosition=function(_,D){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===D&&(C=!0)}}return this.updateLines(_,_),E},L.prototype.removeExtraToken=function(_,D){this.session.bgTokenizer.lines[_]=null,this.updateLines(_,_)},L.prototype.setTheme=function(_,D){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 D&&D();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}),D&&D(),S.isSafari&&w.scroller&&(w.scroller.style.background="red",w.scroller.style.background="")}},L.prototype.getTheme=function(){return this.$themeId},L.prototype.setStyle=function(_,D){g.setCssClass(this.container,_,D!==!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 D=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){D.$scrollAnimation||D.session.setScrollTop(w.data-D.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(w){D.$scrollAnimation||D.session.setScrollLeft(w.data-D.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){D.$scrollAnimation||D.session.setScrollTop(w.data-D.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(w){D.$scrollAnimation||D.session.setScrollLeft(w.data-D.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(D){var w=D[0].contentRect.width,v=D[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),D=_,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(D,P)&&m(z,y.lead)||(D=P,h.selection.moveToPosition(z),h.renderer.scrollCursorIntoView(),h.removeSelectionMarkers(x),x=y.rectangularRangeBlock(D,_),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),D={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},I=k;d.capture(h.container,R,O);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,D=$.offsetX,w=A.offsetX;else var L=A.column,_=$.column,D=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,D),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 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,D=_.rangeList,w=(M?_:D).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 D=L;else var _=this.session.documentToScreenPosition(M?S.end:S.start),D=this.session.screenToDocumentPosition(_.row+$,_.column);if(M){var w=g.fromPoints(L,D);w.cursor=w.start}else{var w=g.fromPoints(D,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 D=[],R=M.length;R--;){var L=M[R];D.unshift(A.getTextRange(L))}$<0?D.unshift(D.pop()):D.push(D.shift());for(var R=M.length;R--;){var L=M[R],w=L.clone();A.replace(L,D[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),D=i(M,_,$);D&&(D.cursor=$==-1?D.start:D.end,this.session.unfold(D),this.multiSelect.addRange(D),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,D=L.end.row,w=_==D;if(w){var v=this.session.getLength(),C;do C=this.session.getLine(D);while(/[=:]/.test(C)&&++D<v);do C=this.session.getLine(_);while(/[=:]/.test(C)&&--_>0);_<0&&(_=0),D>=v&&(D=v-1)}var E=this.session.removeFullLines(_,D);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(D,b){return D.priority<b.priority?-1:D.priority>b.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(D){D.priority=h[D.type]||null}),u=u.sort(i);for(var y=this.renderer.session.$foldData,w=0;w<u.length;w++){var x=u[w].row,$=this.compensateFoldRows(x,y),A=Math.round((x-$)*this.lineHeight*this.heightRatio),S=Math.round((x-$)*this.lineHeight*this.heightRatio),E=Math.round(((x-$)*this.lineHeight+this.lineHeight)*this.heightRatio),R=E-S;if(R<this.minDecorationHeight){var L=(S+E)/2|0;L<this.halfMinDecorationHeight?L=this.halfMinDecorationHeight:L+this.halfMinDecorationHeight>this.canvasHeight&&(L=this.canvasHeight-this.halfMinDecorationHeight),S=Math.round(L-this.halfMinDecorationHeight),E=Math.round(L+this.halfMinDecorationHeight)}a.fillStyle=o[u[w].type]||null,a.fillRect(0,A,this.canvasWidth,E-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,w=t("./layer/font_metrics").FontMetrics,x=t("./lib/event_emitter").EventEmitter,$=t("./css/editor-css"),A=t("./layer/decorators").Decorator,S=t("./lib/useragent"),E=t("./layer/text_util").isTextToken;g.importCssString($,"ace_editor.css",!1);var R=(function(){function L(_,D){var b=this;this.container=_||g.createElement("div"),g.addCssClass(this.container,"ace_editor"),g.HI_DPI&&g.addCssClass(this.container,"ace_hidpi"),this.setTheme(D),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){b.$scrollAnimation||b.session.setScrollTop(C.data-b.scrollMargin.top)}),this.scrollBarH.on("scroll",function(C){b.$scrollAnimation||b.session.setScrollLeft(C.data-b.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new w(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",function(C){b.updateCharacterSize(),b.onResize(!0,b.gutterWidth,b.$size.width,b.$size.height),b._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(_,D,b){if(D===void 0&&(D=1/0),this.$changedLines?(this.$changedLines.firstRow>_&&(this.$changedLines.firstRow=_),this.$changedLines.lastRow<D&&(this.$changedLines.lastRow=D)):this.$changedLines={firstRow:_,lastRow:D},this.$changedLines.lastRow<this.layerConfig.firstRow)if(b)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(_,D,b,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),b||(b=C.clientWidth||C.scrollWidth);var M=this.$updateCachedSize(_,D,b,v);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!b&&!v)return this.resizing=0;_&&(this.$gutterLayer.$padding=null),_?this.$renderChanges(M|this.$changes,!0):this.$loop.schedule(M|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},L.prototype.$updateCachedSize=function(_,D,b,v){v-=this.$extraHeight||0;var C=0,M=this.$size,T={width:M.width,height:M.height,scrollerHeight:M.scrollerHeight,scrollerWidth:M.scrollerWidth};if(v&&(_||M.height!=v)&&(M.height=v,C|=this.CHANGE_SIZE,M.scrollerHeight=M.height,this.$horizScroll&&(M.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(M.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",C=C|this.CHANGE_SCROLL),b&&(_||M.width!=b)){C|=this.CHANGE_SIZE,M.width=b,D==null&&(D=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=D,g.setStyle(this.scrollBarH.element.style,"left",D+"px"),g.setStyle(this.scroller.style,"left",D+this.margin.left+"px"),M.scrollerWidth=Math.max(0,b-D-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(M.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||_)&&(C|=this.CHANGE_FULL)}return M.$dirty=!b||!v,C&&this._signal("resize",T),C},L.prototype.onGutterResize=function(_){var D=this.$showGutter?_:0;D!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,D,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,D=Math.floor(_/this.characterWidth);return this.session.adjustWrapLimit(D,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 D=this.$printMarginEl.style;D.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",D.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,D=this.$composition;if(!this.$keepTextAreaAtCursor&&!D){g.translate(this.textarea,-100,0);return}var b=this.$cursorLayer.$pixelPos;if(b){D&&D.markerRange&&(b=this.$cursorLayer.getPixelPosition(D.markerRange.start,!0));var v=this.layerConfig,C=b.top,M=b.left;C-=v.offset;var T=D&&D.useTextareaForIME||S.isMobile?this.lineHeight:1;if(C<0||C>v.height-T){g.translate(this.textarea,0,0);return}var k=1,O=this.$size.height-T;if(!D)C+=this.lineHeight;else if(D.useTextareaForIME){var I=this.textarea.value;k=this.characterWidth*this.session.$getStringScreenWidth(I)[0]}else C+=this.lineHeight+2;M-=this.scrollLeft,M>this.$size.scrollerWidth-k&&(M=this.$size.scrollerWidth-k),M+=this.gutterWidth+this.margin.left,g.setStyle(_,"height",T+"px"),g.setStyle(_,"width",k+"px"),g.translate(this.textarea,Math.min(M,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,D=_.lastRow,b=this.session.documentToScreenRow(D,0)*_.lineHeight;return b-this.session.getScrollTop()>_.height-_.lineHeight?D-1:D},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(_,D,b,v){var C=this.scrollMargin;C.top=_|0,C.bottom=D|0,C.right=v|0,C.left=b|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(_,D,b,v){var C=this.margin;C.top=_|0,C.bottom=D|0,C.right=v|0,C.left=b|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,D=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(_-=(D-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>_-D&&(_=this.scrollTop+D,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(_,D){if(this.$changes&&(_|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!_&&!D){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 b=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(),b.firstRow!=this.layerConfig.firstRow&&b.firstRowScreen==this.layerConfig.firstRowScreen){var v=this.scrollTop+(b.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;v>0&&(this.scrollTop=v,_=_|this.CHANGE_SCROLL,_|=this.$computeLayerConfig()|this.$loop.clear())}b=this.layerConfig,this.$updateScrollBarV(),_&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),g.translate(this.content,-this.scrollLeft,-b.offset);var C=b.width+2*this.$padding+"px",M=b.minHeight+"px";g.setStyle(this.content.style,"width",C),g.setStyle(this.content.style,"height",M)}if(_&this.CHANGE_H_SCROLL&&(g.translate(this.content,-this.scrollLeft,-b.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(b),this.$showGutter&&this.$gutterLayer.update(b),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(b),this.$markerBack.update(b),this.$markerFront.update(b),this.$cursorLayer.update(b),this.$moveTextAreaToCursor(),this._signal("afterRender",_);return}if(_&this.CHANGE_SCROLL){this.$changedLines=null,_&this.CHANGE_TEXT||_&this.CHANGE_LINES?this.$textLayer.update(b):this.$textLayer.scrollLines(b),this.$showGutter&&(_&this.CHANGE_GUTTER||_&this.CHANGE_LINES?this.$gutterLayer.update(b):this.$gutterLayer.scrollLines(b)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(b),this.$markerBack.update(b),this.$markerFront.update(b),this.$cursorLayer.update(b),this.$moveTextAreaToCursor(),this._signal("afterRender",_);return}_&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(b),this.$showGutter&&this.$gutterLayer.update(b),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(b)):_&this.CHANGE_LINES?((this.$updateLines()||_&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(b),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(b)):_&this.CHANGE_TEXT||_&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(b),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(b)):_&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(b),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(b)),_&this.CHANGE_CURSOR&&(this.$cursorLayer.update(b),this.$moveTextAreaToCursor()),_&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(b),_&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(b),this._signal("afterRender",_)},L.prototype.$autosize=function(){var _=this.session.getScreenLength()*this.lineHeight,D=this.$maxLines*this.lineHeight,b=Math.min(D,Math.max((this.$minLines||1)*this.lineHeight,_))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(b+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&b>this.$maxPixelHeight&&(b=this.$maxPixelHeight);var v=b<=2*this.lineHeight,C=!v&&_>D;if(b!=this.desiredHeight||this.$size.height!=this.desiredHeight||C!=this.$vScroll){C!=this.$vScroll&&(this.$vScroll=C,this.scrollBarV.setVisible(C));var M=this.container.clientWidth;this.container.style.height=b+"px",this.$updateCachedSize(!0,this.$gutterWidth,M,b),this.desiredHeight=b,this._signal("autosize")}},L.prototype.$computeLayerConfig=function(){var _=this.session,D=this.$size,b=D.height<=2*this.lineHeight,v=this.session.getScreenLength(),C=v*this.lineHeight,M=this.$getLongestLine(),T=!b&&(this.$hScrollBarAlwaysVisible||D.scrollerWidth-M-2*this.$padding<0),k=this.$horizScroll!==T;k&&(this.$horizScroll=T,this.scrollBarH.setVisible(T));var O=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var I=D.scrollerHeight+this.lineHeight,N=!this.$maxLines&&this.$scrollPastEnd?(D.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;C+=N;var P=this.scrollMargin;this.session.setScrollTop(Math.max(-P.top,Math.min(this.scrollTop,C-D.scrollerHeight+P.bottom))),this.session.setScrollLeft(Math.max(-P.left,Math.min(this.scrollLeft,M+2*this.$padding-D.scrollerWidth+P.right)));var B=!b&&(this.$vScrollBarAlwaysVisible||D.scrollerHeight-C+N<0||this.scrollTop>P.top),F=O!==B;F&&(this.$vScroll=B,this.scrollBarV.setVisible(B));var H=this.scrollTop%this.lineHeight,z=Math.ceil(I/this.lineHeight)-1,W=Math.max(0,Math.round((this.scrollTop-H)/this.lineHeight)),U=W+z,K,Y,G=this.lineHeight;W=_.screenToDocumentRow(W,0);var Q=_.getFoldLine(W);Q&&(W=Q.start.row),K=_.documentToScreenRow(W,0),Y=_.getRowLength(W)*G,U=Math.min(_.screenToDocumentRow(U,0),_.getLength()-1),I=D.scrollerHeight+_.getRowLength(U)*G+Y,H=this.scrollTop-K*G;var ue=0;return(this.layerConfig.width!=M||k)&&(ue=this.CHANGE_H_SCROLL),(k||F)&&(ue|=this.$updateCachedSize(!0,this.gutterWidth,D.width,D.height),this._signal("scrollbarVisibilityChanged"),F&&(M=this.$getLongestLine())),this.layerConfig={width:M,padding:this.$padding,firstRow:W,firstRowScreen:K,lastRow:U,lineHeight:G,characterWidth:this.characterWidth,minHeight:I,maxHeight:C,offset:H,gutterOffset:G?Math.max(0,Math.ceil((H+D.height-D.scrollerHeight)/G)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(M-this.$padding),ue},L.prototype.$updateLines=function(){if(this.$changedLines){var _=this.$changedLines.firstRow,D=this.$changedLines.lastRow;this.$changedLines=null;var b=this.layerConfig;if(!(_>b.lastRow+1)&&!(D<b.firstRow)){if(D===1/0){this.$showGutter&&this.$gutterLayer.update(b),this.$textLayer.update(b);return}return this.$textLayer.updateLines(b,_,D),!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(_,D){this.$gutterLayer.addGutterDecoration(_,D)},L.prototype.removeGutterDecoration=function(_,D){this.$gutterLayer.removeGutterDecoration(_,D)},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(_,D,b){this.scrollCursorIntoView(_,b),this.scrollCursorIntoView(D,b)},L.prototype.scrollCursorIntoView=function(_,D,b){if(this.$size.scrollerHeight!==0){var v=this.$cursorLayer.getPixelPosition(_),C=v.left,M=v.top,T=b&&b.top||0,k=b&&b.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var O=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;O+T>M?(D&&O+T>M+this.lineHeight&&(M-=D*this.$size.scrollerHeight),M===0&&(M=-this.scrollMargin.top),this.session.setScrollTop(M)):O+this.$size.scrollerHeight-k<M+this.lineHeight&&(D&&O+this.$size.scrollerHeight-k<M-this.lineHeight&&(M+=D*this.$size.scrollerHeight),this.session.setScrollTop(M+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(_,D){typeof _=="number"&&(_={row:_,column:0});var b=this.$cursorLayer.getPixelPosition(_),v=this.$size.scrollerHeight-this.lineHeight,C=b.top-v*(D||0);return this.session.setScrollTop(C),C},L.prototype.$calcSteps=function(_,D){var b=0,v=this.STEPS,C=[],M=function(T,k,O){return O*(Math.pow(T-1,3)+1)+k};for(b=0;b<v;++b)C.push(M(b/this.STEPS,_,D-_));return C},L.prototype.scrollToLine=function(_,D,b,v){var C=this.$cursorLayer.getPixelPosition({row:_,column:0}),M=C.top;D&&(M-=this.$size.scrollerHeight/2);var T=this.scrollTop;this.session.setScrollTop(M),b!==!1&&this.animateScrolling(T,v)},L.prototype.animateScrolling=function(_,D){var b=this.scrollTop;if(!this.$animatedScroll)return;var v=this;if(_==b)return;if(this.$scrollAnimation){var C=this.$scrollAnimation.steps;if(C.length&&(_=C[0],_==b))return}var M=v.$calcSteps(_,b);this.$scrollAnimation={from:_,to:b,steps:M},clearInterval(this.$timer),v.session.setScrollTop(M.shift()),v.session.$scrollTop=b;function T(){v.$timer=clearInterval(v.$timer),v.$scrollAnimation=null,v.$stopAnimation=!1,D&&D()}this.$timer=setInterval(function(){if(v.$stopAnimation){T();return}if(!v.session)return clearInterval(v.$timer);M.length?(v.session.setScrollTop(M.shift()),v.session.$scrollTop=b):b!=null?(v.session.$scrollTop=-1,v.session.setScrollTop(b),b=null):T()},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(_,D){this.session.setScrollTop(D),this.session.setScrollLeft(_)},L.prototype.scrollBy=function(_,D){D&&this.session.setScrollTop(this.session.getScrollTop()+D),_&&this.session.setScrollLeft(this.session.getScrollLeft()+_)},L.prototype.isScrollableBy=function(_,D){if(D<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||D>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(_,D){var b;if(this.$hasCssTransforms){b={top:0,left:0};var v=this.$fontMetrics.transformCoordinates([_,D]);_=v[1]-this.gutterWidth-this.margin.left,D=v[0]}else b=this.scroller.getBoundingClientRect();var C=_+this.scrollLeft-b.left-this.$padding,M=C/this.characterWidth,T=Math.floor((D+this.scrollTop-b.top)/this.lineHeight),k=this.$blockCursor?Math.floor(M):Math.round(M);return{row:T,column:k,side:M-k>0?1:-1,offsetX:C}},L.prototype.screenToTextCoordinates=function(_,D){var b;if(this.$hasCssTransforms){b={top:0,left:0};var v=this.$fontMetrics.transformCoordinates([_,D]);_=v[1]-this.gutterWidth-this.margin.left,D=v[0]}else b=this.scroller.getBoundingClientRect();var C=_+this.scrollLeft-b.left-this.$padding,M=C/this.characterWidth,T=this.$blockCursor?Math.floor(M):Math.round(M),k=Math.floor((D+this.scrollTop-b.top)/this.lineHeight);return this.session.screenToDocumentPosition(k,Math.max(T,0),C)},L.prototype.textToScreenCoordinates=function(_,D){var b=this.scroller.getBoundingClientRect(),v=this.session.documentToScreenPosition(_,D),C=this.$padding+(this.session.$bidiHandler.isBidiRow(v.row,_)?this.session.$bidiHandler.getPosLeft(v.column):Math.round(v.column*this.characterWidth)),M=v.row*this.lineHeight;return{pageX:b.left+C-this.scrollLeft,pageY:b.top+M-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 D=this.session.selection.cursor;this.addToken(_,"composition_placeholder",D.row,D.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(_,D){var b=this.session.selection.cursor,v=D||{row:b.row,column:b.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 M=g.createElement("div");if(C.length>1){var T=this.hideTokensAfterPosition(v.row,v.column),k;C.slice(1).forEach(function(F){var H=g.createElement("div"),z=g.createElement("span");z.className="ace_ghost_text",F.wrapped&&(H.className="ghost_text_line_wrapped"),F.text.length===0&&(F.text=" "),z.appendChild(g.createTextNode(F.text)),H.appendChild(z),M.appendChild(H),k=H}),T.forEach(function(F){var H=g.createElement("span");E(F.type)||(H.className="ace_"+F.type.replace(/\./g," ace_")),H.appendChild(g.createTextNode(F.value)),k.appendChild(H)}),this.$ghostTextWidget={el:M,row:v.row,column:v.column,className:"ace_ghost_text_container"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget);var O=this.$cursorLayer.getPixelPosition(v,!0),I=this.container,N=I.getBoundingClientRect().height,P=C.length*this.lineHeight,B=P<N-O.top;if(B)return;P<N?this.scrollBy(0,(C.length-1)*this.lineHeight):this.scrollToRow(v.row)}},L.prototype.$calculateWrappedTextChunks=function(_,D){var b=this.$size.scrollerWidth-this.$padding*2,v=Math.floor(b/this.characterWidth)-2;v=v<=0?60:v;for(var C=_.split(/\r?\n/),M=[],T=0;T<C.length;T++){var k=this.session.$getDisplayTokens(C[T],D.column),O=this.session.$computeWrapSplits(k,v,this.session.$tabSize);if(O.length>0){var I=0;O.push(C[T].length);for(var N=0;N<O.length;N++){var P=C[T].slice(I,O[N]);M.push({text:P,wrapped:!0}),I=O[N]}}else M.push({text:C[T],wrapped:!1})}return M},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(_,D,b,v){var C=this.session;C.bgTokenizer.lines[b]=null;var M={type:D,value:_},T=C.getTokens(b);if(v==null||!T.length)T.push(M);else for(var k=0,O=0;O<T.length;O++){var I=T[O];if(k+=I.value.length,v<=k){var N=I.value.length-(k-v),P=I.value.slice(0,N),B=I.value.slice(N);T.splice(O,1,{type:I.type,value:P},M,{type:I.type,value:B});break}}this.updateLines(b,b)},L.prototype.hideTokensAfterPosition=function(_,D){for(var b=this.session.getTokens(_),v=0,C=!1,M=[],T=0;T<b.length;T++){var k=b[T];if(v+=k.value.length,k.type!=="ghost_text"){if(C){M.push({type:k.type,value:k.value}),k.type="hidden_token";continue}v===D&&(C=!0)}}return this.updateLines(_,_),M},L.prototype.removeExtraToken=function(_,D){this.session.bgTokenizer.lines[_]=null,this.updateLines(_,_)},L.prototype.setTheme=function(_,D){var b=this;if(this.$themeId=_,b._dispatchEvent("themeChange",{theme:_}),!_||typeof _=="string"){var v=_||this.$options.theme.initialValue;c.loadModule(["theme",v],C)}else C(_);function C(M){if(b.$themeId!=_)return D&&D();if(!M||!M.cssClass)throw new Error("couldn't load module "+_+" or it didn't call define");M.$id&&(b.$themeId=M.$id),g.importCssString(M.cssText,M.cssClass,b.container),b.theme&&g.removeCssClass(b.container,b.theme.cssClass);var T="padding"in M?M.padding:"padding"in(b.theme||{})?4:b.$padding;b.$padding&&T!=b.$padding&&b.setPadding(T),b.$theme=M.cssClass,b.theme=M,g.addCssClass(b.container,M.cssClass),g.setCssClass(b.container,"ace_dark",M.isDark),b.$size&&(b.$size.width=0,b.$updateSizeAsync()),b._dispatchEvent("themeLoaded",{theme:M}),D&&D(),S.isSafari&&b.scroller&&(b.scroller.style.background="red",b.scroller.style.background="")}},L.prototype.getTheme=function(){return this.$themeId},L.prototype.setStyle=function(_,D){g.setCssClass(this.container,_,D!==!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 D=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(b){D.$scrollAnimation||D.session.setScrollTop(b.data-D.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(b){D.$scrollAnimation||D.session.setScrollLeft(b.data-D.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(b){D.$scrollAnimation||D.session.setScrollTop(b.data-D.scrollMargin.top)}),this.scrollBarH.addEventListener("scroll",function(b){D.$scrollAnimation||D.session.setScrollLeft(b.data-D.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(D){var b=D[0].contentRect.width,v=D[0].contentRect.height;Math.abs(_.$size.width-b)>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,x),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 w=this.$normalizePath;h=h||w(t.toUrl("ace/worker/worker.js",null,"_"));var x={};a.forEach(function($){x[$]=w(t.toUrl($,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=r(h),y&&this.send("importScripts",y),this.$worker.postMessage({init:!0,tlns:x,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,w=Object.create(m),x=[],$=new o({messageBuffer:x,terminate:function(){},postMessage:function(S){x.push(S),h&&(y?setTimeout(A):A())}});$.setEmitSync=function(S){y=S};var A=function(){var S=x.shift();S.command?h[S.command].apply(h,S.args):S.event&&w._signal(S.event,S.data)};return w.postMessage=function(S){$.onMessage({data:S})},w.callback=function(S,E){this.postMessage({type:"call",id:E,data:S})},w.emit=function(S,E){this.postMessage({type:"event",name:S,data:E})},c.loadModule(["worker",i],function(S){for(h=new S[u](w);x.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,w=h.inMultiSelectMode,x=f.getDocumentPosition(),$=y.getCursor(),A=f.inSelection()||y.isEmpty()&&m(x,$),S=f.x,E=f.y,R=function(P){S=P.clientX,E=P.clientY},L=h.session,_=h.renderer.pixelToScreenCoordinates(S,E),D=_,b;if(h.$mouseHandler.$enableJumpToDef)a&&o||i&&o?b=s?"block":"add":o&&h.$blockSelectEnabled&&(b="block");else if(i&&!o){if(b="add",!w&&s)return}else o&&h.$blockSelectEnabled&&(b="block");if(b&&g.isMac&&r.ctrlKey&&h.$mouseHandler.cancelContextMenu(),b=="add"){if(!w&&A)return;if(!w){var v=y.toOrientedRange();h.addSelectionMarker(v)}var C=y.rangeList.rangeAtPoint(x);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(b=="block"){f.stop(),h.inVirtualSelectionMode=!0;var M,T=[],k=function(){var P=h.renderer.pixelToScreenCoordinates(S,E),B=L.screenToDocumentPosition(P.row,P.column,P.offsetX);m(D,P)&&m(B,y.lead)||(D=P,h.selection.moveToPosition(B),h.renderer.scrollCursorIntoView(),h.removeSelectionMarkers(T),T=y.rectangularRangeBlock(D,_),h.$mouseHandler.$clickSelection&&T.length==1&&T[0].isEmpty()&&(T[0]=h.$mouseHandler.$clickSelection.clone()),T.forEach(h.addSelectionMarker,h),h.updateSelectionMarkers())};w&&!i?y.toSingleRange():!w&&i&&(M=y.toOrientedRange(),h.addSelectionMarker(M)),s?_=L.documentToScreenPosition(y.lead):y.moveToPosition(x),D={row:-1,column:-1};var O=function(P){k(),clearInterval(N),h.removeSelectionMarkers(T),T.length||(T=[y.toOrientedRange()]),M&&(h.removeSelectionMarker(M),y.toSingleRange(M));for(var B=0;B<T.length;B++)y.addRange(T[B]);h.inVirtualSelectionMode=!1,h.$mouseHandler.$clickSelection=null},I=k;d.capture(h.container,R,O);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 E=this.rangeList.add($);return this.$onAddRange($),E.length&&this.$onRemoveRange(E),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 E=this.ranges.indexOf($[S]);this.ranges.splice(E,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 E=$[S],R=E.start.row,L=E.end.row;if(R===L)A.push(E.clone());else{for(A.push(new g(R,E.start.column,R,this.session.getLine(R).length));++R<L;)A.push(this.getLineRange(R,!0));A.push(new g(L,0,L,E.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 E=this.session.documentToScreenPosition(this.cursor),R=this.session.documentToScreenPosition(this.anchor),L=this.rectangularRangeBlock(E,R);L.forEach(this.addRange,this)}},this.rectangularRangeBlock=function($,A,S){var E=[],R=$.column<A.column;if(R)var L=$.column,_=A.column,D=$.offsetX,b=A.offsetX;else var L=A.column,_=$.column,D=A.offsetX,b=$.offsetX;var v=$.row<A.row;if(v)var C=$.row,M=A.row;else var C=A.row,M=$.row;L<0&&(L=0),C<0&&(C=0),C==M&&(S=!0);for(var T,k=C;k<=M;k++){var O=g.fromPoints(this.session.screenToDocumentPosition(k,L,D),this.session.screenToDocumentPosition(k,_,b));if(O.isEmpty()){if(T&&y(O.end,T))break;T=O.end}O.cursor=R?O.start:O.end,E.push(O)}if(v&&E.reverse(),!S){for(var I=E.length-1;E[I].isEmpty()&&I>0;)I--;if(I>0)for(var N=0;E[N].isEmpty();)N++;for(var P=I;P>=N;P--)E[P].isEmpty()&&E.splice(P,1)}return E}}).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 E=$[S];if(E.marker){this.session.removeMarker(E.marker);var R=A.indexOf(E);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"?E=S.forEachSelection(A,$.args):A.multiSelectAction=="forEachLine"?E=S.forEachSelection(A,$.args,!0):A.multiSelectAction=="single"?(S.exitMultiSelectMode(),E=A.exec(S,$.args||{})):E=A.multiSelectAction(S,$.args||{});else{var E=A.exec(S,$.args||{});S.multiSelect.addRange(S.multiSelect.toOrientedRange()),S.multiSelect.mergeOverlappingRanges()}return E}},this.forEachSelection=function($,A,S){if(!this.inVirtualSelectionMode){var E=S&&S.keepOrder,R=S==!0||S&&S.$byLines,L=this.session,_=this.selection,D=_.rangeList,b=(E?_:D).ranges,v;if(!b.length)return $.exec?$.exec(this,A||{}):$(this,A||{});var C=_._eventRegistry;_._eventRegistry={};var M=new m(L);this.inVirtualSelectionMode=!0;for(var T=b.length;T--;){if(R)for(;T>0&&b[T].start.row==b[T-1].end.row;)T--;M.fromOrientedRange(b[T]),M.index=T,this.selection=L.selection=M;var k=$.exec?$.exec(this,A||{}):$(this,A||{});!v&&k!==void 0&&(v=k),M.toOrientedRange(b[T])}M.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=[],E=0;E<A.length;E++)S.push(this.session.getTextRange(A[E]));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 E=A==this.multiSelect.anchor?S.cursor==S.start?S.end:S.start:S.cursor;E.row!=A.row||this.session.$clipPositionToDocument(E.row,E.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 E=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();A.needle=this.session.getTextRange(E)}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 E&&L.rangeList.rangeAtPoint(E.start)&&L.addRange(E,!0),R.length},this.selectMoreLines=function($,A){var S=this.selection.toOrientedRange(),E=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 D=L;else var _=this.session.documentToScreenPosition(E?S.end:S.start),D=this.session.screenToDocumentPosition(_.row+$,_.column);if(E){var b=g.fromPoints(L,D);b.cursor=b.start}else{var b=g.fromPoints(D,L);b.cursor=b.end}if(b.desiredColumn=R.column,!this.selection.inMultiSelectMode)this.selection.addRange(S);else if(A)var v=S.cursor;this.selection.addRange(b),v&&this.selection.substractPoint(v)},this.transposeSelections=function($){for(var A=this.session,S=A.multiSelect,E=S.ranges,R=E.length;R--;){var L=E[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 D=[],R=E.length;R--;){var L=E[R];D.unshift(A.getTextRange(L))}$<0?D.unshift(D.pop()):D.push(D.shift());for(var R=E.length;R--;){var L=E[R],b=L.clone();A.replace(L,D[R]),L.start.row=b.start.row,L.start.column=b.start.column}S.fromOrientedRange(S.ranges[0])},this.selectMore=function($,A,S){var E=this.session,R=E.multiSelect,L=R.toOrientedRange();if(!(L.isEmpty()&&(L=E.getWordRange(L.start.row,L.start.column),L.cursor=$==-1?L.start:L.end,this.multiSelect.addRange(L),S))){var _=E.getTextRange(L),D=i(E,_,$);D&&(D.cursor=$==-1?D.start:D.end,this.session.unfold(D),this.multiSelect.addRange(D),this.renderer.scrollCursorIntoView(null,.5)),A&&this.multiSelect.substractPoint(L.cursor)}},this.alignCursors=function(){var $=this.session,A=$.multiSelect,S=A.ranges,E=-1,R=S.filter(function(I){if(I.cursor.row==E)return!0;E=I.cursor.row});if(!S.length||R.length==S.length-1){var L=this.selection.getRange(),_=L.start.row,D=L.end.row,b=_==D;if(b){var v=this.session.getLength(),C;do C=this.session.getLine(D);while(/[=:]/.test(C)&&++D<v);do C=this.session.getLine(_);while(/[=:]/.test(C)&&--_>0);_<0&&(_=0),D>=v&&(D=v-1)}var M=this.session.removeFullLines(_,D);M=this.$reAlignText(M,b),this.session.insert({row:_,column:0},M.join(`
|
|
2099
2099
|
`)+`
|
|
2100
|
-
`),
|
|
2100
|
+
`),b||(L.start.column=0,L.end.column=M[M.length-1].length),this.selection.setRange(L)}else{R.forEach(function(I){A.substractPoint(I.cursor)});var T=0,k=1/0,O=S.map(function(I){var N=I.cursor,P=$.getLine(N.row),B=P.substr(N.column).search(/\S/g);return B==-1&&(B=0),N.column>T&&(T=N.column),B<k&&(k=B),B});S.forEach(function(I,N){var P=I.cursor,B=T-P.column,F=O[N]-k;B>F?$.insert(P,r.stringRepeat(" ",B-F)):$.remove(new g(P.row,P.column,P.row,P.column-B+F)),I.start.column=I.end.column=T,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,E=!0,R,L,_;return $.map(function(M){var T=M.match(/(\s*)(.*?)(\s*)([=:].*)/);return T?R==null?(R=T[1].length,L=T[2].length,_=T[3].length,T):(R+L+_!=T[1].length+T[2].length+T[3].length&&(E=!1),R!=T[1].length&&(S=!1),R>T[1].length&&(R=T[1].length),L<T[2].length&&(L=T[2].length),_>T[3].length&&(_=T[3].length),T):[M]}).map(A?b:S?E?v:b:C);function D(M){return r.stringRepeat(" ",M)}function b(M){return M[2]?D(R)+M[2]+D(L-M[2].length+_)+M[4].replace(/^([=:])\s+/,"$1 "):M[0]}function v(M){return M[2]?D(R+L-M[2].length)+M[2]+D(_)+M[4].replace(/^([=:])\s+/,"$1 "):M[0]}function C(M){return M[2]?D(R)+M[2]+D(_)+M[4].replace(/^([=:])\s+/,"$1 "):M[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 w($){$.$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),x($))}function x($){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&&E()},$),f.addListener(A,"keyup",E,$),f.addListener(A,"blur",E,$);function E(R){S&&($.renderer.setMouseCursor(""),S=!1)}}n.MultiSelect=w,t("./config").defineOptions(h.prototype,"editor",{enableMultiselect:{set:function($){w(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 w=m.getTokenAt(c,0);if(!w||w.type!=="string")break}h=c}}if(h>u){var x=m.getLine(h).length;return new d(u,a,h,x)}}},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 w=h[0];a.column=(w.pos&&typeof w.column!="number"?w.pos.sc:w.column)||0,a.row=w.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 x={row:a.row,fixedWidth:!0,coverGutter:!0,el:d.createElement("div"),type:"errorMarker"},$=x.el.appendChild(d.createElement("div")),A=x.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",x.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 E=function(R,L,_){if(L===0&&(_==="esc"||_==="return"))return x.destroy(),{command:"null"}};x.destroy=function(){r.$mouseHandler.isMousePressed||(r.keyBinding.removeKeyboardHandler(E),s.widgetManager.removeLineWidget(x),r.off("changeSelection",x.destroy),r.off("changeSession",x.destroy),r.off("mouseup",x.destroy),r.off("change",x.destroy))},r.keyBinding.addKeyboardHandler(E),r.on("changeSelection",x.destroy),r.on("changeSession",x.destroy),r.on("mouseup",x.destroy),r.on("change",x.destroy),r.session.widgetManager.addLineWidget(x),x.el.onmousedown=r.focus.bind(r),r.renderer.scrollCursorIntoView(null,.5,{bottom:x.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,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),
|
|
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),w=new m(new r(s),y,a),x={document:y,editor:w,onResize:w.resize.bind(w,null)};return h&&(x.textarea=h),w.on("destroy",function(){x.editor.container.env=null}),w.container.env=w.env=x,w},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)})})()})(Qo)),Qo.exports}var sa=av();const lv=Rt(sa),cv="/formeo/assets/js/mode-json.min.js",uv="/formeo/assets/js/theme-github_light_default.min.js";var Jo,yu;function hv(){if(yu)return Jo;yu=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 Jo=l,Jo}var es,wu;function dv(){if(wu)return es;wu=1;function l(e){return function(t){return e?.[t]}}return es=l,es}var ts,bu;function fv(){if(bu)return ts;bu=1;var l=dv(),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 ts=t,ts}var ns,Cu;function pv(){if(Cu)return ns;Cu=1;var l=fv(),e=jn(),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 ns=f,ns}var is,Su;function gv(){if(Su)return is;Su=1;var l=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function e(t){return t.match(l)||[]}return is=e,is}var rs,Au;function mv(){if(Au)return rs;Au=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 rs=e,rs}var os,$u;function vv(){if($u)return os;$u=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+",w="["+d+"]",x="["+g+"]",$="[^"+l+a+y+d+g+o+"]",A="\\ud83c[\\udffb-\\udfff]",S="(?:"+h+"|"+A+")",E="[^"+l+"]",R="(?:\\ud83c[\\udde6-\\uddff]){2}",L="[\\ud800-\\udbff][\\udc00-\\udfff]",_="["+o+"]",D="\\u200d",b="(?:"+x+"|"+$+")",v="(?:"+_+"|"+$+")",C="(?:"+i+"(?:d|ll|m|re|s|t|ve))?",M="(?:"+i+"(?:D|LL|M|RE|S|T|VE))?",T=S+"?",k="["+s+"]?",O="(?:"+D+"(?:"+[E,R,L].join("|")+")"+k+T+")*",I="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",N="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",P=k+T+O,B="(?:"+[w,R,L].join("|")+")"+P,F=RegExp([_+"?"+x+"+"+C+"(?="+[u,_,"$"].join("|")+")",v+"+"+M+"(?="+[u,_+b,"$"].join("|")+")",_+"?"+b+"+"+C,_+"+"+M,N,I,y,B].join("|"),"g");function H(z){return z.match(F)||[]}return os=H,os}var ss,Mu;function yv(){if(Mu)return ss;Mu=1;var l=gv(),e=mv(),t=jn(),n=vv();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 ss=p,ss}var as,xu;function wv(){if(xu)return as;xu=1;var l=hv(),e=pv(),t=yv(),n="['’]",p=RegExp(n,"g");function d(g){return function(m){return l(t(e(m).replace(p,"")),g,"")}}return as=d,as}var ls,Eu;function bv(){if(Eu)return ls;Eu=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 ls=l,ls}var cs,_u;function Cv(){if(_u)return cs;_u=1;var l=bv();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 cs=e,cs}var us,Tu;function rd(){if(Tu)return us;Tu=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 us=c,us}var hs,Lu;function Sv(){if(Lu)return hs;Lu=1;function l(e){return e.split("")}return hs=l,hs}var ds,Ru;function Av(){if(Ru)return ds;Ru=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,w="(?:"+[r+m+"?",m,o,s,g].join("|")+")",x=RegExp(c+"(?="+c+")|"+w+y,"g");function $(A){return A.match(x)||[]}return ds=$,ds}var fs,ku;function $v(){if(ku)return fs;ku=1;var l=Sv(),e=rd(),t=Av();function n(p){return e(p)?t(p):l(p)}return fs=n,fs}var ps,Du;function Mv(){if(Du)return ps;Du=1;var l=Cv(),e=rd(),t=$v(),n=jn();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 ps=p,ps}var gs,Ou;function xv(){if(Ou)return gs;Ou=1;var l=Mv(),e=l("toUpperCase");return gs=e,gs}var ms,Iu;function Ev(){if(Iu)return ms;Iu=1;var l=wv(),e=xv(),t=l(function(n,p,d){return n+(d?" ":"")+e(p)});return ms=t,ms}var _v=Ev();const Tv=Rt(_v);sa.config.setModuleUrl("ace/mode/json",cv);sa.config.setModuleUrl("ace/theme/github_light_default",uv);const tt=lv.edit("formData-editor");tt.session.setOption("useWorker",!1);tt.setOptions({theme:"ace/theme/github_light_default",mode:"ace/mode/json"});const Lv=document.getElementById("submit-formData"),Rv=document.getElementById("formData-popover"),kv=document.getElementById("editor-action-buttons"),Dv=(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:()=>{tt.setValue(JSON.stringify(l.formData,null,2),1)}}),Ov={editData:{popovertarget:"formData-popover"}},Iv=l=>{const e=Ov[l]||{};return{id:l,type:"button",...e}},Nv=(l,e)=>{Lv.addEventListener("click",()=>{l.formData=tt.session.getValue(),Rv.hidePopover()});const t=Dv(l,e);return Object.entries(t).map(([p,d])=>{const g=Iv(p),m=Object.assign(document.createElement("button"),g);for(const[f,r]of Object.entries(g))m.setAttribute(f,r);const c=document.createTextNode(Tv(p));return m.appendChild(c),m.addEventListener("click",d,!1),kv.appendChild(m),m})};document.getElementById("format-json").addEventListener("click",Fv);document.getElementById("collapse-json").addEventListener("click",Pv);document.getElementById("copy-json").addEventListener("click",Hv);function Fv(){const l=tt.session.getValue(),e=JSON.parse(l);tt.setValue(JSON.stringify(e,null,2),1)}function Pv(){const l=tt.session.getValue(),e=JSON.parse(l);tt.setValue(JSON.stringify(e,null,0),1)}async function Hv({target:l}){const e=l.textContent;l.textContent="Copied!";const t=setTimeout(()=>{l.textContent=e,clearTimeout(t)},3e3);try{await navigator.clipboard.writeText(tt.session.getValue()),console.log("Text copied to clipboard")}catch(n){console.error("Failed to copy: ",n)}}const Wv=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 zv(l){l.innerHTML=`
|
|
2134
2134
|
<form class="build-form"></form>
|
|
2135
2135
|
<div class="render-form"></div>
|
|
2136
|
-
`;const e=new ia(tn),t=new ra(oa);return Nv(e,t),
|
|
2136
|
+
`;const e=new ia(tn),t=new ra(oa);return Nv(e,t),Wv(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 Bv{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 zv(this.frameworkContainer);break;case"angular":this.currentDemo=await Um(this.frameworkContainer);break;case"react":this.currentDemo=await Jm(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
|
|
2146
|
+
`}}document.addEventListener("DOMContentLoaded",()=>{window.frameworkLoader=new Bv});export{vm as C,je as a,X as m,at as t};
|