formeo 4.2.5 → 5.0.1
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 +2 -2
- package/dist/demo/assets/css/demo.min.css.gz +0 -0
- package/dist/demo/assets/css/formeo.min.css +2 -2
- package/dist/demo/assets/img/formeo-sprite.svg +1 -1
- package/dist/demo/assets/js/demo.min.js +79 -79
- package/dist/demo/assets/js/demo.min.js.gz +0 -0
- package/dist/demo/assets/js/formeo.cjs.js +711 -163
- package/dist/demo/assets/js/formeo.es.js +711 -163
- 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 +711 -163
- package/dist/demo/assets/js/formeo.min.umd.js +2 -2
- package/dist/demo/assets/js/formeo.umd.js +711 -163
- package/dist/demo/assets/js/index.min.js +1 -1
- package/dist/demo/assets/js/index.min2.js +2 -2
- 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-sprite.svg +1 -1
- package/dist/formeo.cjs.js +711 -163
- package/dist/formeo.css +176 -3
- package/dist/formeo.es.js +711 -163
- package/dist/formeo.min.cjs.js +2 -2
- package/dist/formeo.min.css +2 -2
- package/dist/formeo.min.es.js +3 -3
- package/dist/formeo.min.js +711 -163
- package/dist/formeo.min.umd.js +2 -2
- package/dist/formeo.umd.js +711 -163
- package/package.json +5 -5
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
formeo - https://formeo.io
|
|
4
|
-
Version:
|
|
4
|
+
Version: 5.0.0
|
|
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
|
|
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 h of p)if(h.type==="childList")for(const g of h.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&n(g)}).observe(document,{childList:!0,subtree:!0});function t(p){const h={};return p.integrity&&(h.integrity=p.integrity),p.referrerPolicy&&(h.referrerPolicy=p.referrerPolicy),p.crossOrigin==="use-credentials"?h.credentials="include":p.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function n(p){if(p.ep)return;p.ep=!0;const h=t(p);fetch(p.href,h)}})();const pd={"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"}},gd=pd["en-US"];async function md(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 ma={extension:".lang",location:"assets/lang/",langs:["en-US"],locale:"en-US",override:{}};class Xt{constructor(e=ma){this.langs=Object.create(null),this.loaded=[],this.processConfig(e)}processConfig(e){const{location:t,...n}={...ma,...e},p=t.replace(/\/?$/,"/");this.config={location:p,...n};const{override:h,preloaded:g={}}=this.config,m=Object.entries(this.langs).concat(Object.entries(h||g));this.langs=m.reduce((c,[d,r])=>(c[d]=this.applyLanguage(d,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"?Xt.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 h=p.match(/\{[^}]+?\}/g);if(t&&h)if(typeof t=="object")for(const g of h){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 Xt.fromFile(e.replace(/\n\n/g,`
|
|
9
9
|
`))}static fromFile(e){const t=e.split(`
|
|
10
|
-
`),n={};for(let f,d=0;d<t.length;d++)f=/^(.+?) *?= *?([^\n]+)/.exec(t[d]),f&&(n[f[1]]=f[2].replace(/(^\s+|\s+$)/g,""));return n}loadLang(e,t=!0){const n=this;return new Promise(function(f,d){if(n.loaded.indexOf(e)!==-1&&t)return n.applyLanguage(n.langs[e]),f(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),f(n.langs[e])}).catch(m=>{console.error(m);const c=n.applyLanguage(e);f(c)})}})}applyLanguage(e,t={}){const n=this.config.override[e]||{},f=this.langs[e]||{};return this.langs[e]={...f,...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 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,Ke=(l,e,t)=>ud(l,typeof e!="symbol"?e+"":e,t);const hd="_3x4ZIcu-",dd="JIt36hCJ",Ft={tooltip:hd,visible:dd},fd={triggerName:"tooltip"};class Nu{constructor(e=fd){Ke(this,"triggerName"),Ke(this,"tooltip"),Ke(this,"activeTriggerType",null),Ke(this,"spacing",12),Ke(this,"handleClick",t=>{const n=this.triggerName,f=t.target.closest(`[${n}][${n}-type="click"]`);if(f)if(this.isVisible())this.hide();else{const d=f.getAttribute(`${n}`);this.show(f,d),this.activeTriggerType="click"}else this.hide()}),Ke(this,"handleMouseOver",t=>{const n=this.triggerName,f=t.target.closest(`[${n}]`);if(this.activeTriggerType!=="click"&&f?.getAttribute(`${n}-type`)!=="click"){const d=f?.getAttribute(`${n}`);d&&(this.show(f,d),this.activeTriggerType="hover")}}),Ke(this,"handleMouseOut",t=>{const n=this.triggerName,f=t.target.closest(`[${n}]`);this.activeTriggerType!=="click"&&f?.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 ${Ft.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(Ft.visible)}calculatePosition(e){const t=e.getBoundingClientRect(),n=this.tooltip.getBoundingClientRect(),f=[{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 f.find(d=>this.fitsInViewport(d,n))||f[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(Ft.tooltip)||getComputedStyle(m).pointerEvents==="none")return!1}).length===0:!1}show(e,t){this.tooltip.innerHTML=t??"",this.tooltip.classList.add(Ft.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(Ft.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.4",Fu={name:pd,version:gd};var an=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function kt(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var ei,ua;function md(){if(ua)return ei;ua=1;function l(){this.__data__=[],this.size=0}return ei=l,ei}var ti,ha;function nn(){if(ha)return ti;ha=1;function l(e,t){return e===t||e!==e&&t!==t}return ti=l,ti}var ni,da;function Fn(){if(da)return ni;da=1;var l=nn();function e(t,n){for(var f=t.length;f--;)if(l(t[f][0],n))return f;return-1}return ni=e,ni}var ii,fa;function vd(){if(fa)return ii;fa=1;var l=Fn(),e=Array.prototype,t=e.splice;function n(f){var d=this.__data__,g=l(d,f);if(g<0)return!1;var m=d.length-1;return g==m?d.pop():t.call(d,g,1),--this.size,!0}return ii=n,ii}var ri,pa;function yd(){if(pa)return ri;pa=1;var l=Fn();function e(t){var n=this.__data__,f=l(n,t);return f<0?void 0:n[f][1]}return ri=e,ri}var oi,ga;function wd(){if(ga)return oi;ga=1;var l=Fn();function e(t){return l(this.__data__,t)>-1}return oi=e,oi}var si,ma;function bd(){if(ma)return si;ma=1;var l=Fn();function e(t,n){var f=this.__data__,d=l(f,t);return d<0?(++this.size,f.push([t,n])):f[d][1]=n,this}return si=e,si}var ai,va;function Pn(){if(va)return ai;va=1;var l=md(),e=vd(),t=yd(),n=wd(),f=bd();function d(g){var m=-1,c=g==null?0:g.length;for(this.clear();++m<c;){var p=g[m];this.set(p[0],p[1])}}return d.prototype.clear=l,d.prototype.delete=e,d.prototype.get=t,d.prototype.has=n,d.prototype.set=f,ai=d,ai}var li,ya;function Cd(){if(ya)return li;ya=1;var l=Pn();function e(){this.__data__=new l,this.size=0}return li=e,li}var ci,wa;function Sd(){if(wa)return ci;wa=1;function l(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}return ci=l,ci}var ui,ba;function Ad(){if(ba)return ui;ba=1;function l(e){return this.__data__.get(e)}return ui=l,ui}var hi,Ca;function $d(){if(Ca)return hi;Ca=1;function l(e){return this.__data__.has(e)}return hi=l,hi}var di,Sa;function Pu(){if(Sa)return di;Sa=1;var l=typeof an=="object"&&an&&an.Object===Object&&an;return di=l,di}var fi,Aa;function qe(){if(Aa)return fi;Aa=1;var l=Pu(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=l||e||Function("return this")();return fi=t,fi}var pi,$a;function Hn(){if($a)return pi;$a=1;var l=qe(),e=l.Symbol;return pi=e,pi}var gi,Ma;function Md(){if(Ma)return gi;Ma=1;var l=Hn(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,f=l?l.toStringTag:void 0;function d(g){var m=t.call(g,f),c=g[f];try{g[f]=void 0;var p=!0}catch{}var r=n.call(g);return p&&(m?g[f]=c:delete g[f]),r}return gi=d,gi}var mi,xa;function xd(){if(xa)return mi;xa=1;var l=Object.prototype,e=l.toString;function t(n){return e.call(n)}return mi=t,mi}var vi,Ea;function Dt(){if(Ea)return vi;Ea=1;var l=Hn(),e=Md(),t=xd(),n="[object Null]",f="[object Undefined]",d=l?l.toStringTag:void 0;function g(m){return m==null?m===void 0?f:n:d&&d in Object(m)?e(m):t(m)}return vi=g,vi}var yi,_a;function ct(){if(_a)return yi;_a=1;function l(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return yi=l,yi}var wi,Ta;function _s(){if(Ta)return wi;Ta=1;var l=Dt(),e=ct(),t="[object AsyncFunction]",n="[object Function]",f="[object GeneratorFunction]",d="[object Proxy]";function g(m){if(!e(m))return!1;var c=l(m);return c==n||c==f||c==t||c==d}return wi=g,wi}var bi,La;function Ed(){if(La)return bi;La=1;var l=qe(),e=l["__core-js_shared__"];return bi=e,bi}var Ci,Ra;function _d(){if(Ra)return Ci;Ra=1;var l=Ed(),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 Ci=t,Ci}var Si,ka;function Hu(){if(ka)return Si;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 Si=t,Si}var Ai,Da;function Td(){if(Da)return Ai;Da=1;var l=_s(),e=_d(),t=ct(),n=Hu(),f=/[\\^$.*+?()[\]{}|]/g,d=/^\[object .+?Constructor\]$/,g=Function.prototype,m=Object.prototype,c=g.toString,p=m.hasOwnProperty,r=RegExp("^"+c.call(p).replace(f,"\\$&").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 Ai=o,Ai}var $i,Oa;function Ld(){if(Oa)return $i;Oa=1;function l(e,t){return e?.[t]}return $i=l,$i}var Mi,Ia;function yt(){if(Ia)return Mi;Ia=1;var l=Td(),e=Ld();function t(n,f){var d=e(n,f);return l(d)?d:void 0}return Mi=t,Mi}var xi,Na;function Ts(){if(Na)return xi;Na=1;var l=yt(),e=qe(),t=l(e,"Map");return xi=t,xi}var Ei,Fa;function Wn(){if(Fa)return Ei;Fa=1;var l=yt(),e=l(Object,"create");return Ei=e,Ei}var _i,Pa;function Rd(){if(Pa)return _i;Pa=1;var l=Wn();function e(){this.__data__=l?l(null):{},this.size=0}return _i=e,_i}var Ti,Ha;function kd(){if(Ha)return Ti;Ha=1;function l(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return Ti=l,Ti}var Li,Wa;function Dd(){if(Wa)return Li;Wa=1;var l=Wn(),e="__lodash_hash_undefined__",t=Object.prototype,n=t.hasOwnProperty;function f(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 Li=f,Li}var Ri,za;function Od(){if(za)return Ri;za=1;var l=Wn(),e=Object.prototype,t=e.hasOwnProperty;function n(f){var d=this.__data__;return l?d[f]!==void 0:t.call(d,f)}return Ri=n,Ri}var ki,Ba;function Id(){if(Ba)return ki;Ba=1;var l=Wn(),e="__lodash_hash_undefined__";function t(n,f){var d=this.__data__;return this.size+=this.has(n)?0:1,d[n]=l&&f===void 0?e:f,this}return ki=t,ki}var Di,ja;function Nd(){if(ja)return Di;ja=1;var l=Rd(),e=kd(),t=Dd(),n=Od(),f=Id();function d(g){var m=-1,c=g==null?0:g.length;for(this.clear();++m<c;){var p=g[m];this.set(p[0],p[1])}}return d.prototype.clear=l,d.prototype.delete=e,d.prototype.get=t,d.prototype.has=n,d.prototype.set=f,Di=d,Di}var Oi,Va;function Fd(){if(Va)return Oi;Va=1;var l=Nd(),e=Pn(),t=Ts();function n(){this.size=0,this.__data__={hash:new l,map:new(t||e),string:new l}}return Oi=n,Oi}var Ii,Ua;function Pd(){if(Ua)return Ii;Ua=1;function l(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return Ii=l,Ii}var Ni,Ga;function zn(){if(Ga)return Ni;Ga=1;var l=Pd();function e(t,n){var f=t.__data__;return l(n)?f[typeof n=="string"?"string":"hash"]:f.map}return Ni=e,Ni}var Fi,qa;function Hd(){if(qa)return Fi;qa=1;var l=zn();function e(t){var n=l(this,t).delete(t);return this.size-=n?1:0,n}return Fi=e,Fi}var Pi,Ka;function Wd(){if(Ka)return Pi;Ka=1;var l=zn();function e(t){return l(this,t).get(t)}return Pi=e,Pi}var Hi,Ya;function zd(){if(Ya)return Hi;Ya=1;var l=zn();function e(t){return l(this,t).has(t)}return Hi=e,Hi}var Wi,Za;function Bd(){if(Za)return Wi;Za=1;var l=zn();function e(t,n){var f=l(this,t),d=f.size;return f.set(t,n),this.size+=f.size==d?0:1,this}return Wi=e,Wi}var zi,Xa;function Ls(){if(Xa)return zi;Xa=1;var l=Fd(),e=Hd(),t=Wd(),n=zd(),f=Bd();function d(g){var m=-1,c=g==null?0:g.length;for(this.clear();++m<c;){var p=g[m];this.set(p[0],p[1])}}return d.prototype.clear=l,d.prototype.delete=e,d.prototype.get=t,d.prototype.has=n,d.prototype.set=f,zi=d,zi}var Bi,Qa;function jd(){if(Qa)return Bi;Qa=1;var l=Pn(),e=Ts(),t=Ls(),n=200;function f(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=f,Bi}var ji,Ja;function Wu(){if(Ja)return ji;Ja=1;var l=Pn(),e=Cd(),t=Sd(),n=Ad(),f=$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=f,g.prototype.set=d,ji=g,ji}var Vi,el;function zu(){if(el)return Vi;el=1;var l=yt(),e=(function(){try{var t=l(Object,"defineProperty");return t({},"",{}),t}catch{}})();return Vi=e,Vi}var Ui,tl;function Rs(){if(tl)return Ui;tl=1;var l=zu();function e(t,n,f){n=="__proto__"&&l?l(t,n,{configurable:!0,enumerable:!0,value:f,writable:!0}):t[n]=f}return Ui=e,Ui}var Gi,nl;function Bu(){if(nl)return Gi;nl=1;var l=Rs(),e=nn();function t(n,f,d){(d!==void 0&&!e(n[f],d)||d===void 0&&!(f in n))&&l(n,f,d)}return Gi=t,Gi}var qi,il;function Vd(){if(il)return qi;il=1;function l(e){return function(t,n,f){for(var d=-1,g=Object(t),m=f(t),c=m.length;c--;){var p=m[e?c:++d];if(n(g[p],p,g)===!1)break}return t}}return qi=l,qi}var Ki,rl;function Ud(){if(rl)return Ki;rl=1;var l=Vd(),e=l();return Ki=e,Ki}var Wt={exports:{}};Wt.exports;var ol;function Gd(){return ol||(ol=1,(function(l,e){var t=qe(),n=e&&!e.nodeType&&e,f=n&&!0&&l&&!l.nodeType&&l,d=f&&f.exports===n,g=d?t.Buffer:void 0,m=g?g.allocUnsafe:void 0;function c(p,r){if(r)return p.slice();var o=p.length,s=m?m(o):new p.constructor(o);return p.copy(s),s}l.exports=c})(Wt,Wt.exports)),Wt.exports}var Yi,sl;function ju(){if(sl)return Yi;sl=1;var l=qe(),e=l.Uint8Array;return Yi=e,Yi}var Zi,al;function qd(){if(al)return Zi;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 Zi=e,Zi}var Xi,ll;function Kd(){if(ll)return Xi;ll=1;var l=qd();function e(t,n){var f=n?l(t.buffer):t.buffer;return new t.constructor(f,t.byteOffset,t.length)}return Xi=e,Xi}var Qi,cl;function Yd(){if(cl)return Qi;cl=1;function l(e,t){var n=-1,f=e.length;for(t||(t=Array(f));++n<f;)t[n]=e[n];return t}return Qi=l,Qi}var Ji,ul;function Zd(){if(ul)return Ji;ul=1;var l=ct(),e=Object.create,t=(function(){function n(){}return function(f){if(!l(f))return{};if(e)return e(f);n.prototype=f;var d=new n;return n.prototype=void 0,d}})();return Ji=t,Ji}var er,hl;function Vu(){if(hl)return er;hl=1;function l(e,t){return function(n){return e(t(n))}}return er=l,er}var tr,dl;function Uu(){if(dl)return tr;dl=1;var l=Vu(),e=l(Object.getPrototypeOf,Object);return tr=e,tr}var nr,fl;function ks(){if(fl)return nr;fl=1;var l=Object.prototype;function e(t){var n=t&&t.constructor,f=typeof n=="function"&&n.prototype||l;return t===f}return nr=e,nr}var ir,pl;function Xd(){if(pl)return ir;pl=1;var l=Zd(),e=Uu(),t=ks();function n(f){return typeof f.constructor=="function"&&!t(f)?l(e(f)):{}}return ir=n,ir}var rr,gl;function wt(){if(gl)return rr;gl=1;function l(e){return e!=null&&typeof e=="object"}return rr=l,rr}var or,ml;function Qd(){if(ml)return or;ml=1;var l=Dt(),e=wt(),t="[object Arguments]";function n(f){return e(f)&&l(f)==t}return or=n,or}var sr,vl;function Gu(){if(vl)return sr;vl=1;var l=Qd(),e=wt(),t=Object.prototype,n=t.hasOwnProperty,f=t.propertyIsEnumerable,d=l((function(){return arguments})())?l:function(g){return e(g)&&n.call(g,"callee")&&!f.call(g,"callee")};return sr=d,sr}var ar,yl;function bt(){if(yl)return ar;yl=1;var l=Array.isArray;return ar=l,ar}var lr,wl;function qu(){if(wl)return lr;wl=1;var l=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=l}return lr=e,lr}var cr,bl;function Bn(){if(bl)return cr;bl=1;var l=_s(),e=qu();function t(n){return n!=null&&e(n.length)&&!l(n)}return cr=t,cr}var ur,Cl;function Jd(){if(Cl)return ur;Cl=1;var l=Bn(),e=wt();function t(n){return e(n)&&l(n)}return ur=t,ur}var zt={exports:{}},hr,Sl;function ef(){if(Sl)return hr;Sl=1;function l(){return!1}return hr=l,hr}zt.exports;var Al;function Ds(){return Al||(Al=1,(function(l,e){var t=qe(),n=ef(),f=e&&!e.nodeType&&e,d=f&&!0&&l&&!l.nodeType&&l,g=d&&d.exports===f,m=g?t.Buffer:void 0,c=m?m.isBuffer:void 0,p=c||n;l.exports=p})(zt,zt.exports)),zt.exports}var dr,$l;function tf(){if($l)return dr;$l=1;var l=Dt(),e=Uu(),t=wt(),n="[object Object]",f=Function.prototype,d=Object.prototype,g=f.toString,m=d.hasOwnProperty,c=g.call(Object);function p(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 dr=p,dr}var fr,Ml;function nf(){if(Ml)return fr;Ml=1;var l=Dt(),e=qu(),t=wt(),n="[object Arguments]",f="[object Array]",d="[object Boolean]",g="[object Date]",m="[object Error]",c="[object Function]",p="[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[f]=D[h]=D[d]=D[y]=D[g]=D[m]=D[c]=D[p]=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 fr=b,fr}var pr,xl;function rf(){if(xl)return pr;xl=1;function l(e){return function(t){return e(t)}}return pr=l,pr}var Bt={exports:{}};Bt.exports;var El;function of(){return El||(El=1,(function(l,e){var t=Pu(),n=e&&!e.nodeType&&e,f=n&&!0&&l&&!l.nodeType&&l,d=f&&f.exports===n,g=d&&t.process,m=(function(){try{var c=f&&f.require&&f.require("util").types;return c||g&&g.binding&&g.binding("util")}catch{}})();l.exports=m})(Bt,Bt.exports)),Bt.exports}var gr,_l;function Os(){if(_l)return gr;_l=1;var l=nf(),e=rf(),t=of(),n=t&&t.isTypedArray,f=n?e(n):l;return gr=f,gr}var mr,Tl;function Ku(){if(Tl)return mr;Tl=1;function l(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return mr=l,mr}var vr,Ll;function Yu(){if(Ll)return vr;Ll=1;var l=Rs(),e=nn(),t=Object.prototype,n=t.hasOwnProperty;function f(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 vr=f,vr}var yr,Rl;function sf(){if(Rl)return yr;Rl=1;var l=Yu(),e=Rs();function t(n,f,d,g){var m=!d;d||(d={});for(var c=-1,p=f.length;++c<p;){var r=f[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 yr=t,yr}var wr,kl;function af(){if(kl)return wr;kl=1;function l(e,t){for(var n=-1,f=Array(e);++n<e;)f[n]=t(n);return f}return wr=l,wr}var br,Dl;function Is(){if(Dl)return br;Dl=1;var l=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(n,f){var d=typeof n;return f=f??l,!!f&&(d=="number"||d!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<f}return br=t,br}var Cr,Ol;function Zu(){if(Ol)return Cr;Ol=1;var l=af(),e=Gu(),t=bt(),n=Ds(),f=Is(),d=Os(),g=Object.prototype,m=g.hasOwnProperty;function c(p,r){var o=t(p),s=!o&&e(p),a=!o&&!s&&n(p),i=!o&&!s&&!a&&d(p),u=o||s||a||i,h=u?l(p.length,String):[],y=h.length;for(var w in p)(r||m.call(p,w))&&!(u&&(w=="length"||a&&(w=="offset"||w=="parent")||i&&(w=="buffer"||w=="byteLength"||w=="byteOffset")||f(w,y)))&&h.push(w);return h}return Cr=c,Cr}var Sr,Il;function lf(){if(Il)return Sr;Il=1;function l(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}return Sr=l,Sr}var Ar,Nl;function cf(){if(Nl)return Ar;Nl=1;var l=ct(),e=ks(),t=lf(),n=Object.prototype,f=n.hasOwnProperty;function d(g){if(!l(g))return t(g);var m=e(g),c=[];for(var p in g)p=="constructor"&&(m||!f.call(g,p))||c.push(p);return c}return Ar=d,Ar}var $r,Fl;function Xu(){if(Fl)return $r;Fl=1;var l=Zu(),e=cf(),t=Bn();function n(f){return t(f)?l(f,!0):e(f)}return $r=n,$r}var Mr,Pl;function uf(){if(Pl)return Mr;Pl=1;var l=sf(),e=Xu();function t(n){return l(n,e(n))}return Mr=t,Mr}var xr,Hl;function hf(){if(Hl)return xr;Hl=1;var l=Bu(),e=Gd(),t=Kd(),n=Yd(),f=Xd(),d=Gu(),g=bt(),m=Jd(),c=Ds(),p=_s(),r=ct(),o=tf(),s=Os(),a=Ku(),i=uf();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)||p(E))&&(_=f(R))):D=!1}D&&(S.set(R,_),$(_,R,x,A,S),S.delete(R)),l(h,w,_)}return xr=u,xr}var Er,Wl;function df(){if(Wl)return Er;Wl=1;var l=Wu(),e=Bu(),t=Ud(),n=hf(),f=ct(),d=Xu(),g=Ku();function m(c,p,r,o,s){c!==p&&t(p,function(a,i){if(s||(s=new l),f(a))n(c,p,i,r,m,o,s);else{var u=o?o(g(c,i),a,i+"",c,p,s):void 0;u===void 0&&(u=a),e(c,i,u)}},d)}return Er=m,Er}var _r,zl;function Qu(){if(zl)return _r;zl=1;function l(e){return e}return _r=l,_r}var Tr,Bl;function ff(){if(Bl)return Tr;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 Tr=l,Tr}var Lr,jl;function pf(){if(jl)return Lr;jl=1;var l=ff(),e=Math.max;function t(n,f,d){return f=e(f===void 0?n.length-1:f,0),function(){for(var g=arguments,m=-1,c=e(g.length-f,0),p=Array(c);++m<c;)p[m]=g[f+m];m=-1;for(var r=Array(f+1);++m<f;)r[m]=g[m];return r[f]=d(p),l(n,this,r)}}return Lr=t,Lr}var Rr,Vl;function gf(){if(Vl)return Rr;Vl=1;function l(e){return function(){return e}}return Rr=l,Rr}var kr,Ul;function mf(){if(Ul)return kr;Ul=1;var l=gf(),e=zu(),t=Qu(),n=e?function(f,d){return e(f,"toString",{configurable:!0,enumerable:!1,value:l(d),writable:!0})}:t;return kr=n,kr}var Dr,Gl;function vf(){if(Gl)return Dr;Gl=1;var l=800,e=16,t=Date.now;function n(f){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 f.apply(void 0,arguments)}}return Dr=n,Dr}var Or,ql;function yf(){if(ql)return Or;ql=1;var l=mf(),e=vf(),t=e(l);return Or=t,Or}var Ir,Kl;function wf(){if(Kl)return Ir;Kl=1;var l=Qu(),e=pf(),t=yf();function n(f,d){return t(e(f,d,l),f+"")}return Ir=n,Ir}var Nr,Yl;function bf(){if(Yl)return Nr;Yl=1;var l=nn(),e=Bn(),t=Is(),n=ct();function f(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 Nr=f,Nr}var Fr,Zl;function Cf(){if(Zl)return Fr;Zl=1;var l=wf(),e=bf();function t(n){return l(function(f,d){var g=-1,m=d.length,c=m>1?d[m-1]:void 0,p=m>2?d[2]:void 0;for(c=n.length>3&&typeof c=="function"?(m--,c):void 0,p&&e(d[0],d[1],p)&&(c=m<3?void 0:c,m=1),f=Object(f);++g<m;){var r=d[g];r&&n(f,r,g,c)}return f})}return Fr=t,Fr}var Pr,Xl;function Sf(){if(Xl)return Pr;Xl=1;var l=df(),e=Cf(),t=e(function(n,f,d,g){l(n,f,d,g)});return Pr=t,Pr}var Af=Sf();const $f=kt(Af),Mf=()=>crypto.randomUUID().slice(0,8),xf=()=>Mf().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 f=!0;return n.length&&(f=!new RegExp(n.join("|"),"i").exec(l)),f},Ef=(l,e)=>{const t=l.indexOf(e);t!==-1&&l.splice(t,1)},Le=l=>{const e=l.className?.match(Bf);return e&&Wf[e[0]]},gt=l=>Array.from(new Set(l)),He=l=>l?.attrs?.id||l?.id||xf(),je=(l,e)=>$f({},l,e,(n,f)=>{if(Array.isArray(n))return f!=null?gt(n.concat(f)):f;if(Array.isArray(f))return n!=null?gt(f.concat(n)):f}),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 f=0,d=l.length;f<d;f++)e[f]=Xe(l[f]);return e}if(l instanceof Object){e={};for(const f in l)Object.hasOwn(l,f)&&(e[f]=Xe(l[f]));return e}throw new Error("Unable to copy Object, type not supported.")},Hr=(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=>Nf.test(l);function Tf(l,e=zs){let t=0;return function(...n){const f=Date.now();f-t>=e&&(t=f,l.apply(this,n))}}function xn(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 jn(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 Mt=l=>l?Xe(jn(l)):En();function eh(l,e,t,n={}){if(!e||!l[t][e])return n;const f=`${t}.${e}`;n[f]=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}const Lf='<?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,Vn=Ns,Rf="formeo-sprite",kf=null,Df=`https://cdn.jsdelivr.net/npm/formeo@${Fs}/dist/${Rf}.svg`,Of=`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",Ot=`${Vn}-stage`,Qe=`${Vn}-row`,Je=`${Vn}-column`,It=`${Vn}-field`,bs="custom-column-widths",nh="column-preset",Wr="resizing-columns",If=new Map([[Ot,Qe],[Qe,Je],[Je,It]]),Ps=["stage","row","column","field"],Hs=Ps.map(l=>`${l}s`);new Map(Hs.map((l,e)=>[l,Ps[e]]));const Nf=new RegExp(`^${Hs.join("|")}.`),ih=[...Ps],Ff=[...Hs],Pf=new Map(Ff.map((l,e)=>[l,ih[e]])),zr=ih.reduce((l,e)=>(l[e]=e,l),{}),Hf=[{name:"controls",className:st},{name:"stage",className:Ot},{name:"row",className:Qe},{name:"column",className:Je},{name:"field",className:It}],Ws={controls:st,stage:Ot,row:Qe,column:Je,field:It},Wf=Object.entries(Ws).reduce((l,[e,t])=>(l[t]=e,l),{}),zf=Object.values(Ws),Bf=new RegExp(`${zf.join("|")}`,"g"),{childTypeMapVals:rh,childTypeIndexMapVals:jf}=Hf.reduce((l,{name:e},t,n)=>{const{name:f}=n[t+1]||{};return f&&(l.childTypeMapVals.push([e,f]),l.childTypeIndexMapVals.push([`${e}s`,`${f}s`])),l},{childTypeMapVals:[],childTypeIndexMapVals:[]}),Vf=rh.slice().map(l=>l.slice().reverse()).reverse(),ec=new Map(rh),Uf=new Map(jf),Gf=new Map(Vf.slice()),qf=[[{value:"100.0",label:"100%"}],[{value:"50.0,50.0",label:"50 | 50"},{value:"33.3,66.6",label:"33 | 66"},{value:"66.6,33.3",label:"66 | 33"}],[{value:"33.3,33.3,33.3",label:"33 | 33 | 33"},{value:"25.0,25.0,50.0",label:"25 | 25 | 50"},{value:"50.0,25.0,25.0",label:"50 | 25 | 25"},{value:"25.0,50.0,25.0",label:"25 | 50 | 25"}],[{value:"25.0,25.0,25.0,25.0",label:"25 | 25 | 25 | 25"}],[{value:"20.0,20.0,20.0,20.0,20.0",label:"20 | 20 | 20 | 20 | 20"}],[{value:"16.66,16.66,16.66,16.66,16.66,16.66",label:"16.66 | 16.66 | 16.66 | 16.66 | 16.66 | 16.66"}]],Kf=new Map(qf.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",Yf="formeoChanged",ah="formeoUpdatedStage",lh="formeoUpdatedRow",ch="formeoUpdatedColumn",uh="formeoUpdatedField",Zf="formeoCleared",hh="formeoOnRender",Xf="formeoConditionUpdated",Bs="formeoAddedRow",js="formeoAddedColumn",Vs="formeoAddedField",Us="formeoRemovedRow",Gs="formeoRemovedColumn",qs="formeoRemovedField",dh={equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},Qf={and:"&&",or:"||"},fh={equals:"="},Jf=["logical","source","sourceProperty","comparison","target","targetProperty","assignment","value"],nc=["isChecked","isNotChecked"],ic=["isVisible","isNotVisible"],mn=["value"],ep={comparison:dh,assignment:fh,logical:Qf},ph="if",tp="then",Ks=()=>({[ph]:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],[tp]:[{target:"",targetProperty:"",assignment:"",value:""}]}),np=/(\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-",En=()=>({id:He(),stages:{[He()]:{}},rows:{},columns:{},fields:{}}),_n=["selected","checked"],ip=_n.toReversed(),rp="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`),op=new RegExp(`(?!${rp.join("|")})\\w\\S*`,"g"),sp=/\s+/g;function at(l){return typeof l!="string"||l.trim().match(sp)?l:l.replace(op,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,f=e.exec(l);for(;f!==null;)t.push(l.slice(n,f.index)),n=f.index+f[0].length,f=e.exec(l);return n<l.length&&t.push(l.slice(n)),t.filter(Boolean)},rc=(l,e="-")=>vt(l).join(e),ap=l=>{const e=document.createElement("div");return e.innerHTML=l,e.textContent||e.innerText||""},lp=(l,e,t="…")=>{if(l.length<=e)return l;const n=l.slice(0,e),f=n.lastIndexOf(" ");let d=`${f>0?n.slice(0,f):n}`;return t&&(d+=t),d};var Br,oc;function Ys(){if(oc)return Br;oc=1;var l=Dt(),e=wt(),t="[object Symbol]";function n(f){return typeof f=="symbol"||e(f)&&l(f)==t}return Br=n,Br}var jr,sc;function cp(){if(sc)return jr;sc=1;var l=bt(),e=Ys(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function f(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 jr=f,jr}var Vr,ac;function up(){if(ac)return Vr;ac=1;var l=Ls(),e="Expected a function";function t(n,f){if(typeof n!="function"||f!=null&&typeof f!="function")throw new TypeError(e);var d=function(){var g=arguments,m=f?f.apply(this,g):g[0],c=d.cache;if(c.has(m))return c.get(m);var p=n.apply(this,g);return d.cache=c.set(m,p)||c,p};return d.cache=new(t.Cache||l),d}return t.Cache=l,Vr=t,Vr}var Ur,lc;function hp(){if(lc)return Ur;lc=1;var l=up(),e=500;function t(n){var f=l(n,function(g){return d.size===e&&d.clear(),g}),d=f.cache;return f}return Ur=t,Ur}var Gr,cc;function dp(){if(cc)return Gr;cc=1;var l=hp(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=l(function(f){var d=[];return f.charCodeAt(0)===46&&d.push(""),f.replace(e,function(g,m,c,p){d.push(c?p.replace(t,"$1"):m||g)}),d});return Gr=n,Gr}var qr,uc;function fp(){if(uc)return qr;uc=1;function l(e,t){for(var n=-1,f=e==null?0:e.length,d=Array(f);++n<f;)d[n]=t(e[n],n,e);return d}return qr=l,qr}var Kr,hc;function pp(){if(hc)return Kr;hc=1;var l=Hn(),e=fp(),t=bt(),n=Ys(),f=l?l.prototype:void 0,d=f?f.toString:void 0;function g(m){if(typeof m=="string")return m;if(t(m))return e(m,g)+"";if(n(m))return d?d.call(m):"";var c=m+"";return c=="0"&&1/m==-1/0?"-0":c}return Kr=g,Kr}var Yr,dc;function Un(){if(dc)return Yr;dc=1;var l=pp();function e(t){return t==null?"":l(t)}return Yr=e,Yr}var Zr,fc;function vh(){if(fc)return Zr;fc=1;var l=bt(),e=cp(),t=dp(),n=Un();function f(d,g){return l(d)?d:e(d,g)?[d]:t(n(d))}return Zr=f,Zr}var Xr,pc;function yh(){if(pc)return Xr;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 Xr=e,Xr}var Qr,gc;function gp(){if(gc)return Qr;gc=1;var l=vh(),e=yh();function t(n,f){f=l(f,n);for(var d=0,g=f.length;n!=null&&d<g;)n=n[e(f[d++])];return d&&d==g?n:void 0}return Qr=t,Qr}var Jr,mc;function mp(){if(mc)return Jr;mc=1;var l=gp();function e(t,n,f){var d=t==null?void 0:l(t,n);return d===void 0?f:d}return Jr=e,Jr}var vp=mp();const yp=kt(vp);var eo,vc;function wp(){if(vc)return eo;vc=1;var l=Yu(),e=vh(),t=Is(),n=ct(),f=yh();function d(g,m,c,p){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=f(m[r]),u=c;if(i==="__proto__"||i==="constructor"||i==="prototype")return g;if(r!=s){var h=a[i];u=p?p(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 eo=d,eo}var to,yc;function bp(){if(yc)return to;yc=1;var l=wp();function e(t,n,f){return t==null?t:l(t,n,f)}return to=e,to}var Cp=bp();const Sp=kt(Cp),Ie=yp,Gn=Sp;function Ap(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 vn(...l){return l.flat().reduce((e,t)=>(e[t]=t,e),{})}var no,wc;function $p(){if(wc)return no;wc=1;var l="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,l),this}return no=e,no}var io,bc;function Mp(){if(bc)return io;bc=1;function l(e){return this.__data__.has(e)}return io=l,io}var ro,Cc;function xp(){if(Cc)return ro;Cc=1;var l=Ls(),e=$p(),t=Mp();function n(f){var d=-1,g=f==null?0:f.length;for(this.__data__=new l;++d<g;)this.add(f[d])}return n.prototype.add=n.prototype.push=e,n.prototype.has=t,ro=n,ro}var oo,Sc;function Ep(){if(Sc)return oo;Sc=1;function l(e,t){for(var n=-1,f=e==null?0:e.length;++n<f;)if(t(e[n],n,e))return!0;return!1}return oo=l,oo}var so,Ac;function _p(){if(Ac)return so;Ac=1;function l(e,t){return e.has(t)}return so=l,so}var ao,$c;function wh(){if($c)return ao;$c=1;var l=xp(),e=Ep(),t=_p(),n=1,f=2;function d(g,m,c,p,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&f?new l:void 0;for(o.set(g,m),o.set(m,g);++y<a;){var $=g[y],A=m[y];if(p)var S=s?p(A,$,y,m,g,o):p($,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,p,o)))return x.push(R)})){w=!1;break}}else if(!($===A||r($,A,c,p,o))){w=!1;break}}return o.delete(g),o.delete(m),w}return ao=d,ao}var lo,Mc;function Tp(){if(Mc)return lo;Mc=1;function l(e){var t=-1,n=Array(e.size);return e.forEach(function(f,d){n[++t]=[d,f]}),n}return lo=l,lo}var co,xc;function Lp(){if(xc)return co;xc=1;function l(e){var t=-1,n=Array(e.size);return e.forEach(function(f){n[++t]=f}),n}return co=l,co}var uo,Ec;function Rp(){if(Ec)return uo;Ec=1;var l=Hn(),e=ju(),t=nn(),n=wh(),f=Tp(),d=Lp(),g=1,m=2,c="[object Boolean]",p="[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 p: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=f;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 uo=A,uo}var ho,_c;function kp(){if(_c)return ho;_c=1;function l(e,t){for(var n=-1,f=t.length,d=e.length;++n<f;)e[d+n]=t[n];return e}return ho=l,ho}var fo,Tc;function Dp(){if(Tc)return fo;Tc=1;var l=kp(),e=bt();function t(n,f,d){var g=f(n);return e(n)?g:l(g,d(n))}return fo=t,fo}var po,Lc;function Op(){if(Lc)return po;Lc=1;function l(e,t){for(var n=-1,f=e==null?0:e.length,d=0,g=[];++n<f;){var m=e[n];t(m,n,e)&&(g[d++]=m)}return g}return po=l,po}var go,Rc;function Ip(){if(Rc)return go;Rc=1;function l(){return[]}return go=l,go}var mo,kc;function Np(){if(kc)return mo;kc=1;var l=Op(),e=Ip(),t=Object.prototype,n=t.propertyIsEnumerable,f=Object.getOwnPropertySymbols,d=f?function(g){return g==null?[]:(g=Object(g),l(f(g),function(m){return n.call(g,m)}))}:e;return mo=d,mo}var vo,Dc;function Fp(){if(Dc)return vo;Dc=1;var l=Vu(),e=l(Object.keys,Object);return vo=e,vo}var yo,Oc;function Pp(){if(Oc)return yo;Oc=1;var l=ks(),e=Fp(),t=Object.prototype,n=t.hasOwnProperty;function f(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 yo=f,yo}var wo,Ic;function Hp(){if(Ic)return wo;Ic=1;var l=Zu(),e=Pp(),t=Bn();function n(f){return t(f)?l(f):e(f)}return wo=n,wo}var bo,Nc;function Wp(){if(Nc)return bo;Nc=1;var l=Dp(),e=Np(),t=Hp();function n(f){return l(f,t,e)}return bo=n,bo}var Co,Fc;function zp(){if(Fc)return Co;Fc=1;var l=Wp(),e=1,t=Object.prototype,n=t.hasOwnProperty;function f(d,g,m,c,p,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||p(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 Co=f,Co}var So,Pc;function Bp(){if(Pc)return So;Pc=1;var l=yt(),e=qe(),t=l(e,"DataView");return So=t,So}var Ao,Hc;function jp(){if(Hc)return Ao;Hc=1;var l=yt(),e=qe(),t=l(e,"Promise");return Ao=t,Ao}var $o,Wc;function Vp(){if(Wc)return $o;Wc=1;var l=yt(),e=qe(),t=l(e,"Set");return $o=t,$o}var Mo,zc;function Up(){if(zc)return Mo;zc=1;var l=yt(),e=qe(),t=l(e,"WeakMap");return Mo=t,Mo}var xo,Bc;function Gp(){if(Bc)return xo;Bc=1;var l=Bp(),e=Ts(),t=jp(),n=Vp(),f=Up(),d=Dt(),g=Hu(),m="[object Map]",c="[object Object]",p="[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(f),w=d;return(l&&w(new l(new ArrayBuffer(1)))!=s||e&&w(new e)!=m||t&&w(t.resolve())!=p||n&&w(new n)!=r||f&&w(new f)!=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 p;case h:return r;case y:return o}return $}),xo=w,xo}var Eo,jc;function qp(){if(jc)return Eo;jc=1;var l=Wu(),e=wh(),t=Rp(),n=zp(),f=Gp(),d=bt(),g=Ds(),m=Os(),c=1,p="[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:f(u),R=S?r:f(h);E=E==p?o:E,R=R==p?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 Eo=i,Eo}var _o,Vc;function Kp(){if(Vc)return _o;Vc=1;var l=qp(),e=wt();function t(n,f,d,g,m){return n===f?!0:n==null||f==null||!e(n)&&!e(f)?n!==n&&f!==f:l(n,f,d,g,t,m)}return _o=t,_o}var To,Uc;function Yp(){if(Uc)return To;Uc=1;var l=Kp();function e(t,n){return l(t,n)}return To=e,To}var Zp=Yp();const Ss=kt(Zp),Xp=(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),f=Gn(this.data,e,t),d=Array.isArray(e)?e.join("."):e,g=Object.keys(this.setCallbacks).filter(c=>new RegExp(c).test(d)),m={newVal:t,oldVal:n,path:e};for(const c of g)for(const p of this.setCallbacks[c])p(m);if(!this.disableEvents){const c={entity:this,dataPath:this.dataPath.replace(/\.+$/,""),changePath:this.dataPath+e,value:t,data:f,changeType:Xp(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 f}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,f=e||n||He();return this.set(f,t)};remove=e=>{const t=vt(e),n=t.pop(),f=this.get(t);return Array.isArray(f)?f.splice(Number(n),1):f&&delete f[n],f};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 qn extends Zs{load=e=>{const t=jn(e);this.empty();for(const[n,f]of Object.entries(t))this.add(n,f);return this.data};get=e=>e?Ie(this.data,e):this.add();add=(e,t=Object.create(null))=>{const n=e||He(),f=this.Component({...t,id:n});this.data[n]=f,this.active=f;const g={row:Bs,column:js,field:Vs}[this.name];return g&&J.formeoUpdated({entity:f,componentId:n,componentType:this.name,data:f.data},g),f};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(f){return Object.getOwnPropertyDescriptor(l,f).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){Qp(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 yn(l){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?yn=function(e){return typeof e}:yn=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yn(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 Jp(l,e){if(l==null)return{};var t={},n=Object.keys(l),f,d;for(d=0;d<n.length;d++)f=n[d],!(e.indexOf(f)>=0)&&(t[f]=l[f]);return t}function eg(l,e){if(l==null)return{};var t=Jp(l,e),n,f;if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(l);for(f=0;f<d.length;f++)n=d[f],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(l,n)&&(t[n]=l[n])}return t}var tg="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 Tn(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&&Tn(l,e):Tn(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 _t(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 f=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return f&&new f(t)}function $h(l,e,t){if(l){var n=l.getElementsByTagName(e),f=0,d=n.length;if(t)for(;f<d;f++)t(n[f],f);return n}return[]}function Ue(){var l=document.scrollingElement;return l||document.documentElement}function be(l,e,t,n,f){if(!(!l.getBoundingClientRect&&l!==window)){var d,g,m,c,p,r,o;if(l!==window&&l.parentNode&&l!==Ue()?(d=l.getBoundingClientRect(),g=d.top,m=d.left,c=d.bottom,p=d.right,r=d.height,o=d.width):(g=0,m=0,c=window.innerHeight,p=window.innerWidth,r=window.innerHeight,o=window.innerWidth),(e||t)&&l!==window&&(f=f||l.parentNode,!nt))do if(f&&f.getBoundingClientRect&&(ne(f,"transform")!=="none"||t&&ne(f,"position")!=="static")){var s=f.getBoundingClientRect();g-=s.top+parseInt(ne(f,"border-top-width")),m-=s.left+parseInt(ne(f,"border-left-width")),c=g+d.height,p=m+d.width;break}while(f=f.parentNode);if(n&&l!==window){var a=_t(f||l),i=a&&a.a,u=a&&a.d;a&&(g/=u,m/=i,o/=i,r/=u,c=g+r,p=m+o)}return{top:g,left:m,bottom:c,right:p,width:o,height:r}}}function Yc(l,e,t){for(var n=ot(l,!0),f=be(l)[e];n;){var d=be(n)[t],g=void 0;if(g=f>=d,!g)return n;if(n===Ue())break;n=ot(n,!1)}return!1}function Tt(l,e,t,n){for(var f=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(f===e)return g[d];f++}d++}return null}function Xs(l,e){for(var t=l.lastElementChild;t&&(t===te.ghost||ne(t,"display")==="none"||e&&!Tn(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||Tn(l,e))&&t++;return t}function Zc(l){var e=0,t=0,n=Ue();if(l)do{var f=_t(l),d=f.a,g=f.d;e+=l.scrollLeft*d,t+=l.scrollTop*g}while(l!==n&&(l=l.parentNode));return[e,t]}function ng(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 f=ne(t);if(t.clientWidth<t.scrollWidth&&(f.overflowX=="auto"||f.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(f.overflowY=="auto"||f.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return Ue();if(n||e)return t;n=!0}}while(t=t.parentNode);return Ue()}function ig(l,e){if(l&&e)for(var t in e)e.hasOwnProperty(t)&&(l[t]=e[t]);return l}function Lo(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 rg(){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(f){var d,g,m,c;if(!(!Be(f,e.draggable,l,!1)||f.animated||f===t)){var p=be(f);n.left=Math.min((d=n.left)!==null&&d!==void 0?d:1/0,p.left),n.top=Math.min((g=n.top)!==null&&g!==void 0?g:1/0,p.top),n.right=Math.max((m=n.right)!==null&&m!==void 0?m:-1/0,p.right),n.bottom=Math.max((c=n.bottom)!==null&&c!==void 0?c:-1/0,p.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 og(){var l=[],e;return{captureAnimationState:function(){if(l=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(f){if(!(ne(f,"display")==="none"||f===te.ghost)){l.push({target:f,rect:be(f)});var d=Ge({},l[l.length-1].rect);if(f.thisAnimationDuration){var g=_t(f,!0);g&&(d.top-=g.f,d.left-=g.e)}f.fromRect=d}})}},addAnimationState:function(n){l.push(n)},removeAnimationState:function(n){l.splice(ng(l,{target:n}),1)},animateAll:function(n){var f=this;if(!this.options.animation){clearTimeout(e),typeof n=="function"&&n();return}var d=!1,g=0;l.forEach(function(m){var c=0,p=m.target,r=p.fromRect,o=be(p),s=p.prevFromRect,a=p.prevToRect,i=m.rect,u=_t(p,!0);u&&(o.top-=u.f,o.left-=u.e),p.toRect=o,p.thisAnimationDuration&&Lo(s,o)&&!Lo(r,o)&&(i.top-o.top)/(i.left-o.left)===(r.top-o.top)/(r.left-o.left)&&(c=ag(i,s,a,f.options)),Lo(o,r)||(p.prevFromRect=r,p.prevToRect=o,c||(c=f.options.animation),f.animate(p,i,o,c)),c&&(d=!0,g=Math.max(g,c),clearTimeout(p.animationResetTimer),p.animationResetTimer=setTimeout(function(){p.animationTime=0,p.prevFromRect=null,p.fromRect=null,p.prevToRect=null,p.thisAnimationDuration=null},c),p.thisAnimationDuration=c)}),clearTimeout(e),d?e=setTimeout(function(){typeof n=="function"&&n()},g):typeof n=="function"&&n(),l=[]},animate:function(n,f,d,g){if(g){ne(n,"transition",""),ne(n,"transform","");var m=_t(this.el),c=m&&m.a,p=m&&m.d,r=(f.left-d.left)/(c||1),o=(f.top-d.top)/(p||1);n.animatingX=!!r,n.animatingY=!!o,ne(n,"transform","translate3d("+r+"px,"+o+"px,0)"),this.forRepaintDummy=sg(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 sg(l){return l.offsetWidth}function ag(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=[],Ro={initializeByDefault:!0},on={mount:function(e){for(var t in Ro)Ro.hasOwnProperty(t)&&!(t in e)&&(e[t]=Ro[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 f=this;this.eventCanceled=!1,n.cancel=function(){f.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,f){Ct.forEach(function(m){var c=m.pluginName;if(!(!e.options[c]&&!m.initializeByDefault)){var p=new m(e,t,e.options);p.sortable=e,p.options=e.options,e[c]=p,et(n,p.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(f){typeof f.eventProperties=="function"&&et(n,f.eventProperties.call(t[f.pluginName],e))}),n},modifyOption:function(e,t,n){var f;return Ct.forEach(function(d){e[d.pluginName]&&d.optionListeners&&typeof d.optionListeners[t]=="function"&&(f=d.optionListeners[t].call(e[d.pluginName],n))}),f}};function lg(l){var e=l.sortable,t=l.rootEl,n=l.name,f=l.targetEl,d=l.cloneEl,g=l.toEl,m=l.fromEl,c=l.oldIndex,p=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=f||t,u.clone=d,u.oldIndex=c,u.newIndex=p,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 cg=["evt"],Te=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},f=n.evt,d=eg(n,cg);on.pluginEvent.bind(te)(e,t,Ge({dragEl:q,parentEl:ve,ghostEl:ie,rootEl:fe,nextEl:pt,lastDownEl:wn,cloneEl:pe,cloneHidden:rt,dragStarted:jt,putSortable:Se,activeSortable:te.active,originalEvent:f,oldIndex:xt,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:f})}},d))};function Me(l){lg(Ge({putSortable:Se,cloneEl:pe,targetEl:q,rootEl:fe,oldIndex:xt,oldDraggableIndex:Yt,newIndex:Oe,newDraggableIndex:it},l))}var q,ve,ie,fe,pt,wn,pe,rt,xt,Oe,Yt,it,ln,Se,At=!1,Ln=!1,Rn=[],dt,We,ko,Do,Xc,Qc,jt,St,Zt,Xt=!1,cn=!1,bn,Ae,Oo=[],As=!1,kn=[],Kn=typeof document<"u",un=bh,Jc=rn||nt?"cssFloat":"float",ug=Kn&&!Ch&&!bh&&"draggable"in document.createElement("div"),Th=(function(){if(Kn){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),f=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),d=Tt(e,0,t),g=Tt(e,1,t),m=d&&ne(d),c=g&&ne(g),p=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"||p>=f&&n[Jc]==="none"||g&&n[Jc]==="none"&&p+r>f)?"vertical":"horizontal"},hg=function(e,t,n){var f=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,p=n?t.width:t.height;return f===m||d===c||f+g/2===m+p/2},dg=function(e,t){var n;return Rn.some(function(f){var d=f[Re].options.emptyInsertThreshold;if(!(!d||Xs(f))){var g=be(f),m=e>=g.left-d&&e<=g.right+d,c=t>=g.top-d&&t<=g.bottom+d;if(m&&c)return n=f}}),n},Rh=function(e){function t(d,g){return function(m,c,p,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,p,r),g)(m,c,p,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={},f=e.group;(!f||yn(f)!="object")&&(f={name:f}),n.name=f.name,n.checkPull=t(f.pull,!0),n.checkPut=t(f.put),n.revertClone=f.revertClone,e.group=n},kh=function(){!Th&&ie&&ne(ie,"display","none")},Dh=function(){!Th&&ie&&ne(ie,"display","")};Kn&&!Ch&&document.addEventListener("click",function(l){if(Ln)return l.preventDefault(),l.stopPropagation&&l.stopPropagation(),l.stopImmediatePropagation&&l.stopImmediatePropagation(),Ln=!1,!1},!0);var ft=function(e){if(q){e=e.touches?e.touches[0]:e;var t=dg(e.clientX,e.clientY);if(t){var n={};for(var f in e)e.hasOwnProperty(f)&&(n[f]=e[f]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[Re]._onDragOver(n)}}},fg=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 f in this)f.charAt(0)==="_"&&typeof this[f]=="function"&&(this[f]=this[f].bind(this));this.nativeDraggable=e.forceFallback?!1:ug,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)),Rn.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),et(this,og())}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,f=this.options,d=f.preventOnFilter,g=e.type,m=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,c=(m||e).target,p=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||c,r=f.filter;if(Cg(n),!q&&!(/mousedown|pointerdown/.test(g)&&e.button!==0||f.disabled)&&!p.isContentEditable&&!(!this.nativeDraggable&&qt&&c&&c.tagName.toUpperCase()==="SELECT")&&(c=Be(c,f.draggable,n,!1),!(c&&c.animated)&&wn!==c)){if(xt=Fe(c),Yt=Fe(c,f.draggable),typeof r=="function"){if(r.call(this,e,c,this)){Me({sortable:t,rootEl:p,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(p,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}f.handle&&!Be(p,f.handle,n,!1)||this._prepareDragStart(e,m,c)}}},_prepareDragStart:function(e,t,n){var f=this,d=f.el,g=f.options,m=d.ownerDocument,c;if(n&&!q&&n.parentNode===d){var p=be(n);if(fe=d,q=n,ve=q.parentNode,pt=q.nextSibling,wn=n,ln=g.group,te.dragged=q,dt={target:q,clientX:(t||e).clientX,clientY:(t||e).clientY},Xc=dt.clientX-p.left,Qc=dt.clientY-p.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,q.style["will-change"]="all",c=function(){if(Te("delayEnded",f,{evt:e}),te.eventCanceled){f._onDrop();return}f._disableDelayedDragEvents(),!qc&&f.nativeDraggable&&(q.draggable=!0),f._triggerDragStart(e,t),Me({sortable:f,name:"choose",originalEvent:e}),De(q,g.chosenClass,!0)},g.ignore.split(",").forEach(function(r){$h(q,r.trim(),Io)}),se(m,"dragover",ft),se(m,"mousemove",ft),se(m,"touchmove",ft),se(m,"mouseup",f._onDrop),se(m,"touchend",f._onDrop),se(m,"touchcancel",f._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",f._disableDelayedDrag),se(m,"touchend",f._disableDelayedDrag),se(m,"touchcancel",f._disableDelayedDrag),se(m,"mousemove",f._delayedDragTouchMoveHandler),se(m,"touchmove",f._delayedDragTouchMoveHandler),g.supportPointer&&se(m,"pointermove",f._delayedDragTouchMoveHandler),f._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&&Io(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?Cn(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",fg);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,f=t.fallbackOffset,d=e.touches?e.touches[0]:e,g=ie&&_t(ie,!0),m=ie&&g&&g.a,c=ie&&g&&g.d,p=un&&Ae&&Zc(Ae),r=(d.clientX-dt.clientX+f.x)/(m||1)+(p?p[0]-Oo[0]:0)/(m||1),o=(d.clientY-dt.clientY+f.y)/(c||1)+(p?p[1]-Oo[1]:0)/(c||1);if(!te.active&&!At){if(n&&Math.max(Math.abs(d.clientX-this._lastX),Math.abs(d.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(ie){g?(g.e+=r-(ko||0),g.f+=o-(Do||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),ko=r,Do=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(),Oo=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,f=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=Cn(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?(Ln=!0,n._loopId=setInterval(n._emulateDragOver,50)):(oe(document,"mouseup",n._onDrop),oe(document,"touchend",n._onDrop),oe(document,"touchcancel",n._onDrop),f&&(f.effectAllowed="move",d.setData&&d.setData.call(n,f,q)),se(document,"drop",n),ne(q,"transform","translateZ(0)")),At=!0,n._dragStartId=Cn(n._dragStarted.bind(n,t,e)),se(document,"selectstart",n),jt=!0,qt&&ne(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,n=e.target,f,d,g,m=this.options,c=m.group,p=te.active,r=ln===c,o=m.sort,s=Se||p,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:f,targetRect:d,canSort:o,fromSortable:s,target:n,completed:w,onMove:function(P,B){return hn(fe,t,q,f,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?p._hideClone():p._showClone(i),i!==s&&(De(q,Se?Se.options.ghostClass:p.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(Ln=!1,p&&!m.disabled&&(r?o||(g=ve!==fe):Se===this||(this.lastPutMode=ln.checkPull(this,p,q,e))&&c.checkPut(this,p,q,e))){if(a=this._getDirection(e,n)==="vertical",f=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(!$||vg(e,a,this)&&!$.animated){if($===q)return w(!1);if($&&t===e.target&&(n=$),n&&(d=be(n)),hn(fe,t,q,f,n,d,e,!!n)!==!1)return y(),$&&$.nextSibling?t.insertBefore(q,$.nextSibling):t.appendChild(q),ve=t,x(),w(!0)}else if($&&mg(e,a,this)){var A=Tt(t,0,m,!0);if(A===q)return w(!1);if(n=A,d=be(n),hn(fe,t,q,f,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=!hg(q.animated&&q.toRect||f,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=yg(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,f,n,d,e,T);if(k!==!1)return(k===1||k===-1)&&(T=k===1),As=!0,setTimeout(gg,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&&(bn=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&&(jt&&(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),Io(q),q.style["will-change"]="",jt&&!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!==xt&&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=xt,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=wn=rt=dt=We=jt=Oe=it=xt=Yt=St=Zt=Se=ln=te.dragged=te.ghost=te.clone=te.active=null,kn.forEach(function(e){e.checked=!0}),kn.length=ko=Do=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":q&&(this._onDragOver(e),pg(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,f=0,d=n.length,g=this.options;f<d;f++)t=n[f],Be(t,g.draggable,this.el,!1)&&e.push(t.getAttribute(g.dataIdAttr)||bg(t));return e},sort:function(e,t){var n={},f=this.el;this.toArray().forEach(function(d,g){var m=f.children[g];Be(m,this.options.draggable,f,!1)&&(n[d]=m)},this),t&&this.captureAnimationState(),e.forEach(function(d){n[d]&&(f.removeChild(n[d]),f.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 f=on.modifyOption(this,e,t);typeof f<"u"?n[e]=f: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(),Rn.splice(Rn.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 pg(l){l.dataTransfer&&(l.dataTransfer.dropEffect="move"),l.cancelable&&l.preventDefault()}function hn(l,e,t,n,f,d,g,m){var c,p=l[Re],r=p.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=f||e,c.relatedRect=d||be(e),c.willInsertAfter=m,c.originalEvent=g,l.dispatchEvent(c),r&&(o=r.call(p,c,g)),o}function Io(l){l.draggable=!1}function gg(){As=!1}function mg(l,e,t){var n=be(Tt(t.el,0,t.options,!0)),f=_h(t.el,t.options,ie),d=10;return e?l.clientX<f.left-d||l.clientY<n.top&&l.clientX<n.right:l.clientY<f.top-d||l.clientY<n.bottom&&l.clientX<n.left}function vg(l,e,t){var n=be(Xs(t.el,t.options.draggable)),f=_h(t.el,t.options,ie),d=10;return e?l.clientX>f.right+d||l.clientY>n.bottom&&l.clientX>n.left:l.clientY>f.bottom+d||l.clientX>n.right&&l.clientY>n.top}function yg(l,e,t,n,f,d,g,m){var c=n?l.clientY:l.clientX,p=n?t.height:t.width,r=n?t.top:t.left,o=n?t.bottom:t.right,s=!1;if(!g){if(m&&bn<p*f){if(!Xt&&(Zt===1?c>r+p*d/2:c<o-p*d/2)&&(Xt=!0),Xt)s=!0;else if(Zt===1?c<r+bn:c>o-bn)return-Zt}else if(c>r+p*(1-f)/2&&c<o-p*(1-f)/2)return wg(e)}return s=s||g,s&&(c<r+p*d/2||c>o-p*d/2)?c>r+p/2?1:-1:0}function wg(l){return Fe(q)<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 Cg(l){kn.length=0;for(var e=l.getElementsByTagName("input"),t=e.length;t--;){var n=e[t];n.checked&&kn.push(n)}}function Cn(l){return setTimeout(l,0)}function $s(l){return clearTimeout(l)}Kn&&se(document,"touchmove",function(l){(te.active||At)&&l.cancelable&&l.preventDefault()});te.utils={on:se,off:oe,css:ne,find:$h,is:function(e,t){return!!Be(e,t,e,!1)},extend:ig,throttle:Mh,closest:Be,toggleClass:De,clone:Eh,index:Fe,nextTick:Cn,cancelNextTick:$s,detectDirection:Lh,getChild:Tt,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=tg;var we=[],Vt,Ms,xs=!1,No,Fo,Dn,Ut;function Sg(){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(),Sn(),rg()},nulling:function(){Dn=Ms=Vt=xs=Ut=No=Fo=null,we.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,n){var f=this,d=(t.touches?t.touches[0]:t).clientX,g=(t.touches?t.touches[0]:t).clientY,m=document.elementFromPoint(d,g);if(Dn=t,n||this.options.forceAutoScrollFallback||rn||nt||qt){Po(t,this.options,m,n);var c=ot(m,!0);xs&&(!Ut||d!==No||g!==Fo)&&(Ut&&eu(),Ut=setInterval(function(){var p=ot(document.elementFromPoint(d,g),!0);p!==c&&(c=p,Sn()),Po(t,f.options,p,n)},10),No=d,Fo=g)}else{if(!this.options.bubbleScroll||ot(m,!0)===Ue()){Sn();return}Po(t,this.options,ot(m,!1),!1)}}},et(l,{pluginName:"scroll",initializeByDefault:!0})}function Sn(){we.forEach(function(l){clearInterval(l.pid)}),we=[]}function eu(){clearInterval(Ut)}var Po=Mh(function(l,e,t,n){if(e.scroll){var f=(l.touches?l.touches[0]:l).clientX,d=(l.touches?l.touches[0]:l).clientY,g=e.scrollSensitivity,m=e.scrollSpeed,c=Ue(),p=!1,r;Ms!==t&&(Ms=t,Sn(),Vt=e.scroll,r=e.scrollFn,Vt===!0&&(Vt=ot(t,!0)));var o=0,s=Vt;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-f)<=g&&_+x<E)-(Math.abs(y-f)<=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)&&(p=!0,we[o].pid=setInterval((function(){n&&this.layer===0&&te.active._onTouchMove(Dn);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,Dn,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=p}},30),Oh=function(e){var t=e.originalEvent,n=e.putSortable,f=e.dragEl,d=e.activeSortable,g=e.dispatchSortableEvent,m=e.hideGhostForTarget,c=e.unhideGhostForTarget;if(t){var p=n||d;m();var r=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,o=document.elementFromPoint(r.clientX,r.clientY);c(),p&&!p.el.contains(o)&&(g("spill"),this.onSpill({dragEl:f,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 f=Tt(this.sortable.el,this.startIndex,this.options);f?this.sortable.el.insertBefore(t,f):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,f=n||this.sortable;f.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),f.animateAll()},drop:Oh};et(Js,{pluginName:"removeOnSpill"});te.mount(new Sg);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 f=Number(l.style.opacity)-t;f>0?(l.style.opacity=f,window.requestAnimationFrame(n)):l.remove()})()},slideDown:(l,e=250,t=!1)=>{l.style.display="block";const n=$e.getStyle(l),f=Number.parseInt(n.height,10),d=f/(e/60);l.style.height="0px",(function g(){const m=Number.parseFloat(l.style.height),c=m+d;m<f?(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),f=Number.parseInt(n.height,10),d=n.overflow;l.style.overflow="hidden",l.style.height=`${f}px`;const g=n.minHeight;l.style.minHeight="auto";const m=parseFloat(f/(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},On=(l,e,t)=>{const n=t.split("||"),d=gt(e).map(g=>l.find(m=>{const c=n.find(p=>!!Ie(m,p));return c&&Ie(m,c)===g})).filter(Boolean).concat(l);return gt(d)},Yn=(l,e,t)=>{for(let n=0;n<l.length;n++)e.call(t,l[n],n)},ea=(l,e)=>{const t=[];return Yn(l,(n,f)=>t.push(e(n,f))),t},Ho={},Nh=l=>{const e={className:"class"};if(Ho[l])return Ho[l];const n=(e[l]||l).replace(/^\d+/,"").replace(/[^a-zA-Z0-9-:]/g,"");return Ho[l]=n,n},Fh=l=>l.replace(/\b\w/g,e=>e.toUpperCase()),Ag=l=>window.JSON.parse(window.JSON.stringify(l)),$g=(l,e)=>e.filter(t=>!~l.indexOf(t)),Ne={capitalize:Fh,safeAttrName:Nh,forEach:Yn,copyObj:Ag,map:ea,subtract:$g,indexOfNode:lt,isInt:Ih,get:Ie,orderObjectsBy:On},Ve={js:new Set,css:new Set,formeoSprite:null},tu=(l,e,t=ws)=>new Promise(n=>fetch(l).then(f=>{if(!f.ok)return n(t(f));n(e?e(f):f)}).catch(f=>t(f))),Ph=(l,e)=>{l.removeEventListener("load",Ph),e(l.src)},Hh=(l,e)=>{l.removeEventListener("load",Hh),e(l.src)},Mg=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,f)=>{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:()=>f(new Error(`${(void 0).src} failed to load.`))}});document.head.appendChild(d)}));return Promise.all(e)},xg=l=>{l=Array.isArray(l)?l:[l];const e=l.map(t=>Mg(t));return Promise.all(e)},Eg=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},_g=async(l=kf)=>{if(Ve.formeoSprite)return Ve.formeoSprite;if(!l)return nu(Lf);const e=async t=>nu(await t.text());return tu(l,e,()=>tu(Df,e))},Tg={js:xg,css:Eg},Wh=l=>{const e=Object.entries(l).map(([t,n])=>Tg[t](n));return Promise.all(e)},Lg=async l=>{if(!Ve.css.has(l)&&(await Es(l),!Ve.css.has(Jl)))return await Es(Jl)},Rg={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>`},kg=new Set(["input","textarea","select"]),Dg=l=>l.replace(/^on([A-Z])/,(e,t)=>t.toLowerCase()),Og=new Set(["focus","blur"]),Ig=l=>{const e=Dg(l);return(t,n)=>t.addEventListener(e,n,Og.has(e))},zh=(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=ap(n)),e=`${t}-${mh(lp(n,24,null))}`),e||t};class Ng{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:f,...d}=t.attrs;f&&(typeof f=="string"?n=f:n=(f.find(m=>m.selected===!0)||f[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,f=["children","content"],{className:d,options:g,dataset:m,...c}=this.processElemArg(e);f.push("tag");let p;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)p=n.childType(y),i[p](y)},function:h=>{h=h(),p=n.childType(h),i[p](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);f.push("options")}if(c.attrs&&(n.processAttrs(c,a,t),f.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)}}f.push("config")}if(c.content||c.children){const h=c.content||c.children;p=n.childType(h),i[p]||console.error(`childType: ${p} is not supported`),i[p].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]);f.push("dataset")}c.action&&(this.actionHandler(a,c.action),f.push("action"));const u=Ne.subtract(f,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 f=Date.now(),d=()=>{!e.parentElement&&Date.now()-f<n?window.requestAnimationFrame(d):e.parentElement&&t(e)};d()};actionHandler(e,t){const n={onRender:V.onRender,render:V.onRender};return Object.entries(t).map(([f,d])=>(Array.isArray(d)?d:[d]).map(m=>(n[f]||Ig(f))(e,m)))}get icons(){if(this.iconSymbols)return this.iconSymbols;const e=Ve.formeoSprite.querySelectorAll("svg symbol"),t=n=>{const f=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:f,xmlns:"http://www.w3.org/2000/svg"},children:d}};return this.iconSymbols=Array.from(e).reduce((n,f)=>{const d=f.id.replace(gh,"");return n[d]=t(f),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 f=this.icons[e];if(f){if(t){const d=je(f,t);return this.cachedIcons[n]=V.create(d).outerHTML,this.cachedIcons[n]}return this.cachedIcons[n]=V.create(f).outerHTML,this.cachedIcons[n]}return Rg[V.options.iconFont]?.(e)||e}processAttrs(e,t,n){const{attrs:f={}}=e;if(!n&&!f.name&&f.name!==null&&this.isInput(e.tag)){const d=zh(e);d&&t.setAttribute("name",d)}for(const d of Object.keys(f)){const g=Ne.safeAttrName(d),m=this.processAttrValue(f[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(f=>f.selected===!0);t=n.length?n[0].value:t[0].value}else t=t.join(" ");return t}toggleElementsByStr=(e,t)=>{const n=[],f=(d,g)=>{g?(d.style.display="block",n.push(d)):d.style.display="none"};return V.elementsContainText(e,t,f),n};elementsContainText=(e,t,n)=>{const f=[];return Yn(e,d=>{const m=d.textContent.toLowerCase().indexOf(t.toLowerCase())!==-1;n?.(d,m),m&&f.push(d)}),f};generateOption=({type:e="option",label:t,value:n,i:f=0,selected:d})=>({tag:e==="option"?"option":"input",attrs:{type:e,value:n||`${e}-${f}`,[e==="option"?"selected":"checked"]:d||!f},config:{label:t||X.get("labelCount",{label:X.get("option"),count:f})}});processOptions(e,t,n){const{action:f,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:f},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),kg.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:f=""}}=e;const{id:d,attrs:g}=e;typeof f=="function"&&(f=f());const m={tag:"label",attrs:{for:d||g?.id},className:[],children:[f,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),f=t.getElementsByClassName(`formeo-${n}`);if(this.remove(e),!f.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:f=>f.classList.remove(t),array:f=>{for(const d of t)f.classList.remove(d)}};n.object=n.string,Ne.forEach(e,n[this.childType(t)])}addClasses(e,t){const n={string:f=>f.classList.add(t),array:f=>{for(const d of t)f.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 f=Le(e);if(!f)return;const d=Le(e.parentElement),g=V[f].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(If.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)===Ot;isRow=e=>Le(e)===Qe;isColumn=e=>Le(e)===Je;isField=e=>Le(e)===It;asComponent=e=>ce[`${Le(e)}s`].get(e.id);isDOMElement(e){return e instanceof window.Element||e instanceof window.HTMLElement||!!(e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string")}}const V=new Ng,Fg="modulepreload",Pg=function(l){return"/formeo/"+l},iu={},$t=function(e,t,n){let f=Promise.resolve();if(t&&t.length>0){let c=function(p){return Promise.all(p.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");f=c(t.map(p=>{if(p=Pg(p),p in iu)return;iu[p]=!0;const r=p.endsWith(".css"),o=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${o}`))return;const s=document.createElement("link");if(s.rel=r?"stylesheet":Fg,r||(s.as="script"),s.crossOrigin="",s.href=p,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 ${p}`)))})}))}function d(g){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=g,window.dispatchEvent(m),!m.defaultPrevented)throw g}return f.then(g=>{for(const m of g||[])m.status==="rejected"&&d(m.reason);return e().catch(d)})},Et="f-autocomplete",Hg=`${Et}-display-field`,ta=`${Et}-list`,Pt="highlight-component",In=`${ta}-item`,Wg=(l,e)=>{const t=l.reduce((n,f)=>n+(f===e),0);return t>1?`(${t})`:""},Bh=["config.label","config.controlId"],zg=["config.legend","name"],Bg=[...Bh,...zg],Wo=l=>Bh.reduce((e,t)=>e||l.get(t),null),ru=l=>Bg.reduce((e,t)=>e||l.get(t),null)||at(l.name),jg=new Map([["condition.source",Wo],["if.condition.source",Wo],["if.condition.target",Wo],["then.condition.target",ru],["condition.target",ru]]),jh=({id:l,...e},t)=>{const{name:n,label:f}=e;return n?jg.get(t)(e):f},Vg=({selectedId:l,...e})=>(e.value===l&&(e.selected=!0),e),zo=l=>(l.classList.contains(In)||(l=l.parentElement),l),Vh=({value:l,textLabel:e,htmlLabel:t,componentType:n,depth:f=0},d)=>{const g={tag:"li",children:t,dataset:{value:l,label:e},className:[In,`${In}-depth-${f}`,`component-type-${n}`],action:{mousedown:({target:m})=>{m=zo(m),d.setValue(m),d.selectOption(m),d.hideList()},mouseover:({target:m})=>{m=zo(m),d.removeHighlight(),d.highlightComponent(m)},mouseleave:({target:m})=>{m=zo(m),d.removeHighlight()}}};return V.create(g)},Ug=(l,e)=>{const t=l.data.options.map((f,d)=>{const g=`${l.address}.options[${d}]`,m=f.label,c=f.label;return Vh({value:g,textLabel:m,htmlLabel:c,componentType:"option",depth:1},e)});return V.create({tag:"ul",attrs:{className:[ta,"options-list"]},children:t})},Gg=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 p=m.name,r={tag:"span",content:` ${at(p)}`,className:"component-type"},o=`${p}.${c}`;t.push(o);const s=Wg(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=Ug(m,l);i.push(y)}const h=Vg({value:g,textLabel:u,htmlLabel:i,componentType:p,selectedId:e});d.push(Vh(h,l))}return d},[])};class qg{lastCache=Date.now();optionsCache=null;constructor({key:e,value:t,className:n,onChange:f=ws}){this.key=e,this.className=[n||this.key.replace(/\./g,"-")].flat(),this.value=t,this.onChange=f||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 f=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),f.style.display==="none"?this.showList(d):this.hideList()),n.preventDefault()}],[27,()=>{this.hideList()}]]).get(n.keyCode);return m||(m=()=>!1),m()},t={focus:({target:n})=>{this.updateOptions(),n.parentElement.classList.add(`${Et}-focused`);const f=V.toggleElementsByStr(this.list.querySelectorAll(`.${In}-depth-0`),n.value);n.addEventListener("keydown",e);const d=this.list.querySelector(".active-option")||f[0];this.showList(d)},blur:({target:n})=>{n.parentElement.classList.remove(`${Et}-focused`),n.removeEventListener("keydown",e),this.hideList()},input:n=>{const{value:f}=n.target,d=V.toggleElementsByStr(this.list.querySelectorAll("li"),f);if(f.length===0&&this.clearValue(),d.length===0)this.hideList();else{const g=this.getActiveOption()||d[0];this.showList(g)}this.setValue({dataset:{label:f,value:f}})}};return this.displayField=V.create({tag:"input",autocomplete:"off",action:t,attrs:{type:"text",className:Hg,value:this.label||this.value,placeholder:X.get(`${this.key}.placeholder`)}}),this.hiddenField=V.create({tag:"input",attrs:{type:"hidden",className:Et,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:[Et,this.className].flat(),action:{onRender:n=>{this.stage=n.closest(".formeo-stage"),this.value&&(this.displayField.value=this.label),this.clearButton.classList.toggle("hidden",!this.value.length)}}}),this.dom}get label(){if(!Pe(this.value))return this.value;const e=this.value&&ce.getAddress(this.value);return e&&jh(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=Gg(this),this.optionsCache}setListPosition(){const{offsetHeight:e,offsetWidth:t}=this.displayField,n=this.displayField.closest(".formeo-stage").getBoundingClientRect(),f=this.displayField.getBoundingClientRect(),d={position:"absolute",top:`${f.y+e-n.y}px`,left:`${f.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 f of n){const{dataset:{value:d}}=f;f.classList.remove("active-option"),Pe(d)&&ce.getAddress(d)?.dom?.classList.remove(Pt)}e&&(e.classList.add("active-option"),this.highlightComponent(e))}removeHighlight(){const e=document.getElementsByClassName(Pt);for(const t of e)t.classList.remove(Pt)}highlightComponent(e){const{dataset:{value:t}}=e;if(Pe(t)){const{componentAddress:n,isOptionAddress:f,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(Pt),f&&g.dom.querySelectorAll(".field-preview .f-checkbox, .field-preview .f-radio")[d]?.classList.add(Pt))}}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 f={tag:"input",attrs:{type:t,value:e,placeholder:X.get(`${l}.placeholder`)||at(l)},className:[l.replace(/\./g,"-")],config:{}};return n&&(f.attrs.checked=!0),f}function Uh(l){const e=X.get(l);if(e)return e;const t=l.split(".");return X.get(t[t.length-1])}const Lt={autocomplete:(...l)=>new qg(...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:Uh(`placeholder.${l}`)},className:[l.replace(/\./g,"-")],options:e}),object:l=>Object.entries(l).map(([e,t])=>Lt[V.childType(t)]({key:e,value:t}))},Kg={boolean:(l,e)=>({click:({target:t})=>{if(t.type==="radio"){const n=e.data.options.map(f=>({...f,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:()=>({})},Gh="hidden-property",Yg="hidden-option",jo=/\.options\[\d+\]$/,Zg={"if-sourceProperty":vn(mn,nc,ic),"if-targetProperty":vn(mn),"then-targetProperty":vn(mn,nc,ic),...Object.entries(ep).reduce((l,[e,t])=>(l[`if-${e}`]=t,l[`then-${e}`]=t,l),{})},qh={assignment:Ht,comparison:Ht,logical:Ht,source:({key:l,value:e,onChange:t,conditionType:n})=>Lt.autocomplete({key:`${n}.condition.${l}`,value:e,onChange:t,className:`condition-${l}`}),sourceProperty:Ht,targetProperty:Ht,target:l=>qh.source(l),value:({key:l,value:e,onChange:t},n)=>{const f=Lt.string({key:`condition.${l}`,value:e});return f.action={input:t},f}};function Xg({key:l,value:e,conditionType:t}){const n=`${t}-${l}`,f=Zg[n];return Object.entries(f||{}).map(([d,g])=>Qg({fieldName:l,fieldValue:e,key:d,optionValue:g}))}function Qg({fieldName:l,fieldValue:e,key:t,optionValue:n}){return{label:X.get(`${l}.${t}`)||at(t).toLowerCase(),value:n,selected:n===e}}function Ht({key:l,value:e,onChange:t,conditionType:n}){const f=Xg({key:l,value:e,conditionType:n}),d=Lt.array({key:`condition.${l}`,value:f});return d.action={change:t},d}const Jg=l=>!l?.classList.contains(Gh),em={sourceProperty:l=>{const e=l.get("source"),t=l.get("sourceProperty"),n=!!e.value,f=!!e.value.match(jo);return su(f,t),!n},comparison:l=>{const e=l.get("source"),t=l.get("sourceProperty"),n=!!e.value,f=!!e.value.match(jo);return!n||f||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(jo);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||!Jg(l.get("comparison"))||t.value===Kh?!0:t.value.startsWith("is")}},ou=l=>{for(const[e,t]of l){const n=!!em[e]?.(l)||!1;t.classList.toggle(Gh,n)}},Kh="isChecked",Vo=l=>l.value.endsWith("Checked"),su=(l,e)=>{if(l&&Vo(e))return null;const t=Array.from(e.querySelectorAll("option")),n=[];for(const f of t){const d=Vo(f),g=l?!d:d;g&&n.push(f.value),f.classList.toggle(Yg,g)}n.includes(e.value)&&(e.value=l?Kh:t.find(f=>!Vo(f))?.value||e.value)};function tm(l,e=Jf){return e.reduce((t,n)=>(l[n]!==void 0&&t.push([n,l[n]]),t),[])}class nm{constructor({conditionValues:e,conditionType:t,conditionCount:n,index:f},d){this.values=new Map(tm(e)),this.conditionType=t,this.parent=d,this.baseAddress=`${d.address}.${t}`,this.fields=new Map,this.conditionCount=n,this.index=f,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[f,d]of this.values){const g=r=>this.onChangeCondition({key:f,target:r.target}),m={key:f,value:d,conditionType:this.conditionType,onChange:g},c=qh[f](m,this.values),p=c.dom||V.create(c);this.fields.set(f,c.dom?c:p),e.push(p)}const n={children:[this.label(),...e,...this.generateConditionTypeActionButtons()],className:`f-condition-row ${this.conditionType}-condition-row display-none`,action:{onRender:f=>{this.processUiState()}}};return V.create(n)}generateConditionTypeActionButtons(){const e=[],t="manage-condition-type",n=g=>`${g}-condition-type`,f=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(f);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=xn(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 im=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,f]=l?_n:ip,d=t.data.map(({[n]:g,...m})=>({[f]:g,...m}));t.setData(d)}},rm=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:f,data:d}){this.field=n,this.itemKey=e,this.itemIndex=t,this.panel=f,this.panelName=f.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?On(Object.entries(e),_n,"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 f=t;if(!f){const[g]=Ks()[e],m=n.children.length;e===ph&&(g.logical="||"),f={conditionValues:g,conditionCount:m,index:m}}const d=new nm({conditionType:e,...f},this);return n.appendChild(d.dom),d};removeConditionType=(e,t)=>{const n=this.conditionTypeWrap.get(e),f=n.children[t];f.destroy(),n.removeChild(f.dom)};generateConditionFields=(e,t)=>(this.conditions=new Map,t.forEach((n,f)=>{const d=this.addConditionType(e,{index:f,conditionCount:t.length,conditionValues:n});this.conditions.set(f,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",f=im.get(this.panelName)?.({itemKey:this.itemKey,key:e})||this.itemKey,d=f.split(".").filter(Number.isNaN).join(".")||e,g=Lt[n]({key:e,value:t}),m=`${this.field.shortId}-${rc(f).replace(/-\d+-(selected)/g,"-$1")}`,c={label:this.panelName!=="options"&&(Uh(d)||at(d)),labelAfter:!1},p={name:g.attrs.type==="checkbox"?`${m}[]`:m};p.disabled=this.isDisabled,p.locked=this.isLocked;const r=rm.get(this.itemSlug)?.(this),o=Ap(Kg[n](f,this.field),r||{}),s=je(Lt[n]({key:e,value:t}),{action:o,attrs:p,config:c});return _n.includes(e)?{className:"f-addon",children:s}:s}}const om={multiple:(l,e)=>{Yh(!!l,e)}};class sm{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,f)=>{const d=this.type==="array",g=d?`[${f}]`:`.${n[0]}`,m=d?n:{[n[0]]:n[1]};return new dn({key:`${this.name}${g}`,data:m,field:this.component,index:f,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},f=[];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()}}};f.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 p=at(e),r=new window.CustomEvent(`onAdd${p}`,{detail:c});xe.add[e](c),document.dispatchEvent(r)}}};return f.push(d),{className:"panel-action-buttons",content:f}}addAttribute=(e,t)=>{let n=t;const f=Nh(e),d=`attrs.${f}`;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),om[f]?.(n,this.component);const g=this.props.querySelector(`.${this.component.name}-attrs-${f}`),m=new dn({key:d,data:{[f]: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,f=X.get("newOptionLabel",{type:n})||"New Option",d=`${this.name}[${this.data.length}]`,g=t[t.length-1],c={...t.length?g:{},label:f};e!=="button"&&(c.value=mh(f));const p=new dn({key:d,data:c,field:this.component,index:this.props.children.length,panel:this});this.editPanelItems.push(p),this.props.appendChild(p.dom),this.component.debouncedUpdatePreview(),this.component.resizePanelWrap()};addCondition=e=>{const n=`conditions[${this.component.get("conditions").length}]`,f=new dn({key:n,data:e.template,field:this.component,panel:this});this.props.appendChild(f.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),f=new window.CustomEvent(`onRemove${n}`,{detail:t});document.dispatchEvent(f)};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 Zh{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))}),f=window.setTimeout(()=>{n.observe(t),window.clearTimeout(f)},zs)}getPanelDisplay(){const e=this.panelsWrap,n=Number.parseInt(V.getStyle(e,"width"),10)>390?"tabbed":"slider",f=this.opts.displayType==="auto";return this.panelDisplay=f?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:f=>{this.propertySave(f.to),this.resizePanels()}})})}createPanelNavLabels(){const e=this.opts.panels.map(f=>({tag:"h5",action:{click:d=>{const g=lt(d.target);this.nav.setTranslateX(g,!1),this.nav.groupChange(g)}},content:f.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,f=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(f,"active-tab"),this.currentPanel.classList.add("active-panel"),f[r].classList.add("active-tab"),this.currentPanel);const c=r=>({nav:-n.offsetWidth*r,panel:-t.offsetWidth*r}),p=({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),p({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},p({offset:g}),e.groupChange(r)}else g={nav:m.nav-8,panel:m.panel-8},p({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},p({offset:g}),e.groupChange(r)}else g={nav:8,panel:8},p({offset:g,reset:!0})},e}}let Uo=null;const Go=vn(mn);class Zn 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),f=n.indexOf(t);f>-1&&n.splice(f,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(f=>{try{typeof f=="function"&&f(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),f=super.set(e,t);return n!==t&&this.dom&&this.dispatchComponentEvent("onUpdate",{path:e,oldValue:n,newValue:t}),f}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(p=>p!==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]}),Yn(n,g=>g.remove()),this.dom.parentElement.removeChild(this.dom),Ef(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",f=`${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-${f}`,e)),t.classList.toggle(n,e),t.classList.toggle(f,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 Gf.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 f=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>=f.children.length?f.appendChild(c.dom):f.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 p=c.get("children");return p?.length&&c.loadChildren(p),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:f}){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({},f).addChild();return o.addChild.bind(o)}],[-1,()=>{const o=this.addChild({},f);return o.addChild.bind(o)}],[0,()=>this.addChild.bind(this)],[1,o=>{const s=lt(this.dom);return()=>this.parent.addChild(o,s+1)}],[2,o=>()=>this.parent.parent.addChild(o)]]),r={controls:async()=>{if(!Uo){const{default:w}=await $t(async()=>{const{default:x}=await Promise.resolve().then(()=>Sm);return{default:x}},void 0);Uo=w}const{controlData:{meta:{id:o},...s}}=Uo.get(n.id);Gn(s,"config.controlId",o);const a=o.startsWith("layout-")?o.replace(/^layout-/,""):"field",u=Ie({stage:{row:0,column:-1,field:-2},row:{row:1,column:0,field:-1},column:{row:2,column:1,field:0},field:1},`${this.name}.${a}`),h=c.get(u)();return V.remove(n),h(s,f)},row:()=>{const o={stage:-1,row:0,column:1};return(c.get(o[g])||ys)()?.({id:n.id},f)},column:()=>{const o={stage:-2,row:-1};return(c.get(o[g])||ys)()?.(n.id)}}[d]?.(n,f);return this.dispatchComponentEvent("onAdd",{from:e,to:t,item:n,newIndex:f,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"),f=n&&Ie(e,n),d=Ie(e,this.id),g=[t,f,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 f=this.processConditions(n.if),d=this.processResults(n.then);return f.map(g=>this.evaluateConditions(g)&&this.execResults(d))}):null};getComponent(e){const[t,n]=e.split("."),f=ce[t];return n===this.id?this:f?.get(n)}value=(e,t)=>{const n=e.split("."),f=this.getComponent(e),d=f&&n.slice(2,n.length).join(".");return[!f,!d,!Go[d]].some(Boolean)?e:t?f.set(Go[d],t):f.get(Go[d])};getResult=e=>({"=":(n,f,d)=>n.set(f,d)})[e];processResults=e=>e.map(({operator:t,target:n,value:f})=>{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(f)}});execResults=e=>{const t=e.map(n=>this.execResult(n));return Promise.all(t)};execResult=({target:e,action:t,value:n,_propertyPath:f})=>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===zr.row}get isColumn(){return this.name===zr.column}get isField(){return this.name===zr.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"),f=this.dom.querySelector(`.${this.name}-actions`),d=f.getElementsByTagName("button");f.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],f=t.filter(g=>!n.includes(g));for(const g of f){const m=this.get(g),c=V.childType(m);if(e.includes(c)){const p=new sm(m,g,this);this.editPanels.set(p.name,p)}}const d={panels:Array.from(this.editPanels.values()).map(({panelConfig:g})=>g),id:this.id,displayType:"auto"};this.panels=new Zh(d),this.dom&&(this.dom.querySelector(".panel-nav").replaceWith(this.panels.panelNav),this.dom.querySelector(".panels").replaceWith(this.panels.panelsWrap))}}class am{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,f=V.getStyle(t,"gap")||"0px",d=parseFloat(f,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,f=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,f.classList.add(Wr),this.columnPreset=f.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(f),this.rowWidth<=0){console.warn("Invalid row width calculated"),this.cleanup();return}this.column=t,this.sibling=n,this.row=f;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,f=parseFloat(Hr(t,this.rowWidth)),d=parseFloat(Hr(n,this.rowWidth));return f<10||d<10?null:{colWidth:vs(f.toFixed(1)),siblingColWidth:vs(d.toFixed(1))}}onMove(e){e.preventDefault();const{column:t,sibling:n}=this,f=e.type==="touchmove"?e.touches[0].clientX:e.clientX,d=this.calculateNewWidths(f);if(!d)return;const{colWidth:g,siblingColWidth:m}=d;t.dataset.colWidth=g,n.dataset.colWidth=m,t.style.width=g,n.style.width=m,this.resized=!0}onStop(){const{column:e,sibling:t}=this;window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop),this.resized&&(this.setCustomWidthValue(),ce.setAddress(`columns.${e.id}.config.width`,e.dataset.colWidth),ce.setAddress(`columns.${t.id}.config.width`,t.dataset.colWidth),this.row.classList.remove(Wr),this.resized=!1,this.cleanup())}cleanup(){this.column&&this.originalColumnClass&&(this.column.className=this.originalColumnClass),this.sibling&&this.originalSiblingClass&&(this.sibling.className=this.originalSiblingClass),this.row&&this.row.classList.remove(Wr),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const e=this.columnPreset;let t=e.querySelector(`.${bs}`);const n=this.row.querySelector(".children").children,f=ea(n,m=>Hr(m.clientWidth,this.rowWidth).toFixed(1)),d=f.join(","),g=f.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 lm=()=>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 cm extends Zn{constructor(e){super("column",{...lm(),...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 am),t]}),this.processConfig(),J.columnResized=new window.CustomEvent("columnResized",{detail:{column:this.dom,instance:this}}),te.create(t,{animation:150,fallbackClass:"field-moving",forceFallback:!0,group:{name:"column",pull:!0,put:["column","controls"]},sort:!0,disabled:!1,onEnd:this.onEnd.bind(this),onAdd:this.onAdd.bind(this),onSort:this.onSort.bind(this),onRemove:this.onRemove.bind(this),onMove:n=>{n.from!==n.to&&n.from.classList.remove("hovering-column")},draggable:`.${It}`,handle:".item-move"})}processConfig(){const e=Ne.get(this.data,"config.width");e&&this.setDomWidth(e)}refreshFieldPanels=()=>{for(const e of this.children)e.panels.nav.refresh()};setDomWidth=e=>{this.dom.dataset.colWidth=e,this.dom.style.width=e};setWidth=e=>(this.setDomWidth(e),this.set("config.width",e))}const um={actionButtons:{buttons:["clone","move","remove"],disabled:[]}};let hm=class extends qn{constructor(e){super("columns",e),this.config={all:um}}Component(e){return new cm(e)}};const Xh=new hm,dm=()=>Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[Qe]});class fm extends Zn{constructor(e){super("row",{...dm(),...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",forceFallback:!0,group:{name:"row",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onRemove:this.onRemove.bind(this),onEnd:this.onEnd.bind(this),onAdd:this.onAdd.bind(this),onSort:this.onSort.bind(this),draggable:`.${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()}}},p=V.formGroup([m,c],"row"),r=[t,"hr",g,"hr",p];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 f=n.dom,d=vs(t);n.set("config.width",d),f.style.width=d,f.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=Kf.get(e.length-1)||[],f=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===f)&&d.push({value:f,label:f.replace(/,/g," | "),className:bs}),d.map(m=>{const c={...m};return c.selected=m.value===f,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 pm={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}};let gm=class extends qn{constructor(e){super("rows",e),this.config={all:pm}}Component(e){return new fm(e)}};const na=new gm,mm=()=>({conditions:[Ks()],children:[]});class vm extends Zn{constructor(e){super("stage",{...mm(),...e}),this.updateEditPanels(),this.debouncedUpdateEditPanels=xn(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:[Ot,"empty"],id:this.id},children:[this.getComponentTag(),this.getActionButtons(),this.editWindow,t]}),te.create(t,{animation:150,fallbackClass:"row-moving",group:{name:"stage",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onAdd:this.onAdd.bind(this),onRemove:this.onRemove.bind(this),onStart:()=>{en.active=this},onSort:this.onSort.bind(this),draggable:`.${Qe}`,handle:".item-move"})}empty(e=!0){return new Promise(t=>{e?(this.dom.classList.add("removing-all-fields"),$e.slideUp(this.dom,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 ym=()=>({actionButtons:{buttons:["edit"],disabled:[]},panels:{disabled:[],order:["attrs","options","conditions"]}});let wm=class extends qn{constructor(e){super("stages",e),this.config={all:ym()}}Component(e){return new vm(e)}};const en=new wm;class bm{controlCache=new Set;constructor({events:e={},dependencies:t={},controlAction:n,...f}){this.events=e,this.controlData=f,this.controlAction=n,this.dependencies=t,this.id=f.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,f={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&&Rt.panels.nav.refresh(lt(g))},click:({target:d})=>{const g=d.closest(".field-control")?.id;g&&Rt.addElement(g)}}};return V.create({tag:"li",id:this.id,className:["field-control",`${e.group}-control`,`${e.id}-control`],content:f,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 Cm=Object.freeze({sortable:!0,elementOrder:{},groupOrder:[],groups:[{id:"layout",label:"controls.groups.layout",elementOrder:["row","column"]},{id:"common",label:"controls.groups.form",elementOrder:["button","checkbox"]},{id:"html",label:"controls.groups.html",elementOrder:["header","block-text"]}],disable:{groups:[],elements:[],formActions:[]},elements:[],container:null,panels:{displayType:"slider"}});let Qh=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 f=typeof t=="function"?new t:new bm(t);return this.add(f),this.controls.push(f.dom),f.promise()})}groupLabel=e=>X.get(e)||e||"";groupElements(){let e=this.options.groups.slice(),t=this.controls.slice(),n=[];const f=[];return e=On(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=On(t,d.elementOrder,"meta.id"),g.content=t.filter(m=>{const{controlData:c}=this.get(m.id),p=c.meta.id||"",r=[Ql(p,this.options.disable.elements),c.meta.group===d.id,!f.includes(p)];let o=!0;return o=r.every(s=>s===!0),o&&f.push(p),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:f=>{na.size?(J.confirmClearAll=new window.CustomEvent("confirmClearAll",{detail:{confirmationMessage:X.get("confirmClearAll"),clearAllAction:()=>{en.clearAll().then(()=>{const d={src:f.target};J.formeoCleared(d)})},btnCoords:V.coords(f.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:f})=>{const{default:d}=await $t(async()=>{const{default:c}=await Promise.resolve().then(()=>Lm);return{default:c}},void 0),{formData:g}=d,m={action:()=>{},coords:V.coords(f),message:"",button:f};return xe.click.btn(m),xe.save.form(g)}}};return{className:"form-actions f-btn-group",content:Object.entries({clearBtn:e,saveBtn:t}).reduce((f,[d,g])=>(this.options.disable.formActions.includes(d)||f.push(g),f),[])}}buildDOM(e){const t=this.groupElements(),n=this.formActions(),{displayType:f}=this.options.panels;this.panels=new Zh({panels:t,type:"controls",displayType:f});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]}),p=c.getElementsByClassName("control-group");this.dom=c,this.groups=p;const[r]=p;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=p.length-1;o>=0;o--){const s=`formeo-controls-${p[o]}`;this.options.sortable||globalThis.localStorage.removeItem(s),te.create(p[o],{animation:150,fallbackClass:"control-moving",fallbackOnBody:!0,forceFallback:!0,fallbackTolerance:5,group:{name:"controls",pull:"clone",put:!1,revertClone:!0},onClone:({clone:a,item:i})=>{if(a.id=i.id,this.options.ghostPreview){const{controlData:u}=this.get(i.id);$t(async()=>{const{default:h}=await Promise.resolve().then(()=>xm);return{default:h}},void 0).then(({default:h})=>{a.innerHTML="",a.appendChild(new h(u).preview)})}},onStart:()=>{this.originalDocumentOverflow=document.documentElement.style.overflow,document.documentElement.style.overflow="hidden"},onEnd:()=>{document.documentElement.style.overflow=this.originalDocumentOverflow,this.originalDocumentOverflow=null},sort:this.options.sortable,store:{get:()=>{const a=globalThis.localStorage.getItem(s);return a?a.split("|"):[]},set:a=>{const i=a.toArray();globalThis.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},...f}=Ie(this.get(e),"controlData");return Gn(f,"config.controlId",n),t==="layout"?this.layoutTypes[n.replace("layout-","")]():this.layoutTypes.field(f)};applyOptions=async(e={})=>{const{container:t,elements:n,groupOrder:f,...d}=je(Cm,e);this.container=t,this.groupOrder=gt(f.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"),[])]),p=[g.default,m.default,c.default].flat();return Promise.all(this.registerControls([...p,...n]))}};const Rt=new Qh,Sm=Object.freeze(Object.defineProperty({__proto__:null,Controls:Qh,default:Rt},Symbol.toStringTag,{value:"Module"})),Am=()=>({}),$m=new Set(["checkbox","radio"]),Mm=new Set(["radio","checkbox","select-one","select-multiple"]);class Jh extends Zn{constructor(e=Object.create(null)){super("field",{...Am(),...e}),this.debouncedUpdateEditPanels=xn(this.updateEditPanels),this.debouncedUpdatePreview=xn(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 f=V.create({tag:"li",attrs:{className:It},id:this.id,children:[this.label,this.getComponentTag(),t,n&&this.editWindow,this.preview].filter(Boolean),panelNav:this.panelNav,dataset:{hoverTag:X.get("field")}});this.dom=f,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"),f=this.config.label.disableHTML;return{className:"prev-label",children:[{...(()=>{const c={tag:"label",attrs:{}};return f?(c.tag="input",c.attrs.value=t,c):(c.attrs.contenteditable=!0,c.children=t,c)})(),action:{input:({target:{innerHTML:c,innerText:p}})=>{super.set("config.label",f?p: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(Mm.has(n)){const f=this.preview.querySelectorAll(":checked"),d=this.get("options"),g=d?.[0]?.selected!==void 0?"selected":"checked",m=d.reduce((c,p)=>(c[p.value]=p,c[p.value][g]=!1,c),{});for(const c of f)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 f=e.parentElement,d=lt(f);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((f,[d,g])=>(f[d]=g.bind(this),f),{}),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 $m.has(this.get("config.controlId"))}}const xm=Object.freeze(Object.defineProperty({__proto__:null,default:Jh},Symbol.toStringTag,{value:"Module"})),Em=()=>({actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}});let _m=class extends qn{constructor(e){super("fields",e),this.config={all:Em()}}Component(e){return new Jh(e)}get=e=>{let t=e&&Ie(this.data,e);if(!t){const n=Rt.get(e);n&&(t=this.add(null,n.controlData))}return t};getData=()=>Object.entries(this.data).reduce((e,[t,n])=>{const{conditions:f,...d}=n?.getData()||n;if(f?.length){let g=!0;if(f.length===1){const[m]=f;g=!!m.if[0].source}g&&(d.conditions=f)}return e[t]=d,e},{});load=(e=Object.create(null))=>{const t=jn(e);this.empty();for(const[n,f]of Object.entries(t)){const{meta:d,...g}=f;d?.id&&Gn(g,"config.controlId",d?.id),this.add(n,g)}return this.data}};const ed=new _m,An=en,$n=na,Qt=Xh,Mn=ed,Nn=Rt,Tm=(l,e=!1)=>l?Xe(jn(l)):e&&Ju.get(oh)||En();class td extends Zs{constructor(){super("components"),this.disableEvents=!0,this.stages=An,this.rows=$n,this.columns=Qt,this.fields=Mn,this.controls=Nn}load=(e,t)=>{this.empty();const n=Tm(e,t.sessionStorage);this.opts=t,this.set("id",n.id),this.add("stages",An.load(n.stages)),this.add("rows",$n.load(n.rows)),this.add("columns",Qt.load(n.columns)),this.add("fields",Mn.load(n.fields));for(const f of Object.values(this.get("stages")))f.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:Xh.getData(),fields:ed.getData()}}set config(e){const{stages:t,rows:n,columns:f,fields:d}=e;An.config=t,$n.config=n,Qt.config=f,Mn.config=d}getIndex(e){return this[e]||this[Pf.get(e)]}setAddress(e,t){if(!Pe(e))return;const[n,f,...d]=Array.isArray(e)?e:vt(e),m=this.getIndex(n).get(f);return m?.set(d,t),m}getAddress(e){if(!Pe(e))return;const[t,n,...f]=Array.isArray(e)?e:vt(e),g=this.getIndex(t).get(n);if(!(f.length&&!g))return f.length?g.get(f):g}}const ce=new td,Lm=Object.freeze(Object.defineProperty({__proto__:null,Columns:Qt,Components:td,Controls:Nn,Fields:Mn,Rows:$n,Stages:An,default:ce},Symbol.toStringTag,{value:"Module"})),cu="no-transition",Rm={debug:!1,bubbles:!0,formeoLoaded:l=>{},onAdd:()=>{},onChange:l=>J.opts?.debug&&console.log(l),onUpdate:l=>J.opts?.debug&&console.log(l),onUpdateStage:l=>J.opts?.debug&&console.log(l),onUpdateRow:l=>J.opts?.debug&&console.log(l),onUpdateColumn:l=>J.opts?.debug&&console.log(l),onUpdateField:l=>J.opts?.debug&&console.log(l),onAddRow:l=>J.opts?.debug&&console.log(l),onAddColumn:l=>J.opts?.debug&&console.log(l),onAddField:l=>J.opts?.debug&&console.log(l),onRemoveRow:l=>J.opts?.debug&&console.log(l),onRemoveColumn:l=>J.opts?.debug&&console.log(l),onRemoveField:l=>J.opts?.debug&&console.log(l),onRender:l=>J.opts?.debug&&console.log(l),onSave:l=>{},confirmClearAll:l=>{window.confirm(l.confirmationMessage)&&l.clearAllAction(l)}},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 f=new window.CustomEvent(Yf,{detail:e,bubbles:J.opts?.debug||J.opts?.bubbles});(l||document).dispatchEvent(f)}return n},J={init:function(l){return this.opts={...Rm,...l},this},formeoSaved:l=>ze(l,sh),formeoUpdated:(l,e)=>ze(l,e||Jt),formeoCleared:l=>ze(l,Zf),formeoOnRender:l=>ze(l,hh),formeoConditionUpdated:l=>ze(l,Xf),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)},km=Tf(()=>{const l={timeStamp:window.performance.now(),type:Jt,detail:ce.formData};J.opts.onUpdate(l),J.opts.onChange!==J.opts.onUpdate&&J.opts.onChange(l)},mt);document.addEventListener(Jt,km);document.addEventListener(ah,l=>{const{timeStamp:e,type:t,detail:n}=l,f={timeStamp:e,type:t,detail:n};J.opts.onUpdate(f),J.opts.onUpdateStage(f)});document.addEventListener(lh,l=>{const{timeStamp:e,type:t,detail:n}=l,f={timeStamp:e,type:t,detail:n};J.opts.onUpdate(f),J.opts.onUpdateRow(f)});document.addEventListener(ch,l=>{const{timeStamp:e,type:t,detail:n}=l,f={timeStamp:e,type:t,detail:n};J.opts.onUpdate(f),J.opts.onUpdateColumn(f)});document.addEventListener(uh,l=>{const{timeStamp:e,type:t,detail:n}=l,f={timeStamp:e,type:t,detail:n};J.opts.onUpdate(f),J.opts.onUpdateField(f)});document.addEventListener(Bs,l=>{const{timeStamp:e,type:t,detail:n}=l,f={timeStamp:e,type:t,detail:n};J.opts.onAddRow(f)});document.addEventListener(js,l=>{const{timeStamp:e,type:t,detail:n}=l,f={timeStamp:e,type:t,detail:n};J.opts.onAddColumn(f)});document.addEventListener(Vs,l=>{const{timeStamp:e,type:t,detail:n}=l,f={timeStamp:e,type:t,detail:n};J.opts.onAddField(f)});document.addEventListener(Us,l=>{const{timeStamp:e,type:t,detail:n}=l,f={timeStamp:e,type:t,detail:n};J.opts.onRemoveRow(f)});document.addEventListener(Gs,l=>{const{timeStamp:e,type:t,detail:n}=l,f={timeStamp:e,type:t,detail:n};J.opts.onRemoveColumn(f)});document.addEventListener(qs,l=>{const{timeStamp:e,type:t,detail:n}=l,f={timeStamp:e,type:t,detail:n};J.opts.onRemoveField(f)});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 qo;function Dm(){qo=qo||window.requestAnimationFrame(()=>{qo=!1;for(const l of Object.values(Qt.data))l.dom.classList.add(cu),Nn.dom.classList.add(cu),Nn.panels.nav.refresh(),l.refreshFieldPanels()})}window.addEventListener("resize",Dm);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))}},Om={"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"}},Im=Om["en-US"],nd="en-US";X.addLanguage(nd,Im);X.setCurrent(nd);const Nm={get editor(){return{stickyControls:!1,allowEdit:!0,dataType:"json",debug:!1,sessionStorage:!1,editorContainer:null,svgSprite:null,style:Of,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 f=je(Nm.editor,t),{actions:d,events:g,debug:m,config:c,editorContainer:p,...r}=f;p&&(this.editorContainer=typeof p=="string"?document.querySelector(p):p),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=Mt(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(_g(this.opts.svgSprite),Lg(this.opts.style),X.init({...this.opts.i18n,locale:globalThis.sessionStorage?.getItem(tc)})),await Promise.all(e),this.opts.allowEdit&&this.init()}init(){return Rt.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 pn="f-",hu=l=>typeof l=="string"?document.querySelector(l):l,Fm=({editorContainer:l,renderContainer:e,formData:t,...n})=>{const f={renderContainer:hu(e),editorContainer:hu(l),formData:Mt(t)};return{elements:{},...n,...f}},gn=l=>l.match(np)?.[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")},Pm={isChecked:l=>l.checked,isNotChecked:l=>!l.checked,value:l=>l.value,isVisible:l=>du(l),isNotVisible:l=>!du(l)},Hm=()=>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)},Wm=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}},zm=Object.entries(fh).reduce((l,[e,t])=>(l[t]=pu[e],l[e]=pu[e],l),{}),Bm={isChecked:l=>{l.checked=!0},isNotChecked:l=>{l.checked=!1},value:(l,{assignment:e,...t})=>{const n=zm[e]?.(l,t),f=new Event("input",{bubbles:!0});return l.dispatchEvent(f),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:f,formData:d,config:g}=Fm(e);this.container=n,this.form=Mt(t||d),this.elements=f,this.config=g,this.components=Object.create(null),this.dom=V}get formData(){return this.form}set formData(e){this.form=Mt(e)}get userData(){const e=this.container.querySelector(".formeo-render")||this.renderedForm;if(!e)return{};const t=new FormData(e),n={};for(const[f,d]of t.entries())n[f]?Array.isArray(n[f])?n[f].push(d):n[f]=[n[f],d]:n[f]=d;return n}get userFormData(){const e=[];for(const[t,n]of Object.entries(this.userData)){const f={key:t,value:n,label:this.components[gn(t)]?.config?.label||""};e.push(f)}return e}set userData(e={}){const t=this.container.querySelector("form");for(const n of Object.keys(e)){const f=t.elements[n];if(f.length&&f[0].type==="checkbox"){const d=Array.isArray(e[n])?e[n]:[e[n]];for(const g of f)g.checked=d.includes(g.value)}else if(f.length&&f[0].type==="radio")for(const d of f)d.checked=d.value===e[n];else f.type&&(f.value=e[n])}}render(e=this.form){this.form=Mt(e);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=Mt(e);const t=document.getElementsByClassName("formeo-render").length,n={...this.config,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,f)=>(n.push(this.form[e][f]),n),[]);prefixId=e=>pn+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[gn(e.id)]=e,e);processRow=(e,t="row")=>{const{config:n,id:f}=e,d=[`formeo-${t}-wrap`],g={...e,children:this.processColumns(e.id),id:this.prefixId(f)};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(f)}].reduce((p,{condition:r,result:o})=>(r&&p.push(o()),p),[]);return n.inputGroup&&d.push(`${pn}input-group-wrap`),{tag:n.fieldset?"fieldset":"div",className:d,children:c}};cloneComponentData=e=>{const{children:t=[],id:n,attrs:f={},...d}=this.components[e],g={...f,"data-clone-of":n};return d.tag==="input"&&(g.name=zh(this.components[e])),{...d,id:pn+He(n),children:t?.length&&t.map(({id:m})=>this.cloneComponentData(gn(m))),attrs:g}};addButton=e=>({tag:"button",attrs:{className:"add-input-group btn pull-right",type:"button"},children:"Add +",action:{click:t=>{const n=t.target.parentElement,f=V.create(this.cloneComponentData(e));n.insertBefore(f,n.lastChild);const d=V.create(Hm());f.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 f=n.config?.controlId||n.meta?.id,{action:d={},dependencies:g={}}=this.elements[f]||{};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=Ot,this.components[gn(e.id)]=e,e))}handleComponentCondition=(e,t,n)=>{if(e.length){for(const g of e)this.handleComponentCondition(g,t,n);return}const f=Vm(e);f&&e.addEventListener(f,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:f}=t;for(const d of n){const{source:g,target:m}=d;if(Pe(g)){const{component:c,options:p}=this.getComponent(g),r=p||c;this.handleComponentCondition(r,d,f)}if(Pe(m)){const{component:c,options:p}=this.getComponent(m),r=p||c;this.handleComponentCondition(r,d,f)}}}};evaluateCondition=({source:e,sourceProperty:t,targetProperty:n,comparison:f,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 Wm[f]?.(g,m)};execResult=({target:e,targetProperty:t,assignment:n,value:f})=>{if(Pe(e)){const{component:d,option:g}=this.getComponent(e),m=g||d;Bm[t]?.(m,{targetProperty:t,assignment:n,value:f})}};getComponentProperty=(e,t)=>{const{component:n,option:f}=this.getComponent(e),d=f||n;return Pm[t]?.(d)||d[t]};getComponent=e=>{const t={component:null};if(!Pe(e))return null;const[,n,f,d]=vt(e),g=this.renderedForm.querySelector(`#${pn}${n}`);if(!g)return t;if(t.component=g,f){const m=g.querySelectorAll("input"),c=m[d];return t.options=m,t.option=c,t}return t};getComponents=e=>{const t=[],n=e.slice(e.indexOf(".")+1);return t.push(...this.renderedForm.querySelectorAll(`[name=f-${n}]`)),t}};const jm=[["input",l=>["textarea","text"].includes(l.type)],["change",l=>["select"].includes(l.tagName.toLowerCase())||["checkbox","radio"].includes(l.type)]],Vm=l=>{const[e]=jm.find(t=>t[1](l))||[!1];return e};window!==void 0&&(window.FormeoEditor=id,window.FormeoRenderer=rd);const ia=id,ra=rd,Um={rows:{all:{events:{onAdd:l=>{if(console.log(`You just added a new row with the id "${l.target.id}"`,l.index),l.index===2){const e=l.target.dom.querySelector(".action-btn-wrap"),t=document.createElement("button");t.type="button",t.className="btn btn-sm btn-secondary",t.textContent="Add Column",t.style.border="1px solid #ccc",t.style.width="auto",t.addEventListener("click",()=>{l.target.addChild()}),e.appendChild(t)}}}}},fields:{all:{events:{onRemove:l=>{console.log(`You just removed the field with the id "${l.target.id}"`,l)}}},checkbox:{actionButtons:{},panels:{attrs:{hideDisabled:!0}}}}},Gm={sortable:!1,groupOrder:["common","html"],disable:{},elements:[{tag:"input",config:{label:"Email",disabledAttrs:["type"],lockedAttrs:["required","className"]},meta:{group:"common",id:"email",icon:"@"},attrs:{className:"custom-email",type:"email",required:!0}}],elementOrder:{common:["button","checkbox","date-input","hidden","upload","number","radio","select","text-input","textarea"]}},qm=".build-form",Km=".render-form",tn={editorContainer:qm,actions:{},controls:Gm,config:Um,events:{onSave:console.log,onChange:console.log},sessionStorage:!0,editPanelOrder:["attrs","options"],onLoad:()=>{console.log("demo loaded")}},oa={renderContainer:Km,elements:{tinymce:{action:{onRender:l=>{if(l.id){const e=`#${l.id}`;window.tinymce.remove(e),window.tinymce.init({selector:e})}}}}}};async function Ym(l){l.innerHTML=`
|
|
10
|
+
`),n={};for(let p,h=0;h<t.length;h++)p=/^(.+?) *?= *?([^\n]+)/.exec(t[h]),p&&(n[p[1]]=p[2].replace(/(^\s+|\s+$)/g,""));return n}loadLang(e,t=!0){const n=this;return new Promise(function(p,h){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 md(g).then(m=>{const c=Xt.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 Xt;(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 vd=Object.defineProperty,yd=(l,e,t)=>e in l?vd(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t,Xe=(l,e,t)=>yd(l,typeof e!="symbol"?e+"":e,t);const bd="_3x4ZIcu-",wd="JIt36hCJ",zt={tooltip:bd,visible:wd},Cd={triggerName:"tooltip"};class Uu{constructor(e=Cd){Xe(this,"triggerName"),Xe(this,"tooltip"),Xe(this,"activeTriggerType",null),Xe(this,"spacing",12),Xe(this,"handleClick",t=>{const n=this.triggerName,p=t.target.closest(`[${n}][${n}-type="click"]`);if(p)if(this.isVisible())this.hide();else{const h=p.getAttribute(`${n}`);this.show(p,h),this.activeTriggerType="click"}else this.hide()}),Xe(this,"handleMouseOver",t=>{const n=this.triggerName,p=t.target.closest(`[${n}]`);if(this.activeTriggerType!=="click"&&p?.getAttribute(`${n}-type`)!=="click"){const h=p?.getAttribute(`${n}`);h&&(this.show(p,h),this.activeTriggerType="hover")}}),Xe(this,"handleMouseOut",t=>{const n=this.triggerName,p=t.target.closest(`[${n}]`);this.activeTriggerType!=="click"&&p?.getAttribute(`${n}-type`)!=="click"&&this.hide()}),Xe(this,"handleResize",()=>{this.isVisible()&&this.hide()}),Xe(this,"handleScroll",()=>{this.isVisible()&&this.hide()}),this.triggerName=`data-${e.triggerName}`,this.tooltip=document.createElement("div"),this.tooltip.className=`d-tooltip ${zt.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(zt.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(h=>this.fitsInViewport(h,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(zt.tooltip)||getComputedStyle(m).pointerEvents==="none")return!1}).length===0:!1}show(e,t){this.tooltip.innerHTML=t??"",this.tooltip.classList.add(zt.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(zt.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=Uu);const Sd="formeo",Ad="5.0.0",Gu={name:Sd,version:Ad};var dn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nt(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var ri,va;function $d(){if(va)return ri;va=1;function l(){this.__data__=[],this.size=0}return ri=l,ri}var oi,ya;function ln(){if(ya)return oi;ya=1;function l(e,t){return e===t||e!==e&&t!==t}return oi=l,oi}var si,ba;function zn(){if(ba)return si;ba=1;var l=ln();function e(t,n){for(var p=t.length;p--;)if(l(t[p][0],n))return p;return-1}return si=e,si}var ai,wa;function xd(){if(wa)return ai;wa=1;var l=zn(),e=Array.prototype,t=e.splice;function n(p){var h=this.__data__,g=l(h,p);if(g<0)return!1;var m=h.length-1;return g==m?h.pop():t.call(h,g,1),--this.size,!0}return ai=n,ai}var li,Ca;function Ed(){if(Ca)return li;Ca=1;var l=zn();function e(t){var n=this.__data__,p=l(n,t);return p<0?void 0:n[p][1]}return li=e,li}var ci,Sa;function Md(){if(Sa)return ci;Sa=1;var l=zn();function e(t){return l(this.__data__,t)>-1}return ci=e,ci}var ui,Aa;function Td(){if(Aa)return ui;Aa=1;var l=zn();function e(t,n){var p=this.__data__,h=l(p,t);return h<0?(++this.size,p.push([t,n])):p[h][1]=n,this}return ui=e,ui}var hi,$a;function Bn(){if($a)return hi;$a=1;var l=$d(),e=xd(),t=Ed(),n=Md(),p=Td();function h(g){var m=-1,c=g==null?0:g.length;for(this.clear();++m<c;){var d=g[m];this.set(d[0],d[1])}}return h.prototype.clear=l,h.prototype.delete=e,h.prototype.get=t,h.prototype.has=n,h.prototype.set=p,hi=h,hi}var di,xa;function _d(){if(xa)return di;xa=1;var l=Bn();function e(){this.__data__=new l,this.size=0}return di=e,di}var fi,Ea;function Ld(){if(Ea)return fi;Ea=1;function l(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}return fi=l,fi}var pi,Ma;function Rd(){if(Ma)return pi;Ma=1;function l(e){return this.__data__.get(e)}return pi=l,pi}var gi,Ta;function kd(){if(Ta)return gi;Ta=1;function l(e){return this.__data__.has(e)}return gi=l,gi}var mi,_a;function qu(){if(_a)return mi;_a=1;var l=typeof dn=="object"&&dn&&dn.Object===Object&&dn;return mi=l,mi}var vi,La;function Ze(){if(La)return vi;La=1;var l=qu(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=l||e||Function("return this")();return vi=t,vi}var yi,Ra;function jn(){if(Ra)return yi;Ra=1;var l=Ze(),e=l.Symbol;return yi=e,yi}var bi,ka;function Dd(){if(ka)return bi;ka=1;var l=jn(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,p=l?l.toStringTag:void 0;function h(g){var m=t.call(g,p),c=g[p];try{g[p]=void 0;var d=!0}catch{}var r=n.call(g);return d&&(m?g[p]=c:delete g[p]),r}return bi=h,bi}var wi,Da;function Od(){if(Da)return wi;Da=1;var l=Object.prototype,e=l.toString;function t(n){return e.call(n)}return wi=t,wi}var Ci,Oa;function Ft(){if(Oa)return Ci;Oa=1;var l=jn(),e=Dd(),t=Od(),n="[object Null]",p="[object Undefined]",h=l?l.toStringTag:void 0;function g(m){return m==null?m===void 0?p:n:h&&h in Object(m)?e(m):t(m)}return Ci=g,Ci}var Si,Ia;function ht(){if(Ia)return Si;Ia=1;function l(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return Si=l,Si}var Ai,Na;function ks(){if(Na)return Ai;Na=1;var l=Ft(),e=ht(),t="[object AsyncFunction]",n="[object Function]",p="[object GeneratorFunction]",h="[object Proxy]";function g(m){if(!e(m))return!1;var c=l(m);return c==n||c==p||c==t||c==h}return Ai=g,Ai}var $i,Fa;function Id(){if(Fa)return $i;Fa=1;var l=Ze(),e=l["__core-js_shared__"];return $i=e,$i}var xi,Pa;function Nd(){if(Pa)return xi;Pa=1;var l=Id(),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 xi=t,xi}var Ei,Ha;function Ku(){if(Ha)return Ei;Ha=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 Ei=t,Ei}var Mi,Wa;function Fd(){if(Wa)return Mi;Wa=1;var l=ks(),e=Nd(),t=ht(),n=Ku(),p=/[\\^$.*+?()[\]{}|]/g,h=/^\[object .+?Constructor\]$/,g=Function.prototype,m=Object.prototype,c=g.toString,d=m.hasOwnProperty,r=RegExp("^"+c.call(d).replace(p,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function o(a){if(!t(a)||e(a))return!1;var s=l(a)?r:h;return s.test(n(a))}return Mi=o,Mi}var Ti,za;function Pd(){if(za)return Ti;za=1;function l(e,t){return e?.[t]}return Ti=l,Ti}var _i,Ba;function St(){if(Ba)return _i;Ba=1;var l=Fd(),e=Pd();function t(n,p){var h=e(n,p);return l(h)?h:void 0}return _i=t,_i}var Li,ja;function Ds(){if(ja)return Li;ja=1;var l=St(),e=Ze(),t=l(e,"Map");return Li=t,Li}var Ri,Va;function Vn(){if(Va)return Ri;Va=1;var l=St(),e=l(Object,"create");return Ri=e,Ri}var ki,Ua;function Hd(){if(Ua)return ki;Ua=1;var l=Vn();function e(){this.__data__=l?l(null):{},this.size=0}return ki=e,ki}var Di,Ga;function Wd(){if(Ga)return Di;Ga=1;function l(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return Di=l,Di}var Oi,qa;function zd(){if(qa)return Oi;qa=1;var l=Vn(),e="__lodash_hash_undefined__",t=Object.prototype,n=t.hasOwnProperty;function p(h){var g=this.__data__;if(l){var m=g[h];return m===e?void 0:m}return n.call(g,h)?g[h]:void 0}return Oi=p,Oi}var Ii,Ka;function Bd(){if(Ka)return Ii;Ka=1;var l=Vn(),e=Object.prototype,t=e.hasOwnProperty;function n(p){var h=this.__data__;return l?h[p]!==void 0:t.call(h,p)}return Ii=n,Ii}var Ni,Ya;function jd(){if(Ya)return Ni;Ya=1;var l=Vn(),e="__lodash_hash_undefined__";function t(n,p){var h=this.__data__;return this.size+=this.has(n)?0:1,h[n]=l&&p===void 0?e:p,this}return Ni=t,Ni}var Fi,Za;function Vd(){if(Za)return Fi;Za=1;var l=Hd(),e=Wd(),t=zd(),n=Bd(),p=jd();function h(g){var m=-1,c=g==null?0:g.length;for(this.clear();++m<c;){var d=g[m];this.set(d[0],d[1])}}return h.prototype.clear=l,h.prototype.delete=e,h.prototype.get=t,h.prototype.has=n,h.prototype.set=p,Fi=h,Fi}var Pi,Xa;function Ud(){if(Xa)return Pi;Xa=1;var l=Vd(),e=Bn(),t=Ds();function n(){this.size=0,this.__data__={hash:new l,map:new(t||e),string:new l}}return Pi=n,Pi}var Hi,Qa;function Gd(){if(Qa)return Hi;Qa=1;function l(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return Hi=l,Hi}var Wi,Ja;function Un(){if(Ja)return Wi;Ja=1;var l=Gd();function e(t,n){var p=t.__data__;return l(n)?p[typeof n=="string"?"string":"hash"]:p.map}return Wi=e,Wi}var zi,el;function qd(){if(el)return zi;el=1;var l=Un();function e(t){var n=l(this,t).delete(t);return this.size-=n?1:0,n}return zi=e,zi}var Bi,tl;function Kd(){if(tl)return Bi;tl=1;var l=Un();function e(t){return l(this,t).get(t)}return Bi=e,Bi}var ji,nl;function Yd(){if(nl)return ji;nl=1;var l=Un();function e(t){return l(this,t).has(t)}return ji=e,ji}var Vi,il;function Zd(){if(il)return Vi;il=1;var l=Un();function e(t,n){var p=l(this,t),h=p.size;return p.set(t,n),this.size+=p.size==h?0:1,this}return Vi=e,Vi}var Ui,rl;function Os(){if(rl)return Ui;rl=1;var l=Ud(),e=qd(),t=Kd(),n=Yd(),p=Zd();function h(g){var m=-1,c=g==null?0:g.length;for(this.clear();++m<c;){var d=g[m];this.set(d[0],d[1])}}return h.prototype.clear=l,h.prototype.delete=e,h.prototype.get=t,h.prototype.has=n,h.prototype.set=p,Ui=h,Ui}var Gi,ol;function Xd(){if(ol)return Gi;ol=1;var l=Bn(),e=Ds(),t=Os(),n=200;function p(h,g){var m=this.__data__;if(m instanceof l){var c=m.__data__;if(!e||c.length<n-1)return c.push([h,g]),this.size=++m.size,this;m=this.__data__=new t(c)}return m.set(h,g),this.size=m.size,this}return Gi=p,Gi}var qi,sl;function Yu(){if(sl)return qi;sl=1;var l=Bn(),e=_d(),t=Ld(),n=Rd(),p=kd(),h=Xd();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=h,qi=g,qi}var Ki,al;function Zu(){if(al)return Ki;al=1;var l=St(),e=(function(){try{var t=l(Object,"defineProperty");return t({},"",{}),t}catch{}})();return Ki=e,Ki}var Yi,ll;function Is(){if(ll)return Yi;ll=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 Yi=e,Yi}var Zi,cl;function Xu(){if(cl)return Zi;cl=1;var l=Is(),e=ln();function t(n,p,h){(h!==void 0&&!e(n[p],h)||h===void 0&&!(p in n))&&l(n,p,h)}return Zi=t,Zi}var Xi,ul;function Qd(){if(ul)return Xi;ul=1;function l(e){return function(t,n,p){for(var h=-1,g=Object(t),m=p(t),c=m.length;c--;){var d=m[e?c:++h];if(n(g[d],d,g)===!1)break}return t}}return Xi=l,Xi}var Qi,hl;function Jd(){if(hl)return Qi;hl=1;var l=Qd(),e=l();return Qi=e,Qi}var Ut={exports:{}};Ut.exports;var dl;function ef(){return dl||(dl=1,(function(l,e){var t=Ze(),n=e&&!e.nodeType&&e,p=n&&!0&&l&&!l.nodeType&&l,h=p&&p.exports===n,g=h?t.Buffer:void 0,m=g?g.allocUnsafe:void 0;function c(d,r){if(r)return d.slice();var o=d.length,a=m?m(o):new d.constructor(o);return d.copy(a),a}l.exports=c})(Ut,Ut.exports)),Ut.exports}var Ji,fl;function Qu(){if(fl)return Ji;fl=1;var l=Ze(),e=l.Uint8Array;return Ji=e,Ji}var er,pl;function tf(){if(pl)return er;pl=1;var l=Qu();function e(t){var n=new t.constructor(t.byteLength);return new l(n).set(new l(t)),n}return er=e,er}var tr,gl;function nf(){if(gl)return tr;gl=1;var l=tf();function e(t,n){var p=n?l(t.buffer):t.buffer;return new t.constructor(p,t.byteOffset,t.length)}return tr=e,tr}var nr,ml;function rf(){if(ml)return nr;ml=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 nr=l,nr}var ir,vl;function of(){if(vl)return ir;vl=1;var l=ht(),e=Object.create,t=(function(){function n(){}return function(p){if(!l(p))return{};if(e)return e(p);n.prototype=p;var h=new n;return n.prototype=void 0,h}})();return ir=t,ir}var rr,yl;function Ju(){if(yl)return rr;yl=1;function l(e,t){return function(n){return e(t(n))}}return rr=l,rr}var or,bl;function eh(){if(bl)return or;bl=1;var l=Ju(),e=l(Object.getPrototypeOf,Object);return or=e,or}var sr,wl;function Ns(){if(wl)return sr;wl=1;var l=Object.prototype;function e(t){var n=t&&t.constructor,p=typeof n=="function"&&n.prototype||l;return t===p}return sr=e,sr}var ar,Cl;function sf(){if(Cl)return ar;Cl=1;var l=of(),e=eh(),t=Ns();function n(p){return typeof p.constructor=="function"&&!t(p)?l(e(p)):{}}return ar=n,ar}var lr,Sl;function At(){if(Sl)return lr;Sl=1;function l(e){return e!=null&&typeof e=="object"}return lr=l,lr}var cr,Al;function af(){if(Al)return cr;Al=1;var l=Ft(),e=At(),t="[object Arguments]";function n(p){return e(p)&&l(p)==t}return cr=n,cr}var ur,$l;function th(){if($l)return ur;$l=1;var l=af(),e=At(),t=Object.prototype,n=t.hasOwnProperty,p=t.propertyIsEnumerable,h=l((function(){return arguments})())?l:function(g){return e(g)&&n.call(g,"callee")&&!p.call(g,"callee")};return ur=h,ur}var hr,xl;function $t(){if(xl)return hr;xl=1;var l=Array.isArray;return hr=l,hr}var dr,El;function nh(){if(El)return dr;El=1;var l=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=l}return dr=e,dr}var fr,Ml;function Gn(){if(Ml)return fr;Ml=1;var l=ks(),e=nh();function t(n){return n!=null&&e(n.length)&&!l(n)}return fr=t,fr}var pr,Tl;function lf(){if(Tl)return pr;Tl=1;var l=Gn(),e=At();function t(n){return e(n)&&l(n)}return pr=t,pr}var Gt={exports:{}},gr,_l;function cf(){if(_l)return gr;_l=1;function l(){return!1}return gr=l,gr}Gt.exports;var Ll;function Fs(){return Ll||(Ll=1,(function(l,e){var t=Ze(),n=cf(),p=e&&!e.nodeType&&e,h=p&&!0&&l&&!l.nodeType&&l,g=h&&h.exports===p,m=g?t.Buffer:void 0,c=m?m.isBuffer:void 0,d=c||n;l.exports=d})(Gt,Gt.exports)),Gt.exports}var mr,Rl;function uf(){if(Rl)return mr;Rl=1;var l=Ft(),e=eh(),t=At(),n="[object Object]",p=Function.prototype,h=Object.prototype,g=p.toString,m=h.hasOwnProperty,c=g.call(Object);function d(r){if(!t(r)||l(r)!=n)return!1;var o=e(r);if(o===null)return!0;var a=m.call(o,"constructor")&&o.constructor;return typeof a=="function"&&a instanceof a&&g.call(a)==c}return mr=d,mr}var vr,kl;function hf(){if(kl)return vr;kl=1;var l=Ft(),e=nh(),t=At(),n="[object Arguments]",p="[object Array]",h="[object Boolean]",g="[object Date]",m="[object Error]",c="[object Function]",d="[object Map]",r="[object Number]",o="[object Object]",a="[object RegExp]",s="[object Set]",i="[object String]",u="[object WeakMap]",f="[object ArrayBuffer]",y="[object DataView]",b="[object Float32Array]",E="[object Float64Array]",$="[object Int8Array]",A="[object Int16Array]",S="[object Int32Array]",M="[object Uint8Array]",R="[object Uint8ClampedArray]",L="[object Uint16Array]",T="[object Uint32Array]",D={};D[b]=D[E]=D[$]=D[A]=D[S]=D[M]=D[R]=D[L]=D[T]=!0,D[n]=D[p]=D[f]=D[h]=D[y]=D[g]=D[m]=D[c]=D[d]=D[r]=D[o]=D[a]=D[s]=D[i]=D[u]=!1;function w(v){return t(v)&&e(v.length)&&!!D[l(v)]}return vr=w,vr}var yr,Dl;function df(){if(Dl)return yr;Dl=1;function l(e){return function(t){return e(t)}}return yr=l,yr}var qt={exports:{}};qt.exports;var Ol;function ff(){return Ol||(Ol=1,(function(l,e){var t=qu(),n=e&&!e.nodeType&&e,p=n&&!0&&l&&!l.nodeType&&l,h=p&&p.exports===n,g=h&&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})(qt,qt.exports)),qt.exports}var br,Il;function Ps(){if(Il)return br;Il=1;var l=hf(),e=df(),t=ff(),n=t&&t.isTypedArray,p=n?e(n):l;return br=p,br}var wr,Nl;function ih(){if(Nl)return wr;Nl=1;function l(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return wr=l,wr}var Cr,Fl;function rh(){if(Fl)return Cr;Fl=1;var l=Is(),e=ln(),t=Object.prototype,n=t.hasOwnProperty;function p(h,g,m){var c=h[g];(!(n.call(h,g)&&e(c,m))||m===void 0&&!(g in h))&&l(h,g,m)}return Cr=p,Cr}var Sr,Pl;function pf(){if(Pl)return Sr;Pl=1;var l=rh(),e=Is();function t(n,p,h,g){var m=!h;h||(h={});for(var c=-1,d=p.length;++c<d;){var r=p[c],o=g?g(h[r],n[r],r,h,n):void 0;o===void 0&&(o=n[r]),m?e(h,r,o):l(h,r,o)}return h}return Sr=t,Sr}var Ar,Hl;function gf(){if(Hl)return Ar;Hl=1;function l(e,t){for(var n=-1,p=Array(e);++n<e;)p[n]=t(n);return p}return Ar=l,Ar}var $r,Wl;function Hs(){if(Wl)return $r;Wl=1;var l=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(n,p){var h=typeof n;return p=p??l,!!p&&(h=="number"||h!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<p}return $r=t,$r}var xr,zl;function oh(){if(zl)return xr;zl=1;var l=gf(),e=th(),t=$t(),n=Fs(),p=Hs(),h=Ps(),g=Object.prototype,m=g.hasOwnProperty;function c(d,r){var o=t(d),a=!o&&e(d),s=!o&&!a&&n(d),i=!o&&!a&&!s&&h(d),u=o||a||s||i,f=u?l(d.length,String):[],y=f.length;for(var b in d)(r||m.call(d,b))&&!(u&&(b=="length"||s&&(b=="offset"||b=="parent")||i&&(b=="buffer"||b=="byteLength"||b=="byteOffset")||p(b,y)))&&f.push(b);return f}return xr=c,xr}var Er,Bl;function mf(){if(Bl)return Er;Bl=1;function l(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}return Er=l,Er}var Mr,jl;function vf(){if(jl)return Mr;jl=1;var l=ht(),e=Ns(),t=mf(),n=Object.prototype,p=n.hasOwnProperty;function h(g){if(!l(g))return t(g);var m=e(g),c=[];for(var d in g)d=="constructor"&&(m||!p.call(g,d))||c.push(d);return c}return Mr=h,Mr}var Tr,Vl;function sh(){if(Vl)return Tr;Vl=1;var l=oh(),e=vf(),t=Gn();function n(p){return t(p)?l(p,!0):e(p)}return Tr=n,Tr}var _r,Ul;function yf(){if(Ul)return _r;Ul=1;var l=pf(),e=sh();function t(n){return l(n,e(n))}return _r=t,_r}var Lr,Gl;function bf(){if(Gl)return Lr;Gl=1;var l=Xu(),e=ef(),t=nf(),n=rf(),p=sf(),h=th(),g=$t(),m=lf(),c=Fs(),d=ks(),r=ht(),o=uf(),a=Ps(),s=ih(),i=yf();function u(f,y,b,E,$,A,S){var M=s(f,b),R=s(y,b),L=S.get(R);if(L){l(f,b,L);return}var T=A?A(M,R,b+"",f,y,S):void 0,D=T===void 0;if(D){var w=g(R),v=!w&&c(R),C=!w&&!v&&a(R);T=R,w||v||C?g(M)?T=M:m(M)?T=n(M):v?(D=!1,T=e(R,!0)):C?(D=!1,T=t(R,!0)):T=[]:o(R)||h(R)?(T=M,h(M)?T=i(M):(!r(M)||d(M))&&(T=p(R))):D=!1}D&&(S.set(R,T),$(T,R,E,A,S),S.delete(R)),l(f,b,T)}return Lr=u,Lr}var Rr,ql;function wf(){if(ql)return Rr;ql=1;var l=Yu(),e=Xu(),t=Jd(),n=bf(),p=ht(),h=sh(),g=ih();function m(c,d,r,o,a){c!==d&&t(d,function(s,i){if(a||(a=new l),p(s))n(c,d,i,r,m,o,a);else{var u=o?o(g(c,i),s,i+"",c,d,a):void 0;u===void 0&&(u=s),e(c,i,u)}},h)}return Rr=m,Rr}var kr,Kl;function ah(){if(Kl)return kr;Kl=1;function l(e){return e}return kr=l,kr}var Dr,Yl;function Cf(){if(Yl)return Dr;Yl=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 Dr=l,Dr}var Or,Zl;function Sf(){if(Zl)return Or;Zl=1;var l=Cf(),e=Math.max;function t(n,p,h){return p=e(p===void 0?n.length-1:p,0),function(){for(var g=arguments,m=-1,c=e(g.length-p,0),d=Array(c);++m<c;)d[m]=g[p+m];m=-1;for(var r=Array(p+1);++m<p;)r[m]=g[m];return r[p]=h(d),l(n,this,r)}}return Or=t,Or}var Ir,Xl;function Af(){if(Xl)return Ir;Xl=1;function l(e){return function(){return e}}return Ir=l,Ir}var Nr,Ql;function $f(){if(Ql)return Nr;Ql=1;var l=Af(),e=Zu(),t=ah(),n=e?function(p,h){return e(p,"toString",{configurable:!0,enumerable:!1,value:l(h),writable:!0})}:t;return Nr=n,Nr}var Fr,Jl;function xf(){if(Jl)return Fr;Jl=1;var l=800,e=16,t=Date.now;function n(p){var h=0,g=0;return function(){var m=t(),c=e-(m-g);if(g=m,c>0){if(++h>=l)return arguments[0]}else h=0;return p.apply(void 0,arguments)}}return Fr=n,Fr}var Pr,ec;function Ef(){if(ec)return Pr;ec=1;var l=$f(),e=xf(),t=e(l);return Pr=t,Pr}var Hr,tc;function Mf(){if(tc)return Hr;tc=1;var l=ah(),e=Sf(),t=Ef();function n(p,h){return t(e(p,h,l),p+"")}return Hr=n,Hr}var Wr,nc;function Tf(){if(nc)return Wr;nc=1;var l=ln(),e=Gn(),t=Hs(),n=ht();function p(h,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],h):!1}return Wr=p,Wr}var zr,ic;function _f(){if(ic)return zr;ic=1;var l=Mf(),e=Tf();function t(n){return l(function(p,h){var g=-1,m=h.length,c=m>1?h[m-1]:void 0,d=m>2?h[2]:void 0;for(c=n.length>3&&typeof c=="function"?(m--,c):void 0,d&&e(h[0],h[1],d)&&(c=m<3?void 0:c,m=1),p=Object(p);++g<m;){var r=h[g];r&&n(p,r,g,c)}return p})}return zr=t,zr}var Br,rc;function Lf(){if(rc)return Br;rc=1;var l=wf(),e=_f(),t=e(function(n,p,h,g){l(n,p,h,g)});return Br=t,Br}var Rf=Lf();const kf=Nt(Rf),Df=()=>crypto.randomUUID().slice(0,8),Of=()=>Df().slice(0,8),oc=(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(h=>h==="*"?"":h.replace(t,"\\$&"));let p=!0;return n.length&&(p=!new RegExp(n.join("|"),"i").exec(l)),p},If=(l,e)=>{const t=l.indexOf(e);t!==-1&&l.splice(t,1)},Le=l=>{const e=l.className?.match(Zf);return e&&Kf[e[0]]},yt=l=>Array.from(new Set(l)),We=l=>l?.attrs?.id||l?.id||Of(),Ue=(l,e)=>kf({},l,e,(n,p)=>{if(Array.isArray(n))return p!=null?yt(n.concat(p)):p;if(Array.isArray(p))return n!=null?yt(p.concat(n)):p}),Ke=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,h=l.length;p<h;p++)e[p]=Ke(l[p]);return e}if(l instanceof Object){e={};for(const p in l)Object.hasOwn(l,p)&&(e[p]=Ke(l[p]));return e}throw new Error("Unable to copy Object, type not supported.")},jr=(l,e)=>l/e*100,Cs=l=>`${l.toString()}%`,Ws=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)}}}}),He=l=>/^(stage|row|column|field)s./.test(l),Nf=l=>Vf.test(l);function Ff(l,e=qs){let t=0;return function(...n){const p=Date.now();p-t>=e&&(t=p,l.apply(this,n))}}function Ln(l,e=bt){let t;return function(...n){t&&clearTimeout(t),t=setTimeout(()=>l.apply(this,n),e)}}function Ss(l){return l}function As(){}function qn(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?Ke(qn(l)):Rt();function lh(l,e,t,n={}){if(!e||!l[t][e])return n;const p=`${t}.${e}`;n[p]=l[t][e];const h=Jf.get(t);if(h){const g=l[t][e].data?.children||[];for(const m of g)lh(l,m,h,n)}return n}const Pf='<?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 xml:space="preserve" viewBox="0 0 32 32" id="f-i-info-circle" xmlns="http://www.w3.org/2000/svg"><path d="m17.962 24.725 1.806.096v2.531h-7.534v-2.406l1.045-.094c.568-.063.916-.254.916-1.014v-8.801c0-.699-.188-.92-.791-.92l-1.106-.062v-2.626h5.666zM15.747 4.648c1.394 0 2.405 1.047 2.405 2.374 0 1.331-1.014 2.313-2.438 2.313-1.454 0-2.404-.982-2.404-2.313 0-1.327.95-2.374 2.437-2.374M16 32C7.178 32 0 24.822 0 16S7.178 0 16 0c8.82 0 16 7.178 16 16s-7.18 16-16 16m0-29C8.832 3 3 8.832 3 16s5.832 13 13 13 13-5.832 13-13S23.168 3 16 3"/></symbol><symbol viewBox="0 0 384 512" id="f-i-menu" xmlns="http://www.w3.org/2000/svg"><g id="avprefix__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="axprefix__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="axprefix__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="axprefix__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="bfprefix__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="bfprefix__g7209"><path id="bfprefix__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="bgprefix__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="bhprefix__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="biprefix__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="bjprefix__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="boprefix__icomoon-ignore"/><path d="M240 352h-240v128h480v-128h-240zM448 416h-64v-32h64v32zM112 160l128-128 128 128h-80v160h-96v-160z"/></symbol></svg>',zs=Gu.name,Bs=Gu.version,Kn=zs,Hf="formeo-sprite",Wf=null,zf=`https://cdn.jsdelivr.net/npm/formeo@${Bs}/dist/${Hf}.svg`,Bf=`https://cdn.jsdelivr.net/npm/formeo@${Bs}/dist/formeo.min.css`,sc="https://draggable.github.io/formeo/assets/css/formeo.min.css",ch="f-panel",ct="control-group",Pt=`${Kn}-stage`,tt=`${Kn}-row`,nt=`${Kn}-column`,Ht=`${Kn}-field`,$s="custom-column-widths",uh="column-preset",Vr="resizing-columns",jf=new Map([[Pt,tt],[tt,nt],[nt,Ht]]),js=["stage","row","column","field"],Vs=js.map(l=>`${l}s`);new Map(Vs.map((l,e)=>[l,js[e]]));const Vf=new RegExp(`^${Vs.join("|")}.`),hh=[...js],Uf=[...Vs],Gf=new Map(Uf.map((l,e)=>[l,hh[e]])),Ur=hh.reduce((l,e)=>(l[e]=e,l),{}),qf=[{name:"controls",className:ct},{name:"stage",className:Pt},{name:"row",className:tt},{name:"column",className:nt},{name:"field",className:Ht}],Us={controls:ct,stage:Pt,row:tt,column:nt,field:Ht},Kf=Object.entries(Us).reduce((l,[e,t])=>(l[t]=e,l),{}),Yf=Object.values(Us),Zf=new RegExp(`${Yf.join("|")}`,"g"),{childTypeMapVals:dh,childTypeIndexMapVals:Xf}=qf.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:[]}),Qf=dh.slice().map(l=>l.slice().reverse()).reverse(),ac=new Map(dh),Jf=new Map(Xf),ep=new Map(Qf.slice()),tp=[[{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"}]],np=new Map(tp.reduce((l,e,t)=>(l.push([t,e]),l),[])),Gs=`${zs}-formData`,lc=`${zs}-locale`,Qe=333,bt=Math.round(Qe/2),qs=Math.round(Qe*2),fh="formeoSaved",on="formeoUpdated",ip="formeoChanged",ph="formeoUpdatedStage",gh="formeoUpdatedRow",mh="formeoUpdatedColumn",vh="formeoUpdatedField",rp="formeoCleared",yh="formeoOnRender",op="formeoConditionUpdated",Ks="formeoAddedRow",Ys="formeoAddedColumn",Zs="formeoAddedField",Xs="formeoRemovedRow",Qs="formeoRemovedColumn",Js="formeoRemovedField",bh={equals:"==",notEquals:"!=",contains:"⊃",notContains:"!⊃"},sp={and:"&&",or:"||"},wh={equals:"="},ap=["logical","source","sourceProperty","comparison","target","targetProperty","assignment","value"],cc=["isChecked","isNotChecked"],uc=["isVisible","isNotVisible"],wn=["value"],lp={comparison:bh,assignment:wh,logical:sp},Ch="if",cp="then",ea=()=>({[Ch]:[{source:"",sourceProperty:"",comparison:"",target:"",targetProperty:""}],[cp]:[{target:"",targetProperty:"",assignment:"",value:""}]}),up=/(\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,xs=/\bcol-\w+-\d+/g,Sh="f-i-",Rt=()=>({id:We(),stages:{[We()]:{}},rows:{},columns:{},fields:{}}),Rn=["selected","checked"],hp=Rn.toReversed(),dp=new Map([["config",new Set(["label","helpText","hideLabel","labelAfter","disableHtmlLabel","tooltip"])]]),fp="a an and as at but by for for from in into near nor of on onto or the to with".split(" ").map(l=>String.raw`\s${l}\s`),pp=new RegExp(String.raw`(?!${fp.join("|")})\w\S*`,"g"),gp=/\s+/g;function Je(l){return typeof l!="string"||l.trim().match(gp)?l:l.replace(pp,t=>t.charAt(0).toUpperCase()+t.substring(1).replace(/[A-Z]/g,n=>` ${n}`))}const Ah=(l,e="-")=>l.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,e),wt=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)},hc=(l,e="-")=>wt(l).join(e),mp=l=>{const e=document.createElement("div");return e.innerHTML=l,e.textContent||e.innerText||""},vp=(l,e,t="…")=>{if(l.length<=e)return l;const n=l.slice(0,e),p=n.lastIndexOf(" ");let h=`${p>0?n.slice(0,p):n}`;return t&&(h+=t),h},yp=/^attrs\.|^meta\.|^options\.|^config\./g;function kn(l){return l.replaceAll(yp,"")}var Gr,dc;function ta(){if(dc)return Gr;dc=1;var l=Ft(),e=At(),t="[object Symbol]";function n(p){return typeof p=="symbol"||e(p)&&l(p)==t}return Gr=n,Gr}var qr,fc;function bp(){if(fc)return qr;fc=1;var l=$t(),e=ta(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function p(h,g){if(l(h))return!1;var m=typeof h;return m=="number"||m=="symbol"||m=="boolean"||h==null||e(h)?!0:n.test(h)||!t.test(h)||g!=null&&h in Object(g)}return qr=p,qr}var Kr,pc;function wp(){if(pc)return Kr;pc=1;var l=Os(),e="Expected a function";function t(n,p){if(typeof n!="function"||p!=null&&typeof p!="function")throw new TypeError(e);var h=function(){var g=arguments,m=p?p.apply(this,g):g[0],c=h.cache;if(c.has(m))return c.get(m);var d=n.apply(this,g);return h.cache=c.set(m,d)||c,d};return h.cache=new(t.Cache||l),h}return t.Cache=l,Kr=t,Kr}var Yr,gc;function Cp(){if(gc)return Yr;gc=1;var l=wp(),e=500;function t(n){var p=l(n,function(g){return h.size===e&&h.clear(),g}),h=p.cache;return p}return Yr=t,Yr}var Zr,mc;function Sp(){if(mc)return Zr;mc=1;var l=Cp(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=l(function(p){var h=[];return p.charCodeAt(0)===46&&h.push(""),p.replace(e,function(g,m,c,d){h.push(c?d.replace(t,"$1"):m||g)}),h});return Zr=n,Zr}var Xr,vc;function Ap(){if(vc)return Xr;vc=1;function l(e,t){for(var n=-1,p=e==null?0:e.length,h=Array(p);++n<p;)h[n]=t(e[n],n,e);return h}return Xr=l,Xr}var Qr,yc;function $p(){if(yc)return Qr;yc=1;var l=jn(),e=Ap(),t=$t(),n=ta(),p=l?l.prototype:void 0,h=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 h?h.call(m):"";var c=m+"";return c=="0"&&1/m==-1/0?"-0":c}return Qr=g,Qr}var Jr,bc;function Yn(){if(bc)return Jr;bc=1;var l=$p();function e(t){return t==null?"":l(t)}return Jr=e,Jr}var eo,wc;function $h(){if(wc)return eo;wc=1;var l=$t(),e=bp(),t=Sp(),n=Yn();function p(h,g){return l(h)?h:e(h,g)?[h]:t(n(h))}return eo=p,eo}var to,Cc;function xh(){if(Cc)return to;Cc=1;var l=ta();function e(t){if(typeof t=="string"||l(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return to=e,to}var no,Sc;function xp(){if(Sc)return no;Sc=1;var l=$h(),e=xh();function t(n,p){p=l(p,n);for(var h=0,g=p.length;n!=null&&h<g;)n=n[e(p[h++])];return h&&h==g?n:void 0}return no=t,no}var io,Ac;function Ep(){if(Ac)return io;Ac=1;var l=xp();function e(t,n,p){var h=t==null?void 0:l(t,n);return h===void 0?p:h}return io=e,io}var Mp=Ep();const Tp=Nt(Mp);var ro,$c;function _p(){if($c)return ro;$c=1;var l=rh(),e=$h(),t=Hs(),n=ht(),p=xh();function h(g,m,c,d){if(!n(g))return g;m=e(m,g);for(var r=-1,o=m.length,a=o-1,s=g;s!=null&&++r<o;){var i=p(m[r]),u=c;if(i==="__proto__"||i==="constructor"||i==="prototype")return g;if(r!=a){var f=s[i];u=d?d(f,i,s):void 0,u===void 0&&(u=n(f)?f:t(m[r+1])?[]:{})}l(s,i,u),s=s[i]}return g}return ro=h,ro}var oo,xc;function Lp(){if(xc)return oo;xc=1;var l=_p();function e(t,n,p){return t==null?t:l(t,n,p)}return oo=e,oo}var Rp=Lp();const kp=Nt(Rp),Re=Tp,Zn=kp;function Dp(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 Cn(...l){return l.flat().reduce((e,t)=>(e[t]=t,e),{})}var so,Ec;function Op(){if(Ec)return so;Ec=1;var l="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,l),this}return so=e,so}var ao,Mc;function Ip(){if(Mc)return ao;Mc=1;function l(e){return this.__data__.has(e)}return ao=l,ao}var lo,Tc;function Np(){if(Tc)return lo;Tc=1;var l=Os(),e=Op(),t=Ip();function n(p){var h=-1,g=p==null?0:p.length;for(this.__data__=new l;++h<g;)this.add(p[h])}return n.prototype.add=n.prototype.push=e,n.prototype.has=t,lo=n,lo}var co,_c;function Fp(){if(_c)return co;_c=1;function l(e,t){for(var n=-1,p=e==null?0:e.length;++n<p;)if(t(e[n],n,e))return!0;return!1}return co=l,co}var uo,Lc;function Pp(){if(Lc)return uo;Lc=1;function l(e,t){return e.has(t)}return uo=l,uo}var ho,Rc;function Eh(){if(Rc)return ho;Rc=1;var l=Np(),e=Fp(),t=Pp(),n=1,p=2;function h(g,m,c,d,r,o){var a=c&n,s=g.length,i=m.length;if(s!=i&&!(a&&i>s))return!1;var u=o.get(g),f=o.get(m);if(u&&f)return u==m&&f==g;var y=-1,b=!0,E=c&p?new l:void 0;for(o.set(g,m),o.set(m,g);++y<s;){var $=g[y],A=m[y];if(d)var S=a?d(A,$,y,m,g,o):d($,A,y,g,m,o);if(S!==void 0){if(S)continue;b=!1;break}if(E){if(!e(m,function(M,R){if(!t(E,R)&&($===M||r($,M,c,d,o)))return E.push(R)})){b=!1;break}}else if(!($===A||r($,A,c,d,o))){b=!1;break}}return o.delete(g),o.delete(m),b}return ho=h,ho}var fo,kc;function Hp(){if(kc)return fo;kc=1;function l(e){var t=-1,n=Array(e.size);return e.forEach(function(p,h){n[++t]=[h,p]}),n}return fo=l,fo}var po,Dc;function Wp(){if(Dc)return po;Dc=1;function l(e){var t=-1,n=Array(e.size);return e.forEach(function(p){n[++t]=p}),n}return po=l,po}var go,Oc;function zp(){if(Oc)return go;Oc=1;var l=jn(),e=Qu(),t=ln(),n=Eh(),p=Hp(),h=Wp(),g=1,m=2,c="[object Boolean]",d="[object Date]",r="[object Error]",o="[object Map]",a="[object Number]",s="[object RegExp]",i="[object Set]",u="[object String]",f="[object Symbol]",y="[object ArrayBuffer]",b="[object DataView]",E=l?l.prototype:void 0,$=E?E.valueOf:void 0;function A(S,M,R,L,T,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 d:case a:return t(+S,+M);case r:return S.name==M.name&&S.message==M.message;case s:case u:return S==M+"";case o:var v=p;case i:var C=L&g;if(v||(v=h),S.size!=M.size&&!C)return!1;var x=w.get(S);if(x)return x==M;L|=m,w.set(S,M);var _=n(v(S),v(M),L,T,D,w);return w.delete(S),_;case f:if($)return $.call(S)==$.call(M)}return!1}return go=A,go}var mo,Ic;function Bp(){if(Ic)return mo;Ic=1;function l(e,t){for(var n=-1,p=t.length,h=e.length;++n<p;)e[h+n]=t[n];return e}return mo=l,mo}var vo,Nc;function jp(){if(Nc)return vo;Nc=1;var l=Bp(),e=$t();function t(n,p,h){var g=p(n);return e(n)?g:l(g,h(n))}return vo=t,vo}var yo,Fc;function Vp(){if(Fc)return yo;Fc=1;function l(e,t){for(var n=-1,p=e==null?0:e.length,h=0,g=[];++n<p;){var m=e[n];t(m,n,e)&&(g[h++]=m)}return g}return yo=l,yo}var bo,Pc;function Up(){if(Pc)return bo;Pc=1;function l(){return[]}return bo=l,bo}var wo,Hc;function Gp(){if(Hc)return wo;Hc=1;var l=Vp(),e=Up(),t=Object.prototype,n=t.propertyIsEnumerable,p=Object.getOwnPropertySymbols,h=p?function(g){return g==null?[]:(g=Object(g),l(p(g),function(m){return n.call(g,m)}))}:e;return wo=h,wo}var Co,Wc;function qp(){if(Wc)return Co;Wc=1;var l=Ju(),e=l(Object.keys,Object);return Co=e,Co}var So,zc;function Kp(){if(zc)return So;zc=1;var l=Ns(),e=qp(),t=Object.prototype,n=t.hasOwnProperty;function p(h){if(!l(h))return e(h);var g=[];for(var m in Object(h))n.call(h,m)&&m!="constructor"&&g.push(m);return g}return So=p,So}var Ao,Bc;function Yp(){if(Bc)return Ao;Bc=1;var l=oh(),e=Kp(),t=Gn();function n(p){return t(p)?l(p):e(p)}return Ao=n,Ao}var $o,jc;function Zp(){if(jc)return $o;jc=1;var l=jp(),e=Gp(),t=Yp();function n(p){return l(p,t,e)}return $o=n,$o}var xo,Vc;function Xp(){if(Vc)return xo;Vc=1;var l=Zp(),e=1,t=Object.prototype,n=t.hasOwnProperty;function p(h,g,m,c,d,r){var o=m&e,a=l(h),s=a.length,i=l(g),u=i.length;if(s!=u&&!o)return!1;for(var f=s;f--;){var y=a[f];if(!(o?y in g:n.call(g,y)))return!1}var b=r.get(h),E=r.get(g);if(b&&E)return b==g&&E==h;var $=!0;r.set(h,g),r.set(g,h);for(var A=o;++f<s;){y=a[f];var S=h[y],M=g[y];if(c)var R=o?c(M,S,y,g,h,r):c(S,M,y,h,g,r);if(!(R===void 0?S===M||d(S,M,m,c,r):R)){$=!1;break}A||(A=y=="constructor")}if($&&!A){var L=h.constructor,T=g.constructor;L!=T&&"constructor"in h&&"constructor"in g&&!(typeof L=="function"&&L instanceof L&&typeof T=="function"&&T instanceof T)&&($=!1)}return r.delete(h),r.delete(g),$}return xo=p,xo}var Eo,Uc;function Qp(){if(Uc)return Eo;Uc=1;var l=St(),e=Ze(),t=l(e,"DataView");return Eo=t,Eo}var Mo,Gc;function Jp(){if(Gc)return Mo;Gc=1;var l=St(),e=Ze(),t=l(e,"Promise");return Mo=t,Mo}var To,qc;function eg(){if(qc)return To;qc=1;var l=St(),e=Ze(),t=l(e,"Set");return To=t,To}var _o,Kc;function tg(){if(Kc)return _o;Kc=1;var l=St(),e=Ze(),t=l(e,"WeakMap");return _o=t,_o}var Lo,Yc;function ng(){if(Yc)return Lo;Yc=1;var l=Qp(),e=Ds(),t=Jp(),n=eg(),p=tg(),h=Ft(),g=Ku(),m="[object Map]",c="[object Object]",d="[object Promise]",r="[object Set]",o="[object WeakMap]",a="[object DataView]",s=g(l),i=g(e),u=g(t),f=g(n),y=g(p),b=h;return(l&&b(new l(new ArrayBuffer(1)))!=a||e&&b(new e)!=m||t&&b(t.resolve())!=d||n&&b(new n)!=r||p&&b(new p)!=o)&&(b=function(E){var $=h(E),A=$==c?E.constructor:void 0,S=A?g(A):"";if(S)switch(S){case s:return a;case i:return m;case u:return d;case f:return r;case y:return o}return $}),Lo=b,Lo}var Ro,Zc;function ig(){if(Zc)return Ro;Zc=1;var l=Yu(),e=Eh(),t=zp(),n=Xp(),p=ng(),h=$t(),g=Fs(),m=Ps(),c=1,d="[object Arguments]",r="[object Array]",o="[object Object]",a=Object.prototype,s=a.hasOwnProperty;function i(u,f,y,b,E,$){var A=h(u),S=h(f),M=A?r:p(u),R=S?r:p(f);M=M==d?o:M,R=R==d?o:R;var L=M==o,T=R==o,D=M==R;if(D&&g(u)){if(!g(f))return!1;A=!0,L=!1}if(D&&!L)return $||($=new l),A||m(u)?e(u,f,y,b,E,$):t(u,f,M,y,b,E,$);if(!(y&c)){var w=L&&s.call(u,"__wrapped__"),v=T&&s.call(f,"__wrapped__");if(w||v){var C=w?u.value():u,x=v?f.value():f;return $||($=new l),E(C,x,y,b,$)}}return D?($||($=new l),n(u,f,y,b,E,$)):!1}return Ro=i,Ro}var ko,Xc;function rg(){if(Xc)return ko;Xc=1;var l=ig(),e=At();function t(n,p,h,g,m){return n===p?!0:n==null||p==null||!e(n)&&!e(p)?n!==n&&p!==p:l(n,p,h,g,t,m)}return ko=t,ko}var Do,Qc;function og(){if(Qc)return Do;Qc=1;var l=rg();function e(t,n){return l(t,n)}return Do=e,Do}var sg=og();const Es=Nt(sg),ag=(l,e)=>l===void 0?"added":e===void 0?"removed":Es(l,e)?"unchanged":"changed";class na{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=>Re(this.data,e);set(e,t){const n=Re(this.data,e),p=Zn(this.data,e,t),h=Array.isArray(e)?e.join("."):e,g=Object.keys(this.setCallbacks).filter(c=>new RegExp(c).test(h)),m={newVal:t,oldVal:n,path:e};for(const c of g)for(const d of this.setCallbacks[c])d(m);if(!this.disableEvents){const c={entity:this,dataPath:this.dataPath.replace(/\.+$/,""),changePath:this.dataPath+e,value:t,data:p,changeType:ag(n,t),src:this.dom};if(n&&(c.previousValue=n),J.formeoUpdated(c),this.name){const r={stage:ph,row:gh,column:mh,field:vh}[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=wt(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 Xn extends na{load=e=>{const t=qn(e);this.empty();for(const[n,p]of Object.entries(t))this.add(n,p);return this.data};get=e=>e?Re(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:Ks,column:Ys,field:Zs}[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=Ue(this.configVal,Ke(e))}get config(){return this.configVal}conditionMap=new Map}function Jc(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 Ye(l){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Jc(Object(t),!0).forEach(function(n){lg(l,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(t)):Jc(Object(t)).forEach(function(n){Object.defineProperty(l,n,Object.getOwnPropertyDescriptor(t,n))})}return l}function Sn(l){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Sn=function(e){return typeof e}:Sn=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sn(l)}function lg(l,e,t){return e in l?Object.defineProperty(l,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):l[e]=t,l}function it(){return it=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},it.apply(this,arguments)}function cg(l,e){if(l==null)return{};var t={},n=Object.keys(l),p,h;for(h=0;h<n.length;h++)p=n[h],!(e.indexOf(p)>=0)&&(t[p]=l[p]);return t}function ug(l,e){if(l==null)return{};var t=cg(l,e),n,p;if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(l);for(p=0;p<h.length;p++)n=h[p],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(l,n)&&(t[n]=l[n])}return t}var hg="1.15.3";function et(l){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(l)}var ot=et(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),cn=et(/Edge/i),eu=et(/firefox/i),Qt=et(/safari/i)&&!et(/chrome/i)&&!et(/android/i),Mh=et(/iP(ad|od|hone)/i),Th=et(/chrome/i)&&et(/android/i),_h={capture:!1,passive:!1};function se(l,e,t){l.addEventListener(e,t,!ot&&_h)}function oe(l,e,t){l.removeEventListener(e,t,!ot&&_h)}function Dn(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 Lh(l){return l.host&&l!==document&&l.host.nodeType?l.host:l.parentNode}function Ve(l,e,t,n){if(l){t=t||document;do{if(e!=null&&(e[0]===">"?l.parentNode===t&&Dn(l,e):Dn(l,e))||n&&l===t)return l;if(l===t)break}while(l=Lh(l))}return null}var tu=/\s+/g;function Ie(l,e,t){if(l&&e)if(l.classList)l.classList[t?"add":"remove"](e);else{var n=(" "+l.className+" ").replace(tu," ").replace(" "+e+" "," ");l.className=(n+(t?" "+e:"")).replace(tu," ")}}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 kt(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 Rh(l,e,t){if(l){var n=l.getElementsByTagName(e),p=0,h=n.length;if(t)for(;p<h;p++)t(n[p],p);return n}return[]}function qe(){var l=document.scrollingElement;return l||document.documentElement}function we(l,e,t,n,p){if(!(!l.getBoundingClientRect&&l!==window)){var h,g,m,c,d,r,o;if(l!==window&&l.parentNode&&l!==qe()?(h=l.getBoundingClientRect(),g=h.top,m=h.left,c=h.bottom,d=h.right,r=h.height,o=h.width):(g=0,m=0,c=window.innerHeight,d=window.innerWidth,r=window.innerHeight,o=window.innerWidth),(e||t)&&l!==window&&(p=p||l.parentNode,!ot))do if(p&&p.getBoundingClientRect&&(ne(p,"transform")!=="none"||t&&ne(p,"position")!=="static")){var a=p.getBoundingClientRect();g-=a.top+parseInt(ne(p,"border-top-width")),m-=a.left+parseInt(ne(p,"border-left-width")),c=g+h.height,d=m+h.width;break}while(p=p.parentNode);if(n&&l!==window){var s=kt(p||l),i=s&&s.a,u=s&&s.d;s&&(g/=u,m/=i,o/=i,r/=u,c=g+r,d=m+o)}return{top:g,left:m,bottom:c,right:d,width:o,height:r}}}function nu(l,e,t){for(var n=lt(l,!0),p=we(l)[e];n;){var h=we(n)[t],g=void 0;if(g=p>=h,!g)return n;if(n===qe())break;n=lt(n,!1)}return!1}function Ot(l,e,t,n){for(var p=0,h=0,g=l.children;h<g.length;){if(g[h].style.display!=="none"&&g[h]!==te.ghost&&(n||g[h]!==te.dragged)&&Ve(g[h],t.draggable,l,!1)){if(p===e)return g[h];p++}h++}return null}function ia(l,e){for(var t=l.lastElementChild;t&&(t===te.ghost||ne(t,"display")==="none"||e&&!Dn(t,e));)t=t.previousElementSibling;return t||null}function Pe(l,e){var t=0;if(!l||!l.parentNode)return-1;for(;l=l.previousElementSibling;)l.nodeName.toUpperCase()!=="TEMPLATE"&&l!==te.clone&&(!e||Dn(l,e))&&t++;return t}function iu(l){var e=0,t=0,n=qe();if(l)do{var p=kt(l),h=p.a,g=p.d;e+=l.scrollLeft*h,t+=l.scrollTop*g}while(l!==n&&(l=l.parentNode));return[e,t]}function dg(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 lt(l,e){if(!l||!l.getBoundingClientRect)return qe();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 qe();if(n||e)return t;n=!0}}while(t=t.parentNode);return qe()}function fg(l,e){if(l&&e)for(var t in e)e.hasOwnProperty(t)&&(l[t]=e[t]);return l}function Oo(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 Jt;function kh(l,e){return function(){if(!Jt){var t=arguments,n=this;t.length===1?l.call(n,t[0]):l.apply(n,t),Jt=setTimeout(function(){Jt=void 0},e)}}}function pg(){clearTimeout(Jt),Jt=void 0}function Dh(l,e,t){l.scrollLeft+=e,l.scrollTop+=t}function Oh(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 Ih(l,e,t){var n={};return Array.from(l.children).forEach(function(p){var h,g,m,c;if(!(!Ve(p,e.draggable,l,!1)||p.animated||p===t)){var d=we(p);n.left=Math.min((h=n.left)!==null&&h!==void 0?h:1/0,d.left),n.top=Math.min((g=n.top)!==null&&g!==void 0?g:1/0,d.top),n.right=Math.max((m=n.right)!==null&&m!==void 0?m:-1/0,d.right),n.bottom=Math.max((c=n.bottom)!==null&&c!==void 0?c:-1/0,d.bottom)}}),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var ke="Sortable"+new Date().getTime();function gg(){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 h=Ye({},l[l.length-1].rect);if(p.thisAnimationDuration){var g=kt(p,!0);g&&(h.top-=g.f,h.left-=g.e)}p.fromRect=h}})}},addAnimationState:function(n){l.push(n)},removeAnimationState:function(n){l.splice(dg(l,{target:n}),1)},animateAll:function(n){var p=this;if(!this.options.animation){clearTimeout(e),typeof n=="function"&&n();return}var h=!1,g=0;l.forEach(function(m){var c=0,d=m.target,r=d.fromRect,o=we(d),a=d.prevFromRect,s=d.prevToRect,i=m.rect,u=kt(d,!0);u&&(o.top-=u.f,o.left-=u.e),d.toRect=o,d.thisAnimationDuration&&Oo(a,o)&&!Oo(r,o)&&(i.top-o.top)/(i.left-o.left)===(r.top-o.top)/(r.left-o.left)&&(c=vg(i,a,s,p.options)),Oo(o,r)||(d.prevFromRect=r,d.prevToRect=o,c||(c=p.options.animation),p.animate(d,i,o,c)),c&&(h=!0,g=Math.max(g,c),clearTimeout(d.animationResetTimer),d.animationResetTimer=setTimeout(function(){d.animationTime=0,d.prevFromRect=null,d.fromRect=null,d.prevToRect=null,d.thisAnimationDuration=null},c),d.thisAnimationDuration=c)}),clearTimeout(e),h?e=setTimeout(function(){typeof n=="function"&&n()},g):typeof n=="function"&&n(),l=[]},animate:function(n,p,h,g){if(g){ne(n,"transition",""),ne(n,"transform","");var m=kt(this.el),c=m&&m.a,d=m&&m.d,r=(p.left-h.left)/(c||1),o=(p.top-h.top)/(d||1);n.animatingX=!!r,n.animatingY=!!o,ne(n,"transform","translate3d("+r+"px,"+o+"px,0)"),this.forRepaintDummy=mg(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 mg(l){return l.offsetWidth}function vg(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 xt=[],Io={initializeByDefault:!0},un={mount:function(e){for(var t in Io)Io.hasOwnProperty(t)&&!(t in e)&&(e[t]=Io[t]);xt.forEach(function(n){if(n.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),xt.push(e)},pluginEvent:function(e,t,n){var p=this;this.eventCanceled=!1,n.cancel=function(){p.eventCanceled=!0};var h=e+"Global";xt.forEach(function(g){t[g.pluginName]&&(t[g.pluginName][h]&&t[g.pluginName][h](Ye({sortable:t},n)),t.options[g.pluginName]&&t[g.pluginName][e]&&t[g.pluginName][e](Ye({sortable:t},n)))})},initializePlugins:function(e,t,n,p){xt.forEach(function(m){var c=m.pluginName;if(!(!e.options[c]&&!m.initializeByDefault)){var d=new m(e,t,e.options);d.sortable=e,d.options=e.options,e[c]=d,it(n,d.defaults)}});for(var h in e.options)if(e.options.hasOwnProperty(h)){var g=this.modifyOption(e,h,e.options[h]);typeof g<"u"&&(e.options[h]=g)}},getEventProperties:function(e,t){var n={};return xt.forEach(function(p){typeof p.eventProperties=="function"&&it(n,p.eventProperties.call(t[p.pluginName],e))}),n},modifyOption:function(e,t,n){var p;return xt.forEach(function(h){e[h.pluginName]&&h.optionListeners&&typeof h.optionListeners[t]=="function"&&(p=h.optionListeners[t].call(e[h.pluginName],n))}),p}};function yg(l){var e=l.sortable,t=l.rootEl,n=l.name,p=l.targetEl,h=l.cloneEl,g=l.toEl,m=l.fromEl,c=l.oldIndex,d=l.newIndex,r=l.oldDraggableIndex,o=l.newDraggableIndex,a=l.originalEvent,s=l.putSortable,i=l.extraEventProperties;if(e=e||t&&t[ke],!!e){var u,f=e.options,y="on"+n.charAt(0).toUpperCase()+n.substr(1);window.CustomEvent&&!ot&&!cn?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=h,u.oldIndex=c,u.newIndex=d,u.oldDraggableIndex=r,u.newDraggableIndex=o,u.originalEvent=a,u.pullMode=s?s.lastPutMode:void 0;var b=Ye(Ye({},i),un.getEventProperties(n,e));for(var E in b)u[E]=b[E];t&&t.dispatchEvent(u),f[y]&&f[y].call(e,u)}}var bg=["evt"],_e=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},p=n.evt,h=ug(n,bg);un.pluginEvent.bind(te)(e,t,Ye({dragEl:q,parentEl:ve,ghostEl:ie,rootEl:fe,nextEl:mt,lastDownEl:An,cloneEl:pe,cloneHidden:at,dragStarted:Kt,putSortable:Se,activeSortable:te.active,originalEvent:p,oldIndex:_t,oldDraggableIndex:en,newIndex:Ne,newDraggableIndex:st,hideGhostForTarget:Hh,unhideGhostForTarget:Wh,cloneNowHidden:function(){at=!0},cloneNowShown:function(){at=!1},dispatchSortableEvent:function(m){Ee({sortable:t,name:m,originalEvent:p})}},h))};function Ee(l){yg(Ye({putSortable:Se,cloneEl:pe,targetEl:q,rootEl:fe,oldIndex:_t,oldDraggableIndex:en,newIndex:Ne,newDraggableIndex:st},l))}var q,ve,ie,fe,mt,An,pe,at,_t,Ne,en,st,fn,Se,Mt=!1,On=!1,In=[],pt,Be,No,Fo,ru,ou,Kt,Et,tn,nn=!1,pn=!1,$n,Ae,Po=[],Ms=!1,Nn=[],Qn=typeof document<"u",gn=Mh,su=cn||ot?"cssFloat":"float",wg=Qn&&!Th&&!Mh&&"draggable"in document.createElement("div"),Nh=(function(){if(Qn){if(ot)return!1;var l=document.createElement("x");return l.style.cssText="pointer-events:auto",l.style.pointerEvents==="auto"}})(),Fh=function(e,t){var n=ne(e),p=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),h=Ot(e,0,t),g=Ot(e,1,t),m=h&&ne(h),c=g&&ne(g),d=m&&parseInt(m.marginLeft)+parseInt(m.marginRight)+we(h).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(h&&m.float&&m.float!=="none"){var o=m.float==="left"?"left":"right";return g&&(c.clear==="both"||c.clear===o)?"vertical":"horizontal"}return h&&(m.display==="block"||m.display==="flex"||m.display==="table"||m.display==="grid"||d>=p&&n[su]==="none"||g&&n[su]==="none"&&d+r>p)?"vertical":"horizontal"},Cg=function(e,t,n){var p=n?e.left:e.top,h=n?e.right:e.bottom,g=n?e.width:e.height,m=n?t.left:t.top,c=n?t.right:t.bottom,d=n?t.width:t.height;return p===m||h===c||p+g/2===m+d/2},Sg=function(e,t){var n;return In.some(function(p){var h=p[ke].options.emptyInsertThreshold;if(!(!h||ia(p))){var g=we(p),m=e>=g.left-h&&e<=g.right+h,c=t>=g.top-h&&t<=g.bottom+h;if(m&&c)return n=p}}),n},Ph=function(e){function t(h,g){return function(m,c,d,r){var o=m.options.group.name&&c.options.group.name&&m.options.group.name===c.options.group.name;if(h==null&&(g||o))return!0;if(h==null||h===!1)return!1;if(g&&h==="clone")return h;if(typeof h=="function")return t(h(m,c,d,r),g)(m,c,d,r);var a=(g?m:c).options.group.name;return h===!0||typeof h=="string"&&h===a||h.join&&h.indexOf(a)>-1}}var n={},p=e.group;(!p||Sn(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},Hh=function(){!Nh&&ie&&ne(ie,"display","none")},Wh=function(){!Nh&&ie&&ne(ie,"display","")};Qn&&!Th&&document.addEventListener("click",function(l){if(On)return l.preventDefault(),l.stopPropagation&&l.stopPropagation(),l.stopImmediatePropagation&&l.stopImmediatePropagation(),On=!1,!1},!0);var gt=function(e){if(q){e=e.touches?e.touches[0]:e;var t=Sg(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[ke]._onDragOver(n)}}},Ag=function(e){q&&q.parentNode[ke]._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=it({},e),l[ke]=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 Fh(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};un.initializePlugins(this,l,t);for(var n in t)!(n in e)&&(e[n]=t[n]);Ph(e);for(var p in this)p.charAt(0)==="_"&&typeof this[p]=="function"&&(this[p]=this[p].bind(this));this.nativeDraggable=e.forceFallback?!1:wg,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)),In.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),it(this,gg())}te.prototype={constructor:te,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(Et=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,h=p.preventOnFilter,g=e.type,m=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,c=(m||e).target,d=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||c,r=p.filter;if(Rg(n),!q&&!(/mousedown|pointerdown/.test(g)&&e.button!==0||p.disabled)&&!d.isContentEditable&&!(!this.nativeDraggable&&Qt&&c&&c.tagName.toUpperCase()==="SELECT")&&(c=Ve(c,p.draggable,n,!1),!(c&&c.animated)&&An!==c)){if(_t=Pe(c),en=Pe(c,p.draggable),typeof r=="function"){if(r.call(this,e,c,this)){Ee({sortable:t,rootEl:d,name:"filter",targetEl:c,toEl:n,fromEl:n}),_e("filter",t,{evt:e}),h&&e.cancelable&&e.preventDefault();return}}else if(r&&(r=r.split(",").some(function(o){if(o=Ve(d,o.trim(),n,!1),o)return Ee({sortable:t,rootEl:o,name:"filter",targetEl:c,fromEl:n,toEl:n}),_e("filter",t,{evt:e}),!0}),r)){h&&e.cancelable&&e.preventDefault();return}p.handle&&!Ve(d,p.handle,n,!1)||this._prepareDragStart(e,m,c)}}},_prepareDragStart:function(e,t,n){var p=this,h=p.el,g=p.options,m=h.ownerDocument,c;if(n&&!q&&n.parentNode===h){var d=we(n);if(fe=h,q=n,ve=q.parentNode,mt=q.nextSibling,An=n,fn=g.group,te.dragged=q,pt={target:q,clientX:(t||e).clientX,clientY:(t||e).clientY},ru=pt.clientX-d.left,ou=pt.clientY-d.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,q.style["will-change"]="all",c=function(){if(_e("delayEnded",p,{evt:e}),te.eventCanceled){p._onDrop();return}p._disableDelayedDragEvents(),!eu&&p.nativeDraggable&&(q.draggable=!0),p._triggerDragStart(e,t),Ee({sortable:p,name:"choose",originalEvent:e}),Ie(q,g.chosenClass,!0)},g.ignore.split(",").forEach(function(r){Rh(q,r.trim(),Ho)}),se(m,"dragover",gt),se(m,"mousemove",gt),se(m,"touchmove",gt),se(m,"mouseup",p._onDrop),se(m,"touchend",p._onDrop),se(m,"touchcancel",p._onDrop),eu&&this.nativeDraggable&&(this.options.touchStartThreshold=4,q.draggable=!0),_e("delayStart",this,{evt:e}),g.delay&&(!g.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(cn||ot))){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&&Ho(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?xn(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(Mt=!1,fe&&q){_e("dragStarted",this,{evt:t}),this.nativeDraggable&&se(document,"dragover",Ag);var n=this.options;!e&&Ie(q,n.dragClass,!1),Ie(q,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,Hh();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(q.parentNode[ke]._isOutsideThisEl(e),t)do{if(t[ke]){var n=void 0;if(n=t[ke]._onDragOver({clientX:Be.clientX,clientY:Be.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=Lh(t));Wh()}},_onTouchMove:function(e){if(pt){var t=this.options,n=t.fallbackTolerance,p=t.fallbackOffset,h=e.touches?e.touches[0]:e,g=ie&&kt(ie,!0),m=ie&&g&&g.a,c=ie&&g&&g.d,d=gn&&Ae&&iu(Ae),r=(h.clientX-pt.clientX+p.x)/(m||1)+(d?d[0]-Po[0]:0)/(m||1),o=(h.clientY-pt.clientY+p.y)/(c||1)+(d?d[1]-Po[1]:0)/(c||1);if(!te.active&&!Mt){if(n&&Math.max(Math.abs(h.clientX-this._lastX),Math.abs(h.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(ie){g?(g.e+=r-(No||0),g.f+=o-(Fo||0)):g={a:1,b:0,c:0,d:1,e:r,f:o};var a="matrix(".concat(g.a,",").concat(g.b,",").concat(g.c,",").concat(g.d,",").concat(g.e,",").concat(g.f,")");ne(ie,"webkitTransform",a),ne(ie,"mozTransform",a),ne(ie,"msTransform",a),ne(ie,"transform",a),No=r,Fo=o,Be=h}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!ie){var e=this.options.fallbackOnBody?document.body:fe,t=we(q,!0,gn,!0,e),n=this.options;if(gn){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=qe()),t.top+=Ae.scrollTop,t.left+=Ae.scrollLeft):Ae=qe(),Po=iu(Ae)}ie=q.cloneNode(!0),Ie(ie,n.ghostClass,!1),Ie(ie,n.fallbackClass,!0),Ie(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",gn?"absolute":"fixed"),ne(ie,"zIndex","100000"),ne(ie,"pointerEvents","none"),te.ghost=ie,e.appendChild(ie),ne(ie,"transform-origin",ru/parseInt(ie.style.width)*100+"% "+ou/parseInt(ie.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,p=e.dataTransfer,h=n.options;if(_e("dragStart",this,{evt:e}),te.eventCanceled){this._onDrop();return}_e("setupClone",this),te.eventCanceled||(pe=Oh(q),pe.removeAttribute("id"),pe.draggable=!1,pe.style["will-change"]="",this._hideClone(),Ie(pe,this.options.chosenClass,!1),te.clone=pe),n.cloneId=xn(function(){_e("clone",n),!te.eventCanceled&&(n.options.removeCloneOnHide||fe.insertBefore(pe,q),n._hideClone(),Ee({sortable:n,name:"clone"}))}),!t&&Ie(q,h.dragClass,!0),t?(On=!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",h.setData&&h.setData.call(n,p,q)),se(document,"drop",n),ne(q,"transform","translateZ(0)")),Mt=!0,n._dragStartId=xn(n._dragStarted.bind(n,t,e)),se(document,"selectstart",n),Kt=!0,Qt&&ne(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,n=e.target,p,h,g,m=this.options,c=m.group,d=te.active,r=fn===c,o=m.sort,a=Se||d,s,i=this,u=!1;if(Ms)return;function f(O,I){_e(O,i,Ye({evt:e,isOwner:r,axis:s?"vertical":"horizontal",revert:g,dragRect:p,targetRect:h,canSort:o,fromSortable:a,target:n,completed:b,onMove:function(P,B){return mn(fe,t,q,p,P,we(P),e,B)},changed:E},I))}function y(){f("dragOverAnimationCapture"),i.captureAnimationState(),i!==a&&a.captureAnimationState()}function b(O){return f("dragOverCompleted",{insertion:O}),O&&(r?d._hideClone():d._showClone(i),i!==a&&(Ie(q,Se?Se.options.ghostClass:d.options.ghostClass,!1),Ie(q,m.ghostClass,!0)),Se!==i&&i!==te.active?Se=i:i===te.active&&Se&&(Se=null),a===i&&(i._ignoreWhileAnimating=n),i.animateAll(function(){f("dragOverAnimationComplete"),i._ignoreWhileAnimating=null}),i!==a&&(a.animateAll(),a._ignoreWhileAnimating=null)),(n===q&&!q.animated||n===t&&!n.animated)&&(Et=null),!m.dragoverBubble&&!e.rootEl&&n!==document&&(q.parentNode[ke]._isOutsideThisEl(e.target),!O&>(e)),!m.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),u=!0}function E(){Ne=Pe(q),st=Pe(q,m.draggable),Ee({sortable:i,name:"change",toEl:t,newIndex:Ne,newDraggableIndex:st,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=Ve(n,m.draggable,t,!0),f("dragOver"),te.eventCanceled)return u;if(q.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||i._ignoreWhileAnimating===n)return b(!1);if(On=!1,d&&!m.disabled&&(r?o||(g=ve!==fe):Se===this||(this.lastPutMode=fn.checkPull(this,d,q,e))&&c.checkPut(this,d,q,e))){if(s=this._getDirection(e,n)==="vertical",p=we(q),f("dragOverValid"),te.eventCanceled)return u;if(g)return ve=fe,y(),this._hideClone(),f("revert"),te.eventCanceled||(mt?fe.insertBefore(q,mt):fe.appendChild(q)),b(!0);var $=ia(t,m.draggable);if(!$||Mg(e,s,this)&&!$.animated){if($===q)return b(!1);if($&&t===e.target&&(n=$),n&&(h=we(n)),mn(fe,t,q,p,n,h,e,!!n)!==!1)return y(),$&&$.nextSibling?t.insertBefore(q,$.nextSibling):t.appendChild(q),ve=t,E(),b(!0)}else if($&&Eg(e,s,this)){var A=Ot(t,0,m,!0);if(A===q)return b(!1);if(n=A,h=we(n),mn(fe,t,q,p,n,h,e,!1)!==!1)return y(),t.insertBefore(q,A),ve=t,E(),b(!0)}else if(n.parentNode===t){h=we(n);var S=0,M,R=q.parentNode!==t,L=!Cg(q.animated&&q.toRect||p,n.animated&&n.toRect||h,s),T=s?"top":"left",D=nu(n,"top","top")||nu(q,"top","top"),w=D?D.scrollTop:void 0;Et!==n&&(M=h[T],nn=!1,pn=!L&&m.invertSwap||R),S=Tg(e,n,h,s,L?1:m.swapThreshold,m.invertedSwapThreshold==null?m.swapThreshold:m.invertedSwapThreshold,pn,Et===n);var v;if(S!==0){var C=Pe(q);do C-=S,v=ve.children[C];while(v&&(ne(v,"display")==="none"||v===ie))}if(S===0||v===n)return b(!1);Et=n,tn=S;var x=n.nextElementSibling,_=!1;_=S===1;var k=mn(fe,t,q,p,n,h,e,_);if(k!==!1)return(k===1||k===-1)&&(_=k===1),Ms=!0,setTimeout(xg,30),y(),_&&!x?t.appendChild(q):n.parentNode.insertBefore(q,_?x:n),D&&Dh(D,0,w-D.scrollTop),ve=q.parentNode,M!==void 0&&!pn&&($n=Math.abs(M-we(n)[T])),E(),b(!0)}if(t.contains(q))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",gt),oe(document,"mousemove",gt),oe(document,"touchmove",gt)},_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(Ne=Pe(q),st=Pe(q,n.draggable),_e("drop",this,{evt:e}),ve=q&&q.parentNode,Ne=Pe(q),st=Pe(q,n.draggable),te.eventCanceled){this._nulling();return}Mt=!1,pn=!1,nn=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ts(this.cloneId),Ts(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&&(Kt&&(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),Ho(q),q.style["will-change"]="",Kt&&!Mt&&Ie(q,Se?Se.options.ghostClass:this.options.ghostClass,!1),Ie(q,this.options.chosenClass,!1),Ee({sortable:this,name:"unchoose",toEl:ve,newIndex:null,newDraggableIndex:null,originalEvent:e}),fe!==ve?(Ne>=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()):Ne!==_t&&Ne>=0&&(Ee({sortable:this,name:"update",toEl:ve,originalEvent:e}),Ee({sortable:this,name:"sort",toEl:ve,originalEvent:e})),te.active&&((Ne==null||Ne===-1)&&(Ne=_t,st=en),Ee({sortable:this,name:"end",toEl:ve,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){_e("nulling",this),fe=q=ve=ie=mt=pe=An=at=pt=Be=Kt=Ne=st=_t=en=Et=tn=Se=fn=te.dragged=te.ghost=te.clone=te.active=null,Nn.forEach(function(e){e.checked=!0}),Nn.length=No=Fo=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":q&&(this._onDragOver(e),$g(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,p=0,h=n.length,g=this.options;p<h;p++)t=n[p],Ve(t,g.draggable,this.el,!1)&&e.push(t.getAttribute(g.dataIdAttr)||Lg(t));return e},sort:function(e,t){var n={},p=this.el;this.toArray().forEach(function(h,g){var m=p.children[g];Ve(m,this.options.draggable,p,!1)&&(n[h]=m)},this),t&&this.captureAnimationState(),e.forEach(function(h){n[h]&&(p.removeChild(n[h]),p.appendChild(n[h]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return Ve(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=un.modifyOption(this,e,t);typeof p<"u"?n[e]=p:n[e]=t,e==="group"&&Ph(n)},destroy:function(){_e("destroy",this);var e=this.el;e[ke]=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(),In.splice(In.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!at){if(_e("hideClone",this),te.eventCanceled)return;ne(pe,"display","none"),this.options.removeCloneOnHide&&pe.parentNode&&pe.parentNode.removeChild(pe),at=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(at){if(_e("showClone",this),te.eventCanceled)return;q.parentNode==fe&&!this.options.group.revertClone?fe.insertBefore(pe,q):mt?fe.insertBefore(pe,mt):fe.appendChild(pe),this.options.group.revertClone&&this.animate(q,pe),ne(pe,"display",""),at=!1}}};function $g(l){l.dataTransfer&&(l.dataTransfer.dropEffect="move"),l.cancelable&&l.preventDefault()}function mn(l,e,t,n,p,h,g,m){var c,d=l[ke],r=d.options.onMove,o;return window.CustomEvent&&!ot&&!cn?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=h||we(e),c.willInsertAfter=m,c.originalEvent=g,l.dispatchEvent(c),r&&(o=r.call(d,c,g)),o}function Ho(l){l.draggable=!1}function xg(){Ms=!1}function Eg(l,e,t){var n=we(Ot(t.el,0,t.options,!0)),p=Ih(t.el,t.options,ie),h=10;return e?l.clientX<p.left-h||l.clientY<n.top&&l.clientX<n.right:l.clientY<p.top-h||l.clientY<n.bottom&&l.clientX<n.left}function Mg(l,e,t){var n=we(ia(t.el,t.options.draggable)),p=Ih(t.el,t.options,ie),h=10;return e?l.clientX>p.right+h||l.clientY>n.bottom&&l.clientX>n.left:l.clientY>p.bottom+h||l.clientX>n.right&&l.clientY>n.top}function Tg(l,e,t,n,p,h,g,m){var c=n?l.clientY:l.clientX,d=n?t.height:t.width,r=n?t.top:t.left,o=n?t.bottom:t.right,a=!1;if(!g){if(m&&$n<d*p){if(!nn&&(tn===1?c>r+d*h/2:c<o-d*h/2)&&(nn=!0),nn)a=!0;else if(tn===1?c<r+$n:c>o-$n)return-tn}else if(c>r+d*(1-p)/2&&c<o-d*(1-p)/2)return _g(e)}return a=a||g,a&&(c<r+d*h/2||c>o-d*h/2)?c>r+d/2?1:-1:0}function _g(l){return Pe(q)<Pe(l)?1:-1}function Lg(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 Rg(l){Nn.length=0;for(var e=l.getElementsByTagName("input"),t=e.length;t--;){var n=e[t];n.checked&&Nn.push(n)}}function xn(l){return setTimeout(l,0)}function Ts(l){return clearTimeout(l)}Qn&&se(document,"touchmove",function(l){(te.active||Mt)&&l.cancelable&&l.preventDefault()});te.utils={on:se,off:oe,css:ne,find:Rh,is:function(e,t){return!!Ve(e,t,e,!1)},extend:fg,throttle:kh,closest:Ve,toggleClass:Ie,clone:Oh,index:Pe,nextTick:xn,cancelNextTick:Ts,detectDirection:Fh,getChild:Ot,expando:ke};te.get=function(l){return l[ke]};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=Ye(Ye({},te.utils),n.utils)),un.mount(n)})};te.create=function(l,e){return new te(l,e)};te.version=hg;var be=[],Yt,_s,Ls=!1,Wo,zo,Fn,Zt;function kg(){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)),au(),En(),pg()},nulling:function(){Fn=_s=Yt=Ls=Zt=Wo=zo=null,be.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,n){var p=this,h=(t.touches?t.touches[0]:t).clientX,g=(t.touches?t.touches[0]:t).clientY,m=document.elementFromPoint(h,g);if(Fn=t,n||this.options.forceAutoScrollFallback||cn||ot||Qt){Bo(t,this.options,m,n);var c=lt(m,!0);Ls&&(!Zt||h!==Wo||g!==zo)&&(Zt&&au(),Zt=setInterval(function(){var d=lt(document.elementFromPoint(h,g),!0);d!==c&&(c=d,En()),Bo(t,p.options,d,n)},10),Wo=h,zo=g)}else{if(!this.options.bubbleScroll||lt(m,!0)===qe()){En();return}Bo(t,this.options,lt(m,!1),!1)}}},it(l,{pluginName:"scroll",initializeByDefault:!0})}function En(){be.forEach(function(l){clearInterval(l.pid)}),be=[]}function au(){clearInterval(Zt)}var Bo=kh(function(l,e,t,n){if(e.scroll){var p=(l.touches?l.touches[0]:l).clientX,h=(l.touches?l.touches[0]:l).clientY,g=e.scrollSensitivity,m=e.scrollSpeed,c=qe(),d=!1,r;_s!==t&&(_s=t,En(),Yt=e.scroll,r=e.scrollFn,Yt===!0&&(Yt=lt(t,!0)));var o=0,a=Yt;do{var s=a,i=we(s),u=i.top,f=i.bottom,y=i.left,b=i.right,E=i.width,$=i.height,A=void 0,S=void 0,M=s.scrollWidth,R=s.scrollHeight,L=ne(s),T=s.scrollLeft,D=s.scrollTop;s===c?(A=E<M&&(L.overflowX==="auto"||L.overflowX==="scroll"||L.overflowX==="visible"),S=$<R&&(L.overflowY==="auto"||L.overflowY==="scroll"||L.overflowY==="visible")):(A=E<M&&(L.overflowX==="auto"||L.overflowX==="scroll"),S=$<R&&(L.overflowY==="auto"||L.overflowY==="scroll"));var w=A&&(Math.abs(b-p)<=g&&T+E<M)-(Math.abs(y-p)<=g&&!!T),v=S&&(Math.abs(f-h)<=g&&D+$<R)-(Math.abs(u-h)<=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!==s)&&(be[o].el=s,be[o].vx=w,be[o].vy=v,clearInterval(be[o].pid),(w!=0||v!=0)&&(d=!0,be[o].pid=setInterval((function(){n&&this.layer===0&&te.active._onTouchMove(Fn);var x=be[this.layer].vy?be[this.layer].vy*m:0,_=be[this.layer].vx?be[this.layer].vx*m:0;typeof r=="function"&&r.call(te.dragged.parentNode[ke],_,x,l,Fn,be[this.layer].el)!=="continue"||Dh(be[this.layer].el,_,x)}).bind({layer:o}),24))),o++}while(e.bubbleScroll&&a!==c&&(a=lt(a,!1)));Ls=d}},30),zh=function(e){var t=e.originalEvent,n=e.putSortable,p=e.dragEl,h=e.activeSortable,g=e.dispatchSortableEvent,m=e.hideGhostForTarget,c=e.unhideGhostForTarget;if(t){var d=n||h;m();var r=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,o=document.elementFromPoint(r.clientX,r.clientY);c(),d&&!d.el.contains(o)&&(g("spill"),this.onSpill({dragEl:p,putSortable:n}))}};function ra(){}ra.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=Ot(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:zh};it(ra,{pluginName:"revertOnSpill"});function oa(){}oa.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:zh};it(oa,{pluginName:"removeOnSpill"});te.mount(new kg);te.mount(oa,ra);const xe={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=xe.getStyle(l),p=Number.parseInt(n.height,10),h=p/(e/60);l.style.height="0px",(function g(){const m=Number.parseFloat(l.style.height),c=m+h;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=xe.getStyle(l),p=Number.parseInt(n.height,10),h=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=h,l.style.display="none",l.style.minHeight=g,delete l.style.height,t&&t(l))})()},slideToggle:(l,e=250,t=xe.getStyle(l,"display")==="none")=>{t?xe.slideDown(l,e):xe.slideUp(l,e)}},Bh=l=>Number.isInteger(Number(l)),ut=l=>{let e=0,t=l;for(;t?.previousElementSibling;)t=t.previousElementSibling,e++;return e},Pn=(l,e,t)=>{const n=t.split("||"),h=yt(e).map(g=>l.find(m=>{const c=n.find(d=>!!Re(m,d));return c&&Re(m,c)===g})).filter(Boolean).concat(l);return yt(h)},Jn=(l,e,t)=>{for(let n=0;n<l.length;n++)e.call(t,l[n],n)},sa=(l,e)=>{const t=[];return Jn(l,(n,p)=>t.push(e(n,p))),t},jo={},jh=l=>{const e={className:"class"};if(jo[l])return jo[l];const n=(e[l]||l).replace(/^\d+/,"").replace(/[^a-zA-Z0-9-:]/g,"");return jo[l]=n,n},Vh=l=>l.replace(/\b\w/g,e=>e.toUpperCase()),Dg=l=>window.JSON.parse(window.JSON.stringify(l)),Og=(l,e)=>e.filter(t=>!~l.indexOf(t)),Fe={capitalize:Vh,safeAttrName:jh,forEach:Jn,copyObj:Dg,map:sa,subtract:Og,indexOfNode:ut,isInt:Bh,get:Re,orderObjectsBy:Pn},ze={js:new Set,css:new Set,formeoSprite:null},lu=(l,e,t=As)=>new Promise(n=>fetch(l).then(p=>{if(!p.ok)return n(t(p));n(e?e(p):p)}).catch(p=>t(p))),Uh=(l,e)=>{l.removeEventListener("load",Uh),e(l.src)},Gh=(l,e)=>{l.removeEventListener("load",Gh),e(l.src)},Ig=l=>new Promise((e,t)=>{if(ze.js.has(l))return e(l);ze.js.add(l);const n=V.create({tag:"script",attrs:{type:"text/javascript",async:!0,src:l},action:{load:()=>Gh(n,e),error:()=>t(new Error(`${l} failed to load.`))}});document.head.appendChild(n)}),Rs=l=>{l=Array.isArray(l)?l:[l];const e=l.map(t=>new Promise((n,p)=>{if(ze.css.has(t))return n(t);ze.css.add(t);const h=V.create({tag:"link",attrs:{rel:"stylesheet",href:t},action:{load:()=>Uh(h,n),error:()=>p(new Error(`${t} failed to load.`))}});document.head.appendChild(h)}));return Promise.all(e)},Ng=l=>{l=Array.isArray(l)?l:[l];const e=l.map(t=>Ig(t));return Promise.all(e)},Fg=l=>{l=Array.isArray(l)?l:[l];const e=l.map(t=>Rs(t));return Promise.all(e)},cu=l=>{const t=new DOMParser().parseFromString(l,"image/svg+xml");return ze.formeoSprite=t.documentElement,ze.formeoSprite},Pg=async(l=Wf)=>{if(ze.formeoSprite)return ze.formeoSprite;if(!l)return cu(Pf);const e=async t=>cu(await t.text());return lu(l,e,()=>lu(zf,e))},Hg={js:Ng,css:Fg},qh=l=>{const e=Object.entries(l).map(([t,n])=>Hg[t](n));return Promise.all(e)},Wg=async l=>{if(l&&!ze.css.has(l)&&(await Rs(l),!ze.css.has(l)&&!ze.css.has(sc)))return await Rs(sc)},zg={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="${Sh}${l}">${l}</i>`},Bg=new Set(["input","textarea","select"]),jg=l=>l.replace(/^on([A-Z])/,(e,t)=>t.toLowerCase()),Vg=new Set(["focus","blur"]),Ug=l=>{const e=jg(l);return(t,n)=>t.addEventListener(e,n,Vg.has(e))},Kh=(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=V.create(n).textContent),/^<.+>.+<.+>$/gim.test(n)&&(n=mp(n)),e=`${t}-${Ah(vp(n,24,null))}`),e||t};class Gg{constructor(e=Object.create(null)){this.options=e}set setOptions(e){this.options=Ue(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,...h}=t.attrs;p&&(typeof p=="string"?n=p:n=(p.find(m=>m.selected===!0)||p[0]).value),t.attrs=h}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:h,options:g,dataset:m,...c}=this.processElemArg(e);p.push("tag");let d;const{tag:r}=c;let o;const a={attrs:{},className:[Fe.get(c,"config.inputWrap")],children:[],config:{}};let s=document.createElement(r);const i={string:f=>{s.innerHTML+=f},object:f=>f&&s.appendChild(n.create(f,t)),node:f=>s.appendChild(f),component:f=>s.appendChild(f.dom),array:f=>{for(const y of f)d=n.childType(y),i[d](y)},function:f=>{f=f(),d=n.childType(f),i[d](f)},undefined:()=>null,boolean:()=>null};if(h&&(c.attrs=Ue(c.attrs,{className:h})),g){const f=this.processOptions(g,c,t);if(this.holdsContent(s)&&r!=="button")i.array.call(this,f),c.content=void 0;else return Fe.forEach(f,y=>{a.children.push(n.create(y,t))}),c.attrs.className&&(a.className=c.attrs.className),a.id=c.id,a.config={...c.config},this.create(a,t);p.push("options")}if(c.attrs&&(n.processAttrs(c,s,t),p.push("attrs")),c.config){if(c.config.label&&(c.config.label&&r!=="button"||["radio","checkbox"].includes(Fe.get(c,"attrs.type")))&&!t){const f=n.label(c);if(!c.config.hideLabel){const y=[f,s];n.labelAfter(c)&&y.reverse(),a.children.push(y)}}p.push("config")}if(c.content||c.children){const f=c.content||c.children;d=n.childType(f),i[d]||console.error(`childType: ${d} is not supported`),i[d].call(this,f)}if(m){for(const f in m)Object.hasOwn(m,f)&&(s.dataset[f]=typeof m[f]=="function"?m[f]():m[f]);p.push("dataset")}c.action&&(this.actionHandler(s,c.action),p.push("action"));const u=Fe.subtract(p,Object.keys(c));for(o=u.length-1;o>=0;o--)s[u[o]]=c[u[o]];return a.children.length&&(s=this.create(a)),s};onRender=(e,t,n=Qe)=>{const p=Date.now(),h=()=>{!e.parentElement&&Date.now()-p<n?window.requestAnimationFrame(h):e.parentElement&&t(e)};h()};actionHandler(e,t){const n={onRender:V.onRender,render:V.onRender};return Object.entries(t).map(([p,h])=>(Array.isArray(h)?h:[h]).map(m=>(n[p]||Ug(p))(e,m)))}get icons(){if(this.iconSymbols)return this.iconSymbols;const e=ze.formeoSprite.querySelectorAll("svg symbol"),t=n=>{const p=n.getAttribute("viewBox")||"0 0 24 24",h=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:h}};return this.iconSymbols=Array.from(e).reduce((n,p)=>{const h=p.id.replace(Sh,"");return n[h]=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 h=Ue(p,t);return this.cachedIcons[n]=V.create(h).outerHTML,this.cachedIcons[n]}return this.cachedIcons[n]=V.create(p).outerHTML,this.cachedIcons[n]}return zg[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 h=Kh(e);h&&t.setAttribute("name",h)}for(const h of Object.keys(p)){const g=Fe.safeAttrName(h),m=this.processAttrValue(p[h]);if(m!==!1)try{t.setAttribute(g,m)}catch(c){console.warn(`Could not set attribute ${g} with value ${m}`,c)}}}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=(h,g)=>{g?(h.style.display="block",n.push(h)):h.style.display="none"};return V.elementsContainText(e,t,p),n};elementsContainText=(e,t,n)=>{const p=[];return Jn(e,h=>{const m=h.textContent.toLowerCase().indexOf(t.toLowerCase())!==-1;n?.(h,m),m&&p.push(h)}),p};generateOption=({type:e="option",label:t,value:n,i:p=0,selected:h})=>({tag:e==="option"?"option":"input",attrs:{type:e,value:n||`${e}-${p}`,[e==="option"?"selected":"checked"]:h||!p},config:{label:t||X.get("labelCount",{label:X.get("option"),count:p})}});processOptions(e,t,n){const{action:p,attrs:h={}}=t,g=h.type||t.tag,m=h.id||t.id,c=(r,o)=>{const{label:a,value:s,...i}=r,u=()=>{const y={tag:"input",attrs:{name:m,type:g,value:s||"",id:`${m}-${o}`,...i},action:p},b={tag:"label",attrs:{for:`${m}-${o}`},children:a},E={children:[y,b],className:[`f-${g}`]};return h.className&&(t.config.inputWrap=h.className),t.config.inline&&E.className.push(`f-${g}-inline`),r.selected&&(y.attrs.checked=!0),n&&(b.attrs.contenteditable=!0),E};return{select:()=>{const y=r.attrs||r,b={attrs:y,...r,...y},{label:E,checked:$,selected:A,attrs:S}=b;return{tag:"option",attrs:{...S,selected:!!($||A)},children:E}},button:y=>{const{type:b,label:E,className:$,id:A}=y;return{...t,attrs:{type:b},className:$,id:A||We(),options:void 0,children:E,action:t.action}},checkbox:u,radio:u}[g]?.(r)};return e.map(c)}holdsContent(e){return e.outerHTML.includes("/")}isBlockInput(e){return!this.isInput(e)&&this.holdsContent(e)}isInput(e){let t=e;return typeof t!="string"&&(t=t.tagName),Bg.has(t)}parsedHtml(e){const t=document.createElement("textarea");return t.innerHTML=e,t.textContent}labelAfter(e){const t=Fe.get(e,"attrs.type"),n=Fe.get(e,"config.labelAfter");return n===void 0?t==="checkbox"||t==="radio":n}requiredMark=()=>({tag:"span",className:"text-error",children:"*"});tooltip=e=>({tag:"span",className:"f-tooltip",dataset:{tooltip:e},content:V.icon("info-circle")});helpText=e=>({tag:"small",className:"f-help-text",children:e});label(e,t){const n=Fe.get(e,"attrs.required");let{config:{label:p="",helpText:h="",tooltip:g=null}}=e;const{id:m,attrs:c}=e;typeof p=="function"&&(p=p());const d={tag:"label",attrs:{for:m||c?.id},className:[],children:[p,n&&this.requiredMark(),g&&this.tooltip(g),h&&this.helpText(h)],action:{}};return t&&(d.attrs.for=void 0,d.attrs.contenteditable=!0,d.fMap=t),d}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 h of t)p.classList.remove(h)}};n.object=n.string,Fe.forEach(e,n[this.childType(t)])}addClasses(e,t){const n={string:p=>p.classList.add(t),array:p=>{for(const h of t)p.classList.add(h)}};Fe.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),xe.slideDown(e,300)};xe.slideUp(e,600,t)}toggleSortable(e,t){let n=t;const p=Le(e);if(!p)return;const h=Le(e.parentElement),g=V[p].get(e.id).sortable;n||(n=!g.option("disabled")),g.option("disabled",n),h&&["rows","columns","stages"].includes(h)&&this.toggleSortable(e.parentElement,n)}emptyClass(e){const t=e.getElementsByClassName(jf.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)===ct;isStage=e=>Le(e)===Pt;isRow=e=>Le(e)===tt;isColumn=e=>Le(e)===nt;isField=e=>Le(e)===Ht;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 Gg,qg="modulepreload",Kg=function(l){return"/formeo/"+l},uu={},Tt=function(e,t,n){let p=Promise.resolve();if(t&&t.length>0){let c=function(d){return Promise.all(d.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(d=>{if(d=Kg(d),d in uu)return;uu[d]=!0;const r=d.endsWith(".css"),o=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${o}`))return;const a=document.createElement("link");if(a.rel=r?"stylesheet":qg,r||(a.as="script"),a.crossOrigin="",a.href=d,m&&a.setAttribute("nonce",m),document.head.appendChild(a),r)return new Promise((s,i)=>{a.addEventListener("load",s),a.addEventListener("error",()=>i(new Error(`Unable to preload CSS for ${d}`)))})}))}function h(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"&&h(m.reason);return e().catch(h)})},Lt="f-autocomplete",Yg=`${Lt}-display-field`,aa=`${Lt}-list`,Bt="highlight-component",Hn=`${aa}-item`,Zg=(l,e)=>{const t=l.reduce((n,p)=>n+(p===e),0);return t>1?`(${t})`:""},Yh=["config.label","config.controlId"],Xg=["config.legend","name"],Qg=[...Yh,...Xg],Vo=l=>Yh.reduce((e,t)=>e||l.get(t),null),hu=l=>Qg.reduce((e,t)=>e||l.get(t),null)||Je(l.name),Jg=new Map([["condition.source",Vo],["if.condition.source",Vo],["if.condition.target",Vo],["then.condition.target",hu],["condition.target",hu]]),Zh=({id:l,...e},t)=>{const{name:n,label:p}=e;return n?Jg.get(t)(e):p},em=({selectedId:l,...e})=>(e.value===l&&(e.selected=!0),e),Uo=l=>(l.classList.contains(Hn)||(l=l.parentElement),l),Xh=({value:l,textLabel:e,htmlLabel:t,componentType:n,depth:p=0},h)=>{const g={tag:"li",children:t,dataset:{value:l,label:e},className:[Hn,`${Hn}-depth-${p}`,`component-type-${n}`],action:{mousedown:({target:m})=>{m=Uo(m),h.setValue(m),h.selectOption(m),h.hideList()},mouseover:({target:m})=>{m=Uo(m),h.removeHighlight(),h.highlightComponent(m)},mouseleave:({target:m})=>{m=Uo(m),h.removeHighlight()}}};return V.create(g)},tm=(l,e)=>{const t=l.data.options.map((p,h)=>{const g=`${l.address}.options[${h}]`,m=p.label,c=p.label;return Xh({value:g,textLabel:m,htmlLabel:c,componentType:"option",depth:1},e)});return V.create({tag:"ul",attrs:{className:[aa,"options-list"]},children:t})},nm=l=>{const e=l.value,t=[],n=ce.flatList();return Object.entries(n).reduce((h,[g,m])=>{const c=Zh(m,l.key);if(c){const d=m.name,r={tag:"span",content:` ${Je(d)}`,className:"component-type"},o=`${d}.${c}`;t.push(o);const a=Zg(t,o),s={tag:"span",content:a,className:"component-label-count"},i=[`${c} `,s,r],u=[c,a].join(" ").trim();if(m.isCheckable){const y=tm(m,l);i.push(y)}const f=em({value:g,textLabel:u,htmlLabel:i,componentType:d,selectedId:e});h.push(Xh(f,l))}return h},[])};class im{lastCache=Date.now();optionsCache=null;constructor({key:e,value:t,className:n,onChange:p=As}){this.key=e,this.className=[n||this.key.replace(/\./g,"-")].flat(),this.value=t,this.onChange=p||As,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 He(this.value)}get valueComponent(){return He(this.value)&&ce.getAddress(this.value)}build(){const e=n=>{const p=this.list,h=this.getActiveOption();let m=new Map([[38,()=>{const c=this.getPreviousOption(h);c&&this.selectOption(c)}],[40,()=>{const c=this.getNextOption(h);c&&this.selectOption(c)}],[13,()=>{h&&(this.selectOption(h),this.setValue(h),p.style.display==="none"?this.showList(h):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(`${Lt}-focused`);const p=V.toggleElementsByStr(this.list.querySelectorAll(`.${Hn}-depth-0`),n.value);n.addEventListener("keydown",e);const h=this.list.querySelector(".active-option")||p[0];this.showList(h)},blur:({target:n})=>{n.parentElement.classList.remove(`${Lt}-focused`),n.removeEventListener("keydown",e),this.hideList()},input:n=>{const{value:p}=n.target,h=V.toggleElementsByStr(this.list.querySelectorAll("li"),p);if(p.length===0&&this.clearValue(),h.length===0)this.hideList();else{const g=this.getActiveOption()||h[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:Yg,value:this.label||this.value,placeholder:X.get(`${this.key}.placeholder`)}}),this.hiddenField=V.create({tag:"input",attrs:{type:"hidden",className:Lt,value:this.value}}),this.list=V.create({tag:"ul",attrs:{className:aa}}),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:[Lt,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(!He(this.value))return this.value;const e=this.value&&ce.getAddress(this.value);return e&&Zh(e,`${this.key}`)||this.value}updateOptions(){let e=this.optionsCache;const t=Date.now();(t-this.lastCache>qs*5||!e)&&(V.empty(this.list),e=this.generateOptions(),this.lastCache=t),this.list.children.length||this.list.append(...e)}generateOptions(){return this.optionsCache=nm(this),this.optionsCache}setListPosition(){const{offsetHeight:e,offsetWidth:t}=this.displayField,n=this.displayField.closest(".formeo-stage").getBoundingClientRect(),p=this.displayField.getBoundingClientRect(),h={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,h)}showList(e,t=this.list){this.stage.contains(this.list)||this.stage.appendChild(this.list),this.setListPosition(),this.selectOption(e),xe.slideDown(t,bt)}hideList(e=this.list){xe.slideUp(e,bt),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:h}}=p;p.classList.remove("active-option"),He(h)&&ce.getAddress(h)?.dom?.classList.remove(Bt)}e&&(e.classList.add("active-option"),this.highlightComponent(e))}removeHighlight(){const e=document.getElementsByClassName(Bt);for(const t of e)t.classList.remove(Bt)}highlightComponent(e){const{dataset:{value:t}}=e;if(He(t)){const{componentAddress:n,isOptionAddress:p,optionIndex:h}=wt(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(Bt),p&&g.dom.querySelectorAll(".field-preview .f-checkbox, .field-preview .f-radio")[h]?.classList.add(Bt))}}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})}}const Qh=l=>X.get(`${l}.placeholder`)||Je(kn(l)),la=l=>l.replaceAll(".","-"),du=new Map([["config.helpText",(...l)=>fu(...l)],["config.tooltip",(...l)=>fu(...l)]]);function Go({key:l,value:e,type:t="text",checked:n}){const p={tag:"input",attrs:{type:t,value:e,placeholder:Qh(l)},className:[la(l)],config:{}};return n&&(p.attrs.checked=!0),p}function fu({key:l,value:e}){return{tag:"textarea",attrs:{placeholder:Qh(l)},className:[la(l)],config:{},textContent:e}}function Ge(l){const e=X.get(l);if(e)return e;const t=kn(l);return X.get(t)||Je(t)}const It={autocomplete:(...l)=>new im(...l).createProxy(),string:({key:l,value:e})=>du.has(l)?du.get(l)({key:l,value:e}):Go({key:l,value:e}),boolean:({key:l,value:e})=>Go({key:l,value:e,type:l==="selected"?"radio":"checkbox",checked:!!e}),number:({key:l,value:e})=>Go({key:l,value:e,type:"number"}),array:({key:l,value:e})=>({tag:"select",attrs:{placeholder:Ge(`placeholder.${l}`)},className:[la(l)],options:e}),object:l=>Object.entries(l).map(([e,t])=>It[V.childType(t)]({key:e,value:t}))},rm={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:()=>({})},om=Object.freeze({title:"",content:null,confirmText:()=>Ge("save"),cancelText:()=>Ge("cancel"),onConfirm:()=>{},onCancel:()=>{},className:"",closeOnEscape:!0,position:"top",triggerElement:null,triggerCoords:null});class Dt{constructor(e){this.opts=Ue(om,e),this.dialog=null}createDialog(){const{title:e,content:t,confirmText:n,cancelText:p,className:h,closeOnEscape:g,position:m}=this.opts,c=`dialog-position-${m}`,d=[];return e&&d.push({tag:"h3",className:"dialog-title",textContent:e}),t&&d.push({tag:"div",className:"dialog-body",children:Array.isArray(t)?t:[t]}),d.push({tag:"div",className:"dialog-actions",children:[{tag:"button",type:"button",className:"btn btn-sm btn-secondary",textContent:typeof p=="function"?p():p,action:{click:()=>this.handleCancel()}},{tag:"button",type:"submit",className:"btn btn-sm btn-primary",textContent:typeof n=="function"?n():n}]}),V.create({tag:"dialog",className:["formeo-dialog","formeo",c,h],children:[{tag:"form",className:"dialog-form",method:"dialog",children:d,action:{submit:o=>this.handleSubmit(o)}}],action:{cancel:o=>{g?this.handleCancel():o.preventDefault()}}})}handleSubmit(e){e.preventDefault();const t=new FormData(e.target);this.opts.onConfirm(t,this),this.close()}handleCancel(){this.opts.onCancel(this),this.close()}setPosition(){const{position:e,triggerElement:t,triggerCoords:n}=this.opts;if(e!=="trigger"||!this.dialog)return;let p=n;if(!p&&t){const h=t.getBoundingClientRect();p={x:h.left+h.width/2,y:h.bottom+8}}if(p){const h=this.dialog.getBoundingClientRect(),g=window.innerWidth,m=window.innerHeight;let c=p.x-h.width/2,d=p.y;const r=16;c=Math.max(r,Math.min(c,g-h.width-r)),d=Math.max(r,Math.min(d,m-h.height-r)),this.dialog.style.left=`${c}px`,this.dialog.style.top=`${d}px`,this.dialog.style.transform="none"}}open(){if(this.dialog||(this.dialog=this.createDialog()),document.body.appendChild(this.dialog),this.dialog.showModal(),this.opts.position==="trigger"){const e=setTimeout(()=>{this.setPosition(),clearTimeout(e)},0)}return this}close(){this.dialog&&(this.dialog.close(),this.dialog.remove(),this.dialog=null)}static alert(e,t=()=>{}){return new Dt({content:{tag:"p",className:"dialog-message",textContent:e},confirmText:()=>X.get("ok")||"OK",cancelText:"",onConfirm:()=>t()})}static confirm(e,t=()=>{},n=()=>{}){return new Dt({content:{tag:"p",className:"dialog-message",textContent:e},confirmText:()=>X.get("confirm")||"Confirm",onConfirm:()=>t(),onCancel:()=>n()})}static prompt(e,t=()=>{},n=""){return new Dt({content:[{tag:"label",className:"dialog-prompt-label",children:[{tag:"p",className:"dialog-message",textContent:e},{tag:"input",type:"text",name:"prompt-value",className:"dialog-prompt-input",value:n}]}],onConfirm:p=>{const h=p.get("prompt-value");t(h)}})}}const Jh="hidden-property",sm="hidden-option",qo=/\.options\[\d+\]$/,am={"if-sourceProperty":Cn(wn,cc,uc),"if-targetProperty":Cn(wn),"then-targetProperty":Cn(wn,cc,uc),...Object.entries(lp).reduce((l,[e,t])=>(l[`if-${e}`]=t,l[`then-${e}`]=t,l),{})},ed={assignment:jt,comparison:jt,logical:jt,source:({key:l,value:e,onChange:t,conditionType:n})=>It.autocomplete({key:`${n}.condition.${l}`,value:e,onChange:t,className:`condition-${l}`}),sourceProperty:jt,targetProperty:jt,target:l=>ed.source(l),value:({key:l,value:e,onChange:t},n)=>{const p=It.string({key:`condition.${l}`,value:e});return p.action={input:t},p}};function lm({key:l,value:e,conditionType:t}){const n=`${t}-${l}`,p=am[n];return Object.entries(p||{}).map(([h,g])=>cm({fieldName:l,fieldValue:e,key:h,optionValue:g}))}function cm({fieldName:l,fieldValue:e,key:t,optionValue:n}){return{label:X.get(`${l}.${t}`)||Je(t).toLowerCase(),value:n,selected:n===e}}function jt({key:l,value:e,onChange:t,conditionType:n}){const p=lm({key:l,value:e,conditionType:n}),h=It.array({key:`condition.${l}`,value:p});return h.action={change:t},h}const um=l=>!l?.classList.contains(Jh),hm={sourceProperty:l=>{const e=l.get("source"),t=l.get("sourceProperty"),n=!!e.value,p=!!e.value.match(qo);return gu(p,t),!n},comparison:l=>{const e=l.get("source"),t=l.get("sourceProperty"),n=!!e.value,p=!!e.value.match(qo);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(qo);return gu(n,t),!Nf(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||!um(l.get("comparison"))||t.value===td?!0:t.value.startsWith("is")}},pu=l=>{for(const[e,t]of l){const n=!!hm[e]?.(l)||!1;t.classList.toggle(Jh,n)}},td="isChecked",Ko=l=>l.value.endsWith("Checked"),gu=(l,e)=>{if(l&&Ko(e))return null;const t=Array.from(e.querySelectorAll("option")),n=[];for(const p of t){const h=Ko(p),g=l?!h:h;g&&n.push(p.value),p.classList.toggle(sm,g)}n.includes(e.value)&&(e.value=l?td:t.find(p=>!Ko(p))?.value||e.value)};function dm(l,e=ap){return e.reduce((t,n)=>(l[n]!==void 0&&t.push([n,l[n]]),t),[])}class fm{constructor({conditionValues:e,conditionType:t,conditionCount:n,index:p},h){this.values=new Map(dm(e)),this.conditionType=t,this.parent=h,this.baseAddress=`${h.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),xe.slideUp(this.dom,bt,()=>{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,h]of this.values){const g=r=>this.onChangeCondition({key:p,target:r.target}),m={key:p,value:h,conditionType:this.conditionType,onChange:g},c=ed[p](m,this.values),d=c.dom||V.create(c);this.fields.set(p,c.dom?c:d),e.push(d)}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 h=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(h),e}get value(){return Array.from(this.fields).reduce((e,[t,n])=>(e[t]=n.value,e),{})}processUiState(){pu(this.fields),this.dom.classList.remove("display-none")}updateDataDebounced=Ln(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};pu(this.fields),this.updateDataDebounced(n)}}const pm=new Map([["attrs",({itemKey:l})=>l],["options",({itemKey:l,key:e})=>`${l}.${e}`]]),nd=(l,e)=>{if(e.controlId==="select"){const t=e.editPanels.get("options"),[n,p]=l?Rn:hp,h=t.data.map(({[n]:g,...m})=>({[p]:g,...m}));t.setData(h)}},gm=new Map([["attrs-multiple",l=>({change:({target:e})=>{l.field.controlId==="select"&&nd(e.checked,l.field)}})]]);class Vt{constructor({key:e,index:t,field:n,panel:p,data:h}){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=hc(e),this.conditionTypeWrap=new Map,h!==void 0&&this.field.get(this.itemKey)===void 0&&this.field.set(this.itemKey,h);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?Pn(Object.entries(e),Rn,"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]=ea()[e],m=n.children.length;e===Ch&&(g.logical="||"),p={conditionValues:g,conditionCount:m,index:m}}const h=new fm({conditionType:e,...p},this);return n.appendChild(h.dom),h};removeConditionType=(e,t)=>{const p=this.conditionTypeWrap.get(e).children[t];p.destroy(),p.dom.remove()};generateConditionFields=(e,t)=>(this.conditions=new Map,t.forEach((n,p)=>{const h=this.addConditionType(e,{index:p,conditionCount:t.length,conditionValues:n});this.conditions.set(p,h)}),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:()=>{xe.slideUp(this.dom,Qe,n=>{this.field.remove(this.itemKey),n.remove(),this.panel.updateProps()})},mouseover:n=>{this.dom.classList.add("to-remove")},mouseout:n=>{this.dom.classList.remove("to-remove")}},content:V.icon("remove")};return{className:`${this.panelName}-prop-controls prop-controls`,content:[e]}}getConfigAttrOptions(e){const t=e.split(".").pop(),n=this.field.config?.attrs?.[t];return Array.isArray(n)?n:null}itemInput(e,t){if(this.isDisabled)return null;let n=V.childType(t)||"string",p=t;if(this.panelName==="attrs"){const i=this.getConfigAttrOptions(e);i&&(p=i.map(u=>({...u,selected:u.value===t})),n="array")}const h=pm.get(this.panelName)?.({itemKey:this.itemKey,key:e})||this.itemKey,g=h.split(".").filter(Number.isNaN).join(".")||e,m=It[n]({key:e,value:p}),c=`${this.field.shortId}-${hc(h).replaceAll(/-\d+-(selected)/g,"-$1")}`,d={label:this.panelName!=="options"&&Ge(g),labelAfter:!1,inputWrap:["f-input-wrap",this.isLocked&&"locked-prop",this.isDisabled&&"disabled-prop"].filter(Boolean).join(" ")},r={name:m.attrs.type==="checkbox"?`${c}[]`:c};r.disabled=this.isDisabled,r.readonly=this.isLocked;const o=gm.get(this.itemSlug)?.(this),a=Dp(rm[n](h,this.field),o||{}),s=Ue(It[n]({key:e,value:p}),{action:a,attrs:r,config:d});return Rn.includes(e)?{className:"f-addon",children:s}:s}}const mm={multiple:(l,e)=>{nd(!!l,e)}},vm=[{label:Ge("config.label"),value:"label"},{label:Ge("config.hideLabel"),value:"hideLabel"},{label:Ge("config.helpText"),value:"helpText"},{label:Ge("config.labelAfter"),value:"labelAfter"},{label:Ge("config.disableHtmlLabel"),value:"disableHtmlLabel"},{label:Ge("config.tooltip"),value:"tooltip"}],ym={label:"New Field",hideLabel:!1,helpText:"",labelAfter:!1,disableHtmlLabel:!1,tooltip:""};class bm{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:`${ch} ${this.name}-panel`},children:[this.props,this.editButtons]}}createProps(e=this.data){this.editPanelItems=Array.from(e).map((n,p)=>{const h=this.type==="array",g=n[0],m=h?`[${p}]`:`.${n[0]}`,c=h?n:{[n[0]]:n[1]},d=`${this.name}${m}`,r=this.component.isDisabledProp(d,this.name),o=dp.get(this.name)?.has(g)??!0;return r||!o?null:new Vt({key:d,data:c,field:this.component,index:p,panel:this})}).filter(Boolean);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={attrs:this.addAttribute,options:this.addOption,conditions:this.addCondition,config:this.addConfiguration},n=[];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()}}};n.push(m)}const p=X.get(`panelEditButtons.${e}`)||`+ Add ${Je(e)}`,h={...V.btnTemplate({content:p,title:p}),className:`add-${e}`,action:{click:m=>{const c={btnCoords:V.coords(m.target),addAction:t[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 d=Je(e),r=new globalThis.CustomEvent(`onAdd${d}`,{detail:c});$e.add[e](c),document.dispatchEvent(r)}}};return n.push(h),{className:"panel-action-buttons",content:n}}addAttribute=(e,t)=>{let n=t;const p=jh(e),h=`attrs.${p}`;X.current[h]||X.put(h,Vh(e)),typeof n=="string"&&["true","false"].includes(n)&&(n=JSON.parse(n)),this.component.set(`attrs.${e}`,n),mm[p]?.(n,this.component);const g=this.props.querySelector(`.${this.component.name}-attrs-${p}`),m=new Vt({key:h,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",h=`${this.name}[${this.data.length}]`,g=t[t.length-1],c={...t.length?g:{},label:p};e!=="button"&&(c.value=Ah(p));const d=new Vt({key:h,data:c,field:this.component,index:this.props.children.length,panel:this});this.editPanelItems.push(d),this.props.appendChild(d.dom),this.component.debouncedUpdatePreview(),this.component.resizePanelWrap()};addCondition=e=>{const n=`conditions[${this.component.get("conditions").length}]`,p=new Vt({key:n,data:e.template,field:this.component,panel:this});this.props.appendChild(p.dom),this.component.set(n,e.template),this.component.resizePanelWrap()};addConfiguration=()=>{const e=this.component.get("config");new Dt({className:"config-item-dialog",content:[{tag:"select",config:{label:X.get("selectConfigKey")||"Select Configuration Key"},attrs:{name:"selectConfigKey",required:!0,className:"config-key-select"},options:vm.filter(n=>!(n.value in e))}],onConfirm:n=>{const p=n.get("selectConfigKey").trim(),h=`config.${p}`;if(p){const g=new Vt({key:h,data:ym[p],field:this.component,panel:this});this.editPanelItems.push(g),this.props.appendChild(g.dom),this.component.debouncedUpdatePreview(),this.component.resizePanelWrap()}}}).open()};clearAllItems=()=>{const e=this.type==="array"?[]:{},t={type:this.name,removeAction:()=>{this.component.set(this.name,e),this.updateProps()}};$e.remove[this.name](t);const n=Je(this.name),p=new globalThis.CustomEvent(`onRemove${n}`,{detail:t});document.dispatchEvent(p)};setData(e){this.data=e,this.component.set(this.name,e),this.updateProps()}}const mu=Object.freeze({type:"field",displayType:"slider"}),vn=l=>({transform:`translateX(${l?`${l}px`:0})`});class id{constructor(e){this.opts=Ue(mu,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:h}}])=>{this.currentWidth!==h&&(this.toggleTabbedLayout(),this.currentWidth=h,this.nav.setTranslateX(this.activePanelIndex,!1))}),p=window.setTimeout(()=>{n.observe(t),window.clearTimeout(p)},qs)}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||mu.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 Fe.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:h=>{const g=ut(h.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"},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"},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,h=this.currentPanel.parentElement.childNodes;this.activePanelIndex=ut(this.currentPanel);let g={nav:0,panel:0},m={...g};e.groupChange=r=>(this.activePanelIndex=r,this.currentPanel=h[r],V.removeClasses(h,"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}),d=({offset:r,reset:o,duration:a=bt,animate:s=!this.isTabbed})=>{const i=[vn(m.panel),vn(r.panel)],u=[vn(m.nav),vn(this.isTabbed?0:r.nav)];if(o){const[E]=i,[$]=u;i.push(E),u.push($)}const f={easing:"ease-in-out",duration:s?a:0,fill:"forwards"},y=t.animate(i,f);n.animate(u,f);const b=()=>{y.removeEventListener("finish",b),o||(m=r)};y.addEventListener("finish",b)};return e.setTranslateX=(r=this.activePanelIndex,o=!0)=>{g=c(r),d({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!==h.length){const o=h[r];g={nav:-n.offsetWidth*r,panel:-o.offsetLeft},d({offset:g}),e.groupChange(r)}else g={nav:m.nav-8,panel:m.panel-8},d({offset:g,reset:!0});return this.currentPanel},e.prevGroup=()=>{if(this.activePanelIndex!==0){const r=this.activePanelIndex-1,o=h[r];g={nav:-n.offsetWidth*r,panel:-o.offsetLeft},d({offset:g}),e.groupChange(r)}else g={nav:8,panel:8},d({offset:g,reset:!0})},e}}let Yo=null;const Zo=Cn(wn);class ei extends na{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={...n.config,...ce[`${this.name}s`].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(h){console.error(`Error in ${e} event handler for ${this.name} ${this.id}:`,h)}}),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=wt(e),m=g.pop(),c=this.get(g);return Array.isArray(c)?Bh(m)?c.splice(Number(m),1):this.set(g,c.filter(d=>d!==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]}),Jn(n,g=>g.remove()),this.dom.remove(),If(ce.getAddress(`${t.name}s.${t.id}.children`),this.id),t.children.length||t.emptyClass(),t.name==="row"&&t.autoColumnWidths();const h={row:Xs,column:Qs,field:Js}[this.name];return h&&J.formeoUpdated({componentId:this.id,componentType:this.name,parent:t},h),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}`),Je(this.name)].filter(Boolean)});toggleEdit(e=!this.isEditing){this.isEditing=e;const t=this.dom,n="editing",p=`${n}-${this.name}`,h=this.dom.querySelector(`.${this.name}-edit`);xe.slideToggle(h,Qe,e),this.name==="field"&&(xe.slideToggle(this.preview,Qe,!e),t.parentElement.classList.toggle(`column-${p}`,e)),t.classList.toggle(n,e),t.classList.toggle(p,e)}get buttons(){if(this.actionButtons)return this.actionButtons;const e={handle:(g=`handle-${this.name}`)=>({...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:()=>{xe.slideUp(this.dom,Qe,()=>{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,h=t.filter(g=>!n.includes(g)).map(g=>e[g]?.()||g);return this.actionButtons=h,this.actionButtons}get index(){return ut(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 ep.get(this.name)}get parent(){const e=this.parentType;if(!this.dom||!e)return null;const t=this.dom.closest(`.${Us[e]}`);return t&&V.asComponent(t)}get children(){if(!this.dom)return[];const e=this.domChildren,t=ac.get(this.name);return sa(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:h=We()}=n,g=ac.get(this.name);if(!g)return null;const m=`${g}s`,c=ce.getAddress(`${m}.${h}`)||ce[m].add(h,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 d=c.get("children");return d?.length&&c.loadChildren(d),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(ct)||(e=e.parentElement);const h=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 a=ut(this.dom);return()=>this.parent.addChild(o,a+1)}],[2,o=>()=>this.parent.parent.addChild(o)]]),r={controls:async()=>{if(!Yo){const{default:b}=await Tt(async()=>{const{default:E}=await Promise.resolve().then(()=>Im);return{default:E}},void 0);Yo=b}const{controlData:{meta:{id:o},...a}}=Yo.get(n.id);Zn(a,"config.controlId",o);const s=o.startsWith("layout-")?o.replace(/^layout-/,""):"field",u=Re({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}.${s}`),f=c.get(u)();return V.remove(n),f(a,p)},row:()=>{const o={stage:-1,row:0,column:1};return(c.get(o[g])||Ss)()?.({id:n.id},p)},column:()=>{const o={stage:-2,row:-1};return(c.get(o[g])||Ss)()?.(n.id)}}[h]?.(n,p);return this.dispatchComponentEvent("onAdd",{from:e,to:t,item:n,newIndex:p,fromType:h,toType:g,addedComponent:r,addedVia:"dragDrop"}),m(),r}onSort=()=>this.saveChildOrder();onRemove({from:{parentElement:e}}){return e.classList.contains(nt)&&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=Re(e,"all"),n=Re(this.data,"config.controlId"),p=n&&Re(e,n),h=Re(e,this.id),g=[t,p,h].reduce((m,c)=>c?Ue(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),h=this.processResults(n.then);return p.map(g=>this.evaluateConditions(g)&&this.execResults(h))}):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),h=p&&n.slice(2,n.length).join(".");return[!p,!h,!Zo[h]].some(Boolean)?e:t?p.set(Zo[h],t):p.get(Zo[h])};getResult=e=>({"=":(n,p,h)=>n.set(p,h)})[e];processResults=e=>e.map(({operator:t,target:n,value:p})=>{const h=this.getComponent(n),g=h&&n.split(".").slice(2,n.length).join(".");return{target:h,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((h,g)=>{try{return h(t(e,n))}catch(m){return g(m)}});cloneData=()=>{const e={...Ke(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=>V.create({tag:"ul",attrs:{className:"children"},children:e});get isRow(){return this.name===Ur.row}get isColumn(){return this.name===Ur.column}get isField(){return this.name===Ur.field}isDisabledProp=(e,t="attrs")=>{if(Re(this.config,e))return!1;if((this.config?.disabled||[]).includes(e))return!0;const h=kn(e);return(this.config?.panels[t]?.disabled||[]).includes(h)};isLockedProp=(e,t="attrs")=>{if((this.config?.locked||[]).includes(e))return!0;const h=kn(e);return!!(this.config?.panels[t]?.locked||[]).includes(h)};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`),h=p.getElementsByTagName("button");p.style.maxWidth=`${h.length*h[0].clientWidth}px`,V.remove(n)}else this.resizePanelWrap()}},V.create(e)}updateEditPanels=()=>{if(!this.config)return null;const e=new Set(["object","array"]),t=yt([...this.config.panels.order,...Object.keys(this.data)]),n=new Set(["children","meta","action","events",...this.config.panels.disabled]),p=t.filter(g=>!n.has(g));for(const g of p){const m=this.get(g),c=V.childType(m);if(e.has(c)){const d=new bm(m,g,this);this.editPanels.set(d.name,d)}}const h={panels:Array.from(this.editPanels.values()).map(({panelConfig:g})=>g),id:this.id,displayType:"auto"};this.panels=new id(h),this.dom&&(this.dom.querySelector(".panel-nav").replaceWith(this.panels.panelNav),this.dom.querySelector(".panels").replaceWith(this.panels.panelsWrap))}}class wm{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",h=parseFloat(p,10)||0;return this.totalGapWidth=h*(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(`.${tt}`);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(Vr),this.columnPreset=p.querySelector(`.${uh}`),this.originalColumnClass=t.className,this.originalSiblingClass=n.className,t.className=t.className.replace(xs,""),n.className=n.className.replace(xs,""),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(h){console.error("Failed to initialize resize listeners:",h),this.cleanup()}}calculateNewWidths(e){const t=this.colStartWidth+e-this.startX,n=this.sibStartWidth-e+this.startX,p=parseFloat(jr(t,this.rowWidth)),h=parseFloat(jr(n,this.rowWidth));return p<10||h<10?null:{colWidth:Cs(p.toFixed(1)),siblingColWidth:Cs(h.toFixed(1))}}onMove(e){e.preventDefault();const{column:t,sibling:n}=this,p=e.type==="touchmove"?e.touches[0].clientX:e.clientX,h=this.calculateNewWidths(p);if(!h)return;const{colWidth:g,siblingColWidth:m}=h;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(Vr),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(Vr),window.removeEventListener("pointermove",this.onMove),window.removeEventListener("pointerup",this.onStop)}setCustomWidthValue(){const e=this.columnPreset;let t=e.querySelector(`.${$s}`);const n=this.row.querySelector(".children").children,p=sa(n,m=>jr(m.clientWidth,this.rowWidth).toFixed(1)),h=p.join(","),g=p.join(" | ");return t||(t=V.create({tag:"option",attrs:{className:$s,value:h,selected:!0},content:g}),e.append(t)),t.value=h,t.textContent=g,h}}const Cm=()=>Object.freeze({config:{width:"100%"},children:[],className:[nt]}),vu={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 ei{constructor(e){super("column",{...Cm(),...e});const t=this.createChildWrap();this.dom=V.create({tag:"li",className:[nt,"empty"],dataset:{hoverTag:X.get("column")},id:this.id,content:[this.getComponentTag(),this.getActionButtons(),vu.editWindow(),vu.resizeHandle(new wm),t]}),this.processConfig(),J.columnResized=new window.CustomEvent("columnResized",{detail:{column:this.dom,instance:this}}),te.create(t,{animation:150,fallbackClass:"field-moving",forceFallback:!0,group:{name:"column",pull:!0,put:["column","controls"]},sort:!0,disabled:!1,onEnd:this.onEnd.bind(this),onAdd:this.onAdd.bind(this),onSort:this.onSort.bind(this),onRemove:this.onRemove.bind(this),onMove:n=>{n.from!==n.to&&n.from.classList.remove("hovering-column")},draggable:`.${Ht}`,handle:".item-move"})}processConfig(){const e=Fe.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 $m=class extends Xn{constructor(e){super("columns",e),this.config={all:Am}}Component(e){return new Sm(e)}};const rd=new $m,xm=()=>Object.freeze({config:{fieldset:!1,legend:"",inputGroup:!1},children:[],className:[tt]});class Em extends ei{constructor(e){super("row",{...xm(),...e});const t=this.createChildWrap();this.dom=V.create({tag:"li",className:[tt,"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",forceFallback:!0,group:{name:"row",pull:!0,put:["row","column","controls"]},sort:!0,disabled:!1,onRemove:this.onRemove.bind(this),onEnd:this.onEnd.bind(this),onAdd:this.onAdd.bind(this),onSort:this.onSort.bind(this),draggable:`.${nt}`,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:a}})=>{this.set("config.fieldset",!!a)}},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:a}})=>this.set("config.inputGroup",a)},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"}},h={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:a}})=>this.set("config.legend",a)},className:""}},g=V.formGroup([e,h]),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()}}},d=V.formGroup([m,c],"row"),r=[t,"hr",g,"hr",d];return V.create({className:`${this.name}-edit group-config`,action:{onRender:a=>{const s=r.map(i=>V.create(i));a.append(...s)}}})}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(xs);const p=n.dom,h=Cs(t);n.set("config.width",h),p.style.width=h,p.dataset.colWidth=h;const g=setTimeout(()=>{clearTimeout(g),n.refreshFieldPanels()},bt);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=np.get(e.length-1)||[],p=e.map(h=>{const g=h.get("config.width")||"";return Number(g.replace("%","")).toFixed(1)}).join(",");if(n.length){const h=n.slice();return!h.find(m=>m.value===p)&&h.push({value:p,label:p.replace(/,/g," | "),className:$s}),h.map(m=>{const c={...m};return c.selected=m.value===p,c})}return[]}get columnPresetControlConfig(){return{tag:"select",attrs:{ariaLabel:X.get("defineColumnLayout"),className:uh},action:{change:({target:t})=>{const{value:n}=t;this.setColumnWidths(n)}},options:this.getColumnPresetOptions}}}const Mm={actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]}};let Tm=class extends Xn{constructor(e){super("rows",e),this.config={all:Mm}}Component(e){return new Em(e)}};const ca=new Tm,_m=()=>({conditions:[ea()],children:[]});class Lm extends ei{constructor(e){super("stage",{..._m(),...e}),this.updateEditPanels(),this.debouncedUpdateEditPanels=Ln(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:[Pt,"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:()=>{sn.active=this},onSort:this.onSort.bind(this),draggable:`.${tt}`,handle:".item-move"})}empty(e=!0){return new Promise(t=>{e?(this.dom.classList.add("removing-all-fields"),xe.slideUp(this.dom,Qe,()=>{t(super.empty(e)),this.dom.classList.remove("removing-all-fields"),xe.slideDown(this.dom,Qe)})):t(super.empty())})}onAdd(...e){const t=super.onAdd(...e);t?.name==="column"&&t.parent.autoColumnWidths()}}const Rm=()=>({actionButtons:{buttons:["edit"],disabled:[]},panels:{disabled:[],order:["attrs","options","conditions"]}});let km=class extends Xn{constructor(e){super("stages",e),this.config={all:Rm()}}Component(e){return new Lm(e)}};const sn=new km;class Dm{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:V.icon(e.icon)},{tag:"span",className:"control-label",content:n}],action:{focus:({target:h})=>{const g=h.closest(`.${ct}`);return g&&Ct.panels.nav.refresh(ut(g))},click:({target:h})=>{const g=h.closest(".field-control")?.id;g&&Ct.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 qh(this.dependencies)}i18n(e,t){const n=X.locale,h=this.definition?.i18n?.[n]||{};return(h[e]?.()??h[e])||X.get(e,t)}}const Om=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 od=class{constructor(){this.data=new Map,this.buttonActions={focus:({target:e})=>{const t=e.closest(`.${ct}`);return t&&this.panels.nav.refresh(ut(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 Dm(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=Pn(e,this.groupOrder,"id"),e=e.filter(h=>oc(h.id,this.options.disable.groups)),n=e.map(h=>{const g={tag:"ul",attrs:{className:[ct,ch],id:`${h.id}-${ct}`},config:{label:this.groupLabel(h.label)}};if(this.options.elementOrder[h.id]){const m=this.options.elementOrder[h.id],c=yt(m.concat(h.elementOrder));h.elementOrder=c}return t=Pn(t,h.elementOrder,"meta.id"),g.content=t.filter(m=>{const{controlData:c}=this.get(m.id),d=c.meta.id||"",r=[oc(d,this.options.disable.elements),c.meta.group===h.id,!p.includes(d)];let o=!0;return o=r.every(a=>a===!0),o&&p.push(d),o}),g}),n}add(e=Object.create(null)){const t=Ke(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 Ke(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=>{ca.size?(J.confirmClearAll=new window.CustomEvent("confirmClearAll",{detail:{confirmationMessage:X.get("confirmClearAll"),clearAllAction:()=>{sn.clearAll().then(()=>{const h={src:p.target};J.formeoCleared(h)})},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:h}=await Tt(async()=>{const{default:c}=await Promise.resolve().then(()=>Bm);return{default:c}},void 0),{formData:g}=h,m={action:()=>{},coords:V.coords(p),message:"",button:p};return $e.click.btn(m),$e.save.form(g)}}};return{className:"form-actions f-btn-group",content:Object.entries({clearBtn:e,saveBtn:t}).reduce((p,[h,g])=>(this.options.disable.formActions.includes(h)||p.push(g),p),[])}}buildDOM(e){const t=this.groupElements(),n=this.formActions(),{displayType:p}=this.options.panels;this.panels=new id({panels:t,type:"controls",displayType:p});const h=["control-groups","formeo-panels-wrap",`panel-count-${t.length}`],g=V.create({className:h,content:[this.panels.panelNav,this.panels.panelsWrap]}),m=["formeo-controls"];e&&m.push("formeo-sticky");const c=V.create({className:m,content:[g,n]}),d=c.getElementsByClassName("control-group");this.dom=c,this.groups=d;const[r]=d;this.currentGroup=r,this.actions={filter:o=>{const a=o!=="",s=this.controls;let i=g.querySelector(".filtered-term");if(V.toggleElementsByStr(s,o),a){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=d.length-1;o>=0;o--){const a=`formeo-controls-${d[o]}`;this.options.sortable||globalThis.localStorage.removeItem(a),te.create(d[o],{animation:150,fallbackClass:"control-moving",fallbackOnBody:!0,forceFallback:!0,fallbackTolerance:5,group:{name:"controls",pull:"clone",put:!1,revertClone:!0},onClone:({clone:s,item:i})=>{if(s.id=i.id,this.options.ghostPreview){const{controlData:u}=this.get(i.id);Tt(async()=>{const{default:f}=await Promise.resolve().then(()=>Pm);return{default:f}},void 0).then(({default:f})=>{s.innerHTML="",s.appendChild(new f(u).preview)})}},onStart:()=>{this.originalDocumentOverflow=document.documentElement.style.overflow,document.documentElement.style.overflow="hidden"},onEnd:()=>{document.documentElement.style.overflow=this.originalDocumentOverflow,this.originalDocumentOverflow=null},sort:this.options.sortable,store:{get:()=>{const s=globalThis.localStorage.getItem(a);return s?s.split("|"):[]},set:s=>{const i=s.toArray();globalThis.localStorage.setItem(a,i.join("|"))}}})}return c}layoutTypes={row:()=>sn.active.addChild(),column:()=>this.layoutTypes.row().addChild(),field:e=>this.layoutTypes.column().addChild(e)};addElement=e=>{const{meta:{group:t,id:n},...p}=Re(this.get(e),"controlData");return Zn(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,...h}=Ue(Om,e);this.container=t,this.groupOrder=yt(p.concat(["common","html","layout"])),this.options=h;const[g,m,c]=await Promise.all([Tt(()=>import("./index.min.js"),[]),Tt(()=>import("./index.min2.js"),[]),Tt(()=>import("./index.min3.js"),[])]),d=[g.default,m.default,c.default].flat();return Promise.all(this.registerControls([...d,...n]))}};const Ct=new od,Im=Object.freeze(Object.defineProperty({__proto__:null,Controls:od,default:Ct},Symbol.toStringTag,{value:"Module"})),Nm=new Set(["checkbox","radio"]),Fm=new Set(["radio","checkbox","select-one","select-multiple"]);class sd extends ei{constructor(e=Object.create(null)){super("field",e),this.debouncedUpdateEditPanels=Ln(this.updateEditPanels),this.debouncedUpdatePreview=Ln(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(h=>h.meta?.id==="edit");this.updateEditPanels();const p=V.create({tag:"li",attrs:{className:Ht},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{label:t,editorLabel:n,disableHtmlLabel:p,helpText:h,tooltip:g}=this.get("config"),{required:m}=this.get("attrs")||{},c=n||t,d={tag:"label",attrs:{}};return p?(d.tag="input",d.attrs.value=c):(d.attrs.contenteditable=!0,d.children=c),{className:"prev-label",children:[{...d,action:{input:({target:{innerHTML:a,value:s}})=>{const i=p?s:a;super.set("config.label",i);const u=this.dom.querySelector(".config-label");u&&(u.value=i)}}},m&&V.requiredMark(),g&&V.tooltip(g),h&&V.helpText(h)]}}setData=(e,t)=>super.set(e,t);set(e,t){return this.setData(e,t)}updateLabel(){const e=V.create(this.labelConfig);(this.label||!e)&&this.label.remove(),e&&(this.data.config?.labelAfter?this.dom.append(e):this.dom.prepend(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(Fm.has(n)){const p=this.preview.querySelectorAll(":checked"),h=this.get("options"),g=h?.[0]?.selected===void 0?"checked":"selected",m=h.reduce((c,d)=>(c[d.value]=d,c[d.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,h=ut(p);return this.setData(`options[${h}].label`,e.innerHTML),this.debouncedUpdateEditPanels()}this.setData("content",e.innerHTML||e.value)}}}}fieldPreview(){const{action:e={},...t}=Ke(this.data);t.id=`prev-${this.id}`,t.action=Object.entries(e).reduce((p,[h,g])=>(p[h]=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 Nm.has(this.get("config.controlId"))}}const Pm=Object.freeze(Object.defineProperty({__proto__:null,default:sd},Symbol.toStringTag,{value:"Module"})),Hm=()=>({actionButtons:{buttons:["move","edit","clone","remove"],disabled:[]},panels:{disabled:[],attrs:{disabled:["type"],hideDisabled:!0,locked:[]},order:["attrs","options","conditions"]},label:{disableHTML:!1}});let Wm=class extends Xn{constructor(e){super("fields",e),this.config={all:Hm()}}Component(e){return new sd(e)}get=e=>{let t=e&&Re(this.data,e);if(!t){const n=Ct.get(e);n&&(t=this.add(null,n.controlData))}return t};getData=()=>Object.entries(this.data).reduce((e,[t,n])=>{const{conditions:p,...h}=n?.getData()||n;if(p?.length){let g=!0;if(p.length===1){const[m]=p;g=!!m.if[0].source}g&&(h.conditions=p)}return e[t]=h,e},{});load=(e=Object.create(null))=>{const t=qn(e);this.empty();for(const[n,p]of Object.entries(t)){const{meta:h,...g}=p;h?.id&&Zn(g,"config.controlId",h?.id),this.add(n,g)}return this.data}};const ad=new Wm,Mn=sn,Tn=ca,rn=rd,_n=ad,Wn=Ct,zm=(l,e=!1)=>{if(l!=null){const t=qn(l);if(t&&typeof t=="object"){const n=Ke(t);return{id:n.id||Rt().id,stages:n.stages||Rt().stages,rows:n.rows||{},columns:n.columns||{},fields:n.fields||{}}}console.warn("Formeo: Invalid formData provided, using default")}if(e){const t=Ws.get(Gs);if(t)return t}return Rt()};class ld extends na{constructor(){super("components"),this.disableEvents=!0,this.stages=Mn,this.rows=Tn,this.columns=rn,this.fields=_n,this.controls=Wn}load=(e,t)=>{this.empty();const n=zm(e,t.sessionStorage);this.opts=t,this.set("id",n.id),this.add("stages",Mn.load(n.stages)),this.add("rows",Tn.load(n.rows)),this.add("columns",rn.load(n.columns)),this.add("fields",_n.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))lh(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@${Bs}/dist/formData_schema.json`,...this.formData})}get formData(){return{id:this.get("id"),stages:sn.getData(),rows:ca.getData(),columns:rd.getData(),fields:ad.getData()}}set config(e){const{stages:t,rows:n,columns:p,fields:h}=e;Mn.config=t,Tn.config=n,rn.config=p,_n.config=h}getIndex(e){return this[e]||this[Gf.get(e)]}setAddress(e,t){if(!He(e))return;const[n,p,...h]=Array.isArray(e)?e:wt(e),m=this.getIndex(n).get(p);return m?.set(h,t),m}getAddress(e){if(!He(e))return;const[t,n,...p]=Array.isArray(e)?e:wt(e),g=this.getIndex(t).get(n);if(!(p.length&&!g))return p.length?g.get(p):g}}const ce=new ld,Bm=Object.freeze(Object.defineProperty({__proto__:null,Columns:rn,Components:ld,Controls:Wn,Dialog:Dt,Fields:_n,Rows:Tn,Stages:Mn,default:ce},Symbol.toStringTag,{value:"Module"})),yu="no-transition",jm={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=>{globalThis.confirm(l.confirmationMessage)&&l.clearAllAction(l)}},je=({src:l,...e},t=on)=>{const n=new globalThis.CustomEvent(t,{detail:e,bubbles:J.opts?.debug||J.opts?.bubbles});if(n.data=(l||document).dispatchEvent(n),t===on){const p=new globalThis.CustomEvent(ip,{detail:e,bubbles:J.opts?.debug||J.opts?.bubbles});(l||document).dispatchEvent(p)}return n},J={init:function(l){return this.opts={...jm,...l},this},formeoSaved:l=>je(l,fh),formeoUpdated:(l,e)=>je(l,e||on),formeoCleared:l=>je(l,rp),formeoOnRender:l=>je(l,yh),formeoConditionUpdated:l=>je(l,op),formeoAddedRow:l=>je(l,Ks),formeoAddedColumn:l=>je(l,Ys),formeoAddedField:l=>je(l,Zs),formeoRemovedRow:l=>je(l,Xs),formeoRemovedColumn:l=>je(l,Qs),formeoRemovedField:l=>je(l,Js)},Vm=Ff(()=>{const l={timeStamp:globalThis.performance.now(),type:on,detail:ce.formData};J.opts.onUpdate(l),J.opts.onChange!==J.opts.onUpdate&&J.opts.onChange(l)},bt);document.addEventListener(on,Vm);document.addEventListener(ph,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(gh,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(mh,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(vh,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(Ks,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onAddRow(p)});document.addEventListener(Ys,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onAddColumn(p)});document.addEventListener(Zs,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onAddField(p)});document.addEventListener(Xs,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onRemoveRow(p)});document.addEventListener(Qs,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onRemoveColumn(p)});document.addEventListener(Js,l=>{const{timeStamp:e,type:t,detail:n}=l,p={timeStamp:e,type:t,detail:n};J.opts.onRemoveField(p)});document.addEventListener(yh,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(fh,({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 Xo;function Um(){Xo=Xo||window.requestAnimationFrame(()=>{Xo=!1;for(const l of Object.values(rn.data))l.dom.classList.add(yu),Wn.dom.classList.add(yu),Wn.panels.nav.refresh(),l.refreshFieldPanels()})}window.addEventListener("resize",Um);const bu={add:{attr:l=>{const e=globalThis.prompt(l.message.attr);if(e&&l.isDisabled(e))return globalThis.alert(X.get("attributeNotPermitted",e)),$e.add.attrs(l);let t;e&&(t=String(globalThis.prompt(l.message.value,"")),l.addAction(e,t))},option:l=>{l.addAction()},condition:l=>{l.addAction(l)},config:l=>{l.addAction(l)}},remove:{attrs:l=>{l.removeAction()},options:l=>{l.removeAction()},conditions:l=>{l.removeAction()}},click:{btn:l=>{l.action()}},save:{form:Ss}},$e={init:function(l){const e=Object.keys(bu);return this.opts=e.reduce((t,n)=>(t[n]={...bu[n],...l[n]},t),l),this},add:{attrs:l=>$e.opts.add.attr(l),options:l=>$e.opts.add.option(l),conditions:l=>(l.template=l.template||ea(),$e.opts.add.condition(l)),config:l=>$e.opts.add.config(l)},remove:{attrs:l=>$e.opts.remove.attrs(l),options:l=>$e.opts.remove.options(l),conditions:l=>$e.opts.remove.conditions(l)},click:{btn:l=>$e.opts.click.btn(l)},save:{form:l=>($e.opts.sessionStorage&&Ws.set(Gs,l),J.formeoSaved({formData:l}),$e.opts.save.form(l))}},Gm={get editor(){return{stickyControls:!1,allowEdit:!0,dataType:"json",debug:!1,sessionStorage:!1,editorContainer:null,svgSprite:null,style:Bf,iconFont:null,config:{},events:{},actions:{},controls:{},i18n:{location:"https://draggable.github.io/formeo/assets/lang/"},onLoad:()=>{}}}},Oe={CREATED:"created",LOADING_RESOURCES:"loading",INITIALIZING:"initializing",READY:"ready",ERROR:"error"};let cd=class{#e=Oe.CREATED;#n=null;#t=null;#i=!1;constructor({formData:e,...t},n){const p=Ue(Gm.editor,t),{actions:h,events:g,debug:m,config:c,editorContainer:d,...r}=p;d&&(this.editorContainer=typeof d=="string"?document.querySelector(d):d),this.opts=r,V.setOptions=r,ce.config=c;const o=n||e;this.#t=o?vt(o):null,this.userFormData=this.#t,this.Components=ce,this.dom=V,J.init({debug:m,...g}),$e.init({debug:m,sessionStorage:r.sessionStorage,...h}),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",this.loadResources.bind(this)):this.loadResources()}get formData(){return this.Components.formData}set formData(e={}){const t=vt(e);this.#t=t,this.userFormData=t,this.load(this.userFormData,this.opts)}loadData(e={}){this.formData=e}get json(){return this.Components.json}clear(){const e=Rt();this.#t=e,this.userFormData=e,this.Components.load(this.userFormData,this.opts),this.render()}async loadResources(){document.removeEventListener("DOMContentLoaded",this.loadResources),this.#e=Oe.LOADING_RESOURCES;const e=[Pg(this.opts.svgSprite),Wg(this.opts.style),X.init({preloaded:{"en-US":gd},...this.opts.i18n,locale:globalThis.sessionStorage?.getItem(lc)})].filter(Boolean);try{await Promise.all(e),this.opts.allowEdit&&this.init()}catch(t){throw this.#e=Oe.ERROR,console.error("Failed to load resources:",t),t}}init(){return this.#e===Oe.INITIALIZING?this.#n:this.#e===Oe.READY?this.#r():(this.#e=Oe.INITIALIZING,this.#n=Ct.init(this.opts.controls,this.opts.stickyControls).then(e=>(this.controls=e,this.#i||(this.#s(),this.#i=!0),this.formId=ce.get("id"),this.i18n={setLang:this.#o.bind(this)},this.render(),this.#e=Oe.READY,this.opts.onLoad?.(this),this.tooltipInstance=new Uu,this)).catch(e=>{throw this.#e=Oe.ERROR,console.error("Failed to initialize editor:",e),e}),this.#n)}async#o(e){globalThis.sessionStorage?.setItem(lc,e),await X.setCurrent(e),await this.#r()}async#r(){return this.controls=await Ct.init(this.opts.controls,this.opts.stickyControls),this.render(),this}#s(){const e=this.#a();this.Components.load(e,this.opts)}#a(){if(this.#t)return Ke(this.#t);if(this.opts.sessionStorage){const e=Ws.get(Gs);if(e)return e}return Rt()}load(e=this.userFormData,t=this.opts){this.Components.load(e,t),this.render()}get initState(){return this.#e}get isReady(){return this.#e===Oe.READY}async whenReady(){return this.#e===Oe.READY?this:this.#e===Oe.ERROR?Promise.reject(new Error("Editor initialization failed")):this.#n?this.#n:new Promise((e,t)=>{const n=()=>{this.#e===Oe.READY?e(this):this.#e===Oe.ERROR?t(new Error("Editor initialization failed")):globalThis.requestAnimationFrame(n)};n()})}render(){if(!this.controls)return globalThis.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 yn="f-",wu=l=>typeof l=="string"?document.querySelector(l):l,qm=({editorContainer:l,renderContainer:e,formData:t,...n})=>{const p={renderContainer:wu(e),editorContainer:wu(l),formData:vt(t)};return{elements:{},...n,...p}},bn=l=>l.match(up)?.[0]||l,Cu=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")},Km={isChecked:l=>l.checked,isNotChecked:l=>!l.checked,value:l=>l.value,isVisible:l=>Cu(l),isNotVisible:l=>!Cu(l)},Ym=()=>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()}}),Su={equals:Es,notEquals:(l,e)=>!Es(l,e),contains:(l,e)=>l.includes(e),notContains:(l,e)=>!l.includes(e)},Zm=Object.entries(bh).reduce((l,[e,t])=>(l[t]=Su[e],l[e]=Su[e],l),{}),Au={equals:(l,{targetProperty:e,value:t})=>{l[`_${e}`]=l[e],l[e]=t}},Xm=Object.entries(wh).reduce((l,[e,t])=>(l[t]=Au[e],l[e]=Au[e],l),{}),Qm={isChecked:l=>{l.checked=!0},isNotChecked:l=>{l.checked=!1},value:(l,{assignment:e,...t})=>{const n=Xm[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 ud=class{constructor(e,t){const{renderContainer:n,elements:p,formData:h,config:g}=qm(e);this.container=n,this.form=vt(t||h),this.elements=p,this.config=g,this.components=Object.create(null),this.dom=V}get formData(){return this.form}set formData(e){this.form=vt(e)}get userData(){const e=this.container.querySelector(".formeo-render")||this.renderedForm;if(!e)return{};const t=new FormData(e),n={};for(const[p,h]of t.entries())n[p]?Array.isArray(n[p])?n[p].push(h):n[p]=[n[p],h]:n[p]=h;return n}get userFormData(){const e=[];for(const[t,n]of Object.entries(this.userData)){const p={key:t,value:n,label:this.components[bn(t)]?.config?.label||""};e.push(p)}return e}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 h=Array.isArray(e[n])?e[n]:[e[n]];for(const g of p)g.checked=h.includes(g.value)}else if(p.length&&p[0].type==="radio")for(const h of p)h.checked=h.value===e[n];else p.type&&(p.value=e[n])}}render(e=this.form){this.form=vt(e);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={...this.config,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=>yn+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[bn(e.id)]=e,e);processRow=(e,t="row")=>{const{config:n,id:p}=e,h=[`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((d,{condition:r,result:o})=>(r&&d.push(o()),d),[]);return n.inputGroup&&h.push(`${yn}input-group-wrap`),{tag:n.fieldset?"fieldset":"div",className:h,children:c}};cloneComponentData=e=>{const{children:t=[],id:n,attrs:p={},...h}=this.components[e],g={...p,"data-clone-of":n};return h.tag==="input"&&(g.name=Kh(this.components[e])),{...h,id:yn+We(n),children:t?.length&&t.map(({id:m})=>this.cloneComponentData(bn(m))),attrs:g}};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 h=V.create(Ym());p.appendChild(h)}}});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:h={},dependencies:g={}}=this.elements[p]||{};g&&qh(g);const m=Ue({action:h},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=Pt,this.components[bn(e.id)]=e,e))}handleComponentCondition=(e,t,n)=>{if(e.length){for(const g of e)this.handleComponentCondition(g,t,n);return}const p=ev(e);p&&e.addEventListener(p,g=>{if(this.evaluateCondition(t,g))for(const m of n)this.execResult(m,g)},!1);const h={target:e};if(this.evaluateCondition(t,h))for(const g of n)this.execResult(g,h)};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 h of n){const{source:g,target:m}=h;if(He(g)){const{component:c,options:d}=this.getComponent(g),r=d||c;this.handleComponentCondition(r,h,p)}if(He(m)){const{component:c,options:d}=this.getComponent(m),r=d||c;this.handleComponentCondition(r,h,p)}}}};evaluateCondition=({source:e,sourceProperty:t,targetProperty:n,comparison:p,target:h})=>{const g=this.getComponentProperty(e,t);if(typeof g=="boolean")return g;const m=String(He(h)?this.getComponentProperty(h,n):h);return Zm[p]?.(g,m)};execResult=({target:e,targetProperty:t,assignment:n,value:p})=>{if(He(e)){const{component:h,option:g}=this.getComponent(e),m=g||h;Qm[t]?.(m,{targetProperty:t,assignment:n,value:p})}};getComponentProperty=(e,t)=>{const{component:n,option:p}=this.getComponent(e),h=p||n;return Km[t]?.(h)||h[t]};getComponent=e=>{const t={component:null};if(!He(e))return null;const[,n,p,h]=wt(e),g=this.renderedForm.querySelector(`#${yn}${n}`);if(!g)return t;if(t.component=g,p){const m=g.querySelectorAll("input"),c=m[h];return t.options=m,t.option=c,t}return t};getComponents=e=>{const t=[],n=e.slice(e.indexOf(".")+1);return t.push(...this.renderedForm.querySelectorAll(`[name=f-${n}]`)),t}};const Jm=[["input",l=>["textarea","text"].includes(l.type)],["change",l=>["select"].includes(l.tagName.toLowerCase())||["checkbox","radio"].includes(l.type)]],ev=l=>{const[e]=Jm.find(t=>t[1](l))||[!1];return e};window!==void 0&&(window.FormeoEditor=cd,window.FormeoRenderer=ud);const ua=cd,ha=ud,tv={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:{panels:{attrs:{}},events:{onRemove:l=>{console.log(`You just removed the field with the id "${l.target.id}"`,l)}}},"text-input":{attrs:{type:[{label:"text",value:"text"},{label:"phone",value:"phone"},{label:"email",value:"email"}]},config:{helpText:"This is a custom help text for text input fields.",hideLabel:!1}},checkbox:{actionButtons:{},panels:{attrs:{hideDisabled:!0}}}}},nv={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"]}},iv=".build-form",rv=".render-form",an={editorContainer:iv,actions:{},controls:nv,config:tv,events:{onSave:console.log,onChange:console.log},style:null,sessionStorage:!0,editPanelOrder:["attrs","options"],onLoad:()=>{console.log("demo loaded")}},da={renderContainer:rv,elements:{tinymce:{action:{onRender:l=>{if(l.id){const e=`#${l.id}`;globalThis.tinymce.remove(e),globalThis.tinymce.init({selector:e})}}}}}};async function ov(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 sv(),await av()&&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">${
|
|
54
|
+
<pre><code class="language-typescript">${Jo(uv)}</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">${
|
|
59
|
+
<pre><code class="language-typescript">${Jo(hv)}</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">${
|
|
64
|
+
<pre><code class="language-typescript">${Jo(dv)}</code></pre>
|
|
65
65
|
</div>
|
|
66
66
|
</div>
|
|
67
67
|
|
|
@@ -70,7 +70,7 @@ npm install formeo</code></pre>
|
|
|
70
70
|
<div id="angular-app-root"></div>
|
|
71
71
|
</div>
|
|
72
72
|
</div>
|
|
73
|
-
`;const t=await
|
|
73
|
+
`;const t=await cv();$u();const n=l.querySelector("#toggle-instructions"),p=l.querySelector("#instructions-section"),h=n.querySelector(".toggle-text"),g=n.querySelector(".toggle-icon");return n&&p&&n.addEventListener("click",()=>{const m=p.style.display==="block";p.style.display=m?"none":"block",h.textContent=m?"Show Implementation Guide":"Hide Implementation Guide",g.textContent=m?"▼":"▲",m||setTimeout(()=>$u(),50)}),{angularApp:t,cleanup:()=>{t?.destroy&&t.destroy();const m=document.getElementById("angular-app-root");m&&(m.innerHTML="")}}}catch(e){return console.error("Failed to load Angular demo:",e),l.innerHTML=`
|
|
74
74
|
<div class="angular-demo">
|
|
75
75
|
<h3>Angular Integration Demo</h3>
|
|
76
76
|
<div class="error-message">
|
|
@@ -80,7 +80,7 @@ npm install formeo</code></pre>
|
|
|
80
80
|
<button class="retry-button" onclick="window.frameworkLoader?.switchFramework('angular')">Retry</button>
|
|
81
81
|
</div>
|
|
82
82
|
</div>
|
|
83
|
-
`,{cleanup:()=>{}}}}async function
|
|
83
|
+
`,{cleanup:()=>{}}}}async function sv(){await new Promise(l=>setTimeout(l,500)),console.log("Angular-style demo environment ready")}async function av(){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),lv(),await Qo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"),await Qo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/typescript.min.js"),await Qo("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/bash.min.js"),window.hljs}catch(l){return console.warn("Failed to load Highlight.js:",l),null}}function lv(){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 Qo(l){return new Promise((e,t)=>{const n=document.createElement("script");n.src=l,n.onload=e,n.onerror=t,document.head.appendChild(n)})}function $u(){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 cv(){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
|
|
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 h={...an,editorContainer:".build-form-angular-real",events:{...an.events,onSave:a=>{console.log("Angular Component - Form saved:",a)},onChange:a=>{console.log("Angular Component - Form changed:",a)}}},g={...da,renderContainer:".render-form-angular-real"},m=new ua(h),c=new ha(g),d=l.querySelector("#angular-save-btn"),r=l.querySelector("#angular-render-btn"),o=l.querySelector("#angular-clear-btn");return d&&d.addEventListener("click",()=>{const a=m.formData;console.log("Angular Component - Save clicked:",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("Angular Component - Render clicked:",a)):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 Jo(l){const e=document.createElement("div");return e.textContent=l,e.innerHTML}const uv=`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
|
+
}`,hv=`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
|
+
}`,dv=`// app.config.ts (for standalone applications)
|
|
477
477
|
import { ApplicationConfig } from '@angular/core';
|
|
478
478
|
import { provideRouter } from '@angular/router';
|
|
479
479
|
import { routes } from './app.routes';
|
|
@@ -511,7 +511,7 @@ import { AppComponent } from './app/app.component';
|
|
|
511
511
|
import { appConfig } from './app/app.config';
|
|
512
512
|
|
|
513
513
|
bootstrapApplication(AppComponent, appConfig)
|
|
514
|
-
.catch(err => console.error(err));`;async function
|
|
514
|
+
.catch(err => console.error(err));`;async function fv(l){l.innerHTML=`
|
|
515
515
|
<div class="react-demo">
|
|
516
516
|
<h3>React Integration Demo</h3>
|
|
517
517
|
<p>Demonstrating Formeo integration patterns for React applications</p>
|
|
@@ -519,24 +519,24 @@ bootstrapApplication(AppComponent, appConfig)
|
|
|
519
519
|
<p>Initializing React-style Formeo integration demo...</p>
|
|
520
520
|
</div>
|
|
521
521
|
</div>
|
|
522
|
-
`;try{await
|
|
522
|
+
`;try{await pv(),await gv()&&console.log("Highlight.js loaded successfully for React demo"),l.innerHTML=`
|
|
523
523
|
<div class="react-demo">
|
|
524
524
|
<h3>React Integration Demo</h3>
|
|
525
525
|
<div class="demo-description">
|
|
526
526
|
<p>This demo shows how to integrate Formeo with React applications using modern hooks and patterns.</p>
|
|
527
527
|
<div class="notice">
|
|
528
|
-
<strong>Note:</strong> This is a pattern demonstration. For a complete React project with Formeo,
|
|
528
|
+
<strong>Note:</strong> This is a pattern demonstration. For a complete React project with Formeo,
|
|
529
529
|
see <code>/docs/react-integration-example/</code> in the repository.
|
|
530
530
|
</div>
|
|
531
531
|
</div>
|
|
532
|
-
|
|
532
|
+
|
|
533
533
|
<div class="instructions-toggle">
|
|
534
534
|
<button class="toggle-button" id="toggle-instructions">
|
|
535
535
|
<span class="toggle-text">Show Implementation Guide</span>
|
|
536
536
|
<span class="toggle-icon">▼</span>
|
|
537
537
|
</button>
|
|
538
538
|
</div>
|
|
539
|
-
|
|
539
|
+
|
|
540
540
|
<div class="code-example" id="instructions-section" style="display: none;">
|
|
541
541
|
<div class="guide-section">
|
|
542
542
|
<h4>1. Install Dependencies</h4>
|
|
@@ -550,29 +550,29 @@ npm install formeo
|
|
|
550
550
|
# Install additional dependencies for TypeScript (optional)
|
|
551
551
|
npm install --save-dev @types/react @types/react-dom typescript</code></pre>
|
|
552
552
|
</div>
|
|
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">${ts(yv)}</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">${ts(bv)}</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">${ts(wv)}</code></pre>
|
|
567
567
|
</div>
|
|
568
568
|
</div>
|
|
569
|
-
|
|
569
|
+
|
|
570
570
|
<h4>Interactive Demo (React Patterns)</h4>
|
|
571
571
|
<div class="react-app-container">
|
|
572
572
|
<div id="react-app-root"></div>
|
|
573
573
|
</div>
|
|
574
574
|
</div>
|
|
575
|
-
`;const t=await
|
|
575
|
+
`;const t=await vv();xu();const n=l.querySelector("#toggle-instructions"),p=l.querySelector("#instructions-section"),h=n.querySelector(".toggle-text"),g=n.querySelector(".toggle-icon");return n&&p&&n.addEventListener("click",()=>{const m=p.style.display==="block";p.style.display=m?"none":"block",h.textContent=m?"Show Implementation Guide":"Hide Implementation Guide",g.textContent=m?"▼":"▲",m||setTimeout(()=>xu(),50)}),{reactApp:t,cleanup:()=>{t?.cleanup&&t.cleanup();const m=document.getElementById("react-app-root");m&&(m.innerHTML="")}}}catch(e){return console.error("Failed to load React demo:",e),l.innerHTML=`
|
|
576
576
|
<div class="react-demo">
|
|
577
577
|
<h3>React Integration Demo</h3>
|
|
578
578
|
<div class="error-message">
|
|
@@ -582,18 +582,18 @@ 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
|
|
585
|
+
`,{cleanup:()=>{}}}}async function pv(){await new Promise(l=>setTimeout(l,500)),console.log("React-style demo environment ready")}async function gv(){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),mv(),await es("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"),await es("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/typescript.min.js"),await es("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 mv(){const l=document.createElement("style");l.textContent=`
|
|
586
586
|
.react-demo .guide-section {
|
|
587
587
|
margin-bottom: 24px;
|
|
588
588
|
}
|
|
589
|
-
|
|
589
|
+
|
|
590
590
|
.react-demo .guide-section h4 {
|
|
591
591
|
color: #333;
|
|
592
592
|
margin-bottom: 12px;
|
|
593
593
|
padding-bottom: 8px;
|
|
594
594
|
border-bottom: 2px solid #61dafb;
|
|
595
595
|
}
|
|
596
|
-
|
|
596
|
+
|
|
597
597
|
.react-demo pre {
|
|
598
598
|
background: #f8f9fa;
|
|
599
599
|
border: 1px solid #e1e4e8;
|
|
@@ -603,7 +603,7 @@ npm install --save-dev @types/react @types/react-dom typescript</code></pre>
|
|
|
603
603
|
overflow-x: auto;
|
|
604
604
|
position: relative;
|
|
605
605
|
}
|
|
606
|
-
|
|
606
|
+
|
|
607
607
|
.react-demo pre code {
|
|
608
608
|
background: transparent;
|
|
609
609
|
padding: 0;
|
|
@@ -613,7 +613,7 @@ npm install --save-dev @types/react @types/react-dom typescript</code></pre>
|
|
|
613
613
|
line-height: 1.5;
|
|
614
614
|
color: #24292e;
|
|
615
615
|
}
|
|
616
|
-
|
|
616
|
+
|
|
617
617
|
.react-demo pre code.language-typescript:before,
|
|
618
618
|
.react-demo pre code.language-bash:before {
|
|
619
619
|
content: attr(class);
|
|
@@ -628,19 +628,19 @@ npm install --save-dev @types/react @types/react-dom typescript</code></pre>
|
|
|
628
628
|
text-transform: uppercase;
|
|
629
629
|
font-weight: 500;
|
|
630
630
|
}
|
|
631
|
-
|
|
631
|
+
|
|
632
632
|
.react-demo pre code.language-typescript:before {
|
|
633
633
|
content: 'TypeScript';
|
|
634
634
|
}
|
|
635
|
-
|
|
635
|
+
|
|
636
636
|
.react-demo pre code.language-bash:before {
|
|
637
637
|
content: 'Bash';
|
|
638
638
|
}
|
|
639
|
-
|
|
639
|
+
|
|
640
640
|
.react-demo .hljs {
|
|
641
641
|
background: transparent !important;
|
|
642
642
|
}
|
|
643
|
-
|
|
643
|
+
|
|
644
644
|
.react-demo .code-example {
|
|
645
645
|
background: #ffffff;
|
|
646
646
|
border: 1px solid #e1e4e8;
|
|
@@ -648,7 +648,7 @@ npm install --save-dev @types/react @types/react-dom typescript</code></pre>
|
|
|
648
648
|
padding: 20px;
|
|
649
649
|
margin-top: 16px;
|
|
650
650
|
}
|
|
651
|
-
|
|
651
|
+
|
|
652
652
|
.react-demo .notice {
|
|
653
653
|
background: #e8f4fd;
|
|
654
654
|
border: 1px solid #61dafb;
|
|
@@ -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 es(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 xu(){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 vv(){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
|
|
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 h={...an,editorContainer:".build-form-react-real",events:{...an.events,onSave:s=>{console.log("React Component - Form saved:",s)},onChange:s=>{console.log("React Component - Form changed:",s)}}},g={...da,renderContainer:".render-form-react-real"},m=new ua(h),c=new ha(g),d=l.querySelector("#react-save-btn"),r=l.querySelector("#react-render-btn"),o=l.querySelector("#react-clear-btn"),a=l.querySelector("#react-export-btn");return d&&d.addEventListener("click",()=>{const s=m.formData;console.log("React Component - Save clicked:",s),localStorage.setItem("formeo-react-form",JSON.stringify(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("React Component - Render clicked:",s)):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")}),a&&a.addEventListener("click",()=>{const s=m.formData;if(s&&Object.keys(s).length>0){const i=new Blob([JSON.stringify(s,null,2)],{type:"application/json"}),u=URL.createObjectURL(i),f=document.createElement("a");f.href=u,f.download="formeo-react-form.json",f.click(),URL.revokeObjectURL(u),console.log("React Component - Export clicked")}else alert("Please create a form first before exporting")}),{editor:m,renderer:c,cleanup:()=>{m?.destroy&&m.destroy(),c?.destroy&&c.destroy()}}}return null}function ts(l){const e=document.createElement("div");return e.textContent=l,e.innerHTML}const yv=`import { useEffect, useRef, useCallback } from 'react';
|
|
679
679
|
import { FormeoEditor, FormeoRenderer } from 'formeo';
|
|
680
680
|
|
|
681
681
|
// Custom hook for Formeo Editor
|
|
@@ -808,7 +808,7 @@ export function useFormeoRenderer(options = {}) {
|
|
|
808
808
|
clearRenderer,
|
|
809
809
|
renderer: rendererRef.current
|
|
810
810
|
};
|
|
811
|
-
}`,
|
|
811
|
+
}`,bv=`import React, { useState } from 'react';
|
|
812
812
|
import { useFormeoEditor, useFormeoRenderer } from './hooks/useFormeo';
|
|
813
813
|
|
|
814
814
|
interface FormBuilderProps {
|
|
@@ -960,7 +960,7 @@ export default function App() {
|
|
|
960
960
|
return (
|
|
961
961
|
<div className="app">
|
|
962
962
|
<h1>Formeo React Integration</h1>
|
|
963
|
-
|
|
963
|
+
|
|
964
964
|
<FormBuilder
|
|
965
965
|
onFormSave={handleFormSave}
|
|
966
966
|
onFormSubmit={handleFormSubmit}
|
|
@@ -980,7 +980,7 @@ export default function App() {
|
|
|
980
980
|
)}
|
|
981
981
|
</div>
|
|
982
982
|
);
|
|
983
|
-
}`,
|
|
983
|
+
}`,wv=`import React, { createContext, useContext, useReducer, useCallback } from 'react';
|
|
984
984
|
import { FormeoEditor, FormeoRenderer } from 'formeo';
|
|
985
985
|
|
|
986
986
|
// Types
|
|
@@ -1078,10 +1078,10 @@ function formeoReducer(state: FormeoState, action: FormeoAction): FormeoState {
|
|
|
1078
1078
|
case 'CLEAR_FORM':
|
|
1079
1079
|
const editor = state.editors[action.payload];
|
|
1080
1080
|
const renderer = state.renderers[action.payload];
|
|
1081
|
-
|
|
1081
|
+
|
|
1082
1082
|
if (editor) editor.clear();
|
|
1083
1083
|
// Note: renderer clearing handled by component that owns the container
|
|
1084
|
-
|
|
1084
|
+
|
|
1085
1085
|
return {
|
|
1086
1086
|
...state,
|
|
1087
1087
|
forms: {
|
|
@@ -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 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,f){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(),p=document.createElement("script");p.src=g,c.appendChild(p),p.onload=p.onreadystatechange=function(r,o){(o||!p.readyState||p.readyState=="loaded"||p.readyState=="complete")&&(p=p.onload=p.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,f){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,f){var d={},g=function(){this.propagationStopped=!0},m=function(){this.defaultPrevented=!0};d._emit=d._dispatchEvent=function(c,p){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var r=this._eventRegistry[c]||[],o=this._defaultHandlers[c];if(!(!r.length&&!o)){(typeof p!="object"||!p)&&(p={}),p.type||(p.type=c),p.stopPropagation||(p.stopPropagation=g),p.preventDefault||(p.preventDefault=m),r=r.slice();for(var s=0;s<r.length&&(r[s](p,this),!p.propagationStopped);s++);if(o&&!p.defaultPrevented)return o(p,this)}},d._signal=function(c,p){var r=(this._eventRegistry||{})[c];if(r){r=r.slice();for(var o=0;o<r.length;o++)r[o](p,this)}},d.once=function(c,p){var r=this;if(this.on(c,function o(){r.off(c,o),p.apply(null,arguments)}),!p)return new Promise(function(o){p=o})},d.setDefaultHandler=function(c,p){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(p);a!=-1&&s.splice(a,1)}r[c]=p},d.removeDefaultHandler=function(c,p){var r=this._defaultHandlers;if(r){var o=r._disabled_[c];if(r[c]==p)o&&this.setDefaultHandler(c,o.pop());else if(o){var s=o.indexOf(p);s!=-1&&o.splice(s,1)}}},d.on=d.addEventListener=function(c,p,r){this._eventRegistry=this._eventRegistry||{};var o=this._eventRegistry[c];return o||(o=this._eventRegistry[c]=[]),o.indexOf(p)==-1&&o[r?"unshift":"push"](p),p},d.off=d.removeListener=d.removeEventListener=function(c,p){this._eventRegistry=this._eventRegistry||{};var r=this._eventRegistry[c];if(r){var o=r.indexOf(p);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,f){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,f){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,f){"no use strict";var d=t("./oop"),g=t("./event_emitter").EventEmitter,m=t("./report_error").reportError,c=t("./default_english_messages").defaultEnglishMessages,p={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,p),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,f){f.exports=`.ace-tm .ace_gutter {
|
|
1170
|
+
};`;var ns={exports:{}},Eu;function Cv(){return Eu||(Eu=1,(function(l,e){(function(){var t="ace",n=(function(){return this})();!n&&typeof window<"u"&&(n=window);var p=function(r,o,a){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&&(a=o),p.modules[r]||(p.payloads[r]=a,p.modules[r]=null)};p.modules={},p.payloads={};var h=function(r,o,a){if(typeof o=="string"){var s=c(r,o);if(s!=null)return a&&a(),s}else if(Object.prototype.toString.call(o)==="[object Array]"){for(var i=[],u=0,f=o.length;u<f;++u){var y=c(r,o[u]);if(y==null&&g.original)return;i.push(y)}return a&&a.apply(null,i)||!0}},g=function(r,o){var a=h("",r,o);return a==null&&g.original?g.original.apply(this,arguments):a},m=function(r,o){if(o.indexOf("!")!==-1){var a=o.split("!");return m(r,a[0])+"!"+m(r,a[1])}if(o.charAt(0)=="."){var s=r.split("/").slice(0,-1).join("/");for(o=s+"/"+o;o.indexOf(".")!==-1&&i!=o;){var i=o;o=o.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return o},c=function(r,o){o=m(r,o);var a=p.modules[o];if(!a){if(a=p.payloads[o],typeof a=="function"){var s={},i={id:o,uri:"",exports:s,packaged:!0},u=function(y,b){return h(o,y,b)},f=a(u,s,i);s=f||i.exports,p.modules[o]=s,delete p.payloads[o]}a=p.modules[o]=s||a}return a};function d(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)}d(t)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(t,n,p){function h(g,m,c){Object.defineProperty(g,m,{value:c,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||h(String.prototype,"startsWith",function(g,m){return m=m||0,this.lastIndexOf(g,m)===m}),String.prototype.endsWith||h(String.prototype,"endsWith",function(g,m){var c=this;(m===void 0||m>c.length)&&(m=c.length),m-=g.length;var d=c.indexOf(g,m);return d!==-1&&d===m}),String.prototype.repeat||h(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||h(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 d=arguments[c];d!=null&&Object.keys(d).forEach(function(r){m[r]=d[r]})}return m}),Object.values||(Object.values=function(g){return Object.keys(g).map(function(m){return g[m]})}),Array.prototype.find||h(Array.prototype,"find",function(g){for(var m=this.length,c=arguments[1],d=0;d<m;d++){var r=this[d];if(g.call(c,r,d,this))return r}}),Array.prototype.findIndex||h(Array.prototype,"findIndex",function(g){for(var m=this.length,c=arguments[1],d=0;d<m;d++){var r=this[d];if(g.call(c,r,d,this))return d}}),Array.prototype.includes||h(Array.prototype,"includes",function(g,m){return this.indexOf(g,m)!=-1}),Array.prototype.fill||h(Array.prototype,"fill",function(g){for(var m=this,c=m.length>>>0,d=arguments[1],r=d>>0,o=r<0?Math.max(c+r,0):Math.min(r,c),a=arguments[2],s=a===void 0?c:a>>0,i=s<0?Math.max(c+s,0):Math.min(s,c);o<i;)m[o]=g,o++;return m}),Array.of||h(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 h(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]=h(g[c]);return m}if(Object.prototype.toString.call(g)!=="[object Object]")return g;m={};for(var c in g)m[c]=h(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 d="";c>0;)c&1&&(d+=m),(c>>=1)&&(m+=m);return d};var h=/^\s\s*/,g=/\s\s*$/;n.stringTrimLeft=function(m){return m.replace(h,"")},n.stringTrimRight=function(m){return m.replace(g,"")},n.copyObject=function(m){var c={};for(var d in m)c[d]=m[d];return c},n.copyArray=function(m){for(var c=[],d=0,r=m.length;d<r;d++)m[d]&&typeof m[d]=="object"?c[d]=this.copyObject(m[d]):c[d]=m[d];return c},n.deepCopy=t("./deep_copy").deepCopy,n.arrayToMap=function(m){for(var c={},d=0;d<m.length;d++)c[m[d]]=1;return c},n.createMap=function(m){var c=Object.create(null);for(var d in m)c[d]=m[d];return c},n.arrayRemove=function(m,c){for(var d=0;d<=m.length;d++)c===m[d]&&m.splice(d,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 d=[];return m.replace(c,function(r){d.push({offset:arguments[arguments.length-2],length:r.length})}),d},n.deferredCall=function(m){var c=null,d=function(){c=null,m()},r=function(o){return r.cancel(),c=setTimeout(d,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 d=null,r=function(){d=null,m()},o=function(a){d==null&&(d=setTimeout(r,a||c))};return o.delay=function(a){d&&clearTimeout(d),d=setTimeout(r,a||c)},o.schedule=o,o.call=function(){this.cancel(),m()},o.cancel=function(){d&&clearTimeout(d),d=null},o.isPending=function(){return d},o},n.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch{return!1}return!0},n.skipEmptyMatch=function(m,c,d){return d&&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 h=typeof navigator=="object"?navigator:{},g=(/mac|win|linux/i.exec(h.platform)||["other"])[0].toLowerCase(),m=h.userAgent||"",c=h.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 h=t("./useragent"),g="http://www.w3.org/1999/xhtml";n.buildDom=function a(s,i,u){if(typeof s=="string"&&s){var f=document.createTextNode(s);return i&&i.appendChild(f),f}if(!Array.isArray(s))return s&&s.appendChild&&i&&i.appendChild(s),s;if(typeof s[0]!="string"||!s[0]){for(var y=[],b=0;b<s.length;b++){var E=a(s[b],i,u);E&&y.push(E)}return y}var $=document.createElement(s[0]),A=s[1],S=1;A&&typeof A=="object"&&!Array.isArray(A)&&(S=2);for(var b=S;b<s.length;b++)a(s[b],$,u);return S==2&&Object.keys(A).forEach(function(M){var R=A[M];M==="class"?$.className=Array.isArray(R)?R.join(" "):R:typeof R=="function"||M=="value"||M[0]=="$"?$[M]=R:M==="ref"?u&&(u[R]=$):M==="style"?typeof R=="string"&&($.style.cssText=R):R!=null&&$.setAttribute(M,R)}),i&&i.appendChild($),$},n.getDocumentHead=function(a){return a||(a=document),a.head||a.getElementsByTagName("head")[0]||a.documentElement},n.createElement=function(a,s){return document.createElementNS?document.createElementNS(s||g,a):document.createElement(a)},n.removeChildren=function(a){a.innerHTML=""},n.createTextNode=function(a,s){var i=s?s.ownerDocument:document;return i.createTextNode(a)},n.createFragment=function(a){var s=a?a.ownerDocument:document;return s.createDocumentFragment()},n.hasCssClass=function(a,s){var i=(a.className+"").split(/\s+/g);return i.indexOf(s)!==-1},n.addCssClass=function(a,s){n.hasCssClass(a,s)||(a.className+=" "+s)},n.removeCssClass=function(a,s){for(var i=a.className.split(/\s+/g);;){var u=i.indexOf(s);if(u==-1)break;i.splice(u,1)}a.className=i.join(" ")},n.toggleCssClass=function(a,s){for(var i=a.className.split(/\s+/g),u=!0;;){var f=i.indexOf(s);if(f==-1)break;u=!1,i.splice(f,1)}return u&&i.push(s),a.className=i.join(" "),u},n.setCssClass=function(a,s,i){i?n.addCssClass(a,s):n.removeCssClass(a,s)},n.hasCssString=function(a,s){var i=0,u;if(s=s||document,u=s.querySelectorAll("style")){for(;i<u.length;)if(u[i++].id===a)return!0}},n.removeElementById=function(a,s){s=s||document,s.getElementById(a)&&s.getElementById(a).remove()};var m,c=[];n.useStrictCSP=function(a){m=a,a==!1?d():c||(c=[])};function d(){var a=c;c=null,a&&a.forEach(function(s){r(s[0],s[1])})}function r(a,s,i){if(!(typeof document>"u")){if(c){if(i)d();else if(i===!1)return c.push([a,s])}if(!m){var u=i;!i||!i.getRootNode?u=document:(u=i.getRootNode(),(!u||u==i)&&(u=document));var f=u.ownerDocument||u;if(s&&n.hasCssString(s,u))return null;s&&(a+=`
|
|
1171
|
+
/*# sourceURL=ace/css/`+s+" */");var y=n.createElement("style");y.appendChild(f.createTextNode(a)),s&&(y.id=s),u==f&&(u=n.getDocumentHead(f)),u.insertBefore(y,u.firstChild)}}}if(n.importCssString=r,n.importCssStylsheet=function(a,s){n.buildDom(["link",{rel:"stylesheet",href:a}],n.getDocumentHead(s))},n.scrollbarWidth=function(a){var s=n.createElement("ace_inner");s.style.width="100%",s.style.minWidth="0px",s.style.height="200px",s.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(s);var f=a&&a.documentElement||document&&document.documentElement;if(!f)return 0;f.appendChild(i);var y=s.offsetWidth;u.overflow="scroll";var b=s.offsetWidth;return y===b&&(b=i.clientWidth),f.removeChild(i),y-b},n.computedStyle=function(a,s){return window.getComputedStyle(a,"")||{}},n.setStyle=function(a,s,i){a[s]!==i&&(a[s]=i)},n.HAS_CSS_ANIMATION=!1,n.HAS_CSS_TRANSFORMS=!1,n.HI_DPI=h.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,h.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),!h.isEdge&&typeof o.style.animationName<"u"&&(n.HAS_CSS_ANIMATION=!0),o=null}n.HAS_CSS_TRANSFORMS?n.translate=function(a,s,i){a.style.transform="translate("+Math.round(s)+"px, "+Math.round(i)+"px)"}:n.translate=function(a,s,i){a.style.top=Math.round(i)+"px",a.style.left=Math.round(s)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(t,n,p){var h=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=h.getDocumentHead(),d=document.createElement("script");d.src=g,c.appendChild(d),d.onload=d.onreadystatechange=function(r,o){(o||!d.readyState||d.readyState=="loaded"||d.readyState=="complete")&&(d=d.onload=d.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(h,g){h.super_=g,h.prototype=Object.create(g.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}})},n.mixin=function(h,g){for(var m in g)h[m]=g[m];return h},n.implement=function(h,g){n.mixin(h,g)}}),ace.define("ace/lib/event_emitter",["require","exports","module"],function(t,n,p){var h={},g=function(){this.propagationStopped=!0},m=function(){this.defaultPrevented=!0};h._emit=h._dispatchEvent=function(c,d){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var r=this._eventRegistry[c]||[],o=this._defaultHandlers[c];if(!(!r.length&&!o)){(typeof d!="object"||!d)&&(d={}),d.type||(d.type=c),d.stopPropagation||(d.stopPropagation=g),d.preventDefault||(d.preventDefault=m),r=r.slice();for(var a=0;a<r.length&&(r[a](d,this),!d.propagationStopped);a++);if(o&&!d.defaultPrevented)return o(d,this)}},h._signal=function(c,d){var r=(this._eventRegistry||{})[c];if(r){r=r.slice();for(var o=0;o<r.length;o++)r[o](d,this)}},h.once=function(c,d){var r=this;if(this.on(c,function o(){r.off(c,o),d.apply(null,arguments)}),!d)return new Promise(function(o){d=o})},h.setDefaultHandler=function(c,d){var r=this._defaultHandlers;if(r||(r=this._defaultHandlers={_disabled_:{}}),r[c]){var o=r[c],a=r._disabled_[c];a||(r._disabled_[c]=a=[]),a.push(o);var s=a.indexOf(d);s!=-1&&a.splice(s,1)}r[c]=d},h.removeDefaultHandler=function(c,d){var r=this._defaultHandlers;if(r){var o=r._disabled_[c];if(r[c]==d)o&&this.setDefaultHandler(c,o.pop());else if(o){var a=o.indexOf(d);a!=-1&&o.splice(a,1)}}},h.on=h.addEventListener=function(c,d,r){this._eventRegistry=this._eventRegistry||{};var o=this._eventRegistry[c];return o||(o=this._eventRegistry[c]=[]),o.indexOf(d)==-1&&o[r?"unshift":"push"](d),d},h.off=h.removeListener=h.removeEventListener=function(c,d){this._eventRegistry=this._eventRegistry||{};var r=this._eventRegistry[c];if(r){var o=r.indexOf(d);o!==-1&&r.splice(o,1)}},h.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=h}),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 h={"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=h}),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 h=t("./oop"),g=t("./event_emitter").EventEmitter,m=t("./report_error").reportError,c=t("./default_english_messages").defaultEnglishMessages,d={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 f=this.$options;i=Object.keys(f).filter(function(y){return!f[y].hidden})}return i.forEach(function(y){u[y]=this.getOption(y)},this),u},setOption:function(i,u){if(this["$"+i]!==u){var f=this.$options[i];if(!f)return r('misspelled option "'+i+'"');if(f.forwardTo)return this[f.forwardTo]&&this[f.forwardTo].setOption(i,u);f.handlesSet||(this["$"+i]=u),f&&f.set&&f.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,a,s=(function(){function i(){this.$defaultOptions={},o=c,a="dollarSigns"}return i.prototype.defineOptions=function(u,f,y){return u.$options||(this.$defaultOptions[f]=u.$options={}),Object.keys(y).forEach(function(b){var E=y[b];typeof E=="string"&&(E={forwardTo:E}),E.name||(E.name=b),u.$options[E.name]=E,"initialValue"in E&&(u["$"+E.name]=E.initialValue)}),h.implement(u,d),this},i.prototype.resetOptions=function(u){Object.keys(u.$options).forEach(function(f){var y=u.$options[f];"value"in y&&u.setOption(f,y.value)})},i.prototype.setDefaultValue=function(u,f,y){if(!u){for(u in this.$defaultOptions)if(this.$defaultOptions[u][f])break;if(!this.$defaultOptions[u][f])return!1}var b=this.$defaultOptions[u]||(this.$defaultOptions[u]={});b[f]&&(b.forwardTo?this.setDefaultValue(b.forwardTo,f,y):b[f].value=y)},i.prototype.setDefaultValues=function(u,f){Object.keys(f).forEach(function(y){this.setDefaultValue(u,y,f[y])},this)},i.prototype.setMessages=function(u,f){o=u,f&&f.placeholders&&(a=f.placeholders)},i.prototype.nls=function(u,f,y){o[u]||(r("No message found for the key '"+u+"' in the provided messages, trying to find a translation for the default string '"+f+"'."),o[f]||r("No message found for the default string '"+f+"' in the provided messages. Falling back to the default English message."));var b=o[u]||o[f]||f;return y&&(a==="dollarSigns"&&(b=b.replace(/\$(\$|[\d]+)/g,function(E,$){return $=="$"?"$":y[$]})),a==="curlyBrackets"&&(b=b.replace(/\{([^\}]+)\}/g,function(E,$){return y[$]}))),b},i})();s.prototype.warn=r,s.prototype.reportError=m,h.implement(s.prototype,g),n.AppConfig=s}),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,f){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,f){"no use strict";var d=t("./lib/lang"),g=t("./lib/net"),m=t("./lib/dom"),c=t("./lib/app_config").AppConfig;f.exports=n=new c;var p={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};n.get=function(a){if(!p.hasOwnProperty(a))throw new Error("Unknown config key: "+a);return p[a]},n.set=function(a,i){if(p.hasOwnProperty(a))p[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(p)},n.$modes={},n.moduleUrl=function(a,i){if(p.$moduleUrls[a])return p.$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=p[i+"Path"];return x==null?x=p.basePath:h=="/"&&(i=h=""),x&&x.slice(-1)!="/"&&(x+="/"),x+i+h+y+this.get("suffix")},n.setModuleUrl=function(a,i){return p.$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 f.require=="function"){var i="require";return f[i](a)}},n.setModuleLoader=function(a,i){n.dynamicModules[a]=i};var s=function(){!p.basePath&&!p.workerPath&&!p.modePath&&!p.themePath&&!Object.keys(p.$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,f){t("./lib/fixoldbrowsers");var d=t("./config");d.setLoader(function(p,r){t([p],function(o){r(null,o)})});var g=(function(){return this||typeof window<"u"&&window})();f.exports=function(p){d.init=m,d.$require=t,p.require=t},m(!0);function m(p){if(!(!g||!g.document)){d.set("packaged",p||t.packaged||f.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(p){return p.replace(/-(.)/g,function(r,o){return o.toUpperCase()})}}),ace.define("ace/range",["require","exports","module"],function(t,n,f){var d=(function(){function g(m,c,p,r){this.start={row:m,column:c},this.end={row:p,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,p=m.end,r=m.start;return c=this.compare(p.row,p.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 p={row:c+1,column:0};else if(this.end.row<m)var p={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,p||this.end)},g.prototype.extend=function(m,c){var p=this.compare(m,c);if(p==0)return this;if(p==-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),p=m.documentToScreenPosition(this.end);return new g(c.row,c.column,p.row,p.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,f){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 p=String.fromCharCode(c+32);m["Key"+p.toUpperCase()]=c,g.PRINTABLE_KEYS[c]=p}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,f){var d=t("./keys"),g=t("./useragent"),m=null,c=0,p;function r(){p=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){return p={passive:!1},!0}})}catch{}}function o(){return p==null&&r(),p}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,f){var d;f.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,f){var d=t("../lib/event"),g=t("../config").nls,m=t("../lib/useragent"),c=t("../lib/dom"),p=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=`
|
|
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 h=t("../lib/dom");h.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 h=t("./lib/lang"),g=t("./lib/net"),m=t("./lib/dom"),c=t("./lib/app_config").AppConfig;p.exports=n=new c;var d={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};n.get=function(s){if(!d.hasOwnProperty(s))throw new Error("Unknown config key: "+s);return d[s]},n.set=function(s,i){if(d.hasOwnProperty(s))d[s]=i;else if(this.setDefaultValue("",s,i)==!1)throw new Error("Unknown config key: "+s);s=="useStrictCSP"&&m.useStrictCSP(i)},n.all=function(){return h.copyObject(d)},n.$modes={},n.moduleUrl=function(s,i){if(d.$moduleUrls[s])return d.$moduleUrls[s];var u=s.split("/");i=i||u[u.length-2]||"";var f=i=="snippets"?"/":"-",y=u[u.length-1];if(i=="worker"&&f=="-"){var b=new RegExp("^"+i+"[\\-_]|[\\-_]"+i+"$","g");y=y.replace(b,"")}(!y||y==i)&&u.length>1&&(y=u[u.length-2]);var E=d[i+"Path"];return E==null?E=d.basePath:f=="/"&&(i=f=""),E&&E.slice(-1)!="/"&&(E+="/"),E+i+f+y+this.get("suffix")},n.setModuleUrl=function(s,i){return d.$moduleUrls[s]=i};var r=function(s,i){if(s==="ace/theme/textmate"||s==="./theme/textmate")return i(null,t("./theme/textmate"));if(o)return o(s,i);console.error("loader is not configured")},o;n.setLoader=function(s){o=s},n.dynamicModules=Object.create(null),n.$loading={},n.$loaded={},n.loadModule=function(s,i){var u;if(Array.isArray(s))var f=s[0],y=s[1];else if(typeof s=="string")var y=s;var b=function(E){if(E&&!n.$loading[y])return i&&i(E);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,f),$),a()}};if(n.dynamicModules[y])n.dynamicModules[y]().then(function(E){E.default?b(E.default):b(E)});else{try{u=this.$require(y)}catch{}b(u||n.$loaded[y])}},n.$require=function(s){if(typeof p.require=="function"){var i="require";return p[i](s)}},n.setModuleLoader=function(s,i){n.dynamicModules[s]=i};var a=function(){!d.basePath&&!d.workerPath&&!d.modePath&&!d.themePath&&!Object.keys(d.$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"),a=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 h=t("./config");h.setLoader(function(d,r){t([d],function(o){r(null,o)})});var g=(function(){return this||typeof window<"u"&&window})();p.exports=function(d){h.init=m,h.$require=t,d.require=t},m(!0);function m(d){if(!(!g||!g.document)){h.set("packaged",d||t.packaged||p.packaged||g.define&&(void 0).packaged);var r={},o="",a=document.currentScript||document._currentScript,s=a&&a.ownerDocument||document;a&&a.src&&(o=a.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var i=s.getElementsByTagName("script"),u=0;u<i.length;u++){var f=i[u],y=f.src||f.getAttribute("src");if(y){for(var b=f.attributes,E=0,$=b.length;E<$;E++){var A=b[E];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"&&h.set(M,r[M])}}function c(d){return d.replace(/-(.)/g,function(r,o){return o.toUpperCase()})}}),ace.define("ace/range",["require","exports","module"],function(t,n,p){var h=(function(){function g(m,c,d,r){this.start={row:m,column:c},this.end={row:d,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,d=m.end,r=m.start;return c=this.compare(d.row,d.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 d={row:c+1,column:0};else if(this.end.row<m)var d={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,d||this.end)},g.prototype.extend=function(m,c){var d=this.compare(m,c);if(d==0)return this;if(d==-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),d=m.documentToScreenPosition(this.end);return new g(c.row,c.column,d.row,d.column)},g.prototype.moveBy=function(m,c){this.start.row+=m,this.start.column+=c,this.end.row+=m,this.end.column+=c},g})();h.fromPoints=function(g,m){return new h(g.row,g.column,m.row,m.column)},h.comparePoints=function(g,m){return g.row-m.row||g.column-m.column},n.Range=h}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(t,n,p){for(var h=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 d=String.fromCharCode(c+32);m["Key"+d.toUpperCase()]=c,g.PRINTABLE_KEYS[c]=d}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 a in g.FUNCTION_KEYS){var s=g.FUNCTION_KEYS[a].toLowerCase();g[s]=parseInt(a,10)}for(var a in g.PRINTABLE_KEYS){var s=g.PRINTABLE_KEYS[a].toLowerCase();g[s]=parseInt(a,10)}h.mixin(g,g.MODIFIER_KEYS),h.mixin(g,g.PRINTABLE_KEYS),h.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(f){return u&g.KEY_MODS[f]}).join("-")+"-"})(),g.KEY_MODS[0]="",g.KEY_MODS[-1]="input-",h.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 h=t("./keys"),g=t("./useragent"),m=null,c=0,d;function r(){d=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){return d={passive:!1},!0}})}catch{}}function o(){return d==null&&r(),d}function a(E,$,A){this.elem=E,this.type=$,this.callback=A}a.prototype.destroy=function(){i(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var s=n.addListener=function(E,$,A,S){E.addEventListener($,A,o()),S&&S.$toDestroy.push(new a(E,$,A))},i=n.removeListener=function(E,$,A){E.removeEventListener($,A,o())};n.stopEvent=function(E){return n.stopPropagation(E),n.preventDefault(E),!1},n.stopPropagation=function(E){E.stopPropagation&&E.stopPropagation()},n.preventDefault=function(E){E.preventDefault&&E.preventDefault()},n.getButton=function(E){return E.type=="dblclick"?0:E.type=="contextmenu"||g.isMac&&E.ctrlKey&&!E.altKey&&!E.shiftKey?2:E.button},n.capture=function(E,$,A){var S=E&&E.ownerDocument||document;function M(R){$&&$(R),A&&A(R),i(S,"mousemove",$),i(S,"mouseup",M),i(S,"dragstart",M)}return s(S,"mousemove",$),s(S,"mouseup",M),s(S,"dragstart",M),M},n.addMouseWheelListener=function(E,$,A){s(E,"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 T=15;S.wheelX=R*T,S.wheelY=L*T;break;case S.DOM_DELTA_PAGE:var D=150;S.wheelX=R*D,S.wheelY=L*D;break}$(S)},A)},n.addMultiMouseDownListener=function(E,$,A,S,M){var R=0,L,T,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 x=Math.abs(C.clientX-L)>5||Math.abs(C.clientY-T)>5;(!D||x)&&(R=1),D&&clearTimeout(D),D=setTimeout(function(){D=null},$[R-1]||600),R==1&&(L=C.clientX,T=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(E)||(E=[E]),E.forEach(function(C){s(C,"mousedown",v,M)})};function u(E){return 0|(E.ctrlKey?1:0)|(E.altKey?2:0)|(E.shiftKey?4:0)|(E.metaKey?8:0)}n.getModifierString=function(E){return h.KEY_MODS[u(E)]};function f(E,$,A){var S=u($);if(!A&&$.code&&(A=h.$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 h.MODIFIER_KEYS&&(A=-1),!(!S&&A===13&&$.location===3&&(E($,S,-A),$.defaultPrevented))){if(g.isChromeOS&&S&8){if(E($,S,A),$.defaultPrevented)return;S&=-9}return!S&&!(A in h.FUNCTION_KEYS)&&!(A in h.PRINTABLE_KEYS)?!1:E($,S,A)}}n.addCommandKeyListener=function(E,$,A){var S=null;s(E,"keydown",function(M){m[M.keyCode]=(m[M.keyCode]||0)+1;var R=f($,M,M.keyCode);return S=M.defaultPrevented,R},A),s(E,"keypress",function(M){S&&(M.ctrlKey||M.altKey||M.shiftKey||M.metaKey)&&(n.stopEvent(M),S=null)},A),s(E,"keyup",function(M){m[M.keyCode]=null},A),m||(y(),s(window,"focus",y))};function y(){m=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!g.isOldIE){var b=1;n.nextTick=function(E,$){$=$||window;var A="zero-timeout-message-"+b++,S=function(M){M.data==A&&(n.stopPropagation(M),i($,"message",S),E())};s($,"message",S),$.postMessage(A,"*")}}n.$idleBlocked=!1,n.onIdle=function(E,$){return setTimeout(function A(){n.$idleBlocked?setTimeout(A,100):E()},$)},n.$idleBlockId=null,n.blockIdle=function(E){n.$idleBlockId&&clearTimeout(n.$idleBlockId),n.$idleBlocked=!0,n.$idleBlockId=setTimeout(function(){n.$idleBlocked=!1},E||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(E){setTimeout(E,17)}}),ace.define("ace/clipboard",["require","exports","module"],function(t,n,p){var h;p.exports={lineMode:!1,pasteCancelled:function(){return h&&h>Date.now()-50?!0:h=!1},cancel:function(){h=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 h=t("../lib/event"),g=t("../config").nls,m=t("../lib/useragent"),c=t("../lib/dom"),d=t("../lib/lang"),r=t("../clipboard"),o=m.isChrome<18,a=m.isIE,s=m.isChrome>63,i=400,u=t("../lib/keys"),f=u.KEY_MODS,y=m.isIOS,b=y?/\s/:/\n/,E=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,T=!1,D=!1,w="";E||(M.style.fontSize="1px");var v=!1,C=!1,x="",_=0,k=0,O=0,I=Number.MAX_SAFE_INTEGER,N=Number.MIN_SAFE_INTEGER,P=0;try{var B=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 Z=S.session.selection.cursor.row;j+=g("text-input.aria-label","Cursor at row $0",[Z+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"}),h.addListener(M,"blur",function(j){C||(S.onBlur(j),B=!1)},S),h.addListener(M,"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}),w||s||this.$focusScroll=="browser")return M.focus({preventScroll:!0});var j=M.style.top;M.style.position="fixed",M.style.top="0px";try{var Z=M.getBoundingClientRect().top!=0}catch{return}var ee=[];if(Z)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}),Z&&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 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);T&&ee&&(x=M.value="",ft()),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
|
-
`;Z!=
|
|
1331
|
+
`;Z!=M.value&&(M.value=x=Z);var ee=4,re=4+(j.length||(S.selection.isEmpty()?0:1));(_!=ee||k!=re)&&M.setSelectionRange(ee,re),_=ee,k=re}}:function(){if(!(T||D)&&!(!B&&!K)){T=!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
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
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
|
|
1334
|
+
`+le}else E&&ge>0&&(ee=`
|
|
1335
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
|
|
1336
|
+
`,j==Z?j=Z=0:(j=0,Z=1)));var Te=ee+`
|
|
1337
1337
|
|
|
1338
|
-
`;
|
|
1339
|
-
`:ye},G=function(j){if(
|
|
1340
|
-
`?le=u.end:me<
|
|
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 Nt=Z.onCommandKey({},_e,le);if(!Nt&&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,f){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=p(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 p(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,f){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,f){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,p=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",p),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,f){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"),p=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+$),p.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})(p);n.GutterTooltip=s}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(t,n,f){var d=t("../lib/event"),g=t("../lib/useragent"),m=(function(){function c(p,r){this.speed,this.wheelX,this.wheelY,this.domEvent=p,this.editor=r,this.x=this.clientX=p.clientX,this.y=this.clientY=p.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 p=this.getDocumentPosition().row,r=this.editor.session.documentToScreenRow(p,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 p=this.editor,r=p.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,f){var d=t("../lib/dom"),g=t("../lib/event"),m=t("../lib/useragent"),c=200,p=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>=p&&(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,f){var d=t("./mouse_event").MouseEvent,g=t("../lib/event"),m=t("../lib/dom");n.addTouchListeners=function(c,p){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=p.getCopyText(),N=p.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 p.commands.canExecute(I,p)},O=function(I){var N=I.target.getAttribute("action");if(N=="more"||!M)return M=!M,T();N=="paste"?C.readText().then(function(P){p.execCommand(N,P)}):N&&((N=="cut"||N=="copy")&&(C?C.writeText(p.getCopyText()):document.execCommand("copy")),p.execCommand(N)),E.firstChild.style.display="none",M=!1,N!="openCommandPalette"&&p.focus()};E=m.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(I){r="menu",I.stopPropagation(),I.preventDefault(),p.textInput.focus()},ontouchend:function(I){I.stopPropagation(),I.preventDefault(),O(I)},onclick:O},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],p.container)}function L(){if(!p.getOption("enableMobileMenu")){E&&_();return}E||R();var C=p.selection.cursor,M=p.renderer.textToScreenCoordinates(C.row,C.column),T=p.renderer.textToScreenCoordinates(0,0).pageX,k=p.renderer.scrollLeft,O=p.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",p.on("input",_)}function _(C){E&&(E.style.display="none"),p.off("input",_)}function D(){u=null,clearTimeout(u);var C=p.selection.getRange(),M=C.contains(w.row,w.column);(C.isEmpty()||!M)&&(p.selection.moveToPosition(w),p.selection.selectWord()),r="wait",L()}function b(){u=null,clearTimeout(u),p.selection.moveToPosition(w);var C=x>=2?p.selection.getLineRange(w.row):p.session.getBracketRange(w);C&&!C.isEmpty()?p.selection.setRange(C):p.selection.selectWord(),r="wait"}g.addListener(c,"contextmenu",function(C){if(S){var M=p.textInput.getElement();M.focus()}},p),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=p.$mouseHandler.isMousePressed=!0;var T=p.renderer.layerConfig.lineHeight,k=p.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,p);if(w=B.getDocumentPosition(),O-a<500&&M.length==1&&!y)x++,C.preventDefault(),C.button=0,b();else{x=0;var F=p.selection.cursor,H=p.selection.isEmpty()?F:p.selection.anchor,z=p.renderer.$cursorLayer.getPixelPosition(F,!0),W=p.renderer.$cursorLayer.getPixelPosition(H,!0),U=p.renderer.scroller.getBoundingClientRect(),K=p.renderer.layerConfig.offset,Y=p.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},p),g.addListener(c,"touchend",function(C){S=p.$mouseHandler.isMousePressed=!1,h&&clearInterval(h),r=="zoom"?(r="",y=0):u?(p.selection.moveToPosition(w),y=0,L()):r=="scroll"?(v(),_()):L(),clearTimeout(u),u=null},p),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,p);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),p._emit("mousewheel",P),P.propagationStopped||($=A=0)}else{var B=new d(C,p),F=B.getDocumentPosition();r=="cursor"?p.selection.moveCursorToPosition(F):r=="anchor"&&p.selection.setSelectionAnchor(F.row,F.column),p.renderer.scrollCursorIntoView(F),C.preventDefault()}}},p);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=p.session.getScrollTop();p.renderer.scrollBy(10*$,10*A),C==p.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,f){var d=t("../lib/event"),g=t("../lib/useragent"),m=t("./default_handlers").DefaultHandlers,c=t("./default_gutter_handler").GutterHandler,p=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 p(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 p(h,this.editor))},i.prototype.onMouseWheel=function(u,h){var y=new p(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 p(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,f){var d=t("../lib/dom"),g=(function(){function m(c){c.on("click",function(p){var r=p.getDocumentPosition(),o=c.session,s=o.getFoldAt(r.row,r.column,1);s&&(p.getAccelKey()?o.removeFold(s):o.expandFold(s),p.stop());var a=p.domEvent&&p.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(p){var r=c.renderer.$gutterLayer.getRegion(p);if(r=="foldWidgets"){var o=p.getDocumentPosition().row,s=c.session;s.foldWidgets&&s.foldWidgets[o]&&c.session.onFoldWidgetClick(o,p),c.isFocused()||c.focus(),p.stop()}}),c.on("gutterdblclick",function(p){var r=c.renderer.$gutterLayer.getRegion(p);if(r=="foldWidgets"){var o=p.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}))}p.stop()}})}return m})();n.FoldHandler=g}),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],function(t,n,f){var d=t("../lib/keys"),g=t("../lib/event"),m=(function(){function c(p){this.$editor=p,this.$data={editor:p},this.$handlers=[],this.setDefaultHandler(p.commands)}return c.prototype.setDefaultHandler=function(p){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=p,this.addKeyboardHandler(p,0)},c.prototype.setKeyboardHandler=function(p){var r=this.$handlers;if(r[r.length-1]!=p){for(;r[r.length-1]&&r[r.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(r[r.length-1]);this.addKeyboardHandler(p,1)}},c.prototype.addKeyboardHandler=function(p,r){if(p){typeof p=="function"&&!p.handleKeyboard&&(p.handleKeyboard=p);var o=this.$handlers.indexOf(p);o!=-1&&this.$handlers.splice(o,1),r==null?this.$handlers.push(p):this.$handlers.splice(r,0,p),o==-1&&p.attach&&p.attach(this.$editor)}},c.prototype.removeKeyboardHandler=function(p){var r=this.$handlers.indexOf(p);return r==-1?!1:(this.$handlers.splice(r,1),p.detach&&p.detach(this.$editor),!0)},c.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},c.prototype.getStatusText=function(){var p=this.$data,r=p.editor;return this.$handlers.map(function(o){return o.getStatusText&&o.getStatusText(r,p)||""}).filter(Boolean).join(" ")},c.prototype.$callKeyboardHandlers=function(p,r,o,s){for(var a,i=!1,u=this.$editor.commands,h=this.$handlers.length;h--&&(a=this.$handlers[h].handleKeyboard(this.$data,p,r,o,s),!(!(!a||!a.command)&&(a.command=="null"?i=!0:i=u.exec(a.command,this.$editor,a.args,s),i&&s&&p!=-1&&a.passEvent!=!0&&a.command.passEvent!=!0&&g.stopEvent(s),i))););return!i&&p==-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(p,r,o){var s=d.keyCodeToString(o);return this.$callKeyboardHandlers(r,s,o,p)},c.prototype.onTextInput=function(p){return this.$callKeyboardHandlers(-1,p)},c})();n.KeyBinding=m}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(t,n,f){var d=0,g=0,m=!1,c=!1,p=!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,p=!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(p){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 p=!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,f){var d=t("./lib/bidiutil"),g=t("./lib/lang"),m=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,c=(function(){function p(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 p.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},p.prototype.onChange=function(r){this.seenBidi?this.currentRow=null:r.action=="insert"&&m.test(r.lines.join(`
|
|
1342
|
-
`))&&(this.seenBidi=!0,this.currentRow=null)},p.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},p.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},p.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)},p.prototype.updateBidiMap=function(){var r=[];d.hasBidiCharacters(this.line,r)||this.isRtlDir?this.bidiMap=d.doBidiReorder(this.line,r,this.isRtlDir):this.bidiMap={}},p.prototype.markAsDirty=function(){this.currentRow=null},p.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}},p.prototype.setShowInvisibles=function(r){this.showInvisibles=r,this.currentRow=null},p.prototype.setEolChar=function(r){this.EOL=r},p.prototype.setContentWidth=function(r){this.contentWidth=r},p.prototype.isRtlLine=function(r){return this.$isRtl?!0:r!=null?this.session.getLine(r).charAt(0)==this.RLE:this.isRtlDir},p.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)},p.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},p.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},p.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},p})();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,f){var d=t("./lib/oop"),g=t("./lib/lang"),m=t("./lib/event_emitter").EventEmitter,c=t("./range").Range,p=(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})();p.prototype.setSelectionAnchor=p.prototype.setAnchor,p.prototype.getSelectionAnchor=p.prototype.getAnchor,p.prototype.setSelectionRange=p.prototype.setRange,d.implement(p.prototype,m),n.Selection=p}),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(t,n,f){var d=t("./lib/report_error").reportError,g=2e3,m=(function(){function c(p){this.splitRegex,this.states=p,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(p){g=p|0},c.prototype.$applyToken=function(p){var r=this.splitRegex.exec(p).slice(1),o=this.token.apply(this,r);if(typeof o=="string")return[{type:o,value:p}];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(p){if(!p)return[];var r=this.splitRegex.exec(p);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(p){var r=p.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,function(o,s){return s?"(?:":o});return r},c.prototype.createSplitterRegexp=function(p,r){if(p.indexOf("(?=")!=-1){var o=0,s=!1,a={};p.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(p.substr(a.end))&&(p=p.substring(0,a.start)+p.substr(a.end))}return p.charAt(0)!="^"&&(p="^"+p),p.charAt(p.length-1)!="$"&&(p+="$"),new RegExp(p,(r||"").replace("g",""))},c.prototype.getLineTokens=function(p,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(p);){var A=i.defaultToken,S=null,E=h[0],R=u.lastIndex;if(R-E.length>w){var L=p.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,p):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==p.length)break;if(w=R,x++>g){for(x>2*p.length&&this.reportError("infinite loop with in ace tokenizer",{startState:r,line:p});w<p.length;)$.type&&y.push($),$={value:p.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,f){var d=t("../lib/deep_copy").deepCopy,g;g=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}},(function(){this.addRules=function(p,r){if(!r){for(var o in p)this.$rules[o]=p[o];return}for(var o in p){for(var s=p[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(p,r,o,s,a){var i=typeof p=="function"?new p().getRules():p;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(p,r){return(p!="start"||r.length)&&r.unshift(this.nextState,p),this.nextState},c=function(p,r){return r.shift(),r.shift()||"start"};this.normalizeRules=function(){var p=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+=p++)),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(p,r,o,s){var a=Object.create(null);return this.$keywordList=[],Object.keys(p).forEach(function(i){for(var u=p[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),p=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,f){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,f){var d=t("./range").Range,g=(function(){function m(c,p,r){this.$session=c,this.$row=p,this.$rowTokens=c.getTokens(p);var o=c.getTokenAt(p,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,p=this.$tokenIndex,r=c[p].start;if(r!==void 0)return r;for(r=0;p>0;)p-=1,r+=c[p].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],p=this.getCurrentTokenColumn();return new d(this.$row,p,this.$row,p+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,f){var d=t("../../lib/oop"),g=t("../behaviour").Behaviour,m=t("../../token_iterator").TokenIterator,c=t("../../lib/lang"),p=["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==`
|
|
1338
|
+
`;Te!=x&&(M.value=x=Te,_=k=Te.length)}if(K&&(_=M.selectionStart,k=M.selectionEnd),k!=Z||_!=j||M.selectionEnd!=k)try{M.setSelectionRange(j,Z),_=j,k=Z}catch{}T=!1}};this.resetSelection=H,B&&S.onFocus();var z=function(j){return j.selectionStart===0&&j.selectionEnd>=x.length&&j.value===x&&x&&j.selectionEnd!==k},W=function(j){T||(R?R=!1:z(M)?(S.selectAll(),H()):E&&M.selectionStart!=_&&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=M.selectionStart,re=M.selectionEnd,ae=_,ge=x.length-k,ye=j,me=j.length-ee,de=j.length-re,le=0;ae>0&&x[le]==j[le];)le++,ae--;for(ye=ye.slice(le),le=1;ge>0&&x.length-le>_-1&&x[x.length-le]==j[j.length-le];)le++,ge--;me-=le-1,de-=le-1;var Te=ye.length-le+1;if(Te<0&&(ae=-Te,Te=0),ye=ye.slice(0,Te),!Z&&!ye&&!me&&!ae&&!ge&&!de)return"";D=!0;var Wt=!1;return m.isAndroid&&ye==". "&&(ye=" ",Wt=!0),ye&&!ae&&!ge&&!me&&!de||v?S.onTextInput(ye):S.onTextInput(ye,{extendLeft:ae,extendRight:ge,restoreStart:me,restoreEnd:de}),D=!1,x=j,_=ee,k=re,O=de,Wt?`
|
|
1339
|
+
`:ye},G=function(j){if(T)return dt();if(j&&j.inputType){if(j.inputType=="historyUndo")return S.execCommand("undo");if(j.inputType=="historyRedo")return S.execCommand("redo")}var Z=M.value,ee=Y(Z,!0);(Z.length>i+100||b.test(ee)||E&&_<1&&_==k)&&H()},Q=function(j,Z,ee){var re=j.clipboardData||window.clipboardData;if(!(!re||o)){var ae=a||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 h.preventDefault(j);Q(j,ee)?(y&&(H(ee),R=ee,setTimeout(function(){R=!1},10)),Z?S.onCut():S.onCopy(),h.preventDefault(j)):(R=!0,M.value=ee,M.select(),setTimeout(function(){R=!1,H(),Z?S.onCut():S.onCopy()}))},Me=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),h.preventDefault(j)):(M.value="",L=!0))};h.addCommandKeyListener(M,function(j,Z,ee){if(!T)return S.onCommandKey(j,Z,ee)},S),h.addListener(M,"select",W,S),h.addListener(M,"input",G,S),h.addListener(M,"cut",Me,S),h.addListener(M,"copy",Ce,S),h.addListener(M,"paste",he,S),(!("oncut"in M)||!("oncopy"in M)||!("onpaste"in M))&&h.addListener(A,"keydown",function(j){if(!(m.isMac&&!j.metaKey||!j.ctrlKey))switch(j.keyCode){case 67:Ce(j);break;case 86:he(j);break;case 88:Me(j);break}},S);var De=function(j){if(!(T||!S.onCompositionStart||S.$readOnly)&&(T={},!v)){j.data&&(T.useTextareaForIME=!1),setTimeout(dt,0),S._signal("compositionStart"),S.on("mousedown",ti);var Z=S.getSelectionRange();Z.end.row=Z.start.row,Z.end.column=Z.start.column,T.markerRange=Z,T.selectionStart=_,S.onCompositionStart(T),T.useTextareaForIME?(x=M.value="",_=0,k=0):(M.msGetInputContext&&(T.context=M.msGetInputContext()),M.getInputContext&&(T.context=M.getInputContext()))}},dt=function(){if(!(!T||!S.onCompositionUpdate||S.$readOnly)){if(v)return ti();if(T.useTextareaForIME)S.onCompositionUpdate(M.value);else{var j=M.value;Y(j),T.markerRange&&(T.context&&(T.markerRange.start.column=T.selectionStart=T.context.compositionStartOffset),T.markerRange.end.column=T.markerRange.start.column+k-T.selectionStart+O)}}},ft=function(j){!S.onCompositionEnd||S.$readOnly||(T=!1,S.onCompositionEnd(),S.off("mousedown",ti),j&&G())};function ti(){C=!0,M.blur(),M.focus(),C=!1}var pa=d.delayedCall(dt,50).schedule.bind(null,null);function dd(j){j.keyCode==27&&M.value.length<M.selectionStart&&(T||(x=M.value),_=k=-1,H()),pa()}h.addListener(M,"compositionstart",De,S),h.addListener(M,"compositionupdate",dt,S),h.addListener(M,"keyup",dd,S),h.addListener(M,"keydown",pa,S),h.addListener(M,"compositionend",ft,S),this.getElement=function(){return M},this.setCommandMode=function(j){v=j,M.readOnly=!1},this.setReadOnly=function(j){v||(M.readOnly=j)},this.setCopyWithEmptySelection=function(j){},this.onContextMenu=function(j){K=!0,H(),S._emit("nativecontextmenu",{target:S,domEvent:j}),this.moveToMouse(j,!0)},this.moveToMouse=function(j,Z){w||(w=M.style.cssText),M.style.cssText=(Z?"z-index:100000;":"")+(m.isIE?"opacity:0.1;":"")+"text-indent: -"+(_+k)*S.renderer.characterWidth*.5+"px;";var ee=S.container.getBoundingClientRect(),re=c.computedStyle(S.container),ae=ee.top+(parseInt(re.borderTopWidth)||0),ge=ee.left+(parseInt(ee.borderLeftWidth)||0),ye=ee.bottom-ae-M.clientHeight-2,me=function(de){c.translate(M,de.clientX-ge-2,Math.min(de.clientY-ae-2,ye))};me(j),j.type=="mousedown"&&(S.renderer.$isMousePressed=!0,clearTimeout(ni),m.isWin&&h.capture(S.container,me,hn))},this.onContextMenuClose=hn;var ni;function hn(){clearTimeout(ni),ni=setTimeout(function(){w&&(M.style.cssText=w,w=""),S.renderer.$isMousePressed=!1,S.renderer.$keepTextAreaAtCursor&&S.renderer.$moveTextAreaToCursor()},0)}var ii=function(j){S.textInput.onContextMenu(j),hn()};h.addListener(M,"mouseup",ii,S),h.addListener(M,"mousedown",function(j){j.preventDefault(),hn()},S),h.addListener(S.renderer.scroller,"contextmenu",ii,S),h.addListener(M,"contextmenu",ii,S),y&&fd(A,S,M);function fd(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||T||Z.$mouseHandler.isMousePressed)&&!R){var me=ee.selectionStart,de=ee.selectionEnd,le=null,Te=0;if(me==0?le=u.up:me==1?le=u.home:de>k&&x[de]==`
|
|
1340
|
+
`?le=u.end:me<_&&x[me-1]==" "?(le=u.left,Te=f.option):me<_||me==_&&k!=_&&me==de?le=u.left:de>k&&x.slice(0,de).split(`
|
|
1341
|
+
`).length>2?le=u.down:de>k&&x[de-1]==" "?(le=u.right,Te=f.option):(de>k||de==k&&k!=_&&me==de)&&(le=u.right),me!==de&&(Te|=f.shift),le){var Wt=Z.onCommandKey({},Te,le);if(!Wt&&Z.commands){le=u.keyCodeToString(le);var ga=Z.commands.findKeyCommand(Te,le);ga&&Z.execCommand(ga)}_=me,k=de,H("")}}};document.addEventListener("selectionchange",ge),Z.on("destroy",function(){document.removeEventListener("selectionchange",ge)})}this.destroy=function(){M.parentElement&&M.parentElement.removeChild(M)}},n.TextInput=$,n.$setUserAgentForTests=function(A,S){E=A,y=S}}),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],function(t,n,p){var h=t("../lib/useragent"),g=0,m=550,c=(function(){function o(a){a.$clickSelection=null;var s=a.editor;s.setDefaultHandler("mousedown",this.onMouseDown.bind(a)),s.setDefaultHandler("dblclick",this.onDoubleClick.bind(a)),s.setDefaultHandler("tripleclick",this.onTripleClick.bind(a)),s.setDefaultHandler("quadclick",this.onQuadClick.bind(a)),s.setDefaultHandler("mousewheel",this.onMouseWheel.bind(a));var i=["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"];i.forEach(function(u){a[u]=this[u]},this),a.selectByLines=this.extendSelectionBy.bind(a,"getLineRange"),a.selectByWords=this.extendSelectionBy.bind(a,"getWordRange")}return o.prototype.onMouseDown=function(a){var s=a.inSelection(),i=a.getDocumentPosition();this.mousedownEvent=a;var u=this.editor,f=a.getButton();if(f!==0){var y=u.getSelectionRange(),b=y.isEmpty();(b||f==1)&&u.selection.moveToPosition(i),f==2&&(u.textInput.onContextMenu(a.domEvent),h.isMozilla||a.preventDefault());return}if(this.mousedownEvent.time=Date.now(),s&&!u.isFocused()&&(u.focus(),this.$focusTimeout&&!this.$clickSelection&&!u.inMultiSelectMode)){this.setState("focusWait"),this.captureMouse(a);return}return this.captureMouse(a),this.startSelect(i,a.domEvent._clicks>1),a.preventDefault()},o.prototype.startSelect=function(a,s){a=a||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var i=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?i.selection.selectToPosition(a):s||i.selection.moveToPosition(a),s||this.select(),i.setStyle("ace_selecting"),this.setState("select"))},o.prototype.select=function(){var a,s=this.editor,i=s.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var u=this.$clickSelection.comparePoint(i);if(u==-1)a=this.$clickSelection.end;else if(u==1)a=this.$clickSelection.start;else{var f=r(this.$clickSelection,i);i=f.cursor,a=f.anchor}s.selection.setSelectionAnchor(a.row,a.column)}s.selection.selectToPosition(i),s.renderer.scrollCursorIntoView()},o.prototype.extendSelectionBy=function(a){var s,i=this.editor,u=i.renderer.screenToTextCoordinates(this.x,this.y),f=i.selection[a](u.row,u.column);if(this.$clickSelection){var y=this.$clickSelection.comparePoint(f.start),b=this.$clickSelection.comparePoint(f.end);if(y==-1&&b<=0)s=this.$clickSelection.end,(f.end.row!=u.row||f.end.column!=u.column)&&(u=f.start);else if(b==1&&y>=0)s=this.$clickSelection.start,(f.start.row!=u.row||f.start.column!=u.column)&&(u=f.end);else if(y==-1&&b==1)u=f.end,s=f.start;else{var E=r(this.$clickSelection,u);u=E.cursor,s=E.anchor}i.selection.setSelectionAnchor(s.row,s.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 a=d(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),s=Date.now();(a>g||s-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},o.prototype.onDoubleClick=function(a){var s=a.getDocumentPosition(),i=this.editor,u=i.session,f=u.getBracketRange(s);f?(f.isEmpty()&&(f.start.column--,f.end.column++),this.setState("select")):(f=i.selection.getWordRange(s.row,s.column),this.setState("selectByWords")),this.$clickSelection=f,this.select()},o.prototype.onTripleClick=function(a){var s=a.getDocumentPosition(),i=this.editor;this.setState("selectByLines");var u=i.getSelectionRange();u.isMultiLine()&&u.contains(s.row,s.column)?(this.$clickSelection=i.selection.getLineRange(u.start.row),this.$clickSelection.end=i.selection.getLineRange(u.end.row).end):this.$clickSelection=i.selection.getLineRange(s.row),this.select()},o.prototype.onQuadClick=function(a){var s=this.editor;s.selectAll(),this.$clickSelection=s.getSelectionRange(),this.setState("selectAll")},o.prototype.onMouseWheel=function(a){if(!a.getAccelKey()){a.getShiftKey()&&a.wheelY&&!a.wheelX&&(a.wheelX=a.wheelY,a.wheelY=0);var s=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var i=this.$lastScroll,u=a.domEvent.timeStamp,f=u-i.t,y=f?a.wheelX/f:i.vx,b=f?a.wheelY/f:i.vy;f<m&&(y=(y+i.vx)/2,b=(b+i.vy)/2);var E=Math.abs(y/b),$=!1;if(E>=1&&s.renderer.isScrollableBy(a.wheelX*a.speed,0)&&($=!0),E<=1&&s.renderer.isScrollableBy(0,a.wheelY*a.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 s.renderer.scrollBy(a.wheelX*a.speed,a.wheelY*a.speed),a.stop()}},o})();c.prototype.selectEnd=c.prototype.selectByLinesEnd,c.prototype.selectAllEnd=c.prototype.selectByLinesEnd,c.prototype.selectByWordsEnd=c.prototype.selectByLinesEnd,n.DefaultHandlers=c;function d(o,a,s,i){return Math.sqrt(Math.pow(s-o,2)+Math.pow(i-a,2))}function r(o,a){if(o.start.row==o.end.row)var s=2*a.column-o.start.column-o.end.column;else if(o.start.row==o.end.row-1&&!o.start.column&&!o.end.column)var s=a.column-4;else var s=2*a.row-o.start.row-o.end.row;return s<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 h=this&&this.__extends||(function(){var u=function(f,y){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,E){b.__proto__=E}||function(b,E){for(var $ in E)Object.prototype.hasOwnProperty.call(E,$)&&(b[$]=E[$])},u(f,y)};return function(f,y){if(typeof y!="function"&&y!==null)throw new TypeError("Class extends value "+String(y)+" is not a constructor or null");u(f,y);function b(){this.constructor=f}f.prototype=y===null?Object.create(y):(b.prototype=y.prototype,new b)}})(),g=this&&this.__values||function(u){var f=typeof Symbol=="function"&&Symbol.iterator,y=f&&u[f],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(f?"Object is not iterable.":"Symbol.iterator is not defined.")},m=t("./lib/dom");t("./lib/event");var c=t("./range").Range,d=t("./lib/scroll").preventParentScroll,r="ace_tooltip",o=(function(){function u(f){this.isOpen=!1,this.$element=null,this.$parentNode=f}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(f){this.getElement().textContent=f},u.prototype.setHtml=function(f){this.getElement().innerHTML=f},u.prototype.setPosition=function(f,y){this.getElement().style.left=f+"px",this.getElement().style.top=y+"px"},u.prototype.setClassName=function(f){m.addCssClass(this.getElement(),f)},u.prototype.setTheme=function(f){this.$element.className=r+" "+(f.isDark?"ace_dark ":"")+(f.cssClass||"")},u.prototype.show=function(f,y,b){f!=null&&this.setText(f),y!=null&&b!=null&&this.setPosition(y,b),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},u.prototype.hide=function(f){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})(),a=(function(){function u(){this.popups=[]}return u.prototype.addPopup=function(f){this.popups.push(f),this.updatePopups()},u.prototype.removePopup=function(f){var y=this.popups.indexOf(f);y!==-1&&(this.popups.splice(y,1),this.updatePopups())},u.prototype.updatePopups=function(){var f,y,b,E;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($)),T=L.next();!T.done;T=L.next()){var D=T.value;if(this.doPopupsOverlap(D,M)){R=!1;break}}}catch(w){b={error:w}}finally{try{T&&!T.done&&(E=L.return)&&E.call(L)}finally{if(b)throw b.error}}R?$.push(M):M.hide()}}catch(w){f={error:w}}finally{try{S&&!S.done&&(y=A.return)&&y.call(A)}finally{if(f)throw f.error}}},u.prototype.doPopupsOverlap=function(f,y){var b=f.getElement().getBoundingClientRect(),E=y.getElement().getBoundingClientRect();return b.left<E.right&&b.right>E.left&&b.top<E.bottom&&b.bottom>E.top},u})(),s=new a;n.popupManager=s,n.Tooltip=o;var i=(function(u){h(f,u);function f(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 E=b.getElement();return E.style.whiteSpace="pre-wrap",E.style.pointerEvents="auto",E.addEventListener("mouseout",b.onMouseOut),E.tabIndex=-1,E.addEventListener("blur",(function(){E.contains(document.activeElement)||this.hide()}).bind(b)),E.addEventListener("wheel",d),b}return f.prototype.addToEditor=function(y){y.on("mousemove",this.onMouseMove),y.on("mousedown",this.hide),y.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},f.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)},f.prototype.onMouseMove=function(y,b){this.lastEvent=y,this.lastT=Date.now();var E=b.$mouseHandler.isMousePressed;if(this.isOpen){var $=this.lastEvent&&this.lastEvent.getDocumentPosition();(!this.range||!this.range.contains($.row,$.column)||E||this.isOutsideOfText(this.lastEvent))&&this.hide()}this.timeout||E||(this.lastEvent=y,this.timeout=setTimeout(this.waitForHover,this.idleTime))},f.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)},f.prototype.isOutsideOfText=function(y){var b=y.editor,E=y.getDocumentPosition(),$=b.session.getLine(E.row);if(E.column==$.length){var A=b.renderer.pixelToScreenCoordinates(y.clientX,y.clientY),S=b.session.documentToScreenPosition(E.row,E.column);if(S.column!=A.column||S.row!=A.row)return!0}return!1},f.prototype.setDataProvider=function(y){this.$gatherData=y},f.prototype.showForRange=function(y,b,E,$){var A=10;if(!($&&$!=this.lastEvent)&&!(this.isOpen&&document.activeElement==this.getElement())){var S=y.renderer;this.isOpen||(s.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(E),L.style.maxHeight="",L.style.display="block";var T=L.clientHeight,D=L.clientWidth,w=window.innerHeight-M.pageY-S.lineHeight,v=!0;M.pageY-T<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"}},f.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")},f.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,s.removePopup(this)))},f.prototype.$registerCloseEvents=function(){window.addEventListener("keydown",this.hide,!0),window.addEventListener("wheel",this.hide,!0),window.addEventListener("mousedown",this.hide,!0)},f.prototype.$removeCloseEvents=function(){window.removeEventListener("keydown",this.hide,!0),window.removeEventListener("wheel",this.hide,!0),window.removeEventListener("mousedown",this.hide,!0)},f.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())},f})(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 h=this&&this.__extends||(function(){var s=function(i,u){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,y){f.__proto__=y}||function(f,y){for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(f[b]=y[b])},s(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");s(i,u);function f(){this.constructor=i}i.prototype=u===null?Object.create(u):(f.prototype=u.prototype,new f)}})(),g=this&&this.__values||function(s){var i=typeof Symbol=="function"&&Symbol.iterator,u=i&&s[i],f=0;if(u)return u.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&f>=s.length&&(s=void 0),{value:s&&s[f++],done:!s}}};throw new TypeError(i?"Object is not iterable.":"Symbol.iterator is not defined.")},m=t("../lib/dom"),c=t("../lib/event"),d=t("../tooltip").Tooltip,r=t("../config").nls;t("../lib/lang");function o(s){var i=s.editor,u=i.renderer.$gutterLayer,f=new a(i);s.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();s.$clickSelection=i.selection.getLineRange(R)}return s.setState("selectByLines"),s.captureMouse(S),S.preventDefault()}}});var y,b;function E(){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(f.showTooltip(S),!!f.isOpen)if(i.on("mousewheel",$),s.$tooltipFollowsMouse)A(b);else{var T=b.getGutterRow(),D=u.$lines.get(T);if(D){var w=D.element.querySelector(".ace_gutter_annotation"),v=w.getBoundingClientRect(),C=f.getElement().style;C.left=v.right+"px",C.top=v.bottom+"px"}else A(b)}}function $(){y&&(y=clearTimeout(y)),f.isOpen&&(f.hideTooltip(),i.off("mousewheel",$))}function A(S){f.setPosition(S.x,S.y)}s.editor.setDefaultHandler("guttermousemove",function(S){var M=S.domEvent.target||S.domEvent.srcElement;if(m.hasCssClass(M,"ace_fold-widget"))return $();f.isOpen&&s.$tooltipFollowsMouse&&A(S),b=S,!y&&(y=setTimeout(function(){y=null,b&&!s.isMousePressed?E():$()},50))}),c.addListener(i.renderer.$gutter,"mouseout",function(S){b=null,!(!f.isOpen||y)&&(y=setTimeout(function(){y=null,$()},50))},i),i.on("changeSession",$),i.on("input",$)}n.GutterHandler=o;var a=(function(s){h(i,s);function i(u){var f=s.call(this,u.container)||this;return f.editor=u,f}return i.prototype.setPosition=function(u,f){var y=window.innerWidth||document.documentElement.clientWidth,b=window.innerHeight||document.documentElement.clientHeight,E=this.getWidth(),$=this.getHeight();u+=15,f+=15,u+E>y&&(u-=u+E-y),f+$>b&&(f-=20+$),d.prototype.setPosition.call(this,u,f)},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 f,y=this.editor.renderer.$gutterLayer,b=y.$annotations[u],E;b?E={displayText:Array.from(b.displayText),type:Array.from(b.type)}:E={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 T=y.$annotations[R].type[L];A[T].push(y.$annotations[R].text[L]),(!M||S[T]<S[M])&&(M=T)}if(["error","security","warning"].includes(M)){var D="".concat(i.annotationsToSummaryString(A)," in folded code.");E.displayText.push(D),E.type.push(M+"_fold")}}if(E.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<E.displayText.length;R++){var C=m.createElement("span"),x=m.createElement("span");(f=x.classList).add.apply(f,["ace_".concat(E.type[R]),v]),x.setAttribute("aria-label","".concat(i.annotationLabels[E.type[R].replace("_fold","")].singular)),x.setAttribute("role","img"),x.appendChild(m.createTextNode(" ")),C.appendChild(x),C.appendChild(m.createTextNode(E.displayText[R])),C.appendChild(m.createElement("br")),w[E.type[R].replace("_fold","")].push(C)}var _=this.getElement();m.removeChildren(_),w.error.forEach(function(k){return _.appendChild(k)}),w.security.forEach(function(k){return _.appendChild(k)}),w.warning.forEach(function(k){return _.appendChild(k)}),w.info.forEach(function(k){return _.appendChild(k)}),w.hint.forEach(function(k){return _.appendChild(k)}),_.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 f,y,b=[],E=["error","security","warning","info","hint"];try{for(var $=g(E),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){f={error:R}}finally{try{A&&!A.done&&(y=$.return)&&y.call($)}finally{if(f)throw f.error}}return b.join(", ")},i})(d);n.GutterTooltip=a}),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],function(t,n,p){var h=t("../lib/event"),g=t("../lib/useragent"),m=(function(){function c(d,r){this.speed,this.wheelX,this.wheelY,this.domEvent=d,this.editor=r,this.x=this.clientX=d.clientX,this.y=this.clientY=d.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return c.prototype.stopPropagation=function(){h.stopPropagation(this.domEvent),this.propagationStopped=!0},c.prototype.preventDefault=function(){h.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 d=this.getDocumentPosition().row,r=this.editor.session.documentToScreenRow(d,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 d=this.editor,r=d.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 h.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 h=t("../lib/dom"),g=t("../lib/event"),m=t("../lib/useragent"),c=200,d=200,r=5;function o(s){var i=s.editor,u=h.createElement("div");u.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",u.textContent=" ";var f=["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"];f.forEach(function(F){s[F]=this[F]},this),i.on("mousedown",this.onMouseDown.bind(s));var y=i.container,b,E,$,A,S,M,R=0,L,T,D,w,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()),T=!0,this.setState("drag")},this.onDragEnd=function(F){if(y.draggable=!1,T=!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 E=F.clientX,$=F.clientY,b||k(),R++,F.dataTransfer.dropEffect=L=B(F),g.preventDefault(F)},this.onDragOver=function(F){if(!(i.getReadOnly()||!P(F.dataTransfer)))return E=F.clientX,$=F.clientY,b||(k(),R++),I!==null&&(I=null),F.dataTransfer.dropEffect=L=B(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 H=F.dataTransfer;if(T)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 z=H.getData("Text");S={start:M,end:i.session.insert(M,z)},i.focus(),L=null}return O(),g.preventDefault(F)}},g.addListener(y,"dragstart",this.onDragStart.bind(s),i),g.addListener(y,"dragend",this.onDragEnd.bind(s),i),g.addListener(y,"dragenter",this.onDragEnter.bind(s),i),g.addListener(y,"dragover",this.onDragOver.bind(s),i),g.addListener(y,"dragleave",this.onDragLeave.bind(s),i),g.addListener(y,"drop",this.onDrop.bind(s),i);function C(F,H){var z=Date.now(),W=!H||F.row!=H.row,U=!H||F.column!=H.column;if(!w||W||U)i.moveCursorToPosition(F),w=z,v={x:E,y:$};else{var K=a(v.x,v.y,E,$);K>r?w=null:z-w>=d&&(i.renderer.scrollCursorIntoView(),w=null)}}function x(F,H){var z=Date.now(),W=i.renderer.layerConfig.lineHeight,U=i.renderer.layerConfig.characterWidth,K=i.renderer.scroller.getBoundingClientRect(),Y={x:{left:E-K.left,right:K.right-E},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 Me=F.row!=ue.row,Ce=F.column!=ue.column,he=!H||F.row!=H.row;Me||Ce&&!he?D?z-D>=c&&i.renderer.scrollCursorIntoView(ue):D=z:D=null}function _(){var F=M;M=i.renderer.screenToTextCoordinates(E,$),C(M,F),x(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),_(),A=setInterval(_,20),R=0,g.addListener(document,"mousemove",N)}function O(){clearInterval(A),i.session.removeMarker(b),b=null,i.selection.fromOrientedRange(S),i.isFocused()&&!T&&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 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 s=Date.now()-this.mousedownEvent.time;s>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){var s=this.editor.container;s.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(s){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var s=this.editor,i=s.container;i.draggable=!0,s.renderer.$cursorLayer.setBlinking(!1),s.setStyle("ace_dragging");var u=m.isWin?"default":"move";s.renderer.setCursorStyle(u),this.setState("dragReady")},this.onMouseDrag=function(s){var i=this.editor.container;if(m.isIE&&this.state=="dragReady"){var u=a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);u>3&&i.dragDrop()}if(this.state==="dragWait"){var u=a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);u>0&&(i.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(s){if(this.$dragEnabled){this.mousedownEvent=s;var i=this.editor,u=s.inSelection(),f=s.getButton(),y=s.domEvent.detail||1;if(y===1&&f===0&&u){if(s.editor.inMultiSelectMode&&(s.getAccelKey()||s.getShiftKey()))return;this.mousedownEvent.time=Date.now();var b=s.domEvent.target||s.domEvent.srcElement;if("unselectable"in b&&(b.unselectable="on"),i.getDragDelay()){if(m.isWebKit){this.cancelDrag=!0;var E=i.container;E.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(s,this.onMouseDrag.bind(this)),s.defaultPrevented=!0}}}}).call(o.prototype);function a(s,i,u,f){return Math.sqrt(Math.pow(u-s,2)+Math.pow(f-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 h=t("./mouse_event").MouseEvent,g=t("../lib/event"),m=t("../lib/dom");n.addTouchListeners=function(c,d){var r="scroll",o,a,s,i,u,f,y=0,b,E=0,$=0,A=0,S,M;function R(){var C=window.navigator&&window.navigator.clipboard,x=!1,_=function(){var I=d.getCopyText(),N=d.session.getUndoManager().hasUndo();M.replaceChild(m.buildDom(x?["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 d.commands.canExecute(I,d)},O=function(I){var N=I.target.getAttribute("action");if(N=="more"||!x)return x=!x,_();N=="paste"?C.readText().then(function(P){d.execCommand(N,P)}):N&&((N=="cut"||N=="copy")&&(C?C.writeText(d.getCopyText()):document.execCommand("copy")),d.execCommand(N)),M.firstChild.style.display="none",x=!1,N!="openCommandPalette"&&d.focus()};M=m.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(I){r="menu",I.stopPropagation(),I.preventDefault(),d.textInput.focus()},ontouchend:function(I){I.stopPropagation(),I.preventDefault(),O(I)},onclick:O},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],d.container)}function L(){if(!d.getOption("enableMobileMenu")){M&&T();return}M||R();var C=d.selection.cursor,x=d.renderer.textToScreenCoordinates(C.row,C.column),_=d.renderer.textToScreenCoordinates(0,0).pageX,k=d.renderer.scrollLeft,O=d.container.getBoundingClientRect();M.style.top=x.pageY-O.top-3+"px",x.pageX-O.left<O.width-70?(M.style.left="",M.style.right="10px"):(M.style.right="",M.style.left=_+k-O.left+"px"),M.style.display="",M.firstChild.style.display="none",d.on("input",T)}function T(C){M&&(M.style.display="none"),d.off("input",T)}function D(){u=null,clearTimeout(u);var C=d.selection.getRange(),x=C.contains(b.row,b.column);(C.isEmpty()||!x)&&(d.selection.moveToPosition(b),d.selection.selectWord()),r="wait",L()}function w(){u=null,clearTimeout(u),d.selection.moveToPosition(b);var C=E>=2?d.selection.getLineRange(b.row):d.session.getBracketRange(b);C&&!C.isEmpty()?d.selection.setRange(C):d.selection.selectWord(),r="wait"}g.addListener(c,"contextmenu",function(C){if(S){var x=d.textInput.getElement();x.focus()}},d),g.addListener(c,"touchstart",function(C){var x=C.touches;if(u||x.length>1){clearTimeout(u),u=null,s=-1,r="zoom";return}S=d.$mouseHandler.isMousePressed=!0;var _=d.renderer.layerConfig.lineHeight,k=d.renderer.layerConfig.lineHeight,O=C.timeStamp;i=O;var I=x[0],N=I.clientX,P=I.clientY;Math.abs(o-N)+Math.abs(a-P)>_&&(s=-1),o=C.clientX=N,a=C.clientY=P,$=A=0;var B=new h(C,d);if(b=B.getDocumentPosition(),O-s<500&&x.length==1&&!y)E++,C.preventDefault(),C.button=0,w();else{E=0;var F=d.selection.cursor,H=d.selection.isEmpty()?F:d.selection.anchor,z=d.renderer.$cursorLayer.getPixelPosition(F,!0),W=d.renderer.$cursorLayer.getPixelPosition(H,!0),U=d.renderer.scroller.getBoundingClientRect(),K=d.renderer.layerConfig.offset,Y=d.renderer.scrollLeft,G=function(Me,Ce){return Me=Me/k,Ce=Ce/_-.75,Me*Me+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)}s=O},d),g.addListener(c,"touchend",function(C){S=d.$mouseHandler.isMousePressed=!1,f&&clearInterval(f),r=="zoom"?(r="",y=0):u?(d.selection.moveToPosition(b),y=0,L()):r=="scroll"?(v(),T()):L(),clearTimeout(u),u=null},d),g.addListener(c,"touchmove",function(C){u&&(clearTimeout(u),u=null);var x=C.touches;if(!(x.length>1||r=="zoom")){var _=x[0],k=o-_.clientX,O=a-_.clientY;if(r=="wait")if(k*k+O*O>4)r="cursor";else return C.preventDefault();o=_.clientX,a=_.clientY,C.clientX=_.clientX,C.clientY=_.clientY;var I=C.timeStamp,N=I-i;if(i=I,r=="scroll"){var P=new h(C,d);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),d._emit("mousewheel",P),P.propagationStopped||($=A=0)}else{var B=new h(C,d),F=B.getDocumentPosition();r=="cursor"?d.selection.moveCursorToPosition(F):r=="anchor"&&d.selection.setSelectionAnchor(F.row,F.column),d.renderer.scrollCursorIntoView(F),C.preventDefault()}}},d);function v(){y+=60,f=setInterval(function(){y--<=0&&(clearInterval(f),f=null),Math.abs($)<.01&&($=0),Math.abs(A)<.01&&(A=0),y<20&&($=.9*$),y<20&&(A=.9*A);var C=d.session.getScrollTop();d.renderer.scrollBy(10*$,10*A),C==d.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 h=t("../lib/event"),g=t("../lib/useragent"),m=t("./default_handlers").DefaultHandlers,c=t("./default_gutter_handler").GutterHandler,d=t("./mouse_event").MouseEvent,r=t("./dragdrop_handler").DragdropHandler,o=t("./touch_handler").addTouchListeners,a=t("../config"),s=(function(){function i(u){this.$dragDelay,this.$dragEnabled,this.$mouseMoved,this.mouseEvent,this.$focusTimeout;var f=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();h.addListener(b,"click",this.onMouseEvent.bind(this,"click"),u),h.addListener(b,"mousemove",this.onMouseMove.bind(this,"mousemove"),u),h.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),h.addMouseWheelListener(u.container,this.onMouseWheel.bind(this,"mousewheel"),u),o(u.container,u);var E=u.renderer.$gutter;h.addListener(E,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),u),h.addListener(E,"click",this.onMouseEvent.bind(this,"gutterclick"),u),h.addListener(E,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),u),h.addListener(E,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),u),h.addListener(b,"mousedown",y,u),h.addListener(E,"mousedown",y,u),g.isIE&&u.renderer.scrollBarV&&(h.addListener(u.renderer.scrollBarV.element,"mousedown",y,u),h.addListener(u.renderer.scrollBarH.element,"mousedown",y,u)),u.on("mousemove",function($){if(!(f.state||f.$dragDelay||!f.$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,f){this.editor.session&&this.editor._emit(u,new d(f,this.editor))},i.prototype.onMouseMove=function(u,f){var y=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;!y||!y.length||this.editor._emit(u,new d(f,this.editor))},i.prototype.onMouseWheel=function(u,f){var y=new d(f,this.editor);y.speed=this.$scrollSpeed*2,y.wheelX=f.wheelX,y.wheelY=f.wheelY,this.editor._emit(u,y)},i.prototype.setState=function(u){this.state=u},i.prototype.captureMouse=function(u,f){this.x=u.x,this.y=u.y,this.isMousePressed=!0;var y=this.editor,b=this.editor.renderer;b.$isMousePressed=!0;var E=this,$=function(L){if(L){if(g.isWebKit&&!L.which&&E.releaseMouse)return E.releaseMouse();E.x=L.clientX,E.y=L.clientY,f&&f(L),E.mouseEvent=new d(L,E.editor),E.$mouseMoved=!0}},A=function(L){y.off("beforeEndOperation",M),clearInterval(R),y.session&&S(),E[E.state+"End"]&&E[E.state+"End"](L),E.state="",E.isMousePressed=b.$isMousePressed=!1,b.$keepTextAreaAtCursor&&b.$moveTextAreaToCursor(),E.$onCaptureMouseMove=E.releaseMouse=null,L&&E.onMouseEvent("mouseup",L),y.endOperation()},S=function(){E[E.state]&&E[E.state](),E.$mouseMoved=!1};if(g.isOldIE&&u.domEvent.type=="dblclick")return setTimeout(function(){A(u)});var M=function(L){E.releaseMouse&&y.curOp.command.name&&y.curOp.selectionChanged&&(E[E.state+"End"]&&E[E.state+"End"](),E.state="",E.releaseMouse())};y.on("beforeEndOperation",M),y.startOperation({command:{name:"mouse"}}),E.$onCaptureMouseMove=$,E.releaseMouse=h.capture(this.editor.container,$,A);var R=setInterval(S,20)},i.prototype.cancelContextMenu=function(){var u=(function(f){f&&f.domEvent&&f.domEvent.type!="contextmenu"||(this.editor.off("nativecontextmenu",u),f&&f.domEvent&&h.stopEvent(f.domEvent))}).bind(this);setTimeout(u,10),this.editor.on("nativecontextmenu",u)},i.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse()},i})();s.prototype.releaseMouse=null,a.defineOptions(s.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:g.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),n.MouseHandler=s}),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],function(t,n,p){var h=t("../lib/dom"),g=(function(){function m(c){c.on("click",function(d){var r=d.getDocumentPosition(),o=c.session,a=o.getFoldAt(r.row,r.column,1);a&&(d.getAccelKey()?o.removeFold(a):o.expandFold(a),d.stop());var s=d.domEvent&&d.domEvent.target;s&&h.hasCssClass(s,"ace_inline_button")&&h.hasCssClass(s,"ace_toggle_wrap")&&(o.setOption("wrap",!o.getUseWrapMode()),c.renderer.scrollCursorIntoView())}),c.on("gutterclick",function(d){var r=c.renderer.$gutterLayer.getRegion(d);if(r=="foldWidgets"){var o=d.getDocumentPosition().row,a=c.session;a.foldWidgets&&a.foldWidgets[o]&&c.session.onFoldWidgetClick(o,d),c.isFocused()||c.focus(),d.stop()}}),c.on("gutterdblclick",function(d){var r=c.renderer.$gutterLayer.getRegion(d);if(r=="foldWidgets"){var o=d.getDocumentPosition().row,a=c.session,s=a.getParentFoldRangeData(o,!0),i=s.range||s.firstRange;if(i){o=i.start.row;var u=a.getFoldAt(o,a.getLine(o).length,1);u?a.removeFold(u):(a.addFold("...",i),c.renderer.scrollCursorIntoView({row:i.start.row,column:0}))}d.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 h=t("../lib/keys"),g=t("../lib/event"),m=(function(){function c(d){this.$editor=d,this.$data={editor:d},this.$handlers=[],this.setDefaultHandler(d.commands)}return c.prototype.setDefaultHandler=function(d){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=d,this.addKeyboardHandler(d,0)},c.prototype.setKeyboardHandler=function(d){var r=this.$handlers;if(r[r.length-1]!=d){for(;r[r.length-1]&&r[r.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(r[r.length-1]);this.addKeyboardHandler(d,1)}},c.prototype.addKeyboardHandler=function(d,r){if(d){typeof d=="function"&&!d.handleKeyboard&&(d.handleKeyboard=d);var o=this.$handlers.indexOf(d);o!=-1&&this.$handlers.splice(o,1),r==null?this.$handlers.push(d):this.$handlers.splice(r,0,d),o==-1&&d.attach&&d.attach(this.$editor)}},c.prototype.removeKeyboardHandler=function(d){var r=this.$handlers.indexOf(d);return r==-1?!1:(this.$handlers.splice(r,1),d.detach&&d.detach(this.$editor),!0)},c.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},c.prototype.getStatusText=function(){var d=this.$data,r=d.editor;return this.$handlers.map(function(o){return o.getStatusText&&o.getStatusText(r,d)||""}).filter(Boolean).join(" ")},c.prototype.$callKeyboardHandlers=function(d,r,o,a){for(var s,i=!1,u=this.$editor.commands,f=this.$handlers.length;f--&&(s=this.$handlers[f].handleKeyboard(this.$data,d,r,o,a),!(!(!s||!s.command)&&(s.command=="null"?i=!0:i=u.exec(s.command,this.$editor,s.args,a),i&&a&&d!=-1&&s.passEvent!=!0&&s.command.passEvent!=!0&&g.stopEvent(a),i))););return!i&&d==-1&&(s={command:"insertstring"},i=u.exec("insertstring",this.$editor,r)),i&&this.$editor._signal&&this.$editor._signal("keyboardActivity",s),i},c.prototype.onCommandKey=function(d,r,o){var a=h.keyCodeToString(o);return this.$callKeyboardHandlers(r,a,o,d)},c.prototype.onTextInput=function(d){return this.$callKeyboardHandlers(-1,d)},c})();n.KeyBinding=m}),ace.define("ace/lib/bidiutil",["require","exports","module"],function(t,n,p){var h=0,g=0,m=!1,c=!1,d=!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]],a=0,s=1,i=0,u=1,f=2,y=3,b=4,E=5,$=6,A=7,S=8,M=9,R=10,L=11,T=12,D=13,w=14,v=15,C=16,x=17,_=18,k=[_,_,_,_,_,_,_,_,_,$,E,$,S,E,_,_,_,_,_,_,_,_,_,_,_,_,_,_,E,E,E,$,S,b,b,L,L,L,b,b,b,b,b,R,M,R,M,M,f,f,f,f,f,f,f,f,f,f,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,_,_,_,_,_,_,E,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,M,b,L,L,L,L,b,b,b,b,i,b,b,_,b,b,L,L,f,f,b,i,b,b,b,f,i,b,b,b,b,b],O=[S,S,S,S,S,S,S,S,S,S,S,_,_,_,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,E,D,w,v,C,x,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,H,z,W){var U=h?o:r,K=null,Y=null,G=null,Q=0,ue=null,Me=null,Ce=-1,he=null,De=null,dt=[];if(!W)for(he=0,W=[];he<z;he++)W[he]=B(F[he]);for(g=h,m=!1,c=!1,d=!1,De=0;De<z;De++){if(K=Q,dt[De]=Y=P(F,W,dt,De),Q=U[K][Y],ue=Q&240,Q&=15,H[De]=G=U[Q][5],ue>0)if(ue==16){for(he=Ce;he<De;he++)H[he]=1;Ce=-1}else Ce=-1;if(Me=U[Q][6],Me)Ce==-1&&(Ce=De);else if(Ce>-1){for(he=Ce;he<De;he++)H[he]=G;Ce=-1}W[De]==E&&(H[De]=0),g|=G}if(d){for(he=0;he<z;he++)if(W[he]==$){H[he]=h;for(var ft=he-1;ft>=0&&W[ft]==S;ft--)H[ft]=h}}}function N(F,H,z){if(!(g<F)){if(F==1&&h==s&&!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 b:case y:return U;case f:return m?y:f;case A:return m=!0,u;case S:return b;case M:return W<1||W+1>=H.length||(K=z[W-1])!=f&&K!=y||(Y=H[W+1])!=f&&Y!=y?b:(m&&(Y=y),Y==K?Y:b);case R:return K=W>0?z[W-1]:E,K==f&&W+1<H.length&&H[W+1]==f?f:b;case L:if(W>0&&z[W-1]==f)return f;if(m)return b;for(Q=W+1,G=H.length;Q<G&&H[Q]==L;)Q++;return Q<G&&H[Q]==f?f:b;case T:for(G=H.length,Q=W+1;Q<G&&H[Q]==T;)Q++;if(Q<G){var ue=F[W],Me=ue>=1425&&ue<=2303||ue==64286;if(K=H[Q],Me&&(K==u||K==A))return u}return W<1||(K=H[W-1])==E?b:z[W-1];case E:return m=!1,c=!0,h;case $:return d=!0,b;case D:case w:case C:case x:case v:m=!1;case _:return b}}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)?T:/[\u0660-\u0669\u066b-\u066c]/.test(F)?y:H==1642?L:/[\u06f0-\u06f9]/.test(F)?f:A:z==32&&H<=8287?O[H&255]:z==254&&H>=65136?A:b}n.L=i,n.R=u,n.EN=f,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=[];h=z?s:a,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]===b||H[G]===_)?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 h=t("./lib/bidiutil"),g=t("./lib/lang"),m=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,c=(function(){function d(r){this.session=r,this.bidiMap={},this.currentRow=null,this.bidiUtil=h,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 d.prototype.isBidiRow=function(r,o,a){return this.seenBidi?(r!==this.currentRow&&(this.currentRow=r,this.updateRowLine(o,a),this.updateBidiMap()),this.bidiMap.bidiLevels):!1},d.prototype.onChange=function(r){this.seenBidi?this.currentRow=null:r.action=="insert"&&m.test(r.lines.join(`
|
|
1342
|
+
`))&&(this.seenBidi=!0,this.currentRow=null)},d.prototype.getDocumentRow=function(){var r=0,o=this.session.$screenRowCache;if(o.length){var a=this.session.$getRowCacheIndex(o,this.currentRow);a>=0&&(r=this.session.$docRowCache[a])}return r},d.prototype.getSplitIndex=function(){var r=0,o=this.session.$screenRowCache;if(o.length)for(var a,s=this.session.$getRowCacheIndex(o,this.currentRow);this.currentRow-r>0&&(a=this.session.$getRowCacheIndex(o,this.currentRow-r-1),a===s);)s=a,r++;else r=this.currentRow;return r},d.prototype.updateRowLine=function(r,o){r===void 0&&(r=this.getDocumentRow());var a=r===this.session.getLength()-1,s=a?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[h.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?s:h.DOT))}else this.line+=this.showInvisibles?s:h.DOT;var u=this.session,f=0,y;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,function(b,E){return b===" "||u.isFullWidth(b.charCodeAt(0))?(y=b===" "?u.getScreenTabSize(E+f):2,f+=y-1,g.stringRepeat(h.DOT,y)):b}),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==h.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},d.prototype.updateBidiMap=function(){var r=[];h.hasBidiCharacters(this.line,r)||this.isRtlDir?this.bidiMap=h.doBidiReorder(this.line,r,this.isRtlDir):this.bidiMap={}},d.prototype.markAsDirty=function(){this.currentRow=null},d.prototype.updateCharacterWidths=function(r){if(this.characterWidth!==r.$characterSize.width){this.fontMetrics=r;var o=this.characterWidth=r.$characterSize.width,a=r.$measureCharWidth("ה");this.charWidths[h.L]=this.charWidths[h.EN]=this.charWidths[h.ON_R]=o,this.charWidths[h.R]=this.charWidths[h.AN]=a,this.charWidths[h.R_H]=a*.45,this.charWidths[h.B]=this.charWidths[h.RLE]=0,this.currentRow=null}},d.prototype.setShowInvisibles=function(r){this.showInvisibles=r,this.currentRow=null},d.prototype.setEolChar=function(r){this.EOL=r},d.prototype.setContentWidth=function(r){this.contentWidth=r},d.prototype.isRtlLine=function(r){return this.$isRtl?!0:r!=null?this.session.getLine(r).charAt(0)==this.RLE:this.isRtlDir},d.prototype.setRtlDirection=function(r,o){for(var a=r.getCursorPosition(),s=r.selection.getSelectionAnchor().row;s<=a.row;s++)!o&&r.session.getLine(s).charAt(0)===r.session.$bidiHandler.RLE?r.session.doc.removeInLine(s,0,1):o&&r.session.getLine(s).charAt(0)!==r.session.$bidiHandler.RLE&&r.session.doc.insert({column:0,row:s},r.session.$bidiHandler.RLE)},d.prototype.getPosLeft=function(r){r-=this.wrapIndent;var o=this.line.charAt(0)===this.RLE?1:0,a=r>o?this.session.getOverwrite()?r:r-1:o,s=h.getVisualFromLogicalIdx(a,this.bidiMap),i=this.bidiMap.bidiLevels,u=0;!this.session.getOverwrite()&&r<=o&&i[s]%2!==0&&s++;for(var f=0;f<s;f++)u+=this.charWidths[i[f]];return!this.session.getOverwrite()&&r>o&&i[s]%2===0&&(u+=this.charWidths[i[s]]),this.wrapIndent&&(u+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(u+=this.rtlLineOffset),u},d.prototype.getSelections=function(r,o){var a=this.bidiMap,s=a.bidiLevels,i,u=[],f=0,y=Math.min(r,o)-this.wrapIndent,b=Math.max(r,o)-this.wrapIndent,E=!1,$=!1,A=0;this.wrapIndent&&(f+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var S,M=0;M<s.length;M++)S=a.logicalFromVisual[M],i=s[M],E=S>=y&&S<b,E&&!$?A=f:!E&&$&&u.push({left:A,width:f-A}),f+=this.charWidths[i],$=E;if(E&&M===s.length&&u.push({left:A,width:f-A}),this.isRtlDir)for(var R=0;R<u.length;R++)u[R].left+=this.rtlLineOffset;return u},d.prototype.offsetToCol=function(a){this.isRtlDir&&(a-=this.rtlLineOffset);var o=0,a=Math.max(a,0),s=0,i=0,u=this.bidiMap.bidiLevels,f=this.charWidths[u[i]];for(this.wrapIndent&&(a-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);a>s+f/2;){if(s+=f,i===u.length-1){f=0;break}f=this.charWidths[u[++i]]}return i>0&&u[i-1]%2!==0&&u[i]%2===0?(a<s&&i--,o=this.bidiMap.logicalFromVisual[i]):i>0&&u[i-1]%2===0&&u[i]%2!==0?o=1+(a>s?this.bidiMap.logicalFromVisual[i]:this.bidiMap.logicalFromVisual[i-1]):this.isRtlDir&&i===u.length-1&&f===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&&f!==0&&i--,o=this.bidiMap.logicalFromVisual[i]),o===0&&this.isRtlDir&&o++,o+this.wrapIndent},d})();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 h=t("./lib/oop"),g=t("./lib/lang"),m=t("./lib/event_emitter").EventEmitter,c=t("./range").Range,d=(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 a=this;this.cursor.on("change",function(s){a.$cursorChanged=!0,a.$silent||a._emit("changeCursor"),!a.$isEmpty&&!a.$silent&&a._emit("changeSelection"),!a.$keepDesiredColumnOnChange&&s.old.column!=s.value.column&&(a.$desiredColumn=null)}),this.anchor.on("change",function(){a.$anchorChanged=!0,!a.$isEmpty&&!a.$silent&&a._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,a){this.$isEmpty=!1,this.anchor.setPosition(o,a)},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,a=this.lead;return o.row>a.row||o.row==a.row&&o.column>a.column},r.prototype.getRange=function(){var o=this.anchor,a=this.lead;return this.$isEmpty?c.fromPoints(a,a):this.isBackwards()?c.fromPoints(a,o):c.fromPoints(o,a)},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,a){var s=a?o.end:o.start,i=a?o.start:o.end;this.$setSelection(s.row,s.column,i.row,i.column)},r.prototype.$setSelection=function(o,a,s,i){if(!this.$silent){var u=this.$isEmpty,f=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(o,a),this.cursor.setPosition(s,i),this.$isEmpty=!c.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||u!=this.$isEmpty||f)&&this._emit("changeSelection")}},r.prototype.$moveSelection=function(o){var a=this.lead;this.$isEmpty&&this.setSelectionAnchor(a.row,a.column),o.call(this)},r.prototype.selectTo=function(o,a){this.$moveSelection(function(){this.moveCursorTo(o,a)})},r.prototype.selectToPosition=function(o){this.$moveSelection(function(){this.moveCursorToPosition(o)})},r.prototype.moveTo=function(o,a){this.clearSelection(),this.moveCursorTo(o,a)},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,a){if(typeof a>"u"){var s=o||this.lead;o=s.row,a=s.column}return this.session.getWordRange(o,a)},r.prototype.selectWord=function(){this.setSelectionRange(this.getWordRange())},r.prototype.selectAWord=function(){var o=this.getCursor(),a=this.session.getAWordRange(o.row,o.column);this.setSelectionRange(a)},r.prototype.getLineRange=function(o,a){var s=typeof o=="number"?o:this.lead.row,i,u=this.session.getFoldLine(s);return u?(s=u.start.row,i=u.end.row):i=s,a===!0?new c(s,0,i,this.session.getLine(i).length):new c(s,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,a,s){var i=o.column,u=o.column+a;return s<0&&(i=o.column-a,u=o.column),this.session.isTabStop(o)&&this.doc.getLine(o.row).slice(i,u).split(" ").length-1==a},r.prototype.moveCursorLeft=function(){var o=this.lead.getPosition(),a;if(a=this.session.getFoldAt(o.row,o.column,-1))this.moveCursorTo(a.start.row,a.start.column);else if(o.column===0)o.row>0&&this.moveCursorTo(o.row-1,this.doc.getLine(o.row-1).length);else{var s=this.session.getTabSize();this.wouldMoveIntoSoftTab(o,s,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-s):this.moveCursorBy(0,-1)}},r.prototype.moveCursorRight=function(){var o=this.lead.getPosition(),a;if(a=this.session.getFoldAt(o.row,o.column,1))this.moveCursorTo(a.end.row,a.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 s=this.session.getTabSize(),o=this.lead;this.wouldMoveIntoSoftTab(o,s,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,s):this.moveCursorBy(0,1)}},r.prototype.moveCursorLineStart=function(){var o=this.lead.row,a=this.lead.column,s=this.session.documentToScreenRow(o,a),i=this.session.screenToDocumentPosition(s,0),u=this.session.getDisplayLine(o,null,i.row,i.column),f=u.match(/^\s*/);f[0].length!=a&&!this.session.$useEmacsStyleLineStart&&(i.column+=f[0].length),this.moveCursorToPosition(i)},r.prototype.moveCursorLineEnd=function(){var o=this.lead,a=this.session.getDocumentLastRowColumnPosition(o.row,o.column);if(this.lead.column==a.column){var s=this.session.getLine(a.row);if(a.column==s.length){var i=s.search(/\s+$/);i>0&&(a.column=i)}}this.moveCursorTo(a.row,a.column)},r.prototype.moveCursorFileEnd=function(){var o=this.doc.getLength()-1,a=this.doc.getLine(o).length;this.moveCursorTo(o,a)},r.prototype.moveCursorFileStart=function(){this.moveCursorTo(0,0)},r.prototype.moveCursorLongWordRight=function(){var o=this.lead.row,a=this.lead.column,s=this.doc.getLine(o),i=s.substring(a);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var u=this.session.getFoldAt(o,a,1);if(u){this.moveCursorTo(u.end.row,u.end.column);return}if(this.session.nonTokenRe.exec(i)&&(a+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,i=s.substring(a)),a>=s.length){this.moveCursorTo(o,s.length),this.moveCursorRight(),o<this.doc.getLength()-1&&this.moveCursorWordRight();return}this.session.tokenRe.exec(i)&&(a+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(o,a)},r.prototype.moveCursorLongWordLeft=function(){var o=this.lead.row,a=this.lead.column,s;if(s=this.session.getFoldAt(o,a,-1)){this.moveCursorTo(s.start.row,s.start.column);return}var i=this.session.getFoldStringAt(o,a,-1);i==null&&(i=this.doc.getLine(o).substring(0,a));var u=g.stringReverse(i);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(u)&&(a-=this.session.nonTokenRe.lastIndex,u=u.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),a<=0){this.moveCursorTo(o,0),this.moveCursorLeft(),o>0&&this.moveCursorWordLeft();return}this.session.tokenRe.exec(u)&&(a-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(o,a)},r.prototype.$shortWordEndIndex=function(o){var a=0,s,i=/\s/,u=this.session.tokenRe;if(u.lastIndex=0,this.session.tokenRe.exec(o))a=this.session.tokenRe.lastIndex;else{for(;(s=o[a])&&i.test(s);)a++;if(a<1){for(u.lastIndex=0;(s=o[a])&&!u.test(s);)if(u.lastIndex=0,a++,i.test(s))if(a>2){a--;break}else{for(;(s=o[a])&&i.test(s);)a++;if(a>2)break}}}return u.lastIndex=0,a},r.prototype.moveCursorShortWordRight=function(){var o=this.lead.row,a=this.lead.column,s=this.doc.getLine(o),i=s.substring(a),u=this.session.getFoldAt(o,a,1);if(u)return this.moveCursorTo(u.end.row,u.end.column);if(a==s.length){var f=this.doc.getLength();do o++,i=this.doc.getLine(o);while(o<f&&/^\s*$/.test(i));/^\s+/.test(i)||(i=""),a=0}var y=this.$shortWordEndIndex(i);this.moveCursorTo(o,a+y)},r.prototype.moveCursorShortWordLeft=function(){var o=this.lead.row,a=this.lead.column,s;if(s=this.session.getFoldAt(o,a,-1))return this.moveCursorTo(s.start.row,s.start.column);var i=this.session.getLine(o).substring(0,a);if(a===0){do o--,i=this.doc.getLine(o);while(o>0&&/^\s*$/.test(i));a=i.length,/\s+$/.test(i)||(i="")}var u=g.stringReverse(i),f=this.$shortWordEndIndex(u);return this.moveCursorTo(o,a-f)},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,a){var s=this.session.documentToScreenPosition(this.lead.row,this.lead.column),i;if(a===0&&(o!==0&&(this.session.$bidiHandler.isBidiRow(s.row,this.lead.row)?(i=this.session.$bidiHandler.getPosLeft(s.column),s.column=Math.round(i/this.session.$bidiHandler.charWidths[0])):i=s.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?s.column=this.$desiredColumn:this.$desiredColumn=s.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 f=this.session.screenToDocumentPosition(s.row+o,s.column,i);o!==0&&a===0&&f.row===this.lead.row&&(f.column,this.lead.column),this.moveCursorTo(f.row,f.column+a,a===0)},r.prototype.moveCursorToPosition=function(o){this.moveCursorTo(o.row,o.column)},r.prototype.moveCursorTo=function(o,a,s){var i=this.session.getFoldAt(o,a,1);i&&(o=i.start.row,a=i.start.column),this.$keepDesiredColumnOnChange=!0;var u=this.session.getLine(o);/[\uDC00-\uDFFF]/.test(u.charAt(a))&&u.charAt(a-1)&&(this.lead.row==o&&this.lead.column==a+1?a=a-1:a=a+1),this.lead.setPosition(o,a),this.$keepDesiredColumnOnChange=!1,s||(this.$desiredColumn=null)},r.prototype.moveCursorToScreen=function(o,a,s){var i=this.session.screenToDocumentPosition(o,a);this.moveCursorTo(i.row,i.column,s)},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 a=this.getRange();return o?(o.start.column=a.start.column,o.start.row=a.start.row,o.end.column=a.end.column,o.end.row=a.end.row):o=a,o.cursor=this.isBackwards()?o.start:o.end,o.desiredColumn=this.$desiredColumn,o},r.prototype.getRangeOfMovements=function(o){var a=this.getCursor();try{o(this);var s=this.getCursor();return c.fromPoints(a,s)}catch{return c.fromPoints(a,a)}finally{this.moveCursorToPosition(a)}},r.prototype.toJSON=function(){if(this.rangeCount)var o=this.ranges.map(function(a){var s=a.clone();return s.isBackwards=a.cursor==a.start,s});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 a=o.length;a--;){var s=c.fromPoints(o[a].start,o[a].end);o[a].isBackwards&&(s.cursor=s.start),this.addRange(s,!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 a=this.ranges.length;a--;)if(!this.ranges[a].isEqual(o[a]))return!1;return!0},r})();d.prototype.setSelectionAnchor=d.prototype.setAnchor,d.prototype.getSelectionAnchor=d.prototype.getAnchor,d.prototype.setSelectionRange=d.prototype.setRange,h.implement(d.prototype,m),n.Selection=d}),ace.define("ace/tokenizer",["require","exports","module","ace/lib/report_error"],function(t,n,p){var h=t("./lib/report_error").reportError,g=2e3,m=(function(){function c(d){this.splitRegex,this.states=d,this.regExps={},this.matchMappings={};for(var r in this.states){for(var o=this.states[r],a=[],s=0,i=this.matchMappings[r]={defaultToken:"text"},u="g",f=[],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 E=b.regex,$=new RegExp("(?:("+E+")|(.))").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)?E=b.regex.replace(/\\([0-9]+)/g,function(A,S){return"\\"+(parseInt(S,10)+s+1)}):($=1,E=this.removeCapturingGroups(b.regex)),!b.splitRegex&&typeof b.token!="string"&&f.push(b)),i[s]=y,s+=$,a.push(E),b.onMatch||(b.onMatch=null)}}a.length||(i[0]=0,a.push("$")),f.forEach(function(A){A.splitRegex=this.createSplitterRegexp(A.regex,u)},this),this.regExps[r]=new RegExp("("+a.join(")|(")+")|($)",u)}}return c.prototype.$setMaxTokenCount=function(d){g=d|0},c.prototype.$applyToken=function(d){var r=this.splitRegex.exec(d).slice(1),o=this.token.apply(this,r);if(typeof o=="string")return[{type:o,value:d}];for(var a=[],s=0,i=o.length;s<i;s++)r[s]&&(a[a.length]={type:o[s],value:r[s]});return a},c.prototype.$arrayTokens=function(d){if(!d)return[];var r=this.splitRegex.exec(d);if(!r)return"text";for(var o=[],a=this.tokenArray,s=0,i=a.length;s<i;s++)r[s+1]&&(o[o.length]={type:a[s],value:r[s+1]});return o},c.prototype.removeCapturingGroups=function(d){var r=d.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,function(o,a){return a?"(?:":o});return r},c.prototype.createSplitterRegexp=function(d,r){if(d.indexOf("(?=")!=-1){var o=0,a=!1,s={};d.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,function(i,u,f,y,b,E){return a?a=b!="]":b?a=!0:y?(o==s.stack&&(s.end=E+1,s.stack=-1),o--):f&&(o++,f.length!=1&&(s.stack=o,s.start=E)),i}),s.end!=null&&/^\)*$/.test(d.substr(s.end))&&(d=d.substring(0,s.start)+d.substr(s.end))}return d.charAt(0)!="^"&&(d="^"+d),d.charAt(d.length-1)!="$"&&(d+="$"),new RegExp(d,(r||"").replace("g",""))},c.prototype.getLineTokens=function(d,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 a=r||"start",s=this.states[a];s||(a="start",s=this.states[a]);var i=this.matchMappings[a],u=this.regExps[a];u.lastIndex=0;for(var f,y=[],b=0,E=0,$={type:null,value:""};f=u.exec(d);){var A=i.defaultToken,S=null,M=f[0],R=u.lastIndex;if(R-M.length>b){var L=d.substring(b,R-M.length);$.type==A?$.value+=L:($.type&&y.push($),$={type:A,value:L})}for(var T=0;T<f.length-2;T++)if(f[T+1]!==void 0){S=s[i[T]],S.onMatch?A=S.onMatch(M,a,o,d):A=S.token,S.next&&(typeof S.next=="string"?a=S.next:a=S.next(a,o),s=this.states[a],s||(this.reportError("state doesn't exist",a),a="start",s=this.states[a]),i=this.matchMappings[a],b=R,u=this.regExps[a],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 T=0;T<A.length;T++)y.push(A[T])}}if(b==d.length)break;if(b=R,E++>g){for(E>2*d.length&&this.reportError("infinite loop with in ace tokenizer",{startState:r,line:d});b<d.length;)$.type&&y.push($),$={value:d.substring(b,b+=500),type:"overflow"};a="start",o=[];break}}return $.type&&y.push($),o.length>1&&o[0]!==a&&o.unshift("#tmp",a),{tokens:y,state:o.length?o:a}},c})();m.prototype.reportError=h,n.Tokenizer=m}),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/deep_copy"],function(t,n,p){var h=t("../lib/deep_copy").deepCopy,g;g=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}},(function(){this.addRules=function(d,r){if(!r){for(var o in d)this.$rules[o]=d[o];return}for(var o in d){for(var a=d[o],s=0;s<a.length;s++){var i=a[s];(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]=a}},this.getRules=function(){return this.$rules},this.embedRules=function(d,r,o,a,s){var i=typeof d=="function"?new d().getRules():d;if(a)for(var u=0;u<a.length;u++)a[u]=r+a[u];else{a=[];for(var f in i)a.push(r+f)}if(this.addRules(i,r),o)for(var y=Array.prototype[s?"push":"unshift"],u=0;u<a.length;u++)y.apply(this.$rules[a[u]],h(o));this.$embeds||(this.$embeds=[]),this.$embeds.push(r)},this.getEmbeds=function(){return this.$embeds};var m=function(d,r){return(d!="start"||r.length)&&r.unshift(this.nextState,d),this.nextState},c=function(d,r){return r.shift(),r.shift()||"start"};this.normalizeRules=function(){var d=0,r=this.$rules;function o(a){var s=r[a];s.processed=!0;for(var i=0;i<s.length;i++){var u=s[i],f=null;Array.isArray(u)&&(f=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+=d++)),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 E in u.rules)r[E]?r[E].push&&r[E].push.apply(r[E],u.rules[E]):r[E]=u.rules[E];var $=typeof u=="string"?u:u.include;if($&&($==="$self"&&($="start"),Array.isArray($)?f=$.map(function(S){return r[S]}):f=r[$]),f){var A=[i,1].concat(f);u.noEscape&&(A=A.filter(function(S){return!S.next})),s.splice.apply(s,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(d,r,o,a){var s=Object.create(null);return this.$keywordList=[],Object.keys(d).forEach(function(i){for(var u=d[i],f=u.split(a||"|"),y=f.length;y--;){var b=f[y];this.$keywordList.push(b),o&&(b=b.toLowerCase()),s[b]=i}},this),d=null,o?function(i){return s[i.toLowerCase()]||r}:function(i){return s[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 h;h=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(h.prototype),n.Behaviour=h}),ace.define("ace/token_iterator",["require","exports","module","ace/range"],function(t,n,p){var h=t("./range").Range,g=(function(){function m(c,d,r){this.$session=c,this.$row=d,this.$rowTokens=c.getTokens(d);var o=c.getTokenAt(d,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,d=this.$tokenIndex,r=c[d].start;if(r!==void 0)return r;for(r=0;d>0;)d-=1,r+=c[d].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],d=this.getCurrentTokenColumn();return new h(this.$row,d,this.$row,d+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 h=t("../../lib/oop"),g=t("../behaviour").Behaviour,m=t("../../token_iterator").TokenIterator,c=t("../../lib/lang"),d=["text","paren.rparen","rparen","paren","punctuation.operator"],r=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],o,a={},s={'"':'"',"'":"'"},i=function(y){var b=-1;if(y.multiSelect&&(b=y.selection.index,a.rangeCount!=y.multiSelect.rangeCount&&(a={rangeCount:y.multiSelect.rangeCount})),a[b])return o=a[b];o=a[b]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},u=function(y,b,E,$){var A=y.end.row-y.start.row;return{text:E+b+$,selection:[0,y.start.column+1,A,y.end.column+(A?0:1)]}},f;f=function(y){y=y||{},this.add("braces","insertion",function(b,E,$,A,S){var M=$.getCursorPosition(),R=A.doc.getLine(M.row);if(S=="{"){i($);var L=$.getSelectionRange(),T=A.doc.getTextRange(L),D=A.getTokenAt(M.row,M.column);if(T!==""&&T!=="{"&&$.getWrapBehavioursEnabled())return u(L,T,"{","}");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:(f.recordAutoInsert($,A,"}"),{text:"{}",selection:[1,1]})}else if(f.isSaneInsertion($,A))return/[\]\}\)]/.test(R[M.column])||$.inMultiSelectMode||y.braces?(f.recordAutoInsert($,A,"}"),{text:"{}",selection:[1,1]}):(f.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&&f.isAutoInsertedClosing(M,R,S))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(S==`
|
|
1343
1343
|
`||S==`\r
|
|
1344
|
-
`){i($);var
|
|
1344
|
+
`){i($);var x="";f.isMaybeInsertedClosing(M,R)&&(x=c.stringRepeat("}",o.maybeInsertedBrackets),f.clearMaybeInsertedClosing());var v=R.substring(M.column,M.column+1);if(v==="}"){var _=A.findMatchingBracket({row:M.row,column:M.column+1},"}");if(!_)return null;var k=this.$getIndent(A.getLine(_.row))}else if(x)var k=this.$getIndent(R);else{f.clearMaybeInsertedClosing();return}var O=k+A.getTabString();return{text:`
|
|
1345
1345
|
`+O+`
|
|
1346
|
-
`+k+
|
|
1346
|
+
`+k+x,selection:[1,O.length,1,O.length]}}else f.clearMaybeInsertedClosing()}),this.add("braces","deletion",function(b,E,$,A,S){var M=A.doc.getTextRange(S);if(!S.isMultiLine()&&M=="{"){i($);var R=A.doc.getLine(S.start.row),L=R.substring(S.end.column,S.end.column+1);if(L=="}")return S.end.column++,S;o.maybeInsertedBrackets--}}),this.add("parens","insertion",function(b,E,$,A,S){if(S=="("){i($);var M=$.getSelectionRange(),R=A.doc.getTextRange(M);if(R!==""&&$.getWrapBehavioursEnabled())return u(M,R,"(",")");if(f.isSaneInsertion($,A))return f.recordAutoInsert($,A,")"),{text:"()",selection:[1,1]}}else if(S==")"){i($);var L=$.getCursorPosition(),T=A.doc.getLine(L.row),D=T.substring(L.column,L.column+1);if(D==")"){var w=A.$findOpeningBracket(")",{column:L.column+1,row:L.row});if(w!==null&&f.isAutoInsertedClosing(L,T,S))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(b,E,$,A,S){var M=A.doc.getTextRange(S);if(!S.isMultiLine()&&M=="("){i($);var R=A.doc.getLine(S.start.row),L=R.substring(S.start.column+1,S.start.column+2);if(L==")")return S.end.column++,S}}),this.add("brackets","insertion",function(b,E,$,A,S){if(S=="["){i($);var M=$.getSelectionRange(),R=A.doc.getTextRange(M);if(R!==""&&$.getWrapBehavioursEnabled())return u(M,R,"[","]");if(f.isSaneInsertion($,A))return f.recordAutoInsert($,A,"]"),{text:"[]",selection:[1,1]}}else if(S=="]"){i($);var L=$.getCursorPosition(),T=A.doc.getLine(L.row),D=T.substring(L.column,L.column+1);if(D=="]"){var w=A.$findOpeningBracket("]",{column:L.column+1,row:L.row});if(w!==null&&f.isAutoInsertedClosing(L,T,S))return f.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(b,E,$,A,S){var M=A.doc.getTextRange(S);if(!S.isMultiLine()&&M=="["){i($);var R=A.doc.getLine(S.start.row),L=R.substring(S.start.column+1,S.start.column+2);if(L=="]")return S.end.column++,S}}),this.add("string_dquotes","insertion",function(b,E,$,A,S){var M=A.$mode.$quotes||s;if(S.length==1&&M[S]){if(this.lineCommentStart&&this.lineCommentStart.indexOf(S)!=-1)return;i($);var R=S,L=$.getSelectionRange(),T=A.doc.getTextRange(L);if(T!==""&&(T.length!=1||!M[T])&&$.getWrapBehavioursEnabled())return u(L,T,R,R);if(!T){var D=$.getCursorPosition(),w=A.doc.getLine(D.row),v=w.substring(D.column-1,D.column),C=w.substring(D.column,D.column+1),x=A.getTokenAt(D.row,D.column),_=A.getTokenAt(D.row,D.column+1);if(v=="\\"&&x&&/escape/.test(x.type))return null;var k=x&&/string|escape/.test(x.type),O=!_||/string|escape/.test(_.type),I;if(C==R)I=k!==O,I&&/string\.end/.test(_.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=w[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(b,E,$,A,S){var M=A.$mode.$quotes||s,R=A.doc.getTextRange(S);if(!S.isMultiLine()&&M.hasOwnProperty(R)){i($);var L=A.doc.getLine(S.start.row),T=L.substring(S.start.column+1,S.start.column+2);if(T==R)return S.end.column++,S}}),y.closeDocComment!==!1&&this.add("doc comment end","insertion",function(b,E,$,A,S){if(b==="doc-start"&&(S===`
|
|
1347
1347
|
`||S===`\r
|
|
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",p)){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",p))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,f){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,f){var d=t("../config"),g=t("../tokenizer").Tokenizer,m=t("./text_highlight_rules").TextHighlightRules,c=t("./behaviour/cstyle").CstyleBehaviour,p=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("^["+p.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+p.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,f){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 p;return this.lineWidgets?p=this.lineWidgets[c]&&this.lineWidgets[c].rowCount||0:p=0,!this.$useWrapMode||!this.$wrapData[c]?1+p:this.$wrapData[c].length+1+p},m.prototype.$getWidgetScreenLength=function(){var c=0;return this.lineWidgets.forEach(function(p){p&&p.rowCount&&!p.hidden&&(c+=p.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 p=this.editor;if(p){this.editor=null,p.widgetManager=null,p.renderer.off("beforeRender",this.measureWidgets),p.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,p){var r=p.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 p=this.session.lineWidgets;if(p){var r=c.start.row,o=c.end.row-r;if(o!==0)if(c.action=="remove"){var s=p.splice(r+1,o);!p[r]&&s[s.length-1]&&(p[r]=s.pop()),s.forEach(function(i){i&&this.removeLineWidget(i)},this),this.$updateRows()}else{var a=new Array(o);p[r]&&p[r].column!=null&&c.start.column>p[r].column&&r++,a.unshift(r,0),p.splice.apply(p,a),this.$updateRows()}}},m.prototype.$updateRows=function(){var c=this.session.lineWidgets;if(c){var p=!0;c.forEach(function(r,o){if(r)for(p=!1,r.row=o;r.$oldWidget;)r.$oldWidget.row=o,r=r.$oldWidget}),p&&(this.session.lineWidgets=null)}},m.prototype.$registerLineWidget=function(c){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var p=this.session.lineWidgets[c.row];return p&&(c.$oldWidget=p,p.el&&p.el.parentNode&&(p.el.parentNode.removeChild(p.el),p._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 p=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",p.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/p.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,p),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 p=this.session.lineWidgets[c.row];if(p==c)this.session.lineWidgets[c.row]=c.$oldWidget,c.$oldWidget&&this.onWidgetChanged(c.$oldWidget);else for(;p;){if(p.$oldWidget==c){p.$oldWidget=c.$oldWidget;break}p=p.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:c.row}}}),this.$updateRows()},m.prototype.getWidgetsAtRow=function(c){for(var p=this.session.lineWidgets,r=p&&p[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,p){var r=this.session._changedWidgets,o=p.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,p.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,p){var r=p.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,p.$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,p.container.appendChild(u.el));var h=p.$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:p.gutterWidth;u.fixedWidth||(y-=p.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=p.scrollBar.getWidth()+"px":u.el.style.right=""}}}},m})();n.LineWidgets=g}),ace.define("ace/apply_delta",["require","exports","module"],function(t,n,f){n.applyDelta=function(d,g,m){var c=g.start.row,p=g.start.column,r=d[c]||"";switch(g.action){case"insert":var o=g.lines;if(o.length===1)d[c]=r.substring(0,p)+g.lines[0]+r.substring(p);else{var s=[c,1].concat(g.lines);d.splice.apply(d,s),d[c]=r.substring(0,p)+d[c],d[c+g.lines.length-1]+=r.substring(p)}break;case"remove":var a=g.end.column,i=g.end.row;c===i?d[c]=r.substring(0,p)+r.substring(a):d.splice(c,i-c+1,r.substring(0,p)+d[i].substring(a));break}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(t,n,f){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=p(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 p(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,f){var d=t("./lib/oop"),g=t("./apply_delta").applyDelta,m=t("./lib/event_emitter").EventEmitter,c=t("./range").Range,p=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 p(this,s,a)},o.prototype.$detectNewLine=function(s){var a=s.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=a?a[1]:`
|
|
1348
|
+
`)&&$.selection.isEmpty()){var M=$.getCursorPosition();if(M.column===0)return;for(var R=A.doc.getLine(M.row),L=A.doc.getLine(M.row+1),T=A.getTokens(M.row),D=0,w=0;w<T.length;w++){D+=T[w].value.length;var v=T[w];if(D>=M.column){if(D===M.column){if(!/\.doc/.test(v.type))return;if(/\*\//.test(v.value)){var C=T[w+1];if(!C||!/\.doc/.test(C.type))return}}var x=M.column-(D-v.value.length),_=v.value.indexOf("*/"),k=v.value.indexOf("/**",_>-1?_+2:0);if(k!==-1&&x>k&&x<k+3||_!==-1&&k!==-1&&x>=_&&x<=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]}}})},f.isSaneInsertion=function(y,b){var E=y.getCursorPosition(),$=new m(b,E.row,E.column);if(!this.$matchTokenType($.getCurrentToken()||"text",d)){if(/[)}\]]/.test(y.session.getLine(E.row)[E.column]))return!0;var A=new m(b,E.row,E.column+1);if(!this.$matchTokenType(A.getCurrentToken()||"text",d))return!1}return $.stepForward(),$.getCurrentTokenRow()!==E.row||this.$matchTokenType($.getCurrentToken()||"text",r)},f.$matchTokenType=function(y,b){return b.indexOf(y.type||y)>-1},f.recordAutoInsert=function(y,b,E){var $=y.getCursorPosition(),A=b.doc.getLine($.row);this.isAutoInsertedClosing($,A,o.autoInsertedLineEnd[0])||(o.autoInsertedBrackets=0),o.autoInsertedRow=$.row,o.autoInsertedLineEnd=E+A.substr($.column),o.autoInsertedBrackets++},f.recordMaybeInsert=function(y,b,E){var $=y.getCursorPosition(),A=b.doc.getLine($.row);this.isMaybeInsertedClosing($,A)||(o.maybeInsertedBrackets=0),o.maybeInsertedRow=$.row,o.maybeInsertedLineStart=A.substr(0,$.column)+E,o.maybeInsertedLineEnd=A.substr($.column),o.maybeInsertedBrackets++},f.isAutoInsertedClosing=function(y,b,E){return o.autoInsertedBrackets>0&&y.row===o.autoInsertedRow&&E===o.autoInsertedLineEnd[0]&&b.substr(y.column)===o.autoInsertedLineEnd},f.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},f.popAutoInsertedClosing=function(){o.autoInsertedLineEnd=o.autoInsertedLineEnd.substr(1),o.autoInsertedBrackets--},f.clearMaybeInsertedClosing=function(){o&&(o.maybeInsertedBrackets=0,o.maybeInsertedRow=-1)},h.inherits(f,g),n.CstyleBehaviour=f}),ace.define("ace/unicode",["require","exports","module"],function(t,n,p){for(var h=[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<h.length;c+=2)m.push(g+=h[c]),h[c+1]&&m.push(45,g+=h[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 h=t("../config"),g=t("../tokenizer").Tokenizer,m=t("./text_highlight_rules").TextHighlightRules,c=t("./behaviour/cstyle").CstyleBehaviour,d=t("../unicode"),r=t("../lib/lang"),o=t("../token_iterator").TokenIterator,a=t("../range").Range,s;s=function(){this.HighlightRules=m},(function(){this.$defaultBehaviour=new c,this.tokenRe=new RegExp("^["+d.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+d.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,f,y){var b=u.doc,E=!0,$=!0,A=1/0,S=u.getTabSize(),M=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var T=this.lineCommentStart.map(r.escapeRegExp).join("|"),R=this.lineCommentStart[0];else var T=r.escapeRegExp(this.lineCommentStart),R=this.lineCommentStart;T=new RegExp("^(\\s*)(?:"+T+") ?"),M=u.getUseSoftTabs();var v=function(B,F){var H=B.match(T);if(H){var z=H[1].length,W=H[0].length;!_(B,z,W)&&H[0][W-1]==" "&&W--,b.removeInLine(F,z,W)}},x=R+" ",w=function(B,F){(!E||/\S/.test(B))&&(_(B,A,A)?b.insertInLine({row:F,column:A},x):b.insertInLine({row:F,column:A},R))},C=function(B,F){return T.test(B)},_=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,T=new RegExp("^(\\s*)(?:"+r.escapeRegExp(R)+")"),D=new RegExp("(?:"+r.escapeRegExp(L)+")\\s*$"),w=function(I,N){C(I,N)||(!E||/\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(T))&&b.removeInLine(N,P[1].length,P[0].length)},C=function(I,N){if(T.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=f;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,E=!1,$=!1),M&&A%S!=0&&(A=Math.floor(A/S)*S),k($?v:w)},this.toggleBlockComment=function(i,u,f,y){var b=this.blockComment;if(b){!b.start&&b[0]&&(b=b[0]);var E=new o(u,y.row,y.column),$=E.getCurrentToken();u.selection;var A=u.selection.toOrientedRange(),S,M;if($&&/comment/.test($.type)){for(var R,L;$&&/comment/.test($.type);){var T=$.value.indexOf(b.start);if(T!=-1){var D=E.getCurrentTokenRow(),w=E.getCurrentTokenColumn()+T;R=new a(D,w,D,w+b.start.length);break}$=E.stepBackward()}for(var E=new o(u,y.row,y.column),$=E.getCurrentToken();$&&/comment/.test($.type);){var T=$.value.indexOf(b.end);if(T!=-1){var D=E.getCurrentTokenRow(),w=E.getCurrentTokenColumn()+T;L=new a(D,w,D,w+b.end.length);break}$=E.stepForward()}L&&u.remove(L),R&&(u.remove(R),S=R.start.row,M=-b.start.length)}else M=b.start.length,S=f.start.row,u.insert(f.end,b.end),u.insert(f.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,f){return this.$getIndent(u)},this.checkOutdent=function(i,u,f){return!1},this.autoOutdent=function(i,u,f){},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 f=i[u],y=f.prototype.$id,b=h.$modes[y];b||(h.$modes[y]=b=new f),h.$modes[u]||(h.$modes[u]=b),this.$embeds.push(u),this.$modes[u]=b}for(var E=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],$=function(S){(function(M){var R=E[S],L=M[R];M[E[S]]=function(){return this.$delegator(R,arguments,L)}})(A)},A=this,u=0;u<E.length;u++)$(u)},this.$delegator=function(i,u,f){var y=u[0]||"start";if(typeof y!="string"){if(Array.isArray(y[2])){var b=y[2][y[2].length-1],E=this.$modes[b];if(E)return E[i].apply(E,[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 E=this.$modes[this.$embeds[$]];return E[i].apply(E,u)}}var S=f.apply(this,u);return f?S:void 0},this.transformAction=function(i,u,f,y,b){if(this.$behaviour){var E=this.$behaviour.getBehaviours();for(var $ in E)if(E[$][u]){var A=E[$][u].apply(this,arguments);if(A)return A}}},this.getKeywords=function(i){if(!this.completionKeywords){var u=this.$tokenizer.rules,f=[];for(var y in u)for(var b=u[y],E=0,$=b.length;E<$;E++)if(typeof b[E].token=="string")/keyword|support|storage/.test(b[E].token)&&f.push(b[E].regex);else if(typeof b[E].token=="object"){for(var A=0,S=b[E].token.length;A<S;A++)if(/keyword|support|storage/.test(b[E].token[A])){var y=b[E].regex.match(/\(.+?\)/g)[A];f.push(y.substr(1,y.length-2))}}this.completionKeywords=f}return i?f.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(i,u,f,y){var b=this.$keywordList||this.$createKeywordList();return b.map(function(E){return{name:E,value:E,score:0,meta:"keyword"}})},this.$id="ace/mode/text"}).call(s.prototype),n.Mode=s}),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],function(t,n,p){var h=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 d;return this.lineWidgets?d=this.lineWidgets[c]&&this.lineWidgets[c].rowCount||0:d=0,!this.$useWrapMode||!this.$wrapData[c]?1+d:this.$wrapData[c].length+1+d},m.prototype.$getWidgetScreenLength=function(){var c=0;return this.lineWidgets.forEach(function(d){d&&d.rowCount&&!d.hidden&&(c+=d.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 d=this.editor;if(d){this.editor=null,d.widgetManager=null,d.renderer.off("beforeRender",this.measureWidgets),d.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,d){var r=d.lineWidgets;if(!(!r||!c.action)){for(var o=c.data,a=o.start.row,s=o.end.row,i=c.action=="add",u=a+1;u<s;u++)r[u]&&(r[u].hidden=i);r[s]&&(i?r[a]?r[s].hidden=i:r[a]=r[s]:(r[a]==r[s]&&(r[a]=void 0),r[s].hidden=i))}},m.prototype.updateOnChange=function(c){var d=this.session.lineWidgets;if(d){var r=c.start.row,o=c.end.row-r;if(o!==0)if(c.action=="remove"){var a=d.splice(r+1,o);!d[r]&&a[a.length-1]&&(d[r]=a.pop()),a.forEach(function(i){i&&this.removeLineWidget(i)},this),this.$updateRows()}else{var s=new Array(o);d[r]&&d[r].column!=null&&c.start.column>d[r].column&&r++,s.unshift(r,0),d.splice.apply(d,s),this.$updateRows()}}},m.prototype.$updateRows=function(){var c=this.session.lineWidgets;if(c){var d=!0;c.forEach(function(r,o){if(r)for(d=!1,r.row=o;r.$oldWidget;)r.$oldWidget.row=o,r=r.$oldWidget}),d&&(this.session.lineWidgets=null)}},m.prototype.$registerLineWidget=function(c){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var d=this.session.lineWidgets[c.row];return d&&(c.$oldWidget=d,d.el&&d.el.parentNode&&(d.el.parentNode.removeChild(d.el),d._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 d=this.editor.renderer;c.html&&!c.el&&(c.el=h.createElement("div"),c.el.innerHTML=c.html),c.text&&!c.el&&(c.el=h.createElement("div"),c.el.textContent=c.text),c.el&&(h.addCssClass(c.el,"ace_lineWidgetContainer"),c.className&&h.addCssClass(c.el,c.className),c.el.style.position="absolute",c.el.style.zIndex="5",d.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/d.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,d),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 d=this.session.lineWidgets[c.row];if(d==c)this.session.lineWidgets[c.row]=c.$oldWidget,c.$oldWidget&&this.onWidgetChanged(c.$oldWidget);else for(;d;){if(d.$oldWidget==c){d.$oldWidget=c.$oldWidget;break}d=d.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:c.row}}}),this.$updateRows()},m.prototype.getWidgetsAtRow=function(c){for(var d=this.session.lineWidgets,r=d&&d[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,d){var r=this.session._changedWidgets,o=d.layerConfig;if(!(!r||!r.length)){for(var a=1/0,s=0;s<r.length;s++){var i=r[s];if(!(!i||!i.el)&&i.session==this.session){if(!i._inDocument){if(this.session.lineWidgets[i.row]!=i)continue;i._inDocument=!0,d.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<a&&(a=i.row))}}a!=1/0&&(this.session._emit("changeFold",{data:{start:{row:a}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},m.prototype.renderWidgets=function(c,d){var r=d.layerConfig,o=this.session.lineWidgets;if(o){for(var a=Math.min(this.firstRow,r.firstRow),s=Math.max(this.lastRow,r.lastRow,o.length);a>0&&!o[a];)a--;this.firstRow=r.firstRow,this.lastRow=r.lastRow,d.$cursorLayer.config=r;for(var i=a;i<=s;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,d.container.appendChild(u.el));var f=d.$cursorLayer.getPixelPosition({row:i,column:0},!0).top;u.coverLine||(f+=r.lineHeight*this.session.getRowLineCount(u.row)),u.el.style.top=f-r.offset+"px";var y=u.coverGutter?0:d.gutterWidth;u.fixedWidth||(y-=d.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=d.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(h,g,m){var c=g.start.row,d=g.start.column,r=h[c]||"";switch(g.action){case"insert":var o=g.lines;if(o.length===1)h[c]=r.substring(0,d)+g.lines[0]+r.substring(d);else{var a=[c,1].concat(g.lines);h.splice.apply(h,a),h[c]=r.substring(0,d)+h[c],h[c+g.lines.length-1]+=r.substring(d)}break;case"remove":var s=g.end.column,i=g.end.row;c===i?h[c]=r.substring(0,d)+r.substring(s):h.splice(c,i-c+1,r.substring(0,d)+h[i].substring(s));break}}}),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],function(t,n,p){var h=t("./lib/oop"),g=t("./lib/event_emitter").EventEmitter,m=(function(){function r(o,a,s){this.$onChange=this.onChange.bind(this),this.attach(o),typeof a!="number"?this.setPosition(a.row,a.column):this.setPosition(a,s)}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 a=d(o,{row:this.row,column:this.column},this.$insertRight);this.setPosition(a.row,a.column,!0)}},r.prototype.setPosition=function(o,a,s){var i;if(s?i={row:o,column:a}:i=this.$clipPositionToDocument(o,a),!(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,a){var s={};return o>=this.document.getLength()?(s.row=Math.max(0,this.document.getLength()-1),s.column=this.document.getLine(s.row).length):o<0?(s.row=0,s.column=0):(s.row=o,s.column=Math.min(this.document.getLine(s.row).length,Math.max(0,a))),a<0&&(s.column=0),s},r})();m.prototype.$insertRight=!1,h.implement(m.prototype,g);function c(r,o,a){var s=a?r.column<=o.column:r.column<o.column;return r.row<o.row||r.row==o.row&&s}function d(r,o,a){var s=r.action=="insert",i=(s?1:-1)*(r.end.row-r.start.row),u=(s?1:-1)*(r.end.column-r.start.column),f=r.start,y=s?f:r.end;return c(o,f,a)?{row:o.row,column:o.column}:c(y,o,!a)?{row:o.row+i,column:o.column+(o.row==y.row?u:0)}:{row:f.row,column:f.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 h=t("./lib/oop"),g=t("./apply_delta").applyDelta,m=t("./lib/event_emitter").EventEmitter,c=t("./range").Range,d=t("./anchor").Anchor,r=(function(){function o(a){this.$lines=[""],a.length===0?this.$lines=[""]:Array.isArray(a)?this.insertMergedLines({row:0,column:0},a):this.insert({row:0,column:0},a)}return o.prototype.setValue=function(a){var s=this.getLength()-1;this.remove(new c(0,0,s,this.getLine(s).length)),this.insert({row:0,column:0},a||"")},o.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},o.prototype.createAnchor=function(a,s){return new d(this,a,s)},o.prototype.$detectNewLine=function(a){var s=a.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=s?s[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
|
-
`}},o.prototype.setNewLineMode=function(
|
|
1353
|
-
`||
|
|
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,f){var d=t("./lib/oop"),g=t("./lib/event_emitter").EventEmitter,m=(function(){function c(p,r){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=p;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(p){this.tokenizer=p,this.lines=[],this.states=[],this.start(0)},c.prototype.setDocument=function(p){this.doc=p,this.lines=[],this.states=[],this.stop()},c.prototype.fireUpdateEvent=function(p,r){var o={first:p,last:r};this._signal("update",{data:o})},c.prototype.start=function(p){this.currentLine=Math.min(p||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(p){var r=p.start.row,o=p.end.row-r;if(o===0)this.lines[r]=null;else if(p.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(p){return this.lines[p]||this.$tokenizeRow(p)},c.prototype.getState=function(p){return this.currentLine==p&&this.$tokenizeRow(p),this.states[p]||"start"},c.prototype.$tokenizeRow=function(p){var r=this.doc.getLine(p),o=this.states[p-1],s=this.tokenizer.getLineTokens(r,o,p);return this.states[p]+""!=s.state+""?(this.states[p]=s.state,this.lines[p+1]=null,this.currentLine>p+1&&(this.currentLine=p+1)):this.currentLine==p&&(this.currentLine=p+1),this.lines[p]=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,f){var d=t("./lib/lang"),g=t("./range").Range,m=(function(){function c(p,r,o){o===void 0&&(o="text"),this.setRegexp(p),this.clazz=r,this.type=o}return c.prototype.setRegexp=function(p){this.regExp+""!=p+""&&(this.regExp=p,this.cache=[])},c.prototype.update=function(p,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(p,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,f){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)+`
|
|
1352
|
+
`}},o.prototype.setNewLineMode=function(a){this.$newLineMode!==a&&(this.$newLineMode=a,this._signal("changeNewLineMode"))},o.prototype.getNewLineMode=function(){return this.$newLineMode},o.prototype.isNewLine=function(a){return a==`\r
|
|
1353
|
+
`||a=="\r"||a==`
|
|
1354
|
+
`},o.prototype.getLine=function(a){return this.$lines[a]||""},o.prototype.getLines=function(a,s){return this.$lines.slice(a,s+1)},o.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},o.prototype.getLength=function(){return this.$lines.length},o.prototype.getTextRange=function(a){return this.getLinesForRange(a).join(this.getNewLineCharacter())},o.prototype.getLinesForRange=function(a){var s;if(a.start.row===a.end.row)s=[this.getLine(a.start.row).substring(a.start.column,a.end.column)];else{s=this.getLines(a.start.row,a.end.row),s[0]=(s[0]||"").substring(a.start.column);var i=s.length-1;a.end.row-a.start.row==i&&(s[i]=s[i].substring(0,a.end.column))}return s},o.prototype.insertLines=function(a,s){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(a,s)},o.prototype.removeLines=function(a,s){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(a,s)},o.prototype.insertNewLine=function(a){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(a,["",""])},o.prototype.insert=function(a,s){return this.getLength()<=1&&this.$detectNewLine(s),this.insertMergedLines(a,this.$split(s))},o.prototype.insertInLine=function(a,s){var i=this.clippedPos(a.row,a.column),u=this.pos(a.row,a.column+s.length);return this.applyDelta({start:i,end:u,action:"insert",lines:[s]},!0),this.clonePos(u)},o.prototype.clippedPos=function(a,s){var i=this.getLength();a===void 0?a=i:a<0?a=0:a>=i&&(a=i-1,s=void 0);var u=this.getLine(a);return s==null&&(s=u.length),s=Math.min(Math.max(s,0),u.length),{row:a,column:s}},o.prototype.clonePos=function(a){return{row:a.row,column:a.column}},o.prototype.pos=function(a,s){return{row:a,column:s}},o.prototype.$clipPosition=function(a){var s=this.getLength();return a.row>=s?(a.row=Math.max(0,s-1),a.column=this.getLine(s-1).length):(a.row=Math.max(0,a.row),a.column=Math.min(Math.max(a.column,0),this.getLine(a.row).length)),a},o.prototype.insertFullLines=function(a,s){a=Math.min(Math.max(a,0),this.getLength());var i=0;a<this.getLength()?(s=s.concat([""]),i=0):(s=[""].concat(s),a--,i=this.$lines[a].length),this.insertMergedLines({row:a,column:i},s)},o.prototype.insertMergedLines=function(a,s){var i=this.clippedPos(a.row,a.column),u={row:i.row+s.length-1,column:(s.length==1?i.column:0)+s[s.length-1].length};return this.applyDelta({start:i,end:u,action:"insert",lines:s}),this.clonePos(u)},o.prototype.remove=function(a){var s=this.clippedPos(a.start.row,a.start.column),i=this.clippedPos(a.end.row,a.end.column);return this.applyDelta({start:s,end:i,action:"remove",lines:this.getLinesForRange({start:s,end:i})}),this.clonePos(s)},o.prototype.removeInLine=function(a,s,i){var u=this.clippedPos(a,s),f=this.clippedPos(a,i);return this.applyDelta({start:u,end:f,action:"remove",lines:this.getLinesForRange({start:u,end:f})},!0),this.clonePos(u)},o.prototype.removeFullLines=function(a,s){a=Math.min(Math.max(0,a),this.getLength()-1),s=Math.min(Math.max(0,s),this.getLength()-1);var i=s==this.getLength()-1&&a>0,u=s<this.getLength()-1,f=i?a-1:a,y=i?this.getLine(f).length:0,b=u?s+1:s,E=u?0:this.getLine(b).length,$=new c(f,y,b,E),A=this.$lines.slice(a,s+1);return this.applyDelta({start:$.start,end:$.end,action:"remove",lines:this.getLinesForRange($)}),A},o.prototype.removeNewLine=function(a){a<this.getLength()-1&&a>=0&&this.applyDelta({start:this.pos(a,this.getLine(a).length),end:this.pos(a+1,0),action:"remove",lines:["",""]})},o.prototype.replace=function(a,s){if(a instanceof c||(a=c.fromPoints(a.start,a.end)),s.length===0&&a.isEmpty())return a.start;if(s==this.getTextRange(a))return a.end;this.remove(a);var i;return s?i=this.insert(a.start,s):i=a.start,i},o.prototype.applyDeltas=function(a){for(var s=0;s<a.length;s++)this.applyDelta(a[s])},o.prototype.revertDeltas=function(a){for(var s=a.length-1;s>=0;s--)this.revertDelta(a[s])},o.prototype.applyDelta=function(a,s){var i=a.action=="insert";(i?a.lines.length<=1&&!a.lines[0]:!c.comparePoints(a.start,a.end))||(i&&a.lines.length>2e4?this.$splitAndapplyLargeDelta(a,2e4):(g(this.$lines,a,s),this._signal("change",a)))},o.prototype.$safeApplyDelta=function(a){var s=this.$lines.length;(a.action=="remove"&&a.start.row<s&&a.end.row<s||a.action=="insert"&&a.start.row<=s)&&this.applyDelta(a)},o.prototype.$splitAndapplyLargeDelta=function(a,s){for(var i=a.lines,u=i.length-s+1,f=a.start.row,y=a.start.column,b=0,E=0;b<u;b=E){E+=s-1;var $=i.slice(b,E);$.push(""),this.applyDelta({start:this.pos(f+b,y),end:this.pos(f+E,y=0),action:a.action,lines:$},!0)}a.lines=i.slice(b),a.start.row=f+b,a.start.column=y,this.applyDelta(a,!0)},o.prototype.revertDelta=function(a){this.$safeApplyDelta({start:this.clonePos(a.start),end:this.clonePos(a.end),action:a.action=="insert"?"remove":"insert",lines:a.lines.slice()})},o.prototype.indexToPosition=function(a,s){for(var i=this.$lines||this.getAllLines(),u=this.getNewLineCharacter().length,f=s||0,y=i.length;f<y;f++)if(a-=i[f].length+u,a<0)return{row:f,column:a+i[f].length+u};return{row:y-1,column:a+i[y-1].length+u}},o.prototype.positionToIndex=function(a,s){for(var i=this.$lines||this.getAllLines(),u=this.getNewLineCharacter().length,f=0,y=Math.min(a.row,i.length),b=s||0;b<y;++b)f+=i[b].length+u;return f+a.column},o.prototype.$split=function(a){return a.split(/\r\n|\r|\n/)},o})();r.prototype.$autoNewLine="",r.prototype.$newLineMode="auto",h.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 h=t("./lib/oop"),g=t("./lib/event_emitter").EventEmitter,m=(function(){function c(d,r){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=d;var o=this;this.$worker=function(){if(o.running){for(var a=new Date,s=o.currentLine,i=-1,u=o.doc,f=s;o.lines[s];)s++;var y=u.getLength(),b=0;for(o.running=!1;s<y;){o.$tokenizeRow(s),i=s;do s++;while(o.lines[s]);if(b++,b%5===0&&new Date-a>20){o.running=setTimeout(o.$worker,20);break}}o.currentLine=s,i==-1&&(i=s),f<=i&&o.fireUpdateEvent(f,i)}}}return c.prototype.setTokenizer=function(d){this.tokenizer=d,this.lines=[],this.states=[],this.start(0)},c.prototype.setDocument=function(d){this.doc=d,this.lines=[],this.states=[],this.stop()},c.prototype.fireUpdateEvent=function(d,r){var o={first:d,last:r};this._signal("update",{data:o})},c.prototype.start=function(d){this.currentLine=Math.min(d||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(d){var r=d.start.row,o=d.end.row-r;if(o===0)this.lines[r]=null;else if(d.action=="remove")this.lines.splice(r,o+1,null),this.states.splice(r,o+1,null);else{var a=Array(o+1);a.unshift(r,1),this.lines.splice.apply(this.lines,a),this.states.splice.apply(this.states,a)}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(d){return this.lines[d]||this.$tokenizeRow(d)},c.prototype.getState=function(d){return this.currentLine==d&&this.$tokenizeRow(d),this.states[d]||"start"},c.prototype.$tokenizeRow=function(d){var r=this.doc.getLine(d),o=this.states[d-1],a=this.tokenizer.getLineTokens(r,o,d);return this.states[d]+""!=a.state+""?(this.states[d]=a.state,this.lines[d+1]=null,this.currentLine>d+1&&(this.currentLine=d+1)):this.currentLine==d&&(this.currentLine=d+1),this.lines[d]=a.tokens},c.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},c})();h.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 h=t("./lib/lang"),g=t("./range").Range,m=(function(){function c(d,r,o){o===void 0&&(o="text"),this.setRegexp(d),this.clazz=r,this.type=o}return c.prototype.setRegexp=function(d){this.regExp+""!=d+""&&(this.regExp=d,this.cache=[])},c.prototype.update=function(d,r,o,a){if(this.regExp)for(var s=a.firstRow,i=a.lastRow,u={},f=s;f<=i;f++){var y=this.cache[f];y==null&&(y=h.getMatchOffsets(o.getLine(f),this.regExp),y.length>this.MAX_RANGES&&(y=y.slice(0,this.MAX_RANGES)),y=y.map(function(A){return new g(f,A.offset,f,A.offset+A.length)}),this.cache[f]=y.length?y:"");for(var b=y.length;b--;){var E=y[b].toScreenRange(o),$=E.toString();u[$]||(u[$]=!0,r.drawSingleLineMarker(d,E,this.clazz,a))}}},c})();m.prototype.MAX_RANGES=500,n.SearchHighlight=m}),ace.define("ace/undomanager",["require","exports","module","ace/range"],function(t,n,p){var h=(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 T=R[L][0];if(T.id<=S)break;T.id<M&&(T.ignore=!0)}this.lastDeltas=null},A.prototype.getSelection=function(S,M){for(var R=this.selections,L=R.length;L--;){var T=R[L];if(T.rev<S)return M&&(T=R[L+1]),T}},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,T=0,D=R.length;D--;){var w=R[D][0];if(w.id<M&&!L&&(L=D+1),w.id<=S){T=D+1;break}}return R.slice(T,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(),T=null;return L&&(T=S.undoChanges(L,M),this.$redoStack.push(L),this.$syncRev()),this.$fromUndo=!1,T}},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(),T=null;return L&&(T=S.redoChanges(L,M),this.$undoStack.push(L),this.$syncRev()),this.$fromUndo=!1,T},A.prototype.$syncRev=function(){var S=this.$undoStack,M=S[S.length-1],R=M&&M[0].id||0;this.$redoStackBaseRev=R,this.$rev=R},A.prototype.reset=function(){this.lastDeltas=null,this.$lastDelta=null,this.$undoStack=[],this.$redoStack=[],this.$rev=0,this.mark=0,this.$redoStackBaseRev=this.$rev,this.selections=[]},A.prototype.canUndo=function(){return this.$undoStack.length>0},A.prototype.canRedo=function(){return this.$redoStack.length>0},A.prototype.bookmark=function(S){S==null&&(S=this.$rev),this.mark=S},A.prototype.isAtBookmark=function(){return this.$rev===this.mark},A.prototype.toJSON=function(){return{$redoStack:this.$redoStack,$undoStack:this.$undoStack}},A.prototype.fromJSON=function(S){this.reset(),this.$undoStack=S.$undoStack,this.$redoStack=S.$redoStack},A.prototype.$prettyPrint=function(S){return S?o(S):o(this.$undoStack)+`
|
|
1355
1355
|
---
|
|
1356
|
-
`+o(this.$redoStack)},A})();
|
|
1357
|
-
`);var S="";return A.action?(S=A.action=="insert"?"+":"-",S+="["+A.lines+"]"):A.value&&(Array.isArray(A.value)?S=A.value.map(
|
|
1358
|
-
`):S=
|
|
1359
|
-
`)},m.prototype.idxToPosition=function(c){for(var p=0,r=0;r<this.folds.length;r++){var o=this.folds[r];if(c-=o.start.column-p,c<0)return{row:o.start.row,column:o.start.column+c};if(c-=o.placeholder.length,c<0)return o.start;p=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,f){var d=t("./range").Range,g=d.comparePoints,m=(function(){function c(){this.ranges=[],this.$bias=1}return c.prototype.pointIndex=function(p,r,o){for(var s=this.ranges,a=o||0;a<s.length;a++){var i=s[a],u=g(p,i.end);if(!(u>0)){var h=g(p,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(p){var r=!p.isEmpty(),o=this.pointIndex(p.start,r);o<0&&(o=-o-1);var s=this.pointIndex(p.end,r,o);return s<0?s=-s-1:s++,this.ranges.splice(o,s-o,p)},c.prototype.addList=function(p){for(var r=[],o=p.length;o--;)r.push.apply(r,this.add(p[o]));return r},c.prototype.substractPoint=function(p){var r=this.pointIndex(p);if(r>=0)return this.ranges.splice(r,1)},c.prototype.merge=function(){var p=[],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),p.push(o),o=s,a--)}return this.ranges=r,p},c.prototype.contains=function(p,r){return this.pointIndex({row:p,column:r})>=0},c.prototype.containsPoint=function(p){return this.pointIndex(p)>=0},c.prototype.rangeAtPoint=function(p){var r=this.pointIndex(p);if(r>=0)return this.ranges[r]},c.prototype.clipRows=function(p,r){var o=this.ranges;if(o[0].start.row>r||o[o.length-1].start.row<p)return[];var s=this.pointIndex({row:p,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(p){this.session&&this.detach(),this.session=p,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(p){for(var r=p.start,o=p.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(p.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,f){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)){p(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 p(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,f){var d=t("../range").Range,g=t("./fold_line").FoldLine,m=t("./fold").Fold,c=t("../token_iterator").TokenIterator,p=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 p&&(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,f){var d=t("../token_iterator").TokenIterator,g=t("../range").Range;function m(){this.findMatchingBracket=function(c,p){if(c.column==0)return null;var r=p||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 p=this.getLine(c.row),r=!0,o,s=p.charAt(c.column-1),a=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(a||(s=p.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,p){var r=this.getLine(c.row),o=/([\(\[\{])|([\)\]\}])/,s=!p&&r.charAt(c.column-1),a=s&&s.match(o);if(a||(s=(p===void 0||p)&&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,p,r){var o=this.$brackets[c],s=1,a=new d(this,p.row,p.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=p.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,p,r){var o=this.$brackets[c],s=1,a=new d(this,p.row,p.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=p.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 p=new d(this,c.row,c.column),r=this.$findTagName(p);if(r){var o=p.stepBackward();return o.value==="<"?this.$findClosingTag(p,r):this.$findOpeningTag(p,r)}},this.$findTagName=function(c){var p=c.getCurrentToken(),r=!1,o=!1;if(p&&p.type.indexOf("tag-name")===-1)do o?p=c.stepBackward():p=c.stepForward(),p&&(p.value==="/>"?o=!0:p.type.indexOf("tag-name")!==-1&&(r=!0));while(p&&!r);return p},this.$findClosingTag=function(c,p){var r,o=p.value,s=p.value,a=0,i=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);p=c.stepForward();var u=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+p.value.length),h=!1;do{if(r=p,r.type.indexOf("tag-close")!==-1&&!h){var y=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);h=!0}if(p=c.stepForward(),p){if(p.value===">"&&!h){var y=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);h=!0}if(p.type.indexOf("tag-name")!==-1){if(o=p.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);p=c.stepForward();var x=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+p.value.length);if(p.type.indexOf("tag-close")===-1&&(p=c.stepForward()),p&&p.value===">")var $=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);else return}}}else if(s===o&&p.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(p&&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,p){var r=c.getCurrentToken(),o=p.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()+p.value.length);if(p.type.indexOf("tag-close")===-1&&(p=c.stepForward()),!(!p||p.value!==">")){var w=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);c.stepBackward(),c.stepBackward();do if(p=r,a=c.getCurrentTokenRow(),i=c.getCurrentTokenColumn(),u=i+p.value.length,r=c.stepBackward(),p){if(p.type.indexOf("tag-name")!==-1){if(o===p.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 p=c.stepForward();while(p&&p.value!==">");var A=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1)}}else r.value==="</"&&s--}else if(p.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,f){var d=t("./lib/oop"),g=t("./lib/lang"),m=t("./bidihandler").BidiHandler,c=t("./config"),p=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
|
|
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,p);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,f){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=p(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,`$
|
|
1356
|
+
`+o(this.$redoStack)},A})();h.prototype.hasUndo=h.prototype.canUndo,h.prototype.hasRedo=h.prototype.canRedo,h.prototype.isClean=h.prototype.isAtBookmark,h.prototype.markClean=h.prototype.bookmark;function g(A,S){for(var M=S;M--;){var R=A[M];if(R&&!R[0].ignore){for(;M<S-1;){var L=i(A[M],A[M+1]);A[M]=L[0],A[M+1]=L[1],M++}return!0}}}var m=t("./range").Range,c=m.comparePoints;m.comparePoints;function d(A){return{row:A.row,column:A.column}}function r(A){return{start:d(A.start),end:d(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
|
+
`);var S="";return A.action?(S=A.action=="insert"?"+":"-",S+="["+A.lines+"]"):A.value&&(Array.isArray(A.value)?S=A.value.map(a).join(`
|
|
1358
|
+
`):S=a(A.value)),A.start&&(S+=a(A)),(A.id||A.rev)&&(S+=" ("+(A.id||A.rev)+")"),S}function a(A){return A.start.row+":"+A.start.column+"=>"+A.end.row+":"+A.end.column}function s(A,S){var M=A.action=="insert",R=S.action=="insert";if(M&&R)if(c(S.start,A.end)>=0)f(S,A,-1);else if(c(S.start,A.start)<=0)f(A,S,1);else return null;else if(M&&!R)if(c(S.start,A.end)>=0)f(S,A,-1);else if(c(S.end,A.start)<=0)f(A,S,-1);else return null;else if(!M&&R)if(c(S.start,A.start)>=0)f(S,A,1);else if(c(S.start,A.start)<=0)f(A,S,1);else return null;else if(!M&&!R)if(c(S.start,A.start)>=0)f(S,A,1);else if(c(S.end,A.start)<=0)f(A,S,-1);else return null;return[S,A]}function i(A,S){for(var M=A.length;M--;)for(var R=0;R<S.length;R++)if(!s(A[M],S[R])){for(;M<A.length;){for(;R--;)s(S[R],A[M]);R=S.length,M++}return[A,S]}return A.selectionBefore=S.selectionBefore=A.selectionAfter=S.selectionAfter=null,[S,A]}function u(A,S){var M=A.action=="insert",R=S.action=="insert";if(M&&R)c(A.start,S.start)<0?f(S,A,1):f(A,S,1);else if(M&&!R)c(A.start,S.end)>=0?f(A,S,-1):(c(A.start,S.start)<=0||f(A,m.fromPoints(S.start,A.start),-1),f(S,A,1));else if(!M&&R)c(S.start,A.end)>=0?f(S,A,-1):(c(S.start,A.start)<=0||f(S,m.fromPoints(A.start,S.start),-1),f(A,S,1));else if(!M&&!R)if(c(S.start,A.end)>=0)f(S,A,-1);else if(c(S.end,A.start)<=0)f(A,S,-1);else{var L,T;return c(A.start,S.start)<0&&(L=A,A=b(A,S.start)),c(A.end,S.end)>0&&(T=b(A,S.end)),y(S.end,A.start,A.end,-1),T&&!L&&(A.lines=T.lines,A.start=T.start,A.end=T.end,T=A),[S,L,T].filter(Boolean)}return[S,A]}function f(A,S,M){y(A.start,S.start,S.end,M),y(A.end,S.start,S.end,M)}function y(A,S,M,R){A.row==(R==1?S:M).row&&(A.column+=R*(M.column-S.column)),A.row+=R*(M.row-S.row)}function b(A,S){var M=A.lines,R=A.end;A.end=d(S);var L=A.end.row-A.start.row,T=M.splice(L,M.length),D=L?S.column:S.column-A.start.column;M.push(T[0].substring(0,D)),T[0]=T[0].substr(D);var w={start:d(S),end:R,lines:T,action:A.action};return w}function E(A,S){S=r(S);for(var M=A.length;M--;){for(var R=A[M],L=0;L<R.length;L++){var T=R[L],D=u(T,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(M,1)}return A}function $(A,S){for(var M=0;M<S.length;M++)for(var R=S[M],L=0;L<R.length;L++)E(A,R[L])}n.UndoManager=h}),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],function(t,n,p){var h=t("../range").Range,g=(function(){function m(c,d){this.foldData=c,Array.isArray(d)?this.folds=d:d=this.folds=[d];var r=d[d.length-1];this.range=new h(d[0].start.row,d[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(d){d.start.row+=c,d.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(d,r){return-d.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,d,r){var o=0,a=this.folds,s,i,u,f=!0;d==null&&(d=this.end.row,r=this.end.column);for(var y=0;y<a.length;y++){if(s=a[y],i=s.range.compareStart(d,r),i==-1){c(null,d,r,o,f);return}if(u=c(null,s.start.row,s.start.column,o,f),u=!u&&c(s.placeholder,s.start.row,s.start.column,o),u||i===0)return;f=!s.sameRow,o=s.end.column}c(null,d,r,o,f)},m.prototype.getNextFoldTo=function(c,d){for(var r,o,a=0;a<this.folds.length;a++){if(r=this.folds[a],o=r.range.compareEnd(c,d),o==-1)return{fold:r,kind:"after"};if(o===0)return{fold:r,kind:"inside"}}return null},m.prototype.addRemoveChars=function(c,d,r){var o=this.getNextFoldTo(c,d),a,s;if(o){if(a=o.fold,o.kind=="inside"&&a.start.column!=d&&a.start.row!=c)window.console&&window.console.log(c,d,a);else if(a.start.row==c){s=this.folds;var i=s.indexOf(a);for(i===0&&(this.start.column+=r),i;i<s.length;i++){if(a=s[i],a.start.column+=r,!a.sameRow)return;a.end.column+=r}this.end.column+=r}}},m.prototype.split=function(c,d){var r=this.getNextFoldTo(c,d);if(!r||r.kind=="inside")return null;var o=r.fold,a=this.folds,s=this.foldData,i=a.indexOf(o),u=a[i-1];this.end.row=u.end.row,this.end.column=u.end.column,a=a.splice(i,a.length-i);var f=new m(s,a);return s.splice(s.indexOf(this)+1,0,f),f},m.prototype.merge=function(c){for(var d=c.folds,r=0;r<d.length;r++)this.addFold(d[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(d){c.push(" "+d.toString())}),c.push("]"),c.join(`
|
|
1359
|
+
`)},m.prototype.idxToPosition=function(c){for(var d=0,r=0;r<this.folds.length;r++){var o=this.folds[r];if(c-=o.start.column-d,c<0)return{row:o.start.row,column:o.start.column+c};if(c-=o.placeholder.length,c<0)return o.start;d=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 h=t("./range").Range,g=h.comparePoints,m=(function(){function c(){this.ranges=[],this.$bias=1}return c.prototype.pointIndex=function(d,r,o){for(var a=this.ranges,s=o||0;s<a.length;s++){var i=a[s],u=g(d,i.end);if(!(u>0)){var f=g(d,i.start);return u===0?r&&f!==0?-s-2:s:f>0||f===0&&!r?s:-s-1}}return-s-1},c.prototype.add=function(d){var r=!d.isEmpty(),o=this.pointIndex(d.start,r);o<0&&(o=-o-1);var a=this.pointIndex(d.end,r,o);return a<0?a=-a-1:a++,this.ranges.splice(o,a-o,d)},c.prototype.addList=function(d){for(var r=[],o=d.length;o--;)r.push.apply(r,this.add(d[o]));return r},c.prototype.substractPoint=function(d){var r=this.pointIndex(d);if(r>=0)return this.ranges.splice(r,1)},c.prototype.merge=function(){var d=[],r=this.ranges;r=r.sort(function(u,f){return g(u.start,f.start)});for(var o=r[0],a,s=1;s<r.length;s++){a=o,o=r[s];var i=g(a.end,o.start);i<0||i==0&&!a.isEmpty()&&!o.isEmpty()||(g(a.end,o.end)<0&&(a.end.row=o.end.row,a.end.column=o.end.column),r.splice(s,1),d.push(o),o=a,s--)}return this.ranges=r,d},c.prototype.contains=function(d,r){return this.pointIndex({row:d,column:r})>=0},c.prototype.containsPoint=function(d){return this.pointIndex(d)>=0},c.prototype.rangeAtPoint=function(d){var r=this.pointIndex(d);if(r>=0)return this.ranges[r]},c.prototype.clipRows=function(d,r){var o=this.ranges;if(o[0].start.row>r||o[o.length-1].start.row<d)return[];var a=this.pointIndex({row:d,column:0});a<0&&(a=-a-1);var s=this.pointIndex({row:r,column:0},a);s<0&&(s=-s-1);for(var i=[],u=a;u<s;u++)i.push(o[u]);return i},c.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},c.prototype.attach=function(d){this.session&&this.detach(),this.session=d,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(d){for(var r=d.start,o=d.end,a=r.row,s=o.row,i=this.ranges,u=0,f=i.length;u<f;u++){var y=i[u];if(y.end.row>=a)break}if(d.action=="insert")for(var b=s-a,E=-r.column+o.column;u<f;u++){var y=i[u];if(y.start.row>a)break;if(y.start.row==a&&y.start.column>=r.column&&(y.start.column==r.column&&this.$bias<=0||(y.start.column+=E,y.start.row+=b)),y.end.row==a&&y.end.column>=r.column){if(y.end.column==r.column&&this.$bias<0)continue;y.end.column==r.column&&E>0&&u<f-1&&y.end.column>y.start.column&&y.end.column==i[u+1].start.column&&(y.end.column-=E),y.end.column+=E,y.end.row+=b}}else for(var b=a-s,E=r.column-o.column;u<f;u++){var y=i[u];if(y.start.row>s)break;y.end.row<s&&(a<y.end.row||a==y.end.row&&r.column<y.end.column)?(y.end.row=a,y.end.column=r.column):y.end.row==s?y.end.column<=o.column?(b||y.end.column>r.column)&&(y.end.column=r.column,y.end.row=r.row):(y.end.column+=E,y.end.row+=b):y.end.row>s&&(y.end.row+=b),y.start.row<s&&(a<y.start.row||a==y.start.row&&r.column<y.start.column)?(y.start.row=a,y.start.column=r.column):y.start.row==s?y.start.column<=o.column?(b||y.start.column>r.column)&&(y.start.column=r.column,y.start.row=r.row):(y.start.column+=E,y.start.row+=b):y.start.row>s&&(y.start.row+=b)}if(b!=0&&u<f)for(;u<f;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 h=this&&this.__extends||(function(){var a=function(s,i){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,f){u.__proto__=f}||function(u,f){for(var y in f)Object.prototype.hasOwnProperty.call(f,y)&&(u[y]=f[y])},a(s,i)};return function(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");a(s,i);function u(){this.constructor=s}s.prototype=i===null?Object.create(i):(u.prototype=i.prototype,new u)}})(),g=t("../range_list").RangeList,m=(function(a){h(s,a);function s(i,u){var f=a.call(this)||this;return f.foldLine=null,f.placeholder=u,f.range=i,f.start=i.start,f.end=i.end,f.sameRow=i.start.row==i.end.row,f.subFolds=f.ranges=[],f}return s.prototype.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},s.prototype.setFoldLine=function(i){this.foldLine=i,this.subFolds.forEach(function(u){u.setFoldLine(i)})},s.prototype.clone=function(){var i=this.range.clone(),u=new s(i,this.placeholder);return this.subFolds.forEach(function(f){u.subFolds.push(f.clone())}),u.collapseChildren=this.collapseChildren,u},s.prototype.addSubFold=function(i){if(!this.range.isEqual(i)){d(i,this.start);for(var E=i.start.row,$=i.start.column,u=0,f=-1;u<this.subFolds.length&&(f=this.subFolds[u].range.compare(E,$),f==1);u++);var y=this.subFolds[u],b=0;if(f==0){if(y.range.containsRange(i))return y.addSubFold(i);b=1}for(var E=i.range.end.row,$=i.range.end.column,A=u,f=-1;A<this.subFolds.length&&(f=this.subFolds[A].range.compare(E,$),f==1);A++);f==0&&A++;for(var S=this.subFolds.splice(u,A-u,i),M=f==0?S.length-1:S.length,R=b;R<M;R++)i.addSubFold(S[R]);return i.setFoldLine(this.foldLine),i}},s.prototype.restoreRange=function(i){return o(i,this.start)},s})(g);function c(a,s){a.row-=s.row,a.row==0&&(a.column-=s.column)}function d(a,s){c(a.start,s),c(a.end,s)}function r(a,s){a.row==0&&(a.column+=s.column),a.row+=s.row}function o(a,s){r(a.start,s),r(a.end,s)}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 h=t("../range").Range,g=t("./fold_line").FoldLine,m=t("./fold").Fold,c=t("../token_iterator").TokenIterator,d=t("../mouse/mouse_event").MouseEvent;function r(){this.getFoldAt=function(o,a,s){var i=this.getFoldLine(o);if(!i)return null;for(var u=i.folds,f=0;f<u.length;f++){var y=u[f].range;if(y.contains(o,a)){if(s==1&&y.isEnd(o,a)&&!y.isEmpty())continue;if(s==-1&&y.isStart(o,a)&&!y.isEmpty())continue;return u[f]}}},this.getFoldsInRange=function(o){var a=o.start,s=o.end,i=this.$foldData,u=[];a.column+=1,s.column-=1;for(var f=0;f<i.length;f++){var y=i[f].range.compareRange(o);if(y!=2){if(y==-2)break;for(var b=i[f].folds,E=0;E<b.length;E++){var $=b[E];if(y=$.range.compareRange(o),y==-2)break;if(y==2)continue;if(y==42)break;u.push($)}}}return a.column-=1,s.column+=1,u},this.getFoldsInRangeList=function(o){if(Array.isArray(o)){var a=[];o.forEach(function(s){a=a.concat(this.getFoldsInRange(s))},this)}else var a=this.getFoldsInRange(o);return a},this.getAllFolds=function(){for(var o=[],a=this.$foldData,s=0;s<a.length;s++)for(var i=0;i<a[s].folds.length;i++)o.push(a[s].folds[i]);return o},this.getFoldStringAt=function(o,a,s,i){if(i=i||this.getFoldLine(o),!i)return null;for(var u={end:{column:0}},f,y,b=0;b<i.folds.length;b++){y=i.folds[b];var E=y.range.compareEnd(o,a);if(E==-1){f=this.getLine(y.start.row).substring(u.end.column,y.start.column);break}else if(E===0)return null;u=y}return f||(f=this.getLine(y.start.row).substring(u.end.column)),s==-1?f.substring(0,a-u.end.column):s==1?f.substring(a-u.end.column):f},this.getFoldLine=function(o,a){var s=this.$foldData,i=0;for(a&&(i=s.indexOf(a)),i==-1&&(i=0),i;i<s.length;i++){var u=s[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,a){var s=this.$foldData,i=0;for(a&&(i=s.indexOf(a)),i==-1&&(i=0),i;i<s.length;i++){var u=s[i];if(u.end.row>=o)return u}return null},this.getFoldedRowCount=function(o,a){for(var s=this.$foldData,i=a-o+1,u=0;u<s.length;u++){var f=s[u],y=f.end.row,b=f.start.row;if(y>=a){b<a&&(b>=o?i-=a-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(a,s){return a.start.row-s.start.row}),o},this.addFold=function(o,a){var s=this.$foldData,i=!1,u;o instanceof m?u=o:(u=new m(a,o),u.collapseChildren=a.collapseChildren),this.$clipRangeToDocument(u.range);var f=u.start.row,y=u.start.column,b=u.end.row,E=u.end.column,$=this.getFoldAt(f,y,1),A=this.getFoldAt(b,E,-1);if($&&A==$)return $.addSubFold(u);$&&!$.range.isStart(f,y)&&this.removeFold($),A&&!A.range.isEnd(b,E)&&this.removeFold(A);var S=this.getFoldsInRange(u.range);S.length>0&&(this.removeFolds(S),u.collapseChildren||S.forEach(function(T){u.addSubFold(T)}));for(var M=0;M<s.length;M++){var R=s[M];if(b==R.start.row){R.addFold(u),i=!0;break}else if(f==R.end.row){if(R.addFold(u),i=!0,!u.sameRow){var L=s[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(a){this.addFold(a)},this)},this.removeFold=function(o){var a=o.foldLine,s=a.start.row,i=a.end.row,u=this.$foldData,f=a.folds;if(f.length==1)u.splice(u.indexOf(a),1);else if(a.range.isEnd(o.end.row,o.end.column))f.pop(),a.end.row=f[f.length-1].end.row,a.end.column=f[f.length-1].end.column;else if(a.range.isStart(o.start.row,o.start.column))f.shift(),a.start.row=f[0].start.row,a.start.column=f[0].start.column;else if(o.sameRow)f.splice(f.indexOf(o),1);else{var y=a.split(o.start.row,o.start.column);f=y.folds,f.shift(),y.start.row=f[0].start.row,y.start.column=f[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(s,i):this.$updateRowLengthCache(s,i)),this.$modified=!0,this._signal("changeFold",{data:o,action:"remove"})},this.removeFolds=function(o){for(var a=[],s=0;s<o.length;s++)a.push(o[s]);a.forEach(function(i){this.removeFold(i)},this),this.$modified=!0},this.expandFold=function(o){this.removeFold(o),o.subFolds.forEach(function(a){o.restoreRange(a),this.addFold(a)},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(a){this.expandFold(a)},this)},this.unfold=function(o,a){var s,i;if(o==null)s=new h(0,0,this.getLength(),0),a==null&&(a=!0);else if(typeof o=="number")s=new h(o,0,o,this.getLine(o).length);else if("row"in o)s=h.fromPoints(o,o);else{if(Array.isArray(o))return i=[],o.forEach(function(f){i=i.concat(this.unfold(f))},this),i;s=o}i=this.getFoldsInRangeList(s);for(var u=i;i.length==1&&h.comparePoints(i[0].start,s.start)<0&&h.comparePoints(i[0].end,s.end)>0;)this.expandFolds(i),i=this.getFoldsInRangeList(s);if(a!=!1?this.removeFolds(i):this.expandFolds(i),u.length)return u},this.isRowFolded=function(o,a){return!!this.getFoldLine(o,a)},this.getRowFoldEnd=function(o,a){var s=this.getFoldLine(o,a);return s?s.end.row:o},this.getRowFoldStart=function(o,a){var s=this.getFoldLine(o,a);return s?s.start.row:o},this.getFoldDisplayLine=function(o,a,s,i,u){i==null&&(i=o.start.row),u==null&&(u=0),a==null&&(a=o.end.row),s==null&&(s=this.getLine(a).length);var f=this.doc,y="";return o.walk(function(b,E,$,A){if(!(E<i)){if(E==i){if($<u)return;A=Math.max(u,A)}b!=null?y+=b:y+=f.getLine(E).substring(A,$)}},a,s),y},this.getDisplayLine=function(o,a,s,i){var u=this.getFoldLine(o);if(u)return this.getFoldDisplayLine(u,o,a,s,i);var f;return f=this.doc.getLine(o),f.substring(i||0,a||f.length)},this.$cloneFoldData=function(){var o=[];return o=this.$foldData.map(function(a){var s=a.folds.map(function(i){return i.clone()});return new g(o,s)}),o},this.toggleFold=function(o){var a=this.selection,s=a.getRange(),i,u;if(s.isEmpty()){var f=s.start;if(i=this.getFoldAt(f.row,f.column),i){this.expandFold(i);return}else(u=this.findMatchingBracket(f))?s.comparePoint(u)==1?s.end=u:(s.start=u,s.start.column++,s.end.column--):(u=this.findMatchingBracket({row:f.row,column:f.column+1}))?(s.comparePoint(u)==1?s.end=u:s.start=u,s.start.column++):s=this.getCommentFoldRange(f.row,f.column)||s}else{var y=this.getFoldsInRange(s);if(o&&y.length){this.expandFolds(y);return}else y.length==1&&(i=y[0])}if(i||(i=this.getFoldAt(s.start.row,s.start.column)),i&&i.range.toString()==s.toString()){this.expandFold(i);return}var b="...";if(!s.isMultiLine()){if(b=this.getTextRange(s),b.length<4)return;b=b.trim().substring(0,2)+".."}this.addFold(b,s)},this.getCommentFoldRange=function(o,a,s){var i=new c(this,o,a),u=i.getCurrentToken(),f=u&&u.type;if(u&&/^comment|string/.test(f)){f=f.match(/comment|string/)[0],f=="comment"&&(f+="|doc-start|\\.doc");var y=new RegExp(f),b=new h;if(s!=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,a);var E=this.getState(i.$row);if(s!=-1){var $=-1;do if(u=i.stepForward(),$==-1){var A=this.getState(i.$row);E.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,a,s,i){s==null&&(s=1e5);var u=this.foldWidgets;if(u){a=a||this.getLength(),o=o||0;for(var f=o;f<a;f++)if(u[f]==null&&(u[f]=this.getFoldWidget(f)),u[f]=="start"&&!(i&&!i(f))){var y=this.getFoldWidgetRange(f);y&&y.isMultiLine()&&y.end.row<=a&&y.start.row>=o&&(f=y.end.row,y.collapseChildren=s,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(a){for(var s=o.getTokens(a),i=0;i<s.length;i++){var u=s[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 a=this.$foldMode;this.$setFolding(null),this.$setFolding(a)}},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,a){var s=this.foldWidgets;if(!s||a&&s[o])return{};for(var i=o-1,u;i>=0;){var f=s[i];if(f==null&&(f=s[i]=this.getFoldWidget(i)),f=="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,a){a instanceof d&&(a=a.domEvent);var s={children:a.shiftKey,all:a.ctrlKey||a.metaKey,siblings:a.altKey},i=this.$toggleFoldWidget(o,s);if(!i){var u=a.target||a.srcElement;u&&/ace_fold-widget/.test(u.className)&&(u.className+=" ace_invalid")}},this.$toggleFoldWidget=function(o,a){if(this.getFoldWidget){var s=this.getFoldWidget(o),i=this.getLine(o),u=s==="end"?-1:1,f=this.getFoldAt(o,u===-1?0:i.length,u);if(f)return a.children||a.all?this.removeFold(f):this.expandFold(f),f;var y=this.getFoldWidgetRange(o,!0);if(y&&!y.isMultiLine()&&(f=this.getFoldAt(y.start.row,y.start.column,1),f&&y.isEqual(f.range)))return this.removeFold(f),f;if(a.siblings){var b=this.getParentFoldRangeData(o);if(b.range)var E=b.range.start.row+1,$=b.range.end.row;this.foldAll(E,$,a.all?1e4:0)}else a.children?($=y?y.end.row:this.getLength(),this.foldAll(o+1,$,a.all?1e4:0)):y&&(a.all&&(y.collapseChildren=1e4),this.addFold("...",y));return y}},this.toggleFoldWidget=function(o){var a=this.selection.getCursor().row;a=this.getRowFoldStart(a);var s=this.$toggleFoldWidget(a,{});if(!s){var i=this.getParentFoldRangeData(a,!0);if(s=i.range||i.firstRange,s){a=s.start.row;var u=this.getFoldAt(a,this.getLine(a).length,1);u?this.removeFold(u):this.addFold("...",s)}}},this.updateFoldWidgets=function(o){var a=o.start.row,s=o.end.row-a;if(s===0)this.foldWidgets[a]=null;else if(o.action=="remove")this.foldWidgets.splice(a,s+1,null);else{var i=Array(s+1);i.unshift(a,1),this.foldWidgets.splice.apply(this.foldWidgets,i)}},this.tokenizerUpdateFoldWidgets=function(o){var a=o.data;a.first!=a.last&&this.foldWidgets.length>a.first&&this.foldWidgets.splice(a.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 h=t("../token_iterator").TokenIterator,g=t("../range").Range;function m(){this.findMatchingBracket=function(c,d){if(c.column==0)return null;var r=d||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 d=this.getLine(c.row),r=!0,o,a=d.charAt(c.column-1),s=a&&a.match(/([\(\[\{])|([\)\]\}])/);if(s||(a=d.charAt(c.column),c={row:c.row,column:c.column+1},s=a&&a.match(/([\(\[\{])|([\)\]\}])/),r=!1),!s)return null;if(s[1]){var i=this.$findClosingBracket(s[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(s[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,d){var r=this.getLine(c.row),o=/([\(\[\{])|([\)\]\}])/,a=!d&&r.charAt(c.column-1),s=a&&a.match(o);if(s||(a=(d===void 0||d)&&r.charAt(c.column),c={row:c.row,column:c.column+1},s=a&&a.match(o)),!s)return null;var i=new g(c.row,c.column-1,c.row,c.column),u=s[1]?this.$findClosingBracket(s[1],c):this.$findOpeningBracket(s[2],c);if(!u)return[i];var f=new g(u.row,u.column,u.row,u.column+1);return[i,f]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(c,d,r){var o=this.$brackets[c],a=1,s=new h(this,d.row,d.column),i=s.getCurrentToken();if(i||(i=s.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=d.column-s.getCurrentTokenColumn()-2,f=i.value;;){for(;u>=0;){var y=f.charAt(u);if(y==o){if(a-=1,a==0)return{row:s.getCurrentTokenRow(),column:u+s.getCurrentTokenColumn()}}else y==c&&(a+=1);u-=1}do i=s.stepBackward();while(i&&!r.test(i.type));if(i==null)break;f=i.value,u=f.length-1}return null}},this.$findClosingBracket=function(c,d,r){var o=this.$brackets[c],a=1,s=new h(this,d.row,d.column),i=s.getCurrentToken();if(i||(i=s.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=d.column-s.getCurrentTokenColumn();;){for(var f=i.value,y=f.length;u<y;){var b=f.charAt(u);if(b==o){if(a-=1,a==0)return{row:s.getCurrentTokenRow(),column:u+s.getCurrentTokenColumn()}}else b==c&&(a+=1);u+=1}do i=s.stepForward();while(i&&!r.test(i.type));if(i==null)break;u=0}return null}},this.getMatchingTags=function(c){var d=new h(this,c.row,c.column),r=this.$findTagName(d);if(r){var o=d.stepBackward();return o.value==="<"?this.$findClosingTag(d,r):this.$findOpeningTag(d,r)}},this.$findTagName=function(c){var d=c.getCurrentToken(),r=!1,o=!1;if(d&&d.type.indexOf("tag-name")===-1)do o?d=c.stepBackward():d=c.stepForward(),d&&(d.value==="/>"?o=!0:d.type.indexOf("tag-name")!==-1&&(r=!0));while(d&&!r);return d},this.$findClosingTag=function(c,d){var r,o=d.value,a=d.value,s=0,i=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);d=c.stepForward();var u=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+d.value.length),f=!1;do{if(r=d,r.type.indexOf("tag-close")!==-1&&!f){var y=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);f=!0}if(d=c.stepForward(),d){if(d.value===">"&&!f){var y=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);f=!0}if(d.type.indexOf("tag-name")!==-1){if(o=d.value,a===o){if(r.value==="<")s++;else if(r.value==="</"&&(s--,s<0)){c.stepBackward();var b=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+2);d=c.stepForward();var E=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+d.value.length);if(d.type.indexOf("tag-close")===-1&&(d=c.stepForward()),d&&d.value===">")var $=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);else return}}}else if(a===o&&d.value==="/>"&&(s--,s<0))var b=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+2),E=b,$=E,y=new g(u.end.row,u.end.column,u.end.row,u.end.column+1)}}while(d&&s>=0);if(i&&y&&b&&$&&u&&E)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:E}},this.$findOpeningTag=function(c,d){var r=c.getCurrentToken(),o=d.value,a=0,s=c.getCurrentTokenRow(),i=c.getCurrentTokenColumn(),u=i+2,f=new g(s,i,s,u);c.stepForward();var y=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+d.value.length);if(d.type.indexOf("tag-close")===-1&&(d=c.stepForward()),!(!d||d.value!==">")){var b=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);c.stepBackward(),c.stepBackward();do if(d=r,s=c.getCurrentTokenRow(),i=c.getCurrentTokenColumn(),u=i+d.value.length,r=c.stepBackward(),d){if(d.type.indexOf("tag-name")!==-1){if(o===d.value)if(r.value==="<"){if(a++,a>0){var E=new g(s,i,s,u),$=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1);do d=c.stepForward();while(d&&d.value!==">");var A=new g(c.getCurrentTokenRow(),c.getCurrentTokenColumn(),c.getCurrentTokenRow(),c.getCurrentTokenColumn()+1)}}else r.value==="</"&&a--}else if(d.value==="/>"){for(var S=0,M=r;M;){if(M.type.indexOf("tag-name")!==-1&&M.value===o){a--;break}else if(M.value==="<")break;M=c.stepBackward(),S++}for(var R=0;R<S;R++)c.stepForward()}}while(r&&a<=0);if($&&A&&f&&b&&E&&y)return{openTag:new g($.start.row,$.start.column,A.end.row,A.end.column),closeTag:new g(f.start.row,f.start.column,b.end.row,b.end.column),openTagName:E,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 h=t("./lib/oop"),g=t("./lib/lang"),m=t("./bidihandler").BidiHandler,c=t("./config"),d=t("./lib/event_emitter").EventEmitter,r=t("./selection").Selection,o=t("./mode/text").Mode,a=t("./range").Range,s=t("./line_widgets").LineWidgets,i=t("./document").Document,u=t("./background_tokenizer").BackgroundTokenizer,f=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 x=this;this.bgTokenizer.on("update",function(_){x._signal("tokenizerUpdate",_)}),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),(typeof v!="object"||!v.getLine)&&(v=new i(v)),this.setDocument(v),this.selection=new r(this),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.selection.on("changeCursor",this.$onSelectionChange),this.$bidiHandler=new m(this),c.resetOptions(this),this.setMode(C),c._signal("session",this),this.destroyed=!1,this.$initOperationListeners()}return w.prototype.$initOperationListeners=function(){var v=this;this.curOp=null,this.on("change",function(){v.curOp||(v.startOperation(),v.curOp.selectionBefore=v.$lastSel),v.curOp.docChanged=!0},!0),this.on("changeSelection",function(){v.curOp||(v.startOperation(),v.curOp.selectionBefore=v.$lastSel),v.curOp.selectionChanged=!0},!0),this.$operationResetTimer=g.delayedCall(this.endOperation.bind(this,!0))},w.prototype.startOperation=function(v){if(this.curOp){if(!v||this.curOp.command)return;this.prevOp=this.curOp}v||(v={}),this.$operationResetTimer.schedule(),this.curOp={command:v.command||{},args:v.args},this.curOp.selectionBefore=this.selection.toJSON(),this._signal("startOperation",v)},w.prototype.endOperation=function(v){if(this.curOp){if(v&&v.returnValue===!1){this.curOp=null,this._signal("endOperation",v);return}if(v==!0&&this.curOp.command&&this.curOp.command.name=="mouse")return;var C=this.selection.toJSON();this.curOp.selectionAfter=C,this.$lastSel=this.selection.toJSON(),this.getUndoManager().addSelection(C),this._signal("beforeEndOperation"),this.prevOp=this.curOp,this.curOp=null,this._signal("endOperation",v)}},w.prototype.setDocument=function(v){this.doc&&this.doc.off("change",this.$onChange),this.doc=v,v.on("change",this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},w.prototype.getDocument=function(){return this.doc},Object.defineProperty(w.prototype,"widgetManager",{get:function(){var v=new s(this);return this.widgetManager=v,this.$editor&&v.attach(this.$editor),v},set:function(v){Object.defineProperty(this,"widgetManager",{writable:!0,enumerable:!0,configurable:!0,value:v})},enumerable:!1,configurable:!0}),w.prototype.$resetRowCache=function(v){if(!v){this.$docRowCache=[],this.$screenRowCache=[];return}var C=this.$docRowCache.length,x=this.$getRowCacheIndex(this.$docRowCache,v)+1;C>x&&(this.$docRowCache.splice(x,C),this.$screenRowCache.splice(x,C))},w.prototype.$getRowCacheIndex=function(v,C){for(var x=0,_=v.length-1;x<=_;){var k=x+_>>1,O=v[k];if(C>O)x=k+1;else if(C<O)_=k-1;else return k}return x-1},w.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0)},w.prototype.onChangeFold=function(v){var C=v.data;this.$resetRowCache(C.start.row)},w.prototype.onChange=function(v){this.$modified=!0,this.$bidiHandler.onChange(v),this.$resetRowCache(v.start.row);var C=this.$updateInternalDataOnChange(v);!this.$fromUndo&&this.$undoManager&&(C&&C.length&&(this.$undoManager.add({action:"removeFolds",folds:C},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(v,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange(v),this._signal("change",v)},w.prototype.onSelectionChange=function(){this._signal("changeSelection")},w.prototype.setValue=function(v){this.doc.setValue(v),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},w.fromJSON=function(v){typeof v=="string"&&(v=JSON.parse(v));var C=new y;C.$undoStack=v.history.undo,C.$redoStack=v.history.redo,C.mark=v.history.mark,C.$rev=v.history.rev;var x=new w(v.value);return v.folds.forEach(function(_){x.addFold("...",a.fromPoints(_.start,_.end))}),x.setAnnotations(v.annotations),x.setBreakpoints(v.breakpoints),x.setMode(v.mode),x.setScrollLeft(v.scrollLeft),x.setScrollTop(v.scrollTop),x.setUndoManager(C),x.selection.fromJSON(v.selection),x},w.prototype.toJSON=function(){return{annotations:this.$annotations,breakpoints:this.$breakpoints,folds:this.getAllFolds().map(function(v){return v.range}),history:this.getUndoManager(),mode:this.$mode.$id,scrollLeft:this.$scrollLeft,scrollTop:this.$scrollTop,selection:this.selection.toJSON(),value:this.doc.getValue()}},w.prototype.toString=function(){return this.doc.getValue()},w.prototype.getSelection=function(){return this.selection},w.prototype.getState=function(v){return this.bgTokenizer.getState(v)},w.prototype.getTokens=function(v){return this.bgTokenizer.getTokens(v)},w.prototype.getTokenAt=function(v,C){var x=this.bgTokenizer.getTokens(v),_,k=0;if(C==null){var O=x.length-1;k=this.getLine(v).length}else for(var O=0;O<x.length&&(k+=x[O].value.length,!(k>=C));O++);return _=x[O],_?(_.index=O,_.start=k-_.value.length,_):null},w.prototype.setUndoManager=function(v){if(this.$undoManager=v,this.$informUndoManager&&this.$informUndoManager.cancel(),v){var C=this;v.addSession(this),this.$syncInformUndoManager=function(){C.$informUndoManager.cancel(),C.mergeUndoDeltas=!1},this.$informUndoManager=g.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},w.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},w.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},w.prototype.getTabString=function(){return this.getUseSoftTabs()?g.stringRepeat(" ",this.getTabSize()):" "},w.prototype.setUseSoftTabs=function(v){this.setOption("useSoftTabs",v)},w.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},w.prototype.setTabSize=function(v){this.setOption("tabSize",v)},w.prototype.getTabSize=function(){return this.$tabSize},w.prototype.isTabStop=function(v){return this.$useSoftTabs&&v.column%this.$tabSize===0},w.prototype.setNavigateWithinSoftTabs=function(v){this.setOption("navigateWithinSoftTabs",v)},w.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},w.prototype.setOverwrite=function(v){this.setOption("overwrite",v)},w.prototype.getOverwrite=function(){return this.$overwrite},w.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},w.prototype.addGutterDecoration=function(v,C){this.$decorations[v]||(this.$decorations[v]=""),this.$decorations[v]+=" "+C,this._signal("changeBreakpoint",{})},w.prototype.removeGutterDecoration=function(v,C){this.$decorations[v]=(this.$decorations[v]||"").replace(" "+C,""),this._signal("changeBreakpoint",{})},w.prototype.getBreakpoints=function(){return this.$breakpoints},w.prototype.setBreakpoints=function(v){this.$breakpoints=[];for(var C=0;C<v.length;C++)this.$breakpoints[v[C]]="ace_breakpoint";this._signal("changeBreakpoint",{})},w.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},w.prototype.setBreakpoint=function(v,C){C===void 0&&(C="ace_breakpoint"),C?this.$breakpoints[v]=C:delete this.$breakpoints[v],this._signal("changeBreakpoint",{})},w.prototype.clearBreakpoint=function(v){delete this.$breakpoints[v],this._signal("changeBreakpoint",{})},w.prototype.addMarker=function(v,C,x,_){var k=this.$markerId++,O={range:v,type:x||"line",renderer:typeof x=="function"?x:null,clazz:C,inFront:!!_,id:k};return _?(this.$frontMarkers[k]=O,this._signal("changeFrontMarker")):(this.$backMarkers[k]=O,this._signal("changeBackMarker")),k},w.prototype.addDynamicMarker=function(v,C){if(v.update){var x=this.$markerId++;return v.id=x,v.inFront=!!C,C?(this.$frontMarkers[x]=v,this._signal("changeFrontMarker")):(this.$backMarkers[x]=v,this._signal("changeBackMarker")),v}},w.prototype.removeMarker=function(v){var C=this.$frontMarkers[v]||this.$backMarkers[v];if(C){var x=C.inFront?this.$frontMarkers:this.$backMarkers;delete x[v],this._signal(C.inFront?"changeFrontMarker":"changeBackMarker")}},w.prototype.getMarkers=function(v){return v?this.$frontMarkers:this.$backMarkers},w.prototype.highlight=function(v){if(!this.$searchHighlight){var C=new f(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(C)}this.$searchHighlight.setRegexp(v)},w.prototype.highlightLines=function(v,C,x,_){typeof C!="number"&&(x=C,C=v),x||(x="ace_step");var k=new a(v,0,C,1/0);return k.id=this.addMarker(k,x,"fullLine",_),k},w.prototype.setAnnotations=function(v){this.$annotations=v,this._signal("changeAnnotation",{})},w.prototype.getAnnotations=function(){return this.$annotations||[]},w.prototype.clearAnnotations=function(){this.setAnnotations([])},w.prototype.$detectNewLine=function(v){var C=v.match(/^.*?(\r?\n)/m);C?this.$autoNewLine=C[1]:this.$autoNewLine=`
|
|
1361
|
+
`},w.prototype.getWordRange=function(v,C){var x=this.getLine(v),_=!1;if(C>0&&(_=!!x.charAt(C-1).match(this.tokenRe)),_||(_=!!x.charAt(C).match(this.tokenRe)),_)var k=this.tokenRe;else if(/^\s+$/.test(x.slice(C-1,C+1)))var k=/\s/;else var k=this.nonTokenRe;var O=C;if(O>0){do O--;while(O>=0&&x.charAt(O).match(k));O++}for(var I=C;I<x.length&&x.charAt(I).match(k);)I++;return new a(v,O,v,I)},w.prototype.getAWordRange=function(v,C){for(var x=this.getWordRange(v,C),_=this.getLine(x.end.row);_.charAt(x.end.column).match(/[ \t]/);)x.end.column+=1;return x},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 x=v,_=x.path}else _=v||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new o),this.$modes[_]&&!x){this.$onChangeMode(this.$modes[_]),C&&C();return}this.$modeId=_,c.loadModule(["mode",_],(function(k){if(this.$modeId!==_)return C&&C();this.$modes[_]&&!x?this.$onChangeMode(this.$modes[_]):k&&k.Mode&&(k=new k.Mode(x),x||(this.$modes[_]=k,k.$id=_),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 x=this.$mode;this.$mode=v,this.$stopWorker(),this.$useWorker&&this.$startWorker();var _=v.getTokenizer();if(_.on!==void 0){var k=this.onReloadTokenizer.bind(this);_.on("update",k)}this.bgTokenizer.setTokenizer(_),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:x,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(),x=this.$rowLengthCache,_=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}x[P]==null&&(x[P]=this.$getStringScreenWidth(C[P])[0]),x[P]>_&&(_=x[P])}this.screenWidth=_}},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 x=v.length-1;x!=-1;x--){var _=v[x];_.action=="insert"||_.action=="remove"?this.doc.revertDelta(_):_.folds&&this.addFolds(_.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 x=0;x<v.length;x++){var _=v[x];(_.action=="insert"||_.action=="remove")&&this.doc.$safeApplyDelta(_)}!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 x(N){return C?N.action!=="insert":N.action==="insert"}for(var _,k,O=0;O<v.length;O++){var I=v[O];if(I.start){if(!_){x(I)?_=a.fromPoints(I.start,I.end):_=a.fromPoints(I.start,I.start);continue}x(I)?(k=I.start,_.compare(k.row,k.column)==-1&&_.setStart(k),k=I.end,_.compare(k.row,k.column)==1&&_.setEnd(k)):(k=I.start,_.compare(k.row,k.column)==-1&&(_=a.fromPoints(I.start,I.start)))}}return _},w.prototype.replace=function(v,C){return this.doc.replace(v,C)},w.prototype.moveText=function(v,C,x){var _=this.getTextRange(v),k=this.getFoldsInRange(v),O=a.fromPoints(C,C);if(!x){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,_),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},w.prototype.indentRows=function(v,C,x){x=x.replace(/\t/g,this.getTabString());for(var _=v;_<=C;_++)this.doc.insertInLine({row:_,column:0},x)},w.prototype.outdentRows=function(v){for(var C=v.collapseRows(),x=new a(0,0,0,0),_=this.getTabSize(),k=C.start.row;k<=C.end.row;++k){var O=this.getLine(k);x.start.row=k,x.end.row=k;for(var I=0;I<_&&O.charAt(I)==" ";++I);I<_&&O.charAt(I)==" "?(x.start.column=I,x.end.column=I+1):(x.start.column=0,x.end.column=I),this.remove(x)}},w.prototype.$moveLines=function(v,C,x){if(v=this.getRowFoldStart(v),C=this.getRowFoldEnd(C),x<0){var _=this.getRowFoldStart(v+x);if(_<0)return 0;var k=_-v}else if(x>0){var _=this.getRowFoldEnd(C+x);if(_>this.doc.getLength()-1)return 0;var k=_-C}else{v=this.$clipRowToDocument(v),C=this.$clipRowToDocument(C);var k=C-v+1}var O=new a(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=x==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 x=this.doc.getLength();v>=x?(v=x-1,C=this.doc.getLine(x-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 x=this.$wrapLimitRange;x.max<0&&(x={min:C,max:C});var _=this.$constrainWrapLimit(v,x.min,x.max);return _!=this.$wrapLimit&&_>1?(this.$wrapLimit=_,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,x){return C&&(v=Math.max(C,v)),x&&(v=Math.min(x,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,x=v.action,_=v.start,k=v.end,O=_.row,I=k.row,N=I-O,P=null;if(this.$updating=!0,N!=0)if(x==="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,_.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(_.row,_.column);K==0?(F=F.split(_.row,_.column),F&&(F.shiftRow(N),F.addRemoveChars(I,0,k.column-_.column))):K==-1&&(F.addRemoveChars(O,0,k.column-_.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),x==="remove"&&(P=this.getFoldsInRange(v),this.removeFolds(P),N=-N);var F=this.getFoldLine(O);F&&F.addRemoveChars(O,_.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 x=this.doc.getAllLines(),_=this.getTabSize(),k=this.$wrapData,O=this.$wrapLimit,I,N,P=v;for(C=Math.min(C,x.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(x[F].substring(z,H),I.length);I=I.concat(W)}).bind(this),N.end.row,x[N.end.row].length+1),k[N.start.row]=this.$computeWrapSplits(I,O,_),P=N.end.row+1):(I=this.$getDisplayTokens(x[P]),k[P]=this.$computeWrapSplits(I,O,_),P++)},w.prototype.$computeWrapSplits=function(v,C,x){if(v.length==0)return[];var _=[],k=v.length,O=0,I=0,N=this.$wrapAsCode,P=this.$indentedSoftWrap,B=C<=Math.max(2*x,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+=x;else{if(G==T)continue;break}}return N&&P!==!1&&(K+=x),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)}_.length||(z=F(),_.indent=z),I+=Y,_.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]==M;)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 _},w.prototype.$getDisplayTokens=function(v,C){var x=[],_;C=C||0;for(var k=0;k<v.length;k++){var O=v.charCodeAt(k);if(O==9){_=this.getScreenTabSize(x.length+C),x.push(L);for(var I=1;I<_;I++)x.push(T)}else O==32?x.push(R):O>39&&O<48||O>57&&O<64?x.push(M):O>=4352&&D(O)?x.push(E,$):x.push(E)}return x},w.prototype.$getStringScreenWidth=function(v,C,x){if(C==0)return[0,0];C==null&&(C=1/0),x=x||0;var _,k;for(k=0;k<v.length&&(_=v.charCodeAt(k),_==9?x+=this.getScreenTabSize(x):_>=4352&&D(_)?x+=2:x+=1,!(x>C));k++);return[x,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),x=this.$wrapData[C.row];return x.length&&x[0]<C.column?x.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 x=this.documentToScreenRow(v,C);return this.getScreenLastRowColumn(x)},w.prototype.getDocumentLastRowColumnPosition=function(v,C){var x=this.documentToScreenRow(v,C);return this.screenToDocumentPosition(x,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,x){if(v<0)return{row:0,column:0};var _,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)_=this.getFoldDisplayLine(U),k=U.start.row;else{if(N+P<=v||k>W)return{row:W,column:this.getLine(W).length};_=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],_=_.substring(O)))}return x!==void 0&&this.$bidiHandler.isBidiRow(N+G,k,G)&&(C=this.$bidiHandler.offsetToCol(x)),O+=this.$getStringScreenWidth(_,C-Y)[1],this.$useWrapMode&&O>=I&&(O=I-1),U?U.idxToPosition(O):{row:k,column:O}},w.prototype.documentToScreenPosition=function(v,C){if(typeof C>"u")var x=this.$clipPositionToDocument(v.row,v.column);else x=this.$clipPositionToDocument(v,C);v=x.row,C=x.column;var _=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],_=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;_+=this.getRowLength(N),N=I,H&&(this.$docRowCache.push(N),this.$screenRowCache.push(_))}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];)_++,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&&(_+=this.lineWidgets[N].rowsAbove),{row:_,column:K+this.$getStringScreenWidth(U)[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,_=0,C=this.$foldData[_++],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[_++],I=C?C.start.row:1/0)}else{v=this.getLength();for(var x=this.$foldData,_=0;_<x.length;_++)C=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,x,_){if(x===0)return[0,0];x||(x=1/0),_=_||0;var k,O;for(O=0;O<C.length&&(k=C.charAt(O),k===" "?_+=this.getScreenTabSize(_):_+=v.getCharacterWidth(k),!(_>x));O++);return[_,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,h.implement(b.prototype,d);var E=1,$=2,A=3,S=4,M=9,R=10,L=11,T=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 h=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 h.copyObject(this.$options)},r.prototype.setOptions=function(o){this.$options=o},r.prototype.find=function(o){var a=this.$options,s=this.$matchIterator(o,a);if(!s)return!1;var i=null;return s.forEach(function(u,f,y,b){return i=new m(u,f,y,b),f==b&&a.start&&a.start.start&&a.skipCurrent!=!1&&i.isEqual(a.start)?(i=null,!1):!0}),i},r.prototype.findAll=function(o){var a=this.$options;if(!a.needle)return[];this.$assembleRegExp(a);var s=a.range,i=s?o.getLines(s.start.row,s.end.row):o.doc.getAllLines(),u=[],f=a.re;if(a.$isMultiLine){var y=f.length,b=i.length-y,E;e:for(var $=f.offset||0;$<=b;$++){for(var A=0;A<y;A++)if(i[$+A].search(f[A])==-1)continue e;var S=i[$],M=i[$+y-1],R=S.length-S.match(f[0])[0].length,L=M.match(f[y-1])[0].length;E&&E.end.row===$&&E.end.column>R||(u.push(E=new m($,R,$+y-1,L)),y>2&&($=$+y-2))}}else for(var T=0;T<i.length;T++)for(var D=h.getMatchOffsets(i[T],f),A=0;A<D.length;A++){var w=D[A];u.push(new m(T,w.offset,T,w.offset+w.length))}if(s){for(var v=s.start.column,C=s.end.column,T=0,A=u.length-1;T<A&&u[T].start.column<v&&u[T].start.row==0;)T++;for(var x=s.end.row-s.start.row;T<A&&u[A].end.column>C&&u[A].end.row==x;)A--;for(u=u.slice(T,A+1),T=0,A=u.length;T<A;T++)u[T].start.row+=s.start.row,u[T].end.row+=s.start.row}return u},r.prototype.replace=function(o,a){var s=this.$options,i=this.$assembleRegExp(s);if(s.$isMultiLine)return a;if(i){var u=i.exec(o);if(!u||u[0].length!=o.length)return null;if(s.regExp||(a=a.replace(/\$/g,"$$$$")),a=o.replace(i,a),s.preserveCase){a=a.split("");for(var f=Math.min(o.length,o.length);f--;){var y=o[f];y&&y.toLowerCase()!=y?a[f]=a[f].toUpperCase():a[f]=a[f].toLowerCase()}a=a.join("")}return a}},r.prototype.$assembleRegExp=function(o,a){if(o.needle instanceof RegExp)return o.re=o.needle;var s=o.needle;if(!o.needle)return o.re=!1;o.regExp||(s=h.escapeRegExp(s));var i=o.caseSensitive?"gm":"gmi";try{new RegExp(s,"u"),o.$supportsUnicodeFlag=!0,i+="u"}catch{o.$supportsUnicodeFlag=!1}if(o.wholeWord&&(s=d(s,o)),o.$isMultiLine=!a&&/[\n\r]/.test(s),o.$isMultiLine)return o.re=this.$assembleMultilineRegExp(s,i);try{var u=new RegExp(s,i)}catch{u=!1}return o.re=u},r.prototype.$assembleMultilineRegExp=function(o,a){for(var s=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,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 p(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,f){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,p=(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})(p);o.call=function(s,a,i){p.prototype.$init.call(s,a,i,!0)},p.call=function(s,a,i){p.prototype.$init.call(s,a,i,!1)},n.HashHandler=o,n.MultiHashHandler=p}),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],function(t,n,f){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,p=(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(p.prototype,c),n.CommandManager=p}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(t,n,f){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(`
|
|
1363
|
+
`),i=[],u=0;u<s.length;u++)try{i.push(new RegExp(s[u],a))}catch{return!1}return i},r.prototype.$matchIterator=function(o,a){var s=this.$assembleRegExp(a);if(!s)return!1;var i=a.backwards==!0,u=a.skipCurrent!=!1,f=s.unicode,y=a.range,b=a.start;b||(b=y?y[i?"end":"start"]:o.selection.getRange()),b.start&&(b=b[u!=i?"end":"start"]);var E=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>=E;L--)if(M(L,Number.MAX_VALUE,R))return;if(a.wrap!=!1){for(L=$,E=b.row;L>=E;L--)if(M(L,Number.MAX_VALUE,R))return}}};else var A=function(L){var T=b.row;if(!M(T,b.column,L)){for(T=T+1;T<=$;T++)if(M(T,0,L))return;if(a.wrap!=!1){for(T=E,$=b.row;T<=$;T++)if(M(T,0,L))return}}};if(a.$isMultiLine)var S=s.length,M=function(R,L,T){var D=i?R-S+1:R;if(!(D<0||D+S>o.getLength())){var w=o.getLine(D),v=w.search(s[0]);if(!(!i&&v<L||v===-1)){for(var C=1;C<S;C++)if(w=o.getLine(D+C),w.search(s[C])==-1)return;var x=w.match(s[S-1])[0].length;if(!(i&&x>L)&&T(D,v,D+S-1,x))return!0}}};else if(i)var M=function(L,T,D){var w=o.getLine(L),v=[],C,x=0;for(s.lastIndex=0;C=s.exec(w);){var _=C[0].length;if(x=C.index,!_){if(x>=w.length)break;s.lastIndex=x+=h.skipEmptyMatch(w,x,f)}if(C.index+_>T)break;v.push(C.index,_)}for(var k=v.length-1;k>=0;k-=2){var O=v[k-1],_=v[k];if(D(L,O,L,O+_))return!0}};else var M=function(L,T,D){var w=o.getLine(L),v,C;for(s.lastIndex=T;C=s.exec(w);){var x=C[0].length;if(v=C.index,D(L,v,L,v+x))return!0;if(!x&&(s.lastIndex=v+=h.skipEmptyMatch(w,v,f),v>=w.length))return!1}};return{forEach:A}},r})();function d(r,o){var a=h.supportsLookbehind();function s(y,b){b===void 0&&(b=!0);var E=a&&o.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w");return E.test(y)||o.regExp?a&&o.$supportsUnicodeFlag?b?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var i=Array.from(r),u=i[0],f=i[i.length-1];return s(u)+r+s(f,!1)}n.Search=c}),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(t,n,p){var h=this&&this.__extends||(function(){var a=function(s,i){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,f){u.__proto__=f}||function(u,f){for(var y in f)Object.prototype.hasOwnProperty.call(f,y)&&(u[y]=f[y])},a(s,i)};return function(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");a(s,i);function u(){this.constructor=s}s.prototype=i===null?Object.create(i):(u.prototype=i.prototype,new u)}})(),g=t("../lib/keys"),m=t("../lib/useragent"),c=g.KEY_MODS,d=(function(){function a(s,i){this.$init(s,i,!1)}return a.prototype.$init=function(s,i,u){this.platform=i||(m.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(s),this.$singleCommand=u},a.prototype.addCommand=function(s){this.commands[s.name]&&this.removeCommand(s),this.commands[s.name]=s,s.bindKey&&this._buildKeyHash(s)},a.prototype.removeCommand=function(s,i){var u=s&&(typeof s=="string"?s:s.name);s=this.commands[u],i||delete this.commands[u];var f=this.commandKeyBinding;for(var y in f){var b=f[y];if(b==s)delete f[y];else if(Array.isArray(b)){var E=b.indexOf(s);E!=-1&&(b.splice(E,1),b.length==1&&(f[y]=b[0]))}}},a.prototype.bindKey=function(s,i,u){if(typeof s=="object"&&s&&(u==null&&(u=s.position),s=s[this.platform]),!!s){if(typeof i=="function")return this.addCommand({exec:i,bindKey:s,name:i.name||s});s.split("|").forEach(function(f){var y="";if(f.indexOf(" ")!=-1){var b=f.split(/\s+/);f=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 E=this.parseKeys(f),$=c[E.hashId]+E.key;this._addCommandToBinding(y+$,i,u)},this)}},a.prototype._addCommandToBinding=function(s,i,u){var f=this.commandKeyBinding,y;if(!i)delete f[s];else if(!f[s]||this.$singleCommand)f[s]=i;else{Array.isArray(f[s])?(y=f[s].indexOf(i))!=-1&&f[s].splice(y,1):f[s]=[f[s]],typeof u!="number"&&(u=r(i));var b=f[s];for(y=0;y<b.length;y++){var E=b[y],$=r(E);if($>u)break}b.splice(y,0,i)}},a.prototype.addCommands=function(s){s&&Object.keys(s).forEach(function(i){var u=s[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)},a.prototype.removeCommands=function(s){Object.keys(s).forEach(function(i){this.removeCommand(s[i])},this)},a.prototype.bindKeys=function(s){Object.keys(s).forEach(function(i){this.bindKey(i,s[i])},this)},a.prototype._buildKeyHash=function(s){this.bindKey(s.bindKey,s)},a.prototype.parseKeys=function(s){var i=s.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function($){return $}),u=i.pop(),f=g[u];if(g.FUNCTION_KEYS[f])u=g.FUNCTION_KEYS[f].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 E=g.KEY_MODS[i[b]];if(E==null)return typeof console<"u"&&console.error("invalid modifier "+i[b]+" in "+s),!1;y|=E}return{key:u,hashId:y}},a.prototype.findKeyCommand=function(s,i){var u=c[s]+i;return this.commandKeyBinding[u]},a.prototype.handleKeyboard=function(s,i,u,f){if(!(f<0)){var y=c[i]+u,b=this.commandKeyBinding[y];return s.$keyChain&&(s.$keyChain+=" "+y,b=this.commandKeyBinding[s.$keyChain]||b),b&&(b=="chainKeys"||b[b.length-1]=="chainKeys")?(s.$keyChain=s.$keyChain||y,{command:"null"}):(s.$keyChain&&((!i||i==4)&&u.length==1?s.$keyChain=s.$keyChain.slice(0,-y.length-1):(i==-1||f>0)&&(s.$keyChain="")),{command:b})}},a.prototype.getStatusText=function(s,i){return i.$keyChain||""},a})();function r(a){return typeof a=="object"&&a.bindKey&&a.bindKey.position||(a.isDefault?-100:0)}var o=(function(a){h(s,a);function s(i,u){var f=a.call(this,i,u)||this;return f.$singleCommand=!0,f}return s})(d);o.call=function(a,s,i){d.prototype.$init.call(a,s,i,!0)},d.call=function(a,s,i){d.prototype.$init.call(a,s,i,!1)},n.HashHandler=o,n.MultiHashHandler=d}),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 h=this&&this.__extends||(function(){var r=function(o,a){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,i){s.__proto__=i}||function(s,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(s[u]=i[u])},r(o,a)};return function(o,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");r(o,a);function s(){this.constructor=o}o.prototype=a===null?Object.create(a):(s.prototype=a.prototype,new s)}})(),g=t("../lib/oop"),m=t("../keyboard/hash_handler").MultiHashHandler,c=t("../lib/event_emitter").EventEmitter,d=(function(r){h(o,r);function o(a,s){var i=r.call(this,s,a)||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(a,s,i){if(Array.isArray(a)){for(var u=a.length;u--;)if(this.exec(a[u],s,i))return!0;return!1}if(typeof a=="string"&&(a=this.commands[a]),!this.canExecute(a,s))return!1;var f={editor:s,command:a,args:i};return f.returnValue=this._emit("exec",f),this._signal("afterExec",f),f.returnValue!==!1},o.prototype.canExecute=function(a,s){return typeof a=="string"&&(a=this.commands[a]),!(!a||s&&s.$readOnly&&!a.readOnly||this.$checkCommandState!=!1&&a.isAvailable&&!a.isAvailable(s))},o.prototype.toggleRecording=function(a){if(!this.$inReplay)return a&&a._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(s){this.macro.push([s.command,s.args])}).bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},o.prototype.replay=function(a){if(!(this.$inReplay||!this.macro)){if(this.recording)return this.toggleRecording(a);try{this.$inReplay=!0,this.macro.forEach(function(s){typeof s=="string"?this.exec(s,a):this.exec(s[0],a,s[1])},this)}finally{this.$inReplay=!1}}},o.prototype.trimMacro=function(a){return a.map(function(s){return typeof s[0]!="string"&&(s[0]=s[0].name),s[1]||(s=s[0]),s})},o})(m);g.implement(d.prototype,c),n.CommandManager=d}),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],function(t,n,p){var h=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(),a=o?r.selection.getLineRange():r.selection.getRange();r._emit("cut",a),a.isEmpty()||r.session.remove(a),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(h.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(),a=o?r.selection.getSelectionLead():r.selection.getSelectionAnchor(),s=o?r.selection.getSelectionAnchor():r.selection.getSelectionLead(),i=r.session.doc.getLine(a.row).length,u=r.session.doc.getTextRange(r.selection.getRange()),f=u.replace(/\n\s*/," ").length,y=r.session.doc.getLine(a.row),b=a.row+1;b<=s.row+1;b++){var E=h.stringTrimLeft(h.stringTrimRight(r.session.doc.getLine(b)));E.length!==0&&(E=" "+E),y+=E}s.row+1<r.session.doc.getLength()-1&&(y+=r.session.doc.getNewLineCharacter()),r.clearSelection(),r.session.doc.replace(new m(a.row,0,s.row+2,0),y),f>0?(r.selection.moveCursorTo(a.row,a.column),r.selection.selectTo(a.row,a.column+f)):(i=r.session.doc.getLine(a.row).length>i?i+1:i,r.selection.moveCursorTo(a.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,a=r.session.doc.getLine(o).length,s=r.selection.rangeList.ranges,i=[];s.length<1&&(s=[r.selection.getRange()]);for(var u=0;u<s.length;u++)u==s.length-1&&(s[u].end.row===o&&s[u].end.column===a||i.push(new m(s[u].end.row,s[u].end.column,o,a))),u===0?s[u].start.row===0&&s[u].start.column===0||i.push(new m(0,0,s[u].start.row,s[u].start.column)):i.push(new m(s[u-1].end.row,s[u-1].end.column,s[u].start.row,s[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 p=1;p<9;p++)n.commands.push({name:"foldToLevel"+p,description:"Fold To Level "+p,level:p,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,f){var d=t("../lib/keys"),g=t("../mouse/default_gutter_handler").GutterTooltip,m=(function(){function p(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 p.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))},p.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))},p.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)},p.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}},p.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()},p.prototype.$isFoldWidgetVisible=function(r){var o=this.editor.isRowFullyVisible(this.$rowIndexToRow(r)),s=this.$getFoldWidget(r).style.display!=="none";return o&&s},p.prototype.$isAnnotationVisible=function(r){var o=this.editor.isRowFullyVisible(this.$rowIndexToRow(r)),s=this.$getAnnotation(r).style.display!=="none";return o&&s},p.prototype.$getFoldWidget=function(r){var o=this.lines.get(r),s=o.element;return s.childNodes[1]},p.prototype.$getAnnotation=function(r){var o=this.lines.get(r),s=o.element;return s.childNodes[2]},p.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},p.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},p.prototype.$focusFoldWidget=function(r){if(r!=null){var o=this.$getFoldWidget(r);o.classList.add(this.editor.renderer.keyboardFocusClassName),o.focus()}},p.prototype.$focusAnnotation=function(r){if(r!=null){var o=this.$getAnnotation(r);o.classList.add(this.editor.renderer.keyboardFocusClassName),o.focus()}},p.prototype.$blurFoldWidget=function(r){var o=this.$getFoldWidget(r);o.classList.remove(this.editor.renderer.keyboardFocusClassName),o.blur()},p.prototype.$blurAnnotation=function(r){var o=this.$getAnnotation(r);o.classList.remove(this.editor.renderer.keyboardFocusClassName),o.blur()},p.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}},p.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}},p.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}},p.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}},p.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}},p.prototype.$rowIndexToRow=function(r){var o=this.lines.get(r);return o?o.row:null},p.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},p})();n.GutterKeyboardHandler=m;var c=(function(){function p(r,o){this.gutterKeyboardHandler=o,this.domEvent=r}return p.prototype.getKey=function(){return d.keyCodeToString(this.domEvent.keyCode)},p.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},p.prototype.isInAnnotationLane=function(){return this.gutterKeyboardHandler.activeLane==="annotation"},p.prototype.isInFoldLane=function(){return this.gutterKeyboardHandler.activeLane==="fold"},p})();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,f){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"),p=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(p.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
|
-
`)==-1){var I=
|
|
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 d=1;d<9;d++)n.commands.push({name:"foldToLevel"+d,description:"Fold To Level "+d,level:d,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 h=t("../lib/keys"),g=t("../mouse/default_gutter_handler").GutterTooltip,m=(function(){function d(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 d.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))},d.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))},d.prototype.$onGutterKeyDown=function(r){if(this.annotationTooltip.isOpen){r.preventDefault(),r.keyCode===h.escape&&this.annotationTooltip.hideTooltip();return}if(r.target===this.element){if(r.keyCode!=h.enter)return;r.preventDefault();var o=this.editor.getCursorPosition().row;this.editor.isRowVisible(o)||this.editor.scrollToLine(o,!0,!0),setTimeout((function(){var a=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),s=this.$findNearestFoldWidget(a),i=this.$findNearestAnnotation(a);if(!(s===null&&i===null)){if(s===null&&i!==null){this.activeRowIndex=i,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}if(s!==null&&i===null){this.activeRowIndex=s,this.activeLane="fold",this.$focusFoldWidget(this.activeRowIndex);return}if(Math.abs(i-a)<Math.abs(s-a)){this.activeRowIndex=i,this.activeLane="annotation",this.$focusAnnotation(this.activeRowIndex);return}else{this.activeRowIndex=s,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)},d.prototype.$handleGutterKeyboardInteraction=function(r){if(r.keyCode===h.tab){r.preventDefault();return}if(r.keyCode===h.escape){r.preventDefault(),this.$blurGutter(),this.element.focus(),this.lane=null;return}if(r.keyCode===h.up){switch(r.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetUp();break;case"annotation":this.$moveAnnotationUp();break}return}if(r.keyCode===h.down){switch(r.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetDown();break;case"annotation":this.$moveAnnotationDown();break}return}if(r.keyCode===h.left){r.preventDefault(),this.$switchLane("annotation");return}if(r.keyCode===h.right){r.preventDefault(),this.$switchLane("fold");return}if(r.keyCode===h.enter||r.keyCode===h.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 a=this.lines.cells[this.activeRowIndex].element.childNodes[2],s=a.getBoundingClientRect(),i=this.annotationTooltip.getElement().style;i.left=s.right+"px",i.top=s.bottom+"px",this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex));break}return}},d.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()},d.prototype.$isFoldWidgetVisible=function(r){var o=this.editor.isRowFullyVisible(this.$rowIndexToRow(r)),a=this.$getFoldWidget(r).style.display!=="none";return o&&a},d.prototype.$isAnnotationVisible=function(r){var o=this.editor.isRowFullyVisible(this.$rowIndexToRow(r)),a=this.$getAnnotation(r).style.display!=="none";return o&&a},d.prototype.$getFoldWidget=function(r){var o=this.lines.get(r),a=o.element;return a.childNodes[1]},d.prototype.$getAnnotation=function(r){var o=this.lines.get(r),a=o.element;return a.childNodes[2]},d.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},d.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},d.prototype.$focusFoldWidget=function(r){if(r!=null){var o=this.$getFoldWidget(r);o.classList.add(this.editor.renderer.keyboardFocusClassName),o.focus()}},d.prototype.$focusAnnotation=function(r){if(r!=null){var o=this.$getAnnotation(r);o.classList.add(this.editor.renderer.keyboardFocusClassName),o.focus()}},d.prototype.$blurFoldWidget=function(r){var o=this.$getFoldWidget(r);o.classList.remove(this.editor.renderer.keyboardFocusClassName),o.blur()},d.prototype.$blurAnnotation=function(r){var o=this.$getAnnotation(r);o.classList.remove(this.editor.renderer.keyboardFocusClassName),o.blur()},d.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}},d.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}},d.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}},d.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}},d.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 a=this.$findNearestFoldWidget(this.activeRowIndex);if(a==null)break;this.activeLane="fold",this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=a,this.$focusFoldWidget(this.activeRowIndex);break}},d.prototype.$rowIndexToRow=function(r){var o=this.lines.get(r);return o?o.row:null},d.prototype.$rowToRowIndex=function(r){for(var o=0;o<this.lines.getLength();o++){var a=this.lines.get(o);if(a.row==r)return o}return null},d})();n.GutterKeyboardHandler=m;var c=(function(){function d(r,o){this.gutterKeyboardHandler=o,this.domEvent=r}return d.prototype.getKey=function(){return h.keyCodeToString(this.domEvent.keyCode)},d.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},d.prototype.isInAnnotationLane=function(){return this.gutterKeyboardHandler.activeLane==="annotation"},d.prototype.isInFoldLane=function(){return this.gutterKeyboardHandler.activeLane==="fold"},d})();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 h=this&&this.__values||function(w){var v=typeof Symbol=="function"&&Symbol.iterator,C=v&&w[v],x=0;if(C)return C.call(w);if(w&&typeof w.length=="number")return{next:function(){return w&&x>=w.length&&(w=void 0),{value:w&&w[x++],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"),d=t("./lib/useragent"),r=t("./keyboard/textinput").TextInput,o=t("./mouse/mouse_handler").MouseHandler,a=t("./mouse/fold_handler").FoldHandler,s=t("./keyboard/keybinding").KeyBinding,i=t("./edit_session").EditSession,u=t("./search").Search,f=t("./range").Range,y=t("./lib/event_emitter").EventEmitter,b=t("./commands/command_manager").CommandManager,E=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"),T=(function(){function w(v,C,x){this.session,this.$toDestroy=[];var _=v.getContainerElement();this.container=_,this.renderer=v,this.id="editor"+ ++w.$uid,this.commands=new b(d.isMac?"mac":"win",E),typeof document=="object"&&(this.textInput=new r(v.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new o(this),new a(this)),this.keyBinding=new s(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||x&&x.session||new i("")),$.resetOptions(this),x&&this.setOptions(x),$._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,x=C&&C.scrollIntoView;if(x){switch(x){case"center-animate":x="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var _=this.selection.getRange(),k=this.renderer.layerConfig;(_.start.row>=k.lastRow||_.end.row<=k.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);break}x=="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,x=this.$mergeableCommands,_=C.command&&v.command.name==C.command.name;if(v.command.name=="insertstring"){var k=v.args;this.mergeNextCommand===void 0&&(this.mergeNextCommand=!0),_=_&&this.mergeNextCommand&&(!/\s/.test(k)||/\s/.test(C.args)),this.mergeNextCommand=!0}else _=_&&x.indexOf(v.command.name)!==-1;this.$mergeUndoDeltas!="always"&&Date.now()-this.sequenceStartTime>2e3&&(_=!1),_?this.session.mergeUndoDeltas=!0:x.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 x=this;$.loadModule(["keybinding",v],function(_){x.$keybindingId==v&&x.keyBinding.setKeyboardHandler(_&&_.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 x=this.session.getSelection();x.off("changeCursor",this.$onCursorChange),x.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 x=v.getCursorPosition(),_=v.getKeyboardHandler(),k=_&&_.$getDirectionForHighlight&&_.$getDirectionForHighlight(v),O=C.getMatchingBracketRanges(x,k);if(!O){var I=new A(C,x.row,x.column),N=I.getCurrentToken();if(N&&/\b(?:tag-open|tag-name)/.test(N.type)){var P=C.getMatchingTags(x);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&&(f.comparePoints(O[0].end,O[1].start)==0?O=[f.fromPoints(O[0].start,O[1].end)]:f.comparePoints(O[0].start,O[1].end)==0&&(O=[f.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)}},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,x=v.start.row==v.end.row?v.end.row:1/0;this.renderer.updateLines(v.start.row,x,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 x=new f(C.row,C.column,C.row,1/0);x.id=v.addMarker(x,"ace_active-line","screenLine"),v.$highlightLineMarker=x}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 x=this.selection.getRange(),_=this.getSelectionStyle();C.$selectionMarker=C.addMarker(x,"ace_selection",_)}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 x=C.start.column,_=C.end.column,k=v.getLine(C.start.row),O=k.substring(x,_);if(!(O.length>5e3||!/[\w\d]/.test(O))){var I=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:O}),N=k.substring(x-1,_+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(),x=!1;if(!v&&this.$copyWithEmptySelection){x=!0;for(var _=this.selection.getAllRanges(),k=0;k<_.length;k++){var O=_[k];k&&_[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=x?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 x={text:v,event:C};this.commands.exec("paste",this,x)},w.prototype.$handlePaste=function(v){typeof v=="string"&&(v={text:v}),this._signal("paste",v);var C=v.text,x=C===R.lineMode,_=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)x?_.insert({row:this.selection.lead.row,column:0},C):this.insert(C);else if(x)this.selection.rangeList.ranges.forEach(function(B){_.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()||_.remove(P),_.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 x=this.session,_=x.getMode(),k=this.getCursorPosition();if(this.getBehavioursEnabled()&&!C){var O=_.transformAction(x.getState(k.row),"insertion",this,x,v);O&&(v!==O.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),v=O.text)}if(v==" "&&(v=this.session.getTabString()),this.selection.isEmpty()){if(this.session.getOverwrite()&&v.indexOf(`
|
|
1366
|
+
`)==-1){var I=f.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)},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(p.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,f){var d=t("../lib/dom"),g=(function(){function m(c,p){this.element=c,this.canvasHeight=p||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,p){return Math.floor(c.firstRowScreen*c.lineHeight/this.canvasHeight)!==Math.floor(p.firstRowScreen*p.lineHeight/this.canvasHeight)},m.prototype.computeLineTop=function(c,p,r){var o=p.firstRowScreen*p.lineHeight,s=Math.floor(o/this.canvasHeight),a=r.documentToScreenRow(c,0)*p.lineHeight;return a-s*this.canvasHeight},m.prototype.computeLineHeight=function(c,p,r){return p.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 p=d.createFragment(this.element),r=0;r<c.length;r++)p.appendChild(c[r].element);this.element.appendChild(p)}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 p=d.createFragment(this.element),r=0;r<c.length;r++)p.appendChild(c[r].element);this.element.firstChild?this.element.insertBefore(p,this.element.firstChild):this.element.appendChild(p)}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,p,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,f){var d=t("../lib/dom"),g=t("../lib/oop"),m=t("../lib/lang"),c=t("../lib/event_emitter").EventEmitter,p=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 p(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,f){var d=t("../range").Range,g=t("../lib/dom"),m=(function(){function p(r){this.element=g.createElement("div"),this.element.className="ace_layer ace_marker-layer",r.appendChild(this.element)}return p.prototype.setPadding=function(r){this.$padding=r},p.prototype.setSession=function(r){this.session=r},p.prototype.setMarkers=function(r){this.markers=r},p.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},p.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)}},p.prototype.$getTop=function(r,o){return(r-o.firstRowScreen)*o.lineHeight},p.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)},p.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||""))}},p.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||""))},p.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)},p.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||""))},p.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||""))},p})();m.prototype.$padding=0;function c(p,r,o,s){return(p?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,f){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,f){var d=t("../lib/oop"),g=t("../lib/dom"),m=t("../lib/lang"),c=t("./lines").Lines,p=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,p),n.Text=s}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(t,n,f){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 p=this.cursors,r=p.length;r--;)d.setStyle(p[r].style,"opacity",c?"":"0")},m.prototype.$startCssAnimation=function(){for(var c=this.cursors,p=c.length;p--;)c[p].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 p=(function(){this.timeoutId=setTimeout(function(){c(!1)},.6*this.blinkInterval)}).bind(this);this.intervalId=setInterval(function(){c(!0),p()},this.blinkInterval),p()}},m.prototype.getPixelPosition=function(c,p){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-(p?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:o,top:s}},m.prototype.isCursorInView=function(c,p){return c.top>=0&&c.top<p.maxHeight},m.prototype.update=function(c){this.config=c;var p=this.session.$selectionMarkers,r=0,o=0;(p===void 0||p.length===0)&&(p=[{cursor:null}]);for(var r=0,s=p.length;r<s;r++){var a=this.getPixelPosition(p[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,p[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,f){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"),p=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,p);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,f){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"),p=t("./lib/event_emitter").EventEmitter;m.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{
|
|
1368
|
+
`){var F=x.getLine(k.row);if(k.column>F.search(/\S|$/)){var N=F.substr(k.column).search(/\S|$/);x.doc.removeInLine(k.row,k.column,k.column+N)}}this.clearSelection();var P=k.column,B=x.getState(k.row),F=x.getLine(k.row),H=_.checkOutdent(B,F,v);if(x.insert(k,v),O&&O.selection&&(O.selection.length==2?this.selection.setSelectionRange(new f(k.row,P+O.selection[0],k.row,P+O.selection[1])):this.selection.setSelectionRange(new f(k.row+O.selection[0],O.selection[1],k.row+O.selection[2],O.selection[3]))),this.$enableAutoIndent){if(x.getDocument().isNewLine(v)){var z=_.getNextLineIndent(B,F.slice(0,k.column),x.getTabString());x.insert({row:k.row+1,column:0},z)}H&&_.autoOutdent(B,x,k.row)}},w.prototype.autoIndent=function(){for(var v=this.session,C=v.getMode(),x=this.selection.isEmpty()?[new f(0,0,v.doc.getLength()-1,0)]:this.selection.getAllRanges(),_="",k="",O="",I=v.getTabString(),N=0;N<x.length;N++)for(var P=x[N].start.row,B=x[N].end.row,F=P;F<=B;F++){F>0&&(_=v.getState(F-1),k=v.getLine(F-1),O=C.getNextLineIndent(_,k,I));var H=v.getLine(F),z=C.$getIndent(H);if(O!==z){if(z.length>0){var W=new f(F,0,F,z.length);v.remove(W)}O.length>0&&v.insert({row:F,column:0},O)}C.autoOutdent(_,v,F)}},w.prototype.onTextInput=function(v,C){if(!C)return this.keyBinding.onTextInput(v);this.startOperation({command:{name:"insertstring"}});var x=this.applyComposition.bind(this,v,C);this.selection.rangeCount?this.forEachSelection(x):x(),this.endOperation()},w.prototype.applyComposition=function(v,C){if(C.extendLeft||C.extendRight){var x=this.selection.getRange();x.start.column-=C.extendLeft,x.end.column+=C.extendRight,x.start.column<0&&(x.start.row--,x.start.column+=this.session.getLine(x.start.row).length+1),this.selection.setRange(x),!v&&!x.isEmpty()&&this.remove()}if((v||!this.selection.isEmpty())&&this.insert(v,!0),C.restoreStart||C.restoreEnd){var x=this.selection.getRange();x.start.column-=C.restoreStart,x.end.column-=C.restoreEnd,this.selection.setRange(x)}},w.prototype.onCommandKey=function(v,C,x){return this.keyBinding.onCommandKey(v,C,x)},w.prototype.setOverwrite=function(v){this.session.setOverwrite(v)},w.prototype.getOverwrite=function(){return this.session.getOverwrite()},w.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},w.prototype.setScrollSpeed=function(v){this.setOption("scrollSpeed",v)},w.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},w.prototype.setDragDelay=function(v){this.setOption("dragDelay",v)},w.prototype.getDragDelay=function(){return this.getOption("dragDelay")},w.prototype.setSelectionStyle=function(v){this.setOption("selectionStyle",v)},w.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},w.prototype.setHighlightActiveLine=function(v){this.setOption("highlightActiveLine",v)},w.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},w.prototype.setHighlightGutterLine=function(v){this.setOption("highlightGutterLine",v)},w.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},w.prototype.setHighlightSelectedWord=function(v){this.setOption("highlightSelectedWord",v)},w.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},w.prototype.setAnimatedScroll=function(v){this.renderer.setAnimatedScroll(v)},w.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},w.prototype.setShowInvisibles=function(v){this.renderer.setShowInvisibles(v)},w.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},w.prototype.setDisplayIndentGuides=function(v){this.renderer.setDisplayIndentGuides(v)},w.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},w.prototype.setHighlightIndentGuides=function(v){this.renderer.setHighlightIndentGuides(v)},w.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},w.prototype.setShowPrintMargin=function(v){this.renderer.setShowPrintMargin(v)},w.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},w.prototype.setPrintMarginColumn=function(v){this.renderer.setPrintMarginColumn(v)},w.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},w.prototype.setReadOnly=function(v){this.setOption("readOnly",v)},w.prototype.getReadOnly=function(){return this.getOption("readOnly")},w.prototype.setBehavioursEnabled=function(v){this.setOption("behavioursEnabled",v)},w.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},w.prototype.setWrapBehavioursEnabled=function(v){this.setOption("wrapBehavioursEnabled",v)},w.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},w.prototype.setShowFoldWidgets=function(v){this.setOption("showFoldWidgets",v)},w.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},w.prototype.setFadeFoldWidgets=function(v){this.setOption("fadeFoldWidgets",v)},w.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},w.prototype.remove=function(v){this.selection.isEmpty()&&(v=="left"?this.selection.selectLeft():this.selection.selectRight());var C=this.getSelectionRange();if(this.getBehavioursEnabled()){var x=this.session,_=x.getState(C.start.row),k=x.getMode().transformAction(_,"deletion",this,x,C);if(C.end.column===0){var O=x.getTextRange(C);if(O[O.length-1]==`
|
|
1369
|
+
`){var I=x.getLine(C.end.row);/^\s+$/.test(I)&&(C.end.column=I.length)}}k&&(C=k)}this.session.remove(C),this.clearSelection()},w.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},w.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},w.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},w.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var v=this.getSelectionRange();v.start.column==v.end.column&&v.start.row==v.end.row&&(v.end.column=0,v.end.row++),this.session.remove(v),this.clearSelection()},w.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var v=this.getCursorPosition();this.insert(`
|
|
1370
|
+
`),this.moveCursorToPosition(v)},w.prototype.setGhostText=function(v,C){this.renderer.setGhostText(v,C)},w.prototype.removeGhostText=function(){this.renderer.removeGhostText()},w.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var v=this.getCursorPosition(),C=v.column;if(C!==0){var x=this.session.getLine(v.row),_,k;C<x.length?(_=x.charAt(C)+x.charAt(C-1),k=new f(v.row,C-1,v.row,C+1)):(_=x.charAt(C-1)+x.charAt(C-2),k=new f(v.row,C-2,v.row,C)),this.session.replace(k,_),this.session.selection.moveToPosition(k.end)}}},w.prototype.toLowerCase=function(){var v=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var C=this.getSelectionRange(),x=this.session.getTextRange(C);this.session.replace(C,x.toLowerCase()),this.selection.setSelectionRange(v)},w.prototype.toUpperCase=function(){var v=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var C=this.getSelectionRange(),x=this.session.getTextRange(C);this.session.replace(C,x.toUpperCase()),this.selection.setSelectionRange(v)},w.prototype.indent=function(){var v=this.session,C=this.getSelectionRange();if(C.start.row<C.end.row){var x=this.$getSelectedRows();v.indentRows(x.first,x.last," ");return}else if(C.start.column<C.end.column){var _=v.getTextRange(C);if(!/^\s+$/.test(_)){var x=this.$getSelectedRows();v.indentRows(x.first,x.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)},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,x=[],_=v.first;_<=v.last;_++)x.push(C.getLine(_));x.sort(function(I,N){return I.toLowerCase()<N.toLowerCase()?-1:I.toLowerCase()>N.toLowerCase()?1:0});for(var k=new f(0,0,0,0),_=v.first;_<=v.last;_++){var O=C.getLine(_);k.start.row=_,k.end.row=_,k.end.column=O.length,C.replace(k,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),x=this.getSelectionRange();this.session.getMode().toggleBlockComment(C,this.session,x,v)},w.prototype.getNumberAt=function(v,C){var x=/[\-]?[0-9]+(?:\.[0-9]+)?/g;x.lastIndex=0;for(var _=this.session.getLine(v);x.lastIndex<C;){var k=x.exec(_);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,x=this.selection.getCursor().column,_=new f(C,x-1,C,x),k=this.session.getTextRange(_);if(!isNaN(parseFloat(k))&&isFinite(k)){var O=this.getNumberAt(C,x);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&&x<I?v*=Math.pow(10,O.end-x-1):v*=Math.pow(10,O.end-x),P+=v,P/=Math.pow(10,N);var B=P.toFixed(N),F=new f(C,O.start,C,O.end);this.session.replace(F,B),this.moveCursorTo(C,Math.max(O.start+1,x+B.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 x=this.getSelectedText(),_=this.selection.getWordRange().start.column,k=x.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),O=C-_-1;O<0&&(O=0);var I=0,N=0,P=this;x.match(/[A-Za-z0-9_]+/)&&k.forEach(function(G,Q){N=I+G.length,O>=I&&O<=N&&(x=G,P.selection.clearSelection(),P.moveCursorTo(v,I+_),P.selection.selectTo(v,N+_)),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=x.match(new RegExp("^\\s?_?("+c.escapeRegExp(z[W])+")\\s?$","i"));if(K){var Y=x.match(new RegExp("([_]|^|\\s)("+c.escapeRegExp(K[1])+")($|\\s)","g"));Y&&(F=x.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="")}}},w.prototype.findLinkAt=function(v,C){var x,_,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=h(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){x={error:W}}finally{try{H&&!H.done&&(_=F.return)&&_.call(F)}finally{if(x)throw x.error}}return B},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,x=v.getRange(),_=v.isBackwards();if(x.isEmpty()){var k=x.start.row;C.duplicateLines(k,k)}else{var O=_?x.start:x.end,I=C.insert(O,C.getTextRange(x));x.start=O,x.end=I,v.setSelectionRange(x,_)}},w.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},w.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},w.prototype.moveText=function(v,C,x){return this.session.moveText(v,C,x)},w.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},w.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},w.prototype.$moveLines=function(v,C){var x,_,k=this.selection;if(!k.inMultiSelectMode||this.inVirtualSelectionMode){var O=k.toOrientedRange();x=this.$getSelectedRows(O),_=this.session.$moveLines(x.first,x.last,C?0:v),C&&v==-1&&(_=0),O.moveBy(_,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),x=this.$getSelectedRows(I[F]);for(var z=x.first,W=x.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}},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 x=this.renderer,_=this.renderer.layerConfig,k=v*Math.floor(_.height/_.lineHeight);C===!0?this.selection.$moveSelection(function(){this.moveCursorBy(k,0)}):C===!1&&(this.selection.moveCursorBy(k,0),this.selection.clearSelection());var O=x.scrollTop;x.scrollBy(0,k*_.lineHeight),C!=null&&x.scrollCursorIntoView(null,.5),x.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,x,_){this.renderer.scrollToLine(v,C,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 x=this.getCursorPosition(),_=new A(this.session,x.row,x.column),k=_.getCurrentToken(),O=0;k&&k.type.indexOf("tag-name")!==-1&&(k=_.stepBackward());var I=k||_.stepForward();if(I){var N,P=!1,B={},F=x.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=_.stepForward(),F=0)}while(I&&!P);if(N){var W,U;if(N==="bracket")W=this.session.getBracketRange(x),W||(W=new f(_.getCurrentTokenRow(),_.getCurrentTokenColumn()+F-1,_.getCurrentTokenRow(),_.getCurrentTokenColumn()+F-1),U=W.start,(C||U.row===x.row&&Math.abs(U.column-x.column)<2)&&(W=this.session.getBracketRange(U)));else if(N==="tag"){if(!I||I.type.indexOf("tag-name")===-1)return;if(W=new f(_.getCurrentTokenRow(),_.getCurrentTokenColumn()-2,_.getCurrentTokenRow(),_.getCurrentTokenColumn()-2),W.compare(x.row,x.column)===0){var K=this.session.getMatchingTags(x);K&&(K.openTag.contains(x.row,x.column)?(W=K.closeTag,U=W.start):(W=K.openTag,K.closeTag.start.row===x.row&&K.closeTag.start.column===x.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))}}},w.prototype.gotoLine=function(v,C,x){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,x)},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 x=this.$search.find(this.session),_=0;return x&&(this.$tryReplace(x,v)&&(_=1),this.selection.setSelectionRange(x),this.renderer.scrollSelectionIntoView(x.start,x.end)),_},w.prototype.replaceAll=function(v,C){C&&this.$search.set(C);var x=this.$search.findAll(this.session),_=0;if(!x.length)return _;var k=this.getSelectionRange();this.selection.moveTo(0,0);for(var O=x.length-1;O>=0;--O)this.$tryReplace(x[O],v)&&_++;return this.selection.setSelectionRange(k),_},w.prototype.$tryReplace=function(v,C){var x=this.session.getTextRange(v);return C=this.$search.replace(x,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,x){C||(C={}),typeof v=="string"||v instanceof RegExp?C.needle=v:typeof v=="object"&&g.mixin(C,v);var _=this.selection.getRange();C.needle==null&&(v=this.session.getTextRange(_)||this.$search.$options.needle,v||(_=this.session.getWordRange(_.start.row,_.start.column),v=this.session.getTextRange(_)),this.$search.set({needle:v})),this.$search.set(C),C.start||this.$search.set({start:_});var k=this.$search.find(this.session);if(C.preventScroll)return k;if(k)return this.revealRange(k,x),k;C.backwards?_.start=_.end:_.end=_.start,this.selection.setRange(_)},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 x=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(v.start,v.end,.5),C!==!1&&this.renderer.animateScrolling(x)},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,x=this,_=!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(){_=!0}),I=this.renderer.on("beforeRender",function(){_&&(C=x.renderer.container.getBoundingClientRect())}),N=this.renderer.on("afterRender",function(){if(_&&C&&(x.isFocused()||x.searchBox&&x.searchBox.isFocused())){var P=x.renderer,B=P.$cursorLayer.$pixelPos,F=P.layerConfig,H=B.top-F.offset;B.top>=0&&H+C.top<0?_=!0:B.top<F.height&&B.top+C.top+F.lineHeight>window.innerHeight?_=!1:_=null,_!=null&&(k.style.top=H+"px",k.style.left=B.left+"px",k.style.height=F.lineHeight+"px",k.scrollIntoView(_)),_=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,x){var _=this;$.loadModule("ace/ext/prompt",function(k){k.prompt(_,v,C,x)})},w})();T.$uid=0,T.prototype.curOp=null,T.prototype.prevOp={},T.prototype.$mergeableCommands=["backspace","del","insertstring"],T.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(T.prototype,y),$.defineOptions(T.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(_){_.blur(),_.renderer.scroller.focus()},readOnly:!0},C=function(_){if(_.target==this.renderer.scroller&&_.keyCode===L.enter){_.preventDefault();var k=this.getCursorPosition().row;this.isRowVisible(k)||this.scrollToLine(k,!0,!0),this.focus()}},x;w?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(d.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),x||(x=new S(this)),x.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),x&&x.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=T}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(t,n,p){var h=t("../lib/dom"),g=(function(){function m(c,d){this.element=c,this.canvasHeight=d||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return m.prototype.moveContainer=function(c){h.translate(this.element,0,-(c.firstRowScreen*c.lineHeight%this.canvasHeight)-c.offset*this.$offsetCoefficient)},m.prototype.pageChanged=function(c,d){return Math.floor(c.firstRowScreen*c.lineHeight/this.canvasHeight)!==Math.floor(d.firstRowScreen*d.lineHeight/this.canvasHeight)},m.prototype.computeLineTop=function(c,d,r){var o=d.firstRowScreen*d.lineHeight,a=Math.floor(o/this.canvasHeight),s=r.documentToScreenRow(c,0)*d.lineHeight;return s-a*this.canvasHeight},m.prototype.computeLineHeight=function(c,d,r){return d.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 d=h.createFragment(this.element),r=0;r<c.length;r++)d.appendChild(c[r].element);this.element.appendChild(d)}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 d=h.createFragment(this.element),r=0;r<c.length;r++)d.appendChild(c[r].element);this.element.firstChild?this.element.insertBefore(d,this.element.firstChild):this.element.appendChild(d)}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,d,r,o){var a=this.cellCache.pop();if(!a){var s=h.createElement("div");o&&o(s),this.element.appendChild(s),a={element:s,text:"",row:c}}return a.row=c,a},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 h=t("../lib/dom"),g=t("../lib/oop"),m=t("../lib/lang"),c=t("../lib/event_emitter").EventEmitter,d=t("./lines").Lines,r=t("../config").nls,o=(function(){function s(i){this.element=h.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 d(this.element),this.$lines.$offsetCoefficient=1}return s.prototype.setSession=function(i){this.session&&this.session.off("change",this.$updateAnnotations),this.session=i,i&&i.on("change",this.$updateAnnotations)},s.prototype.addGutterDecoration=function(i,u){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(i,u)},s.prototype.removeGutterDecoration=function(i,u){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(i,u)},s.prototype.setAnnotations=function(i){this.$annotations=[];for(var u=0;u<i.length;u++){var f=i[u],y=f.row,b=this.$annotations[y];b||(b=this.$annotations[y]={text:[],type:[],displayText:[]});var E=f.text,$=f.text,A=f.type;E=E?m.escapeHTML(E):f.html||"",$=$||f.html||"",b.text.indexOf(E)===-1&&(b.text.push(E),b.type.push(A),b.displayText.push($));var S=f.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")}},s.prototype.$updateAnnotations=function(i){if(this.$annotations.length){var u=i.start.row,f=i.end.row-u;if(f!==0)if(i.action=="remove")this.$annotations.splice(u,f+1,null);else{var y=new Array(f+1);y.unshift(u,1),this.$annotations.splice.apply(this.$annotations,y)}}},s.prototype.update=function(i){this.config=i;var u=this.session,f=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(f),E=b?b.start.row:1/0,$=null,A=-1,S=f;;){if(S>E&&(S=b.end.row+1,b=u.getNextFoldLine(S,b),E=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,a),this.$lines.push($)),this.$renderCell($,i,b,S),S++}this._signal("afterRender"),this.$updateGutterWidth(i)},s.prototype.$updateGutterWidth=function(i){var u=this.session,f=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 E=f?f.getWidth(u,b,i):b.toString().length*i.characterWidth,$=this.$padding||this.$computePadding();E+=$.left+$.right,E!==this.gutterWidth&&!isNaN(E)&&(this.gutterWidth=E,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",E))},s.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var i=this.session.selection.getCursor();this.$cursorRow!==i.row&&(this.$cursorRow=i.row)}},s.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 f=0;f<u.length;f++){var y=u[f];if(y.row>=this.$cursorRow){if(y.row>this.$cursorRow){var b=this.session.getFoldLine(this.$cursorRow);if(f>0&&b&&b.start.row==u[f-1].row)y=u[f-1];else break}y.element.className="ace_gutter-active-line "+y.element.className,this.$cursorCell=y;break}}}}},s.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 f=Math.min(i.lastRow+i.gutterOffset,this.session.getLength()-1),y=this.oldLastRow;if(this.oldLastRow=f,!u||y<i.firstRow)return this.update(i);if(f<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>f)for(var b=this.session.getFoldedRowCount(f+1,y);b>0;b--)this.$lines.pop();i.firstRow<u.firstRow&&this.$lines.unshift(this.$renderLines(i,i.firstRow,u.firstRow-1)),f>y&&this.$lines.push(this.$renderLines(i,y+1,f)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(i)},s.prototype.$renderLines=function(i,u,f){for(var y=[],b=u,E=this.session.getNextFoldLine(b),$=E?E.start.row:1/0;b>$&&(b=E.end.row+1,E=this.session.getNextFoldLine(b,E),$=E?E.start.row:1/0),!(b>f);){var A=this.$lines.createCell(b,i,this.session,a);this.$renderCell(A,i,E,b),y.push(A),b++}return y},s.prototype.$renderCell=function(i,u,f,y){var b=i.element,E=this.session,$=b.childNodes[0],A=b.childNodes[1],S=b.childNodes[2],M=S.firstChild,R=E.$firstLineNumber,L=E.$breakpoints,T=E.$decorations,D=E.gutterRenderer||this.$renderer,w=this.$showFoldWidgets&&E.foldWidgets,v=f?f.start.row:Number.MAX_VALUE,C=u.lineHeight+"px",x=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",_=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",k=(D?D.getText(E,y):y+R).toString();if(this.$highlightGutterLine&&(y==this.$cursorRow||f&&y<this.$cursorRow&&y>=v&&this.$cursorRow<=f.end.row)&&(x+="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]&&(x+=L[y]),T[y]&&(x+=T[y]),this.$annotations[y]&&y!==v&&(x+=this.$annotations[y].className),w){var O=w[y];O==null&&(O=w[y]=E.getFoldWidget(y))}if(O){var I="ace_fold-widget ace_"+O,N=O=="start"&&y==v&&y<f.end.row;if(N){I+=" ace_closed";for(var P="",B=!1,F=y+1;F<=f.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")}x+=P}else I+=" ace_open";A.className!=I&&(A.className=I),h.setStyle(A.style,"height",C),h.setStyle(A.style,"display","inline-block"),A.setAttribute("role","button"),A.setAttribute("tabindex","-1");var H=E.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])):f?A.setAttribute("aria-label",r("gutter.code-folding.closed.aria-label","Toggle code folding, rows $0 through $1",[f.start.row+1,f.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&&(h.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",M.className=_,M.className+=P,h.setStyle(M.style,"height",C),h.setStyle(S.style,"display","block"),h.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",M.className=_,this.$useSvgGutterIcons?M.className+=this.$annotations[y].className:b.classList.add(this.$annotations[y].className.replace(" ","")),h.setStyle(M.style,"height",C),h.setStyle(S.style,"display","block"),h.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 h.setStyle(S.style,"display","none"),S.removeAttribute("aria-label"),S.removeAttribute("role"),S.setAttribute("tabindex","0");return k!==$.data&&($.data=k),b.className!=x&&(b.className=x),h.setStyle(i.element.style,"height",this.$lines.computeLineHeight(y,u,E)+"px"),h.setStyle(i.element.style,"top",this.$lines.computeLineTop(y,u,E)+"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},s.prototype.setHighlightGutterLine=function(i){this.$highlightGutterLine=i},s.prototype.setShowLineNumbers=function(i){this.$renderer=!i&&{getWidth:function(){return 0},getText:function(){return""}}},s.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},s.prototype.setShowFoldWidgets=function(i){i?h.addCssClass(this.element,"ace_folding-enabled"):h.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=i,this.$padding=null},s.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},s.prototype.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var i=h.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},s.prototype.getRegion=function(i){var u=this.$padding||this.$computePadding(),f=this.element.getBoundingClientRect();if(i.x<u.left+f.left)return"markers";if(this.$showFoldWidgets&&i.x>f.right-u.right)return"foldWidgets"},s})();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 a(s){var i=document.createTextNode("");s.appendChild(i);var u=h.createElement("span");s.appendChild(u);var f=h.createElement("span");s.appendChild(f);var y=h.createElement("span");return f.appendChild(y),s}n.Gutter=o}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(t,n,p){var h=t("../range").Range,g=t("../lib/dom"),m=(function(){function d(r){this.element=g.createElement("div"),this.element.className="ace_layer ace_marker-layer",r.appendChild(this.element)}return d.prototype.setPadding=function(r){this.$padding=r},d.prototype.setSession=function(r){this.session=r},d.prototype.setMarkers=function(r){this.markers=r},d.prototype.elt=function(r,o){var a=this.i!=-1&&this.element.childNodes[this.i];a?this.i++:(a=document.createElement("div"),this.element.appendChild(a),this.i=-1),a.style.cssText=o,a.className=r},d.prototype.update=function(r){if(r){this.config=r,this.i=0;var o;for(var a in this.markers){var s=this.markers[a];if(!s.range){s.update(o,this,this.session,r);continue}var i=s.range.clipRows(r.firstRow,r.lastRow);if(!i.isEmpty())if(i=i.toScreenRange(this.session),s.renderer){var u=this.$getTop(i.start.row,r),f=this.$padding+i.start.column*r.characterWidth;s.renderer(o,i,f,u,r)}else s.type=="fullLine"?this.drawFullLineMarker(o,i,s.clazz,r):s.type=="screenLine"?this.drawScreenLineMarker(o,i,s.clazz,r):i.isMultiLine()?s.type=="text"?this.drawTextMarker(o,i,s.clazz,r):this.drawMultiLineMarker(o,i,s.clazz,r):this.drawSingleLineMarker(o,i,s.clazz+" ace_start ace_br15",r)}if(this.i!=-1)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},d.prototype.$getTop=function(r,o){return(r-o.firstRowScreen)*o.lineHeight},d.prototype.drawTextMarker=function(r,o,a,s,i){for(var u=this.session,f=o.start.row,y=o.end.row,b=f,E=0,$=0,A=u.getScreenLastRowColumn(b),S=new h(b,o.start.column,b,$);b<=y;b++)S.start.row=S.end.row=b,S.start.column=b==f?o.start.column:u.getRowWrapIndent(b),S.end.column=A,E=$,$=A,A=b+1<y?u.getScreenLastRowColumn(b+1):b==y?0:o.end.column,this.drawSingleLineMarker(r,S,a+(b==f?" ace_start":"")+" ace_br"+c(b==f||b==f+1&&o.start.column,E<$,$>A,b==y),s,b==y?0:1,i)},d.prototype.drawMultiLineMarker=function(r,o,a,s,i){var u=this.$padding,f=s.lineHeight,y=this.$getTop(o.start.row,s),b=u+o.start.column*s.characterWidth;if(i=i||"",this.session.$bidiHandler.isBidiRow(o.start.row)){var E=o.clone();E.end.row=E.start.row,E.end.column=this.session.getLine(E.start.row).length,this.drawBidiSingleLineMarker(r,E,a+" ace_br1 ace_start",s,null,i)}else this.elt(a+" ace_br1 ace_start","height:"+f+"px;right:"+u+"px;top:"+y+"px;left:"+b+"px;"+(i||""));if(this.session.$bidiHandler.isBidiRow(o.end.row)){var E=o.clone();E.start.row=E.end.row,E.start.column=0,this.drawBidiSingleLineMarker(r,E,a+" ace_br12",s,null,i)}else{y=this.$getTop(o.end.row,s);var $=o.end.column*s.characterWidth;this.elt(a+" ace_br12","height:"+f+"px;width:"+$+"px;top:"+y+"px;left:"+u+"px;"+(i||""))}if(f=(o.end.row-o.start.row-1)*s.lineHeight,!(f<=0)){y=this.$getTop(o.start.row+1,s);var A=(o.start.column?1:0)|(o.end.column?0:8);this.elt(a+(A?" ace_br"+A:""),"height:"+f+"px;right:"+u+"px;top:"+y+"px;left:"+u+"px;"+(i||""))}},d.prototype.drawSingleLineMarker=function(r,o,a,s,i,u){if(this.session.$bidiHandler.isBidiRow(o.start.row))return this.drawBidiSingleLineMarker(r,o,a,s,i,u);var f=s.lineHeight,y=(o.end.column+(i||0)-o.start.column)*s.characterWidth,b=this.$getTop(o.start.row,s),E=this.$padding+o.start.column*s.characterWidth;this.elt(a,"height:"+f+"px;width:"+y+"px;top:"+b+"px;left:"+E+"px;"+(u||""))},d.prototype.drawBidiSingleLineMarker=function(r,o,a,s,i,u){var f=s.lineHeight,y=this.$getTop(o.start.row,s),b=this.$padding,E=this.session.$bidiHandler.getSelections(o.start.column,o.end.column);E.forEach(function($){this.elt(a,"height:"+f+"px;width:"+($.width+(i||0))+"px;top:"+y+"px;left:"+(b+$.left)+"px;"+(u||""))},this)},d.prototype.drawFullLineMarker=function(r,o,a,s,i){var u=this.$getTop(o.start.row,s),f=s.lineHeight;o.start.row!=o.end.row&&(f+=this.$getTop(o.end.row,s)-u),this.elt(a,"height:"+f+"px;top:"+u+"px;left:0;right:0;"+(i||""))},d.prototype.drawScreenLineMarker=function(r,o,a,s,i){var u=this.$getTop(o.start.row,s),f=s.lineHeight;this.elt(a,"height:"+f+"px;top:"+u+"px;left:0;right:0;"+(i||""))},d})();m.prototype.$padding=0;function c(d,r,o,a){return(d?1:0)|(r?2:0)|(o?4:0)|(a?8:0)}n.Marker=m}),ace.define("ace/layer/text_util",["require","exports","module"],function(t,n,p){var h=new Set(["text","rparen","lparen"]);n.isTextToken=function(g){return h.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 h=t("../lib/oop"),g=t("../lib/dom"),m=t("../lib/lang"),c=t("./lines").Lines,d=t("../lib/event_emitter").EventEmitter,r=t("../config").nls,o=t("./text_util").isTextToken,a=(function(){function s(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 s.prototype.$updateEolChar=function(){var i=this.session.doc,u=i.getNewLineCharacter()==`
|
|
1371
|
+
`&&i.getNewLineMode()!="windows",f=u?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=f)return this.EOL_CHAR=f,!0},s.prototype.setPadding=function(i){this.$padding=i,this.element.style.margin="0 "+i+"px"},s.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},s.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},s.prototype.$setFontMetrics=function(i){this.$fontMetrics=i,this.$fontMetrics.on("changeCharacterSize",(function(u){this._signal("changeCharacterSize",u)}).bind(this)),this.$pollSizeChanges()},s.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},s.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},s.prototype.setSession=function(i){this.session=i,i&&this.$computeTabString()},s.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)},s.prototype.setDisplayIndentGuides=function(i){return this.displayIndentGuides==i?!1:(this.displayIndentGuides=i,this.$computeTabString(),!0)},s.prototype.setHighlightIndentGuides=function(i){return this.$highlightIndentGuides===i?!1:(this.$highlightIndentGuides=i,i)},s.prototype.$computeTabString=function(){var i=this.session.getTabSize();this.tabSize=i;for(var u=this.$tabStrings=[0],f=1;f<i+1;f++)if(this.showTabs){var y=this.dom.createElement("span");y.className="ace_invisible ace_invisible_tab",y.textContent=m.stringRepeat(this.TAB_CHAR,f),u.push(y)}else u.push(this.dom.createTextNode(m.stringRepeat(" ",f),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var b="ace_indent-guide",E=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+E,y.textContent=$,this.$tabStrings[" "]=y;var y=this.dom.createElement("span");y.className=b+A,y.textContent=S,this.$tabStrings[" "]=y}},s.prototype.updateLines=function(i,u,f){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(f,i.lastRow),E=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=E[$++];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 T=i.lineHeight*this.session.getRowLength(S)+"px";L.style.height!=T&&(A=!0,L.style.height=T)}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"}},s.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 f=i.lastRow,y=u?u.lastRow:-1;if(!u||y<i.firstRow)return this.update(i);if(f<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()},s.prototype.$renderLinesFragment=function(i,u,f){for(var y=[],b=u,E=this.session.getNextFoldLine(b),$=E?E.start.row:1/0;b>$&&(b=E.end.row+1,E=this.session.getNextFoldLine(b,E),$=E?E.start.row:1/0),!(b>f);){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==$?E:!1),this.$useLineGroups()?S.className="ace_line_group":S.className="ace_line",y.push(A),b++}return y},s.prototype.update=function(i){this.$lines.moveContainer(i),this.config=i;for(var u=i.firstRow,f=i.lastRow,y=this.$lines;y.getLength();)y.pop();y.push(this.$renderLinesFragment(i,u,f))},s.prototype.$renderToken=function(i,u,f,y){for(var b=this,E=/(\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=E.exec(y);){var M=A[1],R=A[2],L=A[3],T=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(T){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:T,$.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(f.type))i.appendChild($);else{var x="ace_"+f.type.replace(/\./g," ace_"),C=this.dom.createElement("span");f.type=="fold"&&(C.style.width=f.value.length*this.config.characterWidth+"px",C.setAttribute("title",r("inline-fold.closed.title","Unfold code"))),C.className=x,C.appendChild($),i.appendChild(C)}return u+y.length},s.prototype.renderIndentGuide=function(i,u,f){var y=u.search(this.$indentGuideRe);if(y<=0||y>=f)return u;if(u[0]==" "){y-=y%this.tabSize;for(var b=y/this.tabSize,E=0;E<b;E++)i.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),u.substr(y)}else if(u[0]==" "){for(var E=0;E<y;E++)i.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),u.substr(y)}return this.$highlightIndentGuide(),u},s.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(),f=/^\s*/.exec(this.session.doc.getLine(u.row))[0].length,y=Math.floor(f/this.tabSize);this.$highlightIndentGuideMarker={indentLevel:y,start:u.row};var b=this.session.$bracketHighlight;if(b){for(var E=this.session.$bracketHighlight.ranges,$=0;$<E.length;$++)if(u.row!==E[$].start.row){this.$highlightIndentGuideMarker.end=E[$].start.row,u.row>E[$].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<=f))break}}this.$renderHighlightIndentGuide()}}},s.prototype.$clearActiveIndentGuide=function(){for(var i=this.$lines.cells,u=0;u<i.length;u++){var f=i[u],y=f.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}}}},s.prototype.$setIndentGuideActive=function(i,u){var f=this.session.doc.getLine(i.row);if(f!==""){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")}}},s.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 f=0;f<i.length;f++){var y=i[f];if(this.$highlightIndentGuideMarker.end&&y.row>=this.$highlightIndentGuideMarker.start+1){if(y.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(y,u)}}else for(var f=i.length-1;f>=0;f--){var y=i[f];if(this.$highlightIndentGuideMarker.end&&y.row<this.$highlightIndentGuideMarker.start){if(y.row<=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(y,u)}}}},s.prototype.$createLineElement=function(i){var u=this.dom.createElement("div");return u.className="ace_line",u.style.height=this.config.lineHeight+"px",u},s.prototype.$renderWrappedLine=function(i,u,f){var y=0,b=0,E=f[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,E),!R)continue;y-=R.length}if(y+R.length<E)$=this.$renderToken(A,$,M,R),y+=R.length;else{for(;y+R.length>=E;)$=this.$renderToken(A,$,M,R.substring(0,E-y)),R=R.substring(E-y),y=E,A=this.$createLineElement(),i.appendChild(A),A.appendChild(this.dom.createTextNode(m.stringRepeat(" ",f.indent),this.element)),b++,$=0,E=f[b]||Number.MAX_VALUE;R.length!=0&&(y+=R.length,$=this.$renderToken(A,$,M,R))}}f[f.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(A,$,null,"",!0)},s.prototype.$renderSimpleLine=function(i,u){for(var f=0,y=0;y<u.length;y++){var b=u[y],E=b.value;if(!(y==0&&this.displayIndentGuides&&(E=this.renderIndentGuide(i,E),!E))){if(f+E.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(i,f,b,E);f=this.$renderToken(i,f,b,E)}}},s.prototype.$renderOverflowMessage=function(i,u,f,y,b){f&&this.$renderToken(i,u,f,y.slice(0,this.MAX_LINE_LENGTH-u));var E=this.dom.createElement("span");E.className="ace_inline_button ace_keyword ace_toggle_wrap",E.textContent=b?"<hide>":"<click to see more...>",i.appendChild(E)},s.prototype.$renderLine=function(i,u,f){if(!f&&f!=!1&&(f=this.session.getFoldLine(u)),f)var y=this.$getFoldLineTokens(u,f);else var y=this.session.getTokens(u);var b=i;if(y.length){var E=this.session.getRowSplitData(u);if(E&&E.length){this.$renderWrappedLine(i,y,E);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){f&&(u=f.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($)}},s.prototype.$getFoldLineTokens=function(i,u){var f=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 E=f.getTokens(i);return u.walk(function($,A,S,M,R){$!=null?y.push({type:"fold",value:$}):(R&&(E=f.getTokens(A)),E.length&&b(E,M,S))},u.end.row,this.session.getLine(u.end.row).length),y},s.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},s})();a.prototype.EOF_CHAR="¶",a.prototype.EOL_CHAR_LF="¬",a.prototype.EOL_CHAR_CRLF="¤",a.prototype.EOL_CHAR=a.prototype.EOL_CHAR_LF,a.prototype.TAB_CHAR="—",a.prototype.SPACE_CHAR="·",a.prototype.$padding=0,a.prototype.MAX_LINE_LENGTH=1e4,a.prototype.showInvisibles=!1,a.prototype.showSpaces=!1,a.prototype.showTabs=!1,a.prototype.showEOL=!1,a.prototype.displayIndentGuides=!0,a.prototype.$highlightIndentGuides=!0,a.prototype.$tabStrings=[],a.prototype.destroy={},a.prototype.onChangeTabSize=a.prototype.$computeTabString,h.implement(a.prototype,d),n.Text=a}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(t,n,p){var h=t("../lib/dom"),g=(function(){function m(c){this.element=h.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(),h.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return m.prototype.$updateOpacity=function(c){for(var d=this.cursors,r=d.length;r--;)h.setStyle(d[r].style,"opacity",c?"":"0")},m.prototype.$startCssAnimation=function(){for(var c=this.cursors,d=c.length;d--;)c[d].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout((function(){this.$isAnimating&&h.addCssClass(this.element,"ace_animate-blinking")}).bind(this))},m.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,h.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,h.setCssClass(this.element,"ace_smooth-blinking",c),this.$updateCursors(!0),this.restartTimer())},m.prototype.addCursor=function(){var c=h.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,h.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},m.prototype.showCursor=function(){this.isVisible=!0,h.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,h.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&&h.addCssClass(this.element,"ace_smooth-blinking")}).bind(this))),h.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var d=(function(){this.timeoutId=setTimeout(function(){c(!1)},.6*this.blinkInterval)}).bind(this);this.intervalId=setInterval(function(){c(!0),d()},this.blinkInterval),d()}},m.prototype.getPixelPosition=function(c,d){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),a=(r.row-(d?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:o,top:a}},m.prototype.isCursorInView=function(c,d){return c.top>=0&&c.top<d.maxHeight},m.prototype.update=function(c){this.config=c;var d=this.session.$selectionMarkers,r=0,o=0;(d===void 0||d.length===0)&&(d=[{cursor:null}]);for(var r=0,a=d.length;r<a;r++){var s=this.getPixelPosition(d[r].cursor,!0);if(!((s.top>c.height+c.offset||s.top<0)&&r>1)){var i=this.cursors[o++]||this.addCursor(),u=i.style;this.drawCursor?this.drawCursor(i,s,c,d[r],this.session):this.isCursorInView(s,c)?(h.setStyle(u,"display","block"),h.translate(i,s.left,s.top),h.setStyle(u,"width",Math.round(c.characterWidth)+"px"),h.setStyle(u,"height",c.lineHeight+"px")):h.setStyle(u,"display","none")}}for(;this.cursors.length>o;)this.removeCursor();var f=this.session.getOverwrite();this.$setOverwrite(f),this.$pixelPos=s,this.restartTimer()},m.prototype.$setOverwrite=function(c){c!=this.overwrite&&(this.overwrite=c,c?h.addCssClass(this.element,"ace_overwrite-cursors"):h.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 h=this&&this.__extends||(function(){var i=function(u,f){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,b){y.__proto__=b}||function(y,b){for(var E in b)Object.prototype.hasOwnProperty.call(b,E)&&(y[E]=b[E])},i(u,f)};return function(u,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");i(u,f);function y(){this.constructor=u}u.prototype=f===null?Object.create(f):(y.prototype=f.prototype,new y)}})(),g=t("./lib/oop"),m=t("./lib/dom"),c=t("./lib/event"),d=t("./lib/event_emitter").EventEmitter,r=32768,o=(function(){function i(u,f){this.element=m.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+f,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,d);var a=(function(i){h(u,i);function u(f,y){var b=i.call(this,f,"-v")||this;return b.scrollTop=0,b.scrollHeight=0,y.$scrollbarWidth=b.width=m.scrollbarWidth(f.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 f=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-f)/(this.coeff-f)}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(f){this.element.style.height=f+"px"},u.prototype.setScrollHeight=function(f){this.scrollHeight=f,f>r?(this.coeff=r/f,f=r):this.coeff!=1&&(this.coeff=1),this.inner.style.height=f+"px"},u.prototype.setScrollTop=function(f){this.scrollTop!=f&&(this.skipEvent=!0,this.scrollTop=f,this.element.scrollTop=f*this.coeff)},u})(o);a.prototype.setInnerHeight=a.prototype.setScrollHeight;var s=(function(i){h(u,i);function u(f,y){var b=i.call(this,f,"-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(f){this.element.style.width=f+"px"},u.prototype.setInnerWidth=function(f){this.inner.style.width=f+"px"},u.prototype.setScrollWidth=function(f){this.inner.style.width=f+"px"},u.prototype.setScrollLeft=function(f){this.scrollLeft!=f&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=f)},u})(o);n.ScrollBar=a,n.ScrollBarV=a,n.ScrollBarH=s,n.VScrollBar=a,n.HScrollBar=s}),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 h=this&&this.__extends||(function(){var s=function(i,u){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,y){f.__proto__=y}||function(f,y){for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(f[b]=y[b])},s(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");s(i,u);function f(){this.constructor=i}i.prototype=u===null?Object.create(u):(f.prototype=u.prototype,new f)}})(),g=t("./lib/oop"),m=t("./lib/dom"),c=t("./lib/event"),d=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
|
|
1409
|
+
}`,"ace_scrollbar.css",!1);var r=(function(){function s(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 s.prototype.setVisible=function(i){this.element.style.display=i?"":"none",this.isVisible=i,this.coeff=1},s})();g.implement(r.prototype,d);var o=(function(s){h(i,s);function i(u,f){var y=s.call(this,u,"-v")||this;return y.scrollTop=0,y.scrollHeight=0,y.parent=u,y.width=y.VScrollWidth,y.renderer=f,y.inner.style.width=y.element.style.width=(y.width||15)+"px",y.$minWidth=0,y}return i.prototype.onMouseDown=function(u,f){if(u==="mousedown"&&!(c.getButton(f)!==0||f.detail===2)){if(f.target===this.inner){var y=this,b=f.clientY,E=function(T){b=T.clientY},$=function(){clearInterval(R)},A=f.clientY,S=this.thumbTop,M=function(){if(b!==void 0){var T=y.scrollTopFromThumbTop(S+b-A);T!==y.scrollTop&&y._emit("scroll",{data:T})}};c.capture(this.inner,E,$);var R=setInterval(M,20);return c.preventDefault(f)}var L=f.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(L)}),c.preventDefault(f)}},i.prototype.getHeight=function(){return this.height},i.prototype.scrollTopFromThumbTop=function(u){var f=u*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return f=f>>0,f<0?f=0:f>this.pageHeight-this.viewHeight&&(f=this.pageHeight-this.viewHeight),f},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,f){this.pageHeight===u&&!f||(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 a=(function(s){h(i,s);function i(u,f){var y=s.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=f,y}return i.prototype.onMouseDown=function(u,f){if(u==="mousedown"&&!(c.getButton(f)!==0||f.detail===2)){if(f.target===this.inner){var y=this,b=f.clientX,E=function(T){b=T.clientX},$=function(){clearInterval(R)},A=f.clientX,S=this.thumbLeft,M=function(){if(b!==void 0){var T=y.scrollLeftFromThumbLeft(S+b-A);T!==y.scrollLeft&&y._emit("scroll",{data:T})}};c.capture(this.inner,E,$);var R=setInterval(M,20);return c.preventDefault(f)}var L=f.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(L)}),c.preventDefault(f)}},i.prototype.getHeight=function(){return this.isVisible?this.height:0},i.prototype.scrollLeftFromThumbLeft=function(u){var f=u*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return f=f>>0,f<0?f=0:f>this.pageWidth-this.viewWidth&&(f=this.pageWidth-this.viewWidth),f},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,f){this.pageWidth===u&&!f||(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);a.prototype.setInnerWidth=a.prototype.setScrollWidth,n.ScrollBar=o,n.ScrollBarV=o,n.ScrollBarH=a,n.VScrollBar=o,n.HScrollBar=a}),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(t,n,p){var h=t("./lib/event"),g=(function(){function m(c,d){this.onRender=c,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=d||window;var r=this;this._flush=function(o){r.pending=!1;var a=r.changes;if(a&&(h.blockIdle(100),r.changes=0,r.onRender(a)),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&&(h.nextFrame(this._flush),this.pending=!0)},m.prototype.clear=function(c){var d=this.changes;return this.changes=0,d},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 h=t("../lib/oop"),g=t("../lib/dom"),m=t("../lib/lang"),c=t("../lib/event"),d=t("../lib/useragent"),r=t("../lib/event_emitter").EventEmitter,o=512,a=typeof ResizeObserver=="function",s=200,i=(function(){function u(f){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),f.appendChild(this.el),this.$measureNode.textContent=m.stringRepeat("X",o),this.$characterSize={width:0,height:0},a?this.$addObserver():this.checkForSizeChanges()}return u.prototype.$setMeasureNodeStyles=function(f,y){f.width=f.height="auto",f.left=f.top="0px",f.visibility="hidden",f.position="absolute",f.whiteSpace="pre",d.isIE<8?f["font-family"]="inherit":f.font="inherit",f.overflow=y?"hidden":"visible"},u.prototype.checkForSizeChanges=function(f){if(f===void 0&&(f=this.$measureSizes()),f&&(this.$characterSize.width!==f.width||this.$characterSize.height!==f.height)){this.$measureNode.style.fontWeight="bold";var y=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=f,this.charSizes=Object.create(null),this.allowBoldFonts=y&&y.width===f.width&&y.height===f.height,this._emit("changeCharacterSize",{data:f})}},u.prototype.$addObserver=function(){var f=this;this.$observer=new window.ResizeObserver(function(y){f.checkForSizeChanges()}),this.$observer.observe(this.$measureNode)},u.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var f=this;return this.$pollSizeChangesTimer=c.onIdle(function y(){f.checkForSizeChanges(),c.onIdle(y,500)},500)},u.prototype.setPolling=function(f){f?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},u.prototype.$measureSizes=function(f){var y={height:(f||this.$measureNode).clientHeight,width:(f||this.$measureNode).clientWidth/o};return y.width===0||y.height===0?null:y},u.prototype.$measureCharWidth=function(f){this.$main.textContent=m.stringRepeat(f,o);var y=this.$main.getBoundingClientRect();return y.width/o},u.prototype.getCharacterWidth=function(f){var y=this.charSizes[f];return y===void 0&&(y=this.charSizes[f]=this.$measureCharWidth(f)/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(f){return!f||!f.parentElement?1:(Number(window.getComputedStyle(f).zoom)||1)*this.$getZoom(f.parentElement)},u.prototype.$initTransformMeasureNodes=function(){var f=function(y,b){return["div",{style:"position: absolute;top:"+y+"px;left:"+b+"px;"}]};this.els=g.buildDom([f(0,0),f(s,0),f(0,s),f(s,s)],this.el)},u.prototype.transformCoordinates=function(f,y){if(f){var b=this.$getZoom(this.el);f=S(1/b,f)}function E(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 M(N){var P=N.getBoundingClientRect();return[P.left,P.top]}var R=M(this.els[0]),L=M(this.els[1]),T=M(this.els[2]),D=M(this.els[3]),w=E($(D,L),$(D,T),$(A(L,T),A(D,R))),v=S(1+w[0],$(L,R)),C=S(1+w[1],$(T,R));if(y){var x=y,_=w[0]*x[0]/s+w[1]*x[1]/s+1,k=A(S(x[0],v),S(x[1],C));return A(S(1/_/s,k),R)}var O=$(f,R),I=E($(v,S(w[0],O)),$(C,S(w[1],O)),O);return S(s,I)},u})();i.prototype.$characterSize={width:0,height:0},h.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,f){var d=t("../lib/dom"),g=t("../lib/oop"),m=t("../lib/event_emitter").EventEmitter,c=(function(){function p(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 p.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)}},p.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},p})();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,f){var d=t("./lib/oop"),g=t("./lib/dom"),m=t("./lib/lang"),c=t("./config"),p=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 p(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,f){var d=t("../lib/oop"),g=t("../lib/net"),m=t("../lib/event_emitter").EventEmitter,c=t("../config");function p(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=p(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,f){var d=t("./range").Range,g=t("./lib/event_emitter").EventEmitter,m=t("./lib/oop"),c=(function(){function p(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 p.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)},p.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)})}},p.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)}},p.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()}},p.prototype.updateAnchors=function(r){this.pos.onChange(r);for(var o=this.others.length;o--;)this.others[o].onChange(r);this.updateMarkers()},p.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)}},p.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))}},p.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},p.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)}},p})();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,f){var d=t("../lib/event"),g=t("../lib/useragent");function m(p,r){return p.row==r.row&&p.column==r.column}function c(p){var r=p.domEvent,o=r.altKey,s=r.shiftKey,a=r.ctrlKey,i=p.getAccelKey(),u=p.getButton();if(a&&g.isMac&&(u=r.button),p.editor.inMultiSelectMode&&u==2){p.editor.textInput.onContextMenu(p.domEvent);return}if(!a&&!o&&!i){u===0&&p.editor.inMultiSelectMode&&p.editor.exitMultiSelectMode();return}if(u===0){var h=p.editor,y=h.selection,w=h.inMultiSelectMode,x=p.getDocumentPosition(),$=y.getCursor(),A=p.inSelection()||y.isEmpty()&&m(x,$),S=p.x,E=p.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"){p.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 p.preventDefault()}}}n.onMouseDown=c}),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],function(t,n,f){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,f){var d=t("./range_list").RangeList,g=t("./range").Range,m=t("./selection").Selection,c=t("./mouse/multi_select_handler").onMouseDown,p=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(`
|
|
2098
|
+
}`}),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],function(t,n,p){var h=t("../lib/dom"),g=t("../lib/oop"),m=t("../lib/event_emitter").EventEmitter,c=(function(){function d(r,o){this.canvas=h.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 d.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 a=(r.lastRow+1)*this.lineHeight;a<this.canvasHeight?this.heightRatio=1:this.heightRatio=this.canvasHeight/this.maxHeight}var s=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(s.clearRect(0,0,this.canvas.width,this.canvas.height),u){var f={info:1,warning:2,error:3};u.forEach(function(D){D.priority=f[D.type]||null}),u=u.sort(i);for(var y=this.renderer.session.$foldData,b=0;b<u.length;b++){var E=u[b].row,$=this.compensateFoldRows(E,y),A=Math.round((E-$)*this.lineHeight*this.heightRatio),S=Math.round((E-$)*this.lineHeight*this.heightRatio),M=Math.round(((E-$)*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)}s.fillStyle=o[u[b].type]||null,s.fillRect(0,A,this.canvasWidth,M-S)}}var T=this.renderer.session.selection.getCursor();if(T){var $=this.compensateFoldRows(T.row,y),A=Math.round((T.row-$)*this.lineHeight*this.heightRatio);s.fillStyle="rgba(0, 0, 0, 0.5)",s.fillRect(0,A,this.canvasWidth,2)}},d.prototype.compensateFoldRows=function(r,o){var a=0;if(o&&o.length>0)for(var s=0;s<o.length;s++)r>o[s].start.row&&r<o[s].end.row?a+=r-o[s].start.row:r>=o[s].end.row&&(a+=o[s].end.row-o[s].start.row);return a},d})();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 h=t("./lib/oop"),g=t("./lib/dom"),m=t("./lib/lang"),c=t("./config"),d=t("./layer/gutter").Gutter,r=t("./layer/marker").Marker,o=t("./layer/text").Text,a=t("./layer/cursor").Cursor,s=t("./scrollbar").HScrollBar,i=t("./scrollbar").VScrollBar,u=t("./scrollbar_custom").HScrollBar,f=t("./scrollbar_custom").VScrollBar,y=t("./renderloop").RenderLoop,b=t("./layer/font_metrics").FontMetrics,E=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(T,D){var w=this;this.container=T||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 d(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 a(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new i(this.container,this),this.scrollBarH=new s(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(T){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=T,T&&this.scrollMargin.top&&T.getScrollTop()<=0&&T.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(T),this.$markerBack.setSession(T),this.$markerFront.setSession(T),this.$gutterLayer.setSession(T),this.$textLayer.setSession(T),T&&(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(T,D,w){if(D===void 0&&(D=1/0),this.$changedLines?(this.$changedLines.firstRow>T&&(this.$changedLines.firstRow=T),this.$changedLines.lastRow<D&&(this.$changedLines.lastRow=D)):this.$changedLines={firstRow:T,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(T){T?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(T,D,w,v){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=T?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 x=this.$updateCachedSize(T,D,w,v);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!w&&!v)return this.resizing=0;T&&(this.$gutterLayer.$padding=null),T?this.$renderChanges(x|this.$changes,!0):this.$loop.schedule(x|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},L.prototype.$updateCachedSize=function(T,D,w,v){v-=this.$extraHeight||0;var C=0,x=this.$size,_={width:x.width,height:x.height,scrollerHeight:x.scrollerHeight,scrollerWidth:x.scrollerWidth};if(v&&(T||x.height!=v)&&(x.height=v,C|=this.CHANGE_SIZE,x.scrollerHeight=x.height,this.$horizScroll&&(x.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(x.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",C=C|this.CHANGE_SCROLL),w&&(T||x.width!=w)){C|=this.CHANGE_SIZE,x.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"),x.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(x.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||T)&&(C|=this.CHANGE_FULL)}return x.$dirty=!w||!v,C&&this._signal("resize",_),C},L.prototype.onGutterResize=function(T){var D=this.$showGutter?T: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 T=this.$size.scrollerWidth-this.$padding*2,D=Math.floor(T/this.characterWidth);return this.session.adjustWrapLimit(D,this.$showPrintMargin&&this.$printMarginColumn)},L.prototype.setAnimatedScroll=function(T){this.setOption("animatedScroll",T)},L.prototype.getAnimatedScroll=function(){return this.$animatedScroll},L.prototype.setShowInvisibles=function(T){this.setOption("showInvisibles",T),this.session.$bidiHandler.setShowInvisibles(T)},L.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},L.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},L.prototype.setDisplayIndentGuides=function(T){this.setOption("displayIndentGuides",T)},L.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},L.prototype.setHighlightIndentGuides=function(T){this.setOption("highlightIndentGuides",T)},L.prototype.setShowPrintMargin=function(T){this.setOption("showPrintMargin",T)},L.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},L.prototype.setPrintMarginColumn=function(T){this.setOption("printMarginColumn",T)},L.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},L.prototype.getShowGutter=function(){return this.getOption("showGutter")},L.prototype.setShowGutter=function(T){return this.setOption("showGutter",T)},L.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},L.prototype.setFadeFoldWidgets=function(T){this.setOption("fadeFoldWidgets",T)},L.prototype.setHighlightGutterLine=function(T){this.setOption("highlightGutterLine",T)},L.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},L.prototype.$updatePrintMargin=function(){if(!(!this.$showPrintMargin&&!this.$printMarginEl)){if(!this.$printMarginEl){var T=g.createElement("div");T.className="ace_layer ace_print-margin-layer",this.$printMarginEl=g.createElement("div"),this.$printMarginEl.className="ace_print-margin",T.appendChild(this.$printMarginEl),this.content.insertBefore(T,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 T=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,x=w.left;C-=v.offset;var _=D&&D.useTextareaForIME||S.isMobile?this.lineHeight:1;if(C<0||C>v.height-_){g.translate(this.textarea,0,0);return}var k=1,O=this.$size.height-_;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;x-=this.scrollLeft,x>this.$size.scrollerWidth-k&&(x=this.$size.scrollerWidth-k),x+=this.gutterWidth+this.margin.left,g.setStyle(T,"height",_+"px"),g.setStyle(T,"width",k+"px"),g.translate(this.textarea,Math.min(x,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 T=this.layerConfig,D=T.lastRow,w=this.session.documentToScreenRow(D,0)*T.lineHeight;return w-this.session.getScrollTop()>T.height-T.lineHeight?D-1:D},L.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},L.prototype.setPadding=function(T){this.$padding=T,this.$textLayer.setPadding(T),this.$cursorLayer.setPadding(T),this.$markerFront.setPadding(T),this.$markerBack.setPadding(T),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},L.prototype.setScrollMargin=function(T,D,w,v){var C=this.scrollMargin;C.top=T|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(T,D,w,v){var C=this.margin;C.top=T|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(T){this.setOption("hScrollBarAlwaysVisible",T)},L.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},L.prototype.setVScrollBarAlwaysVisible=function(T){this.setOption("vScrollBarAlwaysVisible",T)},L.prototype.$updateScrollBarV=function(){var T=this.layerConfig.maxHeight,D=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(T-=(D-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>T-D&&(T=this.scrollTop+D,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(T+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(T,D){if(this.$changes&&(T|=this.$changes,this.$changes=0),!this.session||!this.container.offsetWidth||this.$frozen||!T&&!D){this.$changes|=T;return}if(this.$size.$dirty)return this.$changes|=T,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",T),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var w=this.layerConfig;if(T&this.CHANGE_FULL||T&this.CHANGE_SIZE||T&this.CHANGE_TEXT||T&this.CHANGE_LINES||T&this.CHANGE_SCROLL||T&this.CHANGE_H_SCROLL){if(T|=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,T=T|this.CHANGE_SCROLL,T|=this.$computeLayerConfig()|this.$loop.clear())}w=this.layerConfig,this.$updateScrollBarV(),T&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),g.translate(this.content,-this.scrollLeft,-w.offset);var C=w.width+2*this.$padding+"px",x=w.minHeight+"px";g.setStyle(this.content.style,"width",C),g.setStyle(this.content.style,"height",x)}if(T&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)),T&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",T);return}if(T&this.CHANGE_SCROLL){this.$changedLines=null,T&this.CHANGE_TEXT||T&this.CHANGE_LINES?this.$textLayer.update(w):this.$textLayer.scrollLines(w),this.$showGutter&&(T&this.CHANGE_GUTTER||T&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",T);return}T&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(w),this.$showGutter&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)):T&this.CHANGE_LINES?((this.$updateLines()||T&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)):T&this.CHANGE_TEXT||T&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)):T&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(w),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(w)),T&this.CHANGE_CURSOR&&(this.$cursorLayer.update(w),this.$moveTextAreaToCursor()),T&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(w),T&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(w),this._signal("afterRender",T)},L.prototype.$autosize=function(){var T=this.session.getScreenLength()*this.lineHeight,D=this.$maxLines*this.lineHeight,w=Math.min(D,Math.max((this.$minLines||1)*this.lineHeight,T))+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&&T>D;if(w!=this.desiredHeight||this.$size.height!=this.desiredHeight||C!=this.$vScroll){C!=this.$vScroll&&(this.$vScroll=C,this.scrollBarV.setVisible(C));var x=this.container.clientWidth;this.container.style.height=w+"px",this.$updateCachedSize(!0,this.$gutterWidth,x,w),this.desiredHeight=w,this._signal("autosize")}},L.prototype.$computeLayerConfig=function(){var T=this.session,D=this.$size,w=D.height<=2*this.lineHeight,v=this.session.getScreenLength(),C=v*this.lineHeight,x=this.$getLongestLine(),_=!w&&(this.$hScrollBarAlwaysVisible||D.scrollerWidth-x-2*this.$padding<0),k=this.$horizScroll!==_;k&&(this.$horizScroll=_,this.scrollBarH.setVisible(_));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,x+2*this.$padding-D.scrollerWidth+P.right)));var B=!w&&(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=T.screenToDocumentRow(W,0);var Q=T.getFoldLine(W);Q&&(W=Q.start.row),K=T.documentToScreenRow(W,0),Y=T.getRowLength(W)*G,U=Math.min(T.screenToDocumentRow(U,0),T.getLength()-1),I=D.scrollerHeight+T.getRowLength(U)*G+Y,H=this.scrollTop-K*G;var ue=0;return(this.layerConfig.width!=x||k)&&(ue=this.CHANGE_H_SCROLL),(k||F)&&(ue|=this.$updateCachedSize(!0,this.gutterWidth,D.width,D.height),this._signal("scrollbarVisibilityChanged"),F&&(x=this.$getLongestLine())),this.layerConfig={width:x,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(x-this.$padding),ue},L.prototype.$updateLines=function(){if(this.$changedLines){var T=this.$changedLines.firstRow,D=this.$changedLines.lastRow;this.$changedLines=null;var w=this.layerConfig;if(!(T>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,T,D),!0}}},L.prototype.$getLongestLine=function(){var T=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(T+=1),this.$textLayer&&T>this.$textLayer.MAX_LINE_LENGTH&&(T=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(T*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(T,D){this.$gutterLayer.addGutterDecoration(T,D)},L.prototype.removeGutterDecoration=function(T,D){this.$gutterLayer.removeGutterDecoration(T,D)},L.prototype.updateBreakpoints=function(T){this._rows=T,this.$loop.schedule(this.CHANGE_GUTTER)},L.prototype.setAnnotations=function(T){this.$gutterLayer.setAnnotations(T),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(T,D,w){this.scrollCursorIntoView(T,w),this.scrollCursorIntoView(D,w)},L.prototype.scrollCursorIntoView=function(T,D,w){if(this.$size.scrollerHeight!==0){var v=this.$cursorLayer.getPixelPosition(T),C=v.left,x=v.top,_=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?(D&&O+_>x+this.lineHeight&&(x-=D*this.$size.scrollerHeight),x===0&&(x=-this.scrollMargin.top),this.session.setScrollTop(x)):O+this.$size.scrollerHeight-k<x+this.lineHeight&&(D&&O+this.$size.scrollerHeight-k<x-this.lineHeight&&(x+=D*this.$size.scrollerHeight),this.session.setScrollTop(x+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(T){this.session.setScrollTop(T*this.lineHeight)},L.prototype.alignCursor=function(T,D){typeof T=="number"&&(T={row:T,column:0});var w=this.$cursorLayer.getPixelPosition(T),v=this.$size.scrollerHeight-this.lineHeight,C=w.top-v*(D||0);return this.session.setScrollTop(C),C},L.prototype.$calcSteps=function(T,D){var w=0,v=this.STEPS,C=[],x=function(_,k,O){return O*(Math.pow(_-1,3)+1)+k};for(w=0;w<v;++w)C.push(x(w/this.STEPS,T,D-T));return C},L.prototype.scrollToLine=function(T,D,w,v){var C=this.$cursorLayer.getPixelPosition({row:T,column:0}),x=C.top;D&&(x-=this.$size.scrollerHeight/2);var _=this.scrollTop;this.session.setScrollTop(x),w!==!1&&this.animateScrolling(_,v)},L.prototype.animateScrolling=function(T,D){var w=this.scrollTop;if(!this.$animatedScroll)return;var v=this;if(T==w)return;if(this.$scrollAnimation){var C=this.$scrollAnimation.steps;if(C.length&&(T=C[0],T==w))return}var x=v.$calcSteps(T,w);this.$scrollAnimation={from:T,to:w,steps:x},clearInterval(this.$timer),v.session.setScrollTop(x.shift()),v.session.$scrollTop=w;function _(){v.$timer=clearInterval(v.$timer),v.$scrollAnimation=null,v.$stopAnimation=!1,D&&D()}this.$timer=setInterval(function(){if(v.$stopAnimation){_();return}if(!v.session)return clearInterval(v.$timer);x.length?(v.session.setScrollTop(x.shift()),v.session.$scrollTop=w):w!=null?(v.session.$scrollTop=-1,v.session.setScrollTop(w),w=null):_()},10)},L.prototype.scrollToY=function(T){this.scrollTop!==T&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=T)},L.prototype.scrollToX=function(T){this.scrollLeft!==T&&(this.scrollLeft=T),this.$loop.schedule(this.CHANGE_H_SCROLL)},L.prototype.scrollTo=function(T,D){this.session.setScrollTop(D),this.session.setScrollLeft(T)},L.prototype.scrollBy=function(T,D){D&&this.session.setScrollTop(this.session.getScrollTop()+D),T&&this.session.setScrollLeft(this.session.getScrollLeft()+T)},L.prototype.isScrollableBy=function(T,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||T<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||T>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right)return!0},L.prototype.pixelToScreenCoordinates=function(T,D){var w;if(this.$hasCssTransforms){w={top:0,left:0};var v=this.$fontMetrics.transformCoordinates([T,D]);T=v[1]-this.gutterWidth-this.margin.left,D=v[0]}else w=this.scroller.getBoundingClientRect();var C=T+this.scrollLeft-w.left-this.$padding,x=C/this.characterWidth,_=Math.floor((D+this.scrollTop-w.top)/this.lineHeight),k=this.$blockCursor?Math.floor(x):Math.round(x);return{row:_,column:k,side:x-k>0?1:-1,offsetX:C}},L.prototype.screenToTextCoordinates=function(T,D){var w;if(this.$hasCssTransforms){w={top:0,left:0};var v=this.$fontMetrics.transformCoordinates([T,D]);T=v[1]-this.gutterWidth-this.margin.left,D=v[0]}else w=this.scroller.getBoundingClientRect();var C=T+this.scrollLeft-w.left-this.$padding,x=C/this.characterWidth,_=this.$blockCursor?Math.floor(x):Math.round(x),k=Math.floor((D+this.scrollTop-w.top)/this.lineHeight);return this.session.screenToDocumentPosition(k,Math.max(_,0),C)},L.prototype.textToScreenCoordinates=function(T,D){var w=this.scroller.getBoundingClientRect(),v=this.session.documentToScreenPosition(T,D),C=this.$padding+(this.session.$bidiHandler.isBidiRow(v.row,T)?this.session.$bidiHandler.getPosLeft(v.column):Math.round(v.column*this.characterWidth)),x=v.row*this.lineHeight;return{pageX:w.left+C-this.scrollLeft,pageY:w.top+x-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(T){this.$composition=T,T.cssText||(T.cssText=this.textarea.style.cssText),T.useTextareaForIME==null&&(T.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(g.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):T.markerId=this.session.addMarker(T.markerRange,"ace_composition_marker","text")},L.prototype.setCompositionText=function(T){var D=this.session.selection.cursor;this.addToken(T,"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 T=this.session.selection.cursor;this.removeExtraToken(T.row,T.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},L.prototype.setGhostText=function(T,D){var w=this.session.selection.cursor,v=D||{row:w.row,column:w.column};this.removeGhostText();var C=this.$calculateWrappedTextChunks(T,v);this.addToken(C[0].text,"ghost_text",v.row,v.column),this.$ghostText={text:T,position:{row:v.row,column:v.column}};var x=g.createElement("div");if(C.length>1){var _=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),x.appendChild(H),k=H}),_.forEach(function(F){var H=g.createElement("span");M(F.type)||(H.className="ace_"+F.type.replace(/\./g," ace_")),H.appendChild(g.createTextNode(F.value)),k.appendChild(H)}),this.$ghostTextWidget={el:x,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(T,D){var w=this.$size.scrollerWidth-this.$padding*2,v=Math.floor(w/this.characterWidth)-2;v=v<=0?60:v;for(var C=T.split(/\r?\n/),x=[],_=0;_<C.length;_++){var k=this.session.$getDisplayTokens(C[_],D.column),O=this.session.$computeWrapSplits(k,v,this.session.$tabSize);if(O.length>0){var I=0;O.push(C[_].length);for(var N=0;N<O.length;N++){var P=C[_].slice(I,O[N]);x.push({text:P,wrapped:!0}),I=O[N]}}else x.push({text:C[_],wrapped:!1})}return x},L.prototype.removeGhostText=function(){if(this.$ghostText){var T=this.$ghostText.position;this.removeExtraToken(T.row,T.column),this.$ghostTextWidget&&(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),this.$ghostTextWidget=null),this.$ghostText=null}},L.prototype.addToken=function(T,D,w,v){var C=this.session;C.bgTokenizer.lines[w]=null;var x={type:D,value:T},_=C.getTokens(w);if(v==null||!_.length)_.push(x);else for(var k=0,O=0;O<_.length;O++){var I=_[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);_.splice(O,1,{type:I.type,value:P},x,{type:I.type,value:B});break}}this.updateLines(w,w)},L.prototype.hideTokensAfterPosition=function(T,D){for(var w=this.session.getTokens(T),v=0,C=!1,x=[],_=0;_<w.length;_++){var k=w[_];if(v+=k.value.length,k.type!=="ghost_text"){if(C){x.push({type:k.type,value:k.value}),k.type="hidden_token";continue}v===D&&(C=!0)}}return this.updateLines(T,T),x},L.prototype.removeExtraToken=function(T,D){this.session.bgTokenizer.lines[T]=null,this.updateLines(T,T)},L.prototype.setTheme=function(T,D){var w=this;if(this.$themeId=T,w._dispatchEvent("themeChange",{theme:T}),!T||typeof T=="string"){var v=T||this.$options.theme.initialValue;c.loadModule(["theme",v],C)}else C(T);function C(x){if(w.$themeId!=T)return D&&D();if(!x||!x.cssClass)throw new Error("couldn't load module "+T+" or it didn't call define");x.$id&&(w.$themeId=x.$id),g.importCssString(x.cssText,x.cssClass,w.container),w.theme&&g.removeCssClass(w.container,w.theme.cssClass);var _="padding"in x?x.padding:"padding"in(w.theme||{})?4:w.$padding;w.$padding&&_!=w.$padding&&w.setPadding(_),w.$theme=x.cssClass,w.theme=x,g.addCssClass(w.container,x.cssClass),g.setCssClass(w.container,"ace_dark",x.isDark),w.$size&&(w.$size.width=0,w.$updateSizeAsync()),w._dispatchEvent("themeLoaded",{theme:x}),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(T,D){g.setCssClass(this.container,T,D!==!1)},L.prototype.unsetStyle=function(T){g.removeCssClass(this.container,T)},L.prototype.setCursorStyle=function(T){g.setStyle(this.scroller.style,"cursor",T)},L.prototype.setMouseCursor=function(T){g.setStyle(this.scroller.style,"cursor",T)},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(T){var D=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),this.$scrollDecorator&&delete this.$scrollDecorator,T===!0?(this.scrollBarV=new f(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 s(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 T=this;this.$resizeTimer=m.delayedCall(function(){T.destroyed||T.onResize()},50),this.$resizeObserver=new window.ResizeObserver(function(D){var w=D[0].contentRect.width,v=D[0].contentRect.height;Math.abs(T.$size.width-w)>1||Math.abs(T.$size.height-v)>1?T.$resizeTimer.delay():T.$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,h.implement(R.prototype,E),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 h=t("../lib/oop"),g=t("../lib/net"),m=t("../lib/event_emitter").EventEmitter,c=t("../config");function d(s){var i="importScripts('"+g.qualifyURL(s)+"');";try{return new Blob([i],{type:"application/javascript"})}catch{var u=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder,f=new u;return f.append(i),f.getBlob("application/javascript")}}function r(s){if(typeof Worker>"u")return{postMessage:function(){},terminate:function(){}};if(c.get("loadWorkerFromBlob")){var i=d(s),u=window.URL||window.webkitURL,f=u.createObjectURL(i);return new Worker(f)}return new Worker(s)}var o=function(s){s.postMessage||(s=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=s,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(){h.implement(this,m),this.$createWorkerFromOldConfig=function(s,i,u,f,y){if(t.nameToUrl&&!t.toUrl&&(t.toUrl=t.nameToUrl),c.get("packaged")||!t.toUrl)f=f||c.moduleUrl(i,"worker");else{var b=this.$normalizePath;f=f||b(t.toUrl("ace/worker/worker.js",null,"_"));var E={};s.forEach(function($){E[$]=b(t.toUrl($,null,"_").replace(/(\.js)?(\?.*)?$/,""))})}return this.$worker=r(f),y&&this.send("importScripts",y),this.$worker.postMessage({init:!0,tlns:E,module:i,classname:u}),this.$worker},this.onMessage=function(s){var i=s.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(s){window.console&&console.error&&console.error(s)},this.$normalizePath=function(s){return g.qualifyURL(s)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(s){s.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(s,i){this.$worker.postMessage({command:s,args:i})},this.call=function(s,i,u){if(u){var f=this.callbackId++;this.callbacks[f]=u,i.push(f)}this.send(s,i)},this.emit=function(s,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:s,data:{data:i.data}})}catch(u){console.error(u.stack)}},this.attachToDocument=function(s){this.$doc&&this.terminate(),this.$doc=s,this.call("setValue",[s.getValue()]),s.on("change",this.changeListener,!0)},this.changeListener=function(s){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),s.action=="insert"?this.deltaQueue.push(s.start,s.lines):this.deltaQueue.push(s.start,s.end)},this.$sendDeltaQueue=function(){var s=this.deltaQueue;s&&(this.deltaQueue=null,s.length>50&&s.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:s}))}}).call(o.prototype);var a=function(s,i,u){var f=null,y=!1,b=Object.create(m),E=[],$=new o({messageBuffer:E,terminate:function(){},postMessage:function(S){E.push(S),f&&(y?setTimeout(A):A())}});$.setEmitSync=function(S){y=S};var A=function(){var S=E.shift();S.command?f[S.command].apply(f,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(f=new S[u](b);E.length;)A()}),$};n.UIWorkerClient=a,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 h=t("./range").Range,g=t("./lib/event_emitter").EventEmitter,m=t("./lib/oop"),c=(function(){function d(r,o,a,s,i,u){var f=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=s,this.$onCursorChange=function(){setTimeout(function(){f.onCursorChange()})},this.$pos=a;var y=r.getUndoManager().$undoStack||r.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=y.length,this.setup(),r.selection.on("changeCursor",this.$onCursorChange)}return d.prototype.setup=function(){var r=this,o=this.doc,a=this.session;this.selectionBefore=a.selection.toJSON(),a.selection.inMultiSelectMode&&a.selection.toSingleRange(),this.pos=o.createAnchor(this.$pos.row,this.$pos.column);var s=this.pos;s.$insertRight=!0,s.detach(),s.markerId=a.addMarker(new h(s.row,s.column,s.row,s.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)}),a.setUndoSelect(!1)},d.prototype.showOtherMarkers=function(){if(!this.othersActive){var r=this.session,o=this;this.othersActive=!0,this.others.forEach(function(a){a.markerId=r.addMarker(new h(a.row,a.column,a.row,a.column+o.length),o.othersClass,null,!1)})}},d.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)}},d.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 a=r.action==="insert"?o.end.column-o.start.column:o.start.column-o.end.column,s=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),s&&(this.length+=a),s&&!this.session.$fromUndo){if(r.action==="insert")for(var u=this.others.length-1;u>=0;u--){var f=this.others[u],y={row:f.row,column:f.column+i};this.doc.insertMergedLines(y,r.lines)}else if(r.action==="remove")for(var u=this.others.length-1;u>=0;u--){var f=this.others[u],y={row:f.row,column:f.column+i};this.doc.remove(new h(y.row,y.column,y.row,y.column-a))}}this.$updating=!1,this.updateMarkers()}},d.prototype.updateAnchors=function(r){this.pos.onChange(r);for(var o=this.others.length;o--;)this.others[o].onChange(r);this.updateMarkers()},d.prototype.updateMarkers=function(){if(!this.$updating){var r=this,o=this.session,a=function(i,u){o.removeMarker(i.markerId),i.markerId=o.addMarker(new h(i.row,i.column,i.row,i.column+r.length),u,null,!1)};a(this.pos,this.mainClass);for(var s=this.others.length;s--;)a(this.others[s],this.othersClass)}},d.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))}},d.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},d.prototype.cancel=function(){if(this.$undoStackDepth!==-1){for(var r=this.session.getUndoManager(),o=(r.$undoStack||r.$undostack).length-this.$undoStackDepth,a=0;a<o;a++)r.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},d})();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 h=t("../lib/event"),g=t("../lib/useragent");function m(d,r){return d.row==r.row&&d.column==r.column}function c(d){var r=d.domEvent,o=r.altKey,a=r.shiftKey,s=r.ctrlKey,i=d.getAccelKey(),u=d.getButton();if(s&&g.isMac&&(u=r.button),d.editor.inMultiSelectMode&&u==2){d.editor.textInput.onContextMenu(d.domEvent);return}if(!s&&!o&&!i){u===0&&d.editor.inMultiSelectMode&&d.editor.exitMultiSelectMode();return}if(u===0){var f=d.editor,y=f.selection,b=f.inMultiSelectMode,E=d.getDocumentPosition(),$=y.getCursor(),A=d.inSelection()||y.isEmpty()&&m(E,$),S=d.x,M=d.y,R=function(P){S=P.clientX,M=P.clientY},L=f.session,T=f.renderer.pixelToScreenCoordinates(S,M),D=T,w;if(f.$mouseHandler.$enableJumpToDef)s&&o||i&&o?w=a?"block":"add":o&&f.$blockSelectEnabled&&(w="block");else if(i&&!o){if(w="add",!b&&a)return}else o&&f.$blockSelectEnabled&&(w="block");if(w&&g.isMac&&r.ctrlKey&&f.$mouseHandler.cancelContextMenu(),w=="add"){if(!b&&A)return;if(!b){var v=y.toOrientedRange();f.addSelectionMarker(v)}var C=y.rangeList.rangeAtPoint(E);f.inVirtualSelectionMode=!0,a&&(C=null,v=y.ranges[0]||v,f.removeSelectionMarker(v)),f.once("mouseup",function(){var P=y.toOrientedRange();C&&P.isEmpty()&&m(C.cursor,P.cursor)?y.substractPoint(P.cursor):(a?y.substractPoint(v.cursor):v&&(f.removeSelectionMarker(v),y.addRange(v)),y.addRange(P)),f.inVirtualSelectionMode=!1})}else if(w=="block"){d.stop(),f.inVirtualSelectionMode=!0;var x,_=[],k=function(){var P=f.renderer.pixelToScreenCoordinates(S,M),B=L.screenToDocumentPosition(P.row,P.column,P.offsetX);m(D,P)&&m(B,y.lead)||(D=P,f.selection.moveToPosition(B),f.renderer.scrollCursorIntoView(),f.removeSelectionMarkers(_),_=y.rectangularRangeBlock(D,T),f.$mouseHandler.$clickSelection&&_.length==1&&_[0].isEmpty()&&(_[0]=f.$mouseHandler.$clickSelection.clone()),_.forEach(f.addSelectionMarker,f),f.updateSelectionMarkers())};b&&!i?y.toSingleRange():!b&&i&&(x=y.toOrientedRange(),f.addSelectionMarker(x)),a?T=L.documentToScreenPosition(y.lead):y.moveToPosition(E),D={row:-1,column:-1};var O=function(P){k(),clearInterval(N),f.removeSelectionMarkers(_),_.length||(_=[y.toOrientedRange()]),x&&(f.removeSelectionMarker(x),y.toSingleRange(x));for(var B=0;B<_.length;B++)y.addRange(_[B]);f.inVirtualSelectionMode=!1,f.$mouseHandler.$clickSelection=null},I=k;h.capture(f.container,R,O);var N=setInterval(function(){I()},20);return d.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 h=t("../keyboard/hash_handler").HashHandler;n.keyboardHandler=new h(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 h=t("./range_list").RangeList,g=t("./range").Range,m=t("./selection").Selection,c=t("./mouse/multi_select_handler").onMouseDown,d=t("./lib/event"),r=t("./lib/lang"),o=t("./commands/multi_select_commands");n.commands=o.defaultCommands.concat(o.multiSelectCommands);var a=t("./search").Search,s=new a;function i($,A,S){return s.$options.wrap=!0,s.$options.needle=A,s.$options.backwards=S==-1,s.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 h,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,T=A.column,D=$.offsetX,w=A.offsetX;else var L=A.column,T=$.column,D=A.offsetX,w=$.offsetX;var v=$.row<A.row;if(v)var C=$.row,x=A.row;else var C=A.row,x=$.row;L<0&&(L=0),C<0&&(C=0),C==x&&(S=!0);for(var _,k=C;k<=x;k++){var O=g.fromPoints(this.session.screenToDocumentPosition(k,L,D),this.session.screenToDocumentPosition(k,T,w));if(O.isEmpty()){if(_&&y(O.end,_))break;_=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 f=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,T=this.selection,D=T.rangeList,w=(M?T:D).ranges,v;if(!w.length)return $.exec?$.exec(this,A||{}):$(this,A||{});var C=T._eventRegistry;T._eventRegistry={};var x=new m(L);this.inVirtualSelectionMode=!0;for(var _=w.length;_--;){if(R)for(;_>0&&w[_].start.row==w[_-1].end.row;)_--;x.fromOrientedRange(w[_]),x.index=_,this.selection=L.selection=x;var k=$.exec?$.exec(this,A||{}):$(this,A||{});!v&&k!==void 0&&(v=k),x.toOrientedRange(w[_])}x.detach(),this.selection=L.selection=T,this.inVirtualSelectionMode=!1,T._eventRegistry=C,T.mergeOverlappingRanges(),T.ranges[0]&&T.fromOrientedRange(T.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 T=R.length;T--;)L.addRange(R[T],!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 T=this.session.documentToScreenPosition(M?S.end:S.start),D=this.session.screenToDocumentPosition(T.row+$,T.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 T=A.getWordRange(L.start.row,L.start.column);L.start.row=T.start.row,L.start.column=T.start.column,L.end.row=T.end.row,L.end.column=T.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 T=M.getTextRange(L),D=i(M,T,$);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(),T=L.start.row,D=L.end.row,w=T==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(T);while(/[=:]/.test(C)&&--T>0);T<0&&(T=0),D>=v&&(D=v-1)}var x=this.session.removeFullLines(T,D);x=this.$reAlignText(x,w),this.session.insert({row:T,column:0},x.join(`
|
|
2099
2099
|
`)+`
|
|
2100
|
-
`),
|
|
2100
|
+
`),w||(L.start.column=0,L.end.column=x[x.length-1].length),this.selection.setRange(L)}else{R.forEach(function(I){A.substractPoint(I.cursor)});var _=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>_&&(_=N.column),B<k&&(k=B),B});S.forEach(function(I,N){var P=I.cursor,B=_-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=_,I.start.row=I.end.row=P.row,I.cursor=I.end}),A.fromOrientedRange(S[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}},this.$reAlignText=function($,A){var S=!0,M=!0,R,L,T;return $.map(function(x){var _=x.match(/(\s*)(.*?)(\s*)([=:].*)/);return _?R==null?(R=_[1].length,L=_[2].length,T=_[3].length,_):(R+L+T!=_[1].length+_[2].length+_[3].length&&(M=!1),R!=_[1].length&&(S=!1),R>_[1].length&&(R=_[1].length),L<_[2].length&&(L=_[2].length),T>_[3].length&&(T=_[3].length),_):[x]}).map(A?w:S?M?v:w:C);function D(x){return r.stringRepeat(" ",x)}function w(x){return x[2]?D(R)+x[2]+D(L-x[2].length+T)+x[4].replace(/^([=:])\s+/,"$1 "):x[0]}function v(x){return x[2]?D(R+L-x[2].length)+x[2]+D(T)+x[4].replace(/^([=:])\s+/,"$1 "):x[0]}function C(x){return x[2]?D(R)+x[2]+D(T)+x[4].replace(/^([=:])\s+/,"$1 "):x[0]}}}).call(f.prototype);function y($,A){return $.row==A.row&&$.column==A.column}n.onSessionChange=function($){var A=$.session;A&&!A.multiSelect&&(A.$selectionMarkers=[],A.selection.$initRangeList(),A.multiSelect=A.selection),this.multiSelect=A&&A.multiSelect;var S=$.oldSession;S&&(S.multiSelect.off("addRange",this.$onAddRange),S.multiSelect.off("removeRange",this.$onRemoveRange),S.multiSelect.off("multiSelect",this.$onMultiSelect),S.multiSelect.off("singleSelect",this.$onSingleSelect),S.multiSelect.lead.off("change",this.$checkMultiselectChange),S.multiSelect.anchor.off("change",this.$checkMultiselectChange)),A&&(A.multiSelect.on("addRange",this.$onAddRange),A.multiSelect.on("removeRange",this.$onRemoveRange),A.multiSelect.on("multiSelect",this.$onMultiSelect),A.multiSelect.on("singleSelect",this.$onSingleSelect),A.multiSelect.lead.on("change",this.$checkMultiselectChange),A.multiSelect.anchor.on("change",this.$checkMultiselectChange)),A&&this.inMultiSelectMode!=A.selection.inMultiSelectMode&&(A.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())};function b($){$.$multiselectOnSessionChange||($.$onAddRange=$.$onAddRange.bind($),$.$onRemoveRange=$.$onRemoveRange.bind($),$.$onMultiSelect=$.$onMultiSelect.bind($),$.$onSingleSelect=$.$onSingleSelect.bind($),$.$multiselectOnSessionChange=n.onSessionChange.bind($),$.$checkMultiselectChange=$.$checkMultiselectChange.bind($),$.$multiselectOnSessionChange($),$.on("changeSession",$.$multiselectOnSessionChange),$.on("mousedown",c),$.commands.addCommands(o.defaultCommands),E($))}function E($){if(!$.textInput)return;var A=$.textInput.getElement(),S=!1;d.addListener(A,"keydown",function(R){var L=R.keyCode==18&&!(R.ctrlKey||R.shiftKey||R.metaKey);$.$blockSelectEnabled&&L?S||($.renderer.setMouseCursor("crosshair"),S=!0):S&&M()},$),d.addListener(A,"keyup",M,$),d.addListener(A,"blur",M,$);function M(R){S&&($.renderer.setMouseCursor(""),S=!1)}}n.MultiSelect=b,t("./config").defineOptions(f.prototype,"editor",{enableMultiselect:{set:function($){b(this),$?this.on("mousedown",c):this.off("mousedown",c)},value:!0},enableBlockSelect:{set:function($){this.$blockSelectEnabled=$},value:!0}})}),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],function(t,n,p){var h=t("../../range").Range,g=n.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(m,c,d){var r=m.getLine(d);return this.foldingStartMarker.test(r)?"start":c=="markbeginend"&&this.foldingStopMarker&&this.foldingStopMarker.test(r)?"end":""},this.getFoldWidgetRange=function(m,c,d){return null},this.indentationBlock=function(m,c,d){var r=/\S/,o=m.getLine(c),a=o.search(r);if(a!=-1){for(var s=d||o.length,i=m.getLength(),u=c,f=c;++c<i;){var y=m.getLine(c).search(r);if(y!=-1){if(y<=a){var b=m.getTokenAt(c,0);if(!b||b.type!=="string")break}f=c}}if(f>u){var E=m.getLine(f).length;return new h(u,s,f,E)}}},this.openingBracketBlock=function(m,c,d,r,o){var a={row:d,column:r+1},s=m.$findClosingBracket(c,a,o);if(s){var i=m.foldWidgets[s.row];return i==null&&(i=m.getFoldWidget(s.row)),i=="start"&&s.row>a.row&&(s.row--,s.column=m.getLine(s.row).length),h.fromPoints(a,s)}},this.closingBracketBlock=function(m,c,d,r,o){var a={row:d,column:r},s=m.$findOpeningBracket(c,a);if(s)return s.column++,a.column--,h.fromPoints(s,a)}}).call(g.prototype)}),ace.define("ace/ext/error_marker",["require","exports","module","ace/lib/dom","ace/range","ace/config"],function(t,n,p){var h=t("../lib/dom"),g=t("../range").Range,m=t("../config").nls;function c(r,o,a){for(var s=0,i=r.length-1;s<=i;){var u=s+i>>1,f=a(o,r[u]);if(f>0)s=u+1;else if(f<0)i=u-1;else return u}return-(s+1)}function d(r,o,a){var s=r.getAnnotations().sort(g.comparePoints);if(s.length){var i=c(s,{row:o,column:-1},g.comparePoints);i<0&&(i=-i-1),i>=s.length?i=a>0?0:s.length-1:i===0&&a<0&&(i=s.length-1);var u=s[i];if(!(!u||!a)){if(u.row===o){do u=s[i+=a];while(u&&u.row===o);if(!u)return s.slice()}var f=[];o=u.row;do f[a<0?"unshift":"push"](u),u=s[i+=a];while(u&&u.row==o);return f.length&&f}}}n.showErrorMarker=function(r,o){var a=r.session,s=r.getCursorPosition(),i=s.row,u=a.widgetManager.getWidgetsAtRow(i).filter(function(R){return R.type=="errorMarker"})[0];u?u.destroy():i-=o;var f=d(a,i,o),y;if(f){var b=f[0];s.column=(b.pos&&typeof b.column!="number"?b.pos.sc:b.column)||0,s.row=b.row,y=r.renderer.$gutterLayer.$annotations[s.row]}else{if(u)return;y={displayText:[m("error-marker.good-state","Looks good!")],className:"ace_ok"}}r.session.unfold(s.row),r.selection.moveToPosition(s);var E={row:s.row,fixedWidth:!0,coverGutter:!0,el:h.createElement("div"),type:"errorMarker"},$=E.el.appendChild(h.createElement("div")),A=E.el.appendChild(h.createElement("div"));A.className="error_widget_arrow "+y.className;var S=r.renderer.$cursorLayer.getPixelPosition(s).left;A.style.left=S+r.renderer.gutterWidth-5+"px",E.el.className="error_widget_wrapper",$.className="error_widget "+y.className,y.displayText.forEach(function(R,L){$.appendChild(h.createTextNode(R)),L<y.displayText.length-1&&$.appendChild(h.createElement("br"))}),$.appendChild(h.createElement("div"));var M=function(R,L,T){if(L===0&&(T==="esc"||T==="return"))return E.destroy(),{command:"null"}};E.destroy=function(){r.$mouseHandler.isMousePressed||(r.keyBinding.removeKeyboardHandler(M),a.widgetManager.removeLineWidget(E),r.off("changeSelection",E.destroy),r.off("changeSession",E.destroy),r.off("mouseup",E.destroy),r.off("change",E.destroy))},r.keyBinding.addKeyboardHandler(M),r.on("changeSelection",E.destroy),r.on("changeSession",E.destroy),r.on("mouseup",E.destroy),r.on("change",E.destroy),r.session.widgetManager.addLineWidget(E),E.el.onmousedown=r.focus.bind(r),r.renderer.scrollCursorIntoView(null,.5,{bottom:E.el.offsetHeight})},h.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,f){t("./loader_build")(n);var d=t("./lib/dom"),g=t("./range").Range,m=t("./editor").Editor,c=t("./edit_session").EditSession,p=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 p),i},n.Range=g,n.Editor=m,n.EditSession=c,n.UndoManager=p,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 f in t)t.hasOwnProperty(f)&&(n.ace[f]=t[f]);n.ace.default=n.ace,l&&(l.exports=n.ace)})})()})(Qo)),Qo.exports}var sa=hv();const dv=kt(sa),fv="/formeo/assets/js/mode-json.min.js",pv="/formeo/assets/js/theme-github_light_default.min.js";var Jo,yu;function gv(){if(yu)return Jo;yu=1;function l(e,t,n,f){var d=-1,g=e==null?0:e.length;for(f&&g&&(n=e[++d]);++d<g;)n=t(n,e[d],d,e);return n}return Jo=l,Jo}var es,wu;function mv(){if(wu)return es;wu=1;function l(e){return function(t){return e?.[t]}}return es=l,es}var ts,bu;function vv(){if(bu)return ts;bu=1;var l=mv(),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 yv(){if(Cu)return ns;Cu=1;var l=vv(),e=Un(),t=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,n="\\u0300-\\u036f",f="\\ufe20-\\ufe2f",d="\\u20d0-\\u20ff",g=n+f+d,m="["+g+"]",c=RegExp(m,"g");function p(r){return r=e(r),r&&r.replace(t,l).replace(c,"")}return ns=p,ns}var is,Su;function wv(){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 bv(){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 Cv(){if($u)return os;$u=1;var l="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",f=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",p="\\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+p+r,i="['’]",u="["+a+"]",h="["+f+"]",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 Sv(){if(Mu)return ss;Mu=1;var l=wv(),e=bv(),t=Un(),n=Cv();function f(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=f,ss}var as,xu;function Av(){if(xu)return as;xu=1;var l=gv(),e=yv(),t=Sv(),n="['’]",f=RegExp(n,"g");function d(g){return function(m){return l(t(e(m).replace(f,"")),g,"")}}return as=d,as}var ls,Eu;function $v(){if(Eu)return ls;Eu=1;function l(e,t,n){var f=-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);++f<d;)g[f]=e[f+t];return g}return ls=l,ls}var cs,_u;function Mv(){if(_u)return cs;_u=1;var l=$v();function e(t,n,f){var d=t.length;return f=f===void 0?d:f,!n&&f>=d?t:l(t,n,f)}return cs=e,cs}var us,Tu;function od(){if(Tu)return us;Tu=1;var l="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",f=e+t+n,d="\\ufe0e\\ufe0f",g="\\u200d",m=RegExp("["+g+l+f+d+"]");function c(p){return m.test(p)}return us=c,us}var hs,Lu;function xv(){if(Lu)return hs;Lu=1;function l(e){return e.split("")}return hs=l,hs}var ds,Ru;function Ev(){if(Ru)return ds;Ru=1;var l="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",f=e+t+n,d="\\ufe0e\\ufe0f",g="["+l+"]",m="["+f+"]",c="\\ud83c[\\udffb-\\udfff]",p="(?:"+m+"|"+c+")",r="[^"+l+"]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",a="\\u200d",i=p+"?",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=xv(),e=od(),t=Ev();function n(f){return e(f)?t(f):l(f)}return fs=n,fs}var ps,Du;function Tv(){if(Du)return ps;Du=1;var l=Mv(),e=od(),t=_v(),n=Un();function f(d){return function(g){g=n(g);var m=e(g)?t(g):void 0,c=m?m[0]:g.charAt(0),p=m?l(m,1).join(""):g.slice(1);return c[d]()+p}}return ps=f,ps}var gs,Ou;function Lv(){if(Ou)return gs;Ou=1;var l=Tv(),e=l("toUpperCase");return gs=e,gs}var ms,Iu;function Rv(){if(Iu)return ms;Iu=1;var l=Av(),e=Lv(),t=l(function(n,f,d){return n+(d?" ":"")+e(f)});return ms=t,ms}var kv=Rv();const Dv=kt(kv);sa.config.setModuleUrl("ace/mode/json",fv);sa.config.setModuleUrl("ace/theme/github_light_default",pv);const tt=dv.edit("formData-editor");tt.session.setOption("useWorker",!1);tt.setOptions({theme:"ace/theme/github_light_default",mode:"ace/mode/json"});const Ov=document.getElementById("submit-formData"),Iv=document.getElementById("formData-popover"),Nv=document.getElementById("editor-action-buttons"),Fv=(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),console.log("User Form Data:",e.userFormData)},resetEditor:()=>{window.sessionStorage.removeItem("formeo-formData"),window.location.reload()},editData:()=>{tt.setValue(JSON.stringify(l.formData,null,2),1)}}),Pv={editData:{popovertarget:"formData-popover"}},Hv=l=>{const e=Pv[l]||{};return{id:l,type:"button",...e}},Wv=(l,e)=>{Ov.addEventListener("click",()=>{l.formData=tt.session.getValue(),Iv.hidePopover()});const t=Fv(l,e);return Object.entries(t).map(([f,d])=>{const g=Hv(f),m=Object.assign(document.createElement("button"),g);for(const[p,r]of Object.entries(g))m.setAttribute(p,r);const c=document.createTextNode(Dv(f));return m.appendChild(c),m.addEventListener("click",d,!1),Nv.appendChild(m),m})};document.getElementById("format-json").addEventListener("click",zv);document.getElementById("collapse-json").addEventListener("click",Bv);document.getElementById("copy-json").addEventListener("click",jv);function zv(){const l=tt.session.getValue(),e=JSON.parse(l);tt.setValue(JSON.stringify(e,null,2),1)}function Bv(){const l=tt.session.getValue(),e=JSON.parse(l);tt.setValue(JSON.stringify(e,null,0),1)}async function jv({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 Vv=l=>{const e=document.getElementById("control-filter"),t=document.getElementById("locale"),n=window.sessionStorage.getItem("formeo-locale"),f=({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",f),t.value=n||"en-US",t.addEventListener("change",d,!1)};async function Uv(l){l.innerHTML=`
|
|
2133
|
+
`,"error_marker.css",!1)}),ace.define("ace/ace",["require","exports","module","ace/lib/dom","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config","ace/loader_build"],function(t,n,p){t("./loader_build")(n);var h=t("./lib/dom"),g=t("./range").Range,m=t("./editor").Editor,c=t("./edit_session").EditSession,d=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(a,s){if(typeof a=="string"){var i=a;if(a=document.getElementById(i),!a)throw new Error("ace.edit can't find div #"+i)}if(a&&a.env&&a.env.editor instanceof m)return a.env.editor;var u="";if(a&&/input|textarea/i.test(a.tagName)){var f=a;u=f.value,a=h.createElement("pre"),f.parentNode.replaceChild(a,f)}else a&&(u=a.textContent,a.innerHTML="");var y=n.createEditSession(u),b=new m(new r(a),y,s),E={document:y,editor:b,onResize:b.resize.bind(b,null)};return f&&(E.textarea=f),b.on("destroy",function(){E.editor.container.env=null}),b.container.env=b.env=E,b},n.createEditSession=function(a,s){var i=new c(a,s);return i.setUndoManager(new d),i},n.Range=g,n.Editor=m,n.EditSession=c,n.UndoManager=d,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)})})()})(ns)),ns.exports}var fa=Cv();const Sv=Nt(fa),Av="/formeo/assets/js/mode-json.min.js",$v="/formeo/assets/js/theme-github_light_default.min.js";var is,Mu;function xv(){if(Mu)return is;Mu=1;function l(e,t,n,p){var h=-1,g=e==null?0:e.length;for(p&&g&&(n=e[++h]);++h<g;)n=t(n,e[h],h,e);return n}return is=l,is}var rs,Tu;function Ev(){if(Tu)return rs;Tu=1;function l(e){return function(t){return e?.[t]}}return rs=l,rs}var os,_u;function Mv(){if(_u)return os;_u=1;var l=Ev(),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 os=t,os}var ss,Lu;function Tv(){if(Lu)return ss;Lu=1;var l=Mv(),e=Yn(),t=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,n="\\u0300-\\u036f",p="\\ufe20-\\ufe2f",h="\\u20d0-\\u20ff",g=n+p+h,m="["+g+"]",c=RegExp(m,"g");function d(r){return r=e(r),r&&r.replace(t,l).replace(c,"")}return ss=d,ss}var as,Ru;function _v(){if(Ru)return as;Ru=1;var l=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function e(t){return t.match(l)||[]}return as=e,as}var ls,ku;function Lv(){if(ku)return ls;ku=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 ls=e,ls}var cs,Du;function Rv(){if(Du)return cs;Du=1;var l="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",p=e+t+n,h="\\u2700-\\u27bf",g="a-z\\xdf-\\xf6\\xf8-\\xff",m="\\xac\\xb1\\xd7\\xf7",c="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",d="\\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",a="\\ufe0e\\ufe0f",s=m+c+d+r,i="['’]",u="["+s+"]",f="["+p+"]",y="\\d+",b="["+h+"]",E="["+g+"]",$="[^"+l+s+y+h+g+o+"]",A="\\ud83c[\\udffb-\\udfff]",S="(?:"+f+"|"+A+")",M="[^"+l+"]",R="(?:\\ud83c[\\udde6-\\uddff]){2}",L="[\\ud800-\\udbff][\\udc00-\\udfff]",T="["+o+"]",D="\\u200d",w="(?:"+E+"|"+$+")",v="(?:"+T+"|"+$+")",C="(?:"+i+"(?:d|ll|m|re|s|t|ve))?",x="(?:"+i+"(?:D|LL|M|RE|S|T|VE))?",_=S+"?",k="["+a+"]?",O="(?:"+D+"(?:"+[M,R,L].join("|")+")"+k+_+")*",I="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",N="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",P=k+_+O,B="(?:"+[b,R,L].join("|")+")"+P,F=RegExp([T+"?"+E+"+"+C+"(?="+[u,T,"$"].join("|")+")",v+"+"+x+"(?="+[u,T+w,"$"].join("|")+")",T+"?"+w+"+"+C,T+"+"+x,N,I,y,B].join("|"),"g");function H(z){return z.match(F)||[]}return cs=H,cs}var us,Ou;function kv(){if(Ou)return us;Ou=1;var l=_v(),e=Lv(),t=Yn(),n=Rv();function p(h,g,m){return h=t(h),g=m?void 0:g,g===void 0?e(h)?n(h):l(h):h.match(g)||[]}return us=p,us}var hs,Iu;function Dv(){if(Iu)return hs;Iu=1;var l=xv(),e=Tv(),t=kv(),n="['’]",p=RegExp(n,"g");function h(g){return function(m){return l(t(e(m).replace(p,"")),g,"")}}return hs=h,hs}var ds,Nu;function Ov(){if(Nu)return ds;Nu=1;function l(e,t,n){var p=-1,h=e.length;t<0&&(t=-t>h?0:h+t),n=n>h?h:n,n<0&&(n+=h),h=t>n?0:n-t>>>0,t>>>=0;for(var g=Array(h);++p<h;)g[p]=e[p+t];return g}return ds=l,ds}var fs,Fu;function Iv(){if(Fu)return fs;Fu=1;var l=Ov();function e(t,n,p){var h=t.length;return p=p===void 0?h:p,!n&&p>=h?t:l(t,n,p)}return fs=e,fs}var ps,Pu;function hd(){if(Pu)return ps;Pu=1;var l="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",p=e+t+n,h="\\ufe0e\\ufe0f",g="\\u200d",m=RegExp("["+g+l+p+h+"]");function c(d){return m.test(d)}return ps=c,ps}var gs,Hu;function Nv(){if(Hu)return gs;Hu=1;function l(e){return e.split("")}return gs=l,gs}var ms,Wu;function Fv(){if(Wu)return ms;Wu=1;var l="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",p=e+t+n,h="\\ufe0e\\ufe0f",g="["+l+"]",m="["+p+"]",c="\\ud83c[\\udffb-\\udfff]",d="(?:"+m+"|"+c+")",r="[^"+l+"]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",s="\\u200d",i=d+"?",u="["+h+"]?",f="(?:"+s+"(?:"+[r,o,a].join("|")+")"+u+i+")*",y=u+i+f,b="(?:"+[r+m+"?",m,o,a,g].join("|")+")",E=RegExp(c+"(?="+c+")|"+b+y,"g");function $(A){return A.match(E)||[]}return ms=$,ms}var vs,zu;function Pv(){if(zu)return vs;zu=1;var l=Nv(),e=hd(),t=Fv();function n(p){return e(p)?t(p):l(p)}return vs=n,vs}var ys,Bu;function Hv(){if(Bu)return ys;Bu=1;var l=Iv(),e=hd(),t=Pv(),n=Yn();function p(h){return function(g){g=n(g);var m=e(g)?t(g):void 0,c=m?m[0]:g.charAt(0),d=m?l(m,1).join(""):g.slice(1);return c[h]()+d}}return ys=p,ys}var bs,ju;function Wv(){if(ju)return bs;ju=1;var l=Hv(),e=l("toUpperCase");return bs=e,bs}var ws,Vu;function zv(){if(Vu)return ws;Vu=1;var l=Dv(),e=Wv(),t=l(function(n,p,h){return n+(h?" ":"")+e(p)});return ws=t,ws}var Bv=zv();const jv=Nt(Bv);fa.config.setModuleUrl("ace/mode/json",Av);fa.config.setModuleUrl("ace/theme/github_light_default",$v);const rt=Sv.edit("formData-editor");rt.session.setOption("useWorker",!1);rt.setOptions({theme:"ace/theme/github_light_default",mode:"ace/mode/json"});const Vv=document.getElementById("submit-formData"),Uv=document.getElementById("formData-popover"),Gv=document.getElementById("editor-action-buttons"),qv=(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),console.log("User Form Data:",e.userFormData)},resetEditor:()=>{window.sessionStorage.removeItem("formeo-formData"),window.location.reload()},editData:()=>{rt.setValue(JSON.stringify(l.formData,null,2),1)}}),Kv={editData:{popovertarget:"formData-popover"}},Yv=l=>{const e=Kv[l]||{};return{id:l,type:"button",...e}},Zv=(l,e)=>{Vv.addEventListener("click",()=>{l.formData=rt.session.getValue(),Uv.hidePopover()});const t=qv(l,e);return Object.entries(t).map(([p,h])=>{const g=Yv(p),m=Object.assign(document.createElement("button"),g);for(const[d,r]of Object.entries(g))m.setAttribute(d,r);const c=document.createTextNode(jv(p));return m.appendChild(c),m.addEventListener("click",h,!1),Gv.appendChild(m),m})};document.getElementById("format-json").addEventListener("click",Xv);document.getElementById("collapse-json").addEventListener("click",Qv);document.getElementById("copy-json").addEventListener("click",Jv);function Xv(){const l=rt.session.getValue(),e=JSON.parse(l);rt.setValue(JSON.stringify(e,null,2),1)}function Qv(){const l=rt.session.getValue(),e=JSON.parse(l);rt.setValue(JSON.stringify(e,null,0),1)}async function Jv({target:l}){const e=l.textContent;l.textContent="Copied!";const t=setTimeout(()=>{l.textContent=e,clearTimeout(t)},3e3);try{await navigator.clipboard.writeText(rt.session.getValue()),console.log("Text copied to clipboard")}catch(n){console.error("Failed to copy: ",n)}}const ey=l=>{const e=document.getElementById("control-filter"),t=document.getElementById("locale"),n=globalThis.sessionStorage.getItem("formeo-locale"),p=({target:{value:g}})=>l.controls.actions.filter(g),h=({target:{value:g}})=>{globalThis.sessionStorage.setItem("formeo-locale",g),l.i18n.setLang(g)};e.addEventListener("input",p),t.value=n||"en-US",t.addEventListener("change",h,!1)};async function ty(l){l.innerHTML=`
|
|
2134
2134
|
<form class="build-form"></form>
|
|
2135
2135
|
<div class="render-form"></div>
|
|
2136
|
-
`;const e=new
|
|
2136
|
+
`;const e=new ua(an),t=new ha(da);return Zv(e,t),ey(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 ny{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 ty(this.frameworkContainer);break;case"angular":this.currentDemo=await ov(this.frameworkContainer);break;case"react":this.currentDemo=await fv(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 ny});export{Dm as C,Ue as a,X as m,Je as t};
|