diff --git a/config.codekit3 b/config.codekit3 index 6319868..ad93324 100644 --- a/config.codekit3 +++ b/config.codekit3 @@ -1189,39 +1189,74 @@ "oAP" : "\/src\/Vizy.php", "oF" : 0 }, - "\/src\/web\/assets\/field\/dist\/assets\/vizy-0baa0ce9.js" : { + "\/src\/web\/assets\/field\/dist\/assets\/vizy-1d31d33d.js" : { "bF" : 0, "ft" : 64, "ma" : 1, "mi" : 1, "oA" : 0, - "oAP" : "\/src\/web\/assets\/field\/dist\/js\/vizy-0baa0ce9.js", + "oAP" : "\/src\/web\/assets\/field\/dist\/js\/vizy-1d31d33d.js", "oF" : 0, "sC" : 0, "tS" : 0 }, - "\/src\/web\/assets\/field\/dist\/assets\/vizy-0baa0ce9.js.gz" : { + "\/src\/web\/assets\/field\/dist\/assets\/vizy-1d31d33d.js.gz" : { "cB" : 0, "ft" : 8192, "hM" : 0, "oA" : 0, - "oAP" : "\/src\/web\/assets\/field\/dist\/assets\/vizy-0baa0ce9.js.gz", + "oAP" : "\/src\/web\/assets\/field\/dist\/assets\/vizy-1d31d33d.js.gz", "oF" : 0 }, - "\/src\/web\/assets\/field\/dist\/assets\/vizy-0baa0ce9.js.map" : { + "\/src\/web\/assets\/field\/dist\/assets\/vizy-1d31d33d.js.map" : { "cB" : 0, "ft" : 8192, "hM" : 0, "oA" : 0, - "oAP" : "\/src\/web\/assets\/field\/dist\/assets\/vizy-0baa0ce9.js.map", + "oAP" : "\/src\/web\/assets\/field\/dist\/assets\/vizy-1d31d33d.js.map", "oF" : 0 }, - "\/src\/web\/assets\/field\/dist\/assets\/vizy-0baa0ce9.js.map.gz" : { + "\/src\/web\/assets\/field\/dist\/assets\/vizy-1d31d33d.js.map.gz" : { "cB" : 0, "ft" : 8192, "hM" : 0, "oA" : 0, - "oAP" : "\/src\/web\/assets\/field\/dist\/assets\/vizy-0baa0ce9.js.map.gz", + "oAP" : "\/src\/web\/assets\/field\/dist\/assets\/vizy-1d31d33d.js.map.gz", + "oF" : 0 + }, + "\/src\/web\/assets\/field\/dist\/assets\/vizy-91fcee7d.js" : { + "bF" : 0, + "ft" : 64, + "ma" : 1, + "mi" : 1, + "oA" : 0, + "oAP" : "\/src\/web\/assets\/field\/dist\/js\/vizy-91fcee7d.js", + "oF" : 0, + "sC" : 0, + "tS" : 0 + }, + "\/src\/web\/assets\/field\/dist\/assets\/vizy-91fcee7d.js.gz" : { + "cB" : 0, + "ft" : 8192, + "hM" : 0, + "oA" : 0, + "oAP" : "\/src\/web\/assets\/field\/dist\/assets\/vizy-91fcee7d.js.gz", + "oF" : 0 + }, + "\/src\/web\/assets\/field\/dist\/assets\/vizy-91fcee7d.js.map" : { + "cB" : 0, + "ft" : 8192, + "hM" : 0, + "oA" : 0, + "oAP" : "\/src\/web\/assets\/field\/dist\/assets\/vizy-91fcee7d.js.map", + "oF" : 0 + }, + "\/src\/web\/assets\/field\/dist\/assets\/vizy-91fcee7d.js.map.gz" : { + "cB" : 0, + "ft" : 8192, + "hM" : 0, + "oA" : 0, + "oAP" : "\/src\/web\/assets\/field\/dist\/assets\/vizy-91fcee7d.js.map.gz", "oF" : 0 }, "\/src\/web\/assets\/field\/dist\/assets\/vizy-e02a0e63.css" : { @@ -1543,6 +1578,14 @@ "oAP" : "\/src\/web\/assets\/field\/src\/js\/components\/input\/VizyBlockFields.vue", "oF" : 0 }, + "\/src\/web\/assets\/field\/src\/js\/components\/input\/VizyUserTemplate.vue" : { + "cB" : 0, + "ft" : 8192, + "hM" : 0, + "oA" : 0, + "oAP" : "\/src\/web\/assets\/field\/src\/js\/components\/input\/VizyUserTemplate.vue", + "oF" : 0 + }, "\/src\/web\/assets\/field\/src\/js\/components\/settings\/AutoSuggest.vue" : { "cB" : 0, "ft" : 8192, diff --git a/src/web/assets/field/dist/assets/vizy-1d31d33d.js b/src/web/assets/field/dist/assets/vizy-1d31d33d.js deleted file mode 100644 index 3a0fde2..0000000 --- a/src/web/assets/field/dist/assets/vizy-1d31d33d.js +++ /dev/null @@ -1,1313 +0,0 @@ -<<<<<<<< HEAD:src/web/assets/field/dist/assets/vizy-1d31d33d.js -var FP=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Pue=FP((ri,ii)=>{/** -* @vue/shared v3.4.15 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function ai(t,e){const n=new Set(t.split(","));return e?r=>n.has(r.toLowerCase()):r=>n.has(r)}const Ft={},bu=[],An=()=>{},vp=()=>!1,Cl=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),b1=t=>t.startsWith("onUpdate:"),Rt=Object.assign,_1=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},VP=Object.prototype.hasOwnProperty,Dt=(t,e)=>VP.call(t,e),We=Array.isArray,_u=t=>oc(t)==="[object Map]",Tl=t=>oc(t)==="[object Set]",Gx=t=>oc(t)==="[object Date]",jP=t=>oc(t)==="[object RegExp]",pt=t=>typeof t=="function",xt=t=>typeof t=="string",Vi=t=>typeof t=="symbol",qt=t=>t!==null&&typeof t=="object",w1=t=>(qt(t)||pt(t))&&pt(t.then)&&pt(t.catch),CA=Object.prototype.toString,oc=t=>CA.call(t),WP=t=>oc(t).slice(8,-1),TA=t=>oc(t)==="[object Object]",k1=t=>xt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Ya=ai(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),UP=ai("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),rg=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},qP=/-(\w)/g,bn=rg(t=>t.replace(qP,(e,n)=>n?n.toUpperCase():"")),KP=/\B([A-Z])/g,ni=rg(t=>t.replace(KP,"-$1").toLowerCase()),El=rg(t=>t.charAt(0).toUpperCase()+t.slice(1)),wu=rg(t=>t?`on${El(t)}`:""),ji=(t,e)=>!Object.is(t,e),ku=(t,e)=>{for(let n=0;n{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n})},zf=t=>{const e=parseFloat(t);return isNaN(e)?t:e},Bp=t=>{const e=xt(t)?Number(t):NaN;return isNaN(e)?t:e};let Yx;const x1=()=>Yx||(Yx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),GP="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error",YP=ai(GP);function oi(t){if(We(t)){const e={};for(let n=0;n{if(n){const r=n.split(XP);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function gt(t){let e="";if(xt(t))e=t;else if(We(t))for(let n=0;nqo(n,e))}const Ne=t=>xt(t)?t:t==null?"":We(t)||qt(t)&&(t.toString===CA||!pt(t.toString))?JSON.stringify(t,MA,2):String(t),MA=(t,e)=>e&&e.__v_isRef?MA(t,e.value):_u(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[r,i],o)=>(n[s0(r,o)+" =>"]=i,n),{})}:Tl(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>s0(n))}:Vi(e)?s0(e):qt(e)&&!We(e)&&!TA(e)?String(e):e,s0=(t,e="")=>{var n;return Vi(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};/** -* @vue/reactivity v3.4.15 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let Zr;class S1{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=Zr,!e&&Zr&&(this.index=(Zr.scopes||(Zr.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const n=Zr;try{return Zr=this,e()}finally{Zr=n}}}on(){Zr=this}off(){Zr=this.parent}stop(e){if(this._active){let n,r;for(n=0,r=this.effects.length;n=2))break}this._dirtyLevel<2&&(this._dirtyLevel=0),ca()}return this._dirtyLevel>=2}set dirty(e){this._dirtyLevel=e?2:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=Gs,n=Ja;try{return Gs=!0,Ja=this,this._runnings++,Jx(this),this.fn()}finally{Xx(this),this._runnings--,Ja=n,Gs=e}}stop(){var e;this.active&&(Jx(this),Xx(this),(e=this.onStop)==null||e.call(this),this.active=!1)}}function dD(t){return t.value}function Jx(t){t._trackId++,t._depsLength=0}function Xx(t){if(t.deps&&t.deps.length>t._depsLength){for(let e=t._depsLength;e{n.dirty&&n.run()});e&&(Rt(n,e),e.scope&&LA(n,e.scope)),(!e||!e.lazy)&&n.run();const r=n.run.bind(n);return r.effect=n,r}function pD(t){t.effect.stop()}let Gs=!0,Ty=0;const PA=[];function ua(){PA.push(Gs),Gs=!1}function ca(){const t=PA.pop();Gs=t===void 0?!0:t}function C1(){Ty++}function T1(){for(Ty--;!Ty&&Ey.length;)Ey.shift()()}function DA(t,e,n){if(e.get(t)!==t._trackId){e.set(t,t._trackId);const r=t.deps[t._depsLength];r!==e?(r&&IA(r,t),t.deps[t._depsLength++]=e):t._depsLength++}}const Ey=[];function RA(t,e,n){C1();for(const r of t.keys())if(r._dirtyLevel{const n=new Map;return n.cleanup=t,n.computed=e,n},$p=new WeakMap,Xa=Symbol(""),Ay=Symbol("");function Wr(t,e,n){if(Gs&&Ja){let r=$p.get(t);r||$p.set(t,r=new Map);let i=r.get(n);i||r.set(n,i=BA(()=>r.delete(n))),DA(Ja,i)}}function Vo(t,e,n,r,i,o){const s=$p.get(t);if(!s)return;let l=[];if(e==="clear")l=[...s.values()];else if(n==="length"&&We(t)){const u=Number(r);s.forEach((f,d)=>{(d==="length"||!Vi(d)&&d>=u)&&l.push(f)})}else switch(n!==void 0&&l.push(s.get(n)),e){case"add":We(t)?k1(n)&&l.push(s.get("length")):(l.push(s.get(Xa)),_u(t)&&l.push(s.get(Ay)));break;case"delete":We(t)||(l.push(s.get(Xa)),_u(t)&&l.push(s.get(Ay)));break;case"set":_u(t)&&l.push(s.get(Xa));break}C1();for(const u of l)u&&RA(u,2);T1()}function mD(t,e){var n;return(n=$p.get(t))==null?void 0:n.get(e)}const gD=ai("__proto__,__v_isRef,__isVue"),$A=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Vi)),Zx=vD();function vD(){const t={};return["includes","indexOf","lastIndexOf"].forEach(e=>{t[e]=function(...n){const r=Mt(this);for(let o=0,s=this.length;o{t[e]=function(...n){ua(),C1();const r=Mt(this)[e].apply(this,n);return T1(),ca(),r}}),t}function yD(t){const e=Mt(this);return Wr(e,"has",t),e.hasOwnProperty(t)}class HA{constructor(e=!1,n=!1){this._isReadonly=e,this._shallow=n}get(e,n,r){const i=this._isReadonly,o=this._shallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(i?o?qA:UA:o?WA:jA).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const s=We(e);if(!i){if(s&&Dt(Zx,n))return Reflect.get(Zx,n,r);if(n==="hasOwnProperty")return yD}const l=Reflect.get(e,n,r);return(Vi(n)?$A.has(n):gD(n))||(i||Wr(e,"get",n),o)?l:qn(l)?s&&k1(n)?l:l.value:qt(l)?i?A1(l):Al(l):l}}class FA extends HA{constructor(e=!1){super(!1,e)}set(e,n,r,i){let o=e[n];if(!this._shallow){const u=ll(o);if(!Bf(r)&&!ll(r)&&(o=Mt(o),r=Mt(r)),!We(e)&&qn(o)&&!qn(r))return u?!1:(o.value=r,!0)}const s=We(e)&&k1(n)?Number(n)t,og=t=>Reflect.getPrototypeOf(t);function Sh(t,e,n=!1,r=!1){t=t.__v_raw;const i=Mt(t),o=Mt(e);n||(ji(e,o)&&Wr(i,"get",e),Wr(i,"get",o));const{has:s}=og(i),l=r?E1:n?M1:$f;if(s.call(i,e))return l(t.get(e));if(s.call(i,o))return l(t.get(o));t!==i&&t.get(e)}function Ch(t,e=!1){const n=this.__v_raw,r=Mt(n),i=Mt(t);return e||(ji(t,i)&&Wr(r,"has",t),Wr(r,"has",i)),t===i?n.has(t):n.has(t)||n.has(i)}function Th(t,e=!1){return t=t.__v_raw,!e&&Wr(Mt(t),"iterate",Xa),Reflect.get(t,"size",t)}function Qx(t){t=Mt(t);const e=Mt(this);return og(e).has.call(e,t)||(e.add(t),Vo(e,"add",t,t)),this}function e2(t,e){e=Mt(e);const n=Mt(this),{has:r,get:i}=og(n);let o=r.call(n,t);o||(t=Mt(t),o=r.call(n,t));const s=i.call(n,t);return n.set(t,e),o?ji(e,s)&&Vo(n,"set",t,e):Vo(n,"add",t,e),this}function t2(t){const e=Mt(this),{has:n,get:r}=og(e);let i=n.call(e,t);i||(t=Mt(t),i=n.call(e,t)),r&&r.call(e,t);const o=e.delete(t);return i&&Vo(e,"delete",t,void 0),o}function n2(){const t=Mt(this),e=t.size!==0,n=t.clear();return e&&Vo(t,"clear",void 0,void 0),n}function Eh(t,e){return function(r,i){const o=this,s=o.__v_raw,l=Mt(s),u=e?E1:t?M1:$f;return!t&&Wr(l,"iterate",Xa),s.forEach((f,d)=>r.call(i,u(f),u(d),o))}}function Ah(t,e,n){return function(...r){const i=this.__v_raw,o=Mt(i),s=_u(o),l=t==="entries"||t===Symbol.iterator&&s,u=t==="keys"&&s,f=i[t](...r),d=n?E1:e?M1:$f;return!e&&Wr(o,"iterate",u?Ay:Xa),{next(){const{value:m,done:v}=f.next();return v?{value:m,done:v}:{value:l?[d(m[0]),d(m[1])]:d(m),done:v}},[Symbol.iterator](){return this}}}}function ks(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function xD(){const t={get(o){return Sh(this,o)},get size(){return Th(this)},has:Ch,add:Qx,set:e2,delete:t2,clear:n2,forEach:Eh(!1,!1)},e={get(o){return Sh(this,o,!1,!0)},get size(){return Th(this)},has:Ch,add:Qx,set:e2,delete:t2,clear:n2,forEach:Eh(!1,!0)},n={get(o){return Sh(this,o,!0)},get size(){return Th(this,!0)},has(o){return Ch.call(this,o,!0)},add:ks("add"),set:ks("set"),delete:ks("delete"),clear:ks("clear"),forEach:Eh(!0,!1)},r={get(o){return Sh(this,o,!0,!0)},get size(){return Th(this,!0)},has(o){return Ch.call(this,o,!0)},add:ks("add"),set:ks("set"),delete:ks("delete"),clear:ks("clear"),forEach:Eh(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(o=>{t[o]=Ah(o,!1,!1),n[o]=Ah(o,!0,!1),e[o]=Ah(o,!1,!0),r[o]=Ah(o,!0,!0)}),[t,n,e,r]}const[SD,CD,TD,ED]=xD();function sg(t,e){const n=e?t?ED:TD:t?CD:SD;return(r,i,o)=>i==="__v_isReactive"?!t:i==="__v_isReadonly"?t:i==="__v_raw"?r:Reflect.get(Dt(n,i)&&i in r?n:r,i,o)}const AD={get:sg(!1,!1)},OD={get:sg(!1,!0)},MD={get:sg(!0,!1)},LD={get:sg(!0,!0)},jA=new WeakMap,WA=new WeakMap,UA=new WeakMap,qA=new WeakMap;function ND(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ID(t){return t.__v_skip||!Object.isExtensible(t)?0:ND(WP(t))}function Al(t){return ll(t)?t:ag(t,!1,bD,AD,jA)}function Hp(t){return ag(t,!1,wD,OD,WA)}function A1(t){return ag(t,!0,_D,MD,UA)}function PD(t){return ag(t,!0,kD,LD,qA)}function ag(t,e,n,r,i){if(!qt(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const o=i.get(t);if(o)return o;const s=ID(t);if(s===0)return t;const l=new Proxy(t,s===2?r:n);return i.set(t,l),l}function Za(t){return ll(t)?Za(t.__v_raw):!!(t&&t.__v_isReactive)}function ll(t){return!!(t&&t.__v_isReadonly)}function Bf(t){return!!(t&&t.__v_isShallow)}function O1(t){return Za(t)||ll(t)}function Mt(t){const e=t&&t.__v_raw;return e?Mt(e):t}function fa(t){return zp(t,"__v_skip",!0),t}const $f=t=>qt(t)?Al(t):t,M1=t=>qt(t)?A1(t):t;class KA{constructor(e,n,r,i){this._setter=n,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new Pu(()=>e(this._value),()=>xu(this,1),()=>this.dep&&zA(this.dep)),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=r}get value(){const e=Mt(this);return(!e._cacheable||e.effect.dirty)&&ji(e._value,e._value=e.effect.run())&&xu(e,2),L1(e),e.effect._dirtyLevel>=1&&xu(e,1),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function DD(t,e,n=!1){let r,i;const o=pt(t);return o?(r=t,i=An):(r=t.get,i=t.set),new KA(r,i,o||!i,n)}function L1(t){Gs&&Ja&&(t=Mt(t),DA(Ja,t.dep||(t.dep=BA(()=>t.dep=void 0,t instanceof KA?t:void 0))))}function xu(t,e=2,n){t=Mt(t);const r=t.dep;r&&RA(r,e)}function qn(t){return!!(t&&t.__v_isRef===!0)}function Ot(t){return YA(t,!1)}function GA(t){return YA(t,!0)}function YA(t,e){return qn(t)?t:new RD(t,e)}class RD{constructor(e,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?e:Mt(e),this._value=n?e:$f(e)}get value(){return L1(this),this._value}set value(e){const n=this.__v_isShallow||Bf(e)||ll(e);e=n?e:Mt(e),ji(e,this._rawValue)&&(this._rawValue=e,this._value=n?e:$f(e),xu(this,2))}}function zD(t){xu(t,2)}function fr(t){return qn(t)?t.value:t}function BD(t){return pt(t)?t():fr(t)}const $D={get:(t,e,n)=>fr(Reflect.get(t,e,n)),set:(t,e,n,r)=>{const i=t[e];return qn(i)&&!qn(n)?(i.value=n,!0):Reflect.set(t,e,n,r)}};function N1(t){return Za(t)?t:new Proxy(t,$D)}class HD{constructor(e){this.dep=void 0,this.__v_isRef=!0;const{get:n,set:r}=e(()=>L1(this),()=>xu(this));this._get=n,this._set=r}get value(){return this._get()}set value(e){this._set(e)}}function I1(t){return new HD(t)}function FD(t){const e=We(t)?new Array(t.length):{};for(const n in t)e[n]=JA(t,n);return e}class VD{constructor(e,n,r){this._object=e,this._key=n,this._defaultValue=r,this.__v_isRef=!0}get value(){const e=this._object[this._key];return e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return mD(Mt(this._object),this._key)}}class jD{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function WD(t,e,n){return qn(t)?t:pt(t)?new jD(t):qt(t)&&arguments.length>1?JA(t,e,n):Ot(t)}function JA(t,e,n){const r=t[e];return qn(r)?r:new VD(t,e,n)}const UD={GET:"get",HAS:"has",ITERATE:"iterate"},qD={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"};/** -* @vue/runtime-core v3.4.15 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/const sf=[];function Ea(t,...e){ua();const n=sf.length?sf[sf.length-1].component:null,r=n&&n.appContext.config.warnHandler,i=KD();if(r)mo(r,n,11,[t+e.join(""),n&&n.proxy,i.map(({vnode:o})=>`at <${G3(n,o.type)}>`).join(` -`),i]);else{const o=[`[Vue warn]: ${t}`,...e];i.length&&o.push(` -`,...GD(i)),console.warn(...o)}ca()}function KD(){let t=sf[sf.length-1];if(!t)return[];const e=[];for(;t;){const n=e[0];n&&n.vnode===t?n.recurseCount++:e.push({vnode:t,recurseCount:0});const r=t.component&&t.component.parent;t=r&&r.vnode}return e}function GD(t){const e=[];return t.forEach((n,r)=>{e.push(...r===0?[]:[` -`],...YD(n))}),e}function YD({vnode:t,recurseCount:e}){const n=e>0?`... (${e} recursive calls)`:"",r=t.component?t.component.parent==null:!1,i=` at <${G3(t.component,t.type,r)}`,o=">"+n;return t.props?[i,...JD(t.props),o]:[i+o]}function JD(t){const e=[],n=Object.keys(t);return n.slice(0,3).forEach(r=>{e.push(...XA(r,t[r]))}),n.length>3&&e.push(" ..."),e}function XA(t,e,n){return xt(e)?(e=JSON.stringify(e),n?e:[`${t}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?n?e:[`${t}=${e}`]:qn(e)?(e=XA(t,Mt(e.value),!0),n?e:[`${t}=Ref<`,e,">"]):pt(e)?[`${t}=fn${e.name?`<${e.name}>`:""}`]:(e=Mt(e),n?e:[`${t}=`,e])}function XD(t,e){}const ZD={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",WATCH_GETTER:2,2:"WATCH_GETTER",WATCH_CALLBACK:3,3:"WATCH_CALLBACK",WATCH_CLEANUP:4,4:"WATCH_CLEANUP",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER"},QD={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",[0]:"setup function",[1]:"render function",[2]:"watcher getter",[3]:"watcher callback",[4]:"watcher cleanup function",[5]:"native event handler",[6]:"component event handler",[7]:"vnode hook",[8]:"directive hook",[9]:"transition hook",[10]:"app errorHandler",[11]:"app warnHandler",[12]:"ref function",[13]:"async component loader",[14]:"scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."};function mo(t,e,n,r){let i;try{i=r?t(...r):t()}catch(o){Ol(o,e,n)}return i}function si(t,e,n,r){if(pt(t)){const o=mo(t,e,n,r);return o&&w1(o)&&o.catch(s=>{Ol(s,e,n)}),o}const i=[];for(let o=0;o>>1,i=dr[r],o=Ff(i);olo&&dr.splice(e,1)}function Fp(t){We(t)?Su.push(...t):(!Is||!Is.includes(t,t.allowRecurse?Ra+1:Ra))&&Su.push(t),QA()}function r2(t,e,n=Hf?lo+1:0){for(;nFf(n)-Ff(r));if(Su.length=0,Is){Is.push(...e);return}for(Is=e,Ra=0;Rat.id==null?1/0:t.id,r5=(t,e)=>{const n=Ff(t)-Ff(e);if(n===0){if(t.pre&&!e.pre)return-1;if(e.pre&&!t.pre)return 1}return n};function e3(t){Oy=!1,Hf=!0,dr.sort(r5);const e=An;try{for(lo=0;losu.emit(i,...o)),Oh=[]):typeof window<"u"&&window.HTMLElement&&!((r=(n=window.navigator)==null?void 0:n.userAgent)!=null&&r.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{t3(o,e)}),setTimeout(()=>{su||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Oh=[])},3e3)):Oh=[]}function i5(t,e,...n){if(t.isUnmounted)return;const r=t.vnode.props||Ft;let i=n;const o=e.startsWith("update:"),s=o&&e.slice(7);if(s&&s in r){const d=`${s==="modelValue"?"model":s}Modifiers`,{number:m,trim:v}=r[d]||Ft;v&&(i=n.map(y=>xt(y)?y.trim():y)),m&&(i=n.map(zf))}let l,u=r[l=wu(e)]||r[l=wu(bn(e))];!u&&o&&(u=r[l=wu(ni(e))]),u&&si(u,t,6,i);const f=r[l+"Once"];if(f){if(!t.emitted)t.emitted={};else if(t.emitted[l])return;t.emitted[l]=!0,si(f,t,6,i)}}function n3(t,e,n=!1){const r=e.emitsCache,i=r.get(t);if(i!==void 0)return i;const o=t.emits;let s={},l=!1;if(!pt(t)){const u=f=>{const d=n3(f,e,!0);d&&(l=!0,Rt(s,d))};!n&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}return!o&&!l?(qt(t)&&r.set(t,null),null):(We(o)?o.forEach(u=>s[u]=null):Rt(s,o),qt(t)&&r.set(t,s),s)}function ug(t,e){return!t||!Cl(e)?!1:(e=e.slice(2).replace(/Once$/,""),Dt(t,e[0].toLowerCase()+e.slice(1))||Dt(t,ni(e))||Dt(t,e))}let On=null,cg=null;function Vf(t){const e=On;return On=t,cg=t&&t.type.__scopeId||null,e}function D1(t){cg=t}function R1(){cg=null}const z1=t=>Vt;function Vt(t,e=On,n){if(!e||t._n)return t;const r=(...i)=>{r._d&&By(-1);const o=Vf(e);let s;try{s=t(...i)}finally{Vf(o),r._d&&By(1)}return s};return r._n=!0,r._c=!0,r._d=!0,r}function yp(t){const{type:e,vnode:n,proxy:r,withProxy:i,props:o,propsOptions:[s],slots:l,attrs:u,emit:f,render:d,renderCache:m,data:v,setupState:y,ctx:_,inheritAttrs:C}=t;let x,k;const A=Vf(t);try{if(n.shapeFlag&4){const E=i||r,H=E;x=ei(d.call(H,E,m,o,y,v,_)),k=u}else{const E=e;x=ei(E.length>1?E(o,{attrs:u,slots:l,emit:f}):E(o,null)),k=e.props?u:s5(u)}}catch(E){cf.length=0,Ol(E,t,1),x=Qe(pr)}let N=x;if(k&&C!==!1){const E=Object.keys(k),{shapeFlag:H}=N;E.length&&H&7&&(s&&E.some(b1)&&(k=a5(k,s)),N=yo(N,k))}return n.dirs&&(N=yo(N),N.dirs=N.dirs?N.dirs.concat(n.dirs):n.dirs),n.transition&&(N.transition=n.transition),x=N,Vf(A),x}function o5(t,e=!0){let n;for(let r=0;r{let e;for(const n in t)(n==="class"||n==="style"||Cl(n))&&((e||(e={}))[n]=t[n]);return e},a5=(t,e)=>{const n={};for(const r in t)(!b1(r)||!(r.slice(9)in e))&&(n[r]=t[r]);return n};function l5(t,e,n){const{props:r,children:i,component:o}=t,{props:s,children:l,patchFlag:u}=e,f=o.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&u>=0){if(u&1024)return!0;if(u&16)return r?i2(r,s,f):!!s;if(u&8){const d=e.dynamicProps;for(let m=0;mt.__isSuspense;let My=0;const c5={name:"Suspense",__isSuspense:!0,process(t,e,n,r,i,o,s,l,u,f){if(t==null)d5(e,n,r,i,o,s,l,u,f);else{if(o&&o.deps>0){e.suspense=t.suspense;return}h5(t,e,n,r,i,s,l,u,f)}},hydrate:p5,create:F1,normalize:m5},f5=c5;function jf(t,e){const n=t.props&&t.props[e];pt(n)&&n()}function d5(t,e,n,r,i,o,s,l,u){const{p:f,o:{createElement:d}}=u,m=d("div"),v=t.suspense=F1(t,i,r,e,m,n,o,s,l,u);f(null,v.pendingBranch=t.ssContent,m,null,r,v,o,s),v.deps>0?(jf(t,"onPending"),jf(t,"onFallback"),f(null,t.ssFallback,e,n,r,null,o,s),Cu(v,t.ssFallback)):v.resolve(!1,!0)}function h5(t,e,n,r,i,o,s,l,{p:u,um:f,o:{createElement:d}}){const m=e.suspense=t.suspense;m.vnode=e,e.el=t.el;const v=e.ssContent,y=e.ssFallback,{activeBranch:_,pendingBranch:C,isInFallback:x,isHydrating:k}=m;if(C)m.pendingBranch=v,Ii(v,C)?(u(C,v,m.hiddenContainer,null,i,m,o,s,l),m.deps<=0?m.resolve():x&&(k||(u(_,y,n,r,i,null,o,s,l),Cu(m,y)))):(m.pendingId=My++,k?(m.isHydrating=!1,m.activeBranch=C):f(C,i,m),m.deps=0,m.effects.length=0,m.hiddenContainer=d("div"),x?(u(null,v,m.hiddenContainer,null,i,m,o,s,l),m.deps<=0?m.resolve():(u(_,y,n,r,i,null,o,s,l),Cu(m,y))):_&&Ii(v,_)?(u(_,v,n,r,i,m,o,s,l),m.resolve(!0)):(u(null,v,m.hiddenContainer,null,i,m,o,s,l),m.deps<=0&&m.resolve()));else if(_&&Ii(v,_))u(_,v,n,r,i,m,o,s,l),Cu(m,v);else if(jf(e,"onPending"),m.pendingBranch=v,v.shapeFlag&512?m.pendingId=v.component.suspenseId:m.pendingId=My++,u(null,v,m.hiddenContainer,null,i,m,o,s,l),m.deps<=0)m.resolve();else{const{timeout:A,pendingId:N}=m;A>0?setTimeout(()=>{m.pendingId===N&&m.fallback(y)},A):A===0&&m.fallback(y)}}function F1(t,e,n,r,i,o,s,l,u,f,d=!1){const{p:m,m:v,um:y,n:_,o:{parentNode:C,remove:x}}=f;let k;const A=g5(t);A&&e!=null&&e.pendingBranch&&(k=e.pendingId,e.deps++);const N=t.props?Bp(t.props.timeout):void 0,E=o,H={vnode:t,parent:e,parentComponent:n,namespace:s,container:r,hiddenContainer:i,deps:0,pendingId:My++,timeout:typeof N=="number"?N:-1,activeBranch:null,pendingBranch:null,isInFallback:!d,isHydrating:d,isUnmounted:!1,effects:[],resolve(I=!1,q=!1){const{vnode:P,activeBranch:z,pendingBranch:w,pendingId:R,effects:U,parentComponent:K,container:oe}=H;let D=!1;H.isHydrating?H.isHydrating=!1:I||(D=z&&w.transition&&w.transition.mode==="out-in",D&&(z.transition.afterLeave=()=>{R===H.pendingId&&(v(w,oe,o===E?_(z):o,0),Fp(U))}),z&&(C(z.el)!==H.hiddenContainer&&(o=_(z)),y(z,K,H,!0)),D||v(w,oe,o,0)),Cu(H,w),H.pendingBranch=null,H.isInFallback=!1;let ae=H.parent,ce=!1;for(;ae;){if(ae.pendingBranch){ae.effects.push(...U),ce=!0;break}ae=ae.parent}!ce&&!D&&Fp(U),H.effects=[],A&&e&&e.pendingBranch&&k===e.pendingId&&(e.deps--,e.deps===0&&!q&&e.resolve()),jf(P,"onResolve")},fallback(I){if(!H.pendingBranch)return;const{vnode:q,activeBranch:P,parentComponent:z,container:w,namespace:R}=H;jf(q,"onFallback");const U=_(P),K=()=>{H.isInFallback&&(m(null,I,w,U,z,null,R,l,u),Cu(H,I))},oe=I.transition&&I.transition.mode==="out-in";oe&&(P.transition.afterLeave=K),H.isInFallback=!0,y(P,z,null,!0),oe||K()},move(I,q,P){H.activeBranch&&v(H.activeBranch,I,q,P),H.container=I},next(){return H.activeBranch&&_(H.activeBranch)},registerDep(I,q){const P=!!H.pendingBranch;P&&H.deps++;const z=I.vnode.el;I.asyncDep.catch(w=>{Ol(w,I,0)}).then(w=>{if(I.isUnmounted||H.isUnmounted||H.pendingId!==I.suspenseId)return;I.asyncResolved=!0;const{vnode:R}=I;Fy(I,w,!1),z&&(R.el=z);const U=!z&&I.subTree.el;q(I,R,C(z||I.subTree.el),z?null:_(I.subTree),H,s,u),U&&x(U),B1(I,R.el),P&&--H.deps===0&&H.resolve()})},unmount(I,q){H.isUnmounted=!0,H.activeBranch&&y(H.activeBranch,n,I,q),H.pendingBranch&&y(H.pendingBranch,n,I,q)}};return H}function p5(t,e,n,r,i,o,s,l,u){const f=e.suspense=F1(e,r,n,t.parentNode,document.createElement("div"),null,i,o,s,l,!0),d=u(t,f.pendingBranch=e.ssContent,n,f,o,s);return f.deps===0&&f.resolve(!1,!0),d}function m5(t){const{shapeFlag:e,children:n}=t,r=e&32;t.ssContent=s2(r?n.default:n),t.ssFallback=r?s2(n.fallback):Qe(pr)}function s2(t){let e;if(pt(t)){const n=fl&&t._c;n&&(t._d=!1,ge()),t=t(),n&&(t._d=!0,e=Br,$3())}return We(t)&&(t=o5(t)),t=ei(t),e&&!t.dynamicChildren&&(t.dynamicChildren=e.filter(n=>n!==t)),t}function o3(t,e){e&&e.pendingBranch?We(t)?e.effects.push(...t):e.effects.push(t):Fp(t)}function Cu(t,e){t.activeBranch=e;const{vnode:n,parentComponent:r}=t;let i=e.el;for(;!i&&e.component;)e=e.component.subTree,i=e.el;n.el=i,r&&r.subTree===n&&(r.vnode.el=i,B1(r,i))}function g5(t){var e;return((e=t.props)==null?void 0:e.suspensible)!=null&&t.props.suspensible!==!1}const s3=Symbol.for("v-scx"),a3=()=>lf(s3);function l3(t,e){return bd(t,null,e)}function u3(t,e){return bd(t,null,{flush:"post"})}function c3(t,e){return bd(t,null,{flush:"sync"})}const Mh={};function En(t,e,n){return bd(t,e,n)}function bd(t,e,{immediate:n,deep:r,flush:i,once:o,onTrack:s,onTrigger:l}=Ft){if(e&&o){const I=e;e=(...q)=>{I(...q),H()}}const u=Bn,f=I=>r===!0?I:Fa(I,r===!1?1:void 0);let d,m=!1,v=!1;if(qn(t)?(d=()=>t.value,m=Bf(t)):Za(t)?(d=()=>f(t),m=!0):We(t)?(v=!0,m=t.some(I=>Za(I)||Bf(I)),d=()=>t.map(I=>{if(qn(I))return I.value;if(Za(I))return f(I);if(pt(I))return mo(I,u,2)})):pt(t)?e?d=()=>mo(t,u,2):d=()=>(y&&y(),si(t,u,3,[_])):d=An,e&&r){const I=d;d=()=>Fa(I())}let y,_=I=>{y=N.onStop=()=>{mo(I,u,4),y=N.onStop=void 0}},C;if(wd)if(_=An,e?n&&si(e,u,3,[d(),v?[]:void 0,_]):d(),i==="sync"){const I=a3();C=I.__watcherHandles||(I.__watcherHandles=[])}else return An;let x=v?new Array(t.length).fill(Mh):Mh;const k=()=>{if(!(!N.active||!N.dirty))if(e){const I=N.run();(r||m||(v?I.some((q,P)=>ji(q,x[P])):ji(I,x)))&&(y&&y(),si(e,u,3,[I,x===Mh?void 0:v&&x[0]===Mh?[]:x,_]),x=I)}else N.run()};k.allowRecurse=!!e;let A;i==="sync"?A=k:i==="post"?A=()=>Zn(k,u&&u.suspense):(k.pre=!0,u&&(k.id=u.uid),A=()=>lg(k));const N=new Pu(d,An,A),E=NA(),H=()=>{N.stop(),E&&_1(E.effects,N)};return e?n?k():x=N.run():i==="post"?Zn(N.run.bind(N),u&&u.suspense):N.run(),C&&C.push(H),H}function v5(t,e,n){const r=this.proxy,i=xt(t)?t.includes(".")?f3(r,t):()=>r[t]:t.bind(r,r);let o;pt(e)?o=e:(o=e.handler,n=e);const s=dl(this),l=bd(i,o.bind(r),n);return s(),l}function f3(t,e){const n=e.split(".");return()=>{let r=t;for(let i=0;i0){if(n>=e)return t;n++}if(r=r||new Set,r.has(t))return t;if(r.add(t),qn(t))Fa(t.value,e,n,r);else if(We(t))for(let i=0;i{Fa(i,e,n,r)});else if(TA(t))for(const i in t)Fa(t[i],e,n,r);return t}function Ut(t,e){if(On===null)return t;const n=gg(On)||On.proxy,r=t.dirs||(t.dirs=[]);for(let i=0;i{t.isMounted=!0}),Ml(()=>{t.isUnmounting=!0}),t}const di=[Function,Array],j1={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:di,onEnter:di,onAfterEnter:di,onEnterCancelled:di,onBeforeLeave:di,onLeave:di,onAfterLeave:di,onLeaveCancelled:di,onBeforeAppear:di,onAppear:di,onAfterAppear:di,onAppearCancelled:di},y5={name:"BaseTransition",props:j1,setup(t,{slots:e}){const n=qi(),r=V1();let i;return()=>{const o=e.default&&fg(e.default(),!0);if(!o||!o.length)return;let s=o[0];if(o.length>1){for(const C of o)if(C.type!==pr){s=C;break}}const l=Mt(t),{mode:u}=l;if(r.isLeaving)return a0(s);const f=a2(s);if(!f)return a0(s);const d=Du(f,l,r,n);ul(f,d);const m=n.subTree,v=m&&a2(m);let y=!1;const{getTransitionKey:_}=f.type;if(_){const C=_();i===void 0?i=C:C!==i&&(i=C,y=!0)}if(v&&v.type!==pr&&(!Ii(f,v)||y)){const C=Du(v,l,r,n);if(ul(v,C),u==="out-in")return r.isLeaving=!0,C.afterLeave=()=>{r.isLeaving=!1,n.update.active!==!1&&(n.effect.dirty=!0,n.update())},a0(s);u==="in-out"&&f.type!==pr&&(C.delayLeave=(x,k,A)=>{const N=h3(r,v);N[String(v.key)]=v,x[Ps]=()=>{k(),x[Ps]=void 0,delete d.delayedLeave},d.delayedLeave=A})}return s}}},d3=y5;function h3(t,e){const{leavingVNodes:n}=t;let r=n.get(e.type);return r||(r=Object.create(null),n.set(e.type,r)),r}function Du(t,e,n,r){const{appear:i,mode:o,persisted:s=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:f,onEnterCancelled:d,onBeforeLeave:m,onLeave:v,onAfterLeave:y,onLeaveCancelled:_,onBeforeAppear:C,onAppear:x,onAfterAppear:k,onAppearCancelled:A}=e,N=String(t.key),E=h3(n,t),H=(P,z)=>{P&&si(P,r,9,z)},I=(P,z)=>{const w=z[1];H(P,z),We(P)?P.every(R=>R.length<=1)&&w():P.length<=1&&w()},q={mode:o,persisted:s,beforeEnter(P){let z=l;if(!n.isMounted)if(i)z=C||l;else return;P[Ps]&&P[Ps](!0);const w=E[N];w&&Ii(t,w)&&w.el[Ps]&&w.el[Ps](),H(z,[P])},enter(P){let z=u,w=f,R=d;if(!n.isMounted)if(i)z=x||u,w=k||f,R=A||d;else return;let U=!1;const K=P[Lh]=oe=>{U||(U=!0,oe?H(R,[P]):H(w,[P]),q.delayedLeave&&q.delayedLeave(),P[Lh]=void 0)};z?I(z,[P,K]):K()},leave(P,z){const w=String(t.key);if(P[Lh]&&P[Lh](!0),n.isUnmounting)return z();H(m,[P]);let R=!1;const U=P[Ps]=K=>{R||(R=!0,z(),K?H(_,[P]):H(y,[P]),P[Ps]=void 0,E[w]===t&&delete E[w])};E[w]=t,v?I(v,[P,U]):U()},clone(P){return Du(P,e,n,r)}};return q}function a0(t){if(_d(t))return t=yo(t),t.children=null,t}function a2(t){return _d(t)?t.children?t.children[0]:void 0:t}function ul(t,e){t.shapeFlag&6&&t.component?ul(t.component.subTree,e):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function fg(t,e=!1,n){let r=[],i=0;for(let o=0;o1)for(let o=0;oRt({name:t.name},e,{setup:t}))():t}const Qa=t=>!!t.type.__asyncLoader;/*! #__NO_SIDE_EFFECTS__ */function b5(t){pt(t)&&(t={loader:t});const{loader:e,loadingComponent:n,errorComponent:r,delay:i=200,timeout:o,suspensible:s=!0,onError:l}=t;let u=null,f,d=0;const m=()=>(d++,u=null,v()),v=()=>{let y;return u||(y=u=e().catch(_=>{if(_=_ instanceof Error?_:new Error(String(_)),l)return new Promise((C,x)=>{l(_,()=>C(m()),()=>x(_),d+1)});throw _}).then(_=>y!==u&&u?u:(_&&(_.__esModule||_[Symbol.toStringTag]==="Module")&&(_=_.default),f=_,_)))};return Vn({name:"AsyncComponentWrapper",__asyncLoader:v,get __asyncResolved(){return f},setup(){const y=Bn;if(f)return()=>l0(f,y);const _=A=>{u=null,Ol(A,y,13,!r)};if(s&&y.suspense||wd)return v().then(A=>()=>l0(A,y)).catch(A=>(_(A),()=>r?Qe(r,{error:A}):null));const C=Ot(!1),x=Ot(),k=Ot(!!i);return i&&setTimeout(()=>{k.value=!1},i),o!=null&&setTimeout(()=>{if(!C.value&&!x.value){const A=new Error(`Async component timed out after ${o}ms.`);_(A),x.value=A}},o),v().then(()=>{C.value=!0,y.parent&&_d(y.parent.vnode)&&(y.parent.effect.dirty=!0,lg(y.parent.update))}).catch(A=>{_(A),x.value=A}),()=>{if(C.value&&f)return l0(f,y);if(x.value&&r)return Qe(r,{error:x.value});if(n&&!k.value)return Qe(n)}}})}function l0(t,e){const{ref:n,props:r,children:i,ce:o}=e.vnode,s=Qe(t,r,i);return s.ref=n,s.ce=o,delete e.vnode.ce,s}const _d=t=>t.type.__isKeepAlive,_5={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(t,{slots:e}){const n=qi(),r=n.ctx;if(!r.renderer)return()=>{const A=e.default&&e.default();return A&&A.length===1?A[0]:A};const i=new Map,o=new Set;let s=null;const l=n.suspense,{renderer:{p:u,m:f,um:d,o:{createElement:m}}}=r,v=m("div");r.activate=(A,N,E,H,I)=>{const q=A.component;f(A,N,E,0,l),u(q.vnode,A,N,E,q,l,H,A.slotScopeIds,I),Zn(()=>{q.isDeactivated=!1,q.a&&ku(q.a);const P=A.props&&A.props.onVnodeMounted;P&&Rr(P,q.parent,A)},l)},r.deactivate=A=>{const N=A.component;f(A,v,null,1,l),Zn(()=>{N.da&&ku(N.da);const E=A.props&&A.props.onVnodeUnmounted;E&&Rr(E,N.parent,A),N.isDeactivated=!0},l)};function y(A){u0(A),d(A,n,l,!0)}function _(A){i.forEach((N,E)=>{const H=Gp(N.type);H&&(!A||!A(H))&&C(E)})}function C(A){const N=i.get(A);!s||!Ii(N,s)?y(N):s&&u0(s),i.delete(A),o.delete(A)}En(()=>[t.include,t.exclude],([A,N])=>{A&&_(E=>Qc(A,E)),N&&_(E=>!Qc(N,E))},{flush:"post",deep:!0});let x=null;const k=()=>{x!=null&&i.set(x,c0(n.subTree))};return ts(k),hg(k),Ml(()=>{i.forEach(A=>{const{subTree:N,suspense:E}=n,H=c0(N);if(A.type===H.type&&A.key===H.key){u0(H);const I=H.component.da;I&&Zn(I,E);return}y(A)})}),()=>{if(x=null,!e.default)return null;const A=e.default(),N=A[0];if(A.length>1)return s=null,A;if(!ea(N)||!(N.shapeFlag&4)&&!(N.shapeFlag&128))return s=null,N;let E=c0(N);const H=E.type,I=Gp(Qa(E)?E.type.__asyncResolved||{}:H),{include:q,exclude:P,max:z}=t;if(q&&(!I||!Qc(q,I))||P&&I&&Qc(P,I))return s=E,N;const w=E.key==null?H:E.key,R=i.get(w);return E.el&&(E=yo(E),N.shapeFlag&128&&(N.ssContent=E)),x=w,R?(E.el=R.el,E.component=R.component,E.transition&&ul(E,E.transition),E.shapeFlag|=512,o.delete(w),o.add(w)):(o.add(w),z&&o.size>parseInt(z,10)&&C(o.values().next().value)),E.shapeFlag|=256,s=E,i3(N.type)?N:E}}},w5=_5;function Qc(t,e){return We(t)?t.some(n=>Qc(n,e)):xt(t)?t.split(",").includes(e):jP(t)?t.test(e):!1}function p3(t,e){g3(t,"a",e)}function m3(t,e){g3(t,"da",e)}function g3(t,e,n=Bn){const r=t.__wdc||(t.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return t()});if(dg(e,r,n),n){let i=n.parent;for(;i&&i.parent;)_d(i.parent.vnode)&&k5(r,e,n,i),i=i.parent}}function k5(t,e,n,r){const i=dg(e,t,r,!0);pg(()=>{_1(r[e],i)},n)}function u0(t){t.shapeFlag&=-257,t.shapeFlag&=-513}function c0(t){return t.shapeFlag&128?t.ssContent:t}function dg(t,e,n=Bn,r=!1){if(n){const i=n[t]||(n[t]=[]),o=e.__weh||(e.__weh=(...s)=>{if(n.isUnmounted)return;ua();const l=dl(n),u=si(e,n,t,s);return l(),ca(),u});return r?i.unshift(o):i.push(o),o}}const es=t=>(e,n=Bn)=>(!wd||t==="sp")&&dg(t,(...r)=>e(...r),n),v3=es("bm"),ts=es("m"),y3=es("bu"),hg=es("u"),Ml=es("bum"),pg=es("um"),b3=es("sp"),_3=es("rtg"),w3=es("rtc");function k3(t,e=Bn){dg("ec",t,e)}function Zt(t,e,n,r){let i;const o=n&&n[r];if(We(t)||xt(t)){i=new Array(t.length);for(let s=0,l=t.length;se(s,l,void 0,o&&o[l]));else{const s=Object.keys(t);i=new Array(s.length);for(let l=0,u=s.length;l{const o=r.fn(...i);return o&&(o.key=r.key),o}:r.fn)}return t}function pn(t,e,n={},r,i){if(On.isCE||On.parent&&Qa(On.parent)&&On.parent.isCE)return e!=="default"&&(n.name=e),Qe("slot",n,r&&r());let o=t[e];o&&o._c&&(o._d=!1),ge();const s=o&&x3(o(n)),l=Et(kt,{key:n.key||s&&s.key||`_${e}`},s||(r?r():[]),s&&t._===1?64:-2);return!i&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),o&&o._c&&(o._d=!0),l}function x3(t){return t.some(e=>ea(e)?!(e.type===pr||e.type===kt&&!x3(e.children)):!0)?t:null}function Ly(t,e){const n={};for(const r in t)n[e&&/[A-Z]/.test(r)?`on:${r}`:wu(r)]=t[r];return n}const Ny=t=>t?j3(t)?gg(t)||t.proxy:Ny(t.parent):null,af=Rt(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Ny(t.parent),$root:t=>Ny(t.root),$emit:t=>t.emit,$options:t=>U1(t),$forceUpdate:t=>t.f||(t.f=()=>{t.effect.dirty=!0,lg(t.update)}),$nextTick:t=>t.n||(t.n=Ri.bind(t.proxy)),$watch:t=>v5.bind(t)}),f0=(t,e)=>t!==Ft&&!t.__isScriptSetup&&Dt(t,e),Iy={get({_:t},e){const{ctx:n,setupState:r,data:i,props:o,accessCache:s,type:l,appContext:u}=t;let f;if(e[0]!=="$"){const y=s[e];if(y!==void 0)switch(y){case 1:return r[e];case 2:return i[e];case 4:return n[e];case 3:return o[e]}else{if(f0(r,e))return s[e]=1,r[e];if(i!==Ft&&Dt(i,e))return s[e]=2,i[e];if((f=t.propsOptions[0])&&Dt(f,e))return s[e]=3,o[e];if(n!==Ft&&Dt(n,e))return s[e]=4,n[e];Py&&(s[e]=0)}}const d=af[e];let m,v;if(d)return e==="$attrs"&&Wr(t,"get",e),d(t);if((m=l.__cssModules)&&(m=m[e]))return m;if(n!==Ft&&Dt(n,e))return s[e]=4,n[e];if(v=u.config.globalProperties,Dt(v,e))return v[e]},set({_:t},e,n){const{data:r,setupState:i,ctx:o}=t;return f0(i,e)?(i[e]=n,!0):r!==Ft&&Dt(r,e)?(r[e]=n,!0):Dt(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(o[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:r,appContext:i,propsOptions:o}},s){let l;return!!n[s]||t!==Ft&&Dt(t,s)||f0(e,s)||(l=o[0])&&Dt(l,s)||Dt(r,s)||Dt(af,s)||Dt(i.config.globalProperties,s)},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:Dt(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}},x5=Rt({},Iy,{get(t,e){if(e!==Symbol.unscopables)return Iy.get(t,e,t)},has(t,e){return e[0]!=="_"&&!YP(e)}});function S5(){return null}function C5(){return null}function T5(t){}function E5(t){}function A5(){return null}function O5(){}function M5(t,e){return null}function L5(){return S3().slots}function N5(){return S3().attrs}function S3(){const t=qi();return t.setupContext||(t.setupContext=K3(t))}function Wf(t){return We(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}function I5(t,e){const n=Wf(t);for(const r in e){if(r.startsWith("__skip"))continue;let i=n[r];i?We(i)||pt(i)?i=n[r]={type:i,default:e[r]}:i.default=e[r]:i===null&&(i=n[r]={default:e[r]}),i&&e[`__skip_${r}`]&&(i.skipFactory=!0)}return n}function P5(t,e){return!t||!e?t||e:We(t)&&We(e)?t.concat(e):Rt({},Wf(t),Wf(e))}function D5(t,e){const n={};for(const r in t)e.includes(r)||Object.defineProperty(n,r,{enumerable:!0,get:()=>t[r]});return n}function R5(t){const e=qi();let n=t();return Hy(),w1(n)&&(n=n.catch(r=>{throw dl(e),r})),[n,()=>dl(e)]}let Py=!0;function z5(t){const e=U1(t),n=t.proxy,r=t.ctx;Py=!1,e.beforeCreate&&l2(e.beforeCreate,t,"bc");const{data:i,computed:o,methods:s,watch:l,provide:u,inject:f,created:d,beforeMount:m,mounted:v,beforeUpdate:y,updated:_,activated:C,deactivated:x,beforeDestroy:k,beforeUnmount:A,destroyed:N,unmounted:E,render:H,renderTracked:I,renderTriggered:q,errorCaptured:P,serverPrefetch:z,expose:w,inheritAttrs:R,components:U,directives:K,filters:oe}=e;if(f&&B5(f,r,null),s)for(const ce in s){const ve=s[ce];pt(ve)&&(r[ce]=ve.bind(n))}if(i){const ce=i.call(n,n);qt(ce)&&(t.data=Al(ce))}if(Py=!0,o)for(const ce in o){const ve=o[ce],ze=pt(ve)?ve.bind(n,n):pt(ve.get)?ve.get.bind(n,n):An,qe=!pt(ve)&&pt(ve.set)?ve.set.bind(n):An,vt=er({get:ze,set:qe});Object.defineProperty(r,ce,{enumerable:!0,configurable:!0,get:()=>vt.value,set:mt=>vt.value=mt})}if(l)for(const ce in l)C3(l[ce],r,n,ce);if(u){const ce=pt(u)?u.call(n):u;Reflect.ownKeys(ce).forEach(ve=>{Wp(ve,ce[ve])})}d&&l2(d,t,"c");function ae(ce,ve){We(ve)?ve.forEach(ze=>ce(ze.bind(n))):ve&&ce(ve.bind(n))}if(ae(v3,m),ae(ts,v),ae(y3,y),ae(hg,_),ae(p3,C),ae(m3,x),ae(k3,P),ae(w3,I),ae(_3,q),ae(Ml,A),ae(pg,E),ae(b3,z),We(w))if(w.length){const ce=t.exposed||(t.exposed={});w.forEach(ve=>{Object.defineProperty(ce,ve,{get:()=>n[ve],set:ze=>n[ve]=ze})})}else t.exposed||(t.exposed={});H&&t.render===An&&(t.render=H),R!=null&&(t.inheritAttrs=R),U&&(t.components=U),K&&(t.directives=K)}function B5(t,e,n=An){We(t)&&(t=Dy(t));for(const r in t){const i=t[r];let o;qt(i)?"default"in i?o=lf(i.from||r,i.default,!0):o=lf(i.from||r):o=lf(i),qn(o)?Object.defineProperty(e,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:s=>o.value=s}):e[r]=o}}function l2(t,e,n){si(We(t)?t.map(r=>r.bind(e.proxy)):t.bind(e.proxy),e,n)}function C3(t,e,n,r){const i=r.includes(".")?f3(n,r):()=>n[r];if(xt(t)){const o=e[t];pt(o)&&En(i,o)}else if(pt(t))En(i,t.bind(n));else if(qt(t))if(We(t))t.forEach(o=>C3(o,e,n,r));else{const o=pt(t.handler)?t.handler.bind(n):e[t.handler];pt(o)&&En(i,o,t)}}function U1(t){const e=t.type,{mixins:n,extends:r}=e,{mixins:i,optionsCache:o,config:{optionMergeStrategies:s}}=t.appContext,l=o.get(e);let u;return l?u=l:!i.length&&!n&&!r?u=e:(u={},i.length&&i.forEach(f=>jp(u,f,s,!0)),jp(u,e,s)),qt(e)&&o.set(e,u),u}function jp(t,e,n,r=!1){const{mixins:i,extends:o}=e;o&&jp(t,o,n,!0),i&&i.forEach(s=>jp(t,s,n,!0));for(const s in e)if(!(r&&s==="expose")){const l=$5[s]||n&&n[s];t[s]=l?l(t[s],e[s]):e[s]}return t}const $5={data:u2,props:c2,emits:c2,methods:ef,computed:ef,beforeCreate:Sr,created:Sr,beforeMount:Sr,mounted:Sr,beforeUpdate:Sr,updated:Sr,beforeDestroy:Sr,beforeUnmount:Sr,destroyed:Sr,unmounted:Sr,activated:Sr,deactivated:Sr,errorCaptured:Sr,serverPrefetch:Sr,components:ef,directives:ef,watch:F5,provide:u2,inject:H5};function u2(t,e){return e?t?function(){return Rt(pt(t)?t.call(this,this):t,pt(e)?e.call(this,this):e)}:e:t}function H5(t,e){return ef(Dy(t),Dy(e))}function Dy(t){if(We(t)){const e={};for(let n=0;n1)return n&&pt(e)?e.call(r&&r.proxy):e}}function W5(){return!!(Bn||On||Uf)}function U5(t,e,n,r=!1){const i={},o={};zp(o,mg,1),t.propsDefaults=Object.create(null),E3(t,e,i,o);for(const s in t.propsOptions[0])s in i||(i[s]=void 0);n?t.props=r?i:Hp(i):t.type.props?t.props=i:t.props=o,t.attrs=o}function q5(t,e,n,r){const{props:i,attrs:o,vnode:{patchFlag:s}}=t,l=Mt(i),[u]=t.propsOptions;let f=!1;if((r||s>0)&&!(s&16)){if(s&8){const d=t.vnode.dynamicProps;for(let m=0;m{u=!0;const[v,y]=A3(m,e,!0);Rt(s,v),y&&l.push(...y)};!n&&e.mixins.length&&e.mixins.forEach(d),t.extends&&d(t.extends),t.mixins&&t.mixins.forEach(d)}if(!o&&!u)return qt(t)&&r.set(t,bu),bu;if(We(o))for(let d=0;d-1,y[1]=C<0||_-1||Dt(y,"default"))&&l.push(m)}}}const f=[s,l];return qt(t)&&r.set(t,f),f}function f2(t){return t[0]!=="$"}function d2(t){const e=t&&t.toString().match(/^\s*(function|class) (\w+)/);return e?e[2]:t===null?"null":""}function h2(t,e){return d2(t)===d2(e)}function p2(t,e){return We(e)?e.findIndex(n=>h2(n,t)):pt(e)&&h2(e,t)?0:-1}const O3=t=>t[0]==="_"||t==="$stable",q1=t=>We(t)?t.map(ei):[ei(t)],K5=(t,e,n)=>{if(e._n)return e;const r=Vt((...i)=>q1(e(...i)),n);return r._c=!1,r},M3=(t,e,n)=>{const r=t._ctx;for(const i in t){if(O3(i))continue;const o=t[i];if(pt(o))e[i]=K5(i,o,r);else if(o!=null){const s=q1(o);e[i]=()=>s}}},L3=(t,e)=>{const n=q1(e);t.slots.default=()=>n},G5=(t,e)=>{if(t.vnode.shapeFlag&32){const n=e._;n?(t.slots=Mt(e),zp(e,"_",n)):M3(e,t.slots={})}else t.slots={},e&&L3(t,e);zp(t.slots,mg,1)},Y5=(t,e,n)=>{const{vnode:r,slots:i}=t;let o=!0,s=Ft;if(r.shapeFlag&32){const l=e._;l?n&&l===1?o=!1:(Rt(i,e),!n&&l===1&&delete i._):(o=!e.$stable,M3(e,i)),s=e}else e&&(L3(t,e),s={default:1});if(o)for(const l in i)!O3(l)&&s[l]==null&&delete i[l]};function Up(t,e,n,r,i=!1){if(We(t)){t.forEach((v,y)=>Up(v,e&&(We(e)?e[y]:e),n,r,i));return}if(Qa(r)&&!i)return;const o=r.shapeFlag&4?gg(r.component)||r.component.proxy:r.el,s=i?null:o,{i:l,r:u}=t,f=e&&e.r,d=l.refs===Ft?l.refs={}:l.refs,m=l.setupState;if(f!=null&&f!==u&&(xt(f)?(d[f]=null,Dt(m,f)&&(m[f]=null)):qn(f)&&(f.value=null)),pt(u))mo(u,l,12,[s,d]);else{const v=xt(u),y=qn(u),_=t.f;if(v||y){const C=()=>{if(_){const x=v?Dt(m,u)?m[u]:d[u]:u.value;i?We(x)&&_1(x,o):We(x)?x.includes(o)||x.push(o):v?(d[u]=[o],Dt(m,u)&&(m[u]=d[u])):(u.value=[o],t.k&&(d[t.k]=u.value))}else v?(d[u]=s,Dt(m,u)&&(m[u]=s)):y&&(u.value=s,t.k&&(d[t.k]=s))};i||_?C():(C.id=-1,Zn(C,n))}}}let xs=!1;const J5=t=>t.namespaceURI.includes("svg")&&t.tagName!=="foreignObject",X5=t=>t.namespaceURI.includes("MathML"),Nh=t=>{if(J5(t))return"svg";if(X5(t))return"mathml"},Wc=t=>t.nodeType===8;function Z5(t){const{mt:e,p:n,o:{patchProp:r,createText:i,nextSibling:o,parentNode:s,remove:l,insert:u,createComment:f}}=t,d=(N,E)=>{if(!E.hasChildNodes()){__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&Ea("Attempting to hydrate existing markup but container is empty. Performing full mount instead."),n(null,N,E),Vp(),E._vnode=N;return}xs=!1,m(E.firstChild,N,null,null,null),Vp(),E._vnode=N,xs&&console.error("Hydration completed but contains mismatches.")},m=(N,E,H,I,q,P=!1)=>{const z=Wc(N)&&N.data==="[",w=()=>C(N,E,H,I,q,z),{type:R,ref:U,shapeFlag:K,patchFlag:oe}=E;let D=N.nodeType;E.el=N,oe===-2&&(P=!1,E.dynamicChildren=null);let ae=null;switch(R){case cl:D!==3?E.children===""?(u(E.el=i(""),s(N),N),ae=N):ae=w():(N.data!==E.children&&(xs=!0,__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&Ea("Hydration text mismatch in",N.parentNode,` - - rendered on server: ${JSON.stringify(N.data)} - - expected on client: ${JSON.stringify(E.children)}`),N.data=E.children),ae=o(N));break;case pr:A(N)?(ae=o(N),k(E.el=N.content.firstChild,N,H)):D!==8||z?ae=w():ae=o(N);break;case el:if(z&&(N=o(N),D=N.nodeType),D===1||D===3){ae=N;const ce=!E.children.length;for(let ve=0;ve{P=P||!!E.dynamicChildren;const{type:z,props:w,patchFlag:R,shapeFlag:U,dirs:K,transition:oe}=E,D=z==="input"||z==="option";if(D||R!==-1){K&&so(E,null,H,"created");let ae=!1;if(A(N)){ae=D3(I,oe)&&H&&H.vnode.props&&H.vnode.props.appear;const ve=N.content.firstChild;ae&&oe.beforeEnter(ve),k(ve,N,H),E.el=N=ve}if(U&16&&!(w&&(w.innerHTML||w.textContent))){let ve=y(N.firstChild,E,N,H,I,q,P),ze=!1;for(;ve;){xs=!0,__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&!ze&&(Ea("Hydration children mismatch on",N,` -Server rendered element contains more child nodes than client vdom.`),ze=!0);const qe=ve;ve=ve.nextSibling,l(qe)}}else U&8&&N.textContent!==E.children&&(xs=!0,__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&Ea("Hydration text content mismatch on",N,` - - rendered on server: ${N.textContent} - - expected on client: ${E.children}`),N.textContent=E.children);if(w)if(D||!P||R&48)for(const ve in w)(D&&(ve.endsWith("value")||ve==="indeterminate")||Cl(ve)&&!Ya(ve)||ve[0]===".")&&r(N,ve,null,w[ve],void 0,void 0,H);else w.onClick&&r(N,"onClick",null,w.onClick,void 0,void 0,H);let ce;(ce=w&&w.onVnodeBeforeMount)&&Rr(ce,H,E),K&&so(E,null,H,"beforeMount"),((ce=w&&w.onVnodeMounted)||K||ae)&&o3(()=>{ce&&Rr(ce,H,E),ae&&oe.enter(N),K&&so(E,null,H,"mounted")},I)}return N.nextSibling},y=(N,E,H,I,q,P,z)=>{z=z||!!E.dynamicChildren;const w=E.children,R=w.length;let U=!1;for(let K=0;K{const{slotScopeIds:z}=E;z&&(q=q?q.concat(z):z);const w=s(N),R=y(o(N),E,w,H,I,q,P);return R&&Wc(R)&&R.data==="]"?o(E.anchor=R):(xs=!0,u(E.anchor=f("]"),w,R),R)},C=(N,E,H,I,q,P)=>{if(xs=!0,__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&Ea(`Hydration node mismatch: -- rendered on server:`,N,N.nodeType===3?"(text)":Wc(N)&&N.data==="["?"(start of fragment)":"",` -- expected on client:`,E.type),E.el=null,P){const R=x(N);for(;;){const U=o(N);if(U&&U!==R)l(U);else break}}const z=o(N),w=s(N);return l(N),n(null,E,w,z,H,I,Nh(w),q),z},x=(N,E="[",H="]")=>{let I=0;for(;N;)if(N=o(N),N&&Wc(N)&&(N.data===E&&I++,N.data===H)){if(I===0)return o(N);I--}return N},k=(N,E,H)=>{const I=E.parentNode;I&&I.replaceChild(N,E);let q=H;for(;q;)q.vnode.el===E&&(q.vnode.el=q.subTree.el=N),q=q.parent},A=N=>N.nodeType===1&&N.tagName.toLowerCase()==="template";return[d,m]}function Q5(){typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__!="boolean"&&(x1().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__=!1)}const Zn=o3;function N3(t){return P3(t)}function I3(t){return P3(t,Z5)}function P3(t,e){Q5();const n=x1();n.__VUE__=!0;const{insert:r,remove:i,patchProp:o,createElement:s,createText:l,createComment:u,setText:f,setElementText:d,parentNode:m,nextSibling:v,setScopeId:y=An,insertStaticContent:_}=t,C=(ie,ne,be,_e=null,xe=null,G=null,Z=void 0,L=null,W=!!ne.dynamicChildren)=>{if(ie===ne)return;ie&&!Ii(ie,ne)&&(_e=Be(ie),mt(ie,xe,G,!0),ie=null),ne.patchFlag===-2&&(W=!1,ne.dynamicChildren=null);const{type:O,ref:j,shapeFlag:F}=ne;switch(O){case cl:x(ie,ne,be,_e);break;case pr:k(ie,ne,be,_e);break;case el:ie==null&&A(ne,be,_e,Z);break;case kt:U(ie,ne,be,_e,xe,G,Z,L,W);break;default:F&1?H(ie,ne,be,_e,xe,G,Z,L,W):F&6?K(ie,ne,be,_e,xe,G,Z,L,W):(F&64||F&128)&&O.process(ie,ne,be,_e,xe,G,Z,L,W,Ke)}j!=null&&xe&&Up(j,ie&&ie.ref,G,ne||ie,!ne)},x=(ie,ne,be,_e)=>{if(ie==null)r(ne.el=l(ne.children),be,_e);else{const xe=ne.el=ie.el;ne.children!==ie.children&&f(xe,ne.children)}},k=(ie,ne,be,_e)=>{ie==null?r(ne.el=u(ne.children||""),be,_e):ne.el=ie.el},A=(ie,ne,be,_e)=>{[ie.el,ie.anchor]=_(ie.children,ne,be,_e,ie.el,ie.anchor)},N=({el:ie,anchor:ne},be,_e)=>{let xe;for(;ie&&ie!==ne;)xe=v(ie),r(ie,be,_e),ie=xe;r(ne,be,_e)},E=({el:ie,anchor:ne})=>{let be;for(;ie&&ie!==ne;)be=v(ie),i(ie),ie=be;i(ne)},H=(ie,ne,be,_e,xe,G,Z,L,W)=>{ne.type==="svg"?Z="svg":ne.type==="math"&&(Z="mathml"),ie==null?I(ne,be,_e,xe,G,Z,L,W):z(ie,ne,xe,G,Z,L,W)},I=(ie,ne,be,_e,xe,G,Z,L)=>{let W,O;const{props:j,shapeFlag:F,transition:Q,dirs:le}=ie;if(W=ie.el=s(ie.type,G,j&&j.is,j),F&8?d(W,ie.children):F&16&&P(ie.children,W,null,_e,xe,d0(ie,G),Z,L),le&&so(ie,null,_e,"created"),q(W,ie,ie.scopeId,Z,_e),j){for(const ye in j)ye!=="value"&&!Ya(ye)&&o(W,ye,null,j[ye],G,ie.children,_e,xe,Ie);"value"in j&&o(W,"value",null,j.value,G),(O=j.onVnodeBeforeMount)&&Rr(O,_e,ie)}le&&so(ie,null,_e,"beforeMount");const pe=D3(xe,Q);pe&&Q.beforeEnter(W),r(W,ne,be),((O=j&&j.onVnodeMounted)||pe||le)&&Zn(()=>{O&&Rr(O,_e,ie),pe&&Q.enter(W),le&&so(ie,null,_e,"mounted")},xe)},q=(ie,ne,be,_e,xe)=>{if(be&&y(ie,be),_e)for(let G=0;G<_e.length;G++)y(ie,_e[G]);if(xe){let G=xe.subTree;if(ne===G){const Z=xe.vnode;q(ie,Z,Z.scopeId,Z.slotScopeIds,xe.parent)}}},P=(ie,ne,be,_e,xe,G,Z,L,W=0)=>{for(let O=W;O{const L=ne.el=ie.el;let{patchFlag:W,dynamicChildren:O,dirs:j}=ne;W|=ie.patchFlag&16;const F=ie.props||Ft,Q=ne.props||Ft;let le;if(be&&Aa(be,!1),(le=Q.onVnodeBeforeUpdate)&&Rr(le,be,ne,ie),j&&so(ne,ie,be,"beforeUpdate"),be&&Aa(be,!0),O?w(ie.dynamicChildren,O,L,be,_e,d0(ne,xe),G):Z||ve(ie,ne,L,null,be,_e,d0(ne,xe),G,!1),W>0){if(W&16)R(L,ne,F,Q,be,_e,xe);else if(W&2&&F.class!==Q.class&&o(L,"class",null,Q.class,xe),W&4&&o(L,"style",F.style,Q.style,xe),W&8){const pe=ne.dynamicProps;for(let ye=0;ye{le&&Rr(le,be,ne,ie),j&&so(ne,ie,be,"updated")},_e)},w=(ie,ne,be,_e,xe,G,Z)=>{for(let L=0;L{if(be!==_e){if(be!==Ft)for(const L in be)!Ya(L)&&!(L in _e)&&o(ie,L,be[L],null,Z,ne.children,xe,G,Ie);for(const L in _e){if(Ya(L))continue;const W=_e[L],O=be[L];W!==O&&L!=="value"&&o(ie,L,O,W,Z,ne.children,xe,G,Ie)}"value"in _e&&o(ie,"value",be.value,_e.value,Z)}},U=(ie,ne,be,_e,xe,G,Z,L,W)=>{const O=ne.el=ie?ie.el:l(""),j=ne.anchor=ie?ie.anchor:l("");let{patchFlag:F,dynamicChildren:Q,slotScopeIds:le}=ne;le&&(L=L?L.concat(le):le),ie==null?(r(O,be,_e),r(j,be,_e),P(ne.children||[],be,j,xe,G,Z,L,W)):F>0&&F&64&&Q&&ie.dynamicChildren?(w(ie.dynamicChildren,Q,be,xe,G,Z,L),(ne.key!=null||xe&&ne===xe.subTree)&&K1(ie,ne,!0)):ve(ie,ne,be,j,xe,G,Z,L,W)},K=(ie,ne,be,_e,xe,G,Z,L,W)=>{ne.slotScopeIds=L,ie==null?ne.shapeFlag&512?xe.ctx.activate(ne,be,_e,Z,W):oe(ne,be,_e,xe,G,Z,W):D(ie,ne,W)},oe=(ie,ne,be,_e,xe,G,Z)=>{const L=ie.component=V3(ie,_e,xe);if(_d(ie)&&(L.ctx.renderer=Ke),W3(L),L.asyncDep){if(xe&&xe.registerDep(L,ae),!ie.el){const W=L.subTree=Qe(pr);k(null,W,ne,be)}}else ae(L,ie,ne,be,xe,G,Z)},D=(ie,ne,be)=>{const _e=ne.component=ie.component;if(l5(ie,ne,be))if(_e.asyncDep&&!_e.asyncResolved){ce(_e,ne,be);return}else _e.next=ne,n5(_e.update),_e.effect.dirty=!0,_e.update();else ne.el=ie.el,_e.vnode=ne},ae=(ie,ne,be,_e,xe,G,Z)=>{const L=()=>{if(ie.isMounted){let{next:j,bu:F,u:Q,parent:le,vnode:pe}=ie;{const Te=R3(ie);if(Te){j&&(j.el=pe.el,ce(ie,j,Z)),Te.asyncDep.then(()=>{ie.isUnmounted||L()});return}}let ye=j,Y;Aa(ie,!1),j?(j.el=pe.el,ce(ie,j,Z)):j=pe,F&&ku(F),(Y=j.props&&j.props.onVnodeBeforeUpdate)&&Rr(Y,le,j,pe),Aa(ie,!0);const X=yp(ie),de=ie.subTree;ie.subTree=X,C(de,X,m(de.el),Be(de),ie,xe,G),j.el=X.el,ye===null&&B1(ie,X.el),Q&&Zn(Q,xe),(Y=j.props&&j.props.onVnodeUpdated)&&Zn(()=>Rr(Y,le,j,pe),xe)}else{let j;const{el:F,props:Q}=ne,{bm:le,m:pe,parent:ye}=ie,Y=Qa(ne);if(Aa(ie,!1),le&&ku(le),!Y&&(j=Q&&Q.onVnodeBeforeMount)&&Rr(j,ye,ne),Aa(ie,!0),F&&at){const X=()=>{ie.subTree=yp(ie),at(F,ie.subTree,ie,xe,null)};Y?ne.type.__asyncLoader().then(()=>!ie.isUnmounted&&X()):X()}else{const X=ie.subTree=yp(ie);C(null,X,be,_e,ie,xe,G),ne.el=X.el}if(pe&&Zn(pe,xe),!Y&&(j=Q&&Q.onVnodeMounted)){const X=ne;Zn(()=>Rr(j,ye,X),xe)}(ne.shapeFlag&256||ye&&Qa(ye.vnode)&&ye.vnode.shapeFlag&256)&&ie.a&&Zn(ie.a,xe),ie.isMounted=!0,ne=be=_e=null}},W=ie.effect=new Pu(L,An,()=>lg(O),ie.scope),O=ie.update=()=>{W.dirty&&W.run()};O.id=ie.uid,Aa(ie,!0),O()},ce=(ie,ne,be)=>{ne.component=ie;const _e=ie.vnode.props;ie.vnode=ne,ie.next=null,q5(ie,ne.props,_e,be),Y5(ie,ne.children,be),ua(),r2(ie),ca()},ve=(ie,ne,be,_e,xe,G,Z,L,W=!1)=>{const O=ie&&ie.children,j=ie?ie.shapeFlag:0,F=ne.children,{patchFlag:Q,shapeFlag:le}=ne;if(Q>0){if(Q&128){qe(O,F,be,_e,xe,G,Z,L,W);return}else if(Q&256){ze(O,F,be,_e,xe,G,Z,L,W);return}}le&8?(j&16&&Ie(O,xe,G),F!==O&&d(be,F)):j&16?le&16?qe(O,F,be,_e,xe,G,Z,L,W):Ie(O,xe,G,!0):(j&8&&d(be,""),le&16&&P(F,be,_e,xe,G,Z,L,W))},ze=(ie,ne,be,_e,xe,G,Z,L,W)=>{ie=ie||bu,ne=ne||bu;const O=ie.length,j=ne.length,F=Math.min(O,j);let Q;for(Q=0;Qj?Ie(ie,xe,G,!0,!1,F):P(ne,be,_e,xe,G,Z,L,W,F)},qe=(ie,ne,be,_e,xe,G,Z,L,W)=>{let O=0;const j=ne.length;let F=ie.length-1,Q=j-1;for(;O<=F&&O<=Q;){const le=ie[O],pe=ne[O]=W?Ds(ne[O]):ei(ne[O]);if(Ii(le,pe))C(le,pe,be,null,xe,G,Z,L,W);else break;O++}for(;O<=F&&O<=Q;){const le=ie[F],pe=ne[Q]=W?Ds(ne[Q]):ei(ne[Q]);if(Ii(le,pe))C(le,pe,be,null,xe,G,Z,L,W);else break;F--,Q--}if(O>F){if(O<=Q){const le=Q+1,pe=leQ)for(;O<=F;)mt(ie[O],xe,G,!0),O++;else{const le=O,pe=O,ye=new Map;for(O=pe;O<=Q;O++){const Le=ne[O]=W?Ds(ne[O]):ei(ne[O]);Le.key!=null&&ye.set(Le.key,O)}let Y,X=0;const de=Q-pe+1;let Te=!1,je=0;const he=new Array(de);for(O=0;O=de){mt(Le,xe,G,!0);continue}let me;if(Le.key!=null)me=ye.get(Le.key);else for(Y=pe;Y<=Q;Y++)if(he[Y-pe]===0&&Ii(Le,ne[Y])){me=Y;break}me===void 0?mt(Le,xe,G,!0):(he[me-pe]=O+1,me>=je?je=me:Te=!0,C(Le,ne[me],be,null,xe,G,Z,L,W),X++)}const Ae=Te?eR(he):bu;for(Y=Ae.length-1,O=de-1;O>=0;O--){const Le=pe+O,me=ne[Le],Je=Le+1{const{el:G,type:Z,transition:L,children:W,shapeFlag:O}=ie;if(O&6){vt(ie.component.subTree,ne,be,_e);return}if(O&128){ie.suspense.move(ne,be,_e);return}if(O&64){Z.move(ie,ne,be,Ke);return}if(Z===kt){r(G,ne,be);for(let F=0;FL.enter(G),xe);else{const{leave:F,delayLeave:Q,afterLeave:le}=L,pe=()=>r(G,ne,be),ye=()=>{F(G,()=>{pe(),le&&le()})};Q?Q(G,pe,ye):ye()}else r(G,ne,be)},mt=(ie,ne,be,_e=!1,xe=!1)=>{const{type:G,props:Z,ref:L,children:W,dynamicChildren:O,shapeFlag:j,patchFlag:F,dirs:Q}=ie;if(L!=null&&Up(L,null,be,ie,!0),j&256){ne.ctx.deactivate(ie);return}const le=j&1&&Q,pe=!Qa(ie);let ye;if(pe&&(ye=Z&&Z.onVnodeBeforeUnmount)&&Rr(ye,ne,ie),j&6)Xe(ie.component,be,_e);else{if(j&128){ie.suspense.unmount(be,_e);return}le&&so(ie,null,ne,"beforeUnmount"),j&64?ie.type.remove(ie,ne,be,xe,Ke,_e):O&&(G!==kt||F>0&&F&64)?Ie(O,ne,be,!1,!0):(G===kt&&F&384||!xe&&j&16)&&Ie(W,ne,be),_e&&bt(ie)}(pe&&(ye=Z&&Z.onVnodeUnmounted)||le)&&Zn(()=>{ye&&Rr(ye,ne,ie),le&&so(ie,null,ne,"unmounted")},be)},bt=ie=>{const{type:ne,el:be,anchor:_e,transition:xe}=ie;if(ne===kt){yt(be,_e);return}if(ne===el){E(ie);return}const G=()=>{i(be),xe&&!xe.persisted&&xe.afterLeave&&xe.afterLeave()};if(ie.shapeFlag&1&&xe&&!xe.persisted){const{leave:Z,delayLeave:L}=xe,W=()=>Z(be,G);L?L(ie.el,G,W):W()}else G()},yt=(ie,ne)=>{let be;for(;ie!==ne;)be=v(ie),i(ie),ie=be;i(ne)},Xe=(ie,ne,be)=>{const{bum:_e,scope:xe,update:G,subTree:Z,um:L}=ie;_e&&ku(_e),xe.stop(),G&&(G.active=!1,mt(Z,ie,ne,be)),L&&Zn(L,ne),Zn(()=>{ie.isUnmounted=!0},ne),ne&&ne.pendingBranch&&!ne.isUnmounted&&ie.asyncDep&&!ie.asyncResolved&&ie.suspenseId===ne.pendingId&&(ne.deps--,ne.deps===0&&ne.resolve())},Ie=(ie,ne,be,_e=!1,xe=!1,G=0)=>{for(let Z=G;Zie.shapeFlag&6?Be(ie.component.subTree):ie.shapeFlag&128?ie.suspense.next():v(ie.anchor||ie.el);let Ee=!1;const Ze=(ie,ne,be)=>{ie==null?ne._vnode&&mt(ne._vnode,null,null,!0):C(ne._vnode||null,ie,ne,null,null,null,be),Ee||(Ee=!0,r2(),Vp(),Ee=!1),ne._vnode=ie},Ke={p:C,um:mt,m:vt,r:bt,mt:oe,mc:P,pc:ve,pbc:w,n:Be,o:t};let Fe,at;return e&&([Fe,at]=e(Ke)),{render:Ze,hydrate:Fe,createApp:j5(Ze,Fe)}}function d0({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function Aa({effect:t,update:e},n){t.allowRecurse=e.allowRecurse=n}function D3(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function K1(t,e,n=!1){const r=t.children,i=e.children;if(We(r)&&We(i))for(let o=0;o>1,t[n[l]]0&&(e[r]=n[o-1]),n[o]=r)}}for(o=n.length,s=n[o-1];o-- >0;)n[o]=s,s=e[s];return n}function R3(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:R3(e)}const tR=t=>t.__isTeleport,uf=t=>t&&(t.disabled||t.disabled===""),m2=t=>typeof SVGElement<"u"&&t instanceof SVGElement,g2=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,zy=(t,e)=>{const n=t&&t.to;return xt(n)?e?e(n):null:n},nR={name:"Teleport",__isTeleport:!0,process(t,e,n,r,i,o,s,l,u,f){const{mc:d,pc:m,pbc:v,o:{insert:y,querySelector:_,createText:C,createComment:x}}=f,k=uf(e.props);let{shapeFlag:A,children:N,dynamicChildren:E}=e;if(t==null){const H=e.el=C(""),I=e.anchor=C("");y(H,n,r),y(I,n,r);const q=e.target=zy(e.props,_),P=e.targetAnchor=C("");q&&(y(P,q),s==="svg"||m2(q)?s="svg":(s==="mathml"||g2(q))&&(s="mathml"));const z=(w,R)=>{A&16&&d(N,w,R,i,o,s,l,u)};k?z(n,I):q&&z(q,P)}else{e.el=t.el;const H=e.anchor=t.anchor,I=e.target=t.target,q=e.targetAnchor=t.targetAnchor,P=uf(t.props),z=P?n:I,w=P?H:q;if(s==="svg"||m2(I)?s="svg":(s==="mathml"||g2(I))&&(s="mathml"),E?(v(t.dynamicChildren,E,z,i,o,s,l),K1(t,e,!0)):u||m(t,e,z,w,i,o,s,l,!1),k)P?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):Ih(e,n,H,f,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const R=e.target=zy(e.props,_);R&&Ih(e,R,null,f,0)}else P&&Ih(e,I,q,f,1)}B3(e)},remove(t,e,n,r,{um:i,o:{remove:o}},s){const{shapeFlag:l,children:u,anchor:f,targetAnchor:d,target:m,props:v}=t;if(m&&o(d),s&&o(f),l&16){const y=s||!uf(v);for(let _=0;_0?Br||bu:null,$3(),fl>0&&Br&&Br.push(t),t}function Se(t,e,n,r,i,o){return H3(ee(t,e,n,r,i,o,!0))}function Et(t,e,n,r,i){return H3(Qe(t,e,n,r,i,!0))}function ea(t){return t?t.__v_isVNode===!0:!1}function Ii(t,e){return t.type===e.type&&t.key===e.key}function iR(t){}const mg="__vInternal",F3=({key:t})=>t??null,bp=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?xt(t)||qn(t)||pt(t)?{i:On,r:t,k:e,f:!!n}:t:null);function ee(t,e=null,n=null,r=0,i=null,o=t===kt?0:1,s=!1,l=!1){const u={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&F3(e),ref:e&&bp(e),scopeId:cg,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:On};return l?(Y1(u,n),o&128&&t.normalize(u)):n&&(u.shapeFlag|=xt(n)?8:16),fl>0&&!s&&Br&&(u.patchFlag>0||o&6)&&u.patchFlag!==32&&Br.push(u),u}const Qe=oR;function oR(t,e=null,n=null,r=0,i=null,o=!1){if((!t||t===r3)&&(t=pr),ea(t)){const l=yo(t,e,!0);return n&&Y1(l,n),fl>0&&!o&&Br&&(l.shapeFlag&6?Br[Br.indexOf(t)]=l:Br.push(l)),l.patchFlag|=-2,l}if(pR(t)&&(t=t.__vccOpts),e){e=G1(e);let{class:l,style:u}=e;l&&!xt(l)&&(e.class=gt(l)),qt(u)&&(O1(u)&&!We(u)&&(u=Rt({},u)),e.style=oi(u))}const s=xt(t)?1:i3(t)?128:tR(t)?64:qt(t)?4:pt(t)?2:0;return ee(t,e,n,r,i,s,o,!0)}function G1(t){return t?O1(t)||mg in t?Rt({},t):t:null}function yo(t,e,n=!1){const{props:r,ref:i,patchFlag:o,children:s}=t,l=e?wi(r||{},e):r;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:l,key:l&&F3(l),ref:e&&e.ref?n&&i?We(i)?i.concat(bp(e)):[i,bp(e)]:bp(e):i,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:s,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==kt?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&yo(t.ssContent),ssFallback:t.ssFallback&&yo(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce}}function Ui(t=" ",e=0){return Qe(cl,null,t,e)}function sR(t,e){const n=Qe(el,null,t);return n.staticCount=e,n}function _t(t="",e=!1){return e?(ge(),Et(pr,null,t)):Qe(pr,null,t)}function ei(t){return t==null||typeof t=="boolean"?Qe(pr):We(t)?Qe(kt,null,t.slice()):typeof t=="object"?Ds(t):Qe(cl,null,String(t))}function Ds(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:yo(t)}function Y1(t,e){let n=0;const{shapeFlag:r}=t;if(e==null)e=null;else if(We(e))n=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),Y1(t,i()),i._c&&(i._d=!0));return}else{n=32;const i=e._;!i&&!(mg in e)?e._ctx=On:i===3&&On&&(On.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else pt(e)?(e={default:e,_ctx:On},n=32):(e=String(e),r&64?(n=16,e=[Ui(e)]):n=8);t.children=e,t.shapeFlag|=n}function wi(...t){const e={};for(let n=0;nBn||On;let qp,$y;{const t=x1(),e=(n,r)=>{let i;return(i=t[n])||(i=t[n]=[]),i.push(r),o=>{i.length>1?i.forEach(s=>s(o)):i[0](o)}};qp=e("__VUE_INSTANCE_SETTERS__",n=>Bn=n),$y=e("__VUE_SSR_SETTERS__",n=>wd=n)}const dl=t=>{const e=Bn;return qp(t),t.scope.on(),()=>{t.scope.off(),qp(e)}},Hy=()=>{Bn&&Bn.scope.off(),qp(null)};function j3(t){return t.vnode.shapeFlag&4}let wd=!1;function W3(t,e=!1){e&&$y(e);const{props:n,children:r}=t.vnode,i=j3(t);U5(t,n,i,e),G5(t,r);const o=i?uR(t,e):void 0;return e&&$y(!1),o}function uR(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=fa(new Proxy(t.ctx,Iy));const{setup:r}=n;if(r){const i=t.setupContext=r.length>1?K3(t):null,o=dl(t);ua();const s=mo(r,t,0,[t.props,i]);if(ca(),o(),w1(s)){if(s.then(Hy,Hy),e)return s.then(l=>{Fy(t,l,e)}).catch(l=>{Ol(l,t,0)});t.asyncDep=s}else Fy(t,s,e)}else q3(t,e)}function Fy(t,e,n){pt(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:qt(e)&&(t.setupState=N1(e)),q3(t,n)}let Kp,Vy;function U3(t){Kp=t,Vy=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,x5))}}const cR=()=>!Kp;function q3(t,e,n){const r=t.type;if(!t.render){if(!e&&Kp&&!r.render){const i=r.template||U1(t).template;if(i){const{isCustomElement:o,compilerOptions:s}=t.appContext.config,{delimiters:l,compilerOptions:u}=r,f=Rt(Rt({isCustomElement:o,delimiters:l},s),u);r.render=Kp(i,f)}}t.render=r.render||An,Vy&&Vy(t)}{const i=dl(t);ua();try{z5(t)}finally{ca(),i()}}}function fR(t){return t.attrsProxy||(t.attrsProxy=new Proxy(t.attrs,{get(e,n){return Wr(t,"get","$attrs"),e[n]}}))}function K3(t){const e=n=>{t.exposed=n||{}};return{get attrs(){return fR(t)},slots:t.slots,emit:t.emit,expose:e}}function gg(t){if(t.exposed)return t.exposeProxy||(t.exposeProxy=new Proxy(N1(fa(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in af)return af[n](t)},has(e,n){return n in e||n in af}}))}const dR=/(?:^|[-_])(\w)/g,hR=t=>t.replace(dR,e=>e.toUpperCase()).replace(/[-_]/g,"");function Gp(t,e=!0){return pt(t)?t.displayName||t.name:t.name||e&&t.__name}function G3(t,e,n=!1){let r=Gp(e);if(!r&&e.__file){const i=e.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&t&&t.parent){const i=o=>{for(const s in o)if(o[s]===e)return s};r=i(t.components||t.parent.type.components)||i(t.appContext.components)}return r?hR(r):n?"App":"Anonymous"}function pR(t){return pt(t)&&"__vccOpts"in t}const er=(t,e)=>DD(t,e,wd);function mR(t,e,n=Ft){const r=qi(),i=bn(e),o=ni(e),s=I1((u,f)=>{let d;return c3(()=>{const m=t[e];ji(d,m)&&(d=m,f())}),{get(){return u(),n.get?n.get(d):d},set(m){const v=r.vnode.props;!(v&&(e in v||i in v||o in v)&&(`onUpdate:${e}`in v||`onUpdate:${i}`in v||`onUpdate:${o}`in v))&&ji(m,d)&&(d=m,f()),r.emit(`update:${e}`,n.set?n.set(m):m)}}}),l=e==="modelValue"?"modelModifiers":`${e}Modifiers`;return s[Symbol.iterator]=()=>{let u=0;return{next(){return u<2?{value:u++?t[l]||{}:s,done:!1}:{done:!0}}}},s}function Hr(t,e,n){const r=arguments.length;return r===2?qt(e)&&!We(e)?ea(e)?Qe(t,null,[e]):Qe(t,e):Qe(t,null,e):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&ea(n)&&(n=[n]),Qe(t,e,n))}function gR(){}function vR(t,e,n,r){const i=n[r];if(i&&Y3(i,t))return i;const o=e();return o.memo=t.slice(),n[r]=o}function Y3(t,e){const n=t.memo;if(n.length!=e.length)return!1;for(let r=0;r0&&Br&&Br.push(t),!0}const J3="3.4.15",yR=An,bR=QD,_R=su,wR=t3,kR={createComponentInstance:V3,setupComponent:W3,renderComponentRoot:yp,setCurrentRenderingInstance:Vf,isVNode:ea,normalizeVNode:ei},xR=kR,SR=null,CR=null,TR=null;/** -* @vue/runtime-dom v3.4.15 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/const ER="http://www.w3.org/2000/svg",AR="http://www.w3.org/1998/Math/MathML",Rs=typeof document<"u"?document:null,v2=Rs&&Rs.createElement("template"),OR={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,r)=>{const i=e==="svg"?Rs.createElementNS(ER,t):e==="mathml"?Rs.createElementNS(AR,t):Rs.createElement(t,n?{is:n}:void 0);return t==="select"&&r&&r.multiple!=null&&i.setAttribute("multiple",r.multiple),i},createText:t=>Rs.createTextNode(t),createComment:t=>Rs.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Rs.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,r,i,o){const s=n?n.previousSibling:e.lastChild;if(i&&(i===o||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),n),!(i===o||!(i=i.nextSibling)););else{v2.innerHTML=r==="svg"?`${t}`:r==="mathml"?`${t}`:t;const l=v2.content;if(r==="svg"||r==="mathml"){const u=l.firstChild;for(;u.firstChild;)l.appendChild(u.firstChild);l.removeChild(u)}e.insertBefore(l,n)}return[s?s.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},Ss="transition",Uc="animation",Ru=Symbol("_vtc"),zu=(t,{slots:e})=>Hr(d3,Z3(t),e);zu.displayName="Transition";const X3={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},MR=zu.props=Rt({},j1,X3),Oa=(t,e=[])=>{We(t)?t.forEach(n=>n(...e)):t&&t(...e)},y2=t=>t?We(t)?t.some(e=>e.length>1):t.length>1:!1;function Z3(t){const e={};for(const U in t)U in X3||(e[U]=t[U]);if(t.css===!1)return e;const{name:n="v",type:r,duration:i,enterFromClass:o=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:u=o,appearActiveClass:f=s,appearToClass:d=l,leaveFromClass:m=`${n}-leave-from`,leaveActiveClass:v=`${n}-leave-active`,leaveToClass:y=`${n}-leave-to`}=t,_=LR(i),C=_&&_[0],x=_&&_[1],{onBeforeEnter:k,onEnter:A,onEnterCancelled:N,onLeave:E,onLeaveCancelled:H,onBeforeAppear:I=k,onAppear:q=A,onAppearCancelled:P=N}=e,z=(U,K,oe)=>{Os(U,K?d:l),Os(U,K?f:s),oe&&oe()},w=(U,K)=>{U._isLeaving=!1,Os(U,m),Os(U,y),Os(U,v),K&&K()},R=U=>(K,oe)=>{const D=U?q:A,ae=()=>z(K,U,oe);Oa(D,[K,ae]),b2(()=>{Os(K,U?u:o),Io(K,U?d:l),y2(D)||_2(K,r,C,ae)})};return Rt(e,{onBeforeEnter(U){Oa(k,[U]),Io(U,o),Io(U,s)},onBeforeAppear(U){Oa(I,[U]),Io(U,u),Io(U,f)},onEnter:R(!1),onAppear:R(!0),onLeave(U,K){U._isLeaving=!0;const oe=()=>w(U,K);Io(U,m),eO(),Io(U,v),b2(()=>{U._isLeaving&&(Os(U,m),Io(U,y),y2(E)||_2(U,r,x,oe))}),Oa(E,[U,oe])},onEnterCancelled(U){z(U,!1),Oa(N,[U])},onAppearCancelled(U){z(U,!0),Oa(P,[U])},onLeaveCancelled(U){w(U),Oa(H,[U])}})}function LR(t){if(t==null)return null;if(qt(t))return[h0(t.enter),h0(t.leave)];{const e=h0(t);return[e,e]}}function h0(t){return Bp(t)}function Io(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[Ru]||(t[Ru]=new Set)).add(e)}function Os(t,e){e.split(/\s+/).forEach(r=>r&&t.classList.remove(r));const n=t[Ru];n&&(n.delete(e),n.size||(t[Ru]=void 0))}function b2(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let NR=0;function _2(t,e,n,r){const i=t._endId=++NR,o=()=>{i===t._endId&&r()};if(n)return setTimeout(o,n);const{type:s,timeout:l,propCount:u}=Q3(t,e);if(!s)return r();const f=s+"end";let d=0;const m=()=>{t.removeEventListener(f,v),o()},v=y=>{y.target===t&&++d>=u&&m()};setTimeout(()=>{d(n[_]||"").split(", "),i=r(`${Ss}Delay`),o=r(`${Ss}Duration`),s=w2(i,o),l=r(`${Uc}Delay`),u=r(`${Uc}Duration`),f=w2(l,u);let d=null,m=0,v=0;e===Ss?s>0&&(d=Ss,m=s,v=o.length):e===Uc?f>0&&(d=Uc,m=f,v=u.length):(m=Math.max(s,f),d=m>0?s>f?Ss:Uc:null,v=d?d===Ss?o.length:u.length:0);const y=d===Ss&&/\b(transform|all)(,|$)/.test(r(`${Ss}Property`).toString());return{type:d,timeout:m,propCount:v,hasTransform:y}}function w2(t,e){for(;t.lengthk2(n)+k2(t[r])))}function k2(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function eO(){return document.body.offsetHeight}function IR(t,e,n){const r=t[Ru];r&&(e=(e?[e,...r]:[...r]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const J1=Symbol("_vod"),Bu={beforeMount(t,{value:e},{transition:n}){t[J1]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):qc(t,e)},mounted(t,{value:e},{transition:n}){n&&e&&n.enter(t)},updated(t,{value:e,oldValue:n},{transition:r}){!e!=!n&&(r?e?(r.beforeEnter(t),qc(t,!0),r.enter(t)):r.leave(t,()=>{qc(t,!1)}):qc(t,e))},beforeUnmount(t,{value:e}){qc(t,e)}};function qc(t,e){t.style.display=e?t[J1]:"none"}function PR(){Bu.getSSRProps=({value:t})=>{if(!t)return{style:{display:"none"}}}}const tO=Symbol("");function DR(t){const e=qi();if(!e)return;const n=e.ut=(i=t(e.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${e.uid}"]`)).forEach(o=>Wy(o,i))},r=()=>{const i=t(e.proxy);jy(e.subTree,i),n(i)};u3(r),ts(()=>{const i=new MutationObserver(r);i.observe(e.subTree.el.parentNode,{childList:!0}),pg(()=>i.disconnect())})}function jy(t,e){if(t.shapeFlag&128){const n=t.suspense;t=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{jy(n.activeBranch,e)})}for(;t.component;)t=t.component.subTree;if(t.shapeFlag&1&&t.el)Wy(t.el,e);else if(t.type===kt)t.children.forEach(n=>jy(n,e));else if(t.type===el){let{el:n,anchor:r}=t;for(;n&&(Wy(n,e),n!==r);)n=n.nextSibling}}function Wy(t,e){if(t.nodeType===1){const n=t.style;let r="";for(const i in e)n.setProperty(`--${i}`,e[i]),r+=`--${i}: ${e[i]};`;n[tO]=r}}function RR(t,e,n){const r=t.style,i=r.display,o=xt(n);if(n&&!o){if(e&&!xt(e))for(const s in e)n[s]==null&&Uy(r,s,"");for(const s in n)Uy(r,s,n[s])}else if(o){if(e!==n){const s=r[tO];s&&(n+=";"+s),r.cssText=n}}else e&&t.removeAttribute("style");J1 in t&&(r.display=i)}const x2=/\s*!important$/;function Uy(t,e,n){if(We(n))n.forEach(r=>Uy(t,e,r));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const r=zR(t,e);x2.test(n)?t.setProperty(ni(r),n.replace(x2,""),"important"):t[r]=n}}const S2=["Webkit","Moz","ms"],p0={};function zR(t,e){const n=p0[e];if(n)return n;let r=bn(e);if(r!=="filter"&&r in t)return p0[e]=r;r=El(r);for(let i=0;im0||(jR.then(()=>m0=0),m0=Date.now());function UR(t,e){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;si(qR(r,n.value),e,5,[r])};return n.value=t,n.attached=WR(),n}function qR(t,e){if(We(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(r=>i=>!i._stopped&&r&&r(i))}else return e}const A2=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,KR=(t,e,n,r,i,o,s,l,u)=>{const f=i==="svg";e==="class"?IR(t,r,f):e==="style"?RR(t,n,r):Cl(e)?b1(e)||FR(t,e,n,r,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):GR(t,e,r,f))?$R(t,e,r,o,s,l,u):(e==="true-value"?t._trueValue=r:e==="false-value"&&(t._falseValue=r),BR(t,e,r,f))};function GR(t,e,n,r){if(r)return!!(e==="innerHTML"||e==="textContent"||e in t&&A2(e)&&pt(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const i=t.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return A2(e)&&xt(n)?!1:e in t}/*! #__NO_SIDE_EFFECTS__ */function nO(t,e){const n=Vn(t);class r extends vg{constructor(o){super(n,o,e)}}return r.def=n,r}/*! #__NO_SIDE_EFFECTS__ */const YR=t=>nO(t,dO),JR=typeof HTMLElement<"u"?HTMLElement:class{};class vg extends JR{constructor(e,n={},r){super(),this._def=e,this._props=n,this._instance=null,this._connected=!1,this._resolved=!1,this._numberProps=null,this._ob=null,this.shadowRoot&&r?r(this._createVNode(),this.shadowRoot):(this.attachShadow({mode:"open"}),this._def.__asyncLoader||this._resolveProps(this._def))}connectedCallback(){this._connected=!0,this._instance||(this._resolved?this._update():this._resolveDef())}disconnectedCallback(){this._connected=!1,this._ob&&(this._ob.disconnect(),this._ob=null),Ri(()=>{this._connected||(qy(null,this.shadowRoot),this._instance=null)})}_resolveDef(){this._resolved=!0;for(let r=0;r{for(const i of r)this._setAttr(i.attributeName)}),this._ob.observe(this,{attributes:!0});const e=(r,i=!1)=>{const{props:o,styles:s}=r;let l;if(o&&!We(o))for(const u in o){const f=o[u];(f===Number||f&&f.type===Number)&&(u in this._props&&(this._props[u]=Bp(this._props[u])),(l||(l=Object.create(null)))[bn(u)]=!0)}this._numberProps=l,i&&this._resolveProps(r),this._applyStyles(s),this._update()},n=this._def.__asyncLoader;n?n().then(r=>e(r,!0)):e(this._def)}_resolveProps(e){const{props:n}=e,r=We(n)?n:Object.keys(n||{});for(const i of Object.keys(this))i[0]!=="_"&&r.includes(i)&&this._setProp(i,this[i],!0,!1);for(const i of r.map(bn))Object.defineProperty(this,i,{get(){return this._getProp(i)},set(o){this._setProp(i,o)}})}_setAttr(e){let n=this.getAttribute(e);const r=bn(e);this._numberProps&&this._numberProps[r]&&(n=Bp(n)),this._setProp(r,n,!1)}_getProp(e){return this._props[e]}_setProp(e,n,r=!0,i=!0){n!==this._props[e]&&(this._props[e]=n,i&&this._instance&&this._update(),r&&(n===!0?this.setAttribute(ni(e),""):typeof n=="string"||typeof n=="number"?this.setAttribute(ni(e),n+""):n||this.removeAttribute(ni(e))))}_update(){qy(this._createVNode(),this.shadowRoot)}_createVNode(){const e=Qe(this._def,Rt({},this._props));return this._instance||(e.ce=n=>{this._instance=n,n.isCE=!0;const r=(o,s)=>{this.dispatchEvent(new CustomEvent(o,{detail:s}))};n.emit=(o,...s)=>{r(o,s),ni(o)!==o&&r(ni(o),s)};let i=this;for(;i=i&&(i.parentNode||i.host);)if(i instanceof vg){n.parent=i._instance,n.provides=i._instance.provides;break}}),e}_applyStyles(e){e&&e.forEach(n=>{const r=document.createElement("style");r.textContent=n,this.shadowRoot.appendChild(r)})}}function XR(t="$style"){{const e=qi();if(!e)return Ft;const n=e.type.__cssModules;if(!n)return Ft;const r=n[t];return r||Ft}}const rO=new WeakMap,iO=new WeakMap,Yp=Symbol("_moveCb"),O2=Symbol("_enterCb"),oO={name:"TransitionGroup",props:Rt({},MR,{tag:String,moveClass:String}),setup(t,{slots:e}){const n=qi(),r=V1();let i,o;return hg(()=>{if(!i.length)return;const s=t.moveClass||`${t.name||"v"}-move`;if(!r8(i[0].el,n.vnode.el,s))return;i.forEach(e8),i.forEach(t8);const l=i.filter(n8);eO(),l.forEach(u=>{const f=u.el,d=f.style;Io(f,s),d.transform=d.webkitTransform=d.transitionDuration="";const m=f[Yp]=v=>{v&&v.target!==f||(!v||/transform$/.test(v.propertyName))&&(f.removeEventListener("transitionend",m),f[Yp]=null,Os(f,s))};f.addEventListener("transitionend",m)})}),()=>{const s=Mt(t),l=Z3(s);let u=s.tag||kt;i=o,o=e.default?fg(e.default()):[];for(let f=0;fdelete t.mode;oO.props;const QR=oO;function e8(t){const e=t.el;e[Yp]&&e[Yp](),e[O2]&&e[O2]()}function t8(t){iO.set(t,t.el.getBoundingClientRect())}function n8(t){const e=rO.get(t),n=iO.get(t),r=e.left-n.left,i=e.top-n.top;if(r||i){const o=t.el.style;return o.transform=o.webkitTransform=`translate(${r}px,${i}px)`,o.transitionDuration="0s",t}}function r8(t,e,n){const r=t.cloneNode(),i=t[Ru];i&&i.forEach(l=>{l.split(/\s+/).forEach(u=>u&&r.classList.remove(u))}),n.split(/\s+/).forEach(l=>l&&r.classList.add(l)),r.style.display="none";const o=e.nodeType===1?e:e.parentNode;o.appendChild(r);const{hasTransform:s}=Q3(r);return o.removeChild(r),s}const ta=t=>{const e=t.props["onUpdate:modelValue"]||!1;return We(e)?n=>ku(e,n):e};function i8(t){t.target.composing=!0}function M2(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const bi=Symbol("_assign"),Mn={created(t,{modifiers:{lazy:e,trim:n,number:r}},i){t[bi]=ta(i);const o=r||i.props&&i.props.type==="number";Bo(t,e?"change":"input",s=>{if(s.target.composing)return;let l=t.value;n&&(l=l.trim()),o&&(l=zf(l)),t[bi](l)}),n&&Bo(t,"change",()=>{t.value=t.value.trim()}),e||(Bo(t,"compositionstart",i8),Bo(t,"compositionend",M2),Bo(t,"change",M2))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,modifiers:{lazy:n,trim:r,number:i}},o){if(t[bi]=ta(o),t.composing)return;const s=i||t.type==="number"?zf(t.value):t.value,l=e??"";s!==l&&(document.activeElement===t&&t.type!=="range"&&(n||r&&t.value.trim()===l)||(t.value=l))}},kd={deep:!0,created(t,e,n){t[bi]=ta(n),Bo(t,"change",()=>{const r=t._modelValue,i=$u(t),o=t.checked,s=t[bi];if(We(r)){const l=ig(r,i),u=l!==-1;if(o&&!u)s(r.concat(i));else if(!o&&u){const f=[...r];f.splice(l,1),s(f)}}else if(Tl(r)){const l=new Set(r);o?l.add(i):l.delete(i),s(l)}else s(sO(t,o))})},mounted:L2,beforeUpdate(t,e,n){t[bi]=ta(n),L2(t,e,n)}};function L2(t,{value:e,oldValue:n},r){t._modelValue=e,We(e)?t.checked=ig(e,r.props.value)>-1:Tl(e)?t.checked=e.has(r.props.value):e!==n&&(t.checked=qo(e,sO(t,!0)))}const X1={created(t,{value:e},n){t.checked=qo(e,n.props.value),t[bi]=ta(n),Bo(t,"change",()=>{t[bi]($u(t))})},beforeUpdate(t,{value:e,oldValue:n},r){t[bi]=ta(r),e!==n&&(t.checked=qo(e,r.props.value))}},Z1={deep:!0,created(t,{value:e,modifiers:{number:n}},r){const i=Tl(e);Bo(t,"change",()=>{const o=Array.prototype.filter.call(t.options,s=>s.selected).map(s=>n?zf($u(s)):$u(s));t[bi](t.multiple?i?new Set(o):o:o[0]),t._assigning=!0,Ri(()=>{t._assigning=!1})}),t[bi]=ta(r)},mounted(t,{value:e,oldValue:n,modifiers:{number:r}}){N2(t,e,n,r)},beforeUpdate(t,e,n){t[bi]=ta(n)},updated(t,{value:e,oldValue:n,modifiers:{number:r}}){t._assigning||N2(t,e,n,r)}};function N2(t,e,n,r){const i=t.multiple,o=We(e);if(!(i&&!o&&!Tl(e))&&!(o&&qo(e,n))){for(let s=0,l=t.options.length;s-1}else u.selected=e.has(f);else if(qo($u(u),e)){t.selectedIndex!==s&&(t.selectedIndex=s);return}}!i&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function $u(t){return"_value"in t?t._value:t.value}function sO(t,e){const n=e?"_trueValue":"_falseValue";return n in t?t[n]:e}const aO={created(t,e,n){Ph(t,e,n,null,"created")},mounted(t,e,n){Ph(t,e,n,null,"mounted")},beforeUpdate(t,e,n,r){Ph(t,e,n,r,"beforeUpdate")},updated(t,e,n,r){Ph(t,e,n,r,"updated")}};function lO(t,e){switch(t){case"SELECT":return Z1;case"TEXTAREA":return Mn;default:switch(e){case"checkbox":return kd;case"radio":return X1;default:return Mn}}}function Ph(t,e,n,r,i){const s=lO(t.tagName,n.props&&n.props.type)[i];s&&s(t,e,n,r)}function o8(){Mn.getSSRProps=({value:t})=>({value:t}),X1.getSSRProps=({value:t},e)=>{if(e.props&&qo(e.props.value,t))return{checked:!0}},kd.getSSRProps=({value:t},e)=>{if(We(t)){if(e.props&&ig(t,e.props.value)>-1)return{checked:!0}}else if(Tl(t)){if(e.props&&t.has(e.props.value))return{checked:!0}}else if(t)return{checked:!0}},aO.getSSRProps=(t,e)=>{if(typeof e.type!="string")return;const n=lO(e.type.toUpperCase(),e.props&&e.props.type);if(n.getSSRProps)return n.getSSRProps(t,e)}}const s8=["ctrl","shift","alt","meta"],a8={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>s8.some(n=>t[`${n}Key`]&&!e.includes(n))},lt=(t,e)=>{const n=t._withMods||(t._withMods={}),r=e.join(".");return n[r]||(n[r]=(i,...o)=>{for(let s=0;s{const n=t._withKeys||(t._withKeys={}),r=e.join(".");return n[r]||(n[r]=i=>{if(!("key"in i))return;const o=ni(i.key);if(e.some(s=>s===o||l8[s]===o))return t(i)})},uO=Rt({patchProp:KR},OR);let ff,I2=!1;function cO(){return ff||(ff=N3(uO))}function fO(){return ff=I2?ff:I3(uO),I2=!0,ff}const qy=(...t)=>{cO().render(...t)},dO=(...t)=>{fO().hydrate(...t)},Q1=(...t)=>{const e=cO().createApp(...t),{mount:n}=e;return e.mount=r=>{const i=pO(r);if(!i)return;const o=e._component;!pt(o)&&!o.render&&!o.template&&(o.template=i.innerHTML),i.innerHTML="";const s=n(i,!1,hO(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),s},e},u8=(...t)=>{const e=fO().createApp(...t),{mount:n}=e;return e.mount=r=>{const i=pO(r);if(i)return n(i,!0,hO(i))},e};function hO(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function pO(t){return xt(t)?document.querySelector(t):t}let P2=!1;const c8=()=>{P2||(P2=!0,o8(),PR())},f8=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:d3,BaseTransitionPropsValidators:j1,Comment:pr,DeprecationTypes:TR,EffectScope:S1,ErrorCodes:ZD,ErrorTypeStrings:bR,Fragment:kt,KeepAlive:w5,ReactiveEffect:Pu,Static:el,Suspense:f5,Teleport:z3,Text:cl,TrackOpTypes:UD,Transition:zu,TransitionGroup:QR,TriggerOpTypes:qD,VueElement:vg,assertNumber:XD,callWithAsyncErrorHandling:si,callWithErrorHandling:mo,camelize:bn,capitalize:El,cloneVNode:yo,compatUtils:CR,computed:er,createApp:Q1,createBlock:Et,createCommentVNode:_t,createElementBlock:Se,createElementVNode:ee,createHydrationRenderer:I3,createPropsRestProxy:D5,createRenderer:N3,createSSRApp:u8,createSlots:W1,createStaticVNode:sR,createTextVNode:Ui,createVNode:Qe,customRef:I1,defineAsyncComponent:b5,defineComponent:Vn,defineCustomElement:nO,defineEmits:C5,defineExpose:T5,defineModel:O5,defineOptions:E5,defineProps:S5,defineSSRCustomElement:YR,defineSlots:A5,devtools:_R,effect:hD,effectScope:cD,getCurrentInstance:qi,getCurrentScope:NA,getTransitionRawChildren:fg,guardReactiveProps:G1,h:Hr,handleError:Ol,hasInjectionContext:W5,hydrate:dO,initCustomFormatter:gR,initDirectivesForSSR:c8,inject:lf,isMemoSame:Y3,isProxy:O1,isReactive:Za,isReadonly:ll,isRef:qn,isRuntimeOnly:cR,isShallow:Bf,isVNode:ea,markRaw:fa,mergeDefaults:I5,mergeModels:P5,mergeProps:wi,nextTick:Ri,normalizeClass:gt,normalizeProps:AA,normalizeStyle:oi,onActivated:p3,onBeforeMount:v3,onBeforeUnmount:Ml,onBeforeUpdate:y3,onDeactivated:m3,onErrorCaptured:k3,onMounted:ts,onRenderTracked:w3,onRenderTriggered:_3,onScopeDispose:fD,onServerPrefetch:b3,onUnmounted:pg,onUpdated:hg,openBlock:ge,popScopeId:R1,provide:Wp,proxyRefs:N1,pushScopeId:D1,queuePostFlushCb:Fp,reactive:Al,readonly:A1,ref:Ot,registerRuntimeCompiler:U3,render:qy,renderList:Zt,renderSlot:pn,resolveComponent:ut,resolveDirective:sc,resolveDynamicComponent:Qs,resolveFilter:SR,resolveTransitionHooks:Du,setBlockTracking:By,setDevtoolsHook:wR,setTransitionHooks:ul,shallowReactive:Hp,shallowReadonly:PD,shallowRef:GA,ssrContextKey:s3,ssrUtils:xR,stop:pD,toDisplayString:Ne,toHandlerKey:wu,toHandlers:Ly,toRaw:Mt,toRef:WD,toRefs:FD,toValue:BD,transformVNodeArgs:iR,triggerRef:zD,unref:fr,useAttrs:N5,useCssModule:XR,useCssVars:DR,useModel:mR,useSSRContext:a3,useSlots:L5,useTransitionState:V1,vModelCheckbox:kd,vModelDynamic:aO,vModelRadio:X1,vModelSelect:Z1,vModelText:Mn,vShow:Bu,version:J3,warn:yR,watch:En,watchEffect:l3,watchPostEffect:u3,watchSyncEffect:c3,withAsyncContext:R5,withCtx:Vt,withDefaults:M5,withDirectives:Ut,withKeys:Tu,withMemo:vR,withModifiers:lt,withScopeId:z1},Symbol.toStringTag,{value:"Module"}));/** -* @vue/compiler-core v3.4.15 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/const qf=Symbol(""),df=Symbol(""),e_=Symbol(""),Jp=Symbol(""),mO=Symbol(""),hl=Symbol(""),gO=Symbol(""),vO=Symbol(""),t_=Symbol(""),n_=Symbol(""),xd=Symbol(""),r_=Symbol(""),yO=Symbol(""),i_=Symbol(""),o_=Symbol(""),s_=Symbol(""),a_=Symbol(""),l_=Symbol(""),u_=Symbol(""),bO=Symbol(""),_O=Symbol(""),yg=Symbol(""),Xp=Symbol(""),c_=Symbol(""),f_=Symbol(""),Kf=Symbol(""),Sd=Symbol(""),d_=Symbol(""),Ky=Symbol(""),d8=Symbol(""),Gy=Symbol(""),Zp=Symbol(""),h8=Symbol(""),p8=Symbol(""),h_=Symbol(""),m8=Symbol(""),g8=Symbol(""),p_=Symbol(""),wO=Symbol(""),Hu={[qf]:"Fragment",[df]:"Teleport",[e_]:"Suspense",[Jp]:"KeepAlive",[mO]:"BaseTransition",[hl]:"openBlock",[gO]:"createBlock",[vO]:"createElementBlock",[t_]:"createVNode",[n_]:"createElementVNode",[xd]:"createCommentVNode",[r_]:"createTextVNode",[yO]:"createStaticVNode",[i_]:"resolveComponent",[o_]:"resolveDynamicComponent",[s_]:"resolveDirective",[a_]:"resolveFilter",[l_]:"withDirectives",[u_]:"renderList",[bO]:"renderSlot",[_O]:"createSlots",[yg]:"toDisplayString",[Xp]:"mergeProps",[c_]:"normalizeClass",[f_]:"normalizeStyle",[Kf]:"normalizeProps",[Sd]:"guardReactiveProps",[d_]:"toHandlers",[Ky]:"camelize",[d8]:"capitalize",[Gy]:"toHandlerKey",[Zp]:"setBlockTracking",[h8]:"pushScopeId",[p8]:"popScopeId",[h_]:"withCtx",[m8]:"unref",[g8]:"isRef",[p_]:"withMemo",[wO]:"isMemoSame"};function v8(t){Object.getOwnPropertySymbols(t).forEach(e=>{Hu[e]=t[e]})}const li={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function y8(t,e=""){return{type:0,source:e,children:t,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:0,temps:0,codegenNode:void 0,loc:li}}function Gf(t,e,n,r,i,o,s,l=!1,u=!1,f=!1,d=li){return t&&(l?(t.helper(hl),t.helper(ju(t.inSSR,f))):t.helper(Vu(t.inSSR,f)),s&&t.helper(l_)),{type:13,tag:e,props:n,children:r,patchFlag:i,dynamicProps:o,directives:s,isBlock:l,disableTracking:u,isComponent:f,loc:d}}function Cd(t,e=li){return{type:17,loc:e,elements:t}}function vi(t,e=li){return{type:15,loc:e,properties:t}}function yn(t,e){return{type:16,loc:li,key:xt(t)?Tt(t,!0):t,value:e}}function Tt(t,e=!1,n=li,r=0){return{type:4,loc:n,content:t,isStatic:e,constType:e?3:r}}function $i(t,e=li){return{type:8,loc:e,children:t}}function zn(t,e=[],n=li){return{type:14,loc:n,callee:t,arguments:e}}function Fu(t,e=void 0,n=!1,r=!1,i=li){return{type:18,params:t,returns:e,newline:n,isSlot:r,loc:i}}function Yy(t,e,n,r=!0){return{type:19,test:t,consequent:e,alternate:n,newline:r,loc:li}}function b8(t,e,n=!1){return{type:20,index:t,value:e,isVNode:n,loc:li}}function _8(t){return{type:21,body:t,loc:li}}function Vu(t,e){return t||e?t_:n_}function ju(t,e){return t||e?gO:vO}function m_(t,{helper:e,removeHelper:n,inSSR:r}){t.isBlock||(t.isBlock=!0,n(Vu(r,t.isComponent)),e(hl),e(ju(r,t.isComponent)))}const D2=new Uint8Array([123,123]),R2=new Uint8Array([125,125]);function z2(t){return t>=97&&t<=122||t>=65&&t<=90}function Qr(t){return t===32||t===10||t===9||t===12||t===13}function Cs(t){return t===47||t===62||Qr(t)}function Qp(t){const e=new Uint8Array(t.length);for(let n=0;n=0;i--){const o=this.newlines[i];if(e>o){n=i+2,r=e-o;break}}return{column:r,line:n,offset:e}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(e){e===60?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):!this.inVPre&&e===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(e))}stateInterpolationOpen(e){if(e===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const n=this.index+1-this.delimiterOpen.length;n>this.sectionStart&&this.cbs.ontext(this.sectionStart,n),this.state=3,this.sectionStart=n}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(e)):(this.state=1,this.stateText(e))}stateInterpolation(e){e===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(e))}stateInterpolationClose(e){e===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(e))}stateSpecialStartSequence(e){const n=this.sequenceIndex===this.currentSequence.length;if(!(n?Cs(e):(e|32)===this.currentSequence[this.sequenceIndex]))this.inRCDATA=!1;else if(!n){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=6,this.stateInTagName(e)}stateInRCDATA(e){if(this.sequenceIndex===this.currentSequence.length){if(e===62||Qr(e)){const n=this.index-this.currentSequence.length;if(this.sectionStart=e||(this.state===28?this.currentSequence===lr.CdataEnd?this.cbs.oncdata(this.sectionStart,e):this.cbs.oncomment(this.sectionStart,e):this.state===6||this.state===11||this.state===18||this.state===17||this.state===12||this.state===13||this.state===14||this.state===15||this.state===16||this.state===20||this.state===19||this.state===21||this.state===9||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,n){}}function B2(t,{compatConfig:e}){const n=e&&e[t];return t==="MODE"?n||3:n}function tl(t,e){const n=B2("MODE",e),r=B2(t,e);return n===3?r===!0:r!==!1}function Yf(t,e,n,...r){return tl(t,e)}function g_(t){throw t}function kO(t){}function an(t,e,n,r){const i=`https://vuejs.org/error-reference/#compiler-${t}`,o=new SyntaxError(String(i));return o.code=t,o.loc=e,o}const $r=t=>t.type===4&&t.isStatic;function xO(t){switch(t){case"Teleport":case"teleport":return df;case"Suspense":case"suspense":return e_;case"KeepAlive":case"keep-alive":return Jp;case"BaseTransition":case"base-transition":return mO}}const k8=/^\d|[^\$\w]/,v_=t=>!k8.test(t),x8=/[A-Za-z_$\xA0-\uFFFF]/,S8=/[\.\?\w$\xA0-\uFFFF]/,C8=/\s+[.[]\s*|\s*[.[]\s+/g,T8=t=>{t=t.trim().replace(C8,s=>s.trim());let e=0,n=[],r=0,i=0,o=null;for(let s=0;se.type===7&&e.name==="bind"&&(!e.arg||e.arg.type!==4||!e.arg.isStatic))}function g0(t){return t.type===5||t.type===2}function A8(t){return t.type===7&&t.name==="slot"}function em(t){return t.type===1&&t.tagType===3}function tm(t){return t.type===1&&t.tagType===2}const O8=new Set([Kf,Sd]);function CO(t,e=[]){if(t&&!xt(t)&&t.type===14){const n=t.callee;if(!xt(n)&&O8.has(n))return CO(t.arguments[0],e.concat(t))}return[t,e]}function nm(t,e,n){let r,i=t.type===13?t.props:t.arguments[2],o=[],s;if(i&&!xt(i)&&i.type===14){const l=CO(i);i=l[0],o=l[1],s=o[o.length-1]}if(i==null||xt(i))r=vi([e]);else if(i.type===14){const l=i.arguments[0];!xt(l)&&l.type===15?$2(e,l)||l.properties.unshift(e):i.callee===d_?r=zn(n.helper(Xp),[vi([e]),i]):i.arguments.unshift(vi([e])),!r&&(r=i)}else i.type===15?($2(e,i)||i.properties.unshift(e),r=i):(r=zn(n.helper(Xp),[vi([e]),i]),s&&s.callee===Sd&&(s=o[o.length-2]));t.type===13?s?s.arguments[0]=r:t.props=r:s?s.arguments[0]=r:t.arguments[2]=r}function $2(t,e){let n=!1;if(t.key.type===4){const r=t.key.content;n=e.properties.some(i=>i.key.type===4&&i.key.content===r)}return n}function Jf(t,e){return`_${e}_${t.replace(/[^\w]/g,(n,r)=>n==="-"?"_":t.charCodeAt(r).toString())}`}function M8(t){return t.type===14&&t.callee===p_?t.arguments[1].returns:t}const L8=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,TO={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:vp,isPreTag:vp,isCustomElement:vp,onError:g_,onWarn:kO,comments:!1,prefixIdentifiers:!1};let jt=TO,Xf=null,nl="",cr=null,Lt=null,Ir="",Po=-1,Na=-1,rm=0,zs=!1,Jy=null;const hn=[],gn=new w8(hn,{onerr:No,ontext(t,e){Dh(Jn(t,e),t,e)},ontextentity(t,e,n){Dh(t,e,n)},oninterpolation(t,e){if(zs)return Dh(Jn(t,e),t,e);let n=t+gn.delimiterOpen.length,r=e-gn.delimiterClose.length;for(;Qr(nl.charCodeAt(n));)n++;for(;Qr(nl.charCodeAt(r-1));)r--;let i=Jn(n,r);i.includes("&")&&(i=jt.decodeEntities(i,!1)),Xy({type:5,content:wp(i,!1,Rn(n,r)),loc:Rn(t,e)})},onopentagname(t,e){const n=Jn(t,e);cr={type:1,tag:n,ns:jt.getNamespace(n,hn[0],jt.ns),tagType:0,props:[],children:[],loc:Rn(t-1,e),codegenNode:void 0}},onopentagend(t){F2(t)},onclosetag(t,e){const n=Jn(t,e);if(!jt.isVoidTag(n)){let r=!1;for(let i=0;i0&&No(24,hn[0].loc.start.offset);for(let s=0;s<=i;s++){const l=hn.shift();_p(l,e,s(r.type===7?r.rawName:r.name)===n)&&No(2,e)},onattribend(t,e){if(cr&&Lt){if(ja(Lt.loc,e),t!==0)if(Ir.includes("&")&&(Ir=jt.decodeEntities(Ir,!0)),Lt.type===6)Lt.name==="class"&&(Ir=OO(Ir).trim()),t===1&&!Ir&&No(13,e),Lt.value={type:2,content:Ir,loc:t===1?Rn(Po,Na):Rn(Po-1,Na+1)},gn.inSFCRoot&&cr.tag==="template"&&Lt.name==="lang"&&Ir&&Ir!=="html"&&gn.enterRCDATA(Qp("-1&&Yf("COMPILER_V_BIND_SYNC",jt,Lt.loc,Lt.rawName)&&(Lt.name="model",Lt.modifiers.splice(r,1))}(Lt.type!==7||Lt.name!=="pre")&&cr.props.push(Lt)}Ir="",Po=Na=-1},oncomment(t,e){jt.comments&&Xy({type:3,content:Jn(t,e),loc:Rn(t-4,e+3)})},onend(){const t=nl.length;for(let e=0;e{const _=e.start.offset+v,C=_+m.length;return wp(m,!1,Rn(_,C),0,y?1:0)},l={source:s(o.trim(),n.indexOf(o,i.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let u=i.trim().replace(N8,"").trim();const f=i.indexOf(u),d=u.match(H2);if(d){u=u.replace(H2,"").trim();const m=d[1].trim();let v;if(m&&(v=n.indexOf(m,f+u.length),l.key=s(m,v,!0)),d[2]){const y=d[2].trim();y&&(l.index=s(y,n.indexOf(y,l.key?v+m.length:f+u.length),!0))}}return u&&(l.value=s(u,f,!0)),l}function Jn(t,e){return nl.slice(t,e)}function F2(t){gn.inSFCRoot&&(cr.innerLoc=Rn(t+1,t+1)),Xy(cr);const{tag:e,ns:n}=cr;n===0&&jt.isPreTag(e)&&rm++,jt.isVoidTag(e)?_p(cr,t):(hn.unshift(cr),(n===1||n===2)&&(gn.inXML=!0)),cr=null}function Dh(t,e,n){var r;{const s=(r=hn[0])==null?void 0:r.tag;s!=="script"&&s!=="style"&&t.includes("&")&&(t=jt.decodeEntities(t,!1))}const i=hn[0]||Xf,o=i.children[i.children.length-1];(o==null?void 0:o.type)===2?(o.content+=t,ja(o.loc,n)):i.children.push({type:2,content:t,loc:Rn(e,n)})}function _p(t,e,n=!1){n?ja(t.loc,EO(e,60)):ja(t.loc,e+1),gn.inSFCRoot&&(t.children.length?t.innerLoc.end=Rt({},t.children[t.children.length-1].loc.end):t.innerLoc.end=Rt({},t.innerLoc.start),t.innerLoc.source=Jn(t.innerLoc.start.offset,t.innerLoc.end.offset));const{tag:r,ns:i}=t;zs||(r==="slot"?t.tagType=2:V2(t)?t.tagType=3:D8(t)&&(t.tagType=1)),gn.inRCDATA||(t.children=AO(t.children,t.tag)),i===0&&jt.isPreTag(r)&&rm--,Jy===t&&(zs=gn.inVPre=!1,Jy=null),gn.inXML&&(hn[0]?hn[0].ns:jt.ns)===0&&(gn.inXML=!1);{const o=t.props;if(!gn.inSFCRoot&&tl("COMPILER_NATIVE_TEMPLATE",jt)&&t.tag==="template"&&!V2(t)){const l=hn[0]||Xf,u=l.children.indexOf(t);l.children.splice(u,1,...t.children)}const s=o.find(l=>l.type===6&&l.name==="inline-template");s&&Yf("COMPILER_INLINE_TEMPLATE",jt,s.loc)&&t.children.length&&(s.value={type:2,content:Jn(t.children[0].loc.start.offset,t.children[t.children.length-1].loc.end.offset),loc:s.loc})}}function EO(t,e){let n=t;for(;nl.charCodeAt(n)!==e&&n>=0;)n--;return n}const P8=new Set(["if","else","else-if","for","slot"]);function V2({tag:t,props:e}){if(t==="template"){for(let n=0;n64&&t<91}const z8=/\r\n/g;function AO(t,e){var n,r;const i=jt.whitespace!=="preserve";let o=!1;for(let s=0;s0){if(u>=2){l.codegenNode.patchFlag="-1",l.codegenNode=e.hoist(l.codegenNode),o++;continue}}else{const f=l.codegenNode;if(f.type===13){const d=PO(f);if((!d||d===512||d===1)&&NO(l,e)>=2){const m=IO(l);m&&(f.props=e.hoist(m))}f.dynamicProps&&(f.dynamicProps=e.hoist(f.dynamicProps))}}}if(l.type===1){const u=l.tagType===1;u&&e.scopes.vSlot++,kp(l,e),u&&e.scopes.vSlot--}else if(l.type===11)kp(l,e,l.children.length===1);else if(l.type===9)for(let u=0;u1)for(let f=0;fR&&(P.childIndex--,P.onNodeRemoved()),P.parent.children.splice(R,1)},onNodeRemoved:An,addIdentifiers(z){},removeIdentifiers(z){},hoist(z){xt(z)&&(z=Tt(z)),P.hoists.push(z);const w=Tt(`_hoisted_${P.hoists.length}`,!1,z.loc,2);return w.hoisted=z,w},cache(z,w=!1){return b8(P.cached++,z,w)}};return P.filters=new Set,P}function q8(t,e){const n=U8(t,e);_g(t,n),e.hoistStatic&&j8(t,n),e.ssr||K8(t,n),t.helpers=new Set([...n.helpers.keys()]),t.components=[...n.components],t.directives=[...n.directives],t.imports=n.imports,t.hoists=n.hoists,t.temps=n.temps,t.cached=n.cached,t.transformed=!0,t.filters=[...n.filters]}function K8(t,e){const{helper:n}=e,{children:r}=t;if(r.length===1){const i=r[0];if(MO(t,i)&&i.codegenNode){const o=i.codegenNode;o.type===13&&m_(o,e),t.codegenNode=o}else t.codegenNode=i}else if(r.length>1){let i=64;t.codegenNode=Gf(e,n(qf),void 0,t.children,i+"",void 0,void 0,!0,void 0,!1)}}function G8(t,e){let n=0;const r=()=>{n--};for(;nr===t:r=>t.test(r);return(r,i)=>{if(r.type===1){const{props:o}=r;if(r.tagType===3&&o.some(A8))return;const s=[];for(let l=0;l`${Hu[t]}: _${Hu[t]}`;function j2(t,{mode:e="function",prefixIdentifiers:n=e==="module",sourceMap:r=!1,filename:i="template.vue.html",scopeId:o=null,optimizeImports:s=!1,runtimeGlobalName:l="Vue",runtimeModuleName:u="vue",ssrRuntimeModuleName:f="vue/server-renderer",ssr:d=!1,isTS:m=!1,inSSR:v=!1}){const y={mode:e,prefixIdentifiers:n,sourceMap:r,filename:i,scopeId:o,optimizeImports:s,runtimeGlobalName:l,runtimeModuleName:u,ssrRuntimeModuleName:f,ssr:d,isTS:m,inSSR:v,source:t.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(C){return`_${Hu[C]}`},push(C,x=-2,k){y.code+=C},indent(){_(++y.indentLevel)},deindent(C=!1){C?--y.indentLevel:_(--y.indentLevel)},newline(){_(y.indentLevel)}};function _(C){y.push(` -`+" ".repeat(C),0)}return y}function Y8(t,e={}){const n=j2(t,e);e.onContextCreated&&e.onContextCreated(n);const{mode:r,push:i,prefixIdentifiers:o,indent:s,deindent:l,newline:u,scopeId:f,ssr:d}=n,m=Array.from(t.helpers),v=m.length>0,y=!o&&r!=="module",_=!1,C=_?j2(t,e):n;J8(t,C);const x=d?"ssrRender":"render",A=(d?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(i(`function ${x}(${A}) {`),s(),y&&(i("with (_ctx) {"),s(),v&&(i(`const { ${m.map(RO).join(", ")} } = _Vue -`,-1),u())),t.components.length&&(v0(t.components,"component",n),(t.directives.length||t.temps>0)&&u()),t.directives.length&&(v0(t.directives,"directive",n),t.temps>0&&u()),t.filters&&t.filters.length&&(u(),v0(t.filters,"filter",n),u()),t.temps>0){i("let ");for(let N=0;N0?", ":""}_temp${N}`)}return(t.components.length||t.directives.length||t.temps)&&(i(` -`,0),u()),d||i("return "),t.codegenNode?mr(t.codegenNode,n):i("null"),y&&(l(),i("}")),l(),i("}"),{ast:t,code:n.code,preamble:_?C.code:"",map:n.map?n.map.toJSON():void 0}}function J8(t,e){const{ssr:n,prefixIdentifiers:r,push:i,newline:o,runtimeModuleName:s,runtimeGlobalName:l,ssrRuntimeModuleName:u}=e,f=l,d=Array.from(t.helpers);if(d.length>0&&(i(`const _Vue = ${f} -`,-1),t.hoists.length)){const m=[t_,n_,xd,r_,yO].filter(v=>d.includes(v)).map(RO).join(", ");i(`const { ${m} } = _Vue -`,-1)}X8(t.hoists,e),o(),i("return ")}function v0(t,e,{helper:n,push:r,newline:i,isTS:o}){const s=n(e==="filter"?a_:e==="component"?i_:s_);for(let l=0;l3||!1;e.push("["),n&&e.indent(),Td(t,e,n),n&&e.deindent(),e.push("]")}function Td(t,e,n=!1,r=!0){const{push:i,newline:o}=e;for(let s=0;sn||"null")}function iz(t,e){const{push:n,helper:r,pure:i}=e,o=xt(t.callee)?t.callee:r(t.callee);i&&n(wg),n(o+"(",-2,t),Td(t.arguments,e),n(")")}function oz(t,e){const{push:n,indent:r,deindent:i,newline:o}=e,{properties:s}=t;if(!s.length){n("{}",-2,t);return}const l=s.length>1||!1;n(l?"{":"{ "),l&&r();for(let u=0;u "),(u||l)&&(n("{"),r()),s?(u&&n("return "),We(s)?y_(s,e):mr(s,e)):l&&mr(l,e),(u||l)&&(i(),n("}")),f&&(t.isNonScopedSlot&&n(", undefined, true"),n(")"))}function lz(t,e){const{test:n,consequent:r,alternate:i,newline:o}=t,{push:s,indent:l,deindent:u,newline:f}=e;if(n.type===4){const m=!v_(n.content);m&&s("("),zO(n,e),m&&s(")")}else s("("),mr(n,e),s(")");o&&l(),e.indentLevel++,o||s(" "),s("? "),mr(r,e),e.indentLevel--,o&&f(),o||s(" "),s(": ");const d=i.type===19;d||e.indentLevel++,mr(i,e),d||e.indentLevel--,o&&u(!0)}function uz(t,e){const{push:n,helper:r,indent:i,deindent:o,newline:s}=e;n(`_cache[${t.index}] || (`),t.isVNode&&(i(),n(`${r(Zp)}(-1),`),s()),n(`_cache[${t.index}] = `),mr(t.value,e),t.isVNode&&(n(","),s(),n(`${r(Zp)}(1),`),s(),n(`_cache[${t.index}]`),o()),n(")")}new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b");const cz=DO(/^(if|else|else-if)$/,(t,e,n)=>fz(t,e,n,(r,i,o)=>{const s=n.parent.children;let l=s.indexOf(r),u=0;for(;l-->=0;){const f=s[l];f&&f.type===9&&(u+=f.branches.length)}return()=>{if(o)r.codegenNode=U2(i,u,n);else{const f=dz(r.codegenNode);f.alternate=U2(i,u+r.branches.length-1,n)}}}));function fz(t,e,n,r){if(e.name!=="else"&&(!e.exp||!e.exp.content.trim())){const i=e.exp?e.exp.loc:t.loc;n.onError(an(28,e.loc)),e.exp=Tt("true",!1,i)}if(e.name==="if"){const i=W2(t,e),o={type:9,loc:t.loc,branches:[i]};if(n.replaceNode(o),r)return r(o,i,!0)}else{const i=n.parent.children;let o=i.indexOf(t);for(;o-->=-1;){const s=i[o];if(s&&s.type===3){n.removeNode(s);continue}if(s&&s.type===2&&!s.content.trim().length){n.removeNode(s);continue}if(s&&s.type===9){e.name==="else-if"&&s.branches[s.branches.length-1].condition===void 0&&n.onError(an(30,t.loc)),n.removeNode();const l=W2(t,e);s.branches.push(l);const u=r&&r(s,l,!1);_g(l,n),u&&u(),n.currentNode=null}else n.onError(an(30,t.loc));break}}}function W2(t,e){const n=t.tagType===3;return{type:10,loc:t.loc,condition:e.name==="else"?void 0:e.exp,children:n&&!Li(t,"for")?t.children:[t],userKey:bg(t,"key"),isTemplateIf:n}}function U2(t,e,n){return t.condition?Yy(t.condition,q2(t,e,n),zn(n.helper(xd),['""',"true"])):q2(t,e,n)}function q2(t,e,n){const{helper:r}=n,i=yn("key",Tt(`${e}`,!1,li,2)),{children:o}=t,s=o[0];if(o.length!==1||s.type!==1)if(o.length===1&&s.type===11){const u=s.codegenNode;return nm(u,i,n),u}else{let u=64;return Gf(n,r(qf),vi([i]),o,u+"",void 0,void 0,!0,!1,!1,t.loc)}else{const u=s.codegenNode,f=M8(u);return f.type===13&&m_(f,n),nm(f,i,n),u}}function dz(t){for(;;)if(t.type===19)if(t.alternate.type===19)t=t.alternate;else return t;else t.type===20&&(t=t.value)}const hz=DO("for",(t,e,n)=>{const{helper:r,removeHelper:i}=n;return pz(t,e,n,o=>{const s=zn(r(u_),[o.source]),l=em(t),u=Li(t,"memo"),f=bg(t,"key"),d=f&&(f.type===6?Tt(f.value.content,!0):f.exp),m=f?yn("key",d):null,v=o.source.type===4&&o.source.constType>0,y=v?64:f?128:256;return o.codegenNode=Gf(n,r(qf),void 0,s,y+"",void 0,void 0,!0,!v,!1,t.loc),()=>{let _;const{children:C}=o,x=C.length!==1||C[0].type!==1,k=tm(t)?t:l&&t.children.length===1&&tm(t.children[0])?t.children[0]:null;if(k?(_=k.codegenNode,l&&m&&nm(_,m,n)):x?_=Gf(n,r(qf),m?vi([m]):void 0,t.children,"64",void 0,void 0,!0,void 0,!1):(_=C[0].codegenNode,l&&m&&nm(_,m,n),_.isBlock!==!v&&(_.isBlock?(i(hl),i(ju(n.inSSR,_.isComponent))):i(Vu(n.inSSR,_.isComponent))),_.isBlock=!v,_.isBlock?(r(hl),r(ju(n.inSSR,_.isComponent))):r(Vu(n.inSSR,_.isComponent))),u){const A=Fu(Zy(o.parseResult,[Tt("_cached")]));A.body=_8([$i(["const _memo = (",u.exp,")"]),$i(["if (_cached",...d?[" && _cached.key === ",d]:[],` && ${n.helperString(wO)}(_cached, _memo)) return _cached`]),$i(["const _item = ",_]),Tt("_item.memo = _memo"),Tt("return _item")]),s.arguments.push(A,Tt("_cache"),Tt(String(n.cached++)))}else s.arguments.push(Fu(Zy(o.parseResult),_,!0))}})});function pz(t,e,n,r){if(!e.exp){n.onError(an(31,e.loc));return}const i=e.forParseResult;if(!i){n.onError(an(32,e.loc));return}$O(i);const{addIdentifiers:o,removeIdentifiers:s,scopes:l}=n,{source:u,value:f,key:d,index:m}=i,v={type:11,loc:e.loc,source:u,valueAlias:f,keyAlias:d,objectIndexAlias:m,parseResult:i,children:em(t)?t.children:[t]};n.replaceNode(v),l.vFor++;const y=r&&r(v);return()=>{l.vFor--,y&&y()}}function $O(t,e){t.finalized||(t.finalized=!0)}function Zy({value:t,key:e,index:n},r=[]){return mz([t,e,n,...r])}function mz(t){let e=t.length;for(;e--&&!t[e];);return t.slice(0,e+1).map((n,r)=>n||Tt("_".repeat(r+1),!1))}const K2=Tt("undefined",!1),gz=(t,e)=>{if(t.type===1&&(t.tagType===1||t.tagType===3)){const n=Li(t,"slot");if(n)return n.exp,e.scopes.vSlot++,()=>{e.scopes.vSlot--}}},vz=(t,e,n,r)=>Fu(t,n,!1,!0,n.length?n[0].loc:r);function yz(t,e,n=vz){e.helper(h_);const{children:r,loc:i}=t,o=[],s=[];let l=e.scopes.vSlot>0||e.scopes.vFor>0;const u=Li(t,"slot",!0);if(u){const{arg:x,exp:k}=u;x&&!$r(x)&&(l=!0),o.push(yn(x||Tt("default",!0),n(k,void 0,r,i)))}let f=!1,d=!1;const m=[],v=new Set;let y=0;for(let x=0;x{const N=n(k,void 0,A,i);return e.compatConfig&&(N.isNonScopedSlot=!0),yn("default",N)};f?m.length&&m.some(k=>HO(k))&&(d?e.onError(an(39,m[0].loc)):o.push(x(void 0,m))):o.push(x(void 0,r))}const _=l?2:xp(t.children)?3:1;let C=vi(o.concat(yn("_",Tt(_+"",!1))),i);return s.length&&(C=zn(e.helper(_O),[C,Cd(s)])),{slots:C,hasDynamicSlots:l}}function Rh(t,e,n){const r=[yn("name",t),yn("fn",e)];return n!=null&&r.push(yn("key",Tt(String(n),!0))),vi(r)}function xp(t){for(let e=0;efunction(){if(t=e.currentNode,!(t.type===1&&(t.tagType===0||t.tagType===1)))return;const{tag:r,props:i}=t,o=t.tagType===1;let s=o?_z(t,e):`"${r}"`;const l=qt(s)&&s.callee===o_;let u,f,d,m=0,v,y,_,C=l||s===df||s===e_||!o&&(r==="svg"||r==="foreignObject");if(i.length>0){const x=VO(t,e,void 0,o,l);u=x.props,m=x.patchFlag,y=x.dynamicPropNames;const k=x.directives;_=k&&k.length?Cd(k.map(A=>kz(A,e))):void 0,x.shouldUseBlock&&(C=!0)}if(t.children.length>0)if(s===Jp&&(C=!0,m|=1024),o&&s!==df&&s!==Jp){const{slots:k,hasDynamicSlots:A}=yz(t,e);f=k,A&&(m|=1024)}else if(t.children.length===1&&s!==df){const k=t.children[0],A=k.type,N=A===5||A===8;N&&yi(k,e)===0&&(m|=1),N||A===2?f=k:f=t.children}else f=t.children;m!==0&&(d=String(m),y&&y.length&&(v=xz(y))),t.codegenNode=Gf(e,s,u,f,d,v,_,!!C,!1,o,t.loc)};function _z(t,e,n=!1){let{tag:r}=t;const i=Qy(r),o=bg(t,"is");if(o)if(i||tl("COMPILER_IS_ON_ELEMENT",e)){const l=o.type===6?o.value&&Tt(o.value.content,!0):o.exp;if(l)return zn(e.helper(o_),[l])}else o.type===6&&o.value.content.startsWith("vue:")&&(r=o.value.content.slice(4));const s=xO(r)||e.isBuiltInComponent(r);return s?(n||e.helper(s),s):(e.helper(i_),e.components.add(r),Jf(r,"component"))}function VO(t,e,n=t.props,r,i,o=!1){const{tag:s,loc:l,children:u}=t;let f=[];const d=[],m=[],v=u.length>0;let y=!1,_=0,C=!1,x=!1,k=!1,A=!1,N=!1,E=!1;const H=[],I=z=>{f.length&&(d.push(vi(G2(f),l)),f=[]),z&&d.push(z)},q=({key:z,value:w})=>{if($r(z)){const R=z.content,U=Cl(R);if(U&&(!r||i)&&R.toLowerCase()!=="onclick"&&R!=="onUpdate:modelValue"&&!Ya(R)&&(A=!0),U&&Ya(R)&&(E=!0),U&&w.type===14&&(w=w.arguments[0]),w.type===20||(w.type===4||w.type===8)&&yi(w,e)>0)return;R==="ref"?C=!0:R==="class"?x=!0:R==="style"?k=!0:R!=="key"&&!H.includes(R)&&H.push(R),r&&(R==="class"||R==="style")&&!H.includes(R)&&H.push(R)}else N=!0};for(let z=0;z0&&f.push(yn(Tt("ref_for",!0),Tt("true")))),U==="is"&&(Qy(s)||oe&&oe.content.startsWith("vue:")||tl("COMPILER_IS_ON_ELEMENT",e)))continue;f.push(yn(Tt(U,!0,K),Tt(oe?oe.content:"",D,oe?oe.loc:R)))}else{const{name:R,arg:U,exp:K,loc:oe,modifiers:D}=w,ae=R==="bind",ce=R==="on";if(R==="slot"){r||e.onError(an(40,oe));continue}if(R==="once"||R==="memo"||R==="is"||ae&&Va(U,"is")&&(Qy(s)||tl("COMPILER_IS_ON_ELEMENT",e))||ce&&o)continue;if((ae&&Va(U,"key")||ce&&v&&Va(U,"vue:before-update"))&&(y=!0),ae&&Va(U,"ref")&&e.scopes.vFor>0&&f.push(yn(Tt("ref_for",!0),Tt("true"))),!U&&(ae||ce)){if(N=!0,K)if(ae){if(I(),tl("COMPILER_V_BIND_OBJECT_ORDER",e)){d.unshift(K);continue}d.push(K)}else I({type:14,loc:oe,callee:e.helper(d_),arguments:r?[K]:[K,"true"]});else e.onError(an(ae?34:35,oe));continue}ae&&D.includes("prop")&&(_|=32);const ve=e.directiveTransforms[R];if(ve){const{props:ze,needRuntime:qe}=ve(w,t,e);!o&&ze.forEach(q),ce&&U&&!$r(U)?I(vi(ze,l)):f.push(...ze),qe&&(m.push(w),Vi(qe)&&FO.set(w,qe))}else UP(R)||(m.push(w),v&&(y=!0))}}let P;if(d.length?(I(),d.length>1?P=zn(e.helper(Xp),d,l):P=d[0]):f.length&&(P=vi(G2(f),l)),N?_|=16:(x&&!r&&(_|=2),k&&!r&&(_|=4),H.length&&(_|=8),A&&(_|=32)),!y&&(_===0||_===32)&&(C||E||m.length>0)&&(_|=512),!e.inSSR&&P)switch(P.type){case 15:let z=-1,w=-1,R=!1;for(let oe=0;oeyn(s,o)),i))}return Cd(n,t.loc)}function xz(t){let e="[";for(let n=0,r=t.length;n{if(tm(t)){const{children:n,loc:r}=t,{slotName:i,slotProps:o}=Cz(t,e),s=[e.prefixIdentifiers?"_ctx.$slots":"$slots",i,"{}","undefined","true"];let l=2;o&&(s[2]=o,l=3),n.length&&(s[3]=Fu([],n,!1,!1,r),l=4),e.scopeId&&!e.slotted&&(l=5),s.splice(l),t.codegenNode=zn(e.helper(bO),s,r)}};function Cz(t,e){let n='"default"',r;const i=[];for(let o=0;o0){const{props:o,directives:s}=VO(t,e,i,!1,!1);r=o,s.length&&e.onError(an(36,s[0].loc))}return{slotName:n,slotProps:r}}const Tz=/^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,jO=(t,e,n,r)=>{const{loc:i,modifiers:o,arg:s}=t;!t.exp&&!o.length&&n.onError(an(35,i));let l;if(s.type===4)if(s.isStatic){let m=s.content;m.startsWith("vue:")&&(m=`vnode-${m.slice(4)}`);const v=e.tagType!==0||m.startsWith("vnode")||!/[A-Z]/.test(m)?wu(bn(m)):`on:${m}`;l=Tt(v,!0,s.loc)}else l=$i([`${n.helperString(Gy)}(`,s,")"]);else l=s,l.children.unshift(`${n.helperString(Gy)}(`),l.children.push(")");let u=t.exp;u&&!u.content.trim()&&(u=void 0);let f=n.cacheHandlers&&!u&&!n.inVOnce;if(u){const m=SO(u.content),v=!(m||Tz.test(u.content)),y=u.content.includes(";");(v||f&&m)&&(u=$i([`${v?"$event":"(...args)"} => ${y?"{":"("}`,u,y?"}":")"]))}let d={props:[yn(l,u||Tt("() => {}",!1,i))]};return r&&(d=r(d)),f&&(d.props[0].value=n.cache(d.props[0].value)),d.props.forEach(m=>m.key.isHandlerKey=!0),d},Ez=(t,e,n)=>{const{modifiers:r,loc:i}=t,o=t.arg;let{exp:s}=t;if(!s&&o.type===4){const l=bn(o.content);s=t.exp=Tt(l,!1,o.loc)}return o.type!==4?(o.children.unshift("("),o.children.push(') || ""')):o.isStatic||(o.content=`${o.content} || ""`),r.includes("camel")&&(o.type===4?o.isStatic?o.content=bn(o.content):o.content=`${n.helperString(Ky)}(${o.content})`:(o.children.unshift(`${n.helperString(Ky)}(`),o.children.push(")"))),n.inSSR||(r.includes("prop")&&Y2(o,"."),r.includes("attr")&&Y2(o,"^")),!s||s.type===4&&!s.content.trim()?(n.onError(an(34,i)),{props:[yn(o,Tt("",!0,i))]}):{props:[yn(o,s)]}},Y2=(t,e)=>{t.type===4?t.isStatic?t.content=e+t.content:t.content=`\`${e}\${${t.content}}\``:(t.children.unshift(`'${e}' + (`),t.children.push(")"))},Az=(t,e)=>{if(t.type===0||t.type===1||t.type===11||t.type===10)return()=>{const n=t.children;let r,i=!1;for(let o=0;oo.type===7&&!e.directiveTransforms[o.name])&&t.tag!=="template")))for(let o=0;o{if(t.type===1&&Li(t,"once",!0))return J2.has(t)||e.inVOnce||e.inSSR?void 0:(J2.add(t),e.inVOnce=!0,e.helper(Zp),()=>{e.inVOnce=!1;const n=e.currentNode;n.codegenNode&&(n.codegenNode=e.cache(n.codegenNode,!0))})},WO=(t,e,n)=>{const{exp:r,arg:i}=t;if(!r)return n.onError(an(41,t.loc)),zh();const o=r.loc.source,s=r.type===4?r.content:o,l=n.bindingMetadata[o];if(l==="props"||l==="props-aliased")return n.onError(an(44,r.loc)),zh();const u=!1;if(!s.trim()||!SO(s)&&!u)return n.onError(an(42,r.loc)),zh();const f=i||Tt("modelValue",!0),d=i?$r(i)?`onUpdate:${bn(i.content)}`:$i(['"onUpdate:" + ',i]):"onUpdate:modelValue";let m;const v=n.isTS?"($event: any)":"$event";m=$i([`${v} => ((`,r,") = $event)"]);const y=[yn(f,t.exp),yn(d,m)];if(t.modifiers.length&&e.tagType===1){const _=t.modifiers.map(x=>(v_(x)?x:JSON.stringify(x))+": true").join(", "),C=i?$r(i)?`${i.content}Modifiers`:$i([i,' + "Modifiers"']):"modelModifiers";y.push(yn(C,Tt(`{ ${_} }`,!1,t.loc,2)))}return zh(y)};function zh(t=[]){return{props:t}}const Mz=/[\w).+\-_$\]]/,Lz=(t,e)=>{tl("COMPILER_FILTERS",e)&&(t.type===5&&im(t.content,e),t.type===1&&t.props.forEach(n=>{n.type===7&&n.name!=="for"&&n.exp&&im(n.exp,e)}))};function im(t,e){if(t.type===4)X2(t,e);else for(let n=0;n=0&&(A=n.charAt(k),A===" ");k--);(!A||!Mz.test(A))&&(s=!0)}}_===void 0?_=n.slice(0,y).trim():d!==0&&x();function x(){C.push(n.slice(d,y).trim()),d=y+1}if(C.length){for(y=0;y{if(t.type===1){const n=Li(t,"memo");return!n||Z2.has(t)?void 0:(Z2.add(t),()=>{const r=t.codegenNode||e.currentNode.codegenNode;r&&r.type===13&&(t.tagType!==1&&m_(r,e),t.codegenNode=zn(e.helper(p_),[n.exp,Fu(void 0,r),"_cache",String(e.cached++)]))})}};function Pz(t){return[[Oz,cz,Iz,hz,Lz,Sz,bz,gz,Az],{on:jO,bind:Ez,model:WO}]}function Dz(t,e={}){const n=e.onError||g_,r=e.mode==="module";e.prefixIdentifiers===!0?n(an(47)):r&&n(an(48));const i=!1;e.cacheHandlers&&n(an(49)),e.scopeId&&!r&&n(an(50));const o=Rt({},e,{prefixIdentifiers:i}),s=xt(t)?V8(t,o):t,[l,u]=Pz();return q8(s,Rt({},o,{nodeTransforms:[...l,...e.nodeTransforms||[]],directiveTransforms:Rt({},u,e.directiveTransforms||{})})),Y8(s,o)}const Rz=()=>({props:[]});/** -* @vue/compiler-dom v3.4.15 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/const UO=Symbol(""),qO=Symbol(""),KO=Symbol(""),GO=Symbol(""),eb=Symbol(""),YO=Symbol(""),JO=Symbol(""),XO=Symbol(""),ZO=Symbol(""),QO=Symbol("");v8({[UO]:"vModelRadio",[qO]:"vModelCheckbox",[KO]:"vModelText",[GO]:"vModelSelect",[eb]:"vModelDynamic",[YO]:"withModifiers",[JO]:"withKeys",[XO]:"vShow",[ZO]:"Transition",[QO]:"TransitionGroup"});let nu;function zz(t,e=!1){return nu||(nu=document.createElement("div")),e?(nu.innerHTML=`
`,nu.children[0].getAttribute("foo")):(nu.innerHTML=t,nu.textContent)}const Bz={parseMode:"html",isVoidTag:sD,isNativeTag:t=>rD(t)||iD(t)||oD(t),isPreTag:t=>t==="pre",decodeEntities:zz,isBuiltInComponent:t=>{if(t==="Transition"||t==="transition")return ZO;if(t==="TransitionGroup"||t==="transition-group")return QO},getNamespace(t,e,n){let r=e?e.ns:n;if(e&&r===2)if(e.tag==="annotation-xml"){if(t==="svg")return 1;e.props.some(i=>i.type===6&&i.name==="encoding"&&i.value!=null&&(i.value.content==="text/html"||i.value.content==="application/xhtml+xml"))&&(r=0)}else/^m(?:[ions]|text)$/.test(e.tag)&&t!=="mglyph"&&t!=="malignmark"&&(r=0);else e&&r===1&&(e.tag==="foreignObject"||e.tag==="desc"||e.tag==="title")&&(r=0);if(r===0){if(t==="svg")return 1;if(t==="math")return 2}return r}},$z=t=>{t.type===1&&t.props.forEach((e,n)=>{e.type===6&&e.name==="style"&&e.value&&(t.props[n]={type:7,name:"bind",arg:Tt("style",!0,e.loc),exp:Hz(e.value.content,e.loc),modifiers:[],loc:e.loc})})},Hz=(t,e)=>{const n=EA(t);return Tt(JSON.stringify(n),!1,e,3)};function Ys(t,e){return an(t,e)}const Fz=(t,e,n)=>{const{exp:r,loc:i}=t;return r||n.onError(Ys(53,i)),e.children.length&&(n.onError(Ys(54,i)),e.children.length=0),{props:[yn(Tt("innerHTML",!0,i),r||Tt("",!0))]}},Vz=(t,e,n)=>{const{exp:r,loc:i}=t;return r||n.onError(Ys(55,i)),e.children.length&&(n.onError(Ys(56,i)),e.children.length=0),{props:[yn(Tt("textContent",!0),r?yi(r,n)>0?r:zn(n.helperString(yg),[r],i):Tt("",!0))]}},jz=(t,e,n)=>{const r=WO(t,e,n);if(!r.props.length||e.tagType===1)return r;t.arg&&n.onError(Ys(58,t.arg.loc));const{tag:i}=e,o=n.isCustomElement(i);if(i==="input"||i==="textarea"||i==="select"||o){let s=KO,l=!1;if(i==="input"||o){const u=bg(e,"type");if(u){if(u.type===7)s=eb;else if(u.value)switch(u.value.content){case"radio":s=UO;break;case"checkbox":s=qO;break;case"file":l=!0,n.onError(Ys(59,t.loc));break}}else E8(e)&&(s=eb)}else i==="select"&&(s=GO);l||(r.needRuntime=n.helper(s))}else n.onError(Ys(57,t.loc));return r.props=r.props.filter(s=>!(s.key.type===4&&s.key.content==="modelValue")),r},Wz=ai("passive,once,capture"),Uz=ai("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),qz=ai("left,right"),eM=ai("onkeyup,onkeydown,onkeypress",!0),Kz=(t,e,n,r)=>{const i=[],o=[],s=[];for(let l=0;l$r(t)&&t.content.toLowerCase()==="onclick"?Tt(e,!0):t.type!==4?$i(["(",t,`) === "onClick" ? "${e}" : (`,t,")"]):t,Gz=(t,e,n)=>jO(t,e,n,r=>{const{modifiers:i}=t;if(!i.length)return r;let{key:o,value:s}=r.props[0];const{keyModifiers:l,nonKeyModifiers:u,eventOptionModifiers:f}=Kz(o,i,n,t.loc);if(u.includes("right")&&(o=Q2(o,"onContextmenu")),u.includes("middle")&&(o=Q2(o,"onMouseup")),u.length&&(s=zn(n.helper(YO),[s,JSON.stringify(u)])),l.length&&(!$r(o)||eM(o.content))&&(s=zn(n.helper(JO),[s,JSON.stringify(l)])),f.length){const d=f.map(El).join("");o=$r(o)?Tt(`${o.content}${d}`,!0):$i(["(",o,`) + "${d}"`])}return{props:[yn(o,s)]}}),Yz=(t,e,n)=>{const{exp:r,loc:i}=t;return r||n.onError(Ys(61,i)),{props:[],needRuntime:n.helper(XO)}},Jz=(t,e)=>{t.type===1&&t.tagType===0&&(t.tag==="script"||t.tag==="style")&&e.removeNode()},Xz=[$z],Zz={cloak:Rz,html:Fz,text:Vz,model:jz,on:Gz,show:Yz};function Qz(t,e={}){return Dz(t,Rt({},Bz,e,{nodeTransforms:[Jz,...Xz,...e.nodeTransforms||[]],directiveTransforms:Rt({},Zz,e.directiveTransforms||{}),transformHoist:null}))}/** -* vue v3.4.15 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/const eS=new WeakMap;function e7(t){let e=eS.get(t??Ft);return e||(e=Object.create(null),eS.set(t??Ft,e)),e}function tb(t,e){if(!xt(t))if(t.nodeType)t=t.innerHTML;else return An;const n=t,r=e7(e),i=r[n];if(i)return i;if(t[0]==="#"){const u=document.querySelector(t);t=u?u.innerHTML:""}const o=Rt({hoistStatic:!0,onError:void 0,onWarn:An},e);!o.isCustomElement&&typeof customElements<"u"&&(o.isCustomElement=u=>!!customElements.get(u));const{code:s}=Qz(t,o),l=new Function("Vue",s)(f8);return l._rc=!0,r[n]=l}U3(tb);function t7(t){return t=t||Object.create(null),{on:function(n,r){(t[n]||(t[n]=[])).push(r)},off:function(n,r){t[n]&&t[n].splice(t[n].indexOf(r)>>>0,1)},emit:function(n,r){(t[n]||[]).slice().map(function(i){i(r)}),(t["*"]||[]).slice().map(function(i){i(n,r)})}}}function ns(t){return t.split("-")[0]}function Eu(t){return t.split("-")[1]}function Ed(t){return["top","bottom"].includes(ns(t))?"x":"y"}function b_(t){return t==="y"?"height":"width"}function tS(t){let{reference:e,floating:n,placement:r}=t;const i=e.x+e.width/2-n.width/2,o=e.y+e.height/2-n.height/2;let s;switch(ns(r)){case"top":s={x:i,y:e.y-n.height};break;case"bottom":s={x:i,y:e.y+e.height};break;case"right":s={x:e.x+e.width,y:o};break;case"left":s={x:e.x-n.width,y:o};break;default:s={x:e.x,y:e.y}}const l=Ed(r),u=b_(l);switch(Eu(r)){case"start":s[l]=s[l]-(e[u]/2-n[u]/2);break;case"end":s[l]=s[l]+(e[u]/2-n[u]/2);break}return s}const n7=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n;let l=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=tS({...l,placement:r}),d=r,m={};for(let v=0;v({name:"arrow",options:t,async fn(e){const{element:n,padding:r=0}=t??{},{x:i,y:o,placement:s,rects:l,platform:u}=e;if(n==null)return{};const f=tM(r),d={x:i,y:o},m=ns(s),v=Ed(m),y=b_(v),_=await u.getDimensions({element:n}),C=v==="y"?"top":"left",x=v==="y"?"bottom":"right",k=l.reference[y]+l.reference[v]-d[v]-l.floating[y],A=d[v]-l.reference[v],N=await u.getOffsetParent({element:n}),E=N?v==="y"?N.clientHeight||0:N.clientWidth||0:0,H=k/2-A/2,I=f[C],q=E-_[y]-f[x],P=E/2-_[y]/2+H,z=rb(I,P,q);return{data:{[v]:z,centerOffset:P-z}}}}),s7={left:"right",right:"left",bottom:"top",top:"bottom"};function om(t){return t.replace(/left|right|bottom|top/g,e=>s7[e])}function nM(t,e){const n=Eu(t)==="start",r=Ed(t),i=b_(r);let o=r==="x"?n?"right":"left":n?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=om(o)),{main:o,cross:om(o)}}const a7={start:"end",end:"start"};function ib(t){return t.replace(/start|end/g,e=>a7[e])}const l7=["top","right","bottom","left"],u7=l7.reduce((t,e)=>t.concat(e,e+"-start",e+"-end"),[]);function c7(t,e,n){return(t?[...n.filter(i=>Eu(i)===t),...n.filter(i=>Eu(i)!==t)]:n.filter(i=>ns(i)===i)).filter(i=>t?Eu(i)===t||(e?ib(i)!==i:!1):!0)}const f7=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,r,i,o,s,l;const{x:u,y:f,rects:d,middlewareData:m,placement:v}=e,{alignment:y=null,allowedPlacements:_=u7,autoAlignment:C=!0,...x}=t;if((n=m.autoPlacement)!=null&&n.skip)return{};const k=c7(y,C,_),A=await kg(e,x),N=(r=(i=m.autoPlacement)==null?void 0:i.index)!=null?r:0,E=k[N],{main:H,cross:I}=nM(E,d);if(v!==E)return{x:u,y:f,reset:{placement:k[0]}};const q=[A[ns(E)],A[H],A[I]],P=[...(o=(s=m.autoPlacement)==null?void 0:s.overflows)!=null?o:[],{placement:E,overflows:q}],z=k[N+1];if(z)return{data:{index:N+1,overflows:P},reset:{placement:z}};const w=P.slice().sort((U,K)=>U.overflows[0]-K.overflows[0]),R=(l=w.find(U=>{let{overflows:K}=U;return K.every(oe=>oe<=0)}))==null?void 0:l.placement;return{data:{skip:!0},reset:{placement:R??w[0].placement}}}}};function d7(t){const e=om(t);return[ib(t),e,ib(e)]}const h7=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:l}=e;if((n=o.flip)!=null&&n.skip)return{};const{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",flipAlignment:v=!0,...y}=t,_=ns(i),x=d||(_===l||!v?[om(l)]:d7(l)),k=[l,...x],A=await kg(e,y),N=[];let E=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&N.push(A[_]),f){const{main:P,cross:z}=nM(i,s);N.push(A[P],A[z])}if(E=[...E,{placement:i,overflows:N}],!N.every(P=>P<=0)){var H,I;const P=((H=(I=o.flip)==null?void 0:I.index)!=null?H:0)+1,z=k[P];if(z)return{data:{index:P,overflows:E},reset:{placement:z}};let w="bottom";switch(m){case"bestFit":{var q;const R=(q=E.slice().sort((U,K)=>U.overflows.filter(oe=>oe>0).reduce((oe,D)=>oe+D,0)-K.overflows.filter(oe=>oe>0).reduce((oe,D)=>oe+D,0))[0])==null?void 0:q.placement;R&&(w=R);break}case"initialPlacement":w=l;break}return{data:{skip:!0},reset:{placement:w}}}return{}}}};function p7(t){let{placement:e,rects:n,value:r}=t;const i=ns(e),o=["left","top"].includes(i)?-1:1,s=typeof r=="function"?r({...n,placement:e}):r,{mainAxis:l,crossAxis:u}=typeof s=="number"?{mainAxis:s,crossAxis:0}:{mainAxis:0,crossAxis:0,...s};return Ed(i)==="x"?{x:u,y:l*o}:{x:l*o,y:u}}const m7=function(t){return t===void 0&&(t=0),{name:"offset",options:t,fn(e){const{x:n,y:r,placement:i,rects:o}=e,s=p7({placement:i,rects:o,value:t});return{x:n+s.x,y:r+s.y,data:s}}}};function g7(t){return t==="x"?"y":"x"}const v7=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:x=>{let{x:k,y:A}=x;return{x:k,y:A}}},...u}=t,f={x:n,y:r},d=await kg(e,u),m=Ed(ns(i)),v=g7(m);let y=f[m],_=f[v];if(o){const x=m==="y"?"top":"left",k=m==="y"?"bottom":"right",A=y+d[x],N=y-d[k];y=rb(A,y,N)}if(s){const x=v==="y"?"top":"left",k=v==="y"?"bottom":"right",A=_+d[x],N=_-d[k];_=rb(A,_,N)}const C=l.fn({...e,[m]:y,[v]:_});return{...C,data:{x:C.x-n,y:C.y-r}}}}},y7=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n;const{placement:r,rects:i,middlewareData:o}=e,{apply:s,...l}=t;if((n=o.size)!=null&&n.skip)return{};const u=await kg(e,l),f=ns(r),d=Eu(r)==="end";let m,v;f==="top"||f==="bottom"?(m=f,v=d?"left":"right"):(v=f,m=d?"top":"bottom");const y=Ia(u.left,0),_=Ia(u.right,0),C=Ia(u.top,0),x=Ia(u.bottom,0),k={height:i.floating.height-(["left","right"].includes(r)?2*(C!==0||x!==0?C+x:Ia(u.top,u.bottom)):u[m]),width:i.floating.width-(["top","bottom"].includes(r)?2*(y!==0||_!==0?y+_:Ia(u.left,u.right)):u[v])};return s==null||s({...k,...i}),{data:{skip:!0},reset:{rects:!0}}}}};function __(t){return(t==null?void 0:t.toString())==="[object Window]"}function da(t){if(t==null)return window;if(!__(t)){const e=t.ownerDocument;return e&&e.defaultView||window}return t}function xg(t){return da(t).getComputedStyle(t)}function Ko(t){return __(t)?"":t?(t.nodeName||"").toLowerCase():""}function Go(t){return t instanceof da(t).HTMLElement}function sm(t){return t instanceof da(t).Element}function b7(t){return t instanceof da(t).Node}function rM(t){const e=da(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Sg(t){const{overflow:e,overflowX:n,overflowY:r}=xg(t);return/auto|scroll|overlay|hidden/.test(e+r+n)}function _7(t){return["table","td","th"].includes(Ko(t))}function iM(t){const e=navigator.userAgent.toLowerCase().includes("firefox"),n=xg(t);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||e&&n.willChange==="filter"||e&&(n.filter?n.filter!=="none":!1)}const nS=Math.min,hf=Math.max,am=Math.round;function Wu(t,e){e===void 0&&(e=!1);const n=t.getBoundingClientRect();let r=1,i=1;return e&&Go(t)&&(r=t.offsetWidth>0&&am(n.width)/t.offsetWidth||1,i=t.offsetHeight>0&&am(n.height)/t.offsetHeight||1),{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function ha(t){return((b7(t)?t.ownerDocument:t.document)||window.document).documentElement}function Cg(t){return __(t)?{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}:{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function oM(t){return Wu(ha(t)).left+Cg(t).scrollLeft}function w7(t){const e=Wu(t);return am(e.width)!==t.offsetWidth||am(e.height)!==t.offsetHeight}function k7(t,e,n){const r=Go(e),i=ha(e),o=Wu(t,r&&w7(e));let s={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if(r||!r&&n!=="fixed")if((Ko(e)!=="body"||Sg(i))&&(s=Cg(e)),Go(e)){const u=Wu(e,!0);l.x=u.x+e.clientLeft,l.y=u.y+e.clientTop}else i&&(l.x=oM(i));return{x:o.left+s.scrollLeft-l.x,y:o.top+s.scrollTop-l.y,width:o.width,height:o.height}}function Tg(t){return Ko(t)==="html"?t:t.assignedSlot||t.parentNode||(rM(t)?t.host:null)||ha(t)}function rS(t){return!Go(t)||getComputedStyle(t).position==="fixed"?null:t.offsetParent}function x7(t){let e=Tg(t);for(;Go(e)&&!["html","body"].includes(Ko(e));){if(iM(e))return e;e=e.parentNode}return null}function ob(t){const e=da(t);let n=rS(t);for(;n&&_7(n)&&getComputedStyle(n).position==="static";)n=rS(n);return n&&(Ko(n)==="html"||Ko(n)==="body"&&getComputedStyle(n).position==="static"&&!iM(n))?e:n||x7(t)||e}function iS(t){return{width:t.offsetWidth,height:t.offsetHeight}}function S7(t){let{rect:e,offsetParent:n,strategy:r}=t;const i=Go(n),o=ha(n);if(n===o)return e;let s={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if((i||!i&&r!=="fixed")&&((Ko(n)!=="body"||Sg(o))&&(s=Cg(n)),Go(n))){const u=Wu(n,!0);l.x=u.x+n.clientLeft,l.y=u.y+n.clientTop}return{...e,x:e.x-s.scrollLeft+l.x,y:e.y-s.scrollTop+l.y}}function C7(t){const e=da(t),n=ha(t),r=e.visualViewport;let i=n.clientWidth,o=n.clientHeight,s=0,l=0;return r&&(i=r.width,o=r.height,Math.abs(e.innerWidth/r.scale-r.width)<.01&&(s=r.offsetLeft,l=r.offsetTop)),{width:i,height:o,x:s,y:l}}function T7(t){var e;const n=ha(t),r=Cg(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=hf(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=hf(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0);let l=-r.scrollLeft+oM(t);const u=-r.scrollTop;return xg(i||n).direction==="rtl"&&(l+=hf(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:u}}function sM(t){return["html","body","#document"].includes(Ko(t))?t.ownerDocument.body:Go(t)&&Sg(t)?t:sM(Tg(t))}function lm(t,e){var n;e===void 0&&(e=[]);const r=sM(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=da(r),s=i?[o].concat(o.visualViewport||[],Sg(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(lm(Tg(s)))}function E7(t,e){const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&rM(n)){let r=e;do{if(r&&t===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function A7(t){const e=Wu(t),n=e.top+t.clientTop,r=e.left+t.clientLeft;return{top:n,left:r,x:r,y:n,right:r+t.clientWidth,bottom:n+t.clientHeight,width:t.clientWidth,height:t.clientHeight}}function oS(t,e){return e==="viewport"?nb(C7(t)):sm(e)?A7(e):nb(T7(ha(t)))}function O7(t){const e=lm(Tg(t)),r=["absolute","fixed"].includes(xg(t).position)&&Go(t)?ob(t):t;return sm(r)?e.filter(i=>sm(i)&&E7(i,r)&&Ko(i)!=="body"):[]}function M7(t){let{element:e,boundary:n,rootBoundary:r}=t;const o=[...n==="clippingParents"?O7(e):[].concat(n),r],s=o[0],l=o.reduce((u,f)=>{const d=oS(e,f);return u.top=hf(d.top,u.top),u.right=nS(d.right,u.right),u.bottom=nS(d.bottom,u.bottom),u.left=hf(d.left,u.left),u},oS(e,s));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}const L7={getElementRects:t=>{let{reference:e,floating:n,strategy:r}=t;return{reference:k7(e,ob(n),r),floating:{...iS(n),x:0,y:0}}},convertOffsetParentRelativeRectToViewportRelativeRect:t=>S7(t),getOffsetParent:t=>{let{element:e}=t;return ob(e)},isElement:t=>sm(t),getDocumentElement:t=>{let{element:e}=t;return ha(e)},getClippingClientRect:t=>M7(t),getDimensions:t=>{let{element:e}=t;return iS(e)},getClientRects:t=>{let{element:e}=t;return e.getClientRects()}},N7=(t,e,n)=>n7(t,e,{platform:L7,...n});var I7=Object.defineProperty,P7=Object.defineProperties,D7=Object.getOwnPropertyDescriptors,sS=Object.getOwnPropertySymbols,R7=Object.prototype.hasOwnProperty,z7=Object.prototype.propertyIsEnumerable,aS=(t,e,n)=>e in t?I7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,$o=(t,e)=>{for(var n in e||(e={}))R7.call(e,n)&&aS(t,n,e[n]);if(sS)for(var n of sS(e))z7.call(e,n)&&aS(t,n,e[n]);return t},Ad=(t,e)=>P7(t,D7(e));function aM(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&t[n]?aM(t[n],e[n]):t[n]=e[n])}const jo={disabled:!1,distance:5,skidding:0,container:"body",boundary:void 0,instantMove:!1,disposeTimeout:5e3,popperTriggers:[],strategy:"absolute",preventOverflow:!0,flip:!0,shift:!0,overflowPadding:0,arrowPadding:0,arrowOverflow:!0,themes:{tooltip:{placement:"top",triggers:["hover","focus","touch"],hideTriggers:t=>[...t,"click"],delay:{show:200,hide:0},handleResize:!1,html:!1,loadingContent:"..."},dropdown:{placement:"bottom",triggers:["click"],delay:0,handleResize:!0,autoHide:!0},menu:{$extend:"dropdown",triggers:["hover","focus"],popperTriggers:["hover","focus"],delay:{show:0,hide:400}}}};function Uu(t,e){let n=jo.themes[t]||{},r;do r=n[e],typeof r>"u"?n.$extend?n=jo.themes[n.$extend]||{}:(n=null,r=jo[e]):n=null;while(n);return r}function B7(t){const e=[t];let n=jo.themes[t]||{};do n.$extend&&!n.$resetCss?(e.push(n.$extend),n=jo.themes[n.$extend]||{}):n=null;while(n);return e.map(r=>`v-popper--theme-${r}`)}function lS(t){const e=[t];let n=jo.themes[t]||{};do n.$extend?(e.push(n.$extend),n=jo.themes[n.$extend]||{}):n=null;while(n);return e}let pl=!1;if(typeof window<"u"){pl=!1;try{const t=Object.defineProperty({},"passive",{get(){pl=!0}});window.addEventListener("test",null,t)}catch{}}let lM=!1;typeof window<"u"&&typeof navigator<"u"&&(lM=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream);const uM=["auto","top","bottom","left","right"].reduce((t,e)=>t.concat([e,`${e}-start`,`${e}-end`]),[]),uS={hover:"mouseenter",focus:"focus",click:"click",touch:"touchstart"},cS={hover:"mouseleave",focus:"blur",click:"click",touch:"touchend"};function fS(t,e){const n=t.indexOf(e);n!==-1&&t.splice(n,1)}function y0(){return new Promise(t=>requestAnimationFrame(()=>{requestAnimationFrame(t)}))}const Pi=[];let Ma=null;const dS={};function hS(t){let e=dS[t];return e||(e=dS[t]=[]),e}let sb=function(){};typeof window<"u"&&(sb=window.Element);function Pt(t){return function(e){return Uu(e.theme,t)}}const b0="__floating-vue__popper";var cM=()=>Vn({name:"VPopper",provide(){return{[b0]:{parentPopper:this}}},inject:{[b0]:{default:null}},props:{theme:{type:String,required:!0},targetNodes:{type:Function,required:!0},referenceNode:{type:Function,default:null},popperNode:{type:Function,required:!0},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:Pt("disabled")},positioningDisabled:{type:Boolean,default:Pt("positioningDisabled")},placement:{type:String,default:Pt("placement"),validator:t=>uM.includes(t)},delay:{type:[String,Number,Object],default:Pt("delay")},distance:{type:[Number,String],default:Pt("distance")},skidding:{type:[Number,String],default:Pt("skidding")},triggers:{type:Array,default:Pt("triggers")},showTriggers:{type:[Array,Function],default:Pt("showTriggers")},hideTriggers:{type:[Array,Function],default:Pt("hideTriggers")},popperTriggers:{type:Array,default:Pt("popperTriggers")},popperShowTriggers:{type:[Array,Function],default:Pt("popperShowTriggers")},popperHideTriggers:{type:[Array,Function],default:Pt("popperHideTriggers")},container:{type:[String,Object,sb,Boolean],default:Pt("container")},boundary:{type:[String,sb],default:Pt("boundary")},strategy:{type:String,validator:t=>["absolute","fixed"].includes(t),default:Pt("strategy")},autoHide:{type:[Boolean,Function],default:Pt("autoHide")},handleResize:{type:Boolean,default:Pt("handleResize")},instantMove:{type:Boolean,default:Pt("instantMove")},eagerMount:{type:Boolean,default:Pt("eagerMount")},popperClass:{type:[String,Array,Object],default:Pt("popperClass")},computeTransformOrigin:{type:Boolean,default:Pt("computeTransformOrigin")},autoMinSize:{type:Boolean,default:Pt("autoMinSize")},autoSize:{type:[Boolean,String],default:Pt("autoSize")},autoMaxSize:{type:Boolean,default:Pt("autoMaxSize")},autoBoundaryMaxSize:{type:Boolean,default:Pt("autoBoundaryMaxSize")},preventOverflow:{type:Boolean,default:Pt("preventOverflow")},overflowPadding:{type:[Number,String],default:Pt("overflowPadding")},arrowPadding:{type:[Number,String],default:Pt("arrowPadding")},arrowOverflow:{type:Boolean,default:Pt("arrowOverflow")},flip:{type:Boolean,default:Pt("flip")},shift:{type:Boolean,default:Pt("shift")},shiftCrossAxis:{type:Boolean,default:Pt("shiftCrossAxis")},noAutoFocus:{type:Boolean,default:Pt("noAutoFocus")}},emits:["show","hide","update:shown","apply-show","apply-hide","close-group","close-directive","auto-hide","resize","dispose"],data(){return{isShown:!1,isMounted:!1,skipTransition:!1,classes:{showFrom:!1,showTo:!1,hideFrom:!1,hideTo:!0},result:{x:0,y:0,placement:"",strategy:this.strategy,arrow:{x:0,y:0,centerOffset:0},transformOrigin:null},shownChildren:new Set,lastAutoHide:!0}},computed:{popperId(){return this.ariaId!=null?this.ariaId:this.randomId},shouldMountContent(){return this.eagerMount||this.isMounted},slotData(){return{popperId:this.popperId,isShown:this.isShown,shouldMountContent:this.shouldMountContent,skipTransition:this.skipTransition,autoHide:typeof this.autoHide=="function"?this.lastAutoHide:this.autoHide,show:this.show,hide:this.hide,handleResize:this.handleResize,onResize:this.onResize,classes:Ad($o({},this.classes),{popperClass:this.popperClass}),result:this.positioningDisabled?null:this.result,attrs:this.$attrs}},parentPopper(){var t;return(t=this[b0])==null?void 0:t.parentPopper},hasPopperShowTriggerHover(){var t,e;return((t=this.popperTriggers)==null?void 0:t.includes("hover"))||((e=this.popperShowTriggers)==null?void 0:e.includes("hover"))}},watch:$o($o({shown:"$_autoShowHide",disabled(t){t?this.dispose():this.init()},async container(){this.isShown&&(this.$_ensureTeleport(),await this.$_computePosition())}},["triggers","positioningDisabled"].reduce((t,e)=>(t[e]="$_refreshListeners",t),{})),["placement","distance","skidding","boundary","strategy","overflowPadding","arrowPadding","preventOverflow","shift","shiftCrossAxis","flip"].reduce((t,e)=>(t[e]="$_computePosition",t),{})),created(){this.$_isDisposed=!0,this.randomId=`popper_${[Math.random(),Date.now()].map(t=>t.toString(36).substring(2,10)).join("_")}`,this.autoMinSize&&console.warn('[floating-vue] `autoMinSize` option is deprecated. Use `autoSize="min"` instead.'),this.autoMaxSize&&console.warn("[floating-vue] `autoMaxSize` option is deprecated. Use `autoBoundaryMaxSize` instead.")},mounted(){this.init(),this.$_detachPopperNode()},activated(){this.$_autoShowHide()},deactivated(){this.hide()},beforeUnmount(){this.dispose()},methods:{show({event:t=null,skipDelay:e=!1,force:n=!1}={}){var r,i;(r=this.parentPopper)!=null&&r.lockedChild&&this.parentPopper.lockedChild!==this||(this.$_pendingHide=!1,(n||!this.disabled)&&(((i=this.parentPopper)==null?void 0:i.lockedChild)===this&&(this.parentPopper.lockedChild=null),this.$_scheduleShow(t,e),this.$emit("show"),this.$_showFrameLocked=!0,requestAnimationFrame(()=>{this.$_showFrameLocked=!1})),this.$emit("update:shown",!0))},hide({event:t=null,skipDelay:e=!1}={}){var n;if(!this.$_hideInProgress){if(this.shownChildren.size>0){this.$_pendingHide=!0;return}if(this.hasPopperShowTriggerHover&&this.$_isAimingPopper()){this.parentPopper&&(this.parentPopper.lockedChild=this,clearTimeout(this.parentPopper.lockedChildTimer),this.parentPopper.lockedChildTimer=setTimeout(()=>{this.parentPopper.lockedChild===this&&(this.parentPopper.lockedChild.hide({skipDelay:e}),this.parentPopper.lockedChild=null)},1e3));return}((n=this.parentPopper)==null?void 0:n.lockedChild)===this&&(this.parentPopper.lockedChild=null),this.$_pendingHide=!1,this.$_scheduleHide(t,e),this.$emit("hide"),this.$emit("update:shown",!1)}},init(){var t,e;this.$_isDisposed&&(this.$_isDisposed=!1,this.isMounted=!1,this.$_events=[],this.$_preventShow=!1,this.$_referenceNode=(e=(t=this.referenceNode)==null?void 0:t.call(this))!=null?e:this.$el,this.$_targetNodes=this.targetNodes().filter(n=>n.nodeType===n.ELEMENT_NODE),this.$_popperNode=this.popperNode(),this.$_innerNode=this.$_popperNode.querySelector(".v-popper__inner"),this.$_arrowNode=this.$_popperNode.querySelector(".v-popper__arrow-container"),this.$_swapTargetAttrs("title","data-original-title"),this.$_detachPopperNode(),this.triggers.length&&this.$_addEventListeners(),this.shown&&this.show())},dispose(){this.$_isDisposed||(this.$_isDisposed=!0,this.$_removeEventListeners(),this.hide({skipDelay:!0}),this.$_detachPopperNode(),this.isMounted=!1,this.isShown=!1,this.$_updateParentShownChildren(!1),this.$_swapTargetAttrs("data-original-title","title"),this.$emit("dispose"))},async onResize(){this.isShown&&(await this.$_computePosition(),this.$emit("resize"))},async $_computePosition(){var t;if(this.$_isDisposed||this.positioningDisabled)return;const e={strategy:this.strategy,middleware:[]};(this.distance||this.skidding)&&e.middleware.push(m7({mainAxis:this.distance,crossAxis:this.skidding}));const n=this.placement.startsWith("auto");if(n?e.middleware.push(f7({alignment:(t=this.placement.split("-")[1])!=null?t:""})):e.placement=this.placement,this.preventOverflow&&(this.shift&&e.middleware.push(v7({padding:this.overflowPadding,boundary:this.boundary,crossAxis:this.shiftCrossAxis})),!n&&this.flip&&e.middleware.push(h7({padding:this.overflowPadding,boundary:this.boundary}))),e.middleware.push(o7({element:this.$_arrowNode,padding:this.arrowPadding})),this.arrowOverflow&&e.middleware.push({name:"arrowOverflow",fn:({placement:i,rects:o,middlewareData:s})=>{let l;const{centerOffset:u}=s.arrow;return i.startsWith("top")||i.startsWith("bottom")?l=Math.abs(u)>o.reference.width/2:l=Math.abs(u)>o.reference.height/2,{data:{overflow:l}}}}),this.autoMinSize||this.autoSize){const i=this.autoSize?this.autoSize:this.autoMinSize?"min":null;e.middleware.push({name:"autoSize",fn:({rects:o,placement:s,middlewareData:l})=>{var u;if((u=l.autoSize)!=null&&u.skip)return{};let f,d;return s.startsWith("top")||s.startsWith("bottom")?f=o.reference.width:d=o.reference.height,this.$_innerNode.style[i==="min"?"minWidth":i==="max"?"maxWidth":"width"]=f!=null?`${f}px`:null,this.$_innerNode.style[i==="min"?"minHeight":i==="max"?"maxHeight":"height"]=d!=null?`${d}px`:null,{data:{skip:!0},reset:{rects:!0}}}})}(this.autoMaxSize||this.autoBoundaryMaxSize)&&(this.$_innerNode.style.maxWidth=null,this.$_innerNode.style.maxHeight=null,e.middleware.push(y7({boundary:this.boundary,padding:this.overflowPadding,apply:({width:i,height:o})=>{this.$_innerNode.style.maxWidth=i!=null?`${i}px`:null,this.$_innerNode.style.maxHeight=o!=null?`${o}px`:null}})));const r=await N7(this.$_referenceNode,this.$_popperNode,e);Object.assign(this.result,{x:r.x,y:r.y,placement:r.placement,strategy:r.strategy,arrow:$o($o({},r.middlewareData.arrow),r.middlewareData.arrowOverflow)})},$_scheduleShow(t=null,e=!1){if(this.$_updateParentShownChildren(!0),this.$_hideInProgress=!1,clearTimeout(this.$_scheduleTimer),Ma&&this.instantMove&&Ma.instantMove&&Ma!==this.parentPopper){Ma.$_applyHide(!0),this.$_applyShow(!0);return}e?this.$_applyShow():this.$_scheduleTimer=setTimeout(this.$_applyShow.bind(this),this.$_computeDelay("show"))},$_scheduleHide(t=null,e=!1){if(this.shownChildren.size>0){this.$_pendingHide=!0;return}this.$_updateParentShownChildren(!1),this.$_hideInProgress=!0,clearTimeout(this.$_scheduleTimer),this.isShown&&(Ma=this),e?this.$_applyHide():this.$_scheduleTimer=setTimeout(this.$_applyHide.bind(this),this.$_computeDelay("hide"))},$_computeDelay(t){const e=this.delay;return parseInt(e&&e[t]||e||0)},async $_applyShow(t=!1){clearTimeout(this.$_disposeTimer),clearTimeout(this.$_scheduleTimer),this.skipTransition=t,!this.isShown&&(this.$_ensureTeleport(),await y0(),await this.$_computePosition(),await this.$_applyShowEffect(),this.positioningDisabled||this.$_registerEventListeners([...lm(this.$_referenceNode),...lm(this.$_popperNode)],"scroll",()=>{this.$_computePosition()}))},async $_applyShowEffect(){if(this.$_hideInProgress)return;if(this.computeTransformOrigin){const e=this.$_referenceNode.getBoundingClientRect(),n=this.$_popperNode.querySelector(".v-popper__wrapper"),r=n.parentNode.getBoundingClientRect(),i=e.x+e.width/2-(r.left+n.offsetLeft),o=e.y+e.height/2-(r.top+n.offsetTop);this.result.transformOrigin=`${i}px ${o}px`}this.isShown=!0,this.$_applyAttrsToTarget({"aria-describedby":this.popperId,"data-popper-shown":""});const t=this.showGroup;if(t){let e;for(let n=0;n0){this.$_pendingHide=!0,this.$_hideInProgress=!1;return}if(clearTimeout(this.$_scheduleTimer),!this.isShown)return;this.skipTransition=t,fS(Pi,this),Pi.length===0&&document.body.classList.remove("v-popper--some-open");for(const n of lS(this.theme)){const r=hS(n);fS(r,this),r.length===0&&document.body.classList.remove(`v-popper--some-open--${n}`)}Ma===this&&(Ma=null),this.isShown=!1,this.$_applyAttrsToTarget({"aria-describedby":void 0,"data-popper-shown":void 0}),clearTimeout(this.$_disposeTimer);const e=Uu(this.theme,"disposeTimeout");e!==null&&(this.$_disposeTimer=setTimeout(()=>{this.$_popperNode&&(this.$_detachPopperNode(),this.isMounted=!1)},e)),this.$_removeEventListeners("scroll"),this.$emit("apply-hide"),this.classes.showFrom=!1,this.classes.showTo=!1,this.classes.hideFrom=!0,this.classes.hideTo=!1,await y0(),this.classes.hideFrom=!1,this.classes.hideTo=!0},$_autoShowHide(){this.shown?this.show():this.hide()},$_ensureTeleport(){if(this.$_isDisposed)return;let t=this.container;if(typeof t=="string"?t=window.document.querySelector(t):t===!1&&(t=this.$_targetNodes[0].parentNode),!t)throw new Error("No container for popover: "+this.container);t.appendChild(this.$_popperNode),this.isMounted=!0},$_addEventListeners(){const t=n=>{this.isShown&&!this.$_hideInProgress||(n.usedByTooltip=!0,!this.$_preventShow&&this.show({event:n}))};this.$_registerTriggerListeners(this.$_targetNodes,uS,this.triggers,this.showTriggers,t),this.$_registerTriggerListeners([this.$_popperNode],uS,this.popperTriggers,this.popperShowTriggers,t);const e=n=>{n.usedByTooltip||this.hide({event:n})};this.$_registerTriggerListeners(this.$_targetNodes,cS,this.triggers,this.hideTriggers,e),this.$_registerTriggerListeners([this.$_popperNode],cS,this.popperTriggers,this.popperHideTriggers,e)},$_registerEventListeners(t,e,n){this.$_events.push({targetNodes:t,eventType:e,handler:n}),t.forEach(r=>r.addEventListener(e,n,pl?{passive:!0}:void 0))},$_registerTriggerListeners(t,e,n,r,i){let o=n;r!=null&&(o=typeof r=="function"?r(o):r),o.forEach(s=>{const l=e[s];l&&this.$_registerEventListeners(t,l,i)})},$_removeEventListeners(t){const e=[];this.$_events.forEach(n=>{const{targetNodes:r,eventType:i,handler:o}=n;!t||t===i?r.forEach(s=>s.removeEventListener(i,o)):e.push(n)}),this.$_events=e},$_refreshListeners(){this.$_isDisposed||(this.$_removeEventListeners(),this.$_addEventListeners())},$_handleGlobalClose(t,e=!1){this.$_showFrameLocked||(this.hide({event:t}),t.closePopover?this.$emit("close-directive"):this.$emit("auto-hide"),e&&(this.$_preventShow=!0,setTimeout(()=>{this.$_preventShow=!1},300)))},$_detachPopperNode(){this.$_popperNode.parentNode&&this.$_popperNode.parentNode.removeChild(this.$_popperNode)},$_swapTargetAttrs(t,e){for(const n of this.$_targetNodes){const r=n.getAttribute(t);r&&(n.removeAttribute(t),n.setAttribute(e,r))}},$_applyAttrsToTarget(t){for(const e of this.$_targetNodes)for(const n in t){const r=t[n];r==null?e.removeAttribute(n):e.setAttribute(n,r)}},$_updateParentShownChildren(t){let e=this.parentPopper;for(;e;)t?e.shownChildren.add(this.randomId):(e.shownChildren.delete(this.randomId),e.$_pendingHide&&e.hide()),e=e.parentPopper},$_isAimingPopper(){const t=this.$_referenceNode.getBoundingClientRect();if(pf>=t.left&&pf<=t.right&&mf>=t.top&&mf<=t.bottom){const e=this.$_popperNode.getBoundingClientRect(),n=pf-Ms,r=mf-Ls,o=e.left+e.width/2-Ms+(e.top+e.height/2)-Ls+e.width+e.height,s=Ms+n*o,l=Ls+r*o;return Bh(Ms,Ls,s,l,e.left,e.top,e.left,e.bottom)||Bh(Ms,Ls,s,l,e.left,e.top,e.right,e.top)||Bh(Ms,Ls,s,l,e.right,e.top,e.right,e.bottom)||Bh(Ms,Ls,s,l,e.left,e.bottom,e.right,e.bottom)}return!1}},render(){return this.$slots.default(this.slotData)}});typeof document<"u"&&typeof window<"u"&&(lM?(document.addEventListener("touchstart",pS,pl?{passive:!0,capture:!0}:!0),document.addEventListener("touchend",H7,pl?{passive:!0,capture:!0}:!0)):(window.addEventListener("mousedown",pS,!0),window.addEventListener("click",$7,!0)),window.addEventListener("resize",j7));function pS(t){for(let e=0;e=0;r--){const i=Pi[r];try{const o=i.$_containsGlobalTarget=F7(i,t);i.$_pendingHide=!1,requestAnimationFrame(()=>{if(i.$_pendingHide=!1,!n[i.randomId]&&mS(i,o,t)){if(i.$_handleGlobalClose(t,e),!t.closeAllPopover&&t.closePopover&&o){let l=i.parentPopper;for(;l;)n[l.randomId]=!0,l=l.parentPopper;return}let s=i.parentPopper;for(;s&&mS(s,s.$_containsGlobalTarget,t);){s.$_handleGlobalClose(t,e);s=s.parentPopper}}})}catch{}}}function F7(t,e){const n=t.popperNode();return t.$_mouseDownContains||n.contains(e.target)}function mS(t,e,n){return n.closeAllPopover||n.closePopover&&e||V7(t,n)&&!e}function V7(t,e){if(typeof t.autoHide=="function"){const n=t.autoHide(e);return t.lastAutoHide=n,n}return t.autoHide}function j7(t){for(let e=0;e{Ms=pf,Ls=mf,pf=t.clientX,mf=t.clientY},pl?{passive:!0}:void 0);function Bh(t,e,n,r,i,o,s,l){const u=((s-i)*(e-o)-(l-o)*(t-i))/((l-o)*(n-t)-(s-i)*(r-e)),f=((n-t)*(e-o)-(r-e)*(t-i))/((l-o)*(n-t)-(s-i)*(r-e));return u>=0&&u<=1&&f>=0&&f<=1}var Eg=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n};const W7={extends:cM()};function U7(t,e,n,r,i,o){return ge(),Se("div",{ref:"reference",class:gt(["v-popper",{"v-popper--shown":t.slotData.isShown}])},[pn(t.$slots,"default",AA(G1(t.slotData)))],2)}var q7=Eg(W7,[["render",U7]]);function K7(){var t=window.navigator.userAgent,e=t.indexOf("MSIE ");if(e>0)return parseInt(t.substring(e+5,t.indexOf(".",e)),10);var n=t.indexOf("Trident/");if(n>0){var r=t.indexOf("rv:");return parseInt(t.substring(r+3,t.indexOf(".",r)),10)}var i=t.indexOf("Edge/");return i>0?parseInt(t.substring(i+5,t.indexOf(".",i)),10):-1}let Sp;function ab(){ab.init||(ab.init=!0,Sp=K7()!==-1)}var Ag={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){ab(),Ri(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const t=document.createElement("object");this._resizeObject=t,t.setAttribute("aria-hidden","true"),t.setAttribute("tabindex",-1),t.onload=this.addResizeHandlers,t.type="text/html",Sp&&this.$el.appendChild(t),t.data="about:blank",Sp||this.$el.appendChild(t)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!Sp&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const G7=z1();D1("data-v-b329ee4c");const Y7={class:"resize-observer",tabindex:"-1"};R1();const J7=G7((t,e,n,r,i,o)=>(ge(),Et("div",Y7)));Ag.render=J7;Ag.__scopeId="data-v-b329ee4c";Ag.__file="src/components/ResizeObserver.vue";var dM=(t="theme")=>({computed:{themeClass(){return B7(this[t])}}});const X7=Vn({name:"VPopperContent",components:{ResizeObserver:Ag},mixins:[dM()],props:{popperId:String,theme:String,shown:Boolean,mounted:Boolean,skipTransition:Boolean,autoHide:Boolean,handleResize:Boolean,classes:Object,result:Object},emits:["hide","resize"],methods:{toPx(t){return t!=null&&!isNaN(t)?`${t}px`:null}}}),Z7=["id","aria-hidden","tabindex","data-popper-placement"],Q7={ref:"inner",class:"v-popper__inner"},eB=ee("div",{class:"v-popper__arrow-outer"},null,-1),tB=ee("div",{class:"v-popper__arrow-inner"},null,-1),nB=[eB,tB];function rB(t,e,n,r,i,o){const s=ut("ResizeObserver");return ge(),Se("div",{id:t.popperId,ref:"popover",class:gt(["v-popper__popper",[t.themeClass,t.classes.popperClass,{"v-popper__popper--shown":t.shown,"v-popper__popper--hidden":!t.shown,"v-popper__popper--show-from":t.classes.showFrom,"v-popper__popper--show-to":t.classes.showTo,"v-popper__popper--hide-from":t.classes.hideFrom,"v-popper__popper--hide-to":t.classes.hideTo,"v-popper__popper--skip-transition":t.skipTransition,"v-popper__popper--arrow-overflow":t.result&&t.result.arrow.overflow,"v-popper__popper--no-positioning":!t.result}]]),style:oi(t.result?{position:t.result.strategy,transform:`translate3d(${Math.round(t.result.x)}px,${Math.round(t.result.y)}px,0)`}:void 0),"aria-hidden":t.shown?"false":"true",tabindex:t.autoHide?0:void 0,"data-popper-placement":t.result?t.result.placement:void 0,onKeyup:e[2]||(e[2]=Tu(l=>t.autoHide&&t.$emit("hide"),["esc"]))},[ee("div",{class:"v-popper__backdrop",onClick:e[0]||(e[0]=l=>t.autoHide&&t.$emit("hide"))}),ee("div",{class:"v-popper__wrapper",style:oi(t.result?{transformOrigin:t.result.transformOrigin}:void 0)},[ee("div",Q7,[t.mounted?(ge(),Se(kt,{key:0},[ee("div",null,[pn(t.$slots,"default")]),t.handleResize?(ge(),Et(s,{key:0,onNotify:e[1]||(e[1]=l=>t.$emit("resize",l))})):_t("",!0)],64)):_t("",!0)],512),ee("div",{ref:"arrow",class:"v-popper__arrow-container",style:oi(t.result?{left:t.toPx(t.result.arrow.x),top:t.toPx(t.result.arrow.y)}:void 0)},nB,4)],4)],46,Z7)}var hM=Eg(X7,[["render",rB]]),pM={methods:{show(...t){return this.$refs.popper.show(...t)},hide(...t){return this.$refs.popper.hide(...t)},dispose(...t){return this.$refs.popper.dispose(...t)},onResize(...t){return this.$refs.popper.onResize(...t)}}};const iB=Vn({name:"VPopperWrapper",components:{Popper:q7,PopperContent:hM},mixins:[pM,dM("finalTheme")],props:{theme:{type:String,default:null}},computed:{finalTheme(){var t;return(t=this.theme)!=null?t:this.$options.vPopperTheme}},methods:{getTargetNodes(){return Array.from(this.$el.children).filter(t=>t!==this.$refs.popperContent.$el)}}});function oB(t,e,n,r,i,o){const s=ut("PopperContent"),l=ut("Popper");return ge(),Et(l,{ref:"popper",theme:t.finalTheme,"target-nodes":t.getTargetNodes,"popper-node":()=>t.$refs.popperContent.$el,class:gt([t.themeClass])},{default:Vt(({popperId:u,isShown:f,shouldMountContent:d,skipTransition:m,autoHide:v,show:y,hide:_,handleResize:C,onResize:x,classes:k,result:A})=>[pn(t.$slots,"default",{shown:f,show:y,hide:_}),Qe(s,{ref:"popperContent","popper-id":u,theme:t.finalTheme,shown:f,mounted:d,"skip-transition":m,"auto-hide":v,"handle-resize":C,classes:k,result:A,onHide:_,onResize:x},{default:Vt(()=>[pn(t.$slots,"popper",{shown:f,hide:_})]),_:2},1032,["popper-id","theme","shown","mounted","skip-transition","auto-hide","handle-resize","classes","result","onHide","onResize"])]),_:3},8,["theme","target-nodes","popper-node","class"])}var w_=Eg(iB,[["render",oB]]);const sB=Vn(Ad($o({},w_),{name:"VDropdown",vPopperTheme:"dropdown"})),aB=Vn(Ad($o({},w_),{name:"VMenu",vPopperTheme:"menu"})),lB=Vn(Ad($o({},w_),{name:"VTooltip",vPopperTheme:"tooltip"})),uB=Vn({name:"VTooltipDirective",components:{Popper:cM(),PopperContent:hM},mixins:[pM],inheritAttrs:!1,props:{theme:{type:String,default:"tooltip"},html:{type:Boolean,default:t=>Uu(t.theme,"html")},content:{type:[String,Number,Function],default:null},loadingContent:{type:String,default:t=>Uu(t.theme,"loadingContent")}},data(){return{asyncContent:null}},computed:{isContentAsync(){return typeof this.content=="function"},loading(){return this.isContentAsync&&this.asyncContent==null},finalContent(){return this.isContentAsync?this.loading?this.loadingContent:this.asyncContent:this.content}},watch:{content:{handler(){this.fetchContent(!0)},immediate:!0},async finalContent(){await this.$nextTick(),this.$refs.popper.onResize()}},created(){this.$_fetchId=0},methods:{fetchContent(t){if(typeof this.content=="function"&&this.$_isShown&&(t||!this.$_loading&&this.asyncContent==null)){this.asyncContent=null,this.$_loading=!0;const e=++this.$_fetchId,n=this.content(this);n.then?n.then(r=>this.onResult(e,r)):this.onResult(e,n)}},onResult(t,e){t===this.$_fetchId&&(this.$_loading=!1,this.asyncContent=e)},onShow(){this.$_isShown=!0,this.fetchContent()},onHide(){this.$_isShown=!1}}}),cB=["innerHTML"],fB=["textContent"];function dB(t,e,n,r,i,o){const s=ut("PopperContent"),l=ut("Popper");return ge(),Et(l,wi({ref:"popper"},t.$attrs,{theme:t.theme,"popper-node":()=>t.$refs.popperContent.$el,onApplyShow:t.onShow,onApplyHide:t.onHide}),{default:Vt(({popperId:u,isShown:f,shouldMountContent:d,skipTransition:m,autoHide:v,hide:y,handleResize:_,onResize:C,classes:x,result:k})=>[Qe(s,{ref:"popperContent",class:gt({"v-popper--tooltip-loading":t.loading}),"popper-id":u,theme:t.theme,shown:f,mounted:d,"skip-transition":m,"auto-hide":v,"handle-resize":_,classes:x,result:k,onHide:y,onResize:C},{default:Vt(()=>[t.html?(ge(),Se("div",{key:0,innerHTML:t.finalContent},null,8,cB)):(ge(),Se("div",{key:1,textContent:Ne(t.finalContent)},null,8,fB))]),_:2},1032,["class","popper-id","theme","shown","mounted","skip-transition","auto-hide","handle-resize","classes","result","onHide","onResize"])]),_:1},16,["theme","popper-node","onApplyShow","onApplyHide"])}var hB=Eg(uB,[["render",dB]]);const mM="v-popper--has-tooltip";function pB(t,e){let n=t.placement;if(!n&&e)for(const r of uM)e[r]&&(n=r);return n||(n=Uu(t.theme||"tooltip","placement")),n}function gM(t,e,n){let r;const i=typeof e;return i==="string"?r={content:e}:e&&i==="object"?r=e:r={content:!1},r.placement=pB(r,n),r.targetNodes=()=>[t],r.referenceNode=()=>t,r}let _0,Zf,mB=0;function gB(){if(_0)return;Zf=Ot([]),_0=Q1({name:"VTooltipDirectiveApp",setup(){return{directives:Zf}},render(){return this.directives.map(e=>Hr(hB,Ad($o({},e.options),{shown:e.shown||e.options.shown,key:e.id})))},devtools:{hide:!0}});const t=document.createElement("div");document.body.appendChild(t),_0.mount(t)}function vB(t,e,n){gB();const r=Ot(gM(t,e,n)),i=Ot(!1),o={id:mB++,options:r,shown:i};return Zf.value.push(o),t.classList&&t.classList.add(mM),t.$_popper={options:r,item:o,show(){i.value=!0},hide(){i.value=!1}}}function vM(t){if(t.$_popper){const e=Zf.value.indexOf(t.$_popper.item);e!==-1&&Zf.value.splice(e,1),delete t.$_popper,delete t.$_popperOldShown,delete t.$_popperMountTarget}t.classList&&t.classList.remove(mM)}function gS(t,{value:e,modifiers:n}){const r=gM(t,e,n);if(!r.content||Uu(r.theme||"tooltip","disabled"))vM(t);else{let i;t.$_popper?(i=t.$_popper,i.options.value=r):i=vB(t,e,n),typeof e.shown<"u"&&e.shown!==t.$_popperOldShown&&(t.$_popperOldShown=e.shown,e.shown?i.show():i.hide())}}var yB={beforeMount:gS,updated:gS,beforeUnmount(t){vM(t)}};function vS(t){t.addEventListener("click",yM),t.addEventListener("touchstart",bM,pl?{passive:!0}:!1)}function yS(t){t.removeEventListener("click",yM),t.removeEventListener("touchstart",bM),t.removeEventListener("touchend",_M),t.removeEventListener("touchcancel",wM)}function yM(t){const e=t.currentTarget;t.closePopover=!e.$_vclosepopover_touch,t.closeAllPopover=e.$_closePopoverModifiers&&!!e.$_closePopoverModifiers.all}function bM(t){if(t.changedTouches.length===1){const e=t.currentTarget;e.$_vclosepopover_touch=!0;const n=t.changedTouches[0];e.$_vclosepopover_touchPoint=n,e.addEventListener("touchend",_M),e.addEventListener("touchcancel",wM)}}function _M(t){const e=t.currentTarget;if(e.$_vclosepopover_touch=!1,t.changedTouches.length===1){const n=t.changedTouches[0],r=e.$_vclosepopover_touchPoint;t.closePopover=Math.abs(n.screenY-r.screenY)<20&&Math.abs(n.screenX-r.screenX)<20,t.closeAllPopover=e.$_closePopoverModifiers&&!!e.$_closePopoverModifiers.all}}function wM(t){const e=t.currentTarget;e.$_vclosepopover_touch=!1}var bB={beforeMount(t,{value:e,modifiers:n}){t.$_closePopoverModifiers=n,(typeof e>"u"||e)&&vS(t)},updated(t,{value:e,oldValue:n,modifiers:r}){t.$_closePopoverModifiers=r,e!==n&&(typeof e>"u"||e?vS(t):yS(t))},beforeUnmount(t){yS(t)}};function _B(t,e={}){t.$_vTooltipInstalled||(t.$_vTooltipInstalled=!0,aM(jo,e),t.directive("tooltip",yB),t.directive("close-popper",bB),t.component("VTooltip",lB),t.component("VDropdown",sB),t.component("VMenu",aB))}const wB={version:"2.0.0-beta.20",install:_B,options:jo};function gf(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?gf=function(e){return typeof e}:gf=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gf(t)}function bS(t,e,n,r,i,o,s){try{var l=t[o](s),u=l.value}catch(f){n(f);return}l.done?e(u):Promise.resolve(u).then(r,i)}function kB(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function s(u){bS(o,r,i,s,l,"next",u)}function l(u){bS(o,r,i,s,l,"throw",u)}s(void 0)})}}function xB(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _S(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1),Ws=[],cm=!1,Cp=0,xM=-1,vf,yf,BB=function(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;var n=window.getComputedStyle(e);return["auto","scroll"].includes(n.overflowY)&&e.scrollHeight>e.clientHeight},$B=function(e,n){return!(e.scrollTop===0&&n<0||e.scrollTop+e.clientHeight+n>=e.scrollHeight&&n>0)},HB=function(e){for(var n=[];e;){if(n.push(e),e.classList.contains("vfm"))return n;e=e.parentElement}return n},FB=function(e,n){var r=!1,i=HB(e);return i.forEach(function(o){BB(o)&&$B(o,n)&&(r=!0)}),r},SM=function(e){return Ws.some(function(){return FB(e,-Cp)})},fm=function(e){var n=e||window.event;return SM(n.target)||n.touches.length>1?!0:(n.preventDefault&&n.preventDefault(),!1)},VB=function(e){if(yf===void 0){var n=!!e&&e.reserveScrollBarGap===!0,r=window.innerWidth-document.documentElement.clientWidth;if(n&&r>0){var i=parseInt(getComputedStyle(document.body).getPropertyValue("padding-right"),10);yf=document.body.style.paddingRight,document.body.style.paddingRight="".concat(i+r,"px")}}vf===void 0&&(vf=document.body.style.overflow,document.body.style.overflow="hidden")},jB=function(){yf!==void 0&&(document.body.style.paddingRight=yf,yf=void 0),vf!==void 0&&(document.body.style.overflow=vf,vf=void 0)},WB=function(e){return e?e.scrollHeight-e.scrollTop<=e.clientHeight:!1},UB=function(e,n){return Cp=e.targetTouches[0].clientY-xM,SM(e.target)?!1:n&&n.scrollTop===0&&Cp>0||WB(n)&&Cp<0?fm(e):(e.stopPropagation(),!0)},qB=function(e,n){if(!e){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(!Ws.some(function(i){return i.targetElement===e})){var r={targetElement:e,options:n||{}};Ws=[].concat(ml(Ws),[r]),kM?(e.ontouchstart=function(i){i.targetTouches.length===1&&(xM=i.targetTouches[0].clientY)},e.ontouchmove=function(i){i.targetTouches.length===1&&UB(i,e)},cm||(document.addEventListener("touchmove",fm,k_?{passive:!1}:void 0),cm=!0)):VB(n)}},w0=function(e){if(!e){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}Ws=Ws.filter(function(n){return n.targetElement!==e}),kM?(e.ontouchstart=null,e.ontouchmove=null,cm&&Ws.length===0&&(document.removeEventListener("touchmove",fm,k_?{passive:!1}:void 0),cm=!1)):Ws.length||jB()},Vh=function(){},no={Enter:"enter",Entering:"entering",Leave:"leave",Leaving:"leavng"},KB={t:"ns-resize",tr:"nesw-resize",r:"ew-resize",br:"nwse-resize",b:"ns-resize",bl:"nesw-resize",l:"ew-resize",tl:"nwse-resize"},Og={props:{name:{type:String,default:null},modelValue:{type:Boolean,default:!1},ssr:{type:Boolean,default:!0},classes:{type:[String,Object,Array],default:""},overlayClass:{type:[String,Object,Array],default:""},contentClass:{type:[String,Object,Array],default:""},styles:{type:[Object,Array],default:function(){return{}}},overlayStyle:{type:[Object,Array],default:function(){return{}}},contentStyle:{type:[Object,Array],default:function(){return{}}},lockScroll:{type:Boolean,default:!0},hideOverlay:{type:Boolean,default:!1},clickToClose:{type:Boolean,default:!0},escToClose:{type:Boolean,default:!1},preventClick:{type:Boolean,default:!1},attach:{type:null,default:!1,validator:function(e){var n=gf(e);return n==="boolean"||n==="string"?!0:e.nodeType===Node.ELEMENT_NODE}},transition:{type:[String,Object],default:"vfm"},overlayTransition:{type:[String,Object],default:"vfm"},keepOverlay:{type:Boolean,default:!1},zIndexAuto:{type:Boolean,default:!0},zIndexBase:{type:[String,Number],default:1e3},zIndex:{type:[Boolean,String,Number],default:!1},focusRetain:{type:Boolean,default:!0},focusTrap:{type:Boolean,default:!1},fitParent:{type:Boolean,default:!0},drag:{type:Boolean,default:!1},dragSelector:{type:String,default:""},keepChangedStyle:{type:Boolean,default:!1},resize:{type:Boolean,default:!1},resizeDirections:{type:Array,default:function(){return["t","tr","r","br","b","bl","l","tl"]},validator:function(e){return["t","tr","r","br","b","bl","l","tl"].filter(function(n){return e.indexOf(n)!==-1}).length===e.length}},minWidth:{type:Number,default:0},minHeight:{type:Number,default:0},maxWidth:{type:Number,default:1/0},maxHeight:{type:Number,default:1/0}},emits:["update:modelValue","click-outside","before-open","opened","before-close","closed","_before-open","_opened","_closed","drag:start","drag:move","drag:end","resize:start","resize:move","resize:end"],setup:function(e,n){var r=n.emit,i=Symbol("vfm"),o=Ot(null),s=Ot(null),l=Ot(null),u=Ot(null),f=Ot(null),d=Ot(null),m=Ot(null),v=new PB,y=Ot(!1),_=Al({modal:!1,overlay:!1,resize:!1}),C=Ot(null),x=Ot(null),k=Ot(!1),A=Ot({}),N=Ot({}),E=Ot(null),H=Ot(null),I=Vh,q=Vh,P=er(function(){return typeof e.overlayTransition=="string"?{name:e.overlayTransition}:Dr({},e.overlayTransition)}),z=er(function(){return typeof e.transition=="string"?{name:e.transition}:Dr({},e.transition)}),w=er(function(){return(e.hideOverlay||C.value===no.Leave)&&x.value===no.Leave}),R=er(function(){return e.zIndex===!1?e.zIndexAuto?+e.zIndexBase+2*(m.value||0):!1:e.zIndex}),U=er(function(){return Dr({},R.value!==!1&&{zIndex:R.value})}),K=er(function(){var O=[N.value];return Array.isArray(e.contentStyle)?O.push.apply(O,ml(e.contentStyle)):O.push(e.contentStyle),O});En(function(){return e.modelValue},function(O){if(k.value){k.value=!1;return}if(D(),!O){if(ie("before-close",!0)){q("hide");return}ae()}}),En(function(){return e.lockScroll},ce),En(function(){return e.hideOverlay},function(O){e.modelValue&&!O&&(_.overlay=!0)}),En(function(){return e.attach},D),En(w,function(O){O&&(y.value=!1,s.value.style.display="none")},{flush:"post"}),En(function(){return e.drag},function(O){y.value&&(O?xe():G())}),En(function(){return e.resize},function(O){y.value&&(O?Z():L())}),En(function(){return e.keepChangedStyle},function(O){O||(N.value={})}),ts(function(){e.api.modals.push(oe()),D()}),Ml(function(){var O;ae(),e.lockScroll&&s.value&&w0(s.value),o==null||(O=o.value)===null||O===void 0||O.remove();var j=e.api.modals.findIndex(function(F){return F.uid===i});e.api.modals.splice(j,1)});function oe(){return{uid:i,props:e,emit:r,vfmContainer:s,vfmContent:l,vfmResize:u,vfmOverlayTransition:f,vfmTransition:d,getAttachElement:ve,modalStackIndex:m,visibility:_,handleLockScroll:ce,$focusTrap:v,toggle:be,params:A}}function D(){if(e.modelValue){if(r("_before-open",at({type:"_before-open"})),ie("before-open",!1)){q("show");return}var O=ve();if(O||e.attach===!1){if(e.attach!==!1)if(o.value)O.appendChild(o.value);else{y.value=!0,Ri(function(){D()});return}var j=e.api.openedModals.findIndex(function(F){return F.uid===i});j!==-1&&e.api.openedModals.splice(j,1),e.api.openedModals.push(oe()),m.value=e.api.openedModals.length-1,ce(),e.api.openedModals.filter(function(F){return F.uid!==i}).forEach(function(F,Q){F.getAttachElement()===O&&(F.modalStackIndex.value=Q,!F.props.keepOverlay&&(F.visibility.overlay=!1))}),y.value=!0,ze()}else O!==!1&&console.warn("Unable to locate target ".concat(e.attach))}}function ae(){var O=e.api.openedModals.findIndex(function(F){return F.uid===i});if(O!==-1&&e.api.openedModals.splice(O,1),e.api.openedModals.length>0){var j=e.api.openedModals[e.api.openedModals.length-1];j.props.focusTrap&&j.$focusTrap.firstElement().focus(),(j.props.focusRetain||j.props.focusTrap)&&j.vfmContainer.value.focus(),!j.props.hideOverlay&&(j.visibility.overlay=!0)}e.drag&&G(),e.resize&&L(),E.value=null,qe()}function ce(){e.modelValue&&Ri(function(){e.lockScroll?qB(s.value,{reserveScrollBarGap:!0}):w0(s.value)})}function ve(){var O;return e.attach===!1?O=!1:typeof e.attach=="string"?window?O=window.document.querySelector(e.attach):O=!1:O=e.attach,O}function ze(){_.overlay=!0,_.modal=!0}function qe(){_.overlay=!1,_.modal=!1}function vt(){C.value=no.Entering}function mt(){C.value=no.Enter}function bt(){C.value=no.Leaving}function yt(){C.value=no.Leave}function Xe(){x.value=no.Entering}function Ie(){x.value=no.Enter,(e.focusRetain||e.focusTrap)&&s.value.focus(),e.focusTrap&&v.enable(s.value),e.drag&&xe(),e.resize&&Z(),r("_opened"),r("opened",at({type:"opened"})),I("show")}function Be(){x.value=no.Leaving,v.enabled()&&v.disable()}function Ee(){x.value=no.Leave,m.value=null,e.lockScroll&&w0(s.value),e.keepChangedStyle||(N.value={});var O=!1,j=at({type:"closed",stop:function(){O=!0}});r("_closed"),r("closed",j),I("hide"),!O&&(A.value={})}function Ze(O){H.value=O==null?void 0:O.target}function Ke(){H.value===s.value&&E.value!=="resize:move"&&(r("click-outside",at({type:"click-outside"})),e.clickToClose&&r("update:modelValue",!1))}function Fe(){y.value&&e.escToClose&&r("update:modelValue",!1)}function at(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Dr({ref:oe()},O)}function ie(O,j){var F=!1,Q=at({type:O,stop:function(){F=!0}});return r(O,Q),F?(k.value=!0,Ri(function(){r("update:modelValue",j)}),!0):!1}function ne(O,j,F){E.value="".concat(j,":").concat(F),r(E.value,O)}function be(O,j){var F=arguments;return new Promise(function(Q,le){I=function(Y){Q(Y),I=Vh},q=function(Y){le(Y),q=Vh};var pe=typeof O=="boolean"?O:!e.modelValue;pe&&F.length===2&&(A.value=j),r("update:modelValue",pe)})}function _e(O){O.stopPropagation();var j="resize",F="drag",Q=O.target.getAttribute("direction"),le;if(Q)le=j;else if(zB(O,l.value,e.dragSelector))le=F;else return;ne(O,le,"start");var pe=xS(O),ye=s.value.getBoundingClientRect(),Y=l.value.getBoundingClientRect(),X=window.getComputedStyle(l.value).position==="absolute",de={top:SS(N.value.top),left:SS(N.value.left)},Te=function(){if(e.fitParent){var Le={absolute:function(){return{minTop:0,minLeft:0,maxTop:ye.height-Y.height,maxLeft:ye.width-Y.width}},relative:function(){return{minTop:de.top+ye.top-Y.top,minLeft:de.left+ye.left-Y.left,maxTop:de.top+ye.bottom-Y.bottom,maxLeft:de.left+ye.right-Y.right}}};return X?Le.absolute():Le.relative()}else return{}}(),je=le===j&&DB(document.body,"cursor",KB[Q]),he=function(me){me.stopPropagation(),ne(me,le,"move");var Je=xS(me),ct={x:Je.x-pe.x,y:Je.y-pe.y};le===j&&(ct=W(Q,ct,ye,Y,X));var ot,Ct;X?(ot=Y.top-ye.top+ct.y,Ct=Y.left-ye.left+ct.x):(ot=de.top+ct.y,Ct=de.left+ct.x),le===F&&e.fitParent&&(ot=$h(Te.minTop,ot,Te.maxTop),Ct=$h(Te.minLeft,Ct,Te.maxLeft));var yr=Dr(Dr(Dr({position:"relative",top:ot+"px",left:Ct+"px",margin:"unset",touchAction:"none"},X&&{position:"absolute",transform:"unset",width:Y.width+"px",height:Y.height+"px"}),ct.width&&{width:ct.width+"px"}),ct.height&&{height:ct.height+"px"});N.value=Dr(Dr({},N.value),yr)},Ae=function Le(me){me.stopPropagation(),le===j&&je&&je(),setTimeout(function(){ne(me,le,"end")}),Fh("move",document,he),Fh("up",document,Le)};Hh("move",document,he),Hh("up",document,Ae)}function xe(){Hh("down",l.value,_e),N.value.touchAction="none"}function G(){Fh("down",l.value,_e)}function Z(){_.resize=!0,Ri(function(){Hh("down",u.value,_e)})}function L(){Fh("down",u.value,_e),_.resize=!1}function W(O,j,F,Q,le){var pe=function(Te){var je,he=j[Te.axis];he=e.fitParent?$h(Te.min,he,Te.max):he;var Ae=$h(Te.minEdge,Te.getEdge(he),Te.maxEdge);return he=Te.getOffsetAxis(Ae,le),je={},Au(je,Te.edgeName,Ae),Au(je,Te.axis,he),je},ye=function(Te,je,he,Ae){var Le=Q[je],me=F[Te]-Q[Te],Je=RB(je);return{axis:he,edgeName:je,min:Ae?me:-Le,max:Ae?Le:me,minEdge:e["min".concat(Je)],maxEdge:e["max".concat(Je)],getEdge:function(ot){return Q[je]-ot*(Ae?1:-1)},getOffsetAxis:function(ot,Ct){var yr=Q[je]-ot;return Ct?Ae?yr:0:(Ae?1:-1)*yr/2}}},Y={t:["top","height","y",!0],b:["bottom","height","y",!1],l:["left","width","x",!0],r:["right","width","x",!1]},X={x:0,y:0};return O.split("").forEach(function(de){var Te=ye.apply(void 0,ml(Y[de]));X=Dr(Dr({},X),pe(Te))}),X}return{root:o,vfmContainer:s,vfmContent:l,vfmResize:u,vfmOverlayTransition:f,vfmTransition:d,computedOverlayTransition:P,computedTransition:z,visible:y,visibility:_,params:A,calculateZIndex:R,bindStyle:U,bindContentStyle:K,beforeOverlayEnter:vt,afterOverlayEnter:mt,beforeOverlayLeave:bt,afterOverlayLeave:yt,beforeModalEnter:Xe,afterModalEnter:Ie,beforeModalLeave:Be,afterModalLeave:Ee,onMousedown:Ze,onMouseupContainer:Ke,onEsc:Fe}}},k0=z1();D1("data-v-2836fdb5");var GB={key:0,ref:"vfmResize",class:"vfm__resize vfm--absolute vfm--inset vfm--prevent-none vfm--select-none vfm--touch-none"};R1();var YB=k0(function(t,e,n,r,i,o){return n.ssr||r.visible?Ut((ge(),Et("div",{key:0,ref:"root",style:r.bindStyle,class:["vfm vfm--inset",[n.attach===!1?"vfm--fixed":"vfm--absolute",{"vfm--prevent-none":n.preventClick}]],onKeydown:e[4]||(e[4]=Tu(function(){return r.onEsc&&r.onEsc.apply(r,arguments)},["esc"]))},[Qe(zu,wi(r.computedOverlayTransition,{onBeforeEnter:r.beforeOverlayEnter,onAfterEnter:r.afterOverlayEnter,onBeforeLeave:r.beforeOverlayLeave,onAfterLeave:r.afterOverlayLeave}),{default:k0(function(){return[!n.hideOverlay&&r.visibility.overlay?(ge(),Et("div",{key:0,class:["vfm__overlay vfm--overlay vfm--absolute vfm--inset",n.overlayClass],style:n.overlayStyle},null,6)):_t("v-if",!0)]}),_:1},16,["onBeforeEnter","onAfterEnter","onBeforeLeave","onAfterLeave"]),Qe(zu,wi(r.computedTransition,{onBeforeEnter:r.beforeModalEnter,onAfterEnter:r.afterModalEnter,onBeforeLeave:r.beforeModalLeave,onAfterLeave:r.afterModalLeave}),{default:k0(function(){return[Ut(Qe("div",{ref:"vfmContainer",class:["vfm__container vfm--absolute vfm--inset vfm--outline-none",n.classes],style:n.styles,"aria-expanded":r.visibility.modal.toString(),role:"dialog","aria-modal":"true",tabindex:"-1",onMouseup:e[2]||(e[2]=lt(function(){return r.onMouseupContainer&&r.onMouseupContainer.apply(r,arguments)},["self"])),onMousedown:e[3]||(e[3]=lt(function(){return r.onMousedown&&r.onMousedown.apply(r,arguments)},["self"]))},[Qe("div",{ref:"vfmContent",class:["vfm__content",[n.contentClass,{"vfm--prevent-auto":n.preventClick}]],style:r.bindContentStyle,onMousedown:e[1]||(e[1]=function(s){return r.onMousedown(null)})},[pn(t.$slots,"default",{params:r.params,close:function(){return t.$emit("update:modelValue",!1)}}),r.visibility.resize&&r.visibility.modal?(ge(),Et("div",GB,[(ge(!0),Et(kt,null,Zt(n.resizeDirections,function(s){return ge(),Et("div",{key:s,direction:s,class:["vfm--resize-".concat(s),"vfm--absolute vfm--prevent-auto"]},null,10,["direction"])}),128))],512)):_t("v-if",!0)],38)],46,["aria-expanded"]),[[Bu,r.visibility.modal]])]}),_:3},16,["onBeforeEnter","onAfterEnter","onBeforeLeave","onAfterLeave"])],38)),[[Bu,!n.ssr||r.visible]]):_t("v-if",!0)});function JB(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(!t||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}var XB=` -======== -var VP=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Tue=VP((ri,ii)=>{/** -* @vue/shared v3.4.15 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function ai(t,e){const n=new Set(t.split(","));return e?r=>n.has(r.toLowerCase()):r=>n.has(r)}const Ft={},bu=[],An=()=>{},yp=()=>!1,Cl=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),b1=t=>t.startsWith("onUpdate:"),Rt=Object.assign,_1=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},jP=Object.prototype.hasOwnProperty,Dt=(t,e)=>jP.call(t,e),We=Array.isArray,_u=t=>oc(t)==="[object Map]",Tl=t=>oc(t)==="[object Set]",Gx=t=>oc(t)==="[object Date]",WP=t=>oc(t)==="[object RegExp]",pt=t=>typeof t=="function",xt=t=>typeof t=="string",Vi=t=>typeof t=="symbol",qt=t=>t!==null&&typeof t=="object",w1=t=>(qt(t)||pt(t))&&pt(t.then)&&pt(t.catch),CA=Object.prototype.toString,oc=t=>CA.call(t),UP=t=>oc(t).slice(8,-1),TA=t=>oc(t)==="[object Object]",k1=t=>xt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Ya=ai(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),qP=ai("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),ig=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},KP=/-(\w)/g,bn=ig(t=>t.replace(KP,(e,n)=>n?n.toUpperCase():"")),GP=/\B([A-Z])/g,ni=ig(t=>t.replace(GP,"-$1").toLowerCase()),El=ig(t=>t.charAt(0).toUpperCase()+t.slice(1)),wu=ig(t=>t?`on${El(t)}`:""),ji=(t,e)=>!Object.is(t,e),ku=(t,e)=>{for(let n=0;n{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n})},zf=t=>{const e=parseFloat(t);return isNaN(e)?t:e},$p=t=>{const e=xt(t)?Number(t):NaN;return isNaN(e)?t:e};let Yx;const x1=()=>Yx||(Yx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),YP="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error",JP=ai(YP);function oi(t){if(We(t)){const e={};for(let n=0;n{if(n){const r=n.split(ZP);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function vt(t){let e="";if(xt(t))e=t;else if(We(t))for(let n=0;nqo(n,e))}const Le=t=>xt(t)?t:t==null?"":We(t)||qt(t)&&(t.toString===CA||!pt(t.toString))?JSON.stringify(t,MA,2):String(t),MA=(t,e)=>e&&e.__v_isRef?MA(t,e.value):_u(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[r,i],o)=>(n[ay(r,o)+" =>"]=i,n),{})}:Tl(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>ay(n))}:Vi(e)?ay(e):qt(e)&&!We(e)&&!TA(e)?String(e):e,ay=(t,e="")=>{var n;return Vi(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};/** -* @vue/reactivity v3.4.15 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let Zr;class S1{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=Zr,!e&&Zr&&(this.index=(Zr.scopes||(Zr.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const n=Zr;try{return Zr=this,e()}finally{Zr=n}}}on(){Zr=this}off(){Zr=this.parent}stop(e){if(this._active){let n,r;for(n=0,r=this.effects.length;n=2))break}this._dirtyLevel<2&&(this._dirtyLevel=0),ca()}return this._dirtyLevel>=2}set dirty(e){this._dirtyLevel=e?2:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=Gs,n=Ja;try{return Gs=!0,Ja=this,this._runnings++,Jx(this),this.fn()}finally{Xx(this),this._runnings--,Ja=n,Gs=e}}stop(){var e;this.active&&(Jx(this),Xx(this),(e=this.onStop)==null||e.call(this),this.active=!1)}}function hD(t){return t.value}function Jx(t){t._trackId++,t._depsLength=0}function Xx(t){if(t.deps&&t.deps.length>t._depsLength){for(let e=t._depsLength;e{n.dirty&&n.run()});e&&(Rt(n,e),e.scope&&NA(n,e.scope)),(!e||!e.lazy)&&n.run();const r=n.run.bind(n);return r.effect=n,r}function mD(t){t.effect.stop()}let Gs=!0,E0=0;const PA=[];function ua(){PA.push(Gs),Gs=!1}function ca(){const t=PA.pop();Gs=t===void 0?!0:t}function C1(){E0++}function T1(){for(E0--;!E0&&A0.length;)A0.shift()()}function DA(t,e,n){if(e.get(t)!==t._trackId){e.set(t,t._trackId);const r=t.deps[t._depsLength];r!==e?(r&&IA(r,t),t.deps[t._depsLength++]=e):t._depsLength++}}const A0=[];function RA(t,e,n){C1();for(const r of t.keys())if(r._dirtyLevel{const n=new Map;return n.cleanup=t,n.computed=e,n},Hp=new WeakMap,Xa=Symbol(""),O0=Symbol("");function Wr(t,e,n){if(Gs&&Ja){let r=Hp.get(t);r||Hp.set(t,r=new Map);let i=r.get(n);i||r.set(n,i=BA(()=>r.delete(n))),DA(Ja,i)}}function Vo(t,e,n,r,i,o){const s=Hp.get(t);if(!s)return;let l=[];if(e==="clear")l=[...s.values()];else if(n==="length"&&We(t)){const u=Number(r);s.forEach((f,d)=>{(d==="length"||!Vi(d)&&d>=u)&&l.push(f)})}else switch(n!==void 0&&l.push(s.get(n)),e){case"add":We(t)?k1(n)&&l.push(s.get("length")):(l.push(s.get(Xa)),_u(t)&&l.push(s.get(O0)));break;case"delete":We(t)||(l.push(s.get(Xa)),_u(t)&&l.push(s.get(O0)));break;case"set":_u(t)&&l.push(s.get(Xa));break}C1();for(const u of l)u&&RA(u,2);T1()}function gD(t,e){var n;return(n=Hp.get(t))==null?void 0:n.get(e)}const vD=ai("__proto__,__v_isRef,__isVue"),$A=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Vi)),Zx=yD();function yD(){const t={};return["includes","indexOf","lastIndexOf"].forEach(e=>{t[e]=function(...n){const r=Mt(this);for(let o=0,s=this.length;o{t[e]=function(...n){ua(),C1();const r=Mt(this)[e].apply(this,n);return T1(),ca(),r}}),t}function bD(t){const e=Mt(this);return Wr(e,"has",t),e.hasOwnProperty(t)}class HA{constructor(e=!1,n=!1){this._isReadonly=e,this._shallow=n}get(e,n,r){const i=this._isReadonly,o=this._shallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(i?o?qA:UA:o?WA:jA).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const s=We(e);if(!i){if(s&&Dt(Zx,n))return Reflect.get(Zx,n,r);if(n==="hasOwnProperty")return bD}const l=Reflect.get(e,n,r);return(Vi(n)?$A.has(n):vD(n))||(i||Wr(e,"get",n),o)?l:qn(l)?s&&k1(n)?l:l.value:qt(l)?i?A1(l):Al(l):l}}class FA extends HA{constructor(e=!1){super(!1,e)}set(e,n,r,i){let o=e[n];if(!this._shallow){const u=ll(o);if(!Bf(r)&&!ll(r)&&(o=Mt(o),r=Mt(r)),!We(e)&&qn(o)&&!qn(r))return u?!1:(o.value=r,!0)}const s=We(e)&&k1(n)?Number(n)t,sg=t=>Reflect.getPrototypeOf(t);function Ch(t,e,n=!1,r=!1){t=t.__v_raw;const i=Mt(t),o=Mt(e);n||(ji(e,o)&&Wr(i,"get",e),Wr(i,"get",o));const{has:s}=sg(i),l=r?E1:n?M1:$f;if(s.call(i,e))return l(t.get(e));if(s.call(i,o))return l(t.get(o));t!==i&&t.get(e)}function Th(t,e=!1){const n=this.__v_raw,r=Mt(n),i=Mt(t);return e||(ji(t,i)&&Wr(r,"has",t),Wr(r,"has",i)),t===i?n.has(t):n.has(t)||n.has(i)}function Eh(t,e=!1){return t=t.__v_raw,!e&&Wr(Mt(t),"iterate",Xa),Reflect.get(t,"size",t)}function Qx(t){t=Mt(t);const e=Mt(this);return sg(e).has.call(e,t)||(e.add(t),Vo(e,"add",t,t)),this}function eS(t,e){e=Mt(e);const n=Mt(this),{has:r,get:i}=sg(n);let o=r.call(n,t);o||(t=Mt(t),o=r.call(n,t));const s=i.call(n,t);return n.set(t,e),o?ji(e,s)&&Vo(n,"set",t,e):Vo(n,"add",t,e),this}function tS(t){const e=Mt(this),{has:n,get:r}=sg(e);let i=n.call(e,t);i||(t=Mt(t),i=n.call(e,t)),r&&r.call(e,t);const o=e.delete(t);return i&&Vo(e,"delete",t,void 0),o}function nS(){const t=Mt(this),e=t.size!==0,n=t.clear();return e&&Vo(t,"clear",void 0,void 0),n}function Ah(t,e){return function(r,i){const o=this,s=o.__v_raw,l=Mt(s),u=e?E1:t?M1:$f;return!t&&Wr(l,"iterate",Xa),s.forEach((f,d)=>r.call(i,u(f),u(d),o))}}function Oh(t,e,n){return function(...r){const i=this.__v_raw,o=Mt(i),s=_u(o),l=t==="entries"||t===Symbol.iterator&&s,u=t==="keys"&&s,f=i[t](...r),d=n?E1:e?M1:$f;return!e&&Wr(o,"iterate",u?O0:Xa),{next(){const{value:m,done:v}=f.next();return v?{value:m,done:v}:{value:l?[d(m[0]),d(m[1])]:d(m),done:v}},[Symbol.iterator](){return this}}}}function ks(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function SD(){const t={get(o){return Ch(this,o)},get size(){return Eh(this)},has:Th,add:Qx,set:eS,delete:tS,clear:nS,forEach:Ah(!1,!1)},e={get(o){return Ch(this,o,!1,!0)},get size(){return Eh(this)},has:Th,add:Qx,set:eS,delete:tS,clear:nS,forEach:Ah(!1,!0)},n={get(o){return Ch(this,o,!0)},get size(){return Eh(this,!0)},has(o){return Th.call(this,o,!0)},add:ks("add"),set:ks("set"),delete:ks("delete"),clear:ks("clear"),forEach:Ah(!0,!1)},r={get(o){return Ch(this,o,!0,!0)},get size(){return Eh(this,!0)},has(o){return Th.call(this,o,!0)},add:ks("add"),set:ks("set"),delete:ks("delete"),clear:ks("clear"),forEach:Ah(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(o=>{t[o]=Oh(o,!1,!1),n[o]=Oh(o,!0,!1),e[o]=Oh(o,!1,!0),r[o]=Oh(o,!0,!0)}),[t,n,e,r]}const[CD,TD,ED,AD]=SD();function ag(t,e){const n=e?t?AD:ED:t?TD:CD;return(r,i,o)=>i==="__v_isReactive"?!t:i==="__v_isReadonly"?t:i==="__v_raw"?r:Reflect.get(Dt(n,i)&&i in r?n:r,i,o)}const OD={get:ag(!1,!1)},MD={get:ag(!1,!0)},ND={get:ag(!0,!1)},LD={get:ag(!0,!0)},jA=new WeakMap,WA=new WeakMap,UA=new WeakMap,qA=new WeakMap;function ID(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function PD(t){return t.__v_skip||!Object.isExtensible(t)?0:ID(UP(t))}function Al(t){return ll(t)?t:lg(t,!1,_D,OD,jA)}function Fp(t){return lg(t,!1,kD,MD,WA)}function A1(t){return lg(t,!0,wD,ND,UA)}function DD(t){return lg(t,!0,xD,LD,qA)}function lg(t,e,n,r,i){if(!qt(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const o=i.get(t);if(o)return o;const s=PD(t);if(s===0)return t;const l=new Proxy(t,s===2?r:n);return i.set(t,l),l}function Za(t){return ll(t)?Za(t.__v_raw):!!(t&&t.__v_isReactive)}function ll(t){return!!(t&&t.__v_isReadonly)}function Bf(t){return!!(t&&t.__v_isShallow)}function O1(t){return Za(t)||ll(t)}function Mt(t){const e=t&&t.__v_raw;return e?Mt(e):t}function fa(t){return Bp(t,"__v_skip",!0),t}const $f=t=>qt(t)?Al(t):t,M1=t=>qt(t)?A1(t):t;class KA{constructor(e,n,r,i){this._setter=n,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new Pu(()=>e(this._value),()=>xu(this,1),()=>this.dep&&zA(this.dep)),this.effect.computed=this,this.effect.active=this._cacheable=!i,this.__v_isReadonly=r}get value(){const e=Mt(this);return(!e._cacheable||e.effect.dirty)&&ji(e._value,e._value=e.effect.run())&&xu(e,2),N1(e),e.effect._dirtyLevel>=1&&xu(e,1),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function RD(t,e,n=!1){let r,i;const o=pt(t);return o?(r=t,i=An):(r=t.get,i=t.set),new KA(r,i,o||!i,n)}function N1(t){Gs&&Ja&&(t=Mt(t),DA(Ja,t.dep||(t.dep=BA(()=>t.dep=void 0,t instanceof KA?t:void 0))))}function xu(t,e=2,n){t=Mt(t);const r=t.dep;r&&RA(r,e)}function qn(t){return!!(t&&t.__v_isRef===!0)}function Ot(t){return YA(t,!1)}function GA(t){return YA(t,!0)}function YA(t,e){return qn(t)?t:new zD(t,e)}class zD{constructor(e,n){this.__v_isShallow=n,this.dep=void 0,this.__v_isRef=!0,this._rawValue=n?e:Mt(e),this._value=n?e:$f(e)}get value(){return N1(this),this._value}set value(e){const n=this.__v_isShallow||Bf(e)||ll(e);e=n?e:Mt(e),ji(e,this._rawValue)&&(this._rawValue=e,this._value=n?e:$f(e),xu(this,2))}}function BD(t){xu(t,2)}function fr(t){return qn(t)?t.value:t}function $D(t){return pt(t)?t():fr(t)}const HD={get:(t,e,n)=>fr(Reflect.get(t,e,n)),set:(t,e,n,r)=>{const i=t[e];return qn(i)&&!qn(n)?(i.value=n,!0):Reflect.set(t,e,n,r)}};function L1(t){return Za(t)?t:new Proxy(t,HD)}class FD{constructor(e){this.dep=void 0,this.__v_isRef=!0;const{get:n,set:r}=e(()=>N1(this),()=>xu(this));this._get=n,this._set=r}get value(){return this._get()}set value(e){this._set(e)}}function I1(t){return new FD(t)}function VD(t){const e=We(t)?new Array(t.length):{};for(const n in t)e[n]=JA(t,n);return e}class jD{constructor(e,n,r){this._object=e,this._key=n,this._defaultValue=r,this.__v_isRef=!0}get value(){const e=this._object[this._key];return e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return gD(Mt(this._object),this._key)}}class WD{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function UD(t,e,n){return qn(t)?t:pt(t)?new WD(t):qt(t)&&arguments.length>1?JA(t,e,n):Ot(t)}function JA(t,e,n){const r=t[e];return qn(r)?r:new jD(t,e,n)}const qD={GET:"get",HAS:"has",ITERATE:"iterate"},KD={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"};/** -* @vue/runtime-core v3.4.15 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/const sf=[];function Ea(t,...e){ua();const n=sf.length?sf[sf.length-1].component:null,r=n&&n.appContext.config.warnHandler,i=GD();if(r)mo(r,n,11,[t+e.join(""),n&&n.proxy,i.map(({vnode:o})=>`at <${GO(n,o.type)}>`).join(` -`),i]);else{const o=[`[Vue warn]: ${t}`,...e];i.length&&o.push(` -`,...YD(i)),console.warn(...o)}ca()}function GD(){let t=sf[sf.length-1];if(!t)return[];const e=[];for(;t;){const n=e[0];n&&n.vnode===t?n.recurseCount++:e.push({vnode:t,recurseCount:0});const r=t.component&&t.component.parent;t=r&&r.vnode}return e}function YD(t){const e=[];return t.forEach((n,r)=>{e.push(...r===0?[]:[` -`],...JD(n))}),e}function JD({vnode:t,recurseCount:e}){const n=e>0?`... (${e} recursive calls)`:"",r=t.component?t.component.parent==null:!1,i=` at <${GO(t.component,t.type,r)}`,o=">"+n;return t.props?[i,...XD(t.props),o]:[i+o]}function XD(t){const e=[],n=Object.keys(t);return n.slice(0,3).forEach(r=>{e.push(...XA(r,t[r]))}),n.length>3&&e.push(" ..."),e}function XA(t,e,n){return xt(e)?(e=JSON.stringify(e),n?e:[`${t}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?n?e:[`${t}=${e}`]:qn(e)?(e=XA(t,Mt(e.value),!0),n?e:[`${t}=Ref<`,e,">"]):pt(e)?[`${t}=fn${e.name?`<${e.name}>`:""}`]:(e=Mt(e),n?e:[`${t}=`,e])}function ZD(t,e){}const QD={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",WATCH_GETTER:2,2:"WATCH_GETTER",WATCH_CALLBACK:3,3:"WATCH_CALLBACK",WATCH_CLEANUP:4,4:"WATCH_CLEANUP",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER"},eR={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",[0]:"setup function",[1]:"render function",[2]:"watcher getter",[3]:"watcher callback",[4]:"watcher cleanup function",[5]:"native event handler",[6]:"component event handler",[7]:"vnode hook",[8]:"directive hook",[9]:"transition hook",[10]:"app errorHandler",[11]:"app warnHandler",[12]:"ref function",[13]:"async component loader",[14]:"scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."};function mo(t,e,n,r){let i;try{i=r?t(...r):t()}catch(o){Ol(o,e,n)}return i}function si(t,e,n,r){if(pt(t)){const o=mo(t,e,n,r);return o&&w1(o)&&o.catch(s=>{Ol(s,e,n)}),o}const i=[];for(let o=0;o>>1,i=dr[r],o=Ff(i);olo&&dr.splice(e,1)}function Vp(t){We(t)?Su.push(...t):(!Is||!Is.includes(t,t.allowRecurse?Ra+1:Ra))&&Su.push(t),QA()}function rS(t,e,n=Hf?lo+1:0){for(;nFf(n)-Ff(r));if(Su.length=0,Is){Is.push(...e);return}for(Is=e,Ra=0;Rat.id==null?1/0:t.id,iR=(t,e)=>{const n=Ff(t)-Ff(e);if(n===0){if(t.pre&&!e.pre)return-1;if(e.pre&&!t.pre)return 1}return n};function eO(t){M0=!1,Hf=!0,dr.sort(iR);const e=An;try{for(lo=0;losu.emit(i,...o)),Mh=[]):typeof window<"u"&&window.HTMLElement&&!((r=(n=window.navigator)==null?void 0:n.userAgent)!=null&&r.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{tO(o,e)}),setTimeout(()=>{su||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Mh=[])},3e3)):Mh=[]}function oR(t,e,...n){if(t.isUnmounted)return;const r=t.vnode.props||Ft;let i=n;const o=e.startsWith("update:"),s=o&&e.slice(7);if(s&&s in r){const d=`${s==="modelValue"?"model":s}Modifiers`,{number:m,trim:v}=r[d]||Ft;v&&(i=n.map(y=>xt(y)?y.trim():y)),m&&(i=n.map(zf))}let l,u=r[l=wu(e)]||r[l=wu(bn(e))];!u&&o&&(u=r[l=wu(ni(e))]),u&&si(u,t,6,i);const f=r[l+"Once"];if(f){if(!t.emitted)t.emitted={};else if(t.emitted[l])return;t.emitted[l]=!0,si(f,t,6,i)}}function nO(t,e,n=!1){const r=e.emitsCache,i=r.get(t);if(i!==void 0)return i;const o=t.emits;let s={},l=!1;if(!pt(t)){const u=f=>{const d=nO(f,e,!0);d&&(l=!0,Rt(s,d))};!n&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}return!o&&!l?(qt(t)&&r.set(t,null),null):(We(o)?o.forEach(u=>s[u]=null):Rt(s,o),qt(t)&&r.set(t,s),s)}function cg(t,e){return!t||!Cl(e)?!1:(e=e.slice(2).replace(/Once$/,""),Dt(t,e[0].toLowerCase()+e.slice(1))||Dt(t,ni(e))||Dt(t,e))}let On=null,fg=null;function Vf(t){const e=On;return On=t,fg=t&&t.type.__scopeId||null,e}function D1(t){fg=t}function R1(){fg=null}const z1=t=>Vt;function Vt(t,e=On,n){if(!e||t._n)return t;const r=(...i)=>{r._d&&$0(-1);const o=Vf(e);let s;try{s=t(...i)}finally{Vf(o),r._d&&$0(1)}return s};return r._n=!0,r._c=!0,r._d=!0,r}function bp(t){const{type:e,vnode:n,proxy:r,withProxy:i,props:o,propsOptions:[s],slots:l,attrs:u,emit:f,render:d,renderCache:m,data:v,setupState:y,ctx:_,inheritAttrs:C}=t;let x,k;const A=Vf(t);try{if(n.shapeFlag&4){const E=i||r,H=E;x=ei(d.call(H,E,m,o,y,v,_)),k=u}else{const E=e;x=ei(E.length>1?E(o,{attrs:u,slots:l,emit:f}):E(o,null)),k=e.props?u:aR(u)}}catch(E){cf.length=0,Ol(E,t,1),x=Qe(pr)}let L=x;if(k&&C!==!1){const E=Object.keys(k),{shapeFlag:H}=L;E.length&&H&7&&(s&&E.some(b1)&&(k=lR(k,s)),L=yo(L,k))}return n.dirs&&(L=yo(L),L.dirs=L.dirs?L.dirs.concat(n.dirs):n.dirs),n.transition&&(L.transition=n.transition),x=L,Vf(A),x}function sR(t,e=!0){let n;for(let r=0;r{let e;for(const n in t)(n==="class"||n==="style"||Cl(n))&&((e||(e={}))[n]=t[n]);return e},lR=(t,e)=>{const n={};for(const r in t)(!b1(r)||!(r.slice(9)in e))&&(n[r]=t[r]);return n};function uR(t,e,n){const{props:r,children:i,component:o}=t,{props:s,children:l,patchFlag:u}=e,f=o.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&u>=0){if(u&1024)return!0;if(u&16)return r?iS(r,s,f):!!s;if(u&8){const d=e.dynamicProps;for(let m=0;mt.__isSuspense;let N0=0;const fR={name:"Suspense",__isSuspense:!0,process(t,e,n,r,i,o,s,l,u,f){if(t==null)hR(e,n,r,i,o,s,l,u,f);else{if(o&&o.deps>0){e.suspense=t.suspense;return}pR(t,e,n,r,i,s,l,u,f)}},hydrate:mR,create:F1,normalize:gR},dR=fR;function jf(t,e){const n=t.props&&t.props[e];pt(n)&&n()}function hR(t,e,n,r,i,o,s,l,u){const{p:f,o:{createElement:d}}=u,m=d("div"),v=t.suspense=F1(t,i,r,e,m,n,o,s,l,u);f(null,v.pendingBranch=t.ssContent,m,null,r,v,o,s),v.deps>0?(jf(t,"onPending"),jf(t,"onFallback"),f(null,t.ssFallback,e,n,r,null,o,s),Cu(v,t.ssFallback)):v.resolve(!1,!0)}function pR(t,e,n,r,i,o,s,l,{p:u,um:f,o:{createElement:d}}){const m=e.suspense=t.suspense;m.vnode=e,e.el=t.el;const v=e.ssContent,y=e.ssFallback,{activeBranch:_,pendingBranch:C,isInFallback:x,isHydrating:k}=m;if(C)m.pendingBranch=v,Ii(v,C)?(u(C,v,m.hiddenContainer,null,i,m,o,s,l),m.deps<=0?m.resolve():x&&(k||(u(_,y,n,r,i,null,o,s,l),Cu(m,y)))):(m.pendingId=N0++,k?(m.isHydrating=!1,m.activeBranch=C):f(C,i,m),m.deps=0,m.effects.length=0,m.hiddenContainer=d("div"),x?(u(null,v,m.hiddenContainer,null,i,m,o,s,l),m.deps<=0?m.resolve():(u(_,y,n,r,i,null,o,s,l),Cu(m,y))):_&&Ii(v,_)?(u(_,v,n,r,i,m,o,s,l),m.resolve(!0)):(u(null,v,m.hiddenContainer,null,i,m,o,s,l),m.deps<=0&&m.resolve()));else if(_&&Ii(v,_))u(_,v,n,r,i,m,o,s,l),Cu(m,v);else if(jf(e,"onPending"),m.pendingBranch=v,v.shapeFlag&512?m.pendingId=v.component.suspenseId:m.pendingId=N0++,u(null,v,m.hiddenContainer,null,i,m,o,s,l),m.deps<=0)m.resolve();else{const{timeout:A,pendingId:L}=m;A>0?setTimeout(()=>{m.pendingId===L&&m.fallback(y)},A):A===0&&m.fallback(y)}}function F1(t,e,n,r,i,o,s,l,u,f,d=!1){const{p:m,m:v,um:y,n:_,o:{parentNode:C,remove:x}}=f;let k;const A=vR(t);A&&e!=null&&e.pendingBranch&&(k=e.pendingId,e.deps++);const L=t.props?$p(t.props.timeout):void 0,E=o,H={vnode:t,parent:e,parentComponent:n,namespace:s,container:r,hiddenContainer:i,deps:0,pendingId:N0++,timeout:typeof L=="number"?L:-1,activeBranch:null,pendingBranch:null,isInFallback:!d,isHydrating:d,isUnmounted:!1,effects:[],resolve(I=!1,q=!1){const{vnode:P,activeBranch:z,pendingBranch:w,pendingId:R,effects:U,parentComponent:K,container:oe}=H;let D=!1;H.isHydrating?H.isHydrating=!1:I||(D=z&&w.transition&&w.transition.mode==="out-in",D&&(z.transition.afterLeave=()=>{R===H.pendingId&&(v(w,oe,o===E?_(z):o,0),Vp(U))}),z&&(C(z.el)!==H.hiddenContainer&&(o=_(z)),y(z,K,H,!0)),D||v(w,oe,o,0)),Cu(H,w),H.pendingBranch=null,H.isInFallback=!1;let ae=H.parent,ce=!1;for(;ae;){if(ae.pendingBranch){ae.effects.push(...U),ce=!0;break}ae=ae.parent}!ce&&!D&&Vp(U),H.effects=[],A&&e&&e.pendingBranch&&k===e.pendingId&&(e.deps--,e.deps===0&&!q&&e.resolve()),jf(P,"onResolve")},fallback(I){if(!H.pendingBranch)return;const{vnode:q,activeBranch:P,parentComponent:z,container:w,namespace:R}=H;jf(q,"onFallback");const U=_(P),K=()=>{H.isInFallback&&(m(null,I,w,U,z,null,R,l,u),Cu(H,I))},oe=I.transition&&I.transition.mode==="out-in";oe&&(P.transition.afterLeave=K),H.isInFallback=!0,y(P,z,null,!0),oe||K()},move(I,q,P){H.activeBranch&&v(H.activeBranch,I,q,P),H.container=I},next(){return H.activeBranch&&_(H.activeBranch)},registerDep(I,q){const P=!!H.pendingBranch;P&&H.deps++;const z=I.vnode.el;I.asyncDep.catch(w=>{Ol(w,I,0)}).then(w=>{if(I.isUnmounted||H.isUnmounted||H.pendingId!==I.suspenseId)return;I.asyncResolved=!0;const{vnode:R}=I;V0(I,w,!1),z&&(R.el=z);const U=!z&&I.subTree.el;q(I,R,C(z||I.subTree.el),z?null:_(I.subTree),H,s,u),U&&x(U),B1(I,R.el),P&&--H.deps===0&&H.resolve()})},unmount(I,q){H.isUnmounted=!0,H.activeBranch&&y(H.activeBranch,n,I,q),H.pendingBranch&&y(H.pendingBranch,n,I,q)}};return H}function mR(t,e,n,r,i,o,s,l,u){const f=e.suspense=F1(e,r,n,t.parentNode,document.createElement("div"),null,i,o,s,l,!0),d=u(t,f.pendingBranch=e.ssContent,n,f,o,s);return f.deps===0&&f.resolve(!1,!0),d}function gR(t){const{shapeFlag:e,children:n}=t,r=e&32;t.ssContent=sS(r?n.default:n),t.ssFallback=r?sS(n.fallback):Qe(pr)}function sS(t){let e;if(pt(t)){const n=fl&&t._c;n&&(t._d=!1,ge()),t=t(),n&&(t._d=!0,e=$r,$O())}return We(t)&&(t=sR(t)),t=ei(t),e&&!t.dynamicChildren&&(t.dynamicChildren=e.filter(n=>n!==t)),t}function oO(t,e){e&&e.pendingBranch?We(t)?e.effects.push(...t):e.effects.push(t):Vp(t)}function Cu(t,e){t.activeBranch=e;const{vnode:n,parentComponent:r}=t;let i=e.el;for(;!i&&e.component;)e=e.component.subTree,i=e.el;n.el=i,r&&r.subTree===n&&(r.vnode.el=i,B1(r,i))}function vR(t){var e;return((e=t.props)==null?void 0:e.suspensible)!=null&&t.props.suspensible!==!1}const sO=Symbol.for("v-scx"),aO=()=>lf(sO);function lO(t,e){return _d(t,null,e)}function uO(t,e){return _d(t,null,{flush:"post"})}function cO(t,e){return _d(t,null,{flush:"sync"})}const Nh={};function En(t,e,n){return _d(t,e,n)}function _d(t,e,{immediate:n,deep:r,flush:i,once:o,onTrack:s,onTrigger:l}=Ft){if(e&&o){const I=e;e=(...q)=>{I(...q),H()}}const u=Bn,f=I=>r===!0?I:Fa(I,r===!1?1:void 0);let d,m=!1,v=!1;if(qn(t)?(d=()=>t.value,m=Bf(t)):Za(t)?(d=()=>f(t),m=!0):We(t)?(v=!0,m=t.some(I=>Za(I)||Bf(I)),d=()=>t.map(I=>{if(qn(I))return I.value;if(Za(I))return f(I);if(pt(I))return mo(I,u,2)})):pt(t)?e?d=()=>mo(t,u,2):d=()=>(y&&y(),si(t,u,3,[_])):d=An,e&&r){const I=d;d=()=>Fa(I())}let y,_=I=>{y=L.onStop=()=>{mo(I,u,4),y=L.onStop=void 0}},C;if(kd)if(_=An,e?n&&si(e,u,3,[d(),v?[]:void 0,_]):d(),i==="sync"){const I=aO();C=I.__watcherHandles||(I.__watcherHandles=[])}else return An;let x=v?new Array(t.length).fill(Nh):Nh;const k=()=>{if(!(!L.active||!L.dirty))if(e){const I=L.run();(r||m||(v?I.some((q,P)=>ji(q,x[P])):ji(I,x)))&&(y&&y(),si(e,u,3,[I,x===Nh?void 0:v&&x[0]===Nh?[]:x,_]),x=I)}else L.run()};k.allowRecurse=!!e;let A;i==="sync"?A=k:i==="post"?A=()=>Zn(k,u&&u.suspense):(k.pre=!0,u&&(k.id=u.uid),A=()=>ug(k));const L=new Pu(d,An,A),E=LA(),H=()=>{L.stop(),E&&_1(E.effects,L)};return e?n?k():x=L.run():i==="post"?Zn(L.run.bind(L),u&&u.suspense):L.run(),C&&C.push(H),H}function yR(t,e,n){const r=this.proxy,i=xt(t)?t.includes(".")?fO(r,t):()=>r[t]:t.bind(r,r);let o;pt(e)?o=e:(o=e.handler,n=e);const s=dl(this),l=_d(i,o.bind(r),n);return s(),l}function fO(t,e){const n=e.split(".");return()=>{let r=t;for(let i=0;i0){if(n>=e)return t;n++}if(r=r||new Set,r.has(t))return t;if(r.add(t),qn(t))Fa(t.value,e,n,r);else if(We(t))for(let i=0;i{Fa(i,e,n,r)});else if(TA(t))for(const i in t)Fa(t[i],e,n,r);return t}function Ut(t,e){if(On===null)return t;const n=vg(On)||On.proxy,r=t.dirs||(t.dirs=[]);for(let i=0;i{t.isMounted=!0}),Ml(()=>{t.isUnmounting=!0}),t}const di=[Function,Array],j1={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:di,onEnter:di,onAfterEnter:di,onEnterCancelled:di,onBeforeLeave:di,onLeave:di,onAfterLeave:di,onLeaveCancelled:di,onBeforeAppear:di,onAppear:di,onAfterAppear:di,onAppearCancelled:di},bR={name:"BaseTransition",props:j1,setup(t,{slots:e}){const n=qi(),r=V1();let i;return()=>{const o=e.default&&dg(e.default(),!0);if(!o||!o.length)return;let s=o[0];if(o.length>1){for(const C of o)if(C.type!==pr){s=C;break}}const l=Mt(t),{mode:u}=l;if(r.isLeaving)return ly(s);const f=aS(s);if(!f)return ly(s);const d=Du(f,l,r,n);ul(f,d);const m=n.subTree,v=m&&aS(m);let y=!1;const{getTransitionKey:_}=f.type;if(_){const C=_();i===void 0?i=C:C!==i&&(i=C,y=!0)}if(v&&v.type!==pr&&(!Ii(f,v)||y)){const C=Du(v,l,r,n);if(ul(v,C),u==="out-in")return r.isLeaving=!0,C.afterLeave=()=>{r.isLeaving=!1,n.update.active!==!1&&(n.effect.dirty=!0,n.update())},ly(s);u==="in-out"&&f.type!==pr&&(C.delayLeave=(x,k,A)=>{const L=hO(r,v);L[String(v.key)]=v,x[Ps]=()=>{k(),x[Ps]=void 0,delete d.delayedLeave},d.delayedLeave=A})}return s}}},dO=bR;function hO(t,e){const{leavingVNodes:n}=t;let r=n.get(e.type);return r||(r=Object.create(null),n.set(e.type,r)),r}function Du(t,e,n,r){const{appear:i,mode:o,persisted:s=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:f,onEnterCancelled:d,onBeforeLeave:m,onLeave:v,onAfterLeave:y,onLeaveCancelled:_,onBeforeAppear:C,onAppear:x,onAfterAppear:k,onAppearCancelled:A}=e,L=String(t.key),E=hO(n,t),H=(P,z)=>{P&&si(P,r,9,z)},I=(P,z)=>{const w=z[1];H(P,z),We(P)?P.every(R=>R.length<=1)&&w():P.length<=1&&w()},q={mode:o,persisted:s,beforeEnter(P){let z=l;if(!n.isMounted)if(i)z=C||l;else return;P[Ps]&&P[Ps](!0);const w=E[L];w&&Ii(t,w)&&w.el[Ps]&&w.el[Ps](),H(z,[P])},enter(P){let z=u,w=f,R=d;if(!n.isMounted)if(i)z=x||u,w=k||f,R=A||d;else return;let U=!1;const K=P[Lh]=oe=>{U||(U=!0,oe?H(R,[P]):H(w,[P]),q.delayedLeave&&q.delayedLeave(),P[Lh]=void 0)};z?I(z,[P,K]):K()},leave(P,z){const w=String(t.key);if(P[Lh]&&P[Lh](!0),n.isUnmounting)return z();H(m,[P]);let R=!1;const U=P[Ps]=K=>{R||(R=!0,z(),K?H(_,[P]):H(y,[P]),P[Ps]=void 0,E[w]===t&&delete E[w])};E[w]=t,v?I(v,[P,U]):U()},clone(P){return Du(P,e,n,r)}};return q}function ly(t){if(wd(t))return t=yo(t),t.children=null,t}function aS(t){return wd(t)?t.children?t.children[0]:void 0:t}function ul(t,e){t.shapeFlag&6&&t.component?ul(t.component.subTree,e):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function dg(t,e=!1,n){let r=[],i=0;for(let o=0;o1)for(let o=0;oRt({name:t.name},e,{setup:t}))():t}const Qa=t=>!!t.type.__asyncLoader;/*! #__NO_SIDE_EFFECTS__ */function _R(t){pt(t)&&(t={loader:t});const{loader:e,loadingComponent:n,errorComponent:r,delay:i=200,timeout:o,suspensible:s=!0,onError:l}=t;let u=null,f,d=0;const m=()=>(d++,u=null,v()),v=()=>{let y;return u||(y=u=e().catch(_=>{if(_=_ instanceof Error?_:new Error(String(_)),l)return new Promise((C,x)=>{l(_,()=>C(m()),()=>x(_),d+1)});throw _}).then(_=>y!==u&&u?u:(_&&(_.__esModule||_[Symbol.toStringTag]==="Module")&&(_=_.default),f=_,_)))};return Vn({name:"AsyncComponentWrapper",__asyncLoader:v,get __asyncResolved(){return f},setup(){const y=Bn;if(f)return()=>uy(f,y);const _=A=>{u=null,Ol(A,y,13,!r)};if(s&&y.suspense||kd)return v().then(A=>()=>uy(A,y)).catch(A=>(_(A),()=>r?Qe(r,{error:A}):null));const C=Ot(!1),x=Ot(),k=Ot(!!i);return i&&setTimeout(()=>{k.value=!1},i),o!=null&&setTimeout(()=>{if(!C.value&&!x.value){const A=new Error(`Async component timed out after ${o}ms.`);_(A),x.value=A}},o),v().then(()=>{C.value=!0,y.parent&&wd(y.parent.vnode)&&(y.parent.effect.dirty=!0,ug(y.parent.update))}).catch(A=>{_(A),x.value=A}),()=>{if(C.value&&f)return uy(f,y);if(x.value&&r)return Qe(r,{error:x.value});if(n&&!k.value)return Qe(n)}}})}function uy(t,e){const{ref:n,props:r,children:i,ce:o}=e.vnode,s=Qe(t,r,i);return s.ref=n,s.ce=o,delete e.vnode.ce,s}const wd=t=>t.type.__isKeepAlive,wR={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(t,{slots:e}){const n=qi(),r=n.ctx;if(!r.renderer)return()=>{const A=e.default&&e.default();return A&&A.length===1?A[0]:A};const i=new Map,o=new Set;let s=null;const l=n.suspense,{renderer:{p:u,m:f,um:d,o:{createElement:m}}}=r,v=m("div");r.activate=(A,L,E,H,I)=>{const q=A.component;f(A,L,E,0,l),u(q.vnode,A,L,E,q,l,H,A.slotScopeIds,I),Zn(()=>{q.isDeactivated=!1,q.a&&ku(q.a);const P=A.props&&A.props.onVnodeMounted;P&&zr(P,q.parent,A)},l)},r.deactivate=A=>{const L=A.component;f(A,v,null,1,l),Zn(()=>{L.da&&ku(L.da);const E=A.props&&A.props.onVnodeUnmounted;E&&zr(E,L.parent,A),L.isDeactivated=!0},l)};function y(A){cy(A),d(A,n,l,!0)}function _(A){i.forEach((L,E)=>{const H=Yp(L.type);H&&(!A||!A(H))&&C(E)})}function C(A){const L=i.get(A);!s||!Ii(L,s)?y(L):s&&cy(s),i.delete(A),o.delete(A)}En(()=>[t.include,t.exclude],([A,L])=>{A&&_(E=>Qc(A,E)),L&&_(E=>!Qc(L,E))},{flush:"post",deep:!0});let x=null;const k=()=>{x!=null&&i.set(x,fy(n.subTree))};return ts(k),pg(k),Ml(()=>{i.forEach(A=>{const{subTree:L,suspense:E}=n,H=fy(L);if(A.type===H.type&&A.key===H.key){cy(H);const I=H.component.da;I&&Zn(I,E);return}y(A)})}),()=>{if(x=null,!e.default)return null;const A=e.default(),L=A[0];if(A.length>1)return s=null,A;if(!ea(L)||!(L.shapeFlag&4)&&!(L.shapeFlag&128))return s=null,L;let E=fy(L);const H=E.type,I=Yp(Qa(E)?E.type.__asyncResolved||{}:H),{include:q,exclude:P,max:z}=t;if(q&&(!I||!Qc(q,I))||P&&I&&Qc(P,I))return s=E,L;const w=E.key==null?H:E.key,R=i.get(w);return E.el&&(E=yo(E),L.shapeFlag&128&&(L.ssContent=E)),x=w,R?(E.el=R.el,E.component=R.component,E.transition&&ul(E,E.transition),E.shapeFlag|=512,o.delete(w),o.add(w)):(o.add(w),z&&o.size>parseInt(z,10)&&C(o.values().next().value)),E.shapeFlag|=256,s=E,iO(L.type)?L:E}}},kR=wR;function Qc(t,e){return We(t)?t.some(n=>Qc(n,e)):xt(t)?t.split(",").includes(e):WP(t)?t.test(e):!1}function pO(t,e){gO(t,"a",e)}function mO(t,e){gO(t,"da",e)}function gO(t,e,n=Bn){const r=t.__wdc||(t.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return t()});if(hg(e,r,n),n){let i=n.parent;for(;i&&i.parent;)wd(i.parent.vnode)&&xR(r,e,n,i),i=i.parent}}function xR(t,e,n,r){const i=hg(e,t,r,!0);mg(()=>{_1(r[e],i)},n)}function cy(t){t.shapeFlag&=-257,t.shapeFlag&=-513}function fy(t){return t.shapeFlag&128?t.ssContent:t}function hg(t,e,n=Bn,r=!1){if(n){const i=n[t]||(n[t]=[]),o=e.__weh||(e.__weh=(...s)=>{if(n.isUnmounted)return;ua();const l=dl(n),u=si(e,n,t,s);return l(),ca(),u});return r?i.unshift(o):i.push(o),o}}const es=t=>(e,n=Bn)=>(!kd||t==="sp")&&hg(t,(...r)=>e(...r),n),vO=es("bm"),ts=es("m"),yO=es("bu"),pg=es("u"),Ml=es("bum"),mg=es("um"),bO=es("sp"),_O=es("rtg"),wO=es("rtc");function kO(t,e=Bn){hg("ec",t,e)}function Zt(t,e,n,r){let i;const o=n&&n[r];if(We(t)||xt(t)){i=new Array(t.length);for(let s=0,l=t.length;se(s,l,void 0,o&&o[l]));else{const s=Object.keys(t);i=new Array(s.length);for(let l=0,u=s.length;l{const o=r.fn(...i);return o&&(o.key=r.key),o}:r.fn)}return t}function pn(t,e,n={},r,i){if(On.isCE||On.parent&&Qa(On.parent)&&On.parent.isCE)return e!=="default"&&(n.name=e),Qe("slot",n,r&&r());let o=t[e];o&&o._c&&(o._d=!1),ge();const s=o&&xO(o(n)),l=Ct(kt,{key:n.key||s&&s.key||`_${e}`},s||(r?r():[]),s&&t._===1?64:-2);return!i&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),o&&o._c&&(o._d=!0),l}function xO(t){return t.some(e=>ea(e)?!(e.type===pr||e.type===kt&&!xO(e.children)):!0)?t:null}function L0(t,e){const n={};for(const r in t)n[e&&/[A-Z]/.test(r)?`on:${r}`:wu(r)]=t[r];return n}const I0=t=>t?jO(t)?vg(t)||t.proxy:I0(t.parent):null,af=Rt(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>I0(t.parent),$root:t=>I0(t.root),$emit:t=>t.emit,$options:t=>U1(t),$forceUpdate:t=>t.f||(t.f=()=>{t.effect.dirty=!0,ug(t.update)}),$nextTick:t=>t.n||(t.n=Ri.bind(t.proxy)),$watch:t=>yR.bind(t)}),dy=(t,e)=>t!==Ft&&!t.__isScriptSetup&&Dt(t,e),P0={get({_:t},e){const{ctx:n,setupState:r,data:i,props:o,accessCache:s,type:l,appContext:u}=t;let f;if(e[0]!=="$"){const y=s[e];if(y!==void 0)switch(y){case 1:return r[e];case 2:return i[e];case 4:return n[e];case 3:return o[e]}else{if(dy(r,e))return s[e]=1,r[e];if(i!==Ft&&Dt(i,e))return s[e]=2,i[e];if((f=t.propsOptions[0])&&Dt(f,e))return s[e]=3,o[e];if(n!==Ft&&Dt(n,e))return s[e]=4,n[e];D0&&(s[e]=0)}}const d=af[e];let m,v;if(d)return e==="$attrs"&&Wr(t,"get",e),d(t);if((m=l.__cssModules)&&(m=m[e]))return m;if(n!==Ft&&Dt(n,e))return s[e]=4,n[e];if(v=u.config.globalProperties,Dt(v,e))return v[e]},set({_:t},e,n){const{data:r,setupState:i,ctx:o}=t;return dy(i,e)?(i[e]=n,!0):r!==Ft&&Dt(r,e)?(r[e]=n,!0):Dt(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(o[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:r,appContext:i,propsOptions:o}},s){let l;return!!n[s]||t!==Ft&&Dt(t,s)||dy(e,s)||(l=o[0])&&Dt(l,s)||Dt(r,s)||Dt(af,s)||Dt(i.config.globalProperties,s)},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:Dt(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}},SR=Rt({},P0,{get(t,e){if(e!==Symbol.unscopables)return P0.get(t,e,t)},has(t,e){return e[0]!=="_"&&!JP(e)}});function CR(){return null}function TR(){return null}function ER(t){}function AR(t){}function OR(){return null}function MR(){}function NR(t,e){return null}function LR(){return SO().slots}function IR(){return SO().attrs}function SO(){const t=qi();return t.setupContext||(t.setupContext=KO(t))}function Wf(t){return We(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}function PR(t,e){const n=Wf(t);for(const r in e){if(r.startsWith("__skip"))continue;let i=n[r];i?We(i)||pt(i)?i=n[r]={type:i,default:e[r]}:i.default=e[r]:i===null&&(i=n[r]={default:e[r]}),i&&e[`__skip_${r}`]&&(i.skipFactory=!0)}return n}function DR(t,e){return!t||!e?t||e:We(t)&&We(e)?t.concat(e):Rt({},Wf(t),Wf(e))}function RR(t,e){const n={};for(const r in t)e.includes(r)||Object.defineProperty(n,r,{enumerable:!0,get:()=>t[r]});return n}function zR(t){const e=qi();let n=t();return F0(),w1(n)&&(n=n.catch(r=>{throw dl(e),r})),[n,()=>dl(e)]}let D0=!0;function BR(t){const e=U1(t),n=t.proxy,r=t.ctx;D0=!1,e.beforeCreate&&lS(e.beforeCreate,t,"bc");const{data:i,computed:o,methods:s,watch:l,provide:u,inject:f,created:d,beforeMount:m,mounted:v,beforeUpdate:y,updated:_,activated:C,deactivated:x,beforeDestroy:k,beforeUnmount:A,destroyed:L,unmounted:E,render:H,renderTracked:I,renderTriggered:q,errorCaptured:P,serverPrefetch:z,expose:w,inheritAttrs:R,components:U,directives:K,filters:oe}=e;if(f&&$R(f,r,null),s)for(const ce in s){const ve=s[ce];pt(ve)&&(r[ce]=ve.bind(n))}if(i){const ce=i.call(n,n);qt(ce)&&(t.data=Al(ce))}if(D0=!0,o)for(const ce in o){const ve=o[ce],ze=pt(ve)?ve.bind(n,n):pt(ve.get)?ve.get.bind(n,n):An,qe=!pt(ve)&&pt(ve.set)?ve.set.bind(n):An,yt=er({get:ze,set:qe});Object.defineProperty(r,ce,{enumerable:!0,configurable:!0,get:()=>yt.value,set:mt=>yt.value=mt})}if(l)for(const ce in l)CO(l[ce],r,n,ce);if(u){const ce=pt(u)?u.call(n):u;Reflect.ownKeys(ce).forEach(ve=>{Up(ve,ce[ve])})}d&&lS(d,t,"c");function ae(ce,ve){We(ve)?ve.forEach(ze=>ce(ze.bind(n))):ve&&ce(ve.bind(n))}if(ae(vO,m),ae(ts,v),ae(yO,y),ae(pg,_),ae(pO,C),ae(mO,x),ae(kO,P),ae(wO,I),ae(_O,q),ae(Ml,A),ae(mg,E),ae(bO,z),We(w))if(w.length){const ce=t.exposed||(t.exposed={});w.forEach(ve=>{Object.defineProperty(ce,ve,{get:()=>n[ve],set:ze=>n[ve]=ze})})}else t.exposed||(t.exposed={});H&&t.render===An&&(t.render=H),R!=null&&(t.inheritAttrs=R),U&&(t.components=U),K&&(t.directives=K)}function $R(t,e,n=An){We(t)&&(t=R0(t));for(const r in t){const i=t[r];let o;qt(i)?"default"in i?o=lf(i.from||r,i.default,!0):o=lf(i.from||r):o=lf(i),qn(o)?Object.defineProperty(e,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:s=>o.value=s}):e[r]=o}}function lS(t,e,n){si(We(t)?t.map(r=>r.bind(e.proxy)):t.bind(e.proxy),e,n)}function CO(t,e,n,r){const i=r.includes(".")?fO(n,r):()=>n[r];if(xt(t)){const o=e[t];pt(o)&&En(i,o)}else if(pt(t))En(i,t.bind(n));else if(qt(t))if(We(t))t.forEach(o=>CO(o,e,n,r));else{const o=pt(t.handler)?t.handler.bind(n):e[t.handler];pt(o)&&En(i,o,t)}}function U1(t){const e=t.type,{mixins:n,extends:r}=e,{mixins:i,optionsCache:o,config:{optionMergeStrategies:s}}=t.appContext,l=o.get(e);let u;return l?u=l:!i.length&&!n&&!r?u=e:(u={},i.length&&i.forEach(f=>Wp(u,f,s,!0)),Wp(u,e,s)),qt(e)&&o.set(e,u),u}function Wp(t,e,n,r=!1){const{mixins:i,extends:o}=e;o&&Wp(t,o,n,!0),i&&i.forEach(s=>Wp(t,s,n,!0));for(const s in e)if(!(r&&s==="expose")){const l=HR[s]||n&&n[s];t[s]=l?l(t[s],e[s]):e[s]}return t}const HR={data:uS,props:cS,emits:cS,methods:ef,computed:ef,beforeCreate:Cr,created:Cr,beforeMount:Cr,mounted:Cr,beforeUpdate:Cr,updated:Cr,beforeDestroy:Cr,beforeUnmount:Cr,destroyed:Cr,unmounted:Cr,activated:Cr,deactivated:Cr,errorCaptured:Cr,serverPrefetch:Cr,components:ef,directives:ef,watch:VR,provide:uS,inject:FR};function uS(t,e){return e?t?function(){return Rt(pt(t)?t.call(this,this):t,pt(e)?e.call(this,this):e)}:e:t}function FR(t,e){return ef(R0(t),R0(e))}function R0(t){if(We(t)){const e={};for(let n=0;n1)return n&&pt(e)?e.call(r&&r.proxy):e}}function UR(){return!!(Bn||On||Uf)}function qR(t,e,n,r=!1){const i={},o={};Bp(o,gg,1),t.propsDefaults=Object.create(null),EO(t,e,i,o);for(const s in t.propsOptions[0])s in i||(i[s]=void 0);n?t.props=r?i:Fp(i):t.type.props?t.props=i:t.props=o,t.attrs=o}function KR(t,e,n,r){const{props:i,attrs:o,vnode:{patchFlag:s}}=t,l=Mt(i),[u]=t.propsOptions;let f=!1;if((r||s>0)&&!(s&16)){if(s&8){const d=t.vnode.dynamicProps;for(let m=0;m{u=!0;const[v,y]=AO(m,e,!0);Rt(s,v),y&&l.push(...y)};!n&&e.mixins.length&&e.mixins.forEach(d),t.extends&&d(t.extends),t.mixins&&t.mixins.forEach(d)}if(!o&&!u)return qt(t)&&r.set(t,bu),bu;if(We(o))for(let d=0;d-1,y[1]=C<0||_-1||Dt(y,"default"))&&l.push(m)}}}const f=[s,l];return qt(t)&&r.set(t,f),f}function fS(t){return t[0]!=="$"}function dS(t){const e=t&&t.toString().match(/^\s*(function|class) (\w+)/);return e?e[2]:t===null?"null":""}function hS(t,e){return dS(t)===dS(e)}function pS(t,e){return We(e)?e.findIndex(n=>hS(n,t)):pt(e)&&hS(e,t)?0:-1}const OO=t=>t[0]==="_"||t==="$stable",q1=t=>We(t)?t.map(ei):[ei(t)],GR=(t,e,n)=>{if(e._n)return e;const r=Vt((...i)=>q1(e(...i)),n);return r._c=!1,r},MO=(t,e,n)=>{const r=t._ctx;for(const i in t){if(OO(i))continue;const o=t[i];if(pt(o))e[i]=GR(i,o,r);else if(o!=null){const s=q1(o);e[i]=()=>s}}},NO=(t,e)=>{const n=q1(e);t.slots.default=()=>n},YR=(t,e)=>{if(t.vnode.shapeFlag&32){const n=e._;n?(t.slots=Mt(e),Bp(e,"_",n)):MO(e,t.slots={})}else t.slots={},e&&NO(t,e);Bp(t.slots,gg,1)},JR=(t,e,n)=>{const{vnode:r,slots:i}=t;let o=!0,s=Ft;if(r.shapeFlag&32){const l=e._;l?n&&l===1?o=!1:(Rt(i,e),!n&&l===1&&delete i._):(o=!e.$stable,MO(e,i)),s=e}else e&&(NO(t,e),s={default:1});if(o)for(const l in i)!OO(l)&&s[l]==null&&delete i[l]};function qp(t,e,n,r,i=!1){if(We(t)){t.forEach((v,y)=>qp(v,e&&(We(e)?e[y]:e),n,r,i));return}if(Qa(r)&&!i)return;const o=r.shapeFlag&4?vg(r.component)||r.component.proxy:r.el,s=i?null:o,{i:l,r:u}=t,f=e&&e.r,d=l.refs===Ft?l.refs={}:l.refs,m=l.setupState;if(f!=null&&f!==u&&(xt(f)?(d[f]=null,Dt(m,f)&&(m[f]=null)):qn(f)&&(f.value=null)),pt(u))mo(u,l,12,[s,d]);else{const v=xt(u),y=qn(u),_=t.f;if(v||y){const C=()=>{if(_){const x=v?Dt(m,u)?m[u]:d[u]:u.value;i?We(x)&&_1(x,o):We(x)?x.includes(o)||x.push(o):v?(d[u]=[o],Dt(m,u)&&(m[u]=d[u])):(u.value=[o],t.k&&(d[t.k]=u.value))}else v?(d[u]=s,Dt(m,u)&&(m[u]=s)):y&&(u.value=s,t.k&&(d[t.k]=s))};i||_?C():(C.id=-1,Zn(C,n))}}}let xs=!1;const XR=t=>t.namespaceURI.includes("svg")&&t.tagName!=="foreignObject",ZR=t=>t.namespaceURI.includes("MathML"),Ih=t=>{if(XR(t))return"svg";if(ZR(t))return"mathml"},Wc=t=>t.nodeType===8;function QR(t){const{mt:e,p:n,o:{patchProp:r,createText:i,nextSibling:o,parentNode:s,remove:l,insert:u,createComment:f}}=t,d=(L,E)=>{if(!E.hasChildNodes()){__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&Ea("Attempting to hydrate existing markup but container is empty. Performing full mount instead."),n(null,L,E),jp(),E._vnode=L;return}xs=!1,m(E.firstChild,L,null,null,null),jp(),E._vnode=L,xs&&console.error("Hydration completed but contains mismatches.")},m=(L,E,H,I,q,P=!1)=>{const z=Wc(L)&&L.data==="[",w=()=>C(L,E,H,I,q,z),{type:R,ref:U,shapeFlag:K,patchFlag:oe}=E;let D=L.nodeType;E.el=L,oe===-2&&(P=!1,E.dynamicChildren=null);let ae=null;switch(R){case cl:D!==3?E.children===""?(u(E.el=i(""),s(L),L),ae=L):ae=w():(L.data!==E.children&&(xs=!0,__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&Ea("Hydration text mismatch in",L.parentNode,` - - rendered on server: ${JSON.stringify(L.data)} - - expected on client: ${JSON.stringify(E.children)}`),L.data=E.children),ae=o(L));break;case pr:A(L)?(ae=o(L),k(E.el=L.content.firstChild,L,H)):D!==8||z?ae=w():ae=o(L);break;case el:if(z&&(L=o(L),D=L.nodeType),D===1||D===3){ae=L;const ce=!E.children.length;for(let ve=0;ve{P=P||!!E.dynamicChildren;const{type:z,props:w,patchFlag:R,shapeFlag:U,dirs:K,transition:oe}=E,D=z==="input"||z==="option";if(D||R!==-1){K&&so(E,null,H,"created");let ae=!1;if(A(L)){ae=DO(I,oe)&&H&&H.vnode.props&&H.vnode.props.appear;const ve=L.content.firstChild;ae&&oe.beforeEnter(ve),k(ve,L,H),E.el=L=ve}if(U&16&&!(w&&(w.innerHTML||w.textContent))){let ve=y(L.firstChild,E,L,H,I,q,P),ze=!1;for(;ve;){xs=!0,__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&!ze&&(Ea("Hydration children mismatch on",L,` -Server rendered element contains more child nodes than client vdom.`),ze=!0);const qe=ve;ve=ve.nextSibling,l(qe)}}else U&8&&L.textContent!==E.children&&(xs=!0,__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&Ea("Hydration text content mismatch on",L,` - - rendered on server: ${L.textContent} - - expected on client: ${E.children}`),L.textContent=E.children);if(w)if(D||!P||R&48)for(const ve in w)(D&&(ve.endsWith("value")||ve==="indeterminate")||Cl(ve)&&!Ya(ve)||ve[0]===".")&&r(L,ve,null,w[ve],void 0,void 0,H);else w.onClick&&r(L,"onClick",null,w.onClick,void 0,void 0,H);let ce;(ce=w&&w.onVnodeBeforeMount)&&zr(ce,H,E),K&&so(E,null,H,"beforeMount"),((ce=w&&w.onVnodeMounted)||K||ae)&&oO(()=>{ce&&zr(ce,H,E),ae&&oe.enter(L),K&&so(E,null,H,"mounted")},I)}return L.nextSibling},y=(L,E,H,I,q,P,z)=>{z=z||!!E.dynamicChildren;const w=E.children,R=w.length;let U=!1;for(let K=0;K{const{slotScopeIds:z}=E;z&&(q=q?q.concat(z):z);const w=s(L),R=y(o(L),E,w,H,I,q,P);return R&&Wc(R)&&R.data==="]"?o(E.anchor=R):(xs=!0,u(E.anchor=f("]"),w,R),R)},C=(L,E,H,I,q,P)=>{if(xs=!0,__VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&Ea(`Hydration node mismatch: -- rendered on server:`,L,L.nodeType===3?"(text)":Wc(L)&&L.data==="["?"(start of fragment)":"",` -- expected on client:`,E.type),E.el=null,P){const R=x(L);for(;;){const U=o(L);if(U&&U!==R)l(U);else break}}const z=o(L),w=s(L);return l(L),n(null,E,w,z,H,I,Ih(w),q),z},x=(L,E="[",H="]")=>{let I=0;for(;L;)if(L=o(L),L&&Wc(L)&&(L.data===E&&I++,L.data===H)){if(I===0)return o(L);I--}return L},k=(L,E,H)=>{const I=E.parentNode;I&&I.replaceChild(L,E);let q=H;for(;q;)q.vnode.el===E&&(q.vnode.el=q.subTree.el=L),q=q.parent},A=L=>L.nodeType===1&&L.tagName.toLowerCase()==="template";return[d,m]}function e5(){typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__!="boolean"&&(x1().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__=!1)}const Zn=oO;function LO(t){return PO(t)}function IO(t){return PO(t,QR)}function PO(t,e){e5();const n=x1();n.__VUE__=!0;const{insert:r,remove:i,patchProp:o,createElement:s,createText:l,createComment:u,setText:f,setElementText:d,parentNode:m,nextSibling:v,setScopeId:y=An,insertStaticContent:_}=t,C=(ie,te,be,_e=null,xe=null,G=null,Z=void 0,N=null,W=!!te.dynamicChildren)=>{if(ie===te)return;ie&&!Ii(ie,te)&&(_e=Be(ie),mt(ie,xe,G,!0),ie=null),te.patchFlag===-2&&(W=!1,te.dynamicChildren=null);const{type:O,ref:j,shapeFlag:F}=te;switch(O){case cl:x(ie,te,be,_e);break;case pr:k(ie,te,be,_e);break;case el:ie==null&&A(te,be,_e,Z);break;case kt:U(ie,te,be,_e,xe,G,Z,N,W);break;default:F&1?H(ie,te,be,_e,xe,G,Z,N,W):F&6?K(ie,te,be,_e,xe,G,Z,N,W):(F&64||F&128)&&O.process(ie,te,be,_e,xe,G,Z,N,W,Ke)}j!=null&&xe&&qp(j,ie&&ie.ref,G,te||ie,!te)},x=(ie,te,be,_e)=>{if(ie==null)r(te.el=l(te.children),be,_e);else{const xe=te.el=ie.el;te.children!==ie.children&&f(xe,te.children)}},k=(ie,te,be,_e)=>{ie==null?r(te.el=u(te.children||""),be,_e):te.el=ie.el},A=(ie,te,be,_e)=>{[ie.el,ie.anchor]=_(ie.children,te,be,_e,ie.el,ie.anchor)},L=({el:ie,anchor:te},be,_e)=>{let xe;for(;ie&&ie!==te;)xe=v(ie),r(ie,be,_e),ie=xe;r(te,be,_e)},E=({el:ie,anchor:te})=>{let be;for(;ie&&ie!==te;)be=v(ie),i(ie),ie=be;i(te)},H=(ie,te,be,_e,xe,G,Z,N,W)=>{te.type==="svg"?Z="svg":te.type==="math"&&(Z="mathml"),ie==null?I(te,be,_e,xe,G,Z,N,W):z(ie,te,xe,G,Z,N,W)},I=(ie,te,be,_e,xe,G,Z,N)=>{let W,O;const{props:j,shapeFlag:F,transition:Q,dirs:le}=ie;if(W=ie.el=s(ie.type,G,j&&j.is,j),F&8?d(W,ie.children):F&16&&P(ie.children,W,null,_e,xe,hy(ie,G),Z,N),le&&so(ie,null,_e,"created"),q(W,ie,ie.scopeId,Z,_e),j){for(const ye in j)ye!=="value"&&!Ya(ye)&&o(W,ye,null,j[ye],G,ie.children,_e,xe,Ie);"value"in j&&o(W,"value",null,j.value,G),(O=j.onVnodeBeforeMount)&&zr(O,_e,ie)}le&&so(ie,null,_e,"beforeMount");const pe=DO(xe,Q);pe&&Q.beforeEnter(W),r(W,te,be),((O=j&&j.onVnodeMounted)||pe||le)&&Zn(()=>{O&&zr(O,_e,ie),pe&&Q.enter(W),le&&so(ie,null,_e,"mounted")},xe)},q=(ie,te,be,_e,xe)=>{if(be&&y(ie,be),_e)for(let G=0;G<_e.length;G++)y(ie,_e[G]);if(xe){let G=xe.subTree;if(te===G){const Z=xe.vnode;q(ie,Z,Z.scopeId,Z.slotScopeIds,xe.parent)}}},P=(ie,te,be,_e,xe,G,Z,N,W=0)=>{for(let O=W;O{const N=te.el=ie.el;let{patchFlag:W,dynamicChildren:O,dirs:j}=te;W|=ie.patchFlag&16;const F=ie.props||Ft,Q=te.props||Ft;let le;if(be&&Aa(be,!1),(le=Q.onVnodeBeforeUpdate)&&zr(le,be,te,ie),j&&so(te,ie,be,"beforeUpdate"),be&&Aa(be,!0),O?w(ie.dynamicChildren,O,N,be,_e,hy(te,xe),G):Z||ve(ie,te,N,null,be,_e,hy(te,xe),G,!1),W>0){if(W&16)R(N,te,F,Q,be,_e,xe);else if(W&2&&F.class!==Q.class&&o(N,"class",null,Q.class,xe),W&4&&o(N,"style",F.style,Q.style,xe),W&8){const pe=te.dynamicProps;for(let ye=0;ye{le&&zr(le,be,te,ie),j&&so(te,ie,be,"updated")},_e)},w=(ie,te,be,_e,xe,G,Z)=>{for(let N=0;N{if(be!==_e){if(be!==Ft)for(const N in be)!Ya(N)&&!(N in _e)&&o(ie,N,be[N],null,Z,te.children,xe,G,Ie);for(const N in _e){if(Ya(N))continue;const W=_e[N],O=be[N];W!==O&&N!=="value"&&o(ie,N,O,W,Z,te.children,xe,G,Ie)}"value"in _e&&o(ie,"value",be.value,_e.value,Z)}},U=(ie,te,be,_e,xe,G,Z,N,W)=>{const O=te.el=ie?ie.el:l(""),j=te.anchor=ie?ie.anchor:l("");let{patchFlag:F,dynamicChildren:Q,slotScopeIds:le}=te;le&&(N=N?N.concat(le):le),ie==null?(r(O,be,_e),r(j,be,_e),P(te.children||[],be,j,xe,G,Z,N,W)):F>0&&F&64&&Q&&ie.dynamicChildren?(w(ie.dynamicChildren,Q,be,xe,G,Z,N),(te.key!=null||xe&&te===xe.subTree)&&K1(ie,te,!0)):ve(ie,te,be,j,xe,G,Z,N,W)},K=(ie,te,be,_e,xe,G,Z,N,W)=>{te.slotScopeIds=N,ie==null?te.shapeFlag&512?xe.ctx.activate(te,be,_e,Z,W):oe(te,be,_e,xe,G,Z,W):D(ie,te,W)},oe=(ie,te,be,_e,xe,G,Z)=>{const N=ie.component=VO(ie,_e,xe);if(wd(ie)&&(N.ctx.renderer=Ke),WO(N),N.asyncDep){if(xe&&xe.registerDep(N,ae),!ie.el){const W=N.subTree=Qe(pr);k(null,W,te,be)}}else ae(N,ie,te,be,xe,G,Z)},D=(ie,te,be)=>{const _e=te.component=ie.component;if(uR(ie,te,be))if(_e.asyncDep&&!_e.asyncResolved){ce(_e,te,be);return}else _e.next=te,rR(_e.update),_e.effect.dirty=!0,_e.update();else te.el=ie.el,_e.vnode=te},ae=(ie,te,be,_e,xe,G,Z)=>{const N=()=>{if(ie.isMounted){let{next:j,bu:F,u:Q,parent:le,vnode:pe}=ie;{const Te=RO(ie);if(Te){j&&(j.el=pe.el,ce(ie,j,Z)),Te.asyncDep.then(()=>{ie.isUnmounted||N()});return}}let ye=j,Y;Aa(ie,!1),j?(j.el=pe.el,ce(ie,j,Z)):j=pe,F&&ku(F),(Y=j.props&&j.props.onVnodeBeforeUpdate)&&zr(Y,le,j,pe),Aa(ie,!0);const X=bp(ie),de=ie.subTree;ie.subTree=X,C(de,X,m(de.el),Be(de),ie,xe,G),j.el=X.el,ye===null&&B1(ie,X.el),Q&&Zn(Q,xe),(Y=j.props&&j.props.onVnodeUpdated)&&Zn(()=>zr(Y,le,j,pe),xe)}else{let j;const{el:F,props:Q}=te,{bm:le,m:pe,parent:ye}=ie,Y=Qa(te);if(Aa(ie,!1),le&&ku(le),!Y&&(j=Q&&Q.onVnodeBeforeMount)&&zr(j,ye,te),Aa(ie,!0),F&&at){const X=()=>{ie.subTree=bp(ie),at(F,ie.subTree,ie,xe,null)};Y?te.type.__asyncLoader().then(()=>!ie.isUnmounted&&X()):X()}else{const X=ie.subTree=bp(ie);C(null,X,be,_e,ie,xe,G),te.el=X.el}if(pe&&Zn(pe,xe),!Y&&(j=Q&&Q.onVnodeMounted)){const X=te;Zn(()=>zr(j,ye,X),xe)}(te.shapeFlag&256||ye&&Qa(ye.vnode)&&ye.vnode.shapeFlag&256)&&ie.a&&Zn(ie.a,xe),ie.isMounted=!0,te=be=_e=null}},W=ie.effect=new Pu(N,An,()=>ug(O),ie.scope),O=ie.update=()=>{W.dirty&&W.run()};O.id=ie.uid,Aa(ie,!0),O()},ce=(ie,te,be)=>{te.component=ie;const _e=ie.vnode.props;ie.vnode=te,ie.next=null,KR(ie,te.props,_e,be),JR(ie,te.children,be),ua(),rS(ie),ca()},ve=(ie,te,be,_e,xe,G,Z,N,W=!1)=>{const O=ie&&ie.children,j=ie?ie.shapeFlag:0,F=te.children,{patchFlag:Q,shapeFlag:le}=te;if(Q>0){if(Q&128){qe(O,F,be,_e,xe,G,Z,N,W);return}else if(Q&256){ze(O,F,be,_e,xe,G,Z,N,W);return}}le&8?(j&16&&Ie(O,xe,G),F!==O&&d(be,F)):j&16?le&16?qe(O,F,be,_e,xe,G,Z,N,W):Ie(O,xe,G,!0):(j&8&&d(be,""),le&16&&P(F,be,_e,xe,G,Z,N,W))},ze=(ie,te,be,_e,xe,G,Z,N,W)=>{ie=ie||bu,te=te||bu;const O=ie.length,j=te.length,F=Math.min(O,j);let Q;for(Q=0;Qj?Ie(ie,xe,G,!0,!1,F):P(te,be,_e,xe,G,Z,N,W,F)},qe=(ie,te,be,_e,xe,G,Z,N,W)=>{let O=0;const j=te.length;let F=ie.length-1,Q=j-1;for(;O<=F&&O<=Q;){const le=ie[O],pe=te[O]=W?Ds(te[O]):ei(te[O]);if(Ii(le,pe))C(le,pe,be,null,xe,G,Z,N,W);else break;O++}for(;O<=F&&O<=Q;){const le=ie[F],pe=te[Q]=W?Ds(te[Q]):ei(te[Q]);if(Ii(le,pe))C(le,pe,be,null,xe,G,Z,N,W);else break;F--,Q--}if(O>F){if(O<=Q){const le=Q+1,pe=leQ)for(;O<=F;)mt(ie[O],xe,G,!0),O++;else{const le=O,pe=O,ye=new Map;for(O=pe;O<=Q;O++){const Ne=te[O]=W?Ds(te[O]):ei(te[O]);Ne.key!=null&&ye.set(Ne.key,O)}let Y,X=0;const de=Q-pe+1;let Te=!1,je=0;const he=new Array(de);for(O=0;O=de){mt(Ne,xe,G,!0);continue}let me;if(Ne.key!=null)me=ye.get(Ne.key);else for(Y=pe;Y<=Q;Y++)if(he[Y-pe]===0&&Ii(Ne,te[Y])){me=Y;break}me===void 0?mt(Ne,xe,G,!0):(he[me-pe]=O+1,me>=je?je=me:Te=!0,C(Ne,te[me],be,null,xe,G,Z,N,W),X++)}const Ae=Te?t5(he):bu;for(Y=Ae.length-1,O=de-1;O>=0;O--){const Ne=pe+O,me=te[Ne],Je=Ne+1{const{el:G,type:Z,transition:N,children:W,shapeFlag:O}=ie;if(O&6){yt(ie.component.subTree,te,be,_e);return}if(O&128){ie.suspense.move(te,be,_e);return}if(O&64){Z.move(ie,te,be,Ke);return}if(Z===kt){r(G,te,be);for(let F=0;FN.enter(G),xe);else{const{leave:F,delayLeave:Q,afterLeave:le}=N,pe=()=>r(G,te,be),ye=()=>{F(G,()=>{pe(),le&&le()})};Q?Q(G,pe,ye):ye()}else r(G,te,be)},mt=(ie,te,be,_e=!1,xe=!1)=>{const{type:G,props:Z,ref:N,children:W,dynamicChildren:O,shapeFlag:j,patchFlag:F,dirs:Q}=ie;if(N!=null&&qp(N,null,be,ie,!0),j&256){te.ctx.deactivate(ie);return}const le=j&1&&Q,pe=!Qa(ie);let ye;if(pe&&(ye=Z&&Z.onVnodeBeforeUnmount)&&zr(ye,te,ie),j&6)Xe(ie.component,be,_e);else{if(j&128){ie.suspense.unmount(be,_e);return}le&&so(ie,null,te,"beforeUnmount"),j&64?ie.type.remove(ie,te,be,xe,Ke,_e):O&&(G!==kt||F>0&&F&64)?Ie(O,te,be,!1,!0):(G===kt&&F&384||!xe&&j&16)&&Ie(W,te,be),_e&&_t(ie)}(pe&&(ye=Z&&Z.onVnodeUnmounted)||le)&&Zn(()=>{ye&&zr(ye,te,ie),le&&so(ie,null,te,"unmounted")},be)},_t=ie=>{const{type:te,el:be,anchor:_e,transition:xe}=ie;if(te===kt){bt(be,_e);return}if(te===el){E(ie);return}const G=()=>{i(be),xe&&!xe.persisted&&xe.afterLeave&&xe.afterLeave()};if(ie.shapeFlag&1&&xe&&!xe.persisted){const{leave:Z,delayLeave:N}=xe,W=()=>Z(be,G);N?N(ie.el,G,W):W()}else G()},bt=(ie,te)=>{let be;for(;ie!==te;)be=v(ie),i(ie),ie=be;i(te)},Xe=(ie,te,be)=>{const{bum:_e,scope:xe,update:G,subTree:Z,um:N}=ie;_e&&ku(_e),xe.stop(),G&&(G.active=!1,mt(Z,ie,te,be)),N&&Zn(N,te),Zn(()=>{ie.isUnmounted=!0},te),te&&te.pendingBranch&&!te.isUnmounted&&ie.asyncDep&&!ie.asyncResolved&&ie.suspenseId===te.pendingId&&(te.deps--,te.deps===0&&te.resolve())},Ie=(ie,te,be,_e=!1,xe=!1,G=0)=>{for(let Z=G;Zie.shapeFlag&6?Be(ie.component.subTree):ie.shapeFlag&128?ie.suspense.next():v(ie.anchor||ie.el);let Ee=!1;const Ze=(ie,te,be)=>{ie==null?te._vnode&&mt(te._vnode,null,null,!0):C(te._vnode||null,ie,te,null,null,null,be),Ee||(Ee=!0,rS(),jp(),Ee=!1),te._vnode=ie},Ke={p:C,um:mt,m:yt,r:_t,mt:oe,mc:P,pc:ve,pbc:w,n:Be,o:t};let Fe,at;return e&&([Fe,at]=e(Ke)),{render:Ze,hydrate:Fe,createApp:WR(Ze,Fe)}}function hy({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function Aa({effect:t,update:e},n){t.allowRecurse=e.allowRecurse=n}function DO(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function K1(t,e,n=!1){const r=t.children,i=e.children;if(We(r)&&We(i))for(let o=0;o>1,t[n[l]]0&&(e[r]=n[o-1]),n[o]=r)}}for(o=n.length,s=n[o-1];o-- >0;)n[o]=s,s=e[s];return n}function RO(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:RO(e)}const n5=t=>t.__isTeleport,uf=t=>t&&(t.disabled||t.disabled===""),mS=t=>typeof SVGElement<"u"&&t instanceof SVGElement,gS=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,B0=(t,e)=>{const n=t&&t.to;return xt(n)?e?e(n):null:n},r5={name:"Teleport",__isTeleport:!0,process(t,e,n,r,i,o,s,l,u,f){const{mc:d,pc:m,pbc:v,o:{insert:y,querySelector:_,createText:C,createComment:x}}=f,k=uf(e.props);let{shapeFlag:A,children:L,dynamicChildren:E}=e;if(t==null){const H=e.el=C(""),I=e.anchor=C("");y(H,n,r),y(I,n,r);const q=e.target=B0(e.props,_),P=e.targetAnchor=C("");q&&(y(P,q),s==="svg"||mS(q)?s="svg":(s==="mathml"||gS(q))&&(s="mathml"));const z=(w,R)=>{A&16&&d(L,w,R,i,o,s,l,u)};k?z(n,I):q&&z(q,P)}else{e.el=t.el;const H=e.anchor=t.anchor,I=e.target=t.target,q=e.targetAnchor=t.targetAnchor,P=uf(t.props),z=P?n:I,w=P?H:q;if(s==="svg"||mS(I)?s="svg":(s==="mathml"||gS(I))&&(s="mathml"),E?(v(t.dynamicChildren,E,z,i,o,s,l),K1(t,e,!0)):u||m(t,e,z,w,i,o,s,l,!1),k)P?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):Ph(e,n,H,f,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const R=e.target=B0(e.props,_);R&&Ph(e,R,null,f,0)}else P&&Ph(e,I,q,f,1)}BO(e)},remove(t,e,n,r,{um:i,o:{remove:o}},s){const{shapeFlag:l,children:u,anchor:f,targetAnchor:d,target:m,props:v}=t;if(m&&o(d),s&&o(f),l&16){const y=s||!uf(v);for(let _=0;_0?$r||bu:null,$O(),fl>0&&$r&&$r.push(t),t}function Se(t,e,n,r,i,o){return HO(re(t,e,n,r,i,o,!0))}function Ct(t,e,n,r,i){return HO(Qe(t,e,n,r,i,!0))}function ea(t){return t?t.__v_isVNode===!0:!1}function Ii(t,e){return t.type===e.type&&t.key===e.key}function o5(t){}const gg="__vInternal",FO=({key:t})=>t??null,_p=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?xt(t)||qn(t)||pt(t)?{i:On,r:t,k:e,f:!!n}:t:null);function re(t,e=null,n=null,r=0,i=null,o=t===kt?0:1,s=!1,l=!1){const u={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&FO(e),ref:e&&_p(e),scopeId:fg,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:On};return l?(Y1(u,n),o&128&&t.normalize(u)):n&&(u.shapeFlag|=xt(n)?8:16),fl>0&&!s&&$r&&(u.patchFlag>0||o&6)&&u.patchFlag!==32&&$r.push(u),u}const Qe=s5;function s5(t,e=null,n=null,r=0,i=null,o=!1){if((!t||t===rO)&&(t=pr),ea(t)){const l=yo(t,e,!0);return n&&Y1(l,n),fl>0&&!o&&$r&&(l.shapeFlag&6?$r[$r.indexOf(t)]=l:$r.push(l)),l.patchFlag|=-2,l}if(m5(t)&&(t=t.__vccOpts),e){e=G1(e);let{class:l,style:u}=e;l&&!xt(l)&&(e.class=vt(l)),qt(u)&&(O1(u)&&!We(u)&&(u=Rt({},u)),e.style=oi(u))}const s=xt(t)?1:iO(t)?128:n5(t)?64:qt(t)?4:pt(t)?2:0;return re(t,e,n,r,i,s,o,!0)}function G1(t){return t?O1(t)||gg in t?Rt({},t):t:null}function yo(t,e,n=!1){const{props:r,ref:i,patchFlag:o,children:s}=t,l=e?wi(r||{},e):r;return{__v_isVNode:!0,__v_skip:!0,type:t.type,props:l,key:l&&FO(l),ref:e&&e.ref?n&&i?We(i)?i.concat(_p(e)):[i,_p(e)]:_p(e):i,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:s,target:t.target,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==kt?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:t.transition,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&yo(t.ssContent),ssFallback:t.ssFallback&&yo(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce}}function Ui(t=" ",e=0){return Qe(cl,null,t,e)}function a5(t,e){const n=Qe(el,null,t);return n.staticCount=e,n}function gt(t="",e=!1){return e?(ge(),Ct(pr,null,t)):Qe(pr,null,t)}function ei(t){return t==null||typeof t=="boolean"?Qe(pr):We(t)?Qe(kt,null,t.slice()):typeof t=="object"?Ds(t):Qe(cl,null,String(t))}function Ds(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:yo(t)}function Y1(t,e){let n=0;const{shapeFlag:r}=t;if(e==null)e=null;else if(We(e))n=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),Y1(t,i()),i._c&&(i._d=!0));return}else{n=32;const i=e._;!i&&!(gg in e)?e._ctx=On:i===3&&On&&(On.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else pt(e)?(e={default:e,_ctx:On},n=32):(e=String(e),r&64?(n=16,e=[Ui(e)]):n=8);t.children=e,t.shapeFlag|=n}function wi(...t){const e={};for(let n=0;nBn||On;let Kp,H0;{const t=x1(),e=(n,r)=>{let i;return(i=t[n])||(i=t[n]=[]),i.push(r),o=>{i.length>1?i.forEach(s=>s(o)):i[0](o)}};Kp=e("__VUE_INSTANCE_SETTERS__",n=>Bn=n),H0=e("__VUE_SSR_SETTERS__",n=>kd=n)}const dl=t=>{const e=Bn;return Kp(t),t.scope.on(),()=>{t.scope.off(),Kp(e)}},F0=()=>{Bn&&Bn.scope.off(),Kp(null)};function jO(t){return t.vnode.shapeFlag&4}let kd=!1;function WO(t,e=!1){e&&H0(e);const{props:n,children:r}=t.vnode,i=jO(t);qR(t,n,i,e),YR(t,r);const o=i?c5(t,e):void 0;return e&&H0(!1),o}function c5(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=fa(new Proxy(t.ctx,P0));const{setup:r}=n;if(r){const i=t.setupContext=r.length>1?KO(t):null,o=dl(t);ua();const s=mo(r,t,0,[t.props,i]);if(ca(),o(),w1(s)){if(s.then(F0,F0),e)return s.then(l=>{V0(t,l,e)}).catch(l=>{Ol(l,t,0)});t.asyncDep=s}else V0(t,s,e)}else qO(t,e)}function V0(t,e,n){pt(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:qt(e)&&(t.setupState=L1(e)),qO(t,n)}let Gp,j0;function UO(t){Gp=t,j0=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,SR))}}const f5=()=>!Gp;function qO(t,e,n){const r=t.type;if(!t.render){if(!e&&Gp&&!r.render){const i=r.template||U1(t).template;if(i){const{isCustomElement:o,compilerOptions:s}=t.appContext.config,{delimiters:l,compilerOptions:u}=r,f=Rt(Rt({isCustomElement:o,delimiters:l},s),u);r.render=Gp(i,f)}}t.render=r.render||An,j0&&j0(t)}{const i=dl(t);ua();try{BR(t)}finally{ca(),i()}}}function d5(t){return t.attrsProxy||(t.attrsProxy=new Proxy(t.attrs,{get(e,n){return Wr(t,"get","$attrs"),e[n]}}))}function KO(t){const e=n=>{t.exposed=n||{}};return{get attrs(){return d5(t)},slots:t.slots,emit:t.emit,expose:e}}function vg(t){if(t.exposed)return t.exposeProxy||(t.exposeProxy=new Proxy(L1(fa(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in af)return af[n](t)},has(e,n){return n in e||n in af}}))}const h5=/(?:^|[-_])(\w)/g,p5=t=>t.replace(h5,e=>e.toUpperCase()).replace(/[-_]/g,"");function Yp(t,e=!0){return pt(t)?t.displayName||t.name:t.name||e&&t.__name}function GO(t,e,n=!1){let r=Yp(e);if(!r&&e.__file){const i=e.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&t&&t.parent){const i=o=>{for(const s in o)if(o[s]===e)return s};r=i(t.components||t.parent.type.components)||i(t.appContext.components)}return r?p5(r):n?"App":"Anonymous"}function m5(t){return pt(t)&&"__vccOpts"in t}const er=(t,e)=>RD(t,e,kd);function g5(t,e,n=Ft){const r=qi(),i=bn(e),o=ni(e),s=I1((u,f)=>{let d;return cO(()=>{const m=t[e];ji(d,m)&&(d=m,f())}),{get(){return u(),n.get?n.get(d):d},set(m){const v=r.vnode.props;!(v&&(e in v||i in v||o in v)&&(`onUpdate:${e}`in v||`onUpdate:${i}`in v||`onUpdate:${o}`in v))&&ji(m,d)&&(d=m,f()),r.emit(`update:${e}`,n.set?n.set(m):m)}}}),l=e==="modelValue"?"modelModifiers":`${e}Modifiers`;return s[Symbol.iterator]=()=>{let u=0;return{next(){return u<2?{value:u++?t[l]||{}:s,done:!1}:{done:!0}}}},s}function mr(t,e,n){const r=arguments.length;return r===2?qt(e)&&!We(e)?ea(e)?Qe(t,null,[e]):Qe(t,e):Qe(t,null,e):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&ea(n)&&(n=[n]),Qe(t,e,n))}function v5(){}function y5(t,e,n,r){const i=n[r];if(i&&YO(i,t))return i;const o=e();return o.memo=t.slice(),n[r]=o}function YO(t,e){const n=t.memo;if(n.length!=e.length)return!1;for(let r=0;r0&&$r&&$r.push(t),!0}const JO="3.4.15",b5=An,_5=eR,w5=su,k5=tO,x5={createComponentInstance:VO,setupComponent:WO,renderComponentRoot:bp,setCurrentRenderingInstance:Vf,isVNode:ea,normalizeVNode:ei},S5=x5,C5=null,T5=null,E5=null;/** -* @vue/runtime-dom v3.4.15 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/const A5="http://www.w3.org/2000/svg",O5="http://www.w3.org/1998/Math/MathML",Rs=typeof document<"u"?document:null,vS=Rs&&Rs.createElement("template"),M5={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,r)=>{const i=e==="svg"?Rs.createElementNS(A5,t):e==="mathml"?Rs.createElementNS(O5,t):Rs.createElement(t,n?{is:n}:void 0);return t==="select"&&r&&r.multiple!=null&&i.setAttribute("multiple",r.multiple),i},createText:t=>Rs.createTextNode(t),createComment:t=>Rs.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Rs.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,r,i,o){const s=n?n.previousSibling:e.lastChild;if(i&&(i===o||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),n),!(i===o||!(i=i.nextSibling)););else{vS.innerHTML=r==="svg"?`${t}`:r==="mathml"?`${t}`:t;const l=vS.content;if(r==="svg"||r==="mathml"){const u=l.firstChild;for(;u.firstChild;)l.appendChild(u.firstChild);l.removeChild(u)}e.insertBefore(l,n)}return[s?s.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},Ss="transition",Uc="animation",Ru=Symbol("_vtc"),zu=(t,{slots:e})=>mr(dO,ZO(t),e);zu.displayName="Transition";const XO={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},N5=zu.props=Rt({},j1,XO),Oa=(t,e=[])=>{We(t)?t.forEach(n=>n(...e)):t&&t(...e)},yS=t=>t?We(t)?t.some(e=>e.length>1):t.length>1:!1;function ZO(t){const e={};for(const U in t)U in XO||(e[U]=t[U]);if(t.css===!1)return e;const{name:n="v",type:r,duration:i,enterFromClass:o=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:u=o,appearActiveClass:f=s,appearToClass:d=l,leaveFromClass:m=`${n}-leave-from`,leaveActiveClass:v=`${n}-leave-active`,leaveToClass:y=`${n}-leave-to`}=t,_=L5(i),C=_&&_[0],x=_&&_[1],{onBeforeEnter:k,onEnter:A,onEnterCancelled:L,onLeave:E,onLeaveCancelled:H,onBeforeAppear:I=k,onAppear:q=A,onAppearCancelled:P=L}=e,z=(U,K,oe)=>{Os(U,K?d:l),Os(U,K?f:s),oe&&oe()},w=(U,K)=>{U._isLeaving=!1,Os(U,m),Os(U,y),Os(U,v),K&&K()},R=U=>(K,oe)=>{const D=U?q:A,ae=()=>z(K,U,oe);Oa(D,[K,ae]),bS(()=>{Os(K,U?u:o),Io(K,U?d:l),yS(D)||_S(K,r,C,ae)})};return Rt(e,{onBeforeEnter(U){Oa(k,[U]),Io(U,o),Io(U,s)},onBeforeAppear(U){Oa(I,[U]),Io(U,u),Io(U,f)},onEnter:R(!1),onAppear:R(!0),onLeave(U,K){U._isLeaving=!0;const oe=()=>w(U,K);Io(U,m),eM(),Io(U,v),bS(()=>{U._isLeaving&&(Os(U,m),Io(U,y),yS(E)||_S(U,r,x,oe))}),Oa(E,[U,oe])},onEnterCancelled(U){z(U,!1),Oa(L,[U])},onAppearCancelled(U){z(U,!0),Oa(P,[U])},onLeaveCancelled(U){w(U),Oa(H,[U])}})}function L5(t){if(t==null)return null;if(qt(t))return[py(t.enter),py(t.leave)];{const e=py(t);return[e,e]}}function py(t){return $p(t)}function Io(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[Ru]||(t[Ru]=new Set)).add(e)}function Os(t,e){e.split(/\s+/).forEach(r=>r&&t.classList.remove(r));const n=t[Ru];n&&(n.delete(e),n.size||(t[Ru]=void 0))}function bS(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let I5=0;function _S(t,e,n,r){const i=t._endId=++I5,o=()=>{i===t._endId&&r()};if(n)return setTimeout(o,n);const{type:s,timeout:l,propCount:u}=QO(t,e);if(!s)return r();const f=s+"end";let d=0;const m=()=>{t.removeEventListener(f,v),o()},v=y=>{y.target===t&&++d>=u&&m()};setTimeout(()=>{d(n[_]||"").split(", "),i=r(`${Ss}Delay`),o=r(`${Ss}Duration`),s=wS(i,o),l=r(`${Uc}Delay`),u=r(`${Uc}Duration`),f=wS(l,u);let d=null,m=0,v=0;e===Ss?s>0&&(d=Ss,m=s,v=o.length):e===Uc?f>0&&(d=Uc,m=f,v=u.length):(m=Math.max(s,f),d=m>0?s>f?Ss:Uc:null,v=d?d===Ss?o.length:u.length:0);const y=d===Ss&&/\b(transform|all)(,|$)/.test(r(`${Ss}Property`).toString());return{type:d,timeout:m,propCount:v,hasTransform:y}}function wS(t,e){for(;t.lengthkS(n)+kS(t[r])))}function kS(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function eM(){return document.body.offsetHeight}function P5(t,e,n){const r=t[Ru];r&&(e=(e?[e,...r]:[...r]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const J1=Symbol("_vod"),Bu={beforeMount(t,{value:e},{transition:n}){t[J1]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):qc(t,e)},mounted(t,{value:e},{transition:n}){n&&e&&n.enter(t)},updated(t,{value:e,oldValue:n},{transition:r}){!e!=!n&&(r?e?(r.beforeEnter(t),qc(t,!0),r.enter(t)):r.leave(t,()=>{qc(t,!1)}):qc(t,e))},beforeUnmount(t,{value:e}){qc(t,e)}};function qc(t,e){t.style.display=e?t[J1]:"none"}function D5(){Bu.getSSRProps=({value:t})=>{if(!t)return{style:{display:"none"}}}}const tM=Symbol("");function R5(t){const e=qi();if(!e)return;const n=e.ut=(i=t(e.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${e.uid}"]`)).forEach(o=>U0(o,i))},r=()=>{const i=t(e.proxy);W0(e.subTree,i),n(i)};uO(r),ts(()=>{const i=new MutationObserver(r);i.observe(e.subTree.el.parentNode,{childList:!0}),mg(()=>i.disconnect())})}function W0(t,e){if(t.shapeFlag&128){const n=t.suspense;t=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{W0(n.activeBranch,e)})}for(;t.component;)t=t.component.subTree;if(t.shapeFlag&1&&t.el)U0(t.el,e);else if(t.type===kt)t.children.forEach(n=>W0(n,e));else if(t.type===el){let{el:n,anchor:r}=t;for(;n&&(U0(n,e),n!==r);)n=n.nextSibling}}function U0(t,e){if(t.nodeType===1){const n=t.style;let r="";for(const i in e)n.setProperty(`--${i}`,e[i]),r+=`--${i}: ${e[i]};`;n[tM]=r}}function z5(t,e,n){const r=t.style,i=r.display,o=xt(n);if(n&&!o){if(e&&!xt(e))for(const s in e)n[s]==null&&q0(r,s,"");for(const s in n)q0(r,s,n[s])}else if(o){if(e!==n){const s=r[tM];s&&(n+=";"+s),r.cssText=n}}else e&&t.removeAttribute("style");J1 in t&&(r.display=i)}const xS=/\s*!important$/;function q0(t,e,n){if(We(n))n.forEach(r=>q0(t,e,r));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const r=B5(t,e);xS.test(n)?t.setProperty(ni(r),n.replace(xS,""),"important"):t[r]=n}}const SS=["Webkit","Moz","ms"],my={};function B5(t,e){const n=my[e];if(n)return n;let r=bn(e);if(r!=="filter"&&r in t)return my[e]=r;r=El(r);for(let i=0;igy||(W5.then(()=>gy=0),gy=Date.now());function q5(t,e){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;si(K5(r,n.value),e,5,[r])};return n.value=t,n.attached=U5(),n}function K5(t,e){if(We(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(r=>i=>!i._stopped&&r&&r(i))}else return e}const AS=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,G5=(t,e,n,r,i,o,s,l,u)=>{const f=i==="svg";e==="class"?P5(t,r,f):e==="style"?z5(t,n,r):Cl(e)?b1(e)||V5(t,e,n,r,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):Y5(t,e,r,f))?H5(t,e,r,o,s,l,u):(e==="true-value"?t._trueValue=r:e==="false-value"&&(t._falseValue=r),$5(t,e,r,f))};function Y5(t,e,n,r){if(r)return!!(e==="innerHTML"||e==="textContent"||e in t&&AS(e)&&pt(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const i=t.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return AS(e)&&xt(n)?!1:e in t}/*! #__NO_SIDE_EFFECTS__ */function nM(t,e){const n=Vn(t);class r extends yg{constructor(o){super(n,o,e)}}return r.def=n,r}/*! #__NO_SIDE_EFFECTS__ */const J5=t=>nM(t,dM),X5=typeof HTMLElement<"u"?HTMLElement:class{};class yg extends X5{constructor(e,n={},r){super(),this._def=e,this._props=n,this._instance=null,this._connected=!1,this._resolved=!1,this._numberProps=null,this._ob=null,this.shadowRoot&&r?r(this._createVNode(),this.shadowRoot):(this.attachShadow({mode:"open"}),this._def.__asyncLoader||this._resolveProps(this._def))}connectedCallback(){this._connected=!0,this._instance||(this._resolved?this._update():this._resolveDef())}disconnectedCallback(){this._connected=!1,this._ob&&(this._ob.disconnect(),this._ob=null),Ri(()=>{this._connected||(K0(null,this.shadowRoot),this._instance=null)})}_resolveDef(){this._resolved=!0;for(let r=0;r{for(const i of r)this._setAttr(i.attributeName)}),this._ob.observe(this,{attributes:!0});const e=(r,i=!1)=>{const{props:o,styles:s}=r;let l;if(o&&!We(o))for(const u in o){const f=o[u];(f===Number||f&&f.type===Number)&&(u in this._props&&(this._props[u]=$p(this._props[u])),(l||(l=Object.create(null)))[bn(u)]=!0)}this._numberProps=l,i&&this._resolveProps(r),this._applyStyles(s),this._update()},n=this._def.__asyncLoader;n?n().then(r=>e(r,!0)):e(this._def)}_resolveProps(e){const{props:n}=e,r=We(n)?n:Object.keys(n||{});for(const i of Object.keys(this))i[0]!=="_"&&r.includes(i)&&this._setProp(i,this[i],!0,!1);for(const i of r.map(bn))Object.defineProperty(this,i,{get(){return this._getProp(i)},set(o){this._setProp(i,o)}})}_setAttr(e){let n=this.getAttribute(e);const r=bn(e);this._numberProps&&this._numberProps[r]&&(n=$p(n)),this._setProp(r,n,!1)}_getProp(e){return this._props[e]}_setProp(e,n,r=!0,i=!0){n!==this._props[e]&&(this._props[e]=n,i&&this._instance&&this._update(),r&&(n===!0?this.setAttribute(ni(e),""):typeof n=="string"||typeof n=="number"?this.setAttribute(ni(e),n+""):n||this.removeAttribute(ni(e))))}_update(){K0(this._createVNode(),this.shadowRoot)}_createVNode(){const e=Qe(this._def,Rt({},this._props));return this._instance||(e.ce=n=>{this._instance=n,n.isCE=!0;const r=(o,s)=>{this.dispatchEvent(new CustomEvent(o,{detail:s}))};n.emit=(o,...s)=>{r(o,s),ni(o)!==o&&r(ni(o),s)};let i=this;for(;i=i&&(i.parentNode||i.host);)if(i instanceof yg){n.parent=i._instance,n.provides=i._instance.provides;break}}),e}_applyStyles(e){e&&e.forEach(n=>{const r=document.createElement("style");r.textContent=n,this.shadowRoot.appendChild(r)})}}function Z5(t="$style"){{const e=qi();if(!e)return Ft;const n=e.type.__cssModules;if(!n)return Ft;const r=n[t];return r||Ft}}const rM=new WeakMap,iM=new WeakMap,Jp=Symbol("_moveCb"),OS=Symbol("_enterCb"),oM={name:"TransitionGroup",props:Rt({},N5,{tag:String,moveClass:String}),setup(t,{slots:e}){const n=qi(),r=V1();let i,o;return pg(()=>{if(!i.length)return;const s=t.moveClass||`${t.name||"v"}-move`;if(!i8(i[0].el,n.vnode.el,s))return;i.forEach(t8),i.forEach(n8);const l=i.filter(r8);eM(),l.forEach(u=>{const f=u.el,d=f.style;Io(f,s),d.transform=d.webkitTransform=d.transitionDuration="";const m=f[Jp]=v=>{v&&v.target!==f||(!v||/transform$/.test(v.propertyName))&&(f.removeEventListener("transitionend",m),f[Jp]=null,Os(f,s))};f.addEventListener("transitionend",m)})}),()=>{const s=Mt(t),l=ZO(s);let u=s.tag||kt;i=o,o=e.default?dg(e.default()):[];for(let f=0;fdelete t.mode;oM.props;const e8=oM;function t8(t){const e=t.el;e[Jp]&&e[Jp](),e[OS]&&e[OS]()}function n8(t){iM.set(t,t.el.getBoundingClientRect())}function r8(t){const e=rM.get(t),n=iM.get(t),r=e.left-n.left,i=e.top-n.top;if(r||i){const o=t.el.style;return o.transform=o.webkitTransform=`translate(${r}px,${i}px)`,o.transitionDuration="0s",t}}function i8(t,e,n){const r=t.cloneNode(),i=t[Ru];i&&i.forEach(l=>{l.split(/\s+/).forEach(u=>u&&r.classList.remove(u))}),n.split(/\s+/).forEach(l=>l&&r.classList.add(l)),r.style.display="none";const o=e.nodeType===1?e:e.parentNode;o.appendChild(r);const{hasTransform:s}=QO(r);return o.removeChild(r),s}const ta=t=>{const e=t.props["onUpdate:modelValue"]||!1;return We(e)?n=>ku(e,n):e};function o8(t){t.target.composing=!0}function MS(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const bi=Symbol("_assign"),Mn={created(t,{modifiers:{lazy:e,trim:n,number:r}},i){t[bi]=ta(i);const o=r||i.props&&i.props.type==="number";Bo(t,e?"change":"input",s=>{if(s.target.composing)return;let l=t.value;n&&(l=l.trim()),o&&(l=zf(l)),t[bi](l)}),n&&Bo(t,"change",()=>{t.value=t.value.trim()}),e||(Bo(t,"compositionstart",o8),Bo(t,"compositionend",MS),Bo(t,"change",MS))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,modifiers:{lazy:n,trim:r,number:i}},o){if(t[bi]=ta(o),t.composing)return;const s=i||t.type==="number"?zf(t.value):t.value,l=e??"";s!==l&&(document.activeElement===t&&t.type!=="range"&&(n||r&&t.value.trim()===l)||(t.value=l))}},xd={deep:!0,created(t,e,n){t[bi]=ta(n),Bo(t,"change",()=>{const r=t._modelValue,i=$u(t),o=t.checked,s=t[bi];if(We(r)){const l=og(r,i),u=l!==-1;if(o&&!u)s(r.concat(i));else if(!o&&u){const f=[...r];f.splice(l,1),s(f)}}else if(Tl(r)){const l=new Set(r);o?l.add(i):l.delete(i),s(l)}else s(sM(t,o))})},mounted:NS,beforeUpdate(t,e,n){t[bi]=ta(n),NS(t,e,n)}};function NS(t,{value:e,oldValue:n},r){t._modelValue=e,We(e)?t.checked=og(e,r.props.value)>-1:Tl(e)?t.checked=e.has(r.props.value):e!==n&&(t.checked=qo(e,sM(t,!0)))}const X1={created(t,{value:e},n){t.checked=qo(e,n.props.value),t[bi]=ta(n),Bo(t,"change",()=>{t[bi]($u(t))})},beforeUpdate(t,{value:e,oldValue:n},r){t[bi]=ta(r),e!==n&&(t.checked=qo(e,r.props.value))}},Z1={deep:!0,created(t,{value:e,modifiers:{number:n}},r){const i=Tl(e);Bo(t,"change",()=>{const o=Array.prototype.filter.call(t.options,s=>s.selected).map(s=>n?zf($u(s)):$u(s));t[bi](t.multiple?i?new Set(o):o:o[0]),t._assigning=!0,Ri(()=>{t._assigning=!1})}),t[bi]=ta(r)},mounted(t,{value:e,oldValue:n,modifiers:{number:r}}){LS(t,e,n,r)},beforeUpdate(t,e,n){t[bi]=ta(n)},updated(t,{value:e,oldValue:n,modifiers:{number:r}}){t._assigning||LS(t,e,n,r)}};function LS(t,e,n,r){const i=t.multiple,o=We(e);if(!(i&&!o&&!Tl(e))&&!(o&&qo(e,n))){for(let s=0,l=t.options.length;s-1}else u.selected=e.has(f);else if(qo($u(u),e)){t.selectedIndex!==s&&(t.selectedIndex=s);return}}!i&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function $u(t){return"_value"in t?t._value:t.value}function sM(t,e){const n=e?"_trueValue":"_falseValue";return n in t?t[n]:e}const aM={created(t,e,n){Dh(t,e,n,null,"created")},mounted(t,e,n){Dh(t,e,n,null,"mounted")},beforeUpdate(t,e,n,r){Dh(t,e,n,r,"beforeUpdate")},updated(t,e,n,r){Dh(t,e,n,r,"updated")}};function lM(t,e){switch(t){case"SELECT":return Z1;case"TEXTAREA":return Mn;default:switch(e){case"checkbox":return xd;case"radio":return X1;default:return Mn}}}function Dh(t,e,n,r,i){const s=lM(t.tagName,n.props&&n.props.type)[i];s&&s(t,e,n,r)}function s8(){Mn.getSSRProps=({value:t})=>({value:t}),X1.getSSRProps=({value:t},e)=>{if(e.props&&qo(e.props.value,t))return{checked:!0}},xd.getSSRProps=({value:t},e)=>{if(We(t)){if(e.props&&og(t,e.props.value)>-1)return{checked:!0}}else if(Tl(t)){if(e.props&&t.has(e.props.value))return{checked:!0}}else if(t)return{checked:!0}},aM.getSSRProps=(t,e)=>{if(typeof e.type!="string")return;const n=lM(e.type.toUpperCase(),e.props&&e.props.type);if(n.getSSRProps)return n.getSSRProps(t,e)}}const a8=["ctrl","shift","alt","meta"],l8={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>a8.some(n=>t[`${n}Key`]&&!e.includes(n))},lt=(t,e)=>{const n=t._withMods||(t._withMods={}),r=e.join(".");return n[r]||(n[r]=(i,...o)=>{for(let s=0;s{const n=t._withKeys||(t._withKeys={}),r=e.join(".");return n[r]||(n[r]=i=>{if(!("key"in i))return;const o=ni(i.key);if(e.some(s=>s===o||u8[s]===o))return t(i)})},uM=Rt({patchProp:G5},M5);let ff,IS=!1;function cM(){return ff||(ff=LO(uM))}function fM(){return ff=IS?ff:IO(uM),IS=!0,ff}const K0=(...t)=>{cM().render(...t)},dM=(...t)=>{fM().hydrate(...t)},Q1=(...t)=>{const e=cM().createApp(...t),{mount:n}=e;return e.mount=r=>{const i=pM(r);if(!i)return;const o=e._component;!pt(o)&&!o.render&&!o.template&&(o.template=i.innerHTML),i.innerHTML="";const s=n(i,!1,hM(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),s},e},c8=(...t)=>{const e=fM().createApp(...t),{mount:n}=e;return e.mount=r=>{const i=pM(r);if(i)return n(i,!0,hM(i))},e};function hM(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function pM(t){return xt(t)?document.querySelector(t):t}let PS=!1;const f8=()=>{PS||(PS=!0,s8(),D5())},d8=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:dO,BaseTransitionPropsValidators:j1,Comment:pr,DeprecationTypes:E5,EffectScope:S1,ErrorCodes:QD,ErrorTypeStrings:_5,Fragment:kt,KeepAlive:kR,ReactiveEffect:Pu,Static:el,Suspense:dR,Teleport:zO,Text:cl,TrackOpTypes:qD,Transition:zu,TransitionGroup:e8,TriggerOpTypes:KD,VueElement:yg,assertNumber:ZD,callWithAsyncErrorHandling:si,callWithErrorHandling:mo,camelize:bn,capitalize:El,cloneVNode:yo,compatUtils:T5,computed:er,createApp:Q1,createBlock:Ct,createCommentVNode:gt,createElementBlock:Se,createElementVNode:re,createHydrationRenderer:IO,createPropsRestProxy:RR,createRenderer:LO,createSSRApp:c8,createSlots:W1,createStaticVNode:a5,createTextVNode:Ui,createVNode:Qe,customRef:I1,defineAsyncComponent:_R,defineComponent:Vn,defineCustomElement:nM,defineEmits:TR,defineExpose:ER,defineModel:MR,defineOptions:AR,defineProps:CR,defineSSRCustomElement:J5,defineSlots:OR,devtools:w5,effect:pD,effectScope:fD,getCurrentInstance:qi,getCurrentScope:LA,getTransitionRawChildren:dg,guardReactiveProps:G1,h:mr,handleError:Ol,hasInjectionContext:UR,hydrate:dM,initCustomFormatter:v5,initDirectivesForSSR:f8,inject:lf,isMemoSame:YO,isProxy:O1,isReactive:Za,isReadonly:ll,isRef:qn,isRuntimeOnly:f5,isShallow:Bf,isVNode:ea,markRaw:fa,mergeDefaults:PR,mergeModels:DR,mergeProps:wi,nextTick:Ri,normalizeClass:vt,normalizeProps:AA,normalizeStyle:oi,onActivated:pO,onBeforeMount:vO,onBeforeUnmount:Ml,onBeforeUpdate:yO,onDeactivated:mO,onErrorCaptured:kO,onMounted:ts,onRenderTracked:wO,onRenderTriggered:_O,onScopeDispose:dD,onServerPrefetch:bO,onUnmounted:mg,onUpdated:pg,openBlock:ge,popScopeId:R1,provide:Up,proxyRefs:L1,pushScopeId:D1,queuePostFlushCb:Vp,reactive:Al,readonly:A1,ref:Ot,registerRuntimeCompiler:UO,render:K0,renderList:Zt,renderSlot:pn,resolveComponent:ut,resolveDirective:sc,resolveDynamicComponent:Qs,resolveFilter:C5,resolveTransitionHooks:Du,setBlockTracking:$0,setDevtoolsHook:k5,setTransitionHooks:ul,shallowReactive:Fp,shallowReadonly:DD,shallowRef:GA,ssrContextKey:sO,ssrUtils:S5,stop:mD,toDisplayString:Le,toHandlerKey:wu,toHandlers:L0,toRaw:Mt,toRef:UD,toRefs:VD,toValue:$D,transformVNodeArgs:o5,triggerRef:BD,unref:fr,useAttrs:IR,useCssModule:Z5,useCssVars:R5,useModel:g5,useSSRContext:aO,useSlots:LR,useTransitionState:V1,vModelCheckbox:xd,vModelDynamic:aM,vModelRadio:X1,vModelSelect:Z1,vModelText:Mn,vShow:Bu,version:JO,warn:b5,watch:En,watchEffect:lO,watchPostEffect:uO,watchSyncEffect:cO,withAsyncContext:zR,withCtx:Vt,withDefaults:NR,withDirectives:Ut,withKeys:Tu,withMemo:y5,withModifiers:lt,withScopeId:z1},Symbol.toStringTag,{value:"Module"}));/** -* @vue/compiler-core v3.4.15 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/const qf=Symbol(""),df=Symbol(""),e_=Symbol(""),Xp=Symbol(""),mM=Symbol(""),hl=Symbol(""),gM=Symbol(""),vM=Symbol(""),t_=Symbol(""),n_=Symbol(""),Sd=Symbol(""),r_=Symbol(""),yM=Symbol(""),i_=Symbol(""),o_=Symbol(""),s_=Symbol(""),a_=Symbol(""),l_=Symbol(""),u_=Symbol(""),bM=Symbol(""),_M=Symbol(""),bg=Symbol(""),Zp=Symbol(""),c_=Symbol(""),f_=Symbol(""),Kf=Symbol(""),Cd=Symbol(""),d_=Symbol(""),G0=Symbol(""),h8=Symbol(""),Y0=Symbol(""),Qp=Symbol(""),p8=Symbol(""),m8=Symbol(""),h_=Symbol(""),g8=Symbol(""),v8=Symbol(""),p_=Symbol(""),wM=Symbol(""),Hu={[qf]:"Fragment",[df]:"Teleport",[e_]:"Suspense",[Xp]:"KeepAlive",[mM]:"BaseTransition",[hl]:"openBlock",[gM]:"createBlock",[vM]:"createElementBlock",[t_]:"createVNode",[n_]:"createElementVNode",[Sd]:"createCommentVNode",[r_]:"createTextVNode",[yM]:"createStaticVNode",[i_]:"resolveComponent",[o_]:"resolveDynamicComponent",[s_]:"resolveDirective",[a_]:"resolveFilter",[l_]:"withDirectives",[u_]:"renderList",[bM]:"renderSlot",[_M]:"createSlots",[bg]:"toDisplayString",[Zp]:"mergeProps",[c_]:"normalizeClass",[f_]:"normalizeStyle",[Kf]:"normalizeProps",[Cd]:"guardReactiveProps",[d_]:"toHandlers",[G0]:"camelize",[h8]:"capitalize",[Y0]:"toHandlerKey",[Qp]:"setBlockTracking",[p8]:"pushScopeId",[m8]:"popScopeId",[h_]:"withCtx",[g8]:"unref",[v8]:"isRef",[p_]:"withMemo",[wM]:"isMemoSame"};function y8(t){Object.getOwnPropertySymbols(t).forEach(e=>{Hu[e]=t[e]})}const li={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function b8(t,e=""){return{type:0,source:e,children:t,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:0,temps:0,codegenNode:void 0,loc:li}}function Gf(t,e,n,r,i,o,s,l=!1,u=!1,f=!1,d=li){return t&&(l?(t.helper(hl),t.helper(ju(t.inSSR,f))):t.helper(Vu(t.inSSR,f)),s&&t.helper(l_)),{type:13,tag:e,props:n,children:r,patchFlag:i,dynamicProps:o,directives:s,isBlock:l,disableTracking:u,isComponent:f,loc:d}}function Td(t,e=li){return{type:17,loc:e,elements:t}}function vi(t,e=li){return{type:15,loc:e,properties:t}}function yn(t,e){return{type:16,loc:li,key:xt(t)?Et(t,!0):t,value:e}}function Et(t,e=!1,n=li,r=0){return{type:4,loc:n,content:t,isStatic:e,constType:e?3:r}}function $i(t,e=li){return{type:8,loc:e,children:t}}function zn(t,e=[],n=li){return{type:14,loc:n,callee:t,arguments:e}}function Fu(t,e=void 0,n=!1,r=!1,i=li){return{type:18,params:t,returns:e,newline:n,isSlot:r,loc:i}}function J0(t,e,n,r=!0){return{type:19,test:t,consequent:e,alternate:n,newline:r,loc:li}}function _8(t,e,n=!1){return{type:20,index:t,value:e,isVNode:n,loc:li}}function w8(t){return{type:21,body:t,loc:li}}function Vu(t,e){return t||e?t_:n_}function ju(t,e){return t||e?gM:vM}function m_(t,{helper:e,removeHelper:n,inSSR:r}){t.isBlock||(t.isBlock=!0,n(Vu(r,t.isComponent)),e(hl),e(ju(r,t.isComponent)))}const DS=new Uint8Array([123,123]),RS=new Uint8Array([125,125]);function zS(t){return t>=97&&t<=122||t>=65&&t<=90}function Qr(t){return t===32||t===10||t===9||t===12||t===13}function Cs(t){return t===47||t===62||Qr(t)}function em(t){const e=new Uint8Array(t.length);for(let n=0;n=0;i--){const o=this.newlines[i];if(e>o){n=i+2,r=e-o;break}}return{column:r,line:n,offset:e}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(e){e===60?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):!this.inVPre&&e===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(e))}stateInterpolationOpen(e){if(e===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const n=this.index+1-this.delimiterOpen.length;n>this.sectionStart&&this.cbs.ontext(this.sectionStart,n),this.state=3,this.sectionStart=n}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(e)):(this.state=1,this.stateText(e))}stateInterpolation(e){e===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(e))}stateInterpolationClose(e){e===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(e))}stateSpecialStartSequence(e){const n=this.sequenceIndex===this.currentSequence.length;if(!(n?Cs(e):(e|32)===this.currentSequence[this.sequenceIndex]))this.inRCDATA=!1;else if(!n){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=6,this.stateInTagName(e)}stateInRCDATA(e){if(this.sequenceIndex===this.currentSequence.length){if(e===62||Qr(e)){const n=this.index-this.currentSequence.length;if(this.sectionStart=e||(this.state===28?this.currentSequence===lr.CdataEnd?this.cbs.oncdata(this.sectionStart,e):this.cbs.oncomment(this.sectionStart,e):this.state===6||this.state===11||this.state===18||this.state===17||this.state===12||this.state===13||this.state===14||this.state===15||this.state===16||this.state===20||this.state===19||this.state===21||this.state===9||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,n){}}function BS(t,{compatConfig:e}){const n=e&&e[t];return t==="MODE"?n||3:n}function tl(t,e){const n=BS("MODE",e),r=BS(t,e);return n===3?r===!0:r!==!1}function Yf(t,e,n,...r){return tl(t,e)}function g_(t){throw t}function kM(t){}function an(t,e,n,r){const i=`https://vuejs.org/error-reference/#compiler-${t}`,o=new SyntaxError(String(i));return o.code=t,o.loc=e,o}const Hr=t=>t.type===4&&t.isStatic;function xM(t){switch(t){case"Teleport":case"teleport":return df;case"Suspense":case"suspense":return e_;case"KeepAlive":case"keep-alive":return Xp;case"BaseTransition":case"base-transition":return mM}}const x8=/^\d|[^\$\w]/,v_=t=>!x8.test(t),S8=/[A-Za-z_$\xA0-\uFFFF]/,C8=/[\.\?\w$\xA0-\uFFFF]/,T8=/\s+[.[]\s*|\s*[.[]\s+/g,E8=t=>{t=t.trim().replace(T8,s=>s.trim());let e=0,n=[],r=0,i=0,o=null;for(let s=0;se.type===7&&e.name==="bind"&&(!e.arg||e.arg.type!==4||!e.arg.isStatic))}function vy(t){return t.type===5||t.type===2}function O8(t){return t.type===7&&t.name==="slot"}function tm(t){return t.type===1&&t.tagType===3}function nm(t){return t.type===1&&t.tagType===2}const M8=new Set([Kf,Cd]);function CM(t,e=[]){if(t&&!xt(t)&&t.type===14){const n=t.callee;if(!xt(n)&&M8.has(n))return CM(t.arguments[0],e.concat(t))}return[t,e]}function rm(t,e,n){let r,i=t.type===13?t.props:t.arguments[2],o=[],s;if(i&&!xt(i)&&i.type===14){const l=CM(i);i=l[0],o=l[1],s=o[o.length-1]}if(i==null||xt(i))r=vi([e]);else if(i.type===14){const l=i.arguments[0];!xt(l)&&l.type===15?$S(e,l)||l.properties.unshift(e):i.callee===d_?r=zn(n.helper(Zp),[vi([e]),i]):i.arguments.unshift(vi([e])),!r&&(r=i)}else i.type===15?($S(e,i)||i.properties.unshift(e),r=i):(r=zn(n.helper(Zp),[vi([e]),i]),s&&s.callee===Cd&&(s=o[o.length-2]));t.type===13?s?s.arguments[0]=r:t.props=r:s?s.arguments[0]=r:t.arguments[2]=r}function $S(t,e){let n=!1;if(t.key.type===4){const r=t.key.content;n=e.properties.some(i=>i.key.type===4&&i.key.content===r)}return n}function Jf(t,e){return`_${e}_${t.replace(/[^\w]/g,(n,r)=>n==="-"?"_":t.charCodeAt(r).toString())}`}function N8(t){return t.type===14&&t.callee===p_?t.arguments[1].returns:t}const L8=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,TM={parseMode:"base",ns:0,delimiters:["{{","}}"],getNamespace:()=>0,isVoidTag:yp,isPreTag:yp,isCustomElement:yp,onError:g_,onWarn:kM,comments:!1,prefixIdentifiers:!1};let jt=TM,Xf=null,nl="",cr=null,Nt=null,Pr="",Po=-1,La=-1,im=0,zs=!1,X0=null;const hn=[],gn=new k8(hn,{onerr:Lo,ontext(t,e){Rh(Jn(t,e),t,e)},ontextentity(t,e,n){Rh(t,e,n)},oninterpolation(t,e){if(zs)return Rh(Jn(t,e),t,e);let n=t+gn.delimiterOpen.length,r=e-gn.delimiterClose.length;for(;Qr(nl.charCodeAt(n));)n++;for(;Qr(nl.charCodeAt(r-1));)r--;let i=Jn(n,r);i.includes("&")&&(i=jt.decodeEntities(i,!1)),Z0({type:5,content:kp(i,!1,Rn(n,r)),loc:Rn(t,e)})},onopentagname(t,e){const n=Jn(t,e);cr={type:1,tag:n,ns:jt.getNamespace(n,hn[0],jt.ns),tagType:0,props:[],children:[],loc:Rn(t-1,e),codegenNode:void 0}},onopentagend(t){FS(t)},onclosetag(t,e){const n=Jn(t,e);if(!jt.isVoidTag(n)){let r=!1;for(let i=0;i0&&Lo(24,hn[0].loc.start.offset);for(let s=0;s<=i;s++){const l=hn.shift();wp(l,e,s(r.type===7?r.rawName:r.name)===n)&&Lo(2,e)},onattribend(t,e){if(cr&&Nt){if(ja(Nt.loc,e),t!==0)if(Pr.includes("&")&&(Pr=jt.decodeEntities(Pr,!0)),Nt.type===6)Nt.name==="class"&&(Pr=OM(Pr).trim()),t===1&&!Pr&&Lo(13,e),Nt.value={type:2,content:Pr,loc:t===1?Rn(Po,La):Rn(Po-1,La+1)},gn.inSFCRoot&&cr.tag==="template"&&Nt.name==="lang"&&Pr&&Pr!=="html"&&gn.enterRCDATA(em("-1&&Yf("COMPILER_V_BIND_SYNC",jt,Nt.loc,Nt.rawName)&&(Nt.name="model",Nt.modifiers.splice(r,1))}(Nt.type!==7||Nt.name!=="pre")&&cr.props.push(Nt)}Pr="",Po=La=-1},oncomment(t,e){jt.comments&&Z0({type:3,content:Jn(t,e),loc:Rn(t-4,e+3)})},onend(){const t=nl.length;for(let e=0;e{const _=e.start.offset+v,C=_+m.length;return kp(m,!1,Rn(_,C),0,y?1:0)},l={source:s(o.trim(),n.indexOf(o,i.length)),value:void 0,key:void 0,index:void 0,finalized:!1};let u=i.trim().replace(I8,"").trim();const f=i.indexOf(u),d=u.match(HS);if(d){u=u.replace(HS,"").trim();const m=d[1].trim();let v;if(m&&(v=n.indexOf(m,f+u.length),l.key=s(m,v,!0)),d[2]){const y=d[2].trim();y&&(l.index=s(y,n.indexOf(y,l.key?v+m.length:f+u.length),!0))}}return u&&(l.value=s(u,f,!0)),l}function Jn(t,e){return nl.slice(t,e)}function FS(t){gn.inSFCRoot&&(cr.innerLoc=Rn(t+1,t+1)),Z0(cr);const{tag:e,ns:n}=cr;n===0&&jt.isPreTag(e)&&im++,jt.isVoidTag(e)?wp(cr,t):(hn.unshift(cr),(n===1||n===2)&&(gn.inXML=!0)),cr=null}function Rh(t,e,n){var r;{const s=(r=hn[0])==null?void 0:r.tag;s!=="script"&&s!=="style"&&t.includes("&")&&(t=jt.decodeEntities(t,!1))}const i=hn[0]||Xf,o=i.children[i.children.length-1];(o==null?void 0:o.type)===2?(o.content+=t,ja(o.loc,n)):i.children.push({type:2,content:t,loc:Rn(e,n)})}function wp(t,e,n=!1){n?ja(t.loc,EM(e,60)):ja(t.loc,e+1),gn.inSFCRoot&&(t.children.length?t.innerLoc.end=Rt({},t.children[t.children.length-1].loc.end):t.innerLoc.end=Rt({},t.innerLoc.start),t.innerLoc.source=Jn(t.innerLoc.start.offset,t.innerLoc.end.offset));const{tag:r,ns:i}=t;zs||(r==="slot"?t.tagType=2:VS(t)?t.tagType=3:R8(t)&&(t.tagType=1)),gn.inRCDATA||(t.children=AM(t.children,t.tag)),i===0&&jt.isPreTag(r)&&im--,X0===t&&(zs=gn.inVPre=!1,X0=null),gn.inXML&&(hn[0]?hn[0].ns:jt.ns)===0&&(gn.inXML=!1);{const o=t.props;if(!gn.inSFCRoot&&tl("COMPILER_NATIVE_TEMPLATE",jt)&&t.tag==="template"&&!VS(t)){const l=hn[0]||Xf,u=l.children.indexOf(t);l.children.splice(u,1,...t.children)}const s=o.find(l=>l.type===6&&l.name==="inline-template");s&&Yf("COMPILER_INLINE_TEMPLATE",jt,s.loc)&&t.children.length&&(s.value={type:2,content:Jn(t.children[0].loc.start.offset,t.children[t.children.length-1].loc.end.offset),loc:s.loc})}}function EM(t,e){let n=t;for(;nl.charCodeAt(n)!==e&&n>=0;)n--;return n}const D8=new Set(["if","else","else-if","for","slot"]);function VS({tag:t,props:e}){if(t==="template"){for(let n=0;n64&&t<91}const B8=/\r\n/g;function AM(t,e){var n,r;const i=jt.whitespace!=="preserve";let o=!1;for(let s=0;s0){if(u>=2){l.codegenNode.patchFlag="-1",l.codegenNode=e.hoist(l.codegenNode),o++;continue}}else{const f=l.codegenNode;if(f.type===13){const d=PM(f);if((!d||d===512||d===1)&&LM(l,e)>=2){const m=IM(l);m&&(f.props=e.hoist(m))}f.dynamicProps&&(f.dynamicProps=e.hoist(f.dynamicProps))}}}if(l.type===1){const u=l.tagType===1;u&&e.scopes.vSlot++,xp(l,e),u&&e.scopes.vSlot--}else if(l.type===11)xp(l,e,l.children.length===1);else if(l.type===9)for(let u=0;u1)for(let f=0;fR&&(P.childIndex--,P.onNodeRemoved()),P.parent.children.splice(R,1)},onNodeRemoved:An,addIdentifiers(z){},removeIdentifiers(z){},hoist(z){xt(z)&&(z=Et(z)),P.hoists.push(z);const w=Et(`_hoisted_${P.hoists.length}`,!1,z.loc,2);return w.hoisted=z,w},cache(z,w=!1){return _8(P.cached++,z,w)}};return P.filters=new Set,P}function K8(t,e){const n=q8(t,e);wg(t,n),e.hoistStatic&&W8(t,n),e.ssr||G8(t,n),t.helpers=new Set([...n.helpers.keys()]),t.components=[...n.components],t.directives=[...n.directives],t.imports=n.imports,t.hoists=n.hoists,t.temps=n.temps,t.cached=n.cached,t.transformed=!0,t.filters=[...n.filters]}function G8(t,e){const{helper:n}=e,{children:r}=t;if(r.length===1){const i=r[0];if(MM(t,i)&&i.codegenNode){const o=i.codegenNode;o.type===13&&m_(o,e),t.codegenNode=o}else t.codegenNode=i}else if(r.length>1){let i=64;t.codegenNode=Gf(e,n(qf),void 0,t.children,i+"",void 0,void 0,!0,void 0,!1)}}function Y8(t,e){let n=0;const r=()=>{n--};for(;nr===t:r=>t.test(r);return(r,i)=>{if(r.type===1){const{props:o}=r;if(r.tagType===3&&o.some(O8))return;const s=[];for(let l=0;l`${Hu[t]}: _${Hu[t]}`;function jS(t,{mode:e="function",prefixIdentifiers:n=e==="module",sourceMap:r=!1,filename:i="template.vue.html",scopeId:o=null,optimizeImports:s=!1,runtimeGlobalName:l="Vue",runtimeModuleName:u="vue",ssrRuntimeModuleName:f="vue/server-renderer",ssr:d=!1,isTS:m=!1,inSSR:v=!1}){const y={mode:e,prefixIdentifiers:n,sourceMap:r,filename:i,scopeId:o,optimizeImports:s,runtimeGlobalName:l,runtimeModuleName:u,ssrRuntimeModuleName:f,ssr:d,isTS:m,inSSR:v,source:t.source,code:"",column:1,line:1,offset:0,indentLevel:0,pure:!1,map:void 0,helper(C){return`_${Hu[C]}`},push(C,x=-2,k){y.code+=C},indent(){_(++y.indentLevel)},deindent(C=!1){C?--y.indentLevel:_(--y.indentLevel)},newline(){_(y.indentLevel)}};function _(C){y.push(` -`+" ".repeat(C),0)}return y}function J8(t,e={}){const n=jS(t,e);e.onContextCreated&&e.onContextCreated(n);const{mode:r,push:i,prefixIdentifiers:o,indent:s,deindent:l,newline:u,scopeId:f,ssr:d}=n,m=Array.from(t.helpers),v=m.length>0,y=!o&&r!=="module",_=!1,C=_?jS(t,e):n;X8(t,C);const x=d?"ssrRender":"render",A=(d?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(i(`function ${x}(${A}) {`),s(),y&&(i("with (_ctx) {"),s(),v&&(i(`const { ${m.map(RM).join(", ")} } = _Vue -`,-1),u())),t.components.length&&(yy(t.components,"component",n),(t.directives.length||t.temps>0)&&u()),t.directives.length&&(yy(t.directives,"directive",n),t.temps>0&&u()),t.filters&&t.filters.length&&(u(),yy(t.filters,"filter",n),u()),t.temps>0){i("let ");for(let L=0;L0?", ":""}_temp${L}`)}return(t.components.length||t.directives.length||t.temps)&&(i(` -`,0),u()),d||i("return "),t.codegenNode?gr(t.codegenNode,n):i("null"),y&&(l(),i("}")),l(),i("}"),{ast:t,code:n.code,preamble:_?C.code:"",map:n.map?n.map.toJSON():void 0}}function X8(t,e){const{ssr:n,prefixIdentifiers:r,push:i,newline:o,runtimeModuleName:s,runtimeGlobalName:l,ssrRuntimeModuleName:u}=e,f=l,d=Array.from(t.helpers);if(d.length>0&&(i(`const _Vue = ${f} -`,-1),t.hoists.length)){const m=[t_,n_,Sd,r_,yM].filter(v=>d.includes(v)).map(RM).join(", ");i(`const { ${m} } = _Vue -`,-1)}Z8(t.hoists,e),o(),i("return ")}function yy(t,e,{helper:n,push:r,newline:i,isTS:o}){const s=n(e==="filter"?a_:e==="component"?i_:s_);for(let l=0;l3||!1;e.push("["),n&&e.indent(),Ed(t,e,n),n&&e.deindent(),e.push("]")}function Ed(t,e,n=!1,r=!0){const{push:i,newline:o}=e;for(let s=0;sn||"null")}function oz(t,e){const{push:n,helper:r,pure:i}=e,o=xt(t.callee)?t.callee:r(t.callee);i&&n(kg),n(o+"(",-2,t),Ed(t.arguments,e),n(")")}function sz(t,e){const{push:n,indent:r,deindent:i,newline:o}=e,{properties:s}=t;if(!s.length){n("{}",-2,t);return}const l=s.length>1||!1;n(l?"{":"{ "),l&&r();for(let u=0;u "),(u||l)&&(n("{"),r()),s?(u&&n("return "),We(s)?y_(s,e):gr(s,e)):l&&gr(l,e),(u||l)&&(i(),n("}")),f&&(t.isNonScopedSlot&&n(", undefined, true"),n(")"))}function uz(t,e){const{test:n,consequent:r,alternate:i,newline:o}=t,{push:s,indent:l,deindent:u,newline:f}=e;if(n.type===4){const m=!v_(n.content);m&&s("("),zM(n,e),m&&s(")")}else s("("),gr(n,e),s(")");o&&l(),e.indentLevel++,o||s(" "),s("? "),gr(r,e),e.indentLevel--,o&&f(),o||s(" "),s(": ");const d=i.type===19;d||e.indentLevel++,gr(i,e),d||e.indentLevel--,o&&u(!0)}function cz(t,e){const{push:n,helper:r,indent:i,deindent:o,newline:s}=e;n(`_cache[${t.index}] || (`),t.isVNode&&(i(),n(`${r(Qp)}(-1),`),s()),n(`_cache[${t.index}] = `),gr(t.value,e),t.isVNode&&(n(","),s(),n(`${r(Qp)}(1),`),s(),n(`_cache[${t.index}]`),o()),n(")")}new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b");const fz=DM(/^(if|else|else-if)$/,(t,e,n)=>dz(t,e,n,(r,i,o)=>{const s=n.parent.children;let l=s.indexOf(r),u=0;for(;l-->=0;){const f=s[l];f&&f.type===9&&(u+=f.branches.length)}return()=>{if(o)r.codegenNode=US(i,u,n);else{const f=hz(r.codegenNode);f.alternate=US(i,u+r.branches.length-1,n)}}}));function dz(t,e,n,r){if(e.name!=="else"&&(!e.exp||!e.exp.content.trim())){const i=e.exp?e.exp.loc:t.loc;n.onError(an(28,e.loc)),e.exp=Et("true",!1,i)}if(e.name==="if"){const i=WS(t,e),o={type:9,loc:t.loc,branches:[i]};if(n.replaceNode(o),r)return r(o,i,!0)}else{const i=n.parent.children;let o=i.indexOf(t);for(;o-->=-1;){const s=i[o];if(s&&s.type===3){n.removeNode(s);continue}if(s&&s.type===2&&!s.content.trim().length){n.removeNode(s);continue}if(s&&s.type===9){e.name==="else-if"&&s.branches[s.branches.length-1].condition===void 0&&n.onError(an(30,t.loc)),n.removeNode();const l=WS(t,e);s.branches.push(l);const u=r&&r(s,l,!1);wg(l,n),u&&u(),n.currentNode=null}else n.onError(an(30,t.loc));break}}}function WS(t,e){const n=t.tagType===3;return{type:10,loc:t.loc,condition:e.name==="else"?void 0:e.exp,children:n&&!Ni(t,"for")?t.children:[t],userKey:_g(t,"key"),isTemplateIf:n}}function US(t,e,n){return t.condition?J0(t.condition,qS(t,e,n),zn(n.helper(Sd),['""',"true"])):qS(t,e,n)}function qS(t,e,n){const{helper:r}=n,i=yn("key",Et(`${e}`,!1,li,2)),{children:o}=t,s=o[0];if(o.length!==1||s.type!==1)if(o.length===1&&s.type===11){const u=s.codegenNode;return rm(u,i,n),u}else{let u=64;return Gf(n,r(qf),vi([i]),o,u+"",void 0,void 0,!0,!1,!1,t.loc)}else{const u=s.codegenNode,f=N8(u);return f.type===13&&m_(f,n),rm(f,i,n),u}}function hz(t){for(;;)if(t.type===19)if(t.alternate.type===19)t=t.alternate;else return t;else t.type===20&&(t=t.value)}const pz=DM("for",(t,e,n)=>{const{helper:r,removeHelper:i}=n;return mz(t,e,n,o=>{const s=zn(r(u_),[o.source]),l=tm(t),u=Ni(t,"memo"),f=_g(t,"key"),d=f&&(f.type===6?Et(f.value.content,!0):f.exp),m=f?yn("key",d):null,v=o.source.type===4&&o.source.constType>0,y=v?64:f?128:256;return o.codegenNode=Gf(n,r(qf),void 0,s,y+"",void 0,void 0,!0,!v,!1,t.loc),()=>{let _;const{children:C}=o,x=C.length!==1||C[0].type!==1,k=nm(t)?t:l&&t.children.length===1&&nm(t.children[0])?t.children[0]:null;if(k?(_=k.codegenNode,l&&m&&rm(_,m,n)):x?_=Gf(n,r(qf),m?vi([m]):void 0,t.children,"64",void 0,void 0,!0,void 0,!1):(_=C[0].codegenNode,l&&m&&rm(_,m,n),_.isBlock!==!v&&(_.isBlock?(i(hl),i(ju(n.inSSR,_.isComponent))):i(Vu(n.inSSR,_.isComponent))),_.isBlock=!v,_.isBlock?(r(hl),r(ju(n.inSSR,_.isComponent))):r(Vu(n.inSSR,_.isComponent))),u){const A=Fu(Q0(o.parseResult,[Et("_cached")]));A.body=w8([$i(["const _memo = (",u.exp,")"]),$i(["if (_cached",...d?[" && _cached.key === ",d]:[],` && ${n.helperString(wM)}(_cached, _memo)) return _cached`]),$i(["const _item = ",_]),Et("_item.memo = _memo"),Et("return _item")]),s.arguments.push(A,Et("_cache"),Et(String(n.cached++)))}else s.arguments.push(Fu(Q0(o.parseResult),_,!0))}})});function mz(t,e,n,r){if(!e.exp){n.onError(an(31,e.loc));return}const i=e.forParseResult;if(!i){n.onError(an(32,e.loc));return}$M(i);const{addIdentifiers:o,removeIdentifiers:s,scopes:l}=n,{source:u,value:f,key:d,index:m}=i,v={type:11,loc:e.loc,source:u,valueAlias:f,keyAlias:d,objectIndexAlias:m,parseResult:i,children:tm(t)?t.children:[t]};n.replaceNode(v),l.vFor++;const y=r&&r(v);return()=>{l.vFor--,y&&y()}}function $M(t,e){t.finalized||(t.finalized=!0)}function Q0({value:t,key:e,index:n},r=[]){return gz([t,e,n,...r])}function gz(t){let e=t.length;for(;e--&&!t[e];);return t.slice(0,e+1).map((n,r)=>n||Et("_".repeat(r+1),!1))}const KS=Et("undefined",!1),vz=(t,e)=>{if(t.type===1&&(t.tagType===1||t.tagType===3)){const n=Ni(t,"slot");if(n)return n.exp,e.scopes.vSlot++,()=>{e.scopes.vSlot--}}},yz=(t,e,n,r)=>Fu(t,n,!1,!0,n.length?n[0].loc:r);function bz(t,e,n=yz){e.helper(h_);const{children:r,loc:i}=t,o=[],s=[];let l=e.scopes.vSlot>0||e.scopes.vFor>0;const u=Ni(t,"slot",!0);if(u){const{arg:x,exp:k}=u;x&&!Hr(x)&&(l=!0),o.push(yn(x||Et("default",!0),n(k,void 0,r,i)))}let f=!1,d=!1;const m=[],v=new Set;let y=0;for(let x=0;x{const L=n(k,void 0,A,i);return e.compatConfig&&(L.isNonScopedSlot=!0),yn("default",L)};f?m.length&&m.some(k=>HM(k))&&(d?e.onError(an(39,m[0].loc)):o.push(x(void 0,m))):o.push(x(void 0,r))}const _=l?2:Sp(t.children)?3:1;let C=vi(o.concat(yn("_",Et(_+"",!1))),i);return s.length&&(C=zn(e.helper(_M),[C,Td(s)])),{slots:C,hasDynamicSlots:l}}function zh(t,e,n){const r=[yn("name",t),yn("fn",e)];return n!=null&&r.push(yn("key",Et(String(n),!0))),vi(r)}function Sp(t){for(let e=0;efunction(){if(t=e.currentNode,!(t.type===1&&(t.tagType===0||t.tagType===1)))return;const{tag:r,props:i}=t,o=t.tagType===1;let s=o?wz(t,e):`"${r}"`;const l=qt(s)&&s.callee===o_;let u,f,d,m=0,v,y,_,C=l||s===df||s===e_||!o&&(r==="svg"||r==="foreignObject");if(i.length>0){const x=VM(t,e,void 0,o,l);u=x.props,m=x.patchFlag,y=x.dynamicPropNames;const k=x.directives;_=k&&k.length?Td(k.map(A=>xz(A,e))):void 0,x.shouldUseBlock&&(C=!0)}if(t.children.length>0)if(s===Xp&&(C=!0,m|=1024),o&&s!==df&&s!==Xp){const{slots:k,hasDynamicSlots:A}=bz(t,e);f=k,A&&(m|=1024)}else if(t.children.length===1&&s!==df){const k=t.children[0],A=k.type,L=A===5||A===8;L&&yi(k,e)===0&&(m|=1),L||A===2?f=k:f=t.children}else f=t.children;m!==0&&(d=String(m),y&&y.length&&(v=Sz(y))),t.codegenNode=Gf(e,s,u,f,d,v,_,!!C,!1,o,t.loc)};function wz(t,e,n=!1){let{tag:r}=t;const i=eb(r),o=_g(t,"is");if(o)if(i||tl("COMPILER_IS_ON_ELEMENT",e)){const l=o.type===6?o.value&&Et(o.value.content,!0):o.exp;if(l)return zn(e.helper(o_),[l])}else o.type===6&&o.value.content.startsWith("vue:")&&(r=o.value.content.slice(4));const s=xM(r)||e.isBuiltInComponent(r);return s?(n||e.helper(s),s):(e.helper(i_),e.components.add(r),Jf(r,"component"))}function VM(t,e,n=t.props,r,i,o=!1){const{tag:s,loc:l,children:u}=t;let f=[];const d=[],m=[],v=u.length>0;let y=!1,_=0,C=!1,x=!1,k=!1,A=!1,L=!1,E=!1;const H=[],I=z=>{f.length&&(d.push(vi(GS(f),l)),f=[]),z&&d.push(z)},q=({key:z,value:w})=>{if(Hr(z)){const R=z.content,U=Cl(R);if(U&&(!r||i)&&R.toLowerCase()!=="onclick"&&R!=="onUpdate:modelValue"&&!Ya(R)&&(A=!0),U&&Ya(R)&&(E=!0),U&&w.type===14&&(w=w.arguments[0]),w.type===20||(w.type===4||w.type===8)&&yi(w,e)>0)return;R==="ref"?C=!0:R==="class"?x=!0:R==="style"?k=!0:R!=="key"&&!H.includes(R)&&H.push(R),r&&(R==="class"||R==="style")&&!H.includes(R)&&H.push(R)}else L=!0};for(let z=0;z0&&f.push(yn(Et("ref_for",!0),Et("true")))),U==="is"&&(eb(s)||oe&&oe.content.startsWith("vue:")||tl("COMPILER_IS_ON_ELEMENT",e)))continue;f.push(yn(Et(U,!0,K),Et(oe?oe.content:"",D,oe?oe.loc:R)))}else{const{name:R,arg:U,exp:K,loc:oe,modifiers:D}=w,ae=R==="bind",ce=R==="on";if(R==="slot"){r||e.onError(an(40,oe));continue}if(R==="once"||R==="memo"||R==="is"||ae&&Va(U,"is")&&(eb(s)||tl("COMPILER_IS_ON_ELEMENT",e))||ce&&o)continue;if((ae&&Va(U,"key")||ce&&v&&Va(U,"vue:before-update"))&&(y=!0),ae&&Va(U,"ref")&&e.scopes.vFor>0&&f.push(yn(Et("ref_for",!0),Et("true"))),!U&&(ae||ce)){if(L=!0,K)if(ae){if(I(),tl("COMPILER_V_BIND_OBJECT_ORDER",e)){d.unshift(K);continue}d.push(K)}else I({type:14,loc:oe,callee:e.helper(d_),arguments:r?[K]:[K,"true"]});else e.onError(an(ae?34:35,oe));continue}ae&&D.includes("prop")&&(_|=32);const ve=e.directiveTransforms[R];if(ve){const{props:ze,needRuntime:qe}=ve(w,t,e);!o&&ze.forEach(q),ce&&U&&!Hr(U)?I(vi(ze,l)):f.push(...ze),qe&&(m.push(w),Vi(qe)&&FM.set(w,qe))}else qP(R)||(m.push(w),v&&(y=!0))}}let P;if(d.length?(I(),d.length>1?P=zn(e.helper(Zp),d,l):P=d[0]):f.length&&(P=vi(GS(f),l)),L?_|=16:(x&&!r&&(_|=2),k&&!r&&(_|=4),H.length&&(_|=8),A&&(_|=32)),!y&&(_===0||_===32)&&(C||E||m.length>0)&&(_|=512),!e.inSSR&&P)switch(P.type){case 15:let z=-1,w=-1,R=!1;for(let oe=0;oeyn(s,o)),i))}return Td(n,t.loc)}function Sz(t){let e="[";for(let n=0,r=t.length;n{if(nm(t)){const{children:n,loc:r}=t,{slotName:i,slotProps:o}=Tz(t,e),s=[e.prefixIdentifiers?"_ctx.$slots":"$slots",i,"{}","undefined","true"];let l=2;o&&(s[2]=o,l=3),n.length&&(s[3]=Fu([],n,!1,!1,r),l=4),e.scopeId&&!e.slotted&&(l=5),s.splice(l),t.codegenNode=zn(e.helper(bM),s,r)}};function Tz(t,e){let n='"default"',r;const i=[];for(let o=0;o0){const{props:o,directives:s}=VM(t,e,i,!1,!1);r=o,s.length&&e.onError(an(36,s[0].loc))}return{slotName:n,slotProps:r}}const Ez=/^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/,jM=(t,e,n,r)=>{const{loc:i,modifiers:o,arg:s}=t;!t.exp&&!o.length&&n.onError(an(35,i));let l;if(s.type===4)if(s.isStatic){let m=s.content;m.startsWith("vue:")&&(m=`vnode-${m.slice(4)}`);const v=e.tagType!==0||m.startsWith("vnode")||!/[A-Z]/.test(m)?wu(bn(m)):`on:${m}`;l=Et(v,!0,s.loc)}else l=$i([`${n.helperString(Y0)}(`,s,")"]);else l=s,l.children.unshift(`${n.helperString(Y0)}(`),l.children.push(")");let u=t.exp;u&&!u.content.trim()&&(u=void 0);let f=n.cacheHandlers&&!u&&!n.inVOnce;if(u){const m=SM(u.content),v=!(m||Ez.test(u.content)),y=u.content.includes(";");(v||f&&m)&&(u=$i([`${v?"$event":"(...args)"} => ${y?"{":"("}`,u,y?"}":")"]))}let d={props:[yn(l,u||Et("() => {}",!1,i))]};return r&&(d=r(d)),f&&(d.props[0].value=n.cache(d.props[0].value)),d.props.forEach(m=>m.key.isHandlerKey=!0),d},Az=(t,e,n)=>{const{modifiers:r,loc:i}=t,o=t.arg;let{exp:s}=t;if(!s&&o.type===4){const l=bn(o.content);s=t.exp=Et(l,!1,o.loc)}return o.type!==4?(o.children.unshift("("),o.children.push(') || ""')):o.isStatic||(o.content=`${o.content} || ""`),r.includes("camel")&&(o.type===4?o.isStatic?o.content=bn(o.content):o.content=`${n.helperString(G0)}(${o.content})`:(o.children.unshift(`${n.helperString(G0)}(`),o.children.push(")"))),n.inSSR||(r.includes("prop")&&YS(o,"."),r.includes("attr")&&YS(o,"^")),!s||s.type===4&&!s.content.trim()?(n.onError(an(34,i)),{props:[yn(o,Et("",!0,i))]}):{props:[yn(o,s)]}},YS=(t,e)=>{t.type===4?t.isStatic?t.content=e+t.content:t.content=`\`${e}\${${t.content}}\``:(t.children.unshift(`'${e}' + (`),t.children.push(")"))},Oz=(t,e)=>{if(t.type===0||t.type===1||t.type===11||t.type===10)return()=>{const n=t.children;let r,i=!1;for(let o=0;oo.type===7&&!e.directiveTransforms[o.name])&&t.tag!=="template")))for(let o=0;o{if(t.type===1&&Ni(t,"once",!0))return JS.has(t)||e.inVOnce||e.inSSR?void 0:(JS.add(t),e.inVOnce=!0,e.helper(Qp),()=>{e.inVOnce=!1;const n=e.currentNode;n.codegenNode&&(n.codegenNode=e.cache(n.codegenNode,!0))})},WM=(t,e,n)=>{const{exp:r,arg:i}=t;if(!r)return n.onError(an(41,t.loc)),Bh();const o=r.loc.source,s=r.type===4?r.content:o,l=n.bindingMetadata[o];if(l==="props"||l==="props-aliased")return n.onError(an(44,r.loc)),Bh();const u=!1;if(!s.trim()||!SM(s)&&!u)return n.onError(an(42,r.loc)),Bh();const f=i||Et("modelValue",!0),d=i?Hr(i)?`onUpdate:${bn(i.content)}`:$i(['"onUpdate:" + ',i]):"onUpdate:modelValue";let m;const v=n.isTS?"($event: any)":"$event";m=$i([`${v} => ((`,r,") = $event)"]);const y=[yn(f,t.exp),yn(d,m)];if(t.modifiers.length&&e.tagType===1){const _=t.modifiers.map(x=>(v_(x)?x:JSON.stringify(x))+": true").join(", "),C=i?Hr(i)?`${i.content}Modifiers`:$i([i,' + "Modifiers"']):"modelModifiers";y.push(yn(C,Et(`{ ${_} }`,!1,t.loc,2)))}return Bh(y)};function Bh(t=[]){return{props:t}}const Nz=/[\w).+\-_$\]]/,Lz=(t,e)=>{tl("COMPILER_FILTERS",e)&&(t.type===5&&om(t.content,e),t.type===1&&t.props.forEach(n=>{n.type===7&&n.name!=="for"&&n.exp&&om(n.exp,e)}))};function om(t,e){if(t.type===4)XS(t,e);else for(let n=0;n=0&&(A=n.charAt(k),A===" ");k--);(!A||!Nz.test(A))&&(s=!0)}}_===void 0?_=n.slice(0,y).trim():d!==0&&x();function x(){C.push(n.slice(d,y).trim()),d=y+1}if(C.length){for(y=0;y{if(t.type===1){const n=Ni(t,"memo");return!n||ZS.has(t)?void 0:(ZS.add(t),()=>{const r=t.codegenNode||e.currentNode.codegenNode;r&&r.type===13&&(t.tagType!==1&&m_(r,e),t.codegenNode=zn(e.helper(p_),[n.exp,Fu(void 0,r),"_cache",String(e.cached++)]))})}};function Dz(t){return[[Mz,fz,Pz,pz,Lz,Cz,_z,vz,Oz],{on:jM,bind:Az,model:WM}]}function Rz(t,e={}){const n=e.onError||g_,r=e.mode==="module";e.prefixIdentifiers===!0?n(an(47)):r&&n(an(48));const i=!1;e.cacheHandlers&&n(an(49)),e.scopeId&&!r&&n(an(50));const o=Rt({},e,{prefixIdentifiers:i}),s=xt(t)?j8(t,o):t,[l,u]=Dz();return K8(s,Rt({},o,{nodeTransforms:[...l,...e.nodeTransforms||[]],directiveTransforms:Rt({},u,e.directiveTransforms||{})})),J8(s,o)}const zz=()=>({props:[]});/** -* @vue/compiler-dom v3.4.15 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/const UM=Symbol(""),qM=Symbol(""),KM=Symbol(""),GM=Symbol(""),tb=Symbol(""),YM=Symbol(""),JM=Symbol(""),XM=Symbol(""),ZM=Symbol(""),QM=Symbol("");y8({[UM]:"vModelRadio",[qM]:"vModelCheckbox",[KM]:"vModelText",[GM]:"vModelSelect",[tb]:"vModelDynamic",[YM]:"withModifiers",[JM]:"withKeys",[XM]:"vShow",[ZM]:"Transition",[QM]:"TransitionGroup"});let nu;function Bz(t,e=!1){return nu||(nu=document.createElement("div")),e?(nu.innerHTML=`
`,nu.children[0].getAttribute("foo")):(nu.innerHTML=t,nu.textContent)}const $z={parseMode:"html",isVoidTag:aD,isNativeTag:t=>iD(t)||oD(t)||sD(t),isPreTag:t=>t==="pre",decodeEntities:Bz,isBuiltInComponent:t=>{if(t==="Transition"||t==="transition")return ZM;if(t==="TransitionGroup"||t==="transition-group")return QM},getNamespace(t,e,n){let r=e?e.ns:n;if(e&&r===2)if(e.tag==="annotation-xml"){if(t==="svg")return 1;e.props.some(i=>i.type===6&&i.name==="encoding"&&i.value!=null&&(i.value.content==="text/html"||i.value.content==="application/xhtml+xml"))&&(r=0)}else/^m(?:[ions]|text)$/.test(e.tag)&&t!=="mglyph"&&t!=="malignmark"&&(r=0);else e&&r===1&&(e.tag==="foreignObject"||e.tag==="desc"||e.tag==="title")&&(r=0);if(r===0){if(t==="svg")return 1;if(t==="math")return 2}return r}},Hz=t=>{t.type===1&&t.props.forEach((e,n)=>{e.type===6&&e.name==="style"&&e.value&&(t.props[n]={type:7,name:"bind",arg:Et("style",!0,e.loc),exp:Fz(e.value.content,e.loc),modifiers:[],loc:e.loc})})},Fz=(t,e)=>{const n=EA(t);return Et(JSON.stringify(n),!1,e,3)};function Ys(t,e){return an(t,e)}const Vz=(t,e,n)=>{const{exp:r,loc:i}=t;return r||n.onError(Ys(53,i)),e.children.length&&(n.onError(Ys(54,i)),e.children.length=0),{props:[yn(Et("innerHTML",!0,i),r||Et("",!0))]}},jz=(t,e,n)=>{const{exp:r,loc:i}=t;return r||n.onError(Ys(55,i)),e.children.length&&(n.onError(Ys(56,i)),e.children.length=0),{props:[yn(Et("textContent",!0),r?yi(r,n)>0?r:zn(n.helperString(bg),[r],i):Et("",!0))]}},Wz=(t,e,n)=>{const r=WM(t,e,n);if(!r.props.length||e.tagType===1)return r;t.arg&&n.onError(Ys(58,t.arg.loc));const{tag:i}=e,o=n.isCustomElement(i);if(i==="input"||i==="textarea"||i==="select"||o){let s=KM,l=!1;if(i==="input"||o){const u=_g(e,"type");if(u){if(u.type===7)s=tb;else if(u.value)switch(u.value.content){case"radio":s=UM;break;case"checkbox":s=qM;break;case"file":l=!0,n.onError(Ys(59,t.loc));break}}else A8(e)&&(s=tb)}else i==="select"&&(s=GM);l||(r.needRuntime=n.helper(s))}else n.onError(Ys(57,t.loc));return r.props=r.props.filter(s=>!(s.key.type===4&&s.key.content==="modelValue")),r},Uz=ai("passive,once,capture"),qz=ai("stop,prevent,self,ctrl,shift,alt,meta,exact,middle"),Kz=ai("left,right"),e3=ai("onkeyup,onkeydown,onkeypress",!0),Gz=(t,e,n,r)=>{const i=[],o=[],s=[];for(let l=0;lHr(t)&&t.content.toLowerCase()==="onclick"?Et(e,!0):t.type!==4?$i(["(",t,`) === "onClick" ? "${e}" : (`,t,")"]):t,Yz=(t,e,n)=>jM(t,e,n,r=>{const{modifiers:i}=t;if(!i.length)return r;let{key:o,value:s}=r.props[0];const{keyModifiers:l,nonKeyModifiers:u,eventOptionModifiers:f}=Gz(o,i,n,t.loc);if(u.includes("right")&&(o=QS(o,"onContextmenu")),u.includes("middle")&&(o=QS(o,"onMouseup")),u.length&&(s=zn(n.helper(YM),[s,JSON.stringify(u)])),l.length&&(!Hr(o)||e3(o.content))&&(s=zn(n.helper(JM),[s,JSON.stringify(l)])),f.length){const d=f.map(El).join("");o=Hr(o)?Et(`${o.content}${d}`,!0):$i(["(",o,`) + "${d}"`])}return{props:[yn(o,s)]}}),Jz=(t,e,n)=>{const{exp:r,loc:i}=t;return r||n.onError(Ys(61,i)),{props:[],needRuntime:n.helper(XM)}},Xz=(t,e)=>{t.type===1&&t.tagType===0&&(t.tag==="script"||t.tag==="style")&&e.removeNode()},Zz=[Hz],Qz={cloak:zz,html:Vz,text:jz,model:Wz,on:Yz,show:Jz};function e7(t,e={}){return Rz(t,Rt({},$z,e,{nodeTransforms:[Xz,...Zz,...e.nodeTransforms||[]],directiveTransforms:Rt({},Qz,e.directiveTransforms||{}),transformHoist:null}))}/** -* vue v3.4.15 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/const e2=new WeakMap;function t7(t){let e=e2.get(t??Ft);return e||(e=Object.create(null),e2.set(t??Ft,e)),e}function Zf(t,e){if(!xt(t))if(t.nodeType)t=t.innerHTML;else return An;const n=t,r=t7(e),i=r[n];if(i)return i;if(t[0]==="#"){const u=document.querySelector(t);t=u?u.innerHTML:""}const o=Rt({hoistStatic:!0,onError:void 0,onWarn:An},e);!o.isCustomElement&&typeof customElements<"u"&&(o.isCustomElement=u=>!!customElements.get(u));const{code:s}=e7(t,o),l=new Function("Vue",s)(d8);return l._rc=!0,r[n]=l}UO(Zf);function n7(t){return t=t||Object.create(null),{on:function(n,r){(t[n]||(t[n]=[])).push(r)},off:function(n,r){t[n]&&t[n].splice(t[n].indexOf(r)>>>0,1)},emit:function(n,r){(t[n]||[]).slice().map(function(i){i(r)}),(t["*"]||[]).slice().map(function(i){i(n,r)})}}}function ns(t){return t.split("-")[0]}function Eu(t){return t.split("-")[1]}function Ad(t){return["top","bottom"].includes(ns(t))?"x":"y"}function b_(t){return t==="y"?"height":"width"}function t2(t){let{reference:e,floating:n,placement:r}=t;const i=e.x+e.width/2-n.width/2,o=e.y+e.height/2-n.height/2;let s;switch(ns(r)){case"top":s={x:i,y:e.y-n.height};break;case"bottom":s={x:i,y:e.y+e.height};break;case"right":s={x:e.x+e.width,y:o};break;case"left":s={x:e.x-n.width,y:o};break;default:s={x:e.x,y:e.y}}const l=Ad(r),u=b_(l);switch(Eu(r)){case"start":s[l]=s[l]-(e[u]/2-n[u]/2);break;case"end":s[l]=s[l]+(e[u]/2-n[u]/2);break}return s}const r7=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n;let l=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=t2({...l,placement:r}),d=r,m={};for(let v=0;v({name:"arrow",options:t,async fn(e){const{element:n,padding:r=0}=t??{},{x:i,y:o,placement:s,rects:l,platform:u}=e;if(n==null)return{};const f=t3(r),d={x:i,y:o},m=ns(s),v=Ad(m),y=b_(v),_=await u.getDimensions({element:n}),C=v==="y"?"top":"left",x=v==="y"?"bottom":"right",k=l.reference[y]+l.reference[v]-d[v]-l.floating[y],A=d[v]-l.reference[v],L=await u.getOffsetParent({element:n}),E=L?v==="y"?L.clientHeight||0:L.clientWidth||0:0,H=k/2-A/2,I=f[C],q=E-_[y]-f[x],P=E/2-_[y]/2+H,z=rb(I,P,q);return{data:{[v]:z,centerOffset:P-z}}}}),a7={left:"right",right:"left",bottom:"top",top:"bottom"};function sm(t){return t.replace(/left|right|bottom|top/g,e=>a7[e])}function n3(t,e){const n=Eu(t)==="start",r=Ad(t),i=b_(r);let o=r==="x"?n?"right":"left":n?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=sm(o)),{main:o,cross:sm(o)}}const l7={start:"end",end:"start"};function ib(t){return t.replace(/start|end/g,e=>l7[e])}const u7=["top","right","bottom","left"],c7=u7.reduce((t,e)=>t.concat(e,e+"-start",e+"-end"),[]);function f7(t,e,n){return(t?[...n.filter(i=>Eu(i)===t),...n.filter(i=>Eu(i)!==t)]:n.filter(i=>ns(i)===i)).filter(i=>t?Eu(i)===t||(e?ib(i)!==i:!1):!0)}const d7=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,r,i,o,s,l;const{x:u,y:f,rects:d,middlewareData:m,placement:v}=e,{alignment:y=null,allowedPlacements:_=c7,autoAlignment:C=!0,...x}=t;if((n=m.autoPlacement)!=null&&n.skip)return{};const k=f7(y,C,_),A=await xg(e,x),L=(r=(i=m.autoPlacement)==null?void 0:i.index)!=null?r:0,E=k[L],{main:H,cross:I}=n3(E,d);if(v!==E)return{x:u,y:f,reset:{placement:k[0]}};const q=[A[ns(E)],A[H],A[I]],P=[...(o=(s=m.autoPlacement)==null?void 0:s.overflows)!=null?o:[],{placement:E,overflows:q}],z=k[L+1];if(z)return{data:{index:L+1,overflows:P},reset:{placement:z}};const w=P.slice().sort((U,K)=>U.overflows[0]-K.overflows[0]),R=(l=w.find(U=>{let{overflows:K}=U;return K.every(oe=>oe<=0)}))==null?void 0:l.placement;return{data:{skip:!0},reset:{placement:R??w[0].placement}}}}};function h7(t){const e=sm(t);return[ib(t),e,ib(e)]}const p7=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:l}=e;if((n=o.flip)!=null&&n.skip)return{};const{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",flipAlignment:v=!0,...y}=t,_=ns(i),x=d||(_===l||!v?[sm(l)]:h7(l)),k=[l,...x],A=await xg(e,y),L=[];let E=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&L.push(A[_]),f){const{main:P,cross:z}=n3(i,s);L.push(A[P],A[z])}if(E=[...E,{placement:i,overflows:L}],!L.every(P=>P<=0)){var H,I;const P=((H=(I=o.flip)==null?void 0:I.index)!=null?H:0)+1,z=k[P];if(z)return{data:{index:P,overflows:E},reset:{placement:z}};let w="bottom";switch(m){case"bestFit":{var q;const R=(q=E.slice().sort((U,K)=>U.overflows.filter(oe=>oe>0).reduce((oe,D)=>oe+D,0)-K.overflows.filter(oe=>oe>0).reduce((oe,D)=>oe+D,0))[0])==null?void 0:q.placement;R&&(w=R);break}case"initialPlacement":w=l;break}return{data:{skip:!0},reset:{placement:w}}}return{}}}};function m7(t){let{placement:e,rects:n,value:r}=t;const i=ns(e),o=["left","top"].includes(i)?-1:1,s=typeof r=="function"?r({...n,placement:e}):r,{mainAxis:l,crossAxis:u}=typeof s=="number"?{mainAxis:s,crossAxis:0}:{mainAxis:0,crossAxis:0,...s};return Ad(i)==="x"?{x:u,y:l*o}:{x:l*o,y:u}}const g7=function(t){return t===void 0&&(t=0),{name:"offset",options:t,fn(e){const{x:n,y:r,placement:i,rects:o}=e,s=m7({placement:i,rects:o,value:t});return{x:n+s.x,y:r+s.y,data:s}}}};function v7(t){return t==="x"?"y":"x"}const y7=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:x=>{let{x:k,y:A}=x;return{x:k,y:A}}},...u}=t,f={x:n,y:r},d=await xg(e,u),m=Ad(ns(i)),v=v7(m);let y=f[m],_=f[v];if(o){const x=m==="y"?"top":"left",k=m==="y"?"bottom":"right",A=y+d[x],L=y-d[k];y=rb(A,y,L)}if(s){const x=v==="y"?"top":"left",k=v==="y"?"bottom":"right",A=_+d[x],L=_-d[k];_=rb(A,_,L)}const C=l.fn({...e,[m]:y,[v]:_});return{...C,data:{x:C.x-n,y:C.y-r}}}}},b7=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n;const{placement:r,rects:i,middlewareData:o}=e,{apply:s,...l}=t;if((n=o.size)!=null&&n.skip)return{};const u=await xg(e,l),f=ns(r),d=Eu(r)==="end";let m,v;f==="top"||f==="bottom"?(m=f,v=d?"left":"right"):(v=f,m=d?"top":"bottom");const y=Ia(u.left,0),_=Ia(u.right,0),C=Ia(u.top,0),x=Ia(u.bottom,0),k={height:i.floating.height-(["left","right"].includes(r)?2*(C!==0||x!==0?C+x:Ia(u.top,u.bottom)):u[m]),width:i.floating.width-(["top","bottom"].includes(r)?2*(y!==0||_!==0?y+_:Ia(u.left,u.right)):u[v])};return s==null||s({...k,...i}),{data:{skip:!0},reset:{rects:!0}}}}};function __(t){return(t==null?void 0:t.toString())==="[object Window]"}function da(t){if(t==null)return window;if(!__(t)){const e=t.ownerDocument;return e&&e.defaultView||window}return t}function Sg(t){return da(t).getComputedStyle(t)}function Ko(t){return __(t)?"":t?(t.nodeName||"").toLowerCase():""}function Go(t){return t instanceof da(t).HTMLElement}function am(t){return t instanceof da(t).Element}function _7(t){return t instanceof da(t).Node}function r3(t){const e=da(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Cg(t){const{overflow:e,overflowX:n,overflowY:r}=Sg(t);return/auto|scroll|overlay|hidden/.test(e+r+n)}function w7(t){return["table","td","th"].includes(Ko(t))}function i3(t){const e=navigator.userAgent.toLowerCase().includes("firefox"),n=Sg(t);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||e&&n.willChange==="filter"||e&&(n.filter?n.filter!=="none":!1)}const n2=Math.min,hf=Math.max,lm=Math.round;function Wu(t,e){e===void 0&&(e=!1);const n=t.getBoundingClientRect();let r=1,i=1;return e&&Go(t)&&(r=t.offsetWidth>0&&lm(n.width)/t.offsetWidth||1,i=t.offsetHeight>0&&lm(n.height)/t.offsetHeight||1),{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function ha(t){return((_7(t)?t.ownerDocument:t.document)||window.document).documentElement}function Tg(t){return __(t)?{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}:{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function o3(t){return Wu(ha(t)).left+Tg(t).scrollLeft}function k7(t){const e=Wu(t);return lm(e.width)!==t.offsetWidth||lm(e.height)!==t.offsetHeight}function x7(t,e,n){const r=Go(e),i=ha(e),o=Wu(t,r&&k7(e));let s={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if(r||!r&&n!=="fixed")if((Ko(e)!=="body"||Cg(i))&&(s=Tg(e)),Go(e)){const u=Wu(e,!0);l.x=u.x+e.clientLeft,l.y=u.y+e.clientTop}else i&&(l.x=o3(i));return{x:o.left+s.scrollLeft-l.x,y:o.top+s.scrollTop-l.y,width:o.width,height:o.height}}function Eg(t){return Ko(t)==="html"?t:t.assignedSlot||t.parentNode||(r3(t)?t.host:null)||ha(t)}function r2(t){return!Go(t)||getComputedStyle(t).position==="fixed"?null:t.offsetParent}function S7(t){let e=Eg(t);for(;Go(e)&&!["html","body"].includes(Ko(e));){if(i3(e))return e;e=e.parentNode}return null}function ob(t){const e=da(t);let n=r2(t);for(;n&&w7(n)&&getComputedStyle(n).position==="static";)n=r2(n);return n&&(Ko(n)==="html"||Ko(n)==="body"&&getComputedStyle(n).position==="static"&&!i3(n))?e:n||S7(t)||e}function i2(t){return{width:t.offsetWidth,height:t.offsetHeight}}function C7(t){let{rect:e,offsetParent:n,strategy:r}=t;const i=Go(n),o=ha(n);if(n===o)return e;let s={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if((i||!i&&r!=="fixed")&&((Ko(n)!=="body"||Cg(o))&&(s=Tg(n)),Go(n))){const u=Wu(n,!0);l.x=u.x+n.clientLeft,l.y=u.y+n.clientTop}return{...e,x:e.x-s.scrollLeft+l.x,y:e.y-s.scrollTop+l.y}}function T7(t){const e=da(t),n=ha(t),r=e.visualViewport;let i=n.clientWidth,o=n.clientHeight,s=0,l=0;return r&&(i=r.width,o=r.height,Math.abs(e.innerWidth/r.scale-r.width)<.01&&(s=r.offsetLeft,l=r.offsetTop)),{width:i,height:o,x:s,y:l}}function E7(t){var e;const n=ha(t),r=Tg(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=hf(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=hf(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0);let l=-r.scrollLeft+o3(t);const u=-r.scrollTop;return Sg(i||n).direction==="rtl"&&(l+=hf(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:u}}function s3(t){return["html","body","#document"].includes(Ko(t))?t.ownerDocument.body:Go(t)&&Cg(t)?t:s3(Eg(t))}function um(t,e){var n;e===void 0&&(e=[]);const r=s3(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=da(r),s=i?[o].concat(o.visualViewport||[],Cg(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(um(Eg(s)))}function A7(t,e){const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&r3(n)){let r=e;do{if(r&&t===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function O7(t){const e=Wu(t),n=e.top+t.clientTop,r=e.left+t.clientLeft;return{top:n,left:r,x:r,y:n,right:r+t.clientWidth,bottom:n+t.clientHeight,width:t.clientWidth,height:t.clientHeight}}function o2(t,e){return e==="viewport"?nb(T7(t)):am(e)?O7(e):nb(E7(ha(t)))}function M7(t){const e=um(Eg(t)),r=["absolute","fixed"].includes(Sg(t).position)&&Go(t)?ob(t):t;return am(r)?e.filter(i=>am(i)&&A7(i,r)&&Ko(i)!=="body"):[]}function N7(t){let{element:e,boundary:n,rootBoundary:r}=t;const o=[...n==="clippingParents"?M7(e):[].concat(n),r],s=o[0],l=o.reduce((u,f)=>{const d=o2(e,f);return u.top=hf(d.top,u.top),u.right=n2(d.right,u.right),u.bottom=n2(d.bottom,u.bottom),u.left=hf(d.left,u.left),u},o2(e,s));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}const L7={getElementRects:t=>{let{reference:e,floating:n,strategy:r}=t;return{reference:x7(e,ob(n),r),floating:{...i2(n),x:0,y:0}}},convertOffsetParentRelativeRectToViewportRelativeRect:t=>C7(t),getOffsetParent:t=>{let{element:e}=t;return ob(e)},isElement:t=>am(t),getDocumentElement:t=>{let{element:e}=t;return ha(e)},getClippingClientRect:t=>N7(t),getDimensions:t=>{let{element:e}=t;return i2(e)},getClientRects:t=>{let{element:e}=t;return e.getClientRects()}},I7=(t,e,n)=>r7(t,e,{platform:L7,...n});var P7=Object.defineProperty,D7=Object.defineProperties,R7=Object.getOwnPropertyDescriptors,s2=Object.getOwnPropertySymbols,z7=Object.prototype.hasOwnProperty,B7=Object.prototype.propertyIsEnumerable,a2=(t,e,n)=>e in t?P7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,$o=(t,e)=>{for(var n in e||(e={}))z7.call(e,n)&&a2(t,n,e[n]);if(s2)for(var n of s2(e))B7.call(e,n)&&a2(t,n,e[n]);return t},Od=(t,e)=>D7(t,R7(e));function a3(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&t[n]?a3(t[n],e[n]):t[n]=e[n])}const jo={disabled:!1,distance:5,skidding:0,container:"body",boundary:void 0,instantMove:!1,disposeTimeout:5e3,popperTriggers:[],strategy:"absolute",preventOverflow:!0,flip:!0,shift:!0,overflowPadding:0,arrowPadding:0,arrowOverflow:!0,themes:{tooltip:{placement:"top",triggers:["hover","focus","touch"],hideTriggers:t=>[...t,"click"],delay:{show:200,hide:0},handleResize:!1,html:!1,loadingContent:"..."},dropdown:{placement:"bottom",triggers:["click"],delay:0,handleResize:!0,autoHide:!0},menu:{$extend:"dropdown",triggers:["hover","focus"],popperTriggers:["hover","focus"],delay:{show:0,hide:400}}}};function Uu(t,e){let n=jo.themes[t]||{},r;do r=n[e],typeof r>"u"?n.$extend?n=jo.themes[n.$extend]||{}:(n=null,r=jo[e]):n=null;while(n);return r}function $7(t){const e=[t];let n=jo.themes[t]||{};do n.$extend&&!n.$resetCss?(e.push(n.$extend),n=jo.themes[n.$extend]||{}):n=null;while(n);return e.map(r=>`v-popper--theme-${r}`)}function l2(t){const e=[t];let n=jo.themes[t]||{};do n.$extend?(e.push(n.$extend),n=jo.themes[n.$extend]||{}):n=null;while(n);return e}let pl=!1;if(typeof window<"u"){pl=!1;try{const t=Object.defineProperty({},"passive",{get(){pl=!0}});window.addEventListener("test",null,t)}catch{}}let l3=!1;typeof window<"u"&&typeof navigator<"u"&&(l3=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream);const u3=["auto","top","bottom","left","right"].reduce((t,e)=>t.concat([e,`${e}-start`,`${e}-end`]),[]),u2={hover:"mouseenter",focus:"focus",click:"click",touch:"touchstart"},c2={hover:"mouseleave",focus:"blur",click:"click",touch:"touchend"};function f2(t,e){const n=t.indexOf(e);n!==-1&&t.splice(n,1)}function by(){return new Promise(t=>requestAnimationFrame(()=>{requestAnimationFrame(t)}))}const Pi=[];let Ma=null;const d2={};function h2(t){let e=d2[t];return e||(e=d2[t]=[]),e}let sb=function(){};typeof window<"u"&&(sb=window.Element);function Pt(t){return function(e){return Uu(e.theme,t)}}const _y="__floating-vue__popper";var c3=()=>Vn({name:"VPopper",provide(){return{[_y]:{parentPopper:this}}},inject:{[_y]:{default:null}},props:{theme:{type:String,required:!0},targetNodes:{type:Function,required:!0},referenceNode:{type:Function,default:null},popperNode:{type:Function,required:!0},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:Pt("disabled")},positioningDisabled:{type:Boolean,default:Pt("positioningDisabled")},placement:{type:String,default:Pt("placement"),validator:t=>u3.includes(t)},delay:{type:[String,Number,Object],default:Pt("delay")},distance:{type:[Number,String],default:Pt("distance")},skidding:{type:[Number,String],default:Pt("skidding")},triggers:{type:Array,default:Pt("triggers")},showTriggers:{type:[Array,Function],default:Pt("showTriggers")},hideTriggers:{type:[Array,Function],default:Pt("hideTriggers")},popperTriggers:{type:Array,default:Pt("popperTriggers")},popperShowTriggers:{type:[Array,Function],default:Pt("popperShowTriggers")},popperHideTriggers:{type:[Array,Function],default:Pt("popperHideTriggers")},container:{type:[String,Object,sb,Boolean],default:Pt("container")},boundary:{type:[String,sb],default:Pt("boundary")},strategy:{type:String,validator:t=>["absolute","fixed"].includes(t),default:Pt("strategy")},autoHide:{type:[Boolean,Function],default:Pt("autoHide")},handleResize:{type:Boolean,default:Pt("handleResize")},instantMove:{type:Boolean,default:Pt("instantMove")},eagerMount:{type:Boolean,default:Pt("eagerMount")},popperClass:{type:[String,Array,Object],default:Pt("popperClass")},computeTransformOrigin:{type:Boolean,default:Pt("computeTransformOrigin")},autoMinSize:{type:Boolean,default:Pt("autoMinSize")},autoSize:{type:[Boolean,String],default:Pt("autoSize")},autoMaxSize:{type:Boolean,default:Pt("autoMaxSize")},autoBoundaryMaxSize:{type:Boolean,default:Pt("autoBoundaryMaxSize")},preventOverflow:{type:Boolean,default:Pt("preventOverflow")},overflowPadding:{type:[Number,String],default:Pt("overflowPadding")},arrowPadding:{type:[Number,String],default:Pt("arrowPadding")},arrowOverflow:{type:Boolean,default:Pt("arrowOverflow")},flip:{type:Boolean,default:Pt("flip")},shift:{type:Boolean,default:Pt("shift")},shiftCrossAxis:{type:Boolean,default:Pt("shiftCrossAxis")},noAutoFocus:{type:Boolean,default:Pt("noAutoFocus")}},emits:["show","hide","update:shown","apply-show","apply-hide","close-group","close-directive","auto-hide","resize","dispose"],data(){return{isShown:!1,isMounted:!1,skipTransition:!1,classes:{showFrom:!1,showTo:!1,hideFrom:!1,hideTo:!0},result:{x:0,y:0,placement:"",strategy:this.strategy,arrow:{x:0,y:0,centerOffset:0},transformOrigin:null},shownChildren:new Set,lastAutoHide:!0}},computed:{popperId(){return this.ariaId!=null?this.ariaId:this.randomId},shouldMountContent(){return this.eagerMount||this.isMounted},slotData(){return{popperId:this.popperId,isShown:this.isShown,shouldMountContent:this.shouldMountContent,skipTransition:this.skipTransition,autoHide:typeof this.autoHide=="function"?this.lastAutoHide:this.autoHide,show:this.show,hide:this.hide,handleResize:this.handleResize,onResize:this.onResize,classes:Od($o({},this.classes),{popperClass:this.popperClass}),result:this.positioningDisabled?null:this.result,attrs:this.$attrs}},parentPopper(){var t;return(t=this[_y])==null?void 0:t.parentPopper},hasPopperShowTriggerHover(){var t,e;return((t=this.popperTriggers)==null?void 0:t.includes("hover"))||((e=this.popperShowTriggers)==null?void 0:e.includes("hover"))}},watch:$o($o({shown:"$_autoShowHide",disabled(t){t?this.dispose():this.init()},async container(){this.isShown&&(this.$_ensureTeleport(),await this.$_computePosition())}},["triggers","positioningDisabled"].reduce((t,e)=>(t[e]="$_refreshListeners",t),{})),["placement","distance","skidding","boundary","strategy","overflowPadding","arrowPadding","preventOverflow","shift","shiftCrossAxis","flip"].reduce((t,e)=>(t[e]="$_computePosition",t),{})),created(){this.$_isDisposed=!0,this.randomId=`popper_${[Math.random(),Date.now()].map(t=>t.toString(36).substring(2,10)).join("_")}`,this.autoMinSize&&console.warn('[floating-vue] `autoMinSize` option is deprecated. Use `autoSize="min"` instead.'),this.autoMaxSize&&console.warn("[floating-vue] `autoMaxSize` option is deprecated. Use `autoBoundaryMaxSize` instead.")},mounted(){this.init(),this.$_detachPopperNode()},activated(){this.$_autoShowHide()},deactivated(){this.hide()},beforeUnmount(){this.dispose()},methods:{show({event:t=null,skipDelay:e=!1,force:n=!1}={}){var r,i;(r=this.parentPopper)!=null&&r.lockedChild&&this.parentPopper.lockedChild!==this||(this.$_pendingHide=!1,(n||!this.disabled)&&(((i=this.parentPopper)==null?void 0:i.lockedChild)===this&&(this.parentPopper.lockedChild=null),this.$_scheduleShow(t,e),this.$emit("show"),this.$_showFrameLocked=!0,requestAnimationFrame(()=>{this.$_showFrameLocked=!1})),this.$emit("update:shown",!0))},hide({event:t=null,skipDelay:e=!1}={}){var n;if(!this.$_hideInProgress){if(this.shownChildren.size>0){this.$_pendingHide=!0;return}if(this.hasPopperShowTriggerHover&&this.$_isAimingPopper()){this.parentPopper&&(this.parentPopper.lockedChild=this,clearTimeout(this.parentPopper.lockedChildTimer),this.parentPopper.lockedChildTimer=setTimeout(()=>{this.parentPopper.lockedChild===this&&(this.parentPopper.lockedChild.hide({skipDelay:e}),this.parentPopper.lockedChild=null)},1e3));return}((n=this.parentPopper)==null?void 0:n.lockedChild)===this&&(this.parentPopper.lockedChild=null),this.$_pendingHide=!1,this.$_scheduleHide(t,e),this.$emit("hide"),this.$emit("update:shown",!1)}},init(){var t,e;this.$_isDisposed&&(this.$_isDisposed=!1,this.isMounted=!1,this.$_events=[],this.$_preventShow=!1,this.$_referenceNode=(e=(t=this.referenceNode)==null?void 0:t.call(this))!=null?e:this.$el,this.$_targetNodes=this.targetNodes().filter(n=>n.nodeType===n.ELEMENT_NODE),this.$_popperNode=this.popperNode(),this.$_innerNode=this.$_popperNode.querySelector(".v-popper__inner"),this.$_arrowNode=this.$_popperNode.querySelector(".v-popper__arrow-container"),this.$_swapTargetAttrs("title","data-original-title"),this.$_detachPopperNode(),this.triggers.length&&this.$_addEventListeners(),this.shown&&this.show())},dispose(){this.$_isDisposed||(this.$_isDisposed=!0,this.$_removeEventListeners(),this.hide({skipDelay:!0}),this.$_detachPopperNode(),this.isMounted=!1,this.isShown=!1,this.$_updateParentShownChildren(!1),this.$_swapTargetAttrs("data-original-title","title"),this.$emit("dispose"))},async onResize(){this.isShown&&(await this.$_computePosition(),this.$emit("resize"))},async $_computePosition(){var t;if(this.$_isDisposed||this.positioningDisabled)return;const e={strategy:this.strategy,middleware:[]};(this.distance||this.skidding)&&e.middleware.push(g7({mainAxis:this.distance,crossAxis:this.skidding}));const n=this.placement.startsWith("auto");if(n?e.middleware.push(d7({alignment:(t=this.placement.split("-")[1])!=null?t:""})):e.placement=this.placement,this.preventOverflow&&(this.shift&&e.middleware.push(y7({padding:this.overflowPadding,boundary:this.boundary,crossAxis:this.shiftCrossAxis})),!n&&this.flip&&e.middleware.push(p7({padding:this.overflowPadding,boundary:this.boundary}))),e.middleware.push(s7({element:this.$_arrowNode,padding:this.arrowPadding})),this.arrowOverflow&&e.middleware.push({name:"arrowOverflow",fn:({placement:i,rects:o,middlewareData:s})=>{let l;const{centerOffset:u}=s.arrow;return i.startsWith("top")||i.startsWith("bottom")?l=Math.abs(u)>o.reference.width/2:l=Math.abs(u)>o.reference.height/2,{data:{overflow:l}}}}),this.autoMinSize||this.autoSize){const i=this.autoSize?this.autoSize:this.autoMinSize?"min":null;e.middleware.push({name:"autoSize",fn:({rects:o,placement:s,middlewareData:l})=>{var u;if((u=l.autoSize)!=null&&u.skip)return{};let f,d;return s.startsWith("top")||s.startsWith("bottom")?f=o.reference.width:d=o.reference.height,this.$_innerNode.style[i==="min"?"minWidth":i==="max"?"maxWidth":"width"]=f!=null?`${f}px`:null,this.$_innerNode.style[i==="min"?"minHeight":i==="max"?"maxHeight":"height"]=d!=null?`${d}px`:null,{data:{skip:!0},reset:{rects:!0}}}})}(this.autoMaxSize||this.autoBoundaryMaxSize)&&(this.$_innerNode.style.maxWidth=null,this.$_innerNode.style.maxHeight=null,e.middleware.push(b7({boundary:this.boundary,padding:this.overflowPadding,apply:({width:i,height:o})=>{this.$_innerNode.style.maxWidth=i!=null?`${i}px`:null,this.$_innerNode.style.maxHeight=o!=null?`${o}px`:null}})));const r=await I7(this.$_referenceNode,this.$_popperNode,e);Object.assign(this.result,{x:r.x,y:r.y,placement:r.placement,strategy:r.strategy,arrow:$o($o({},r.middlewareData.arrow),r.middlewareData.arrowOverflow)})},$_scheduleShow(t=null,e=!1){if(this.$_updateParentShownChildren(!0),this.$_hideInProgress=!1,clearTimeout(this.$_scheduleTimer),Ma&&this.instantMove&&Ma.instantMove&&Ma!==this.parentPopper){Ma.$_applyHide(!0),this.$_applyShow(!0);return}e?this.$_applyShow():this.$_scheduleTimer=setTimeout(this.$_applyShow.bind(this),this.$_computeDelay("show"))},$_scheduleHide(t=null,e=!1){if(this.shownChildren.size>0){this.$_pendingHide=!0;return}this.$_updateParentShownChildren(!1),this.$_hideInProgress=!0,clearTimeout(this.$_scheduleTimer),this.isShown&&(Ma=this),e?this.$_applyHide():this.$_scheduleTimer=setTimeout(this.$_applyHide.bind(this),this.$_computeDelay("hide"))},$_computeDelay(t){const e=this.delay;return parseInt(e&&e[t]||e||0)},async $_applyShow(t=!1){clearTimeout(this.$_disposeTimer),clearTimeout(this.$_scheduleTimer),this.skipTransition=t,!this.isShown&&(this.$_ensureTeleport(),await by(),await this.$_computePosition(),await this.$_applyShowEffect(),this.positioningDisabled||this.$_registerEventListeners([...um(this.$_referenceNode),...um(this.$_popperNode)],"scroll",()=>{this.$_computePosition()}))},async $_applyShowEffect(){if(this.$_hideInProgress)return;if(this.computeTransformOrigin){const e=this.$_referenceNode.getBoundingClientRect(),n=this.$_popperNode.querySelector(".v-popper__wrapper"),r=n.parentNode.getBoundingClientRect(),i=e.x+e.width/2-(r.left+n.offsetLeft),o=e.y+e.height/2-(r.top+n.offsetTop);this.result.transformOrigin=`${i}px ${o}px`}this.isShown=!0,this.$_applyAttrsToTarget({"aria-describedby":this.popperId,"data-popper-shown":""});const t=this.showGroup;if(t){let e;for(let n=0;n0){this.$_pendingHide=!0,this.$_hideInProgress=!1;return}if(clearTimeout(this.$_scheduleTimer),!this.isShown)return;this.skipTransition=t,f2(Pi,this),Pi.length===0&&document.body.classList.remove("v-popper--some-open");for(const n of l2(this.theme)){const r=h2(n);f2(r,this),r.length===0&&document.body.classList.remove(`v-popper--some-open--${n}`)}Ma===this&&(Ma=null),this.isShown=!1,this.$_applyAttrsToTarget({"aria-describedby":void 0,"data-popper-shown":void 0}),clearTimeout(this.$_disposeTimer);const e=Uu(this.theme,"disposeTimeout");e!==null&&(this.$_disposeTimer=setTimeout(()=>{this.$_popperNode&&(this.$_detachPopperNode(),this.isMounted=!1)},e)),this.$_removeEventListeners("scroll"),this.$emit("apply-hide"),this.classes.showFrom=!1,this.classes.showTo=!1,this.classes.hideFrom=!0,this.classes.hideTo=!1,await by(),this.classes.hideFrom=!1,this.classes.hideTo=!0},$_autoShowHide(){this.shown?this.show():this.hide()},$_ensureTeleport(){if(this.$_isDisposed)return;let t=this.container;if(typeof t=="string"?t=window.document.querySelector(t):t===!1&&(t=this.$_targetNodes[0].parentNode),!t)throw new Error("No container for popover: "+this.container);t.appendChild(this.$_popperNode),this.isMounted=!0},$_addEventListeners(){const t=n=>{this.isShown&&!this.$_hideInProgress||(n.usedByTooltip=!0,!this.$_preventShow&&this.show({event:n}))};this.$_registerTriggerListeners(this.$_targetNodes,u2,this.triggers,this.showTriggers,t),this.$_registerTriggerListeners([this.$_popperNode],u2,this.popperTriggers,this.popperShowTriggers,t);const e=n=>{n.usedByTooltip||this.hide({event:n})};this.$_registerTriggerListeners(this.$_targetNodes,c2,this.triggers,this.hideTriggers,e),this.$_registerTriggerListeners([this.$_popperNode],c2,this.popperTriggers,this.popperHideTriggers,e)},$_registerEventListeners(t,e,n){this.$_events.push({targetNodes:t,eventType:e,handler:n}),t.forEach(r=>r.addEventListener(e,n,pl?{passive:!0}:void 0))},$_registerTriggerListeners(t,e,n,r,i){let o=n;r!=null&&(o=typeof r=="function"?r(o):r),o.forEach(s=>{const l=e[s];l&&this.$_registerEventListeners(t,l,i)})},$_removeEventListeners(t){const e=[];this.$_events.forEach(n=>{const{targetNodes:r,eventType:i,handler:o}=n;!t||t===i?r.forEach(s=>s.removeEventListener(i,o)):e.push(n)}),this.$_events=e},$_refreshListeners(){this.$_isDisposed||(this.$_removeEventListeners(),this.$_addEventListeners())},$_handleGlobalClose(t,e=!1){this.$_showFrameLocked||(this.hide({event:t}),t.closePopover?this.$emit("close-directive"):this.$emit("auto-hide"),e&&(this.$_preventShow=!0,setTimeout(()=>{this.$_preventShow=!1},300)))},$_detachPopperNode(){this.$_popperNode.parentNode&&this.$_popperNode.parentNode.removeChild(this.$_popperNode)},$_swapTargetAttrs(t,e){for(const n of this.$_targetNodes){const r=n.getAttribute(t);r&&(n.removeAttribute(t),n.setAttribute(e,r))}},$_applyAttrsToTarget(t){for(const e of this.$_targetNodes)for(const n in t){const r=t[n];r==null?e.removeAttribute(n):e.setAttribute(n,r)}},$_updateParentShownChildren(t){let e=this.parentPopper;for(;e;)t?e.shownChildren.add(this.randomId):(e.shownChildren.delete(this.randomId),e.$_pendingHide&&e.hide()),e=e.parentPopper},$_isAimingPopper(){const t=this.$_referenceNode.getBoundingClientRect();if(pf>=t.left&&pf<=t.right&&mf>=t.top&&mf<=t.bottom){const e=this.$_popperNode.getBoundingClientRect(),n=pf-Ms,r=mf-Ns,o=e.left+e.width/2-Ms+(e.top+e.height/2)-Ns+e.width+e.height,s=Ms+n*o,l=Ns+r*o;return $h(Ms,Ns,s,l,e.left,e.top,e.left,e.bottom)||$h(Ms,Ns,s,l,e.left,e.top,e.right,e.top)||$h(Ms,Ns,s,l,e.right,e.top,e.right,e.bottom)||$h(Ms,Ns,s,l,e.left,e.bottom,e.right,e.bottom)}return!1}},render(){return this.$slots.default(this.slotData)}});typeof document<"u"&&typeof window<"u"&&(l3?(document.addEventListener("touchstart",p2,pl?{passive:!0,capture:!0}:!0),document.addEventListener("touchend",F7,pl?{passive:!0,capture:!0}:!0)):(window.addEventListener("mousedown",p2,!0),window.addEventListener("click",H7,!0)),window.addEventListener("resize",W7));function p2(t){for(let e=0;e=0;r--){const i=Pi[r];try{const o=i.$_containsGlobalTarget=V7(i,t);i.$_pendingHide=!1,requestAnimationFrame(()=>{if(i.$_pendingHide=!1,!n[i.randomId]&&m2(i,o,t)){if(i.$_handleGlobalClose(t,e),!t.closeAllPopover&&t.closePopover&&o){let l=i.parentPopper;for(;l;)n[l.randomId]=!0,l=l.parentPopper;return}let s=i.parentPopper;for(;s&&m2(s,s.$_containsGlobalTarget,t);){s.$_handleGlobalClose(t,e);s=s.parentPopper}}})}catch{}}}function V7(t,e){const n=t.popperNode();return t.$_mouseDownContains||n.contains(e.target)}function m2(t,e,n){return n.closeAllPopover||n.closePopover&&e||j7(t,n)&&!e}function j7(t,e){if(typeof t.autoHide=="function"){const n=t.autoHide(e);return t.lastAutoHide=n,n}return t.autoHide}function W7(t){for(let e=0;e{Ms=pf,Ns=mf,pf=t.clientX,mf=t.clientY},pl?{passive:!0}:void 0);function $h(t,e,n,r,i,o,s,l){const u=((s-i)*(e-o)-(l-o)*(t-i))/((l-o)*(n-t)-(s-i)*(r-e)),f=((n-t)*(e-o)-(r-e)*(t-i))/((l-o)*(n-t)-(s-i)*(r-e));return u>=0&&u<=1&&f>=0&&f<=1}var Ag=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n};const U7={extends:c3()};function q7(t,e,n,r,i,o){return ge(),Se("div",{ref:"reference",class:vt(["v-popper",{"v-popper--shown":t.slotData.isShown}])},[pn(t.$slots,"default",AA(G1(t.slotData)))],2)}var K7=Ag(U7,[["render",q7]]);function G7(){var t=window.navigator.userAgent,e=t.indexOf("MSIE ");if(e>0)return parseInt(t.substring(e+5,t.indexOf(".",e)),10);var n=t.indexOf("Trident/");if(n>0){var r=t.indexOf("rv:");return parseInt(t.substring(r+3,t.indexOf(".",r)),10)}var i=t.indexOf("Edge/");return i>0?parseInt(t.substring(i+5,t.indexOf(".",i)),10):-1}let Cp;function ab(){ab.init||(ab.init=!0,Cp=G7()!==-1)}var Og={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){ab(),Ri(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const t=document.createElement("object");this._resizeObject=t,t.setAttribute("aria-hidden","true"),t.setAttribute("tabindex",-1),t.onload=this.addResizeHandlers,t.type="text/html",Cp&&this.$el.appendChild(t),t.data="about:blank",Cp||this.$el.appendChild(t)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!Cp&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const Y7=z1();D1("data-v-b329ee4c");const J7={class:"resize-observer",tabindex:"-1"};R1();const X7=Y7((t,e,n,r,i,o)=>(ge(),Ct("div",J7)));Og.render=X7;Og.__scopeId="data-v-b329ee4c";Og.__file="src/components/ResizeObserver.vue";var d3=(t="theme")=>({computed:{themeClass(){return $7(this[t])}}});const Z7=Vn({name:"VPopperContent",components:{ResizeObserver:Og},mixins:[d3()],props:{popperId:String,theme:String,shown:Boolean,mounted:Boolean,skipTransition:Boolean,autoHide:Boolean,handleResize:Boolean,classes:Object,result:Object},emits:["hide","resize"],methods:{toPx(t){return t!=null&&!isNaN(t)?`${t}px`:null}}}),Q7=["id","aria-hidden","tabindex","data-popper-placement"],eB={ref:"inner",class:"v-popper__inner"},tB=re("div",{class:"v-popper__arrow-outer"},null,-1),nB=re("div",{class:"v-popper__arrow-inner"},null,-1),rB=[tB,nB];function iB(t,e,n,r,i,o){const s=ut("ResizeObserver");return ge(),Se("div",{id:t.popperId,ref:"popover",class:vt(["v-popper__popper",[t.themeClass,t.classes.popperClass,{"v-popper__popper--shown":t.shown,"v-popper__popper--hidden":!t.shown,"v-popper__popper--show-from":t.classes.showFrom,"v-popper__popper--show-to":t.classes.showTo,"v-popper__popper--hide-from":t.classes.hideFrom,"v-popper__popper--hide-to":t.classes.hideTo,"v-popper__popper--skip-transition":t.skipTransition,"v-popper__popper--arrow-overflow":t.result&&t.result.arrow.overflow,"v-popper__popper--no-positioning":!t.result}]]),style:oi(t.result?{position:t.result.strategy,transform:`translate3d(${Math.round(t.result.x)}px,${Math.round(t.result.y)}px,0)`}:void 0),"aria-hidden":t.shown?"false":"true",tabindex:t.autoHide?0:void 0,"data-popper-placement":t.result?t.result.placement:void 0,onKeyup:e[2]||(e[2]=Tu(l=>t.autoHide&&t.$emit("hide"),["esc"]))},[re("div",{class:"v-popper__backdrop",onClick:e[0]||(e[0]=l=>t.autoHide&&t.$emit("hide"))}),re("div",{class:"v-popper__wrapper",style:oi(t.result?{transformOrigin:t.result.transformOrigin}:void 0)},[re("div",eB,[t.mounted?(ge(),Se(kt,{key:0},[re("div",null,[pn(t.$slots,"default")]),t.handleResize?(ge(),Ct(s,{key:0,onNotify:e[1]||(e[1]=l=>t.$emit("resize",l))})):gt("",!0)],64)):gt("",!0)],512),re("div",{ref:"arrow",class:"v-popper__arrow-container",style:oi(t.result?{left:t.toPx(t.result.arrow.x),top:t.toPx(t.result.arrow.y)}:void 0)},rB,4)],4)],46,Q7)}var h3=Ag(Z7,[["render",iB]]),p3={methods:{show(...t){return this.$refs.popper.show(...t)},hide(...t){return this.$refs.popper.hide(...t)},dispose(...t){return this.$refs.popper.dispose(...t)},onResize(...t){return this.$refs.popper.onResize(...t)}}};const oB=Vn({name:"VPopperWrapper",components:{Popper:K7,PopperContent:h3},mixins:[p3,d3("finalTheme")],props:{theme:{type:String,default:null}},computed:{finalTheme(){var t;return(t=this.theme)!=null?t:this.$options.vPopperTheme}},methods:{getTargetNodes(){return Array.from(this.$el.children).filter(t=>t!==this.$refs.popperContent.$el)}}});function sB(t,e,n,r,i,o){const s=ut("PopperContent"),l=ut("Popper");return ge(),Ct(l,{ref:"popper",theme:t.finalTheme,"target-nodes":t.getTargetNodes,"popper-node":()=>t.$refs.popperContent.$el,class:vt([t.themeClass])},{default:Vt(({popperId:u,isShown:f,shouldMountContent:d,skipTransition:m,autoHide:v,show:y,hide:_,handleResize:C,onResize:x,classes:k,result:A})=>[pn(t.$slots,"default",{shown:f,show:y,hide:_}),Qe(s,{ref:"popperContent","popper-id":u,theme:t.finalTheme,shown:f,mounted:d,"skip-transition":m,"auto-hide":v,"handle-resize":C,classes:k,result:A,onHide:_,onResize:x},{default:Vt(()=>[pn(t.$slots,"popper",{shown:f,hide:_})]),_:2},1032,["popper-id","theme","shown","mounted","skip-transition","auto-hide","handle-resize","classes","result","onHide","onResize"])]),_:3},8,["theme","target-nodes","popper-node","class"])}var w_=Ag(oB,[["render",sB]]);const aB=Vn(Od($o({},w_),{name:"VDropdown",vPopperTheme:"dropdown"})),lB=Vn(Od($o({},w_),{name:"VMenu",vPopperTheme:"menu"})),uB=Vn(Od($o({},w_),{name:"VTooltip",vPopperTheme:"tooltip"})),cB=Vn({name:"VTooltipDirective",components:{Popper:c3(),PopperContent:h3},mixins:[p3],inheritAttrs:!1,props:{theme:{type:String,default:"tooltip"},html:{type:Boolean,default:t=>Uu(t.theme,"html")},content:{type:[String,Number,Function],default:null},loadingContent:{type:String,default:t=>Uu(t.theme,"loadingContent")}},data(){return{asyncContent:null}},computed:{isContentAsync(){return typeof this.content=="function"},loading(){return this.isContentAsync&&this.asyncContent==null},finalContent(){return this.isContentAsync?this.loading?this.loadingContent:this.asyncContent:this.content}},watch:{content:{handler(){this.fetchContent(!0)},immediate:!0},async finalContent(){await this.$nextTick(),this.$refs.popper.onResize()}},created(){this.$_fetchId=0},methods:{fetchContent(t){if(typeof this.content=="function"&&this.$_isShown&&(t||!this.$_loading&&this.asyncContent==null)){this.asyncContent=null,this.$_loading=!0;const e=++this.$_fetchId,n=this.content(this);n.then?n.then(r=>this.onResult(e,r)):this.onResult(e,n)}},onResult(t,e){t===this.$_fetchId&&(this.$_loading=!1,this.asyncContent=e)},onShow(){this.$_isShown=!0,this.fetchContent()},onHide(){this.$_isShown=!1}}}),fB=["innerHTML"],dB=["textContent"];function hB(t,e,n,r,i,o){const s=ut("PopperContent"),l=ut("Popper");return ge(),Ct(l,wi({ref:"popper"},t.$attrs,{theme:t.theme,"popper-node":()=>t.$refs.popperContent.$el,onApplyShow:t.onShow,onApplyHide:t.onHide}),{default:Vt(({popperId:u,isShown:f,shouldMountContent:d,skipTransition:m,autoHide:v,hide:y,handleResize:_,onResize:C,classes:x,result:k})=>[Qe(s,{ref:"popperContent",class:vt({"v-popper--tooltip-loading":t.loading}),"popper-id":u,theme:t.theme,shown:f,mounted:d,"skip-transition":m,"auto-hide":v,"handle-resize":_,classes:x,result:k,onHide:y,onResize:C},{default:Vt(()=>[t.html?(ge(),Se("div",{key:0,innerHTML:t.finalContent},null,8,fB)):(ge(),Se("div",{key:1,textContent:Le(t.finalContent)},null,8,dB))]),_:2},1032,["class","popper-id","theme","shown","mounted","skip-transition","auto-hide","handle-resize","classes","result","onHide","onResize"])]),_:1},16,["theme","popper-node","onApplyShow","onApplyHide"])}var pB=Ag(cB,[["render",hB]]);const m3="v-popper--has-tooltip";function mB(t,e){let n=t.placement;if(!n&&e)for(const r of u3)e[r]&&(n=r);return n||(n=Uu(t.theme||"tooltip","placement")),n}function g3(t,e,n){let r;const i=typeof e;return i==="string"?r={content:e}:e&&i==="object"?r=e:r={content:!1},r.placement=mB(r,n),r.targetNodes=()=>[t],r.referenceNode=()=>t,r}let wy,Qf,gB=0;function vB(){if(wy)return;Qf=Ot([]),wy=Q1({name:"VTooltipDirectiveApp",setup(){return{directives:Qf}},render(){return this.directives.map(e=>mr(pB,Od($o({},e.options),{shown:e.shown||e.options.shown,key:e.id})))},devtools:{hide:!0}});const t=document.createElement("div");document.body.appendChild(t),wy.mount(t)}function yB(t,e,n){vB();const r=Ot(g3(t,e,n)),i=Ot(!1),o={id:gB++,options:r,shown:i};return Qf.value.push(o),t.classList&&t.classList.add(m3),t.$_popper={options:r,item:o,show(){i.value=!0},hide(){i.value=!1}}}function v3(t){if(t.$_popper){const e=Qf.value.indexOf(t.$_popper.item);e!==-1&&Qf.value.splice(e,1),delete t.$_popper,delete t.$_popperOldShown,delete t.$_popperMountTarget}t.classList&&t.classList.remove(m3)}function g2(t,{value:e,modifiers:n}){const r=g3(t,e,n);if(!r.content||Uu(r.theme||"tooltip","disabled"))v3(t);else{let i;t.$_popper?(i=t.$_popper,i.options.value=r):i=yB(t,e,n),typeof e.shown<"u"&&e.shown!==t.$_popperOldShown&&(t.$_popperOldShown=e.shown,e.shown?i.show():i.hide())}}var bB={beforeMount:g2,updated:g2,beforeUnmount(t){v3(t)}};function v2(t){t.addEventListener("click",y3),t.addEventListener("touchstart",b3,pl?{passive:!0}:!1)}function y2(t){t.removeEventListener("click",y3),t.removeEventListener("touchstart",b3),t.removeEventListener("touchend",_3),t.removeEventListener("touchcancel",w3)}function y3(t){const e=t.currentTarget;t.closePopover=!e.$_vclosepopover_touch,t.closeAllPopover=e.$_closePopoverModifiers&&!!e.$_closePopoverModifiers.all}function b3(t){if(t.changedTouches.length===1){const e=t.currentTarget;e.$_vclosepopover_touch=!0;const n=t.changedTouches[0];e.$_vclosepopover_touchPoint=n,e.addEventListener("touchend",_3),e.addEventListener("touchcancel",w3)}}function _3(t){const e=t.currentTarget;if(e.$_vclosepopover_touch=!1,t.changedTouches.length===1){const n=t.changedTouches[0],r=e.$_vclosepopover_touchPoint;t.closePopover=Math.abs(n.screenY-r.screenY)<20&&Math.abs(n.screenX-r.screenX)<20,t.closeAllPopover=e.$_closePopoverModifiers&&!!e.$_closePopoverModifiers.all}}function w3(t){const e=t.currentTarget;e.$_vclosepopover_touch=!1}var _B={beforeMount(t,{value:e,modifiers:n}){t.$_closePopoverModifiers=n,(typeof e>"u"||e)&&v2(t)},updated(t,{value:e,oldValue:n,modifiers:r}){t.$_closePopoverModifiers=r,e!==n&&(typeof e>"u"||e?v2(t):y2(t))},beforeUnmount(t){y2(t)}};function wB(t,e={}){t.$_vTooltipInstalled||(t.$_vTooltipInstalled=!0,a3(jo,e),t.directive("tooltip",bB),t.directive("close-popper",_B),t.component("VTooltip",uB),t.component("VDropdown",aB),t.component("VMenu",lB))}const kB={version:"2.0.0-beta.20",install:wB,options:jo};function gf(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?gf=function(e){return typeof e}:gf=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gf(t)}function b2(t,e,n,r,i,o,s){try{var l=t[o](s),u=l.value}catch(f){n(f);return}l.done?e(u):Promise.resolve(u).then(r,i)}function xB(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function s(u){b2(o,r,i,s,l,"next",u)}function l(u){b2(o,r,i,s,l,"throw",u)}s(void 0)})}}function SB(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _2(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1),Ws=[],fm=!1,Tp=0,x3=-1,vf,yf,$B=function(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return!1;var n=window.getComputedStyle(e);return["auto","scroll"].includes(n.overflowY)&&e.scrollHeight>e.clientHeight},HB=function(e,n){return!(e.scrollTop===0&&n<0||e.scrollTop+e.clientHeight+n>=e.scrollHeight&&n>0)},FB=function(e){for(var n=[];e;){if(n.push(e),e.classList.contains("vfm"))return n;e=e.parentElement}return n},VB=function(e,n){var r=!1,i=FB(e);return i.forEach(function(o){$B(o)&&HB(o,n)&&(r=!0)}),r},S3=function(e){return Ws.some(function(){return VB(e,-Tp)})},dm=function(e){var n=e||window.event;return S3(n.target)||n.touches.length>1?!0:(n.preventDefault&&n.preventDefault(),!1)},jB=function(e){if(yf===void 0){var n=!!e&&e.reserveScrollBarGap===!0,r=window.innerWidth-document.documentElement.clientWidth;if(n&&r>0){var i=parseInt(getComputedStyle(document.body).getPropertyValue("padding-right"),10);yf=document.body.style.paddingRight,document.body.style.paddingRight="".concat(i+r,"px")}}vf===void 0&&(vf=document.body.style.overflow,document.body.style.overflow="hidden")},WB=function(){yf!==void 0&&(document.body.style.paddingRight=yf,yf=void 0),vf!==void 0&&(document.body.style.overflow=vf,vf=void 0)},UB=function(e){return e?e.scrollHeight-e.scrollTop<=e.clientHeight:!1},qB=function(e,n){return Tp=e.targetTouches[0].clientY-x3,S3(e.target)?!1:n&&n.scrollTop===0&&Tp>0||UB(n)&&Tp<0?dm(e):(e.stopPropagation(),!0)},KB=function(e,n){if(!e){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(!Ws.some(function(i){return i.targetElement===e})){var r={targetElement:e,options:n||{}};Ws=[].concat(ml(Ws),[r]),k3?(e.ontouchstart=function(i){i.targetTouches.length===1&&(x3=i.targetTouches[0].clientY)},e.ontouchmove=function(i){i.targetTouches.length===1&&qB(i,e)},fm||(document.addEventListener("touchmove",dm,k_?{passive:!1}:void 0),fm=!0)):jB(n)}},ky=function(e){if(!e){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}Ws=Ws.filter(function(n){return n.targetElement!==e}),k3?(e.ontouchstart=null,e.ontouchmove=null,fm&&Ws.length===0&&(document.removeEventListener("touchmove",dm,k_?{passive:!1}:void 0),fm=!1)):Ws.length||WB()},jh=function(){},no={Enter:"enter",Entering:"entering",Leave:"leave",Leaving:"leavng"},GB={t:"ns-resize",tr:"nesw-resize",r:"ew-resize",br:"nwse-resize",b:"ns-resize",bl:"nesw-resize",l:"ew-resize",tl:"nwse-resize"},Mg={props:{name:{type:String,default:null},modelValue:{type:Boolean,default:!1},ssr:{type:Boolean,default:!0},classes:{type:[String,Object,Array],default:""},overlayClass:{type:[String,Object,Array],default:""},contentClass:{type:[String,Object,Array],default:""},styles:{type:[Object,Array],default:function(){return{}}},overlayStyle:{type:[Object,Array],default:function(){return{}}},contentStyle:{type:[Object,Array],default:function(){return{}}},lockScroll:{type:Boolean,default:!0},hideOverlay:{type:Boolean,default:!1},clickToClose:{type:Boolean,default:!0},escToClose:{type:Boolean,default:!1},preventClick:{type:Boolean,default:!1},attach:{type:null,default:!1,validator:function(e){var n=gf(e);return n==="boolean"||n==="string"?!0:e.nodeType===Node.ELEMENT_NODE}},transition:{type:[String,Object],default:"vfm"},overlayTransition:{type:[String,Object],default:"vfm"},keepOverlay:{type:Boolean,default:!1},zIndexAuto:{type:Boolean,default:!0},zIndexBase:{type:[String,Number],default:1e3},zIndex:{type:[Boolean,String,Number],default:!1},focusRetain:{type:Boolean,default:!0},focusTrap:{type:Boolean,default:!1},fitParent:{type:Boolean,default:!0},drag:{type:Boolean,default:!1},dragSelector:{type:String,default:""},keepChangedStyle:{type:Boolean,default:!1},resize:{type:Boolean,default:!1},resizeDirections:{type:Array,default:function(){return["t","tr","r","br","b","bl","l","tl"]},validator:function(e){return["t","tr","r","br","b","bl","l","tl"].filter(function(n){return e.indexOf(n)!==-1}).length===e.length}},minWidth:{type:Number,default:0},minHeight:{type:Number,default:0},maxWidth:{type:Number,default:1/0},maxHeight:{type:Number,default:1/0}},emits:["update:modelValue","click-outside","before-open","opened","before-close","closed","_before-open","_opened","_closed","drag:start","drag:move","drag:end","resize:start","resize:move","resize:end"],setup:function(e,n){var r=n.emit,i=Symbol("vfm"),o=Ot(null),s=Ot(null),l=Ot(null),u=Ot(null),f=Ot(null),d=Ot(null),m=Ot(null),v=new DB,y=Ot(!1),_=Al({modal:!1,overlay:!1,resize:!1}),C=Ot(null),x=Ot(null),k=Ot(!1),A=Ot({}),L=Ot({}),E=Ot(null),H=Ot(null),I=jh,q=jh,P=er(function(){return typeof e.overlayTransition=="string"?{name:e.overlayTransition}:Rr({},e.overlayTransition)}),z=er(function(){return typeof e.transition=="string"?{name:e.transition}:Rr({},e.transition)}),w=er(function(){return(e.hideOverlay||C.value===no.Leave)&&x.value===no.Leave}),R=er(function(){return e.zIndex===!1?e.zIndexAuto?+e.zIndexBase+2*(m.value||0):!1:e.zIndex}),U=er(function(){return Rr({},R.value!==!1&&{zIndex:R.value})}),K=er(function(){var O=[L.value];return Array.isArray(e.contentStyle)?O.push.apply(O,ml(e.contentStyle)):O.push(e.contentStyle),O});En(function(){return e.modelValue},function(O){if(k.value){k.value=!1;return}if(D(),!O){if(ie("before-close",!0)){q("hide");return}ae()}}),En(function(){return e.lockScroll},ce),En(function(){return e.hideOverlay},function(O){e.modelValue&&!O&&(_.overlay=!0)}),En(function(){return e.attach},D),En(w,function(O){O&&(y.value=!1,s.value.style.display="none")},{flush:"post"}),En(function(){return e.drag},function(O){y.value&&(O?xe():G())}),En(function(){return e.resize},function(O){y.value&&(O?Z():N())}),En(function(){return e.keepChangedStyle},function(O){O||(L.value={})}),ts(function(){e.api.modals.push(oe()),D()}),Ml(function(){var O;ae(),e.lockScroll&&s.value&&ky(s.value),o==null||(O=o.value)===null||O===void 0||O.remove();var j=e.api.modals.findIndex(function(F){return F.uid===i});e.api.modals.splice(j,1)});function oe(){return{uid:i,props:e,emit:r,vfmContainer:s,vfmContent:l,vfmResize:u,vfmOverlayTransition:f,vfmTransition:d,getAttachElement:ve,modalStackIndex:m,visibility:_,handleLockScroll:ce,$focusTrap:v,toggle:be,params:A}}function D(){if(e.modelValue){if(r("_before-open",at({type:"_before-open"})),ie("before-open",!1)){q("show");return}var O=ve();if(O||e.attach===!1){if(e.attach!==!1)if(o.value)O.appendChild(o.value);else{y.value=!0,Ri(function(){D()});return}var j=e.api.openedModals.findIndex(function(F){return F.uid===i});j!==-1&&e.api.openedModals.splice(j,1),e.api.openedModals.push(oe()),m.value=e.api.openedModals.length-1,ce(),e.api.openedModals.filter(function(F){return F.uid!==i}).forEach(function(F,Q){F.getAttachElement()===O&&(F.modalStackIndex.value=Q,!F.props.keepOverlay&&(F.visibility.overlay=!1))}),y.value=!0,ze()}else O!==!1&&console.warn("Unable to locate target ".concat(e.attach))}}function ae(){var O=e.api.openedModals.findIndex(function(F){return F.uid===i});if(O!==-1&&e.api.openedModals.splice(O,1),e.api.openedModals.length>0){var j=e.api.openedModals[e.api.openedModals.length-1];j.props.focusTrap&&j.$focusTrap.firstElement().focus(),(j.props.focusRetain||j.props.focusTrap)&&j.vfmContainer.value.focus(),!j.props.hideOverlay&&(j.visibility.overlay=!0)}e.drag&&G(),e.resize&&N(),E.value=null,qe()}function ce(){e.modelValue&&Ri(function(){e.lockScroll?KB(s.value,{reserveScrollBarGap:!0}):ky(s.value)})}function ve(){var O;return e.attach===!1?O=!1:typeof e.attach=="string"?window?O=window.document.querySelector(e.attach):O=!1:O=e.attach,O}function ze(){_.overlay=!0,_.modal=!0}function qe(){_.overlay=!1,_.modal=!1}function yt(){C.value=no.Entering}function mt(){C.value=no.Enter}function _t(){C.value=no.Leaving}function bt(){C.value=no.Leave}function Xe(){x.value=no.Entering}function Ie(){x.value=no.Enter,(e.focusRetain||e.focusTrap)&&s.value.focus(),e.focusTrap&&v.enable(s.value),e.drag&&xe(),e.resize&&Z(),r("_opened"),r("opened",at({type:"opened"})),I("show")}function Be(){x.value=no.Leaving,v.enabled()&&v.disable()}function Ee(){x.value=no.Leave,m.value=null,e.lockScroll&&ky(s.value),e.keepChangedStyle||(L.value={});var O=!1,j=at({type:"closed",stop:function(){O=!0}});r("_closed"),r("closed",j),I("hide"),!O&&(A.value={})}function Ze(O){H.value=O==null?void 0:O.target}function Ke(){H.value===s.value&&E.value!=="resize:move"&&(r("click-outside",at({type:"click-outside"})),e.clickToClose&&r("update:modelValue",!1))}function Fe(){y.value&&e.escToClose&&r("update:modelValue",!1)}function at(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Rr({ref:oe()},O)}function ie(O,j){var F=!1,Q=at({type:O,stop:function(){F=!0}});return r(O,Q),F?(k.value=!0,Ri(function(){r("update:modelValue",j)}),!0):!1}function te(O,j,F){E.value="".concat(j,":").concat(F),r(E.value,O)}function be(O,j){var F=arguments;return new Promise(function(Q,le){I=function(Y){Q(Y),I=jh},q=function(Y){le(Y),q=jh};var pe=typeof O=="boolean"?O:!e.modelValue;pe&&F.length===2&&(A.value=j),r("update:modelValue",pe)})}function _e(O){O.stopPropagation();var j="resize",F="drag",Q=O.target.getAttribute("direction"),le;if(Q)le=j;else if(BB(O,l.value,e.dragSelector))le=F;else return;te(O,le,"start");var pe=x2(O),ye=s.value.getBoundingClientRect(),Y=l.value.getBoundingClientRect(),X=window.getComputedStyle(l.value).position==="absolute",de={top:S2(L.value.top),left:S2(L.value.left)},Te=function(){if(e.fitParent){var Ne={absolute:function(){return{minTop:0,minLeft:0,maxTop:ye.height-Y.height,maxLeft:ye.width-Y.width}},relative:function(){return{minTop:de.top+ye.top-Y.top,minLeft:de.left+ye.left-Y.left,maxTop:de.top+ye.bottom-Y.bottom,maxLeft:de.left+ye.right-Y.right}}};return X?Ne.absolute():Ne.relative()}else return{}}(),je=le===j&&RB(document.body,"cursor",GB[Q]),he=function(me){me.stopPropagation(),te(me,le,"move");var Je=x2(me),ct={x:Je.x-pe.x,y:Je.y-pe.y};le===j&&(ct=W(Q,ct,ye,Y,X));var ot,Tt;X?(ot=Y.top-ye.top+ct.y,Tt=Y.left-ye.left+ct.x):(ot=de.top+ct.y,Tt=de.left+ct.x),le===F&&e.fitParent&&(ot=Hh(Te.minTop,ot,Te.maxTop),Tt=Hh(Te.minLeft,Tt,Te.maxLeft));var br=Rr(Rr(Rr({position:"relative",top:ot+"px",left:Tt+"px",margin:"unset",touchAction:"none"},X&&{position:"absolute",transform:"unset",width:Y.width+"px",height:Y.height+"px"}),ct.width&&{width:ct.width+"px"}),ct.height&&{height:ct.height+"px"});L.value=Rr(Rr({},L.value),br)},Ae=function Ne(me){me.stopPropagation(),le===j&&je&&je(),setTimeout(function(){te(me,le,"end")}),Vh("move",document,he),Vh("up",document,Ne)};Fh("move",document,he),Fh("up",document,Ae)}function xe(){Fh("down",l.value,_e),L.value.touchAction="none"}function G(){Vh("down",l.value,_e)}function Z(){_.resize=!0,Ri(function(){Fh("down",u.value,_e)})}function N(){Vh("down",u.value,_e),_.resize=!1}function W(O,j,F,Q,le){var pe=function(Te){var je,he=j[Te.axis];he=e.fitParent?Hh(Te.min,he,Te.max):he;var Ae=Hh(Te.minEdge,Te.getEdge(he),Te.maxEdge);return he=Te.getOffsetAxis(Ae,le),je={},Au(je,Te.edgeName,Ae),Au(je,Te.axis,he),je},ye=function(Te,je,he,Ae){var Ne=Q[je],me=F[Te]-Q[Te],Je=zB(je);return{axis:he,edgeName:je,min:Ae?me:-Ne,max:Ae?Ne:me,minEdge:e["min".concat(Je)],maxEdge:e["max".concat(Je)],getEdge:function(ot){return Q[je]-ot*(Ae?1:-1)},getOffsetAxis:function(ot,Tt){var br=Q[je]-ot;return Tt?Ae?br:0:(Ae?1:-1)*br/2}}},Y={t:["top","height","y",!0],b:["bottom","height","y",!1],l:["left","width","x",!0],r:["right","width","x",!1]},X={x:0,y:0};return O.split("").forEach(function(de){var Te=ye.apply(void 0,ml(Y[de]));X=Rr(Rr({},X),pe(Te))}),X}return{root:o,vfmContainer:s,vfmContent:l,vfmResize:u,vfmOverlayTransition:f,vfmTransition:d,computedOverlayTransition:P,computedTransition:z,visible:y,visibility:_,params:A,calculateZIndex:R,bindStyle:U,bindContentStyle:K,beforeOverlayEnter:yt,afterOverlayEnter:mt,beforeOverlayLeave:_t,afterOverlayLeave:bt,beforeModalEnter:Xe,afterModalEnter:Ie,beforeModalLeave:Be,afterModalLeave:Ee,onMousedown:Ze,onMouseupContainer:Ke,onEsc:Fe}}},xy=z1();D1("data-v-2836fdb5");var YB={key:0,ref:"vfmResize",class:"vfm__resize vfm--absolute vfm--inset vfm--prevent-none vfm--select-none vfm--touch-none"};R1();var JB=xy(function(t,e,n,r,i,o){return n.ssr||r.visible?Ut((ge(),Ct("div",{key:0,ref:"root",style:r.bindStyle,class:["vfm vfm--inset",[n.attach===!1?"vfm--fixed":"vfm--absolute",{"vfm--prevent-none":n.preventClick}]],onKeydown:e[4]||(e[4]=Tu(function(){return r.onEsc&&r.onEsc.apply(r,arguments)},["esc"]))},[Qe(zu,wi(r.computedOverlayTransition,{onBeforeEnter:r.beforeOverlayEnter,onAfterEnter:r.afterOverlayEnter,onBeforeLeave:r.beforeOverlayLeave,onAfterLeave:r.afterOverlayLeave}),{default:xy(function(){return[!n.hideOverlay&&r.visibility.overlay?(ge(),Ct("div",{key:0,class:["vfm__overlay vfm--overlay vfm--absolute vfm--inset",n.overlayClass],style:n.overlayStyle},null,6)):gt("v-if",!0)]}),_:1},16,["onBeforeEnter","onAfterEnter","onBeforeLeave","onAfterLeave"]),Qe(zu,wi(r.computedTransition,{onBeforeEnter:r.beforeModalEnter,onAfterEnter:r.afterModalEnter,onBeforeLeave:r.beforeModalLeave,onAfterLeave:r.afterModalLeave}),{default:xy(function(){return[Ut(Qe("div",{ref:"vfmContainer",class:["vfm__container vfm--absolute vfm--inset vfm--outline-none",n.classes],style:n.styles,"aria-expanded":r.visibility.modal.toString(),role:"dialog","aria-modal":"true",tabindex:"-1",onMouseup:e[2]||(e[2]=lt(function(){return r.onMouseupContainer&&r.onMouseupContainer.apply(r,arguments)},["self"])),onMousedown:e[3]||(e[3]=lt(function(){return r.onMousedown&&r.onMousedown.apply(r,arguments)},["self"]))},[Qe("div",{ref:"vfmContent",class:["vfm__content",[n.contentClass,{"vfm--prevent-auto":n.preventClick}]],style:r.bindContentStyle,onMousedown:e[1]||(e[1]=function(s){return r.onMousedown(null)})},[pn(t.$slots,"default",{params:r.params,close:function(){return t.$emit("update:modelValue",!1)}}),r.visibility.resize&&r.visibility.modal?(ge(),Ct("div",YB,[(ge(!0),Ct(kt,null,Zt(n.resizeDirections,function(s){return ge(),Ct("div",{key:s,direction:s,class:["vfm--resize-".concat(s),"vfm--absolute vfm--prevent-auto"]},null,10,["direction"])}),128))],512)):gt("v-if",!0)],38)],46,["aria-expanded"]),[[Bu,r.visibility.modal]])]}),_:3},16,["onBeforeEnter","onAfterEnter","onBeforeLeave","onAfterLeave"])],38)),[[Bu,!n.ssr||r.visible]]):gt("v-if",!0)});function XB(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(!t||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}var ZB=` ->>>>>>>> origin/craft-4:src/web/assets/field/dist/assets/vizy-91fcee7d.js -.vfm--fixed[data-v-2836fdb5] { - position: fixed; -} -.vfm--absolute[data-v-2836fdb5] { - position: absolute; -} -.vfm--inset[data-v-2836fdb5] { - top: 0; - right: 0; - bottom: 0; - left: 0; -} -.vfm--overlay[data-v-2836fdb5] { - background-color: rgba(0, 0, 0, 0.5); -} -.vfm--prevent-none[data-v-2836fdb5] { - pointer-events: none; -} -.vfm--prevent-auto[data-v-2836fdb5] { - pointer-events: auto; -} -.vfm--outline-none[data-v-2836fdb5]:focus { - outline: none; -} -.vfm-enter-active[data-v-2836fdb5], -.vfm-leave-active[data-v-2836fdb5] { - transition: opacity 0.2s; -} -.vfm-enter-from[data-v-2836fdb5], -.vfm-leave-to[data-v-2836fdb5] { - opacity: 0; -} -.vfm--touch-none[data-v-2836fdb5] { - touch-action: none; -} -.vfm--select-none[data-v-2836fdb5] { - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.vfm--resize-tr[data-v-2836fdb5], -.vfm--resize-br[data-v-2836fdb5], -.vfm--resize-bl[data-v-2836fdb5], -.vfm--resize-tl[data-v-2836fdb5] { - width: 12px; - height: 12px; - z-index: 10; -} -.vfm--resize-t[data-v-2836fdb5] { - top: -6px; - left: 0; - width: 100%; - height: 12px; - cursor: ns-resize; -} -.vfm--resize-tr[data-v-2836fdb5] { - top: -6px; - right: -6px; - cursor: nesw-resize; -} -.vfm--resize-r[data-v-2836fdb5] { - top: 0; - right: -6px; - width: 12px; - height: 100%; - cursor: ew-resize; -} -.vfm--resize-br[data-v-2836fdb5] { - bottom: -6px; - right: -6px; - cursor: nwse-resize; -} -.vfm--resize-b[data-v-2836fdb5] { - bottom: -6px; - left: 0; - width: 100%; - height: 12px; - cursor: ns-resize; -} -.vfm--resize-bl[data-v-2836fdb5] { - bottom: -6px; - left: -6px; - cursor: nesw-resize; -} -.vfm--resize-l[data-v-2836fdb5] { - top: 0; - left: -6px; - width: 12px; - height: 100%; - cursor: ew-resize; -} -.vfm--resize-tl[data-v-2836fdb5] { - top: -6px; - left: -6px; - cursor: nwse-resize; -} -<<<<<<<< HEAD:src/web/assets/field/dist/assets/vizy-1d31d33d.js -`;JB(XB);Og.render=YB;Og.__scopeId="data-v-2836fdb5";Og.__file="lib/VueFinalModal.vue";var x_={props:{},methods:{slice:function(e){this.api.dynamicModals.splice(e,1)},beforeOpen:function(e,n,r){var i=this;return kB(function*(){e.ref.params.value=n.params,yield i.$nextTick(),yield i.$nextTick(),n.value||(i.slice(r),n.reject("show"))})()},isString:function(e){return typeof e=="string"}}},ZB={class:"modals-container"};function QB(t,e,n,r,i,o){return ge(),Et("div",ZB,[(ge(!0),Et(kt,null,Zt(t.api.dynamicModals,function(s,l){return ge(),Et(Qs(s.component),wi({key:s.id},s.bind,{modelValue:s.value,"onUpdate:modelValue":function(f){return s.value=f}},Ly(s.on),{on_closed:function(f){return o.slice(l)},on_beforeOpen:function(f){return o.beforeOpen(f,s)},on_opened:s.opened}),W1({_:2},[Zt(s.slots,function(u,f){return{name:f,fn:Vt(function(){return[_t(" eslint-disable vue/no-v-html "),o.isString(u)?(ge(),Et("div",{key:0,innerHTML:u},null,8,["innerHTML"])):(ge(),Et(Qs(u.component),wi({key:1},u.bind,Ly(u.on||{})),null,16))]})}})]),1040,["modelValue","onUpdate:modelValue","on_closed","on_beforeOpen","on_opened"])}),128))])}x_.render=QB;x_.__file="lib/ModalsContainer.vue";function e$(){var t=null;return{show:function(n){for(var r=this,i=arguments.length,o=new Array(i>1?i-1:0),s=1;s1?r-1:0),o=1;o1&&arguments[1]!==void 0?arguments[1]:{},r=TS===0?Mg:OM(),i=r.$vfm,o=r.VueFinalModal,s=r.ModalsContainer;TS+=1;var l=n.key||TM,u=n.componentName||EM,f=n.dynamicContainerName||AM;Object.defineProperty(e.config.globalProperties,l,{get:function(){return i}}),e.provide(l,i),e.component(u,o),e.component(f,s)},LM=function(e){return{install:function(r,i){var o=Object.assign({},e,i);MM(r,o)}}};LM.install=MM;const ES={$idFactory(t){return function(n=""){return`${this[t]}-${n}`}},$idRef(t){return`#${this.$id(t)}`}},AS={uidProperty:"uid",uidPrefix:"uid-"};function r$(t,e={}){const n=e.uidProperty||AS.uidProperty,r=e.uidPrefix||AS.uidPrefix;let i=0;t.mixin({beforeCreate(){i+=1;const s=r+i;Object.defineProperties(this,{[n]:{get(){return s}}})}});const o=t.version.slice(0,2)==="3."?t.config.globalProperties:t.prototype;o.$id=ES.$idFactory(n),o.$idRef=ES.$idRef}const i$=function(t){if(t!==void 0)return JSON.parse(JSON.stringify(t))};var o$=typeof global=="object"&&global&&global.Object===Object&&global;const NM=o$;var s$=typeof self=="object"&&self&&self.Object===Object&&self,a$=NM||s$||Function("return this")();const Ki=a$;var l$=Ki.Symbol;const na=l$;var IM=Object.prototype,u$=IM.hasOwnProperty,c$=IM.toString,Kc=na?na.toStringTag:void 0;function f$(t){var e=u$.call(t,Kc),n=t[Kc];try{t[Kc]=void 0;var r=!0}catch{}var i=c$.call(t);return r&&(e?t[Kc]=n:delete t[Kc]),i}var d$=Object.prototype,h$=d$.toString;function p$(t){return h$.call(t)}var m$="[object Null]",g$="[object Undefined]",OS=na?na.toStringTag:void 0;function rs(t){return t==null?t===void 0?g$:m$:OS&&OS in Object(t)?f$(t):p$(t)}function bo(t){return t!=null&&typeof t=="object"}var v$="[object Symbol]";function Lg(t){return typeof t=="symbol"||bo(t)&&rs(t)==v$}function PM(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n0){if(++e>=Z$)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function n9(t){return function(){return t}}var r9=function(){try{var t=Nl(Object,"defineProperty");return t({},"",{}),t}catch{}}();const dm=r9;var i9=dm?function(t,e){return dm(t,"toString",{configurable:!0,enumerable:!1,value:n9(e),writable:!0})}:S_;const o9=i9;var s9=t9(o9);const a9=s9;function l9(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o-1&&t%1==0&&t-1&&t%1==0&&t<=m9}function Il(t){return t!=null&&A_(t.length)&&!C_(t)}function $M(t,e,n){if(!gr(n))return!1;var r=typeof e;return(r=="number"?Il(n)&&T_(e,n.length):r=="string"&&e in n)?ac(n[e],t):!1}function HM(t){return BM(function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,s&&$M(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++r-1}function NH(t,e){var n=this.__data__,r=Dg(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function is(t){var e=-1,n=t==null?0:t.length;for(this.clear();++el))return!1;var f=o.get(t),d=o.get(e);if(f&&d)return f==e&&d==t;var m=-1,v=!0,y=n&zV?new mm:void 0;for(o.set(t,e),o.set(e,t);++m=e||q<0||m&&P>=o}function k(){var I=T0();if(x(I))return A(I);l=setTimeout(k,C(I))}function A(I){return l=void 0,v&&r?y(I):(r=i=void 0,s)}function N(){l!==void 0&&clearTimeout(l),f=0,r=u=i=l=void 0}function E(){return l===void 0?s:A(T0())}function H(){var I=T0(),q=x(I);if(r=arguments,i=this,u=I,q){if(l===void 0)return _(u);if(m)return clearTimeout(l),l=setTimeout(k,e),y(u)}return l===void 0&&(l=setTimeout(k,e)),s}return H.cancel=N,H.flush=E,H}function pb(t,e,n){(n!==void 0&&!ac(t[e],n)||n===void 0&&!(e in t))&&E_(t,e,n)}function Aj(t){return bo(t)&&Il(t)}function mb(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Oj(t){return zM(t,M_(t))}function Mj(t,e,n,r,i,o,s){var l=mb(t,n),u=mb(e,n),f=s.get(u);if(f){pb(t,n,f);return}var d=o?o(l,u,n+"",t,e,s):void 0,m=d===void 0;if(m){var v=Ur(u),y=!v&&ed(u),_=!v&&!y&&Ig(u);d=u,v||y||_?Ur(l)?d=l:Aj(l)?d=X$(l):y?(m=!1,d=cV(u,!0)):_?(m=!1,d=OV(u,!0)):d=[]:JM(u)||Qf(u)?(d=l,Qf(l)?d=Oj(l):(!gr(l)||C_(l))&&(d=MV(u))):m=!1}m&&(s.set(u,d),i(d,u,r,o,s),s.delete(u)),pb(t,n,d)}function y6(t,e,n,r,i){t!==e&&kj(e,function(o,s){if(i||(i=new go),gr(o))Mj(t,e,s,n,y6,r,i);else{var l=r?r(mb(t,s),o,s+"",t,e,i):void 0;l===void 0&&(l=o),pb(t,s,l)}},M_)}var Lj={"&":"&","<":"<",">":">",'"':""","'":"'"},Nj=ZM(Lj);const Ij=Nj;var b6=/[&<>"']/g,Pj=RegExp(b6.source);function Dj(t){return t=Od(t),t&&Pj.test(t)?t.replace(b6,Ij):t}function Rj(t){return function(e,n,r){var i=Object(e);if(!Il(e)){var o=v6(n);e=Pg(e),n=function(l){return o(i[l],l,i)}}var s=t(e,n,r);return s>-1?i[o?e[s]:s]:void 0}}var zj=Math.max;function Bj(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:M$(n);return i<0&&(i=zj(r+i,0)),l9(t,v6(e),i)}var $j=Rj(Bj);const gb=$j;var Hj="[object String]";function Fj(t){return typeof t=="string"||!Ur(t)&&bo(t)&&rs(t)==Hj}function Vj(t,e){return PM(e,function(n){return t[n]})}var jj="[object Map]",Wj="[object Set]",Uj=Object.prototype,qj=Uj.hasOwnProperty;function Mi(t){if(t==null)return!0;if(Il(t)&&(Ur(t)||typeof t=="string"||typeof t.splice=="function"||ed(t)||Ig(t)||Qf(t)))return!t.length;var e=hm(t);if(e==jj||e==Wj)return!t.size;if(Ng(t))return!O_(t).length;for(var n in t)if(qj.call(t,n))return!1;return!0}var Kj=nV(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()});const Gj=Kj;var Yj=HM(function(t,e,n){y6(t,e,n)});const Jj=Yj;var Xj=g6("length");const Zj=Xj;var _6="\\ud800-\\udfff",Qj="\\u0300-\\u036f",eW="\\ufe20-\\ufe2f",tW="\\u20d0-\\u20ff",nW=Qj+eW+tW,rW="\\ufe0e\\ufe0f",iW="["+_6+"]",vb="["+nW+"]",yb="\\ud83c[\\udffb-\\udfff]",oW="(?:"+vb+"|"+yb+")",w6="[^"+_6+"]",k6="(?:\\ud83c[\\udde6-\\uddff]){2}",x6="[\\ud800-\\udbff][\\udc00-\\udfff]",sW="\\u200d",S6=oW+"?",C6="["+rW+"]?",aW="(?:"+sW+"(?:"+[w6,k6,x6].join("|")+")"+C6+S6+")*",lW=C6+S6+aW,uW="(?:"+[w6+vb+"?",vb,k6,x6,iW].join("|")+")",aC=RegExp(yb+"(?="+yb+")|"+uW+lW,"g");function cW(t){for(var e=aC.lastIndex=0;aC.test(t);)++e;return e}function fW(t){return hF(t)?cW(t):Zj(t)}var dW="[object Map]",hW="[object Set]";function P_(t){if(t==null)return 0;if(Il(t))return Fj(t)?fW(t):t.length;var e=hm(t);return e==dW||e==hW?t.size:O_(t).length}var T6=Object.prototype,pW=T6.hasOwnProperty;function lC(t,e,n,r){return t===void 0||ac(t,T6[n])&&!pW.call(r,n)?e:t}var mW={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function gW(t){return"\\"+mW[t]}var vW=/<%=([\s\S]+?)%>/g;const E6=vW;var yW=/<%-([\s\S]+?)%>/g;const bW=yW;var _W=/<%([\s\S]+?)%>/g;const wW=_W;var kW={escape:bW,evaluate:wW,interpolate:E6,variable:"",imports:{_:{escape:Dj}}};const uC=kW;var xW="Invalid `variable` option passed into `_.template`",SW=/\b__p \+= '';/g,CW=/\b(__p \+=) '' \+/g,TW=/(__e\(.*?\)|\b__t\)) \+\n'';/g,EW=/[()=,{}\[\]\/\s]/,AW=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Wh=/($^)/,OW=/['\n\r\u2028\u2029\\]/g,MW=Object.prototype,cC=MW.hasOwnProperty;function LW(t,e,n){var r=uC.imports._.templateSettings||uC;n&&$M(t,e,n)&&(e=void 0),t=Od(t),e=VS({},e,r,lC);var i=VS({},e.imports,r.imports,lC),o=Pg(i),s=Vj(i,o),l,u,f=0,d=e.interpolate||Wh,m="__p += '",v=RegExp((e.escape||Wh).source+"|"+d.source+"|"+(d===E6?AW:Wh).source+"|"+(e.evaluate||Wh).source+"|$","g"),y=cC.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+` -`:"";t.replace(v,function(x,k,A,N,E,H){return A||(A=N),m+=t.slice(f,H).replace(OW,gW),k&&(l=!0,m+=`' + -======== -`;XB(ZB);Mg.render=JB;Mg.__scopeId="data-v-2836fdb5";Mg.__file="lib/VueFinalModal.vue";var x_={props:{},methods:{slice:function(e){this.api.dynamicModals.splice(e,1)},beforeOpen:function(e,n,r){var i=this;return xB(function*(){e.ref.params.value=n.params,yield i.$nextTick(),yield i.$nextTick(),n.value||(i.slice(r),n.reject("show"))})()},isString:function(e){return typeof e=="string"}}},QB={class:"modals-container"};function e$(t,e,n,r,i,o){return ge(),Ct("div",QB,[(ge(!0),Ct(kt,null,Zt(t.api.dynamicModals,function(s,l){return ge(),Ct(Qs(s.component),wi({key:s.id},s.bind,{modelValue:s.value,"onUpdate:modelValue":function(f){return s.value=f}},L0(s.on),{on_closed:function(f){return o.slice(l)},on_beforeOpen:function(f){return o.beforeOpen(f,s)},on_opened:s.opened}),W1({_:2},[Zt(s.slots,function(u,f){return{name:f,fn:Vt(function(){return[gt(" eslint-disable vue/no-v-html "),o.isString(u)?(ge(),Ct("div",{key:0,innerHTML:u},null,8,["innerHTML"])):(ge(),Ct(Qs(u.component),wi({key:1},u.bind,L0(u.on||{})),null,16))]})}})]),1040,["modelValue","onUpdate:modelValue","on_closed","on_beforeOpen","on_opened"])}),128))])}x_.render=e$;x_.__file="lib/ModalsContainer.vue";function t$(){var t=null;return{show:function(n){for(var r=this,i=arguments.length,o=new Array(i>1?i-1:0),s=1;s1?r-1:0),o=1;o1&&arguments[1]!==void 0?arguments[1]:{},r=T2===0?Ng:O3(),i=r.$vfm,o=r.VueFinalModal,s=r.ModalsContainer;T2+=1;var l=n.key||T3,u=n.componentName||E3,f=n.dynamicContainerName||A3;Object.defineProperty(e.config.globalProperties,l,{get:function(){return i}}),e.provide(l,i),e.component(u,o),e.component(f,s)},N3=function(e){return{install:function(r,i){var o=Object.assign({},e,i);M3(r,o)}}};N3.install=M3;const E2={$idFactory(t){return function(n=""){return`${this[t]}-${n}`}},$idRef(t){return`#${this.$id(t)}`}},A2={uidProperty:"uid",uidPrefix:"uid-"};function i$(t,e={}){const n=e.uidProperty||A2.uidProperty,r=e.uidPrefix||A2.uidPrefix;let i=0;t.mixin({beforeCreate(){i+=1;const s=r+i;Object.defineProperties(this,{[n]:{get(){return s}}})}});const o=t.version.slice(0,2)==="3."?t.config.globalProperties:t.prototype;o.$id=E2.$idFactory(n),o.$idRef=E2.$idRef}const o$=function(t){if(t!==void 0)return JSON.parse(JSON.stringify(t))};var s$=typeof global=="object"&&global&&global.Object===Object&&global;const L3=s$;var a$=typeof self=="object"&&self&&self.Object===Object&&self,l$=L3||a$||Function("return this")();const Ki=l$;var u$=Ki.Symbol;const na=u$;var I3=Object.prototype,c$=I3.hasOwnProperty,f$=I3.toString,Kc=na?na.toStringTag:void 0;function d$(t){var e=c$.call(t,Kc),n=t[Kc];try{t[Kc]=void 0;var r=!0}catch{}var i=f$.call(t);return r&&(e?t[Kc]=n:delete t[Kc]),i}var h$=Object.prototype,p$=h$.toString;function m$(t){return p$.call(t)}var g$="[object Null]",v$="[object Undefined]",O2=na?na.toStringTag:void 0;function rs(t){return t==null?t===void 0?v$:g$:O2&&O2 in Object(t)?d$(t):m$(t)}function bo(t){return t!=null&&typeof t=="object"}var y$="[object Symbol]";function Lg(t){return typeof t=="symbol"||bo(t)&&rs(t)==y$}function P3(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n0){if(++e>=Q$)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function rH(t){return function(){return t}}var iH=function(){try{var t=Ll(Object,"defineProperty");return t({},"",{}),t}catch{}}();const hm=iH;var oH=hm?function(t,e){return hm(t,"toString",{configurable:!0,enumerable:!1,value:rH(e),writable:!0})}:S_;const sH=oH;var aH=nH(sH);const lH=aH;function uH(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o-1&&t%1==0&&t-1&&t%1==0&&t<=gH}function Il(t){return t!=null&&A_(t.length)&&!C_(t)}function $3(t,e,n){if(!vr(n))return!1;var r=typeof e;return(r=="number"?Il(n)&&T_(e,n.length):r=="string"&&e in n)?ac(n[e],t):!1}function H3(t){return B3(function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,s&&$3(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++r-1}function I9(t,e){var n=this.__data__,r=Rg(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function is(t){var e=-1,n=t==null?0:t.length;for(this.clear();++el))return!1;var f=o.get(t),d=o.get(e);if(f&&d)return f==e&&d==t;var m=-1,v=!0,y=n&BV?new gm:void 0;for(o.set(t,e),o.set(e,t);++m=e||q<0||m&&P>=o}function k(){var I=Ey();if(x(I))return A(I);l=setTimeout(k,C(I))}function A(I){return l=void 0,v&&r?y(I):(r=i=void 0,s)}function L(){l!==void 0&&clearTimeout(l),f=0,r=u=i=l=void 0}function E(){return l===void 0?s:A(Ey())}function H(){var I=Ey(),q=x(I);if(r=arguments,i=this,u=I,q){if(l===void 0)return _(u);if(m)return clearTimeout(l),l=setTimeout(k,e),y(u)}return l===void 0&&(l=setTimeout(k,e)),s}return H.cancel=L,H.flush=E,H}function pb(t,e,n){(n!==void 0&&!ac(t[e],n)||n===void 0&&!(e in t))&&E_(t,e,n)}function Aj(t){return bo(t)&&Il(t)}function mb(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Oj(t){return z3(t,M_(t))}function Mj(t,e,n,r,i,o,s){var l=mb(t,n),u=mb(e,n),f=s.get(u);if(f){pb(t,n,f);return}var d=o?o(l,u,n+"",t,e,s):void 0,m=d===void 0;if(m){var v=Ur(u),y=!v&&td(u),_=!v&&!y&&Pg(u);d=u,v||y||_?Ur(l)?d=l:Aj(l)?d=Z$(l):y?(m=!1,d=fV(u,!0)):_?(m=!1,d=MV(u,!0)):d=[]:J3(u)||ed(u)?(d=l,ed(l)?d=Oj(l):(!vr(l)||C_(l))&&(d=NV(u))):m=!1}m&&(s.set(u,d),i(d,u,r,o,s),s.delete(u)),pb(t,n,d)}function b6(t,e,n,r,i){t!==e&&xj(e,function(o,s){if(i||(i=new go),vr(o))Mj(t,e,s,n,b6,r,i);else{var l=r?r(mb(t,s),o,s+"",t,e,i):void 0;l===void 0&&(l=o),pb(t,s,l)}},M_)}var Nj={"&":"&","<":"<",">":">",'"':""","'":"'"},Lj=Z3(Nj);const Ij=Lj;var _6=/[&<>"']/g,Pj=RegExp(_6.source);function Dj(t){return t=Md(t),t&&Pj.test(t)?t.replace(_6,Ij):t}function Rj(t){return function(e,n,r){var i=Object(e);if(!Il(e)){var o=v6(n);e=Dg(e),n=function(l){return o(i[l],l,i)}}var s=t(e,n,r);return s>-1?i[o?e[s]:s]:void 0}}var zj=Math.max;function Bj(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:N$(n);return i<0&&(i=zj(r+i,0)),uH(t,v6(e),i)}var $j=Rj(Bj);const gb=$j;var Hj="[object String]";function Fj(t){return typeof t=="string"||!Ur(t)&&bo(t)&&rs(t)==Hj}function Vj(t,e){return P3(e,function(n){return t[n]})}var jj="[object Map]",Wj="[object Set]",Uj=Object.prototype,qj=Uj.hasOwnProperty;function Mi(t){if(t==null)return!0;if(Il(t)&&(Ur(t)||typeof t=="string"||typeof t.splice=="function"||td(t)||Pg(t)||ed(t)))return!t.length;var e=pm(t);if(e==jj||e==Wj)return!t.size;if(Ig(t))return!O_(t).length;for(var n in t)if(qj.call(t,n))return!1;return!0}var Kj=rV(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()});const Gj=Kj;var Yj=H3(function(t,e,n){b6(t,e,n)});const Jj=Yj;var Xj=g6("length");const Zj=Xj;var w6="\\ud800-\\udfff",Qj="\\u0300-\\u036f",eW="\\ufe20-\\ufe2f",tW="\\u20d0-\\u20ff",nW=Qj+eW+tW,rW="\\ufe0e\\ufe0f",iW="["+w6+"]",vb="["+nW+"]",yb="\\ud83c[\\udffb-\\udfff]",oW="(?:"+vb+"|"+yb+")",k6="[^"+w6+"]",x6="(?:\\ud83c[\\udde6-\\uddff]){2}",S6="[\\ud800-\\udbff][\\udc00-\\udfff]",sW="\\u200d",C6=oW+"?",T6="["+rW+"]?",aW="(?:"+sW+"(?:"+[k6,x6,S6].join("|")+")"+T6+C6+")*",lW=T6+C6+aW,uW="(?:"+[k6+vb+"?",vb,x6,S6,iW].join("|")+")",aC=RegExp(yb+"(?="+yb+")|"+uW+lW,"g");function cW(t){for(var e=aC.lastIndex=0;aC.test(t);)++e;return e}function fW(t){return pF(t)?cW(t):Zj(t)}var dW="[object Map]",hW="[object Set]";function P_(t){if(t==null)return 0;if(Il(t))return Fj(t)?fW(t):t.length;var e=pm(t);return e==dW||e==hW?t.size:O_(t).length}var E6=Object.prototype,pW=E6.hasOwnProperty;function lC(t,e,n,r){return t===void 0||ac(t,E6[n])&&!pW.call(r,n)?e:t}var mW={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function gW(t){return"\\"+mW[t]}var vW=/<%=([\s\S]+?)%>/g;const A6=vW;var yW=/<%-([\s\S]+?)%>/g;const bW=yW;var _W=/<%([\s\S]+?)%>/g;const wW=_W;var kW={escape:bW,evaluate:wW,interpolate:A6,variable:"",imports:{_:{escape:Dj}}};const uC=kW;var xW="Invalid `variable` option passed into `_.template`",SW=/\b__p \+= '';/g,CW=/\b(__p \+=) '' \+/g,TW=/(__e\(.*?\)|\b__t\)) \+\n'';/g,EW=/[()=,{}\[\]\/\s]/,AW=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Uh=/($^)/,OW=/['\n\r\u2028\u2029\\]/g,MW=Object.prototype,cC=MW.hasOwnProperty;function NW(t,e,n){var r=uC.imports._.templateSettings||uC;n&&$3(t,e,n)&&(e=void 0),t=Md(t),e=V2({},e,r,lC);var i=V2({},e.imports,r.imports,lC),o=Dg(i),s=Vj(i,o),l,u,f=0,d=e.interpolate||Uh,m="__p += '",v=RegExp((e.escape||Uh).source+"|"+d.source+"|"+(d===A6?AW:Uh).source+"|"+(e.evaluate||Uh).source+"|$","g"),y=cC.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+` -`:"";t.replace(v,function(x,k,A,L,E,H){return A||(A=L),m+=t.slice(f,H).replace(OW,gW),k&&(l=!0,m+=`' + ->>>>>>>> origin/craft-4:src/web/assets/field/dist/assets/vizy-91fcee7d.js -__e(`+k+`) + -'`),E&&(u=!0,m+=`'; -`+E+`; -__p += '`),A&&(m+=`' + -((__t = (`+A+`)) == null ? '' : __t) + -'`),f=H+x.length,x}),m+=`'; -`;var _=cC.call(e,"variable")&&e.variable;if(!_)m=`with (obj) { -`+m+` -} -`;else if(EW.test(_))throw new Error(xW);m=(u?m.replace(SW,""):m).replace(CW,"$1").replace(TW,"$1;"),m="function("+(_||"obj")+`) { -`+(_?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(l?", __e = _.escape":"")+(u?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+m+`return __p -<<<<<<<< HEAD:src/web/assets/field/dist/assets/vizy-1d31d33d.js -}`;var C=iF(function(){return Function(o,y+"return "+m).apply(void 0,s)});if(C.source=m,XM(C))throw C;return C}const NW=function(t,e,n){return typeof Craft.translations[t]<"u"&&typeof Craft.translations[t][e]<"u"&&(e=Craft.translations[t][e]),n?LW(e,{interpolate:/{([\s\S]+?)}/g})(n):e},A6=t=>{const e=Q1({delimiters:["${","}"],...t});return e.config.unwrapInjectedRef=!0,e.use(LM),e.use(r$),e.use(wB,{themes:{"vui-tooltip":{$extend:"tooltip",delay:{show:0,hide:0}}}}),e.config.globalProperties.t=NW,e.config.globalProperties.clone=i$,e.config.globalProperties.$events=t7(),e.config.globalProperties.$isDebug=!1,e};function Xn(t){this.content=t}Xn.prototype={constructor:Xn,find:function(t){for(var e=0;e>1}};Xn.from=function(t){if(t instanceof Xn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Xn(e)};function O6(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=O6(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function M6(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),l=e.child(--o),u=s.nodeSize;if(s==l){n-=u,r-=u;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let f=0,d=Math.min(s.text.length,l.text.length);for(;fe&&r(u,i+l,o||null,s)!==!1&&u.content.size){let d=l+1;u.nodesBetween(Math.max(0,e-d),Math.min(u.content.size,n-d),r,i+d)}l=f}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(l,u)=>{l.isText?(o+=l.text.slice(Math.max(e,u)-u,n-u),s=!r):l.isLeaf?(i?o+=typeof i=="function"?i(l):i:l.type.spec.leafText&&(o+=l.type.spec.leafText(l)),s=!r):!s&&l.isBlock&&(o+=r,s=!0)},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);oe)for(let o=0,s=0;se&&((sn)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,n-s-1))),r.push(l),i+=l.nodeSize),s=u}return new Oe(r,i)}cutByIndex(e,n){return e==n?Oe.empty:e==0&&n==this.content.length?this:new Oe(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new Oe(i,o)}addToStart(e){return new Oe([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Oe(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?Uh(r+1,s):Uh(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return Oe.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Oe(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Oe.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}};Jt.none=[];class vm extends Error{}class He{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=N6(this.content,e+this.openStart,n);return r&&new He(r,this.openStart,this.openEnd)}removeBetween(e,n){return new He(L6(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return He.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new He(Oe.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new He(e,r,i)}}He.empty=new He(Oe.empty,0,0);function L6(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(i==e||o.isText){if(l!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(L6(o.content,e-i-1,n-i-1)))}function N6(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let l=N6(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function IW(t,e,n){if(n.openStart>t.depth)throw new vm("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new vm("Inconsistent open depths");return I6(t,e,n,0)}function I6(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function _f(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(rl(t.nodeAfter,r),o++));for(let l=o;li&&_b(t,e,i+1),s=r.depth>i&&_b(n,r,i+1),l=[];return _f(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(P6(o,s),rl(il(o,D6(t,e,n,r,i+1)),l)):(o&&rl(il(o,ym(t,e,i+1)),l),_f(e,n,i,l),s&&rl(il(s,ym(n,r,i+1)),l)),_f(r,null,i,l),new Oe(l)}function ym(t,e,n){let r=[];if(_f(null,t,n,r),t.depth>n){let i=_b(t,e,n+1);rl(il(i,ym(t,e,n+1)),r)}return _f(e,null,n,r),new Oe(r)}function PW(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(Oe.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class rd{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new bm(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:l,offset:u}=s.content.findIndex(o),f=o-u;if(r.push(s,l,i+u),!f||(s=s.child(l),s.isText))break;o=f-1,i+=u+1}return new rd(n,r,o)}static resolveCached(e,n){for(let i=0;ie&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),R6(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=Oe.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let u=i;un.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=Oe.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,i,r)}};Wo.prototype.text=void 0;class _m extends Wo{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):R6(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new _m(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new _m(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function R6(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class vl{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new zW(e,n);if(r.next==null)return vl.empty;let i=z6(r);r.next&&r.err("Unexpected trailing text");let o=WW(jW(i));return UW(o,r),o}matchType(e){for(let n=0;nf.createAndFill()));for(let f=0;f=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` -`)}}vl.empty=new vl(!0);class zW{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function z6(t){let e=[];do e.push(BW(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function BW(t){let e=[];do e.push($W(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function $W(t){let e=VW(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=HW(t,e);else break;return e}function fC(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function HW(t,e){let n=fC(t),r=n;return t.eat(",")&&(t.next!="}"?r=fC(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function FW(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function VW(t){if(t.eat("(")){let e=z6(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=FW(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function jW(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,u){let f={term:u,to:l};return e[s].push(f),f}function i(s,l){s.forEach(u=>u.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((u,f)=>u.concat(o(f,l)),[]);if(s.type=="seq")for(let u=0;;u++){let f=o(s.exprs[u],l);if(u==s.exprs.length-1)return f;i(f,l=n())}else if(s.type=="star"){let u=n();return r(l,u),i(o(s.expr,u),u),[r(u)]}else if(s.type=="plus"){let u=n();return i(o(s.expr,l),u),i(o(s.expr,u),u),[r(u)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let u=l;for(let f=0;f{t[s].forEach(({term:l,to:u})=>{if(!l)return;let f;for(let d=0;d{f||i.push([l,f=[]]),f.indexOf(d)==-1&&f.push(d)})})});let o=e[r.join(",")]=new vl(r.indexOf(t.length-1)>-1);for(let s=0;s-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[o]=new V6(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class qW{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Bg{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=F6(i.attrs),this.excluded=null;let o=$6(this.attrs);this.instance=o?new Jt(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Jt(this,H6(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new Bg(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n-1}}class KW{constructor(e){this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Xn.from(e.nodes),n.marks=Xn.from(e.marks||{}),this.nodes=hC.compile(this.spec.nodes,this),this.marks=Bg.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",l=o.spec.marks;o.contentMatch=r[s]||(r[s]=vl.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=l=="_"?null:l?pC(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:pC(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof hC){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new _m(r,r.defaultAttrs,e,Jt.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Wo.fromJSON(this,e)}markFromJSON(e){return Jt.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function pC(t,e){let n=[];for(let r=0;r-1)&&n.push(s=u)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}let $g=class kb{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new gC(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new gC(this,n,!0);return r.addAll(e,n.from,n.to),He.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(s.getAttrs){let u=s.getAttrs(n);if(u===!1)continue;s.attrs=u||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=vC(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=vC(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new kb(e,kb.schemaRules(e)))}};const j6={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},GW={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},W6={ol:!0,ul:!0},wm=1,km=2,wf=4;function mC(t,e,n){return e!=null?(e?wm:0)|(e==="full"?km:0):t&&t.whitespace=="pre"?wm|km:n&~wf}class qh{constructor(e,n,r,i,o,s,l){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=l,this.content=[],this.activeMarks=Jt.none,this.stashMarks=[],this.match=s||(l&wf?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Oe.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&wm)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=Oe.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(Oe.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;n{s.clearMark(l)&&(r=l.addToSet(r))}):n=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(n),s.consuming===!1)o=s;else break}return[n,r]}addElementByRule(e,n,r){let i,o,s;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(e):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(u=>this.insertNode(u));else{let u=e;typeof n.contentElement=="string"?u=e.querySelector(n.contentElement):typeof n.contentElement=="function"?u=n.contentElement(e):n.contentElement&&(u=n.contentElement),this.findAround(e,u,!0),this.addAll(u)}i&&this.sync(l)&&this.open--,s&&this.removePendingMark(s,l)}addAll(e,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=o,!s.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;ithis.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,u)=>{for(;l>=0;l--){let f=n[l];if(f==""){if(l==n.length-1||l==0)continue;for(;u>=o;u--)if(s(l-1,u))return!0;return!1}else{let d=u>0||u==0&&i?this.nodes[u].type:r&&u>=o?r.node(u-o).type:null;if(!d||d.name!=f&&d.groups.indexOf(f)==-1)return!1;u--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let n=QW(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==n)break}}}function YW(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&W6.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function JW(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function XW(t){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=e.exec(t);)r.push(n[1],n[2].trim());return r}function vC(t){let e={};for(let n in t)e[n]=t[n];return e}function ZW(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=l=>{o.push(l);for(let u=0;u{if(o.length||s.marks.length){let l=0,u=0;for(;l=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&co.renderSpec(M0(r),i(e,n))}static renderSpec(e,n,r=null){if(typeof n=="string")return{dom:e.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let s,l=r?e.createElementNS(r,i):e.createElement(i),u=n[1],f=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){f=2;for(let d in u)if(u[d]!=null){let m=d.indexOf(" ");m>0?l.setAttributeNS(d.slice(0,m),d.slice(m+1),u[d]):l.setAttribute(d,u[d])}}for(let d=f;df)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:v,contentDOM:y}=co.renderSpec(e,m,r);if(l.appendChild(v),y){if(s)throw new RangeError("Multiple content holes");s=y}}}return{dom:l,contentDOM:s}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new co(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=yC(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return yC(e.marks)}}function yC(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function M0(t){return t.document||window.document}const U6=65535,q6=Math.pow(2,16);function eU(t,e){return t+e*q6}function bC(t){return t&U6}function tU(t){return(t-(t&U6))/q6}const K6=1,G6=2,Tp=4,Y6=8;class xb{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Y6)>0}get deletedBefore(){return(this.delInfo&(K6|Tp))>0}get deletedAfter(){return(this.delInfo&(G6|Tp))>0}get deletedAcross(){return(this.delInfo&Tp)>0}}class mi{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&mi.empty)return mi.empty}recover(e){let n=0,r=bC(e);if(!this.inverted)for(let i=0;ie)break;let f=this.ranges[l+o],d=this.ranges[l+s],m=u+f;if(e<=m){let v=f?e==u?-1:e==m?1:n:n,y=u+i+(v<0?0:d);if(r)return y;let _=e==(n<0?u:m)?null:eU(l/3,e-u),C=e==u?G6:e==m?K6:Tp;return(n<0?e!=u:e!=m)&&(C|=Y6),new xb(y,C,_)}i+=d-f}return r?e+i:new xb(e+i,0,null)}touches(e,n){let r=0,i=bC(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;le)break;let f=this.ranges[l+o],d=u+f;if(e<=d&&l==i*3)return!0;r+=this.ranges[l+s]-f}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new Ou;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ro&&u!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return $n.fromReplace(e,this.from,this.to,o)}invert(){return new fo(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Us(n.pos,r.pos,this.mark)}merge(e){return e instanceof Us&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Us(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Us(n.from,n.to,e.markFromJSON(n.mark))}}qr.jsonID("addMark",Us);class fo extends qr{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new He(D_(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return $n.fromReplace(e,this.from,this.to,r)}invert(){return new Us(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new fo(n.pos,r.pos,this.mark)}merge(e){return e instanceof fo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new fo(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new fo(n.from,n.to,e.markFromJSON(n.mark))}}qr.jsonID("removeMark",fo);class qs extends qr{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return $n.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return $n.fromReplace(e,this.pos,this.pos+1,new He(Oe.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new Un(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Un(n.from,n.to,n.gapFrom,n.gapTo,He.fromJSON(e,n.slice),n.insert,!!n.structure)}}qr.jsonID("replaceAround",Un);function Sb(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function nU(t,e,n,r){let i=[],o=[],s,l;t.doc.nodesBetween(e,n,(u,f,d)=>{if(!u.isInline)return;let m=u.marks;if(!r.isInSet(m)&&d.type.allowsMarkType(r.type)){let v=Math.max(f,e),y=Math.min(f+u.nodeSize,n),_=r.addToSet(m);for(let C=0;Ct.step(u)),o.forEach(u=>t.step(u))}function rU(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,l)=>{if(!s.isInline)return;o++;let u=null;if(r instanceof Bg){let f=s.marks,d;for(;d=r.isInSet(f);)(u||(u=[])).push(d),f=d.removeFromSet(f)}else r?r.isInSet(s.marks)&&(u=[r]):u=s.marks;if(u&&u.length){let f=Math.min(l+s.nodeSize,n);for(let d=0;dt.step(new fo(s.from,s.to,s.style)))}function iU(t,e,n,r=n.contentMatch){let i=t.doc.nodeAt(e),o=[],s=e+1;for(let l=0;l=0;l--)t.step(o[l])}function oU(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function lc(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(rn;_--)C||r.index(_)>0?(C=!0,d=Oe.from(r.node(_).copy(d)),m++):u--;let v=Oe.empty,y=0;for(let _=o,C=!1;_>n;_--)C||i.after(_+1)=0;s--){if(r.size){let l=n[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Oe.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Un(i,o,i,o,new He(r,0,0),n.length,!0))}function cU(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,l)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&fU(t.doc,t.mapping.slice(o).map(l),r)){t.clearIncompatible(t.mapping.slice(o).map(l,1),r);let u=t.mapping.slice(o),f=u.map(l,1),d=u.map(l+s.nodeSize,1);return t.step(new Un(f,d,f+1,d-1,new He(Oe.from(r.create(i,null,s.marks)),0,0),1,!0)),!1}})}function fU(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function dU(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Un(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new He(Oe.from(s),0,0),1,!0))}function Mu(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let f=i.depth-1,d=n-2;f>o;f--,d--){let m=i.node(f),v=i.index(f);if(m.type.spec.isolating)return!1;let y=m.content.cutByIndex(v,m.childCount),_=r&&r[d]||m;if(_!=m&&(y=y.replaceChild(0,_.type.create(_.attrs))),!m.canReplace(v+1,m.childCount)||!_.type.validContent(y))return!1}let l=i.indexAfter(o),u=r&&r[0];return i.node(o).canReplaceWith(l,l,u?u.type:i.node(o+1).type)}function hU(t,e,n=1,r){let i=t.doc.resolve(e),o=Oe.empty,s=Oe.empty;for(let l=i.depth,u=i.depth-n,f=n-1;l>u;l--,f--){o=Oe.from(i.node(l).copy(o));let d=r&&r[f];s=Oe.from(d?d.type.create(d.attrs,s):i.node(l).copy(s))}t.step(new tr(e,e,new He(o.append(s),n,n),!0))}function pa(t,e){let n=t.resolve(e),r=n.index();return J6(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function J6(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function Hg(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,l=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),l++,s=r.node(i).maybeChild(l)):(o=r.node(i).maybeChild(l-1),s=r.node(i+1)),o&&!o.isTextblock&&J6(o,s)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function pU(t,e,n){let r=new tr(e-n,e+n,He.empty,!0);t.step(r)}function mU(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,u=r.index(s)+(l>0?1:0),f=r.node(s),d=!1;if(o==1)d=f.canReplace(u,u,i);else{let m=f.contentMatchAt(u).findWrapping(i.firstChild.type);d=m&&f.canReplaceWith(u,u,m[0])}if(d)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function Fg(t,e,n=e,r=He.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return Z6(i,o,r)?new tr(e,n,r):new gU(i,o,r).fit()}function Z6(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class gU{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=Oe.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=Oe.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let f=this.findFittable();f?this.placeNodes(f):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let u=new He(o,s,l);return e>-1?new Un(r.pos,e,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new tr(r.pos,i.pos,u):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=N0(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:u,match:f}=this.frontier[l],d,m=null;if(n==1&&(s?f.matchType(s.type)||(m=f.fillBefore(Oe.from(s),!1)):o&&u.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:m};if(n==2&&s&&(d=f.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:d};if(o&&f.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=N0(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new He(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=N0(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new He(tf(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new He(tf(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let C=0;C1||u==0||C.content.size)&&(m=x,d.push(Q6(C.mark(v.allowedMarks(C.marks)),f==1?u:0,f==l.childCount?y:-1)))}let _=f==l.childCount;_||(y=-1),this.placed=nf(this.placed,n,Oe.from(d)),this.frontier[n].match=m,_&&y<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let C=0,x=l;C1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n=0;l--){let{match:u,type:f}=this.frontier[l],d=I0(e,l,f,u,!0);if(!d||d.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=nf(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=nf(this.placed,this.depth,Oe.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(Oe.empty,!0);n.childCount&&(this.placed=nf(this.placed,this.frontier.length,n))}}function tf(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(tf(t.firstChild.content,e-1,n)))}function nf(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(nf(t.lastChild.content,e-1,n)))}function N0(t,e){for(let n=0;n1&&(r=r.replaceChild(0,Q6(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(Oe.empty,!0)))),t.copy(r)}function I0(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!vU(n,o.content,s)?l:null}function vU(t,e,n){for(let r=n;r0;v--,y--){let _=i.node(v).type.spec;if(_.defining||_.definingAsContext||_.isolating)break;s.indexOf(v)>-1?l=v:i.before(v)==y&&s.splice(1,0,-v)}let u=s.indexOf(l),f=[],d=r.openStart;for(let v=r.content,y=0;;y++){let _=v.firstChild;if(f.push(_),y==r.openStart)break;v=_.content}for(let v=d-1;v>=0;v--){let y=f[v].type,_=yU(y);if(_&&i.node(u).type!=y)d=v;else if(_||!y.isTextblock)break}for(let v=r.openStart;v>=0;v--){let y=(v+d+1)%(r.openStart+1),_=f[y];if(_)for(let C=0;C=0&&(t.replace(e,n,r),!(t.steps.length>m));v--){let y=s[v];y<0||(e=i.before(y),n=o.after(y))}}function e4(t,e,n,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(Oe.empty,!0))}return t}function _U(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=mU(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new He(Oe.from(r),0,0))}function wU(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=t4(r,i);for(let s=0;s0&&(u||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return t.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function t4(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(oe.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}class Lu extends qr{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return $n.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return $n.fromReplace(e,this.pos,this.pos+1,new He(Oe.from(i),0,n.isLeaf?0:1))}getMap(){return mi.empty}invert(e){return new Lu(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Lu(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Lu(n.pos,n.attr,n.value)}}qr.jsonID("attr",Lu);let Ku=class extends Error{};Ku=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Ku.prototype=Object.create(Error.prototype);Ku.prototype.constructor=Ku;Ku.prototype.name="TransformError";class z_{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ou}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Ku(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=He.empty){let i=Fg(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new He(Oe.from(r),0,0))}delete(e,n){return this.replace(e,n,He.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return bU(this,e,n,r),this}replaceRangeWith(e,n,r){return _U(this,e,n,r),this}deleteRange(e,n){return wU(this,e,n),this}lift(e,n){return sU(this,e,n),this}join(e,n=1){return pU(this,e,n),this}wrap(e,n){return uU(this,e,n),this}setBlockType(e,n=e,r,i=null){return cU(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return dU(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Lu(e,n,r)),this}addNodeMark(e,n){return this.step(new qs(e,n)),this}removeNodeMark(e,n){if(!(n instanceof Jt)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new qu(e,n)),this}split(e,n=1,r){return hU(this,e,n,r),this}addMark(e,n,r){return nU(this,e,n,r),this}removeMark(e,n,r){return rU(this,e,n,r),this}clearIncompatible(e,n,r){return iU(this,e,n,r),this}}const P0=Object.create(null);class ht{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new n4(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n=0;o--){let s=n<0?lu(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):lu(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Hi(e.node(0))}static atStart(e){return lu(e,e,0,0,1)||new Hi(e)}static atEnd(e){return lu(e,e,e.content.size,e.childCount,-1)||new Hi(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=P0[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in P0)throw new RangeError("Duplicate use of selection JSON ID "+e);return P0[e]=n,n.prototype.jsonID=e,n}getBookmark(){return st.between(this.$anchor,this.$head).getBookmark()}}ht.prototype.visible=!0;class n4{constructor(e,n){this.$from=e,this.$to=n}}let wC=!1;function kC(t){!wC&&!t.parent.inlineContent&&(wC=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class st extends ht{constructor(e,n=e){kC(e),kC(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ht.near(r);let i=e.resolve(n.map(this.anchor));return new st(i.parent.inlineContent?i:r,r)}replace(e,n=He.empty){if(super.replace(e,n),n==He.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof st&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Vg(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new st(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=ht.findFrom(n,r,!0)||ht.findFrom(n,-r,!0);if(o)n=o.$head;else return ht.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(ht.findFrom(e,-r,!0)||ht.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&it.isSelectable(l))return it.create(t,n-(i<0?l.nodeSize:0))}else{let u=lu(t,l,n+i,i<0?l.childCount:0,i,o);if(u)return u}n+=l.nodeSize*i}return null}function xC(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=d)}),t.setSelection(ht.near(t.doc.resolve(s),n))}const SC=1,Kh=2,CC=4;class xU extends z_{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Kh,this}ensureMarks(e){return Jt.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Kh)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Kh,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Jt.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(ht.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=CC,this}get scrolledIntoView(){return(this.updated&CC)>0}}function TC(t,e){return!e||!t?t:t.bind(e)}class rf{constructor(e,n,r){this.name=e,this.init=TC(n.init,r),this.apply=TC(n.apply,r)}}const SU=[new rf("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new rf("selection",{init(t,e){return t.selection||ht.atStart(e.doc)},apply(t){return t.selection}}),new rf("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new rf("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class D0{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=SU.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new rf(r.key,r.spec.state,r))})}}class du{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new D0(e.schema,e.plugins),o=new du(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Wo.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=ht.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let u=r[l],f=u.spec.state;if(u.key==s.name&&f&&f.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){o[s.name]=f.fromJSON.call(u,e,n[l],o);return}}o[s.name]=s.init(e,o)}}),o}}function r4(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=r4(i,e,{})),n[r]=i}return n}class on{constructor(e){this.spec=e,this.props={},e.props&&r4(e.props,this,this.props),this.key=e.key?e.key.key:i4("plugin")}getState(e){return e[this.key]}}const R0=Object.create(null);function i4(t){return t in R0?t+"$"+ ++R0[t]:(R0[t]=0,t+"$")}class xn{constructor(e="key"){this.key=i4(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ti=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},id=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let EC=null;const Ro=function(t,e,n){let r=EC||(EC=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},yl=function(t,e,n,r){return n&&(AC(t,e,n,r,-1)||AC(t,e,n,r,1))},CU=/^(img|br|input|textarea|hr)$/i;function AC(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:uo(t))){let o=t.parentNode;if(!o||o.nodeType!=1||EU(t)||CU.test(t.nodeName)||t.contentEditable=="false")return!1;e=ti(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?uo(t):0}else return!1}}function uo(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function TU(t,e,n){for(let r=e==0,i=e==uo(t);r||i;){if(t==n)return!0;let o=ti(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==uo(t)}}function EU(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const jg=function(t){return t.focusNode&&yl(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function za(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function AU(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}const ra=typeof navigator<"u"?navigator:null,OC=typeof document<"u"?document:null,ma=ra&&ra.userAgent||"",Cb=/Edge\/(\d+)/.exec(ma),o4=/MSIE \d/.exec(ma),Tb=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ma),Fr=!!(o4||Tb||Cb),Js=o4?document.documentMode:Tb?+Tb[1]:Cb?+Cb[1]:0,Wi=!Fr&&/gecko\/(\d+)/i.test(ma);Wi&&+(/Firefox\/(\d+)/.exec(ma)||[0,0])[1];const Eb=!Fr&&/Chrome\/(\d+)/.exec(ma),Cr=!!Eb,OU=Eb?+Eb[1]:0,Tr=!Fr&&!!ra&&/Apple Computer/.test(ra.vendor),Gu=Tr&&(/Mobile\/\w+/.test(ma)||!!ra&&ra.maxTouchPoints>2),pi=Gu||(ra?/Mac/.test(ra.platform):!1),Ni=/Android \d/.test(ma),Wg=!!OC&&"webkitFontSmoothing"in OC.documentElement.style,MU=Wg?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function LU(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Ts(t,e){return typeof t=="number"?t:t[e]}function NU(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function MC(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=id(s)){if(s.nodeType!=1)continue;let l=s,u=l==o.body,f=u?LU(o):NU(l),d=0,m=0;if(e.topf.bottom-Ts(r,"bottom")&&(m=e.bottom-f.bottom+Ts(i,"bottom")),e.leftf.right-Ts(r,"right")&&(d=e.right-f.right+Ts(i,"right")),d||m)if(u)o.defaultView.scrollBy(d,m);else{let v=l.scrollLeft,y=l.scrollTop;m&&(l.scrollTop+=m),d&&(l.scrollLeft+=d);let _=l.scrollLeft-v,C=l.scrollTop-y;e={left:e.left-_,top:e.top-C,right:e.right-_,bottom:e.bottom-C}}if(u)break}}function IU(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s=n-20){r=l,i=u.top;break}}return{refDOM:r,refTop:i,stack:s4(t.dom)}}function s4(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=id(r));return e}function PU({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;a4(n,r==0?0:r-e)}function a4(t,e){for(let n=0;n=l){s=Math.max(v.bottom,s),l=Math.min(v.top,l);let y=v.left>e.left?v.left-e.left:v.right=(v.left+v.right)/2?1:0));continue}}!n&&(e.left>=v.right&&e.top>=v.top||e.left>=v.left&&e.top>=v.bottom)&&(o=f+1)}}return n&&n.nodeType==3?RU(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:l4(n,i)}function RU(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function $_(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function zU(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function $U(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let l=t.docView.nearestDesc(o,!0);if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent&&!s||!l.contentDOM)){let u=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&!s&&(s=!0,u.left>r.left||u.top>r.top?i=l.posBefore:(u.right-1?i:t.docView.posFromDOM(e,n,-1)}function u4(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?s=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(s=$U(t,r,i,e))}s==null&&(s=BU(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function Ns(t,e){let n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}const FU=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function c4(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=Wg||Wi;if(r.nodeType==3)if(s&&(FU.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let u=Ns(Ro(r,i,i),n);if(Wi&&i&&/\s/.test(r.nodeValue[i-1])&&i=0&&i==r.nodeValue.length?(u--,d=1):n<0?u--:f++,Gc(Ns(Ro(r,u,f),1),d<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==uo(r))){let u=r.childNodes[i-1];if(u.nodeType==1)return z0(u.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(n<0||i==uo(r))){let u=r.childNodes[i-1],f=u.nodeType==3?Ro(u,uo(u)-(s?0:1)):u.nodeType==1&&(u.nodeName!="BR"||!u.nextSibling)?u:null;if(f)return Gc(Ns(f,1),!1)}if(o==null&&i=0)}function Gc(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function z0(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function f4(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function VU(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return f4(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=c4(t,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let u;if(l.nodeType==1)u=l.getClientRects();else if(l.nodeType==3)u=Ro(l,0,l.nodeValue.length).getClientRects();else continue;for(let f=0;fd.top+1&&(n=="up"?s.top-d.top>(d.bottom-s.top)*2:d.bottom-s.bottom>(s.bottom-d.top)*2))return!1}}return!0})}const jU=/[\u0590-\u08ac]/;function WU(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=t.domSelection();return!jU.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:f4(t,e,()=>{let{focusNode:u,focusOffset:f,anchorNode:d,anchorOffset:m}=t.domSelectionRange(),v=l.caretBidiLevel;l.modify("move",n,"character");let y=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:_,focusOffset:C}=t.domSelectionRange(),x=_&&!y.contains(_.nodeType==1?_:_.parentNode)||u==_&&f==C;try{l.collapse(d,m),u&&(u!=d||f!=m)&&l.extend&&l.extend(u,f)}catch{}return v!=null&&(l.caretBidiLevel=v),x})}let LC=null,NC=null,IC=!1;function UU(t,e,n){return LC==e&&NC==n?IC:(LC=e,NC=n,IC=n=="up"||n=="down"?VU(t,e,n):WU(t,e,n))}const Fi=0,PC=1,hu=2,_o=3;class Md{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Fi,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;nti(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||s instanceof h4){i=e-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof d4&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?ti(o.dom)+1:0}}else{let o,s=!0;for(;o=r=d&&n<=f-u.border&&u.node&&u.contentDOM&&this.contentDOM.contains(u.contentDOM))return u.parseRange(e,n,d);e=s;for(let m=l;m>0;m--){let v=this.children[m-1];if(v.size&&v.dom.parentNode==this.contentDOM&&!v.emptyChildAt(1)){i=ti(v.dom)+1;break}e-=v.size}i==-1&&(i=0)}if(i>-1&&(f>n||l==this.children.length-1)){n=f;for(let d=l+1;dy&&sn){let y=l;l=u,u=y}let v=document.createRange();v.setEnd(u.node,u.offset),v.setStart(l.node,l.offset),f.removeAllRanges(),f.addRange(v)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i=r:er){let l=r+o.border,u=s-o.border;if(e>=l&&n<=u){this.dirty=e==r||n==s?hu:PC,e==l&&n==u&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=_o:o.markDirty(e-l,n-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?hu:_o}r=s}this.dirty=hu}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?hu:PC;n.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==Fi&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class qU extends Md{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class bl extends Md{constructor(e,n,r,i){super(e,[],r,i),this.mark=n}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=co.renderSpec(document,n.type.spec.toDOM(n,r))),new bl(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&_o||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return this.dirty!=_o&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Fi){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=Mb(o,0,e,r));for(let l=0;l{if(!u)return s;if(u.parent)return u.parent.posBeforeChild(u)},r,i),d=f&&f.dom,m=f&&f.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:m}=co.renderSpec(document,n.type.spec.toDOM(n)));!m&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let v=d;return d=g4(d,r,n),f?u=new KU(e,n,r,i,d,m||null,v,f,o,s+1):n.isText?new Ug(e,n,r,i,d,v,o):new _l(e,n,r,i,d,m||null,v,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Oe.empty)}return e}matchesNode(e,n,r){return this.dirty==Fi&&e.eq(this.node)&&Ob(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,u=new YU(this,s&&s.node,e);ZU(this.node,this.innerDeco,(f,d,m)=>{f.spec.marks?u.syncToMarks(f.spec.marks,r,e):f.type.side>=0&&!m&&u.syncToMarks(d==this.node.childCount?Jt.none:this.node.child(d).marks,r,e),u.placeWidget(f,e,i)},(f,d,m,v)=>{u.syncToMarks(f.marks,r,e);let y;u.findNodeMatch(f,d,m,v)||l&&e.state.selection.from>i&&e.state.selection.to-1&&u.updateNodeAt(f,d,m,y,e)||u.updateNextNode(f,d,m,e,v)||u.addNode(f,d,m,e,i),i+=f.nodeSize}),u.syncToMarks([],r,e),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||this.dirty==hu)&&(s&&this.protectLocalComposition(e,s),p4(this.contentDOM,this.children,e),Gu&&QU(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof st)||rn+this.node.content.size)return null;let o=e.domSelectionRange(),s=eq(o.focusNode,o.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let l=s.nodeValue,u=tq(this.node.content,l,r-n,i-n);return u<0?null:{node:s,pos:u,text:l}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new qU(this,o,n,i);e.input.compositionNodes.push(s),this.children=Mb(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==_o||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Fi}updateOuterDeco(e){if(Ob(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=m4(this.dom,this.nodeDOM,Ab(this.outerDeco,this.node,n),Ab(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function DC(t,e,n,r,i){return g4(r,e,t),new _l(void 0,t,e,n,r,r,r,i,0)}class Ug extends _l{constructor(e,n,r,i,o,s,l){super(e,n,r,i,o,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==_o||this.dirty!=Fi&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Fi||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Fi,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new Ug(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=_o)}get domAtom(){return!1}}class h4 extends Md{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Fi&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class KU extends _l{constructor(e,n,r,i,o,s,l,u,f,d){super(e,n,r,i,o,s,l,f,d),this.spec=u}update(e,n,r,i){if(this.dirty==_o)return!1;if(this.spec.update){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function p4(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,e.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let u=bl.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,u=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(r){let f=n.children[r-1];if(f instanceof bl)n=f,r=f.children.length;else{l=f,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let u=l.node;if(u){if(u!=t.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function XU(t,e){return t.type.side-e.type.side}function ZU(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let f=0;fo;)l.push(i[s++]);let v=o+d.nodeSize;if(d.isText){let _=v;s!_.inline):l.slice();r(d,y,e.forChild(o,d),m),o=v}}function QU(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function eq(t,e){for(;;){if(t.nodeType==3)return t;if(t.nodeType==1&&e>0){if(t.childNodes.length>e&&t.childNodes[e].nodeType==3)return t.childNodes[e];t=t.childNodes[e-1],e=uo(t)}else if(t.nodeType==1&&e=n){let f=l=0&&f+e.length+l>=n)return l+f;if(n==r&&u.length>=r+e.length-l&&u.slice(r-l,r-l+e.length)==e)return r}}return-1}function Mb(t,e,n,r,i){let o=[];for(let s=0,l=0;s=n||d<=e?o.push(u):(fn&&o.push(u.slice(n-f,u.size,r)))}return o}function H_(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),u,f;if(jg(n)){for(u=l;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&it.isSelectable(d)&&i.parent&&!(d.isInline&&TU(n.focusNode,n.focusOffset,i.dom))){let m=i.posBefore;f=new it(s==m?l:r.resolve(m))}}else{let d=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(d<0)return null;u=r.resolve(d)}if(!f){let d=e=="pointer"||t.state.selection.head{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!v4(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function rq(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,ti(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&Fr&&Js<=11&&(r.disabled=!0,r.disabled=!1)}function y4(t,e){if(e instanceof it){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(HC(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else HC(t)}function HC(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function F_(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||st.between(e,n,r)}function FC(t){return t.editable&&!t.hasFocus()?!1:b4(t)}function b4(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function iq(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return yl(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Lb(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&ht.findFrom(o,e)}function Ba(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function VC(t,e,n){let r=t.state.selection;if(r instanceof st){if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){let i=Lb(t.state,e);return i&&i instanceof it?Ba(t,i):!1}else if(!(pi&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(l))&&!s.contentDOM?it.isSelectable(o)?Ba(t,new it(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):Wg?Ba(t,new st(t.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else{if(r instanceof it&&r.node.isInline)return Ba(t,new st(e>0?r.$to:r.$from));{let i=Lb(t.state,e);return i?Ba(t,i):!1}}}function xm(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function xf(t){let e=t.pmViewDesc;return e&&e.size==0&&(t.nextSibling||t.nodeName!="BR")}function $0(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(Wi&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(xf(l))i=n,o=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(_4(n))break;{let l=n.previousSibling;for(;l&&xf(l);)i=n.parentNode,o=ti(l),l=l.previousSibling;if(l)n=l,r=xm(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Nb(t,n,r):i&&Nb(t,i,o)}function H0(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=xm(n),o,s;for(;;)if(r{t.state==i&&Uo(t)},50)}function jC(t,e,n){let r=t.state.selection;if(r instanceof st&&!r.empty||n.indexOf("s")>-1||pi&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Lb(t.state,e);if(s&&s instanceof it)return Ba(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof Hi?ht.near(s,e):ht.findFrom(s,e);return l?Ba(t,l):!1}return!1}function WC(t,e){if(!(t.state.selection instanceof st))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function UC(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function oq(t){if(!Tr||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;UC(t,r,"true"),setTimeout(()=>UC(t,r,"false"),20)}return!1}function sq(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function aq(t,e){let n=e.keyCode,r=sq(e);return n==8||pi&&n==72&&r=="c"?WC(t,-1)||$0(t):n==46||pi&&n==68&&r=="c"?WC(t,1)||H0(t):n==13||n==27?!0:n==37||pi&&n==66&&r=="c"?VC(t,-1,r)||$0(t):n==39||pi&&n==70&&r=="c"?VC(t,1,r)||H0(t):n==38||pi&&n==80&&r=="c"?jC(t,-1,r)||$0(t):n==40||pi&&n==78&&r=="c"?oq(t)||jC(t,1,r)||H0(t):r==(pi?"m":"c")&&(n==66||n==73||n==89||n==90)}function w4(t,e){t.someProp("transformCopied",y=>{e=y(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let y=r.firstChild;n.push(y.type.name,y.attrs!=y.type.defaultAttrs?y.attrs:null),r=y.content}let s=t.someProp("clipboardSerializer")||co.fromSchema(t.state.schema),l=E4(),u=l.createElement("div");u.appendChild(s.serializeFragment(r,{document:l}));let f=u.firstChild,d,m=0;for(;f&&f.nodeType==1&&(d=T4[f.nodeName.toLowerCase()]);){for(let y=d.length-1;y>=0;y--){let _=l.createElement(d[y]);for(;u.firstChild;)_.appendChild(u.firstChild);u.appendChild(_),m++}f=u.firstChild}f&&f.nodeType==1&&f.setAttribute("data-pm-slice",`${i} ${o}${m?` -${m}`:""} ${JSON.stringify(n)}`);let v=t.someProp("clipboardTextSerializer",y=>y(e,t))||e.content.textBetween(0,e.content.size,` - -`);return{dom:u,text:v}}function k4(t,e,n,r,i){let o=i.parent.type.spec.code,s,l;if(!n&&!e)return null;let u=e&&(r||o||!n);if(u){if(t.someProp("transformPastedText",v=>{e=v(e,o||r,t)}),o)return e?new He(Oe.from(t.state.schema.text(e.replace(/\r\n?/g,` -`))),0,0):He.empty;let m=t.someProp("clipboardTextParser",v=>v(e,i,r,t));if(m)l=m;else{let v=i.marks(),{schema:y}=t.state,_=co.fromSchema(y);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(C=>{let x=s.appendChild(document.createElement("p"));C&&x.appendChild(_.serializeNode(y.text(C,v)))})}}else t.someProp("transformPastedHTML",m=>{n=m(n,t)}),s=cq(n),Wg&&fq(s);let f=s&&s.querySelector("[data-pm-slice]"),d=f&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(f.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let m=+d[3];m>0;m--){let v=s.firstChild;for(;v&&v.nodeType!=1;)v=v.nextSibling;if(!v)break;s=v}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||$g.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(u||d),context:i,ruleFromNode(v){return v.nodeName=="BR"&&!v.nextSibling&&v.parentNode&&!lq.test(v.parentNode.nodeName)?{ignore:!0}:null}})),d)l=dq(qC(l,+d[1],+d[2]),d[4]);else if(l=He.maxOpen(uq(l.content,i),!0),l.openStart||l.openEnd){let m=0,v=0;for(let y=l.content.firstChild;m{l=m(l,t)}),l}const lq=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function uq(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(l=>{if(!s)return;let u=i.findWrapping(l.type),f;if(!u)return s=null;if(f=s.length&&o.length&&S4(u,o,l,s[s.length-1],0))s[s.length-1]=f;else{s.length&&(s[s.length-1]=C4(s[s.length-1],o.length));let d=x4(l,u);s.push(d),i=i.matchType(d.type),o=u}}),s)return Oe.from(s)}return t}function x4(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,Oe.from(t));return t}function S4(t,e,n,r,i){if(i=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,t.childCount>1||o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(Oe.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function qC(t,e,n){return e]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=E4().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&T4[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"").reverse().join("")),n.innerHTML=t,i)for(let o=0;o=0;l-=2){let u=n.nodes[r[l]];if(!u||u.hasRequiredAttrs())break;i=Oe.from(u.create(r[l+1],i)),o++,s++}return new He(i,o,s)}const Er={},Ar={},hq={touchstart:!0,touchmove:!0};class pq{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function mq(t){for(let e in Er){let n=Er[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{vq(t,r)&&!V_(t,r)&&(t.editable||!(r.type in Ar))&&n(t,r)},hq[e]?{passive:!0}:void 0)}Tr&&t.dom.addEventListener("input",()=>null),Pb(t)}function Ks(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function gq(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Pb(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>V_(t,r))})}function V_(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function vq(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function yq(t,e){!V_(t,e)&&Er[e.type]&&(t.editable||!(e.type in Ar))&&Er[e.type](t,e)}Ar.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!O4(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Ni&&Cr&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Gu&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,za(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||aq(t,n)?n.preventDefault():Ks(t,"key")};Ar.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Ar.keypress=(t,e)=>{let n=e;if(O4(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||pi&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof st)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function qg(t){return{left:t.clientX,top:t.clientY}}function bq(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function j_(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,l=>s>o.depth?l(t,n,o.nodeAfter,o.before(s),i,!0):l(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function Nu(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}function _q(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&it.isSelectable(r)?(Nu(t,new it(n),"pointer"),!0):!1}function wq(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof it&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(it.isSelectable(l)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(Nu(t,it.create(t.state.doc,i),"pointer"),!0):!1}function kq(t,e,n,r,i){return j_(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?wq(t,n):_q(t,n))}function xq(t,e,n,r){return j_(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function Sq(t,e,n,r){return j_(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||Cq(t,n,r)}function Cq(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Nu(t,st.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)Nu(t,st.create(r,l+1,l+1+s.content.size),"pointer");else if(it.isSelectable(s))Nu(t,it.create(r,l),"pointer");else continue;return!0}}function W_(t){return Sm(t)}const A4=pi?"metaKey":"ctrlKey";Er.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=W_(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&bq(n,t.input.lastClick)&&!n[A4]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(qg(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Tq(t,s,n,!!r)):(o=="doubleClick"?xq:Sq)(t,s.pos,s.inside,n)?n.preventDefault():Ks(t,"pointer"))};class Tq{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[A4],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let d=e.state.doc.resolve(n.pos);o=d.parent,s=d.depth?d.before():0}const l=i?null:r.target,u=l?e.docView.nearestDesc(l,!0):null;this.target=u?u.dom:null;let{selection:f}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||f instanceof it&&f.from<=s&&f.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Wi&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ks(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Uo(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(qg(e))),this.updateAllowDefault(e),this.allowDefault||!n?Ks(this.view,"pointer"):kq(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Tr&&this.mightDrag&&!this.mightDrag.node.isAtom||Cr&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Nu(this.view,ht.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):Ks(this.view,"pointer")}move(e){this.updateAllowDefault(e),Ks(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Er.touchstart=t=>{t.input.lastTouch=Date.now(),W_(t),Ks(t,"pointer")};Er.touchmove=t=>{t.input.lastTouch=Date.now(),Ks(t,"pointer")};Er.contextmenu=t=>W_(t);function O4(t,e){return t.composing?!0:Tr&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const Eq=Ni?5e3:-1;Ar.compositionstart=Ar.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Sm(t,!0),t.markCursor=null;else if(Sm(t),Wi&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){t.domSelection().collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}M4(t,Eq)};Ar.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,M4(t,20))};function M4(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Sm(t),e))}function L4(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Aq());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Aq(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Sm(t,e=!1){if(!(Ni&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),L4(t),e||t.docView&&t.docView.dirty){let n=H_(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function Oq(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Yu=Fr&&Js<15||Gu&&MU<604;Er.copy=Ar.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=Yu?null:n.clipboardData,s=r.content(),{dom:l,text:u}=w4(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",u)):Oq(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Mq(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function Lq(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?od(t,r.value,null,t.input.shiftKey,e):od(t,r.textContent,r.innerHTML,t.input.shiftKey,e)},50)}function od(t,e,n,r,i){let o=k4(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",u=>u(t,i,o||He.empty)))return!0;if(!o)return!1;let s=Mq(o),l=s?t.state.tr.replaceSelectionWith(s,t.input.shiftKey):t.state.tr.replaceSelection(o);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Ar.paste=(t,e)=>{let n=e;if(t.composing&&!Ni)return;let r=Yu?null:n.clipboardData;r&&od(t,r.getData("text/plain"),r.getData("text/html"),t.input.shiftKey,n)?n.preventDefault():Lq(t,n)};class Nq{constructor(e,n){this.slice=e,this.move=n}}const N4=pi?"altKey":"ctrlKey";Er.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(qg(n));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof it?i.to-1:i.to))){if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(it.create(t.state.doc,r.mightDrag.pos)));else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&t.dispatch(t.state.tr.setSelection(it.create(t.state.doc,f.posBefore)))}}let s=t.state.selection.content(),{dom:l,text:u}=w4(t,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Yu?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Yu||n.dataTransfer.setData("text/plain",u),t.dragging=new Nq(s,!n[N4])};Er.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Ar.dragover=Ar.dragenter=(t,e)=>e.preventDefault();Ar.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(qg(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",_=>{s=_(s,t)}):s=k4(t,n.dataTransfer.getData(Yu?"Text":"text/plain"),Yu?null:n.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!n[N4]);if(t.someProp("handleDrop",_=>_(t,n,s||He.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let u=s?X6(t.state.doc,o.pos,s):o.pos;u==null&&(u=o.pos);let f=t.state.tr;l&&f.deleteSelection();let d=f.mapping.map(u),m=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,v=f.doc;if(m?f.replaceRangeWith(d,d,s.content.firstChild):f.replaceRange(d,d,s),f.doc.eq(v))return;let y=f.doc.resolve(d);if(m&&it.isSelectable(s.content.firstChild)&&y.nodeAfter&&y.nodeAfter.sameMarkup(s.content.firstChild))f.setSelection(new it(y));else{let _=f.mapping.map(u);f.mapping.maps[f.mapping.maps.length-1].forEach((C,x,k,A)=>_=A),f.setSelection(F_(t,y,f.doc.resolve(_)))}t.focus(),t.dispatch(f.setMeta("uiEvent","drop"))};Er.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Uo(t)},20))};Er.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};Er.beforeinput=(t,e)=>{if(Cr&&Ni&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,za(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in Ar)Er[t]=Ar[t];function sd(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class U_{constructor(e,n){this.toDOM=e,this.spec=n||ol,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new hr(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof U_&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&sd(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Xs{constructor(e,n){this.attrs=e,this.spec=n||ol}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new hr(o,s,this)}valid(e,n){return n.from=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;se){let l=this.children[s]+1;this.children[s+2].findInner(e-l,n-l,r,i+l,o)}}map(e,n,r){return this==ur||e.maps.length==0?this:this.mapInner(e,n,0,0,r||ol)}mapInner(e,n,r,i,o){let s;for(let l=0;l{let f=u+r,d;if(d=P4(n,l,f)){for(i||(i=this.children.slice());ol&&m.to=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+n.content.size;for(let l=0;lo&&u.type instanceof Xs){let f=Math.max(o,u.from)-o,d=Math.min(s,u.to)-o;fi.map(e,n,ol));return Hs.from(r)}forChild(e,n){if(n.isLeaf)return tn.empty;let r=[];for(let i=0;in instanceof tn)?e:e.reduce((n,r)=>n.concat(r instanceof tn?r:r.members),[]))}}}function Iq(t,e,n,r,i,o,s){let l=t.slice();for(let f=0,d=o;f{let x=C-_-(y-v);for(let k=0;kA+d-m)continue;let N=l[k]+d-m;y>=N?l[k+1]=v<=N?-2:-1:_>=i&&x&&(l[k]+=x,l[k+1]+=x)}m+=x}),d=n.maps[f].map(d,-1)}let u=!1;for(let f=0;f=r.content.size){u=!0;continue}let v=n.map(t[f+1]+o,-1),y=v-i,{index:_,offset:C}=r.content.findIndex(m),x=r.maybeChild(_);if(x&&C==m&&C+x.nodeSize==y){let k=l[f+2].mapInner(n,x,d+1,t[f]+o+1,s);k!=ur?(l[f]=m,l[f+1]=y,l[f+2]=k):(l[f+1]=-2,u=!0)}else u=!0}if(u){let f=Pq(l,t,e,n,i,o,s),d=Cm(f,r,0,s);e=d.local;for(let m=0;mn&&s.to{let f=P4(t,l,u+n);if(f){o=!0;let d=Cm(f,l,n+u+1,r);d!=ur&&i.push(u,u+l.nodeSize,d)}});let s=I4(o?D4(t):t,-n).sort(sl);for(let l=0;l0;)e++;t.splice(e,0,n)}function F0(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=ur&&e.push(r)}),t.cursorWrapper&&e.push(tn.create(t.state.doc,[t.cursorWrapper.deco])),Hs.from(e)}const Dq={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Rq=Fr&&Js<=11;class zq{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Bq{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new zq,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),Rq&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Dq)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;nthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(FC(this.view)){if(this.suppressingSelectionUpdates)return Uo(this.view);if(Fr&&Js<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&yl(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let o=e.focusNode;o;o=id(o))n.add(o);for(let o=e.anchorNode;o;o=id(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.observer?this.observer.takeRecords():[];this.queue.length&&(n=this.queue.concat(n),this.queue.length=0);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&FC(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,u=[];if(e.editable)for(let d=0;d1){let d=u.filter(m=>m.nodeName=="BR");if(d.length==2){let m=d[0],v=d[1];m.parentNode&&m.parentNode.parentNode==v.parentNode?v.remove():m.remove()}}let f=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),$q(e)),this.handleDOMChange(o,s,l,u),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Uo(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;di;x--){let k=r.childNodes[x-1],A=k.pmViewDesc;if(k.nodeName=="BR"&&!A){o=x;break}if(!A||A.size)break}let m=t.state.doc,v=t.someProp("domParser")||$g.fromSchema(t.state.schema),y=m.resolve(s),_=null,C=v.parse(r,{topNode:y.parent,topMatch:y.parent.contentMatchAt(y.index()),topOpen:!0,from:i,to:o,preserveWhitespace:y.parent.type.whitespace=="pre"?"full":!0,findPositions:f,ruleFromNode:Vq,context:y});if(f&&f[0].pos!=null){let x=f[0].pos,k=f[1]&&f[1].pos;k==null&&(k=x),_={anchor:x+s,head:k+s}}return{doc:C,sel:_,from:s,to:l}}function Vq(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Tr&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Tr&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const jq=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Wq(t,e,n,r,i){if(e<0){let P=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,z=H_(t,P);if(z&&!t.state.selection.eq(z)){if(Cr&&Ni&&t.input.lastKeyCode===13&&Date.now()-100R(t,za(13,"Enter"))))return;let w=t.state.tr.setSelection(z);P=="pointer"?w.setMeta("pointer",!0):P=="key"&&w.scrollIntoView(),t.dispatch(w)}return}let o=t.state.doc.resolve(e),s=o.sharedDepth(n);e=o.before(s+1),n=t.state.doc.resolve(n).after(s+1);let l=t.state.selection,u=Fq(t,e,n),f=t.state.doc,d=f.slice(u.from,u.to),m,v;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Ni)&&i.some(P=>P.nodeType==1&&!jq.test(P.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",P=>P(t,za(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y)if(r&&l instanceof st&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))y={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let P=XC(t,t.state.doc,u.sel);P&&!P.eq(t.state.selection)&&t.dispatch(t.state.tr.setSelection(P))}return}if(Cr&&t.cursorWrapper&&u.sel&&u.sel.anchor==t.cursorWrapper.deco.from&&u.sel.head==u.sel.anchor){let P=y.endB-y.start;u.sel={anchor:u.sel.anchor+P,head:u.sel.anchor+P}}t.input.domChangeCount++,t.state.selection.fromt.state.selection.from&&y.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?y.start=t.state.selection.from:y.endA=t.state.selection.to-2&&t.state.selection.to<=u.to&&(y.endB+=t.state.selection.to-y.endA,y.endA=t.state.selection.to)),Fr&&Js<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>u.from&&u.doc.textBetween(y.start-u.from-1,y.start-u.from+1)=="  "&&(y.start--,y.endA--,y.endB--);let _=u.doc.resolveNoCache(y.start-u.from),C=u.doc.resolveNoCache(y.endB-u.from),x=f.resolve(y.start),k=_.sameParent(C)&&_.parent.inlineContent&&x.end()>=y.endA,A;if((Gu&&t.input.lastIOSEnter>Date.now()-225&&(!k||i.some(P=>P.nodeName=="DIV"||P.nodeName=="P"))||!k&&_.posP(t,za(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>y.start&&qq(f,y.start,y.endA,_,C)&&t.someProp("handleKeyDown",P=>P(t,za(8,"Backspace")))){Ni&&Cr&&t.domObserver.suppressSelectionUpdates();return}Cr&&Ni&&y.endB==y.start&&(t.input.lastAndroidDelete=Date.now()),Ni&&!k&&_.start()!=C.start()&&C.parentOffset==0&&_.depth==C.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==y.endA&&(y.endB-=2,C=u.doc.resolveNoCache(y.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(P){return P(t,za(13,"Enter"))})},20));let N=y.start,E=y.endA,H,I,q;if(k){if(_.pos==C.pos)Fr&&Js<=11&&_.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Uo(t),20)),H=t.state.tr.delete(N,E),I=f.resolve(y.start).marksAcross(f.resolve(y.endA));else if(y.endA==y.endB&&(q=Uq(_.parent.content.cut(_.parentOffset,C.parentOffset),x.parent.content.cut(x.parentOffset,y.endA-x.start()))))H=t.state.tr,q.type=="add"?H.addMark(N,E,q.mark):H.removeMark(N,E,q.mark);else if(_.parent.child(_.index()).isText&&_.index()==C.index()-(C.textOffset?0:1)){let P=_.parent.textBetween(_.parentOffset,C.parentOffset);if(t.someProp("handleTextInput",z=>z(t,N,E,P)))return;H=t.state.tr.insertText(P,N,E)}}if(H||(H=t.state.tr.replace(N,E,u.doc.slice(y.start-u.from,y.endB-u.from))),u.sel){let P=XC(t,H.doc,u.sel);P&&!(Cr&&Ni&&t.composing&&P.empty&&(y.start!=y.endB||t.input.lastAndroidDeletee.content.size?null:F_(t,e.resolve(n.anchor),e.resolve(n.head))}function Uq(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,l,u;for(let d=0;dd.mark(l.addToSet(d.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",u=d=>d.mark(l.removeFromSet(d.marks));else return null;let f=[];for(let d=0;dn||V0(s,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function Kq(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let u=Math.max(0,o-Math.min(s,l));r-=s+u-o}if(s=s?o-r:0;o-=u,l=o+(l-s),s=o}else if(l=l?o-r:0;o-=u,s=o+(s-l),l=o}return{start:o,endA:s,endB:l}}class Gq{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new pq,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(nT),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=eT(this),QC(this),this.nodeViews=tT(this),this.docView=DC(this.state.doc,ZC(this),F0(this),this.dom,this),this.domObserver=new Bq(this,(r,i,o,s)=>Wq(this,r,i,o,s)),this.domObserver.start(),mq(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Pb(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(nT),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){let r=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(L4(this),o=!0),this.state=e;let s=r.plugins!=e.plugins||this._props.plugins!=n.plugins;if(s||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let v=tT(this);Jq(v,this.nodeViews)&&(this.nodeViews=v,i=!0)}(s||n.handleDOMEvents!=this._props.handleDOMEvents)&&Pb(this),this.editable=eT(this),QC(this);let l=F0(this),u=ZC(this),f=r.plugins!=e.plugins&&!r.doc.eq(e.doc)?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(e.doc,u,l);(d||!e.selection.eq(r.selection))&&(o=!0);let m=f=="preserve"&&o&&this.dom.style.overflowAnchor==null&&IU(this);if(o){this.domObserver.stop();let v=d&&(Fr||Cr)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&Yq(r.selection,e.selection);if(d){let y=Cr?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=DC(e.doc,u,l,this.dom,this)),y&&!this.trackWrites&&(v=!0)}v||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&iq(this))?Uo(this,v):(y4(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),f=="reset"?this.dom.scrollTop=0:f=="to selection"?this.scrollToSelection():m&&PU(m)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof it){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&MC(this,n.getBoundingClientRect(),e)}else MC(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;nn.ownerDocument.getSelection()),this._root=n}return e||document}posAtCoords(e){return HU(this,e)}coordsAtPos(e,n=1){return c4(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return UU(this,n||this.state,e)}pasteHTML(e,n){return od(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return od(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(gq(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],F0(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return yq(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return Tr&&this.root.nodeType===11&&AU(this.dom.ownerDocument)==this.dom?Hq(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function ZC(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),e.translate="no",t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"&&(e.class+=" "+n[r]),r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),[hr.node(0,t.state.doc.content.size,e)]}function QC(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:hr.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function eT(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Yq(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function tT(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Jq(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function nT(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var ia={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Tm={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},rT=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),Xq=typeof navigator<"u"&&/Mac/.test(navigator.platform),Zq=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Qq=Xq||rT&&+rT[1]<57;for(var nr=0;nr<10;nr++)ia[48+nr]=ia[96+nr]=String(nr);for(var nr=1;nr<=24;nr++)ia[nr+111]="F"+nr;for(var nr=65;nr<=90;nr++)ia[nr]=String.fromCharCode(nr+32),Tm[nr]=String.fromCharCode(nr);for(var j0 in ia)Tm.hasOwnProperty(j0)||(Tm[j0]=ia[j0]);function eK(t){var e=Qq&&(t.ctrlKey||t.altKey||t.metaKey)||Zq&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Tm:ia)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const tK=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function nK(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let l=0;l127)&&(o=ia[r.keyCode])&&o!=i){let l=e[W0(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const oK=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function R4(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const sK=(t,e,n)=>{let r=R4(t,n);if(!r)return!1;let i=Y_(r);if(!i){let s=r.blockRange(),l=s&&lc(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&H4(t,i,e))return!0;if(r.parent.content.size==0&&(Ju(o,"end")||it.isSelectable(o))){let s=Fg(t.doc,r.before(),r.after(),He.empty);if(s&&s.slice.size{let r=R4(t,n);if(!r)return!1;let i=Y_(r);return i?z4(t,i,e):!1},lK=(t,e,n)=>{let r=B4(t,n);if(!r)return!1;let i=J_(r);return i?z4(t,i,e):!1};function z4(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let d=i.lastChild;if(!d)return!1;i=d}let s=e.nodeAfter,l=s,u=e.pos+1;for(;!l.isTextblock;u++){if(l.type.spec.isolating)return!1;let d=l.firstChild;if(!d)return!1;l=d}let f=Fg(t.doc,o,u,He.empty);if(!f||f.from!=o||f instanceof tr&&f.slice.size>=u-o)return!1;if(n){let d=t.tr.step(f);d.setSelection(st.create(d.doc,o)),n(d.scrollIntoView())}return!0}function Ju(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const uK=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=Y_(r)}let s=o&&o.nodeBefore;return!s||!it.isSelectable(s)?!1:(e&&e(t.tr.setSelection(it.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function Y_(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function B4(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=B4(t,n);if(!r)return!1;let i=J_(r);if(!i)return!1;let o=i.nodeAfter;if(H4(t,i,e))return!0;if(r.parent.content.size==0&&(Ju(o,"start")||it.isSelectable(o))){let s=Fg(t.doc,r.before(),r.after(),He.empty);if(s&&s.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof it,i;if(r){if(n.node.isTextblock||!pa(t.doc,n.from))return!1;i=n.from}else if(i=Hg(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(it.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},hK=(t,e)=>{let n=t.selection,r;if(n instanceof it){if(n.node.isTextblock||!pa(t.doc,n.to))return!1;r=n.to}else if(r=Hg(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},pK=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&lc(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},mK=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` -`).scrollIntoView()),!0)};function $4(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=$4(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let l=n.after(),u=t.tr.replaceWith(l,l,s.createAndFill());u.setSelection(ht.near(u.doc.resolve(l),1)),e(u.scrollIntoView())}return!0},vK=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Hi||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=$4(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Mu(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&lc(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},bK=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(it.create(t.doc,i))),!0)};function _K(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||pa(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function H4(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(_K(t,e,n))return!0;let l=e.parent.canReplace(e.index(),e.index()+1);if(l&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(n){let m=e.pos+i.nodeSize,v=Oe.empty;for(let C=o.length-1;C>=0;C--)v=Oe.from(o[C].create(null,v));v=Oe.from(r.copy(v));let y=t.tr.step(new Un(e.pos-1,m,e.pos,m,new He(v,1,0),o.length,!0)),_=m+2*o.length;pa(y.doc,_)&&y.join(_),n(y.scrollIntoView())}return!0}let u=ht.findFrom(e,1),f=u&&u.$from.blockRange(u.$to),d=f&&lc(f);if(d!=null&&d>=e.depth)return n&&n(t.tr.lift(f,d).scrollIntoView()),!0;if(l&&Ju(i,"start",!0)&&Ju(r,"end")){let m=r,v=[];for(;v.push(m),!m.isTextblock;)m=m.lastChild;let y=i,_=1;for(;!y.isTextblock;y=y.firstChild)_++;if(m.canReplace(m.childCount,m.childCount,y.content)){if(n){let C=Oe.empty;for(let k=v.length-1;k>=0;k--)C=Oe.from(v[k].copy(C));let x=t.tr.step(new Un(e.pos-v.length,e.pos+i.nodeSize,e.pos+_,e.pos+i.nodeSize-_,new He(C,v.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function F4(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(st.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const wK=F4(-1),kK=F4(1);function xK(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&R_(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function iT(t,e=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!u.isTextblock||u.hasMarkup(t,e)))if(u.type==t)i=!0;else{let d=n.doc.resolve(f),m=d.index();i=d.parent.canReplaceWith(m,m+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s=2&&i.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let d=n.doc.resolve(s.start-2);u=new bm(d,d,s.depth),s.endIndex=0;d--)o=Oe.from(n[d].type.create(n[d].attrs,o));t.step(new Un(e.start-(r?2:0),e.end,e.start,e.end,new He(o,0,0),n.length,!0));let s=0;for(let d=0;ds.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?EK(e,n,t,o):AK(e,n,o):!0:!1}}function EK(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);oC;_--)y-=i.child(_).nodeSize,r.delete(y-1,y+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,u=n.endIndex==i.childCount,f=o.node(-1),d=o.index(-1);if(!f.canReplace(d+(l?0:1),d+1,s.content.append(u?Oe.empty:Oe.from(i))))return!1;let m=o.pos,v=m+s.nodeSize;return r.step(new Un(m-(l?1:0),v+(u?1:0),m+1,v-1,new He((l?Oe.empty:Oe.from(i.copy(Oe.empty))).append(u?Oe.empty:Oe.from(i.copy(Oe.empty))),l?0:1,u?0:1),l?0:1)),e(r.scrollIntoView()),!0}function OK(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,f=>f.childCount>0&&f.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let l=o.parent,u=l.child(s-1);if(u.type!=t)return!1;if(n){let f=u.lastChild&&u.lastChild.type==l.type,d=Oe.from(f?t.create():null),m=new He(Oe.from(t.create(null,Oe.from(l.type.create(null,d)))),f?3:1,0),v=o.start,y=o.end;n(e.tr.step(new Un(v-(f?3:1),y,v,y,m,1,!0)).scrollIntoView())}return!0}}function Ld(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class Nd{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([l,u])=>[l,(...d)=>{const m=u(...d)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),m}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l=[],u=!!e,f=e||o.tr,d=()=>(!u&&n&&!f.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(f),l.every(v=>v===!0)),m={...Object.fromEntries(Object.entries(r).map(([v,y])=>[v,(...C)=>{const x=this.buildProps(f,n),k=y(...C)(x);return l.push(k),m}])),run:d};return m}createCan(e){const{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([u,f])=>[u,(...d)=>f(...d)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l={tr:e,editor:i,view:s,state:Ld({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([u,f])=>[u,(...d)=>f(...d)(l)]))}};return l}}class MK{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function Ye(t,e,n){return t.config[e]===void 0&&t.parent?Ye(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?Ye(t.parent,e,n):null}):t.config[e]}function Id(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function X_(t){const e=[],{nodeExtensions:n,markExtensions:r}=Id(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage},u=Ye(s,"addGlobalAttributes",l);if(!u)return;u().forEach(d=>{d.types.forEach(m=>{Object.entries(d.attributes).forEach(([v,y])=>{e.push({type:m,name:v,attribute:{...o,...y}})})})})}),i.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage},u=Ye(s,"addAttributes",l);if(!u)return;const f=u();Object.entries(f).forEach(([d,m])=>{const v={...o,...m};typeof(v==null?void 0:v.default)=="function"&&(v.default=v.default()),v!=null&&v.isRequired&&(v==null?void 0:v.default)===void 0&&delete v.default,e.push({type:s.name,name:d,attribute:v})})}),e}function Hn(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function zt(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const l=o?o.split(" "):[],u=r[i]?r[i].split(" "):[],f=l.filter(d=>!u.includes(d));r[i]=[...u,...f].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Em(t,e){return e.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>zt(n,r),{})}function Z_(t){return typeof t=="function"}function wt(t,e=void 0,...n){return Z_(t)?e?t.bind(e)(...n):t(...n):t}function V4(t={}){return Object.keys(t).length===0&&t.constructor===Object}function j4(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Db(t,e){return t.style?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((o,s)=>{const l=s.attribute.parseHTML?s.attribute.parseHTML(n):j4(n.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function oT(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&V4(n)?!1:n!=null))}function Q_(t,e){var n;const r=X_(t),{nodeExtensions:i,markExtensions:o}=Id(t),s=(n=i.find(f=>Ye(f,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(i.map(f=>{const d=r.filter(k=>k.type===f.name),m={name:f.name,options:f.options,storage:f.storage,editor:e},v=t.reduce((k,A)=>{const N=Ye(A,"extendNodeSchema",m);return{...k,...N?N(f):{}}},{}),y=oT({...v,content:wt(Ye(f,"content",m)),marks:wt(Ye(f,"marks",m)),group:wt(Ye(f,"group",m)),inline:wt(Ye(f,"inline",m)),atom:wt(Ye(f,"atom",m)),selectable:wt(Ye(f,"selectable",m)),draggable:wt(Ye(f,"draggable",m)),code:wt(Ye(f,"code",m)),defining:wt(Ye(f,"defining",m)),isolating:wt(Ye(f,"isolating",m)),attrs:Object.fromEntries(d.map(k=>{var A;return[k.name,{default:(A=k==null?void 0:k.attribute)===null||A===void 0?void 0:A.default}]}))}),_=wt(Ye(f,"parseHTML",m));_&&(y.parseDOM=_.map(k=>Db(k,d)));const C=Ye(f,"renderHTML",m);C&&(y.toDOM=k=>C({node:k,HTMLAttributes:Em(k,d)}));const x=Ye(f,"renderText",m);return x&&(y.toText=x),[f.name,y]})),u=Object.fromEntries(o.map(f=>{const d=r.filter(x=>x.type===f.name),m={name:f.name,options:f.options,storage:f.storage,editor:e},v=t.reduce((x,k)=>{const A=Ye(k,"extendMarkSchema",m);return{...x,...A?A(f):{}}},{}),y=oT({...v,inclusive:wt(Ye(f,"inclusive",m)),excludes:wt(Ye(f,"excludes",m)),group:wt(Ye(f,"group",m)),spanning:wt(Ye(f,"spanning",m)),code:wt(Ye(f,"code",m)),attrs:Object.fromEntries(d.map(x=>{var k;return[x.name,{default:(k=x==null?void 0:x.attribute)===null||k===void 0?void 0:k.default}]}))}),_=wt(Ye(f,"parseHTML",m));_&&(y.parseDOM=_.map(x=>Db(x,d)));const C=Ye(f,"renderHTML",m);return C&&(y.toDOM=x=>C({mark:x,HTMLAttributes:Em(x,d)})),[f.name,y]}));return new KW({topNode:s,nodes:l,marks:u})}function Ep(t,e){return e.nodes[t]||e.marks[t]||null}function Rb(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const W4=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,l)=>{var u,f;const d=((f=(u=i.type.spec).toText)===null||f===void 0?void 0:f.call(u,{node:i,pos:o,parent:s,index:l}))||i.textContent||"%leaf%";n+=d.slice(0,Math.max(0,r-o))}),n};function Kg(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class uc{constructor(e){this.find=e.find,this.handler=e.handler}}const LK=(t,e)=>{if(Kg(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function U0(t){var e;const{editor:n,from:r,to:i,text:o,rules:s,plugin:l}=t,{view:u}=n;if(u.composing)return!1;const f=u.state.doc.resolve(r);if(f.parent.type.spec.code||!((e=f.nodeBefore||f.nodeAfter)===null||e===void 0)&&e.marks.find(v=>v.type.spec.code))return!1;let d=!1;const m=W4(f)+o;return s.forEach(v=>{if(d)return;const y=LK(m,v.find);if(!y)return;const _=u.state.tr,C=Ld({state:u.state,transaction:_}),x={from:r-(y[0].length-o.length),to:i},{commands:k,chain:A,can:N}=new Nd({editor:n,state:C});v.handler({state:C,range:x,match:y,commands:k,chain:A,can:N})===null||!_.steps.length||(_.setMeta(l,{transform:_,from:r,to:i,text:o}),u.dispatch(_),d=!0)}),d}function U4(t){const{editor:e,rules:n}=t,r=new on({state:{init(){return null},apply(i,o){const s=i.getMeta(r);return s||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,s,l){return U0({editor:e,from:o,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&U0({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?U0({editor:e,from:s.pos,to:s.pos,text:` -`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function q4(t){return typeof t=="number"}class Gg{constructor(e){this.find=e.find,this.handler=e.handler}}const NK=(t,e,n)=>{if(Kg(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function IK(t){const{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=t,{commands:u,chain:f,can:d}=new Nd({editor:e,state:n}),m=[];return n.doc.nodesBetween(r,i,(y,_)=>{if(!y.isTextblock||y.type.spec.code)return;const C=Math.max(r,_),x=Math.min(i,_+y.content.size),k=y.textBetween(C-_,x-_,void 0,"");NK(k,o.find,s).forEach(N=>{if(N.index===void 0)return;const E=C+N.index+1,H=E+N[0].length,I={from:n.tr.mapping.map(E),to:n.tr.mapping.map(H)},q=o.handler({state:n,range:I,match:N,commands:u,chain:f,can:d,pasteEvent:s,dropEvent:l});m.push(q)})}),m.every(y=>y!==null)}function K4(t){const{editor:e,rules:n}=t;let r=null,i=!1,o=!1,s=new ClipboardEvent("paste"),l=new DragEvent("drop");return n.map(f=>new on({view(d){const m=v=>{var y;r=!((y=d.dom.parentElement)===null||y===void 0)&&y.contains(v.target)?d.dom.parentElement:null};return window.addEventListener("dragstart",m),{destroy(){window.removeEventListener("dragstart",m)}}},props:{handleDOMEvents:{drop:(d,m)=>(o=r===d.dom.parentElement,l=m,!1),paste:(d,m)=>{var v;const y=(v=m.clipboardData)===null||v===void 0?void 0:v.getData("text/html");return s=m,i=!!(y!=null&&y.includes("data-pm-slice")),!1}}},appendTransaction:(d,m,v)=>{const y=d[0],_=y.getMeta("uiEvent")==="paste"&&!i,C=y.getMeta("uiEvent")==="drop"&&!o;if(!_&&!C)return;const x=m.doc.content.findDiffStart(v.doc.content),k=m.doc.content.findDiffEnd(v.doc.content);if(!q4(x)||!k||x===k.b)return;const A=v.tr,N=Ld({state:v,transaction:A});if(!(!IK({editor:e,state:N,from:Math.max(x-1,0),to:k.b-1,rule:f,pasteEvent:s,dropEvent:l})||!A.steps.length))return l=new DragEvent("drop"),s=new ClipboardEvent("paste"),A}}))}function G4(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return[...new Set(e)]}class Ua{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=Ua.resolve(e),this.schema=Q_(this.extensions,n),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:Ep(r.name,this.schema)};r.type==="mark"&&(!((i=wt(Ye(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const s=Ye(r,"onBeforeCreate",o);s&&this.editor.on("beforeCreate",s);const l=Ye(r,"onCreate",o);l&&this.editor.on("create",l);const u=Ye(r,"onUpdate",o);u&&this.editor.on("update",u);const f=Ye(r,"onSelectionUpdate",o);f&&this.editor.on("selectionUpdate",f);const d=Ye(r,"onTransaction",o);d&&this.editor.on("transaction",d);const m=Ye(r,"onFocus",o);m&&this.editor.on("focus",m);const v=Ye(r,"onBlur",o);v&&this.editor.on("blur",v);const y=Ye(r,"onDestroy",o);y&&this.editor.on("destroy",y)})}static resolve(e){const n=Ua.sort(Ua.flatten(e)),r=G4(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=Ye(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=Ye(r,"priority")||100,s=Ye(i,"priority")||100;return o>s?-1:o{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Ep(n.name,this.schema)},i=Ye(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=Ua.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{const l={name:s.name,options:s.options,storage:s.storage,editor:e,type:Ep(s.name,this.schema)},u=[],f=Ye(s,"addKeyboardShortcuts",l);let d={};if(s.type==="mark"&&s.config.exitable&&(d.ArrowRight=()=>or.handleExit({editor:e,mark:s})),f){const C=Object.fromEntries(Object.entries(f()).map(([x,k])=>[x,()=>k({editor:e})]));d={...d,...C}}const m=iK(d);u.push(m);const v=Ye(s,"addInputRules",l);Rb(s,e.options.enableInputRules)&&v&&r.push(...v());const y=Ye(s,"addPasteRules",l);Rb(s,e.options.enablePasteRules)&&y&&i.push(...y());const _=Ye(s,"addProseMirrorPlugins",l);if(_){const C=_();u.push(...C)}return u}).flat();return[U4({editor:e,rules:r}),...K4({editor:e,rules:i}),...o]}get attributes(){return X_(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=Id(this.extensions);return Object.fromEntries(n.filter(r=>!!Ye(r,"addNodeView")).map(r=>{const i=this.attributes.filter(u=>u.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:Hn(r.name,this.schema)},s=Ye(r,"addNodeView",o);if(!s)return[];const l=(u,f,d,m)=>{const v=Em(u,i);return s()({editor:e,node:u,getPos:d,decorations:m,HTMLAttributes:v,extension:r})};return[r.name,l]}))}}function PK(t){return Object.prototype.toString.call(t).slice(8,-1)}function Ap(t){return PK(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Pd(t,e){const n={...t};return Ap(t)&&Ap(e)&&Object.keys(e).forEach(r=>{Ap(e[r])?r in t?n[r]=Pd(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})}),n}class ir{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=wt(Ye(this,"addOptions",{name:this.name}))),this.storage=wt(Ye(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ir(e)}configure(e={}){const n=this.extend();return n.options=Pd(this.options,e),n.storage=wt(Ye(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new ir({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=wt(Ye(n,"addOptions",{name:n.name})),n.storage=wt(Ye(n,"addStorage",{name:n.name,options:n.options})),n}}function ew(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=` - -`,textSerializers:s={}}=n||{};let l="",u=!0;return t.nodesBetween(r,i,(f,d,m,v)=>{var y;const _=s==null?void 0:s[f.type.name];_?(f.isBlock&&!u&&(l+=o,u=!0),m&&(l+=_({node:f,pos:d,parent:m,index:v,range:e}))):f.isText?(l+=(y=f==null?void 0:f.text)===null||y===void 0?void 0:y.slice(Math.max(r,d)-d,i-d),u=!1):f.isBlock&&!u&&(l+=o,u=!0)}),l}function Yg(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const DK=ir.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new on({key:new xn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(d=>d.$from.pos)),l=Math.max(...o.map(d=>d.$to.pos)),u=Yg(n);return ew(r,{from:s,to:l},{textSerializers:u})}}})]}}),RK=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),zK=(t=!1)=>({commands:e})=>e.setContent("",t),BK=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(l,u)=>{if(l.type.isText)return;const{doc:f,mapping:d}=e,m=f.resolve(d.map(u)),v=f.resolve(d.map(u+l.nodeSize)),y=m.blockRange(v);if(!y)return;const _=lc(y);if(l.type.isTextblock){const{defaultType:C}=m.parent.contentMatchAt(m.index());e.setNodeMarkup(y.start,C)}(_||_===0)&&e.lift(y,_)})}),!0},$K=t=>e=>t(e),HK=()=>({state:t,dispatch:e})=>vK(t,e),FK=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new st(r.doc.resolve(s-1))),!0},VK=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const l=i.before(o),u=i.after(o);t.delete(l,u).scrollIntoView()}return!0}return!1},jK=t=>({tr:e,state:n,dispatch:r})=>{const i=Hn(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const u=o.before(s),f=o.after(s);e.delete(u,f).scrollIntoView()}return!0}return!1},WK=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},UK=()=>({state:t,dispatch:e})=>oK(t,e),qK=()=>({commands:t})=>t.keyboardShortcut("Enter"),KK=()=>({state:t,dispatch:e})=>gK(t,e);function ad(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Kg(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function zb(t,e,n={}){return t.find(r=>r.type===e&&ad(r.attrs,n))}function GK(t,e,n={}){return!!zb(t,e,n)}function Jg(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const i=zb([...r.node.marks],e,n);if(!i)return;let o=r.index,s=t.start()+r.offset,l=o+1,u=s+r.node.nodeSize;for(zb([...r.node.marks],e,n);o>0&&i.isInSet(t.parent.child(o-1).marks);)o-=1,s-=t.parent.child(o).nodeSize;for(;l({tr:n,state:r,dispatch:i})=>{const o=as(t,r.schema),{doc:s,selection:l}=n,{$from:u,from:f,to:d}=l;if(i){const m=Jg(u,o,e);if(m&&m.from<=f&&m.to>=d){const v=st.create(s,m.from,m.to);n.setSelection(v)}}return!0},JK=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{Dd()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!tw(n.state.selection))return s(),!0;const l=nw(i.doc,t)||n.state.selection,u=n.state.selection.eq(l);return o&&(u||i.setSelection(l),u&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},ZK=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),QK=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),Y4=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&Y4(r)}return t};function Am(t){const e=`${t}`,n=new window.DOMParser().parseFromString(e,"text/html").body;return Y4(n)}function ld(t,e,n){if(n={slice:!0,parseOptions:{},...n},typeof t=="object"&&t!==null)try{return Array.isArray(t)&&t.length>0?Oe.fromArray(t.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(t)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),ld("",e,n)}if(typeof t=="string"){const r=$g.fromSchema(e);return n.slice?r.parseSlice(Am(t),n.parseOptions).content:r.parse(Am(t),n.parseOptions)}return ld("",e,n)}function J4(t,e,n){const r=t.steps.length-1;if(r{s===0&&(s=d)}),t.setSelection(ht.near(t.doc.resolve(s),n))}const eG=t=>t.toString().startsWith("<"),tG=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};const s=ld(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(s.toString()==="<>")return!0;let{from:l,to:u}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,d=!0;if((eG(s)?s:[s]).forEach(v=>{v.check(),f=f?v.isText&&v.marks.length===0:!1,d=d?v.isBlock:!1}),l===u&&d){const{parent:v}=r.doc.resolve(l);v.isTextblock&&!v.type.spec.code&&!v.childCount&&(l-=1,u+=1)}f?Array.isArray(e)?r.insertText(e.map(v=>v.text||"").join(""),l,u):typeof e=="object"&&e&&e.text?r.insertText(e.text,l,u):r.insertText(e,l,u):r.replaceWith(l,u,s),n.updateSelection&&J4(r,r.steps.length-1,-1)}return!0},nG=()=>({state:t,dispatch:e})=>dK(t,e),rG=()=>({state:t,dispatch:e})=>hK(t,e),iG=()=>({state:t,dispatch:e})=>sK(t,e),oG=()=>({state:t,dispatch:e})=>cK(t,e),sG=()=>({tr:t,state:e,dispatch:n})=>{try{const r=Hg(e.doc,e.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),n&&n(t),!0)}catch{return!1}},aG=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Hg(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},lG=()=>({state:t,dispatch:e})=>aK(t,e),uG=()=>({state:t,dispatch:e})=>lK(t,e);function Xg(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function cG(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let l=0;l({editor:e,view:n,tr:r,dispatch:i})=>{const o=cG(t).split(/-(?!$)/),s=o.find(f=>!["Alt","Ctrl","Meta","Shift"].includes(f)),l=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),u=e.captureTransaction(()=>{n.someProp("handleKeyDown",f=>f(n,l))});return u==null||u.steps.forEach(f=>{const d=f.map(r.mapping);d&&i&&r.maybeStep(d)}),!0};function Xu(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?Hn(e,t.schema):null,l=[];t.doc.nodesBetween(r,i,(m,v)=>{if(m.isText)return;const y=Math.max(r,v),_=Math.min(i,v+m.nodeSize);l.push({node:m,from:y,to:_})});const u=i-r,f=l.filter(m=>s?s.name===m.node.type.name:!0).filter(m=>ad(m.node.attrs,n,{strict:!1}));return o?!!f.length:f.reduce((m,v)=>m+v.to-v.from,0)>=u}const dG=(t,e={})=>({state:n,dispatch:r})=>{const i=Hn(t,n.schema);return Xu(n,i,e)?pK(n,r):!1},hG=()=>({state:t,dispatch:e})=>yK(t,e),pG=t=>({state:e,dispatch:n})=>{const r=Hn(t,e.schema);return TK(r)(e,n)},mG=()=>({state:t,dispatch:e})=>mK(t,e);function Rd(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Bb(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const gG=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const l=Rd(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Hn(t,r.schema)),l==="mark"&&(s=as(t,r.schema)),i&&n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(f,d)=>{o&&o===f.type&&n.setNodeMarkup(d,void 0,Bb(f.attrs,e)),s&&f.marks.length&&f.marks.forEach(m=>{s===m.type&&n.addMark(d,d+f.nodeSize,s.create(Bb(m.attrs,e)))})})}),!0):!1},vG=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),yG=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),bG=()=>({state:t,dispatch:e})=>uK(t,e),_G=()=>({state:t,dispatch:e})=>fK(t,e),wG=()=>({state:t,dispatch:e})=>bK(t,e),kG=()=>({state:t,dispatch:e})=>kK(t,e),xG=()=>({state:t,dispatch:e})=>wK(t,e);function rw(t,e,n={}){return ld(t,e,{slice:!1,parseOptions:n})}const SG=(t,e=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:s}=r,l=rw(t,i.schema,n);return o&&r.replaceWith(0,s.content.size,l).setMeta("preventUpdate",!e),!0};function cc(t,e){const n=as(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,u=>{s.push(...u.marks)});const l=s.find(u=>u.type.name===n.name);return l?{...l.attrs}:{}}function X4(t,e){const n=new z_(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function Z4(t){for(let e=0;e{e(r)&&n.push({node:r,pos:i})}),n}function Q4(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function iw(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function zd(t){return e=>iw(e.$from,t)}function ow(t,e){const n=co.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function Zg(t,e){const n=Ua.resolve(t);return Q_(n,e)}function TG(t,e){const n=Zg(e),r=Wo.fromJSON(n,t);return ow(r.content,n)}function EG(t,e){const n=Zg(e),r=Am(t);return $g.fromSchema(n).parse(r).toJSON()}function sw(t,e){const n={from:0,to:t.content.size};return ew(t,n,e)}function AG(t,e,n){const{blockSeparator:r=` - -`,textSerializers:i={}}=n||{},o=Zg(e),s=Wo.fromJSON(o,t);return sw(s,{blockSeparator:r,textSerializers:{...Yg(o),...i}})}function eL(t,e){const n=Hn(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,l=>{o.push(l)});const s=o.reverse().find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function aw(t,e){const n=Rd(typeof e=="string"?e:e.name,t.schema);return n==="node"?eL(t,e):n==="mark"?cc(t,e):{}}function tL(t,e=JSON.stringify){const n={};return t.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function OG(t){const e=tL(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function nL(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,o)=>{const s=[];if(i.ranges.length)i.forEach((l,u)=>{s.push({from:l,to:u})});else{const{from:l,to:u}=n[o];if(l===void 0||u===void 0)return;s.push({from:l,to:u})}s.forEach(({from:l,to:u})=>{const f=e.slice(o).map(l,-1),d=e.slice(o).map(u),m=e.invert().map(f,-1),v=e.invert().map(d);r.push({oldRange:{from:m,to:v},newRange:{from:f,to:d}})})}),OG(r)}function rL(t,e=0){const r=t.type===t.type.schema.topNodeType?0:1,i=e,o=i+t.nodeSize,s=t.marks.map(f=>{const d={type:f.type.name};return Object.keys(f.attrs).length&&(d.attrs={...f.attrs}),d}),l={...t.attrs},u={type:t.type.name,from:i,to:o};return Object.keys(l).length&&(u.attrs=l),s.length&&(u.marks=s),t.content.childCount&&(u.content=[],t.forEach((f,d)=>{var m;(m=u.content)===null||m===void 0||m.push(rL(f,e+d+r))})),t.text&&(u.text=t.text),u}function Qg(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t-1),s=Jg(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}const MG=(t,e,n,r=20)=>{const i=t.doc.resolve(n);let o=r,s=null;for(;o>0&&s===null;){const l=i.node(o);(l==null?void 0:l.type.name)===e?s=l:o-=1}return[s,o]};function Sf(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function Om(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?as(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(m=>o?o.name===m.type.name:!0).find(m=>ad(m.attrs,n,{strict:!1}));let s=0;const l=[];if(i.forEach(({$from:m,$to:v})=>{const y=m.pos,_=v.pos;t.doc.nodesBetween(y,_,(C,x)=>{if(!C.isText&&!C.marks.length)return;const k=Math.max(y,x),A=Math.min(_,x+C.nodeSize),N=A-k;s+=N,l.push(...C.marks.map(E=>({mark:E,from:k,to:A})))})}),s===0)return!1;const u=l.filter(m=>o?o.name===m.mark.type.name:!0).filter(m=>ad(m.mark.attrs,n,{strict:!1})).reduce((m,v)=>m+v.to-v.from,0),f=l.filter(m=>o?m.mark.type!==o&&m.mark.type.excludes(o):!0).reduce((m,v)=>m+v.to-v.from,0);return(u>0?u+f:u)>=s}function iL(t,e,n={}){if(!e)return Xu(t,null,n)||Om(t,null,n);const r=Rd(e,t.schema);return r==="node"?Xu(t,e,n):r==="mark"?Om(t,e,n):!1}const LG=(t,e)=>{const{$from:n,$to:r,$anchor:i}=t.selection;if(e){const o=zd(l=>l.type.name===e)(t.selection);if(!o)return!1;const s=t.doc.resolve(o.pos+1);return i.pos+1===s.end()}return!(r.parentOffset{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function $b(t,e){const{nodeExtensions:n}=Id(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=wt(Ye(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function lw(t){var e;const n=(e=t.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),r=t.toJSON();return JSON.stringify(n)===JSON.stringify(r)}function IG(t){return t instanceof it}function PG(t,e,n){const i=t.state.doc.content.size,o=ho(e,0,i),s=ho(n,0,i),l=t.coordsAtPos(o),u=t.coordsAtPos(s,-1),f=Math.min(l.top,u.top),d=Math.max(l.bottom,u.bottom),m=Math.min(l.left,u.left),v=Math.max(l.right,u.right),y=v-m,_=d-f,k={top:f,bottom:d,left:m,right:v,width:y,height:_,x:m,y:f};return{...k,toJSON:()=>k}}function DG(t,e,n){var r;const{selection:i}=e;let o=null;if(tw(i)&&(o=i.$cursor),o){const l=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(l)||!l.some(u=>u.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:l,$to:u})=>{let f=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,u.pos,(d,m,v)=>{if(f)return!1;if(d.isInline){const y=!v||v.type.allowsMarkType(n),_=!!n.isInSet(d.marks)||!d.marks.some(C=>C.type.excludes(n));f=y&&_}return!f}),f})}const RG=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:l}=o,u=as(t,r.schema);if(i)if(s){const f=cc(r,u);n.addStoredMark(u.create({...f,...e}))}else l.forEach(f=>{const d=f.$from.pos,m=f.$to.pos;r.doc.nodesBetween(d,m,(v,y)=>{const _=Math.max(y,d),C=Math.min(y+v.nodeSize,m);v.marks.find(k=>k.type===u)?v.marks.forEach(k=>{u===k.type&&n.addMark(_,C,u.create({...k.attrs,...e}))}):n.addMark(_,C,u.create(e))})});return DG(r,n,u)},zG=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),BG=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Hn(t,n.schema);return o.isTextblock?i().command(({commands:s})=>iT(o,e)(n)?!0:s.clearNodes()).command(({state:s})=>iT(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},$G=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=ho(t,0,r.content.size),o=it.create(r,i);e.setSelection(o)}return!0},HG=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=st.atStart(r).from,l=st.atEnd(r).to,u=ho(i,s,l),f=ho(o,s,l),d=st.create(r,u,f);e.setSelection(d)}return!0},FG=t=>({state:e,dispatch:n})=>{const r=Hn(t,e.schema);return OK(r)(e,n)};function sT(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const VG=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:l,$to:u}=o,f=i.extensionManager.attributes,d=Sf(f,l.node().type.name,l.node().attrs);if(o instanceof it&&o.node.isBlock)return!l.parentOffset||!Mu(s,l.pos)?!1:(r&&(t&&sT(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(r){const m=u.parentOffset===u.parent.content.size;o instanceof st&&e.deleteSelection();const v=l.depth===0?void 0:Z4(l.node(-1).contentMatchAt(l.indexAfter(-1)));let y=m&&v?[{type:v,attrs:d}]:void 0,_=Mu(e.doc,e.mapping.map(l.pos),1,y);if(!y&&!_&&Mu(e.doc,e.mapping.map(l.pos),1,v?[{type:v}]:void 0)&&(_=!0,y=v?[{type:v,attrs:d}]:void 0),_&&(e.split(e.mapping.map(l.pos),1,y),v&&!m&&!l.parentOffset&&l.parent.type!==v)){const C=e.mapping.map(l.before()),x=e.doc.resolve(C);l.node(-1).canReplaceWith(x.index(),x.index()+1,v)&&e.setNodeMarkup(e.mapping.map(l.before()),v)}t&&sT(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},jG=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var o;const s=Hn(t,n.schema),{$from:l,$to:u}=n.selection,f=n.selection.node;if(f&&f.isBlock||l.depth<2||!l.sameParent(u))return!1;const d=l.node(-1);if(d.type!==s)return!1;const m=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==s||l.index(-2)!==l.node(-2).childCount-1)return!1;if(r){let x=Oe.empty;const k=l.index(-1)?1:l.index(-2)?2:3;for(let q=l.depth-k;q>=l.depth-3;q-=1)x=Oe.from(l.node(q).copy(x));const A=l.indexAfter(-1){if(I>-1)return!1;q.isTextblock&&q.content.size===0&&(I=P+1)}),I>-1&&e.setSelection(st.near(e.doc.resolve(I))),e.scrollIntoView()}return!0}const v=u.pos===l.end()?d.contentMatchAt(0).defaultType:null,y=Sf(m,d.type.name,d.attrs),_=Sf(m,l.node().type.name,l.node().attrs);e.delete(l.pos,u.pos);const C=v?[{type:s,attrs:y},{type:v,attrs:_}]:[{type:s,attrs:y}];if(!Mu(e.doc,l.pos,2))return!1;if(r){const{selection:x,storedMarks:k}=n,{splittableMarks:A}=i.extensionManager,N=k||x.$to.parentOffset&&x.$from.marks();if(e.split(l.pos,2,C).scrollIntoView(),!N||!r)return!0;const E=N.filter(H=>A.includes(H.type.name));e.ensureMarks(E)}return!0},q0=(t,e)=>{const n=zd(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&pa(t.doc,n.pos)&&t.join(n.pos),!0},K0=(t,e)=>{const n=zd(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&pa(t.doc,r)&&t.join(r),!0},WG=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:u,commands:f,can:d})=>{const{extensions:m,splittableMarks:v}=i.extensionManager,y=Hn(t,s.schema),_=Hn(e,s.schema),{selection:C,storedMarks:x}=s,{$from:k,$to:A}=C,N=k.blockRange(A),E=x||C.$to.parentOffset&&C.$from.marks();if(!N)return!1;const H=zd(I=>$b(I.type.name,m))(C);if(N.depth>=1&&H&&N.depth-H.depth<=1){if(H.node.type===y)return f.liftListItem(_);if($b(H.node.type.name,m)&&y.validContent(H.node.content)&&l)return u().command(()=>(o.setNodeMarkup(H.pos,y),!0)).command(()=>q0(o,y)).command(()=>K0(o,y)).run()}return!n||!E||!l?u().command(()=>d().wrapInList(y,r)?!0:f.clearNodes()).wrapInList(y,r).command(()=>q0(o,y)).command(()=>K0(o,y)).run():u().command(()=>{const I=d().wrapInList(y,r),q=E.filter(P=>v.includes(P.type.name));return o.ensureMarks(q),I?!0:f.clearNodes()}).wrapInList(y,r).command(()=>q0(o,y)).command(()=>K0(o,y)).run()},UG=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=as(t,r.schema);return Om(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},qG=(t,e,n={})=>({state:r,commands:i})=>{const o=Hn(t,r.schema),s=Hn(e,r.schema);return Xu(r,o,n)?i.setNode(s):i.setNode(o,n)},KG=(t,e={})=>({state:n,commands:r})=>{const i=Hn(t,n.schema);return Xu(n,i,e)?r.lift(i):r.wrapIn(i,e)},GG=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r=0;u-=1)s.step(l.steps[u].invert(l.docs[u]));if(o.text){const u=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,u))}else s.delete(o.from,o.to)}return!0}}return!1},YG=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},JG=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:l}=n,u=as(t,r.schema),{$from:f,empty:d,ranges:m}=l;if(!i)return!0;if(d&&s){let{from:v,to:y}=l;const _=(o=f.marks().find(x=>x.type===u))===null||o===void 0?void 0:o.attrs,C=Jg(f,u,_);C&&(v=C.from,y=C.to),n.removeMark(v,y,u)}else m.forEach(v=>{n.removeMark(v.$from.pos,v.$to.pos,u)});return n.removeStoredMark(u),!0},XG=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const l=Rd(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Hn(t,r.schema)),l==="mark"&&(s=as(t,r.schema)),i&&n.selection.ranges.forEach(u=>{const f=u.$from.pos,d=u.$to.pos;r.doc.nodesBetween(f,d,(m,v)=>{o&&o===m.type&&n.setNodeMarkup(v,void 0,{...m.attrs,...e}),s&&m.marks.length&&m.marks.forEach(y=>{if(s===y.type){const _=Math.max(v,f),C=Math.min(v+m.nodeSize,d);n.addMark(_,C,s.create({...y.attrs,...e}))}})})}),!0):!1},ZG=(t,e={})=>({state:n,dispatch:r})=>{const i=Hn(t,n.schema);return xK(i,e)(n,r)},QG=(t,e={})=>({state:n,dispatch:r})=>{const i=Hn(t,n.schema);return SK(i,e)(n,r)};var eY=Object.freeze({__proto__:null,blur:RK,clearContent:zK,clearNodes:BK,command:$K,createParagraphNear:HK,cut:FK,deleteCurrentNode:VK,deleteNode:jK,deleteRange:WK,deleteSelection:UK,enter:qK,exitCode:KK,extendMarkRange:YK,first:JK,focus:XK,forEach:ZK,insertContent:QK,insertContentAt:tG,joinUp:nG,joinDown:rG,joinBackward:iG,joinForward:oG,joinItemBackward:sG,joinItemForward:aG,joinTextblockBackward:lG,joinTextblockForward:uG,keyboardShortcut:fG,lift:dG,liftEmptyBlock:hG,liftListItem:pG,newlineInCode:mG,resetAttributes:gG,scrollIntoView:vG,selectAll:yG,selectNodeBackward:bG,selectNodeForward:_G,selectParentNode:wG,selectTextblockEnd:kG,selectTextblockStart:xG,setContent:SG,setMark:RG,setMeta:zG,setNode:BG,setNodeSelection:$G,setTextSelection:HG,sinkListItem:FG,splitBlock:VG,splitListItem:jG,toggleList:WG,toggleMark:UG,toggleNode:qG,toggleWrap:KG,undoInputRule:GG,unsetAllMarks:YG,unsetMark:JG,updateAttributes:XG,wrapIn:ZG,wrapInList:QG});const tY=ir.create({name:"commands",addCommands(){return{...eY}}}),nY=ir.create({name:"editable",addProseMirrorPlugins(){return[new on({key:new xn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),rY=ir.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new on({key:new xn("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),iY=ir.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{const{selection:u,doc:f}=l,{empty:d,$anchor:m}=u,{pos:v,parent:y}=m,_=m.parent.isTextblock?l.doc.resolve(v-1):m,C=_.parent.type.spec.isolating,x=m.pos-m.parentOffset,k=C&&_.parent.childCount===1?x===m.pos:ht.atStart(f).from===v;return!d||!k||!y.type.isTextblock||y.textContent.length?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Dd()||Xg()?o:i},addProseMirrorPlugins(){return[new on({key:new xn("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(_=>_.docChanged)&&!e.doc.eq(n.doc)))return;const{empty:i,from:o,to:s}=e.selection,l=ht.atStart(e.doc).from,u=ht.atEnd(e.doc).to;if(i||!(o===l&&s===u)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const m=n.tr,v=Ld({state:n,transaction:m}),{commands:y}=new Nd({editor:this.editor,state:v});if(y.clearNodes(),!!m.steps.length)return m}})]}}),oY=ir.create({name:"tabindex",addProseMirrorPlugins(){return[new on({key:new xn("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var oL=Object.freeze({__proto__:null,ClipboardTextSerializer:DK,Commands:tY,Editable:nY,FocusEvents:rY,Keymap:iY,Tabindex:oY});class Fs{constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Fs(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Fs(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Fs(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=this.pos+r+(i?0:1),s=this.resolvedPos.doc.resolve(o);if(!i&&s.depth<=this.depth)return;const l=new Fs(s,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),e.push(new Fs(s,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let l=0;l{if(o.node.type.name===e){if(Object.keys(n).length>0){const s=o.node.attrs,l=Object.keys(n);for(let u=0;u{const e=Q1({delimiters:["${","}"],...t});return e.config.unwrapInjectedRef=!0,e.use(N3),e.use(i$),e.use(kB,{themes:{"vui-tooltip":{$extend:"tooltip",delay:{show:0,hide:0}}}}),e.config.globalProperties.t=LW,e.config.globalProperties.clone=o$,e.config.globalProperties.$events=n7(),e.config.globalProperties.$isDebug=!1,e};function Xn(t){this.content=t}Xn.prototype={constructor:Xn,find:function(t){for(var e=0;e>1}};Xn.from=function(t){if(t instanceof Xn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Xn(e)};function M6(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=M6(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function N6(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),l=e.child(--o),u=s.nodeSize;if(s==l){n-=u,r-=u;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let f=0,d=Math.min(s.text.length,l.text.length);for(;fe&&r(u,i+l,o||null,s)!==!1&&u.content.size){let d=l+1;u.nodesBetween(Math.max(0,e-d),Math.min(u.content.size,n-d),r,i+d)}l=f}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(l,u)=>{l.isText?(o+=l.text.slice(Math.max(e,u)-u,n-u),s=!r):l.isLeaf?(i?o+=typeof i=="function"?i(l):i:l.type.spec.leafText&&(o+=l.type.spec.leafText(l)),s=!r):!s&&l.isBlock&&(o+=r,s=!0)},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);oe)for(let o=0,s=0;se&&((sn)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,n-s-1))),r.push(l),i+=l.nodeSize),s=u}return new Oe(r,i)}cutByIndex(e,n){return e==n?Oe.empty:e==0&&n==this.content.length?this:new Oe(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new Oe(i,o)}addToStart(e){return new Oe([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Oe(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?qh(r+1,s):qh(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return Oe.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Oe(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Oe.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-i.type.rank),n}};Jt.none=[];class ym extends Error{}class He{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=I6(this.content,e+this.openStart,n);return r&&new He(r,this.openStart,this.openEnd)}removeBetween(e,n){return new He(L6(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return He.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new He(Oe.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new He(e,r,i)}}He.empty=new He(Oe.empty,0,0);function L6(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(i==e||o.isText){if(l!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(L6(o.content,e-i-1,n-i-1)))}function I6(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let l=I6(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function IW(t,e,n){if(n.openStart>t.depth)throw new ym("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ym("Inconsistent open depths");return P6(t,e,n,0)}function P6(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function _f(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(rl(t.nodeAfter,r),o++));for(let l=o;li&&_b(t,e,i+1),s=r.depth>i&&_b(n,r,i+1),l=[];return _f(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(D6(o,s),rl(il(o,R6(t,e,n,r,i+1)),l)):(o&&rl(il(o,bm(t,e,i+1)),l),_f(e,n,i,l),s&&rl(il(s,bm(n,r,i+1)),l)),_f(r,null,i,l),new Oe(l)}function bm(t,e,n){let r=[];if(_f(null,t,n,r),t.depth>n){let i=_b(t,e,n+1);rl(il(i,bm(t,e,n+1)),r)}return _f(e,null,n,r),new Oe(r)}function PW(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(Oe.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class id{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new _m(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:l,offset:u}=s.content.findIndex(o),f=o-u;if(r.push(s,l,i+u),!f||(s=s.child(l),s.isText))break;o=f-1,i+=u+1}return new id(n,r,o)}static resolveCached(e,n){for(let i=0;ie&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),z6(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=Oe.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let u=i;un.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=Oe.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,i,r)}};Wo.prototype.text=void 0;class wm extends Wo{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):z6(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new wm(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new wm(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function z6(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class vl{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new zW(e,n);if(r.next==null)return vl.empty;let i=B6(r);r.next&&r.err("Unexpected trailing text");let o=WW(jW(i));return UW(o,r),o}matchType(e){for(let n=0;nf.createAndFill()));for(let f=0;f=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` -`)}}vl.empty=new vl(!0);class zW{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function B6(t){let e=[];do e.push(BW(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function BW(t){let e=[];do e.push($W(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function $W(t){let e=VW(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=HW(t,e);else break;return e}function fC(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function HW(t,e){let n=fC(t),r=n;return t.eat(",")&&(t.next!="}"?r=fC(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function FW(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function VW(t){if(t.eat("(")){let e=B6(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=FW(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function jW(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,u){let f={term:u,to:l};return e[s].push(f),f}function i(s,l){s.forEach(u=>u.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((u,f)=>u.concat(o(f,l)),[]);if(s.type=="seq")for(let u=0;;u++){let f=o(s.exprs[u],l);if(u==s.exprs.length-1)return f;i(f,l=n())}else if(s.type=="star"){let u=n();return r(l,u),i(o(s.expr,u),u),[r(u)]}else if(s.type=="plus"){let u=n();return i(o(s.expr,l),u),i(o(s.expr,u),u),[r(u)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let u=l;for(let f=0;f{t[s].forEach(({term:l,to:u})=>{if(!l)return;let f;for(let d=0;d{f||i.push([l,f=[]]),f.indexOf(d)==-1&&f.push(d)})})});let o=e[r.join(",")]=new vl(r.indexOf(t.length-1)>-1);for(let s=0;s-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[o]=new j6(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class qW{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class $g{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=V6(i.attrs),this.excluded=null;let o=H6(this.attrs);this.instance=o?new Jt(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Jt(this,F6(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new $g(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n-1}}class KW{constructor(e){this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Xn.from(e.nodes),n.marks=Xn.from(e.marks||{}),this.nodes=hC.compile(this.spec.nodes,this),this.marks=$g.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",l=o.spec.marks;o.contentMatch=r[s]||(r[s]=vl.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=l=="_"?null:l?pC(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:pC(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof hC){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new wm(r,r.defaultAttrs,e,Jt.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Wo.fromJSON(this,e)}markFromJSON(e){return Jt.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function pC(t,e){let n=[];for(let r=0;r-1)&&n.push(s=u)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}let Hg=class kb{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new gC(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new gC(this,n,!0);return r.addAll(e,n.from,n.to),He.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(s.getAttrs){let u=s.getAttrs(n);if(u===!1)continue;s.attrs=u||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=vC(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=vC(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new kb(e,kb.schemaRules(e)))}};const W6={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},GW={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},U6={ol:!0,ul:!0},km=1,xm=2,wf=4;function mC(t,e,n){return e!=null?(e?km:0)|(e==="full"?xm:0):t&&t.whitespace=="pre"?km|xm:n&~wf}class Kh{constructor(e,n,r,i,o,s,l){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=l,this.content=[],this.activeMarks=Jt.none,this.stashMarks=[],this.match=s||(l&wf?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Oe.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&km)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=Oe.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(Oe.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;n{s.clearMark(l)&&(r=l.addToSet(r))}):n=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(n),s.consuming===!1)o=s;else break}return[n,r]}addElementByRule(e,n,r){let i,o,s;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(e):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(u=>this.insertNode(u));else{let u=e;typeof n.contentElement=="string"?u=e.querySelector(n.contentElement):typeof n.contentElement=="function"?u=n.contentElement(e):n.contentElement&&(u=n.contentElement),this.findAround(e,u,!0),this.addAll(u)}i&&this.sync(l)&&this.open--,s&&this.removePendingMark(s,l)}addAll(e,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!n||n.length>s.length)&&(n=s,r=o,!s.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;ithis.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,u)=>{for(;l>=0;l--){let f=n[l];if(f==""){if(l==n.length-1||l==0)continue;for(;u>=o;u--)if(s(l-1,u))return!0;return!1}else{let d=u>0||u==0&&i?this.nodes[u].type:r&&u>=o?r.node(u-o).type:null;if(!d||d.name!=f&&d.groups.indexOf(f)==-1)return!1;u--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let n=QW(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==n)break}}}function YW(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&U6.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function JW(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function XW(t){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=e.exec(t);)r.push(n[1],n[2].trim());return r}function vC(t){let e={};for(let n in t)e[n]=t[n];return e}function ZW(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=l=>{o.push(l);for(let u=0;u{if(o.length||s.marks.length){let l=0,u=0;for(;l=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&co.renderSpec(Ny(r),i(e,n))}static renderSpec(e,n,r=null){if(typeof n=="string")return{dom:e.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let s,l=r?e.createElementNS(r,i):e.createElement(i),u=n[1],f=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){f=2;for(let d in u)if(u[d]!=null){let m=d.indexOf(" ");m>0?l.setAttributeNS(d.slice(0,m),d.slice(m+1),u[d]):l.setAttribute(d,u[d])}}for(let d=f;df)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:v,contentDOM:y}=co.renderSpec(e,m,r);if(l.appendChild(v),y){if(s)throw new RangeError("Multiple content holes");s=y}}}return{dom:l,contentDOM:s}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new co(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=yC(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return yC(e.marks)}}function yC(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Ny(t){return t.document||window.document}const q6=65535,K6=Math.pow(2,16);function eU(t,e){return t+e*K6}function bC(t){return t&q6}function tU(t){return(t-(t&q6))/K6}const G6=1,Y6=2,Ep=4,J6=8;class xb{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&J6)>0}get deletedBefore(){return(this.delInfo&(G6|Ep))>0}get deletedAfter(){return(this.delInfo&(Y6|Ep))>0}get deletedAcross(){return(this.delInfo&Ep)>0}}class mi{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&mi.empty)return mi.empty}recover(e){let n=0,r=bC(e);if(!this.inverted)for(let i=0;ie)break;let f=this.ranges[l+o],d=this.ranges[l+s],m=u+f;if(e<=m){let v=f?e==u?-1:e==m?1:n:n,y=u+i+(v<0?0:d);if(r)return y;let _=e==(n<0?u:m)?null:eU(l/3,e-u),C=e==u?Y6:e==m?G6:Ep;return(n<0?e!=u:e!=m)&&(C|=J6),new xb(y,C,_)}i+=d-f}return r?e+i:new xb(e+i,0,null)}touches(e,n){let r=0,i=bC(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;le)break;let f=this.ranges[l+o],d=u+f;if(e<=d&&l==i*3)return!0;r+=this.ranges[l+s]-f}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new Ou;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ro&&u!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return $n.fromReplace(e,this.from,this.to,o)}invert(){return new fo(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Us(n.pos,r.pos,this.mark)}merge(e){return e instanceof Us&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Us(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Us(n.from,n.to,e.markFromJSON(n.mark))}}qr.jsonID("addMark",Us);class fo extends qr{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new He(D_(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return $n.fromReplace(e,this.from,this.to,r)}invert(){return new Us(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new fo(n.pos,r.pos,this.mark)}merge(e){return e instanceof fo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new fo(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new fo(n.from,n.to,e.markFromJSON(n.mark))}}qr.jsonID("removeMark",fo);class qs extends qr{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return $n.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return $n.fromReplace(e,this.pos,this.pos+1,new He(Oe.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new Un(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Un(n.from,n.to,n.gapFrom,n.gapTo,He.fromJSON(e,n.slice),n.insert,!!n.structure)}}qr.jsonID("replaceAround",Un);function Sb(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function nU(t,e,n,r){let i=[],o=[],s,l;t.doc.nodesBetween(e,n,(u,f,d)=>{if(!u.isInline)return;let m=u.marks;if(!r.isInSet(m)&&d.type.allowsMarkType(r.type)){let v=Math.max(f,e),y=Math.min(f+u.nodeSize,n),_=r.addToSet(m);for(let C=0;Ct.step(u)),o.forEach(u=>t.step(u))}function rU(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,l)=>{if(!s.isInline)return;o++;let u=null;if(r instanceof $g){let f=s.marks,d;for(;d=r.isInSet(f);)(u||(u=[])).push(d),f=d.removeFromSet(f)}else r?r.isInSet(s.marks)&&(u=[r]):u=s.marks;if(u&&u.length){let f=Math.min(l+s.nodeSize,n);for(let d=0;dt.step(new fo(s.from,s.to,s.style)))}function iU(t,e,n,r=n.contentMatch){let i=t.doc.nodeAt(e),o=[],s=e+1;for(let l=0;l=0;l--)t.step(o[l])}function oU(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function lc(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(rn;_--)C||r.index(_)>0?(C=!0,d=Oe.from(r.node(_).copy(d)),m++):u--;let v=Oe.empty,y=0;for(let _=o,C=!1;_>n;_--)C||i.after(_+1)=0;s--){if(r.size){let l=n[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Oe.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Un(i,o,i,o,new He(r,0,0),n.length,!0))}function cU(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,l)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&fU(t.doc,t.mapping.slice(o).map(l),r)){t.clearIncompatible(t.mapping.slice(o).map(l,1),r);let u=t.mapping.slice(o),f=u.map(l,1),d=u.map(l+s.nodeSize,1);return t.step(new Un(f,d,f+1,d-1,new He(Oe.from(r.create(i,null,s.marks)),0,0),1,!0)),!1}})}function fU(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function dU(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Un(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new He(Oe.from(s),0,0),1,!0))}function Mu(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let f=i.depth-1,d=n-2;f>o;f--,d--){let m=i.node(f),v=i.index(f);if(m.type.spec.isolating)return!1;let y=m.content.cutByIndex(v,m.childCount),_=r&&r[d]||m;if(_!=m&&(y=y.replaceChild(0,_.type.create(_.attrs))),!m.canReplace(v+1,m.childCount)||!_.type.validContent(y))return!1}let l=i.indexAfter(o),u=r&&r[0];return i.node(o).canReplaceWith(l,l,u?u.type:i.node(o+1).type)}function hU(t,e,n=1,r){let i=t.doc.resolve(e),o=Oe.empty,s=Oe.empty;for(let l=i.depth,u=i.depth-n,f=n-1;l>u;l--,f--){o=Oe.from(i.node(l).copy(o));let d=r&&r[f];s=Oe.from(d?d.type.create(d.attrs,s):i.node(l).copy(s))}t.step(new tr(e,e,new He(o.append(s),n,n),!0))}function pa(t,e){let n=t.resolve(e),r=n.index();return X6(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function X6(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function Fg(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,l=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),l++,s=r.node(i).maybeChild(l)):(o=r.node(i).maybeChild(l-1),s=r.node(i+1)),o&&!o.isTextblock&&X6(o,s)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function pU(t,e,n){let r=new tr(e-n,e+n,He.empty,!0);t.step(r)}function mU(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,u=r.index(s)+(l>0?1:0),f=r.node(s),d=!1;if(o==1)d=f.canReplace(u,u,i);else{let m=f.contentMatchAt(u).findWrapping(i.firstChild.type);d=m&&f.canReplaceWith(u,u,m[0])}if(d)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function Vg(t,e,n=e,r=He.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return Q6(i,o,r)?new tr(e,n,r):new gU(i,o,r).fit()}function Q6(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class gU{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=Oe.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=Oe.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let f=this.findFittable();f?this.placeNodes(f):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let u=new He(o,s,l);return e>-1?new Un(r.pos,e,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new tr(r.pos,i.pos,u):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=Iy(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:u,match:f}=this.frontier[l],d,m=null;if(n==1&&(s?f.matchType(s.type)||(m=f.fillBefore(Oe.from(s),!1)):o&&u.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:m};if(n==2&&s&&(d=f.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:d};if(o&&f.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Iy(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new He(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Iy(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new He(tf(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new He(tf(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let C=0;C1||u==0||C.content.size)&&(m=x,d.push(e4(C.mark(v.allowedMarks(C.marks)),f==1?u:0,f==l.childCount?y:-1)))}let _=f==l.childCount;_||(y=-1),this.placed=nf(this.placed,n,Oe.from(d)),this.frontier[n].match=m,_&&y<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let C=0,x=l;C1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n=0;l--){let{match:u,type:f}=this.frontier[l],d=Py(e,l,f,u,!0);if(!d||d.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=nf(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=nf(this.placed,this.depth,Oe.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(Oe.empty,!0);n.childCount&&(this.placed=nf(this.placed,this.frontier.length,n))}}function tf(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(tf(t.firstChild.content,e-1,n)))}function nf(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(nf(t.lastChild.content,e-1,n)))}function Iy(t,e){for(let n=0;n1&&(r=r.replaceChild(0,e4(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(Oe.empty,!0)))),t.copy(r)}function Py(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!vU(n,o.content,s)?l:null}function vU(t,e,n){for(let r=n;r0;v--,y--){let _=i.node(v).type.spec;if(_.defining||_.definingAsContext||_.isolating)break;s.indexOf(v)>-1?l=v:i.before(v)==y&&s.splice(1,0,-v)}let u=s.indexOf(l),f=[],d=r.openStart;for(let v=r.content,y=0;;y++){let _=v.firstChild;if(f.push(_),y==r.openStart)break;v=_.content}for(let v=d-1;v>=0;v--){let y=f[v].type,_=yU(y);if(_&&i.node(u).type!=y)d=v;else if(_||!y.isTextblock)break}for(let v=r.openStart;v>=0;v--){let y=(v+d+1)%(r.openStart+1),_=f[y];if(_)for(let C=0;C=0&&(t.replace(e,n,r),!(t.steps.length>m));v--){let y=s[v];y<0||(e=i.before(y),n=o.after(y))}}function t4(t,e,n,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(Oe.empty,!0))}return t}function _U(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=mU(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new He(Oe.from(r),0,0))}function wU(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=n4(r,i);for(let s=0;s0&&(u||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return t.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function n4(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(oe.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}class Nu extends qr{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return $n.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return $n.fromReplace(e,this.pos,this.pos+1,new He(Oe.from(i),0,n.isLeaf?0:1))}getMap(){return mi.empty}invert(e){return new Nu(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Nu(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Nu(n.pos,n.attr,n.value)}}qr.jsonID("attr",Nu);let Ku=class extends Error{};Ku=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};Ku.prototype=Object.create(Error.prototype);Ku.prototype.constructor=Ku;Ku.prototype.name="TransformError";class z_{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ou}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Ku(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=He.empty){let i=Vg(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new He(Oe.from(r),0,0))}delete(e,n){return this.replace(e,n,He.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return bU(this,e,n,r),this}replaceRangeWith(e,n,r){return _U(this,e,n,r),this}deleteRange(e,n){return wU(this,e,n),this}lift(e,n){return sU(this,e,n),this}join(e,n=1){return pU(this,e,n),this}wrap(e,n){return uU(this,e,n),this}setBlockType(e,n=e,r,i=null){return cU(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return dU(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Nu(e,n,r)),this}addNodeMark(e,n){return this.step(new qs(e,n)),this}removeNodeMark(e,n){if(!(n instanceof Jt)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new qu(e,n)),this}split(e,n=1,r){return hU(this,e,n,r),this}addMark(e,n,r){return nU(this,e,n,r),this}removeMark(e,n,r){return rU(this,e,n,r),this}clearIncompatible(e,n,r){return iU(this,e,n,r),this}}const Dy=Object.create(null);class ht{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new r4(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n=0;o--){let s=n<0?lu(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):lu(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Hi(e.node(0))}static atStart(e){return lu(e,e,0,0,1)||new Hi(e)}static atEnd(e){return lu(e,e,e.content.size,e.childCount,-1)||new Hi(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Dy[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Dy)throw new RangeError("Duplicate use of selection JSON ID "+e);return Dy[e]=n,n.prototype.jsonID=e,n}getBookmark(){return st.between(this.$anchor,this.$head).getBookmark()}}ht.prototype.visible=!0;class r4{constructor(e,n){this.$from=e,this.$to=n}}let wC=!1;function kC(t){!wC&&!t.parent.inlineContent&&(wC=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class st extends ht{constructor(e,n=e){kC(e),kC(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ht.near(r);let i=e.resolve(n.map(this.anchor));return new st(i.parent.inlineContent?i:r,r)}replace(e,n=He.empty){if(super.replace(e,n),n==He.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof st&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new jg(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new st(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=ht.findFrom(n,r,!0)||ht.findFrom(n,-r,!0);if(o)n=o.$head;else return ht.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(ht.findFrom(e,-r,!0)||ht.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&it.isSelectable(l))return it.create(t,n-(i<0?l.nodeSize:0))}else{let u=lu(t,l,n+i,i<0?l.childCount:0,i,o);if(u)return u}n+=l.nodeSize*i}return null}function xC(t,e,n){let r=t.steps.length-1;if(r{s==null&&(s=d)}),t.setSelection(ht.near(t.doc.resolve(s),n))}const SC=1,Gh=2,CC=4;class xU extends z_{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Gh,this}ensureMarks(e){return Jt.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Gh)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Gh,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Jt.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(ht.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=CC,this}get scrolledIntoView(){return(this.updated&CC)>0}}function TC(t,e){return!e||!t?t:t.bind(e)}class rf{constructor(e,n,r){this.name=e,this.init=TC(n.init,r),this.apply=TC(n.apply,r)}}const SU=[new rf("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new rf("selection",{init(t,e){return t.selection||ht.atStart(e.doc)},apply(t){return t.selection}}),new rf("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new rf("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Ry{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=SU.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new rf(r.key,r.spec.state,r))})}}class du{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Ry(e.schema,e.plugins),o=new du(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Wo.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=ht.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let u=r[l],f=u.spec.state;if(u.key==s.name&&f&&f.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){o[s.name]=f.fromJSON.call(u,e,n[l],o);return}}o[s.name]=s.init(e,o)}}),o}}function i4(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=i4(i,e,{})),n[r]=i}return n}class on{constructor(e){this.spec=e,this.props={},e.props&&i4(e.props,this,this.props),this.key=e.key?e.key.key:o4("plugin")}getState(e){return e[this.key]}}const zy=Object.create(null);function o4(t){return t in zy?t+"$"+ ++zy[t]:(zy[t]=0,t+"$")}class xn{constructor(e="key"){this.key=o4(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ti=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},od=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let EC=null;const Ro=function(t,e,n){let r=EC||(EC=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},yl=function(t,e,n,r){return n&&(AC(t,e,n,r,-1)||AC(t,e,n,r,1))},CU=/^(img|br|input|textarea|hr)$/i;function AC(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:uo(t))){let o=t.parentNode;if(!o||o.nodeType!=1||EU(t)||CU.test(t.nodeName)||t.contentEditable=="false")return!1;e=ti(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?uo(t):0}else return!1}}function uo(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function TU(t,e,n){for(let r=e==0,i=e==uo(t);r||i;){if(t==n)return!0;let o=ti(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==uo(t)}}function EU(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Wg=function(t){return t.focusNode&&yl(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function za(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function AU(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}const ra=typeof navigator<"u"?navigator:null,OC=typeof document<"u"?document:null,ma=ra&&ra.userAgent||"",Cb=/Edge\/(\d+)/.exec(ma),s4=/MSIE \d/.exec(ma),Tb=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ma),Fr=!!(s4||Tb||Cb),Js=s4?document.documentMode:Tb?+Tb[1]:Cb?+Cb[1]:0,Wi=!Fr&&/gecko\/(\d+)/i.test(ma);Wi&&+(/Firefox\/(\d+)/.exec(ma)||[0,0])[1];const Eb=!Fr&&/Chrome\/(\d+)/.exec(ma),Tr=!!Eb,OU=Eb?+Eb[1]:0,Er=!Fr&&!!ra&&/Apple Computer/.test(ra.vendor),Gu=Er&&(/Mobile\/\w+/.test(ma)||!!ra&&ra.maxTouchPoints>2),pi=Gu||(ra?/Mac/.test(ra.platform):!1),Li=/Android \d/.test(ma),Ug=!!OC&&"webkitFontSmoothing"in OC.documentElement.style,MU=Ug?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function NU(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Ts(t,e){return typeof t=="number"?t:t[e]}function LU(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function MC(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=od(s)){if(s.nodeType!=1)continue;let l=s,u=l==o.body,f=u?NU(o):LU(l),d=0,m=0;if(e.topf.bottom-Ts(r,"bottom")&&(m=e.bottom-f.bottom+Ts(i,"bottom")),e.leftf.right-Ts(r,"right")&&(d=e.right-f.right+Ts(i,"right")),d||m)if(u)o.defaultView.scrollBy(d,m);else{let v=l.scrollLeft,y=l.scrollTop;m&&(l.scrollTop+=m),d&&(l.scrollLeft+=d);let _=l.scrollLeft-v,C=l.scrollTop-y;e={left:e.left-_,top:e.top-C,right:e.right-_,bottom:e.bottom-C}}if(u)break}}function IU(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s=n-20){r=l,i=u.top;break}}return{refDOM:r,refTop:i,stack:a4(t.dom)}}function a4(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=od(r));return e}function PU({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;l4(n,r==0?0:r-e)}function l4(t,e){for(let n=0;n=l){s=Math.max(v.bottom,s),l=Math.min(v.top,l);let y=v.left>e.left?v.left-e.left:v.right=(v.left+v.right)/2?1:0));continue}}!n&&(e.left>=v.right&&e.top>=v.top||e.left>=v.left&&e.top>=v.bottom)&&(o=f+1)}}return n&&n.nodeType==3?RU(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:u4(n,i)}function RU(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function $_(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function zU(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function $U(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let l=t.docView.nearestDesc(o,!0);if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent&&!s||!l.contentDOM)){let u=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&!s&&(s=!0,u.left>r.left||u.top>r.top?i=l.posBefore:(u.right-1?i:t.docView.posFromDOM(e,n,-1)}function c4(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&i++}r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?s=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(s=$U(t,r,i,e))}s==null&&(s=BU(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function Ls(t,e){let n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}const FU=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function f4(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=Ug||Wi;if(r.nodeType==3)if(s&&(FU.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let u=Ls(Ro(r,i,i),n);if(Wi&&i&&/\s/.test(r.nodeValue[i-1])&&i=0&&i==r.nodeValue.length?(u--,d=1):n<0?u--:f++,Gc(Ls(Ro(r,u,f),1),d<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==uo(r))){let u=r.childNodes[i-1];if(u.nodeType==1)return By(u.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(n<0||i==uo(r))){let u=r.childNodes[i-1],f=u.nodeType==3?Ro(u,uo(u)-(s?0:1)):u.nodeType==1&&(u.nodeName!="BR"||!u.nextSibling)?u:null;if(f)return Gc(Ls(f,1),!1)}if(o==null&&i=0)}function Gc(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function By(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function d4(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function VU(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return d4(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=f4(t,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let u;if(l.nodeType==1)u=l.getClientRects();else if(l.nodeType==3)u=Ro(l,0,l.nodeValue.length).getClientRects();else continue;for(let f=0;fd.top+1&&(n=="up"?s.top-d.top>(d.bottom-s.top)*2:d.bottom-s.bottom>(s.bottom-d.top)*2))return!1}}return!0})}const jU=/[\u0590-\u08ac]/;function WU(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=t.domSelection();return!jU.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:d4(t,e,()=>{let{focusNode:u,focusOffset:f,anchorNode:d,anchorOffset:m}=t.domSelectionRange(),v=l.caretBidiLevel;l.modify("move",n,"character");let y=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:_,focusOffset:C}=t.domSelectionRange(),x=_&&!y.contains(_.nodeType==1?_:_.parentNode)||u==_&&f==C;try{l.collapse(d,m),u&&(u!=d||f!=m)&&l.extend&&l.extend(u,f)}catch{}return v!=null&&(l.caretBidiLevel=v),x})}let NC=null,LC=null,IC=!1;function UU(t,e,n){return NC==e&&LC==n?IC:(NC=e,LC=n,IC=n=="up"||n=="down"?VU(t,e,n):WU(t,e,n))}const Fi=0,PC=1,hu=2,_o=3;class Nd{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Fi,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;nti(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||s instanceof p4){i=e-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof h4&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?ti(o.dom)+1:0}}else{let o,s=!0;for(;o=r=d&&n<=f-u.border&&u.node&&u.contentDOM&&this.contentDOM.contains(u.contentDOM))return u.parseRange(e,n,d);e=s;for(let m=l;m>0;m--){let v=this.children[m-1];if(v.size&&v.dom.parentNode==this.contentDOM&&!v.emptyChildAt(1)){i=ti(v.dom)+1;break}e-=v.size}i==-1&&(i=0)}if(i>-1&&(f>n||l==this.children.length-1)){n=f;for(let d=l+1;dy&&sn){let y=l;l=u,u=y}let v=document.createRange();v.setEnd(u.node,u.offset),v.setStart(l.node,l.offset),f.removeAllRanges(),f.addRange(v)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i=r:er){let l=r+o.border,u=s-o.border;if(e>=l&&n<=u){this.dirty=e==r||n==s?hu:PC,e==l&&n==u&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=_o:o.markDirty(e-l,n-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?hu:_o}r=s}this.dirty=hu}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?hu:PC;n.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==Fi&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class qU extends Nd{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class bl extends Nd{constructor(e,n,r,i){super(e,[],r,i),this.mark=n}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=co.renderSpec(document,n.type.spec.toDOM(n,r))),new bl(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&_o||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return this.dirty!=_o&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Fi){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=Mb(o,0,e,r));for(let l=0;l{if(!u)return s;if(u.parent)return u.parent.posBeforeChild(u)},r,i),d=f&&f.dom,m=f&&f.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:m}=co.renderSpec(document,n.type.spec.toDOM(n)));!m&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let v=d;return d=v4(d,r,n),f?u=new KU(e,n,r,i,d,m||null,v,f,o,s+1):n.isText?new qg(e,n,r,i,d,v,o):new _l(e,n,r,i,d,m||null,v,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Oe.empty)}return e}matchesNode(e,n,r){return this.dirty==Fi&&e.eq(this.node)&&Ob(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,u=new YU(this,s&&s.node,e);ZU(this.node,this.innerDeco,(f,d,m)=>{f.spec.marks?u.syncToMarks(f.spec.marks,r,e):f.type.side>=0&&!m&&u.syncToMarks(d==this.node.childCount?Jt.none:this.node.child(d).marks,r,e),u.placeWidget(f,e,i)},(f,d,m,v)=>{u.syncToMarks(f.marks,r,e);let y;u.findNodeMatch(f,d,m,v)||l&&e.state.selection.from>i&&e.state.selection.to-1&&u.updateNodeAt(f,d,m,y,e)||u.updateNextNode(f,d,m,e,v)||u.addNode(f,d,m,e,i),i+=f.nodeSize}),u.syncToMarks([],r,e),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||this.dirty==hu)&&(s&&this.protectLocalComposition(e,s),m4(this.contentDOM,this.children,e),Gu&&QU(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof st)||rn+this.node.content.size)return null;let o=e.domSelectionRange(),s=eq(o.focusNode,o.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let l=s.nodeValue,u=tq(this.node.content,l,r-n,i-n);return u<0?null:{node:s,pos:u,text:l}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new qU(this,o,n,i);e.input.compositionNodes.push(s),this.children=Mb(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==_o||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Fi}updateOuterDeco(e){if(Ob(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=g4(this.dom,this.nodeDOM,Ab(this.outerDeco,this.node,n),Ab(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function DC(t,e,n,r,i){return v4(r,e,t),new _l(void 0,t,e,n,r,r,r,i,0)}class qg extends _l{constructor(e,n,r,i,o,s,l){super(e,n,r,i,o,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==_o||this.dirty!=Fi&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Fi||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Fi,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new qg(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=_o)}get domAtom(){return!1}}class p4 extends Nd{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Fi&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class KU extends _l{constructor(e,n,r,i,o,s,l,u,f,d){super(e,n,r,i,o,s,l,f,d),this.spec=u}update(e,n,r,i){if(this.dirty==_o)return!1;if(this.spec.update){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function m4(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,e.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let u=bl.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,u=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(r){let f=n.children[r-1];if(f instanceof bl)n=f,r=f.children.length;else{l=f,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let u=l.node;if(u){if(u!=t.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function XU(t,e){return t.type.side-e.type.side}function ZU(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let f=0;fo;)l.push(i[s++]);let v=o+d.nodeSize;if(d.isText){let _=v;s!_.inline):l.slice();r(d,y,e.forChild(o,d),m),o=v}}function QU(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function eq(t,e){for(;;){if(t.nodeType==3)return t;if(t.nodeType==1&&e>0){if(t.childNodes.length>e&&t.childNodes[e].nodeType==3)return t.childNodes[e];t=t.childNodes[e-1],e=uo(t)}else if(t.nodeType==1&&e=n){let f=l=0&&f+e.length+l>=n)return l+f;if(n==r&&u.length>=r+e.length-l&&u.slice(r-l,r-l+e.length)==e)return r}}return-1}function Mb(t,e,n,r,i){let o=[];for(let s=0,l=0;s=n||d<=e?o.push(u):(fn&&o.push(u.slice(n-f,u.size,r)))}return o}function H_(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),u,f;if(Wg(n)){for(u=l;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&it.isSelectable(d)&&i.parent&&!(d.isInline&&TU(n.focusNode,n.focusOffset,i.dom))){let m=i.posBefore;f=new it(s==m?l:r.resolve(m))}}else{let d=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(d<0)return null;u=r.resolve(d)}if(!f){let d=e=="pointer"||t.state.selection.head{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!y4(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function rq(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,ti(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&Fr&&Js<=11&&(r.disabled=!0,r.disabled=!1)}function b4(t,e){if(e instanceof it){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(HC(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else HC(t)}function HC(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function F_(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||st.between(e,n,r)}function FC(t){return t.editable&&!t.hasFocus()?!1:_4(t)}function _4(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function iq(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return yl(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Nb(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&ht.findFrom(o,e)}function Ba(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function VC(t,e,n){let r=t.state.selection;if(r instanceof st){if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){let i=Nb(t.state,e);return i&&i instanceof it?Ba(t,i):!1}else if(!(pi&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(l))&&!s.contentDOM?it.isSelectable(o)?Ba(t,new it(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):Ug?Ba(t,new st(t.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else{if(r instanceof it&&r.node.isInline)return Ba(t,new st(e>0?r.$to:r.$from));{let i=Nb(t.state,e);return i?Ba(t,i):!1}}}function Sm(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function xf(t){let e=t.pmViewDesc;return e&&e.size==0&&(t.nextSibling||t.nodeName!="BR")}function Hy(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(Wi&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(xf(l))i=n,o=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(w4(n))break;{let l=n.previousSibling;for(;l&&xf(l);)i=n.parentNode,o=ti(l),l=l.previousSibling;if(l)n=l,r=Sm(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Lb(t,n,r):i&&Lb(t,i,o)}function Fy(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=Sm(n),o,s;for(;;)if(r{t.state==i&&Uo(t)},50)}function jC(t,e,n){let r=t.state.selection;if(r instanceof st&&!r.empty||n.indexOf("s")>-1||pi&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=Nb(t.state,e);if(s&&s instanceof it)return Ba(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof Hi?ht.near(s,e):ht.findFrom(s,e);return l?Ba(t,l):!1}return!1}function WC(t,e){if(!(t.state.selection instanceof st))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function UC(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function oq(t){if(!Er||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;UC(t,r,"true"),setTimeout(()=>UC(t,r,"false"),20)}return!1}function sq(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function aq(t,e){let n=e.keyCode,r=sq(e);return n==8||pi&&n==72&&r=="c"?WC(t,-1)||Hy(t):n==46||pi&&n==68&&r=="c"?WC(t,1)||Fy(t):n==13||n==27?!0:n==37||pi&&n==66&&r=="c"?VC(t,-1,r)||Hy(t):n==39||pi&&n==70&&r=="c"?VC(t,1,r)||Fy(t):n==38||pi&&n==80&&r=="c"?jC(t,-1,r)||Hy(t):n==40||pi&&n==78&&r=="c"?oq(t)||jC(t,1,r)||Fy(t):r==(pi?"m":"c")&&(n==66||n==73||n==89||n==90)}function k4(t,e){t.someProp("transformCopied",y=>{e=y(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let y=r.firstChild;n.push(y.type.name,y.attrs!=y.type.defaultAttrs?y.attrs:null),r=y.content}let s=t.someProp("clipboardSerializer")||co.fromSchema(t.state.schema),l=A4(),u=l.createElement("div");u.appendChild(s.serializeFragment(r,{document:l}));let f=u.firstChild,d,m=0;for(;f&&f.nodeType==1&&(d=E4[f.nodeName.toLowerCase()]);){for(let y=d.length-1;y>=0;y--){let _=l.createElement(d[y]);for(;u.firstChild;)_.appendChild(u.firstChild);u.appendChild(_),m++}f=u.firstChild}f&&f.nodeType==1&&f.setAttribute("data-pm-slice",`${i} ${o}${m?` -${m}`:""} ${JSON.stringify(n)}`);let v=t.someProp("clipboardTextSerializer",y=>y(e,t))||e.content.textBetween(0,e.content.size,` - -`);return{dom:u,text:v}}function x4(t,e,n,r,i){let o=i.parent.type.spec.code,s,l;if(!n&&!e)return null;let u=e&&(r||o||!n);if(u){if(t.someProp("transformPastedText",v=>{e=v(e,o||r,t)}),o)return e?new He(Oe.from(t.state.schema.text(e.replace(/\r\n?/g,` -`))),0,0):He.empty;let m=t.someProp("clipboardTextParser",v=>v(e,i,r,t));if(m)l=m;else{let v=i.marks(),{schema:y}=t.state,_=co.fromSchema(y);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(C=>{let x=s.appendChild(document.createElement("p"));C&&x.appendChild(_.serializeNode(y.text(C,v)))})}}else t.someProp("transformPastedHTML",m=>{n=m(n,t)}),s=cq(n),Ug&&fq(s);let f=s&&s.querySelector("[data-pm-slice]"),d=f&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(f.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let m=+d[3];m>0;m--){let v=s.firstChild;for(;v&&v.nodeType!=1;)v=v.nextSibling;if(!v)break;s=v}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||Hg.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(u||d),context:i,ruleFromNode(v){return v.nodeName=="BR"&&!v.nextSibling&&v.parentNode&&!lq.test(v.parentNode.nodeName)?{ignore:!0}:null}})),d)l=dq(qC(l,+d[1],+d[2]),d[4]);else if(l=He.maxOpen(uq(l.content,i),!0),l.openStart||l.openEnd){let m=0,v=0;for(let y=l.content.firstChild;m{l=m(l,t)}),l}const lq=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function uq(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(l=>{if(!s)return;let u=i.findWrapping(l.type),f;if(!u)return s=null;if(f=s.length&&o.length&&C4(u,o,l,s[s.length-1],0))s[s.length-1]=f;else{s.length&&(s[s.length-1]=T4(s[s.length-1],o.length));let d=S4(l,u);s.push(d),i=i.matchType(d.type),o=u}}),s)return Oe.from(s)}return t}function S4(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,Oe.from(t));return t}function C4(t,e,n,r,i){if(i=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,t.childCount>1||o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(Oe.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function qC(t,e,n){return e]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=A4().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&E4[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"").reverse().join("")),n.innerHTML=t,i)for(let o=0;o=0;l-=2){let u=n.nodes[r[l]];if(!u||u.hasRequiredAttrs())break;i=Oe.from(u.create(r[l+1],i)),o++,s++}return new He(i,o,s)}const Ar={},Or={},hq={touchstart:!0,touchmove:!0};class pq{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function mq(t){for(let e in Ar){let n=Ar[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{vq(t,r)&&!V_(t,r)&&(t.editable||!(r.type in Or))&&n(t,r)},hq[e]?{passive:!0}:void 0)}Er&&t.dom.addEventListener("input",()=>null),Pb(t)}function Ks(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function gq(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Pb(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>V_(t,r))})}function V_(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function vq(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function yq(t,e){!V_(t,e)&&Ar[e.type]&&(t.editable||!(e.type in Or))&&Ar[e.type](t,e)}Or.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!M4(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Li&&Tr&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Gu&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,za(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||aq(t,n)?n.preventDefault():Ks(t,"key")};Or.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Or.keypress=(t,e)=>{let n=e;if(M4(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||pi&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof st)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function Kg(t){return{left:t.clientX,top:t.clientY}}function bq(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function j_(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,l=>s>o.depth?l(t,n,o.nodeAfter,o.before(s),i,!0):l(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function Lu(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}function _q(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&it.isSelectable(r)?(Lu(t,new it(n),"pointer"),!0):!1}function wq(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof it&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(it.isSelectable(l)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(Lu(t,it.create(t.state.doc,i),"pointer"),!0):!1}function kq(t,e,n,r,i){return j_(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?wq(t,n):_q(t,n))}function xq(t,e,n,r){return j_(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function Sq(t,e,n,r){return j_(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||Cq(t,n,r)}function Cq(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Lu(t,st.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)Lu(t,st.create(r,l+1,l+1+s.content.size),"pointer");else if(it.isSelectable(s))Lu(t,it.create(r,l),"pointer");else continue;return!0}}function W_(t){return Cm(t)}const O4=pi?"metaKey":"ctrlKey";Ar.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=W_(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&bq(n,t.input.lastClick)&&!n[O4]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(Kg(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Tq(t,s,n,!!r)):(o=="doubleClick"?xq:Sq)(t,s.pos,s.inside,n)?n.preventDefault():Ks(t,"pointer"))};class Tq{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[O4],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let d=e.state.doc.resolve(n.pos);o=d.parent,s=d.depth?d.before():0}const l=i?null:r.target,u=l?e.docView.nearestDesc(l,!0):null;this.target=u?u.dom:null;let{selection:f}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||f instanceof it&&f.from<=s&&f.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Wi&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ks(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Uo(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Kg(e))),this.updateAllowDefault(e),this.allowDefault||!n?Ks(this.view,"pointer"):kq(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Er&&this.mightDrag&&!this.mightDrag.node.isAtom||Tr&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Lu(this.view,ht.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):Ks(this.view,"pointer")}move(e){this.updateAllowDefault(e),Ks(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Ar.touchstart=t=>{t.input.lastTouch=Date.now(),W_(t),Ks(t,"pointer")};Ar.touchmove=t=>{t.input.lastTouch=Date.now(),Ks(t,"pointer")};Ar.contextmenu=t=>W_(t);function M4(t,e){return t.composing?!0:Er&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const Eq=Li?5e3:-1;Or.compositionstart=Or.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Cm(t,!0),t.markCursor=null;else if(Cm(t),Wi&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){t.domSelection().collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}N4(t,Eq)};Or.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,N4(t,20))};function N4(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Cm(t),e))}function L4(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Aq());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Aq(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Cm(t,e=!1){if(!(Li&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),L4(t),e||t.docView&&t.docView.dirty){let n=H_(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function Oq(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Yu=Fr&&Js<15||Gu&&MU<604;Ar.copy=Or.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=Yu?null:n.clipboardData,s=r.content(),{dom:l,text:u}=k4(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",u)):Oq(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Mq(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function Nq(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?sd(t,r.value,null,t.input.shiftKey,e):sd(t,r.textContent,r.innerHTML,t.input.shiftKey,e)},50)}function sd(t,e,n,r,i){let o=x4(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",u=>u(t,i,o||He.empty)))return!0;if(!o)return!1;let s=Mq(o),l=s?t.state.tr.replaceSelectionWith(s,t.input.shiftKey):t.state.tr.replaceSelection(o);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Or.paste=(t,e)=>{let n=e;if(t.composing&&!Li)return;let r=Yu?null:n.clipboardData;r&&sd(t,r.getData("text/plain"),r.getData("text/html"),t.input.shiftKey,n)?n.preventDefault():Nq(t,n)};class Lq{constructor(e,n){this.slice=e,this.move=n}}const I4=pi?"altKey":"ctrlKey";Ar.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(Kg(n));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof it?i.to-1:i.to))){if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(it.create(t.state.doc,r.mightDrag.pos)));else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&t.dispatch(t.state.tr.setSelection(it.create(t.state.doc,f.posBefore)))}}let s=t.state.selection.content(),{dom:l,text:u}=k4(t,s);n.dataTransfer.clearData(),n.dataTransfer.setData(Yu?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Yu||n.dataTransfer.setData("text/plain",u),t.dragging=new Lq(s,!n[I4])};Ar.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Or.dragover=Or.dragenter=(t,e)=>e.preventDefault();Or.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Kg(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",_=>{s=_(s,t)}):s=x4(t,n.dataTransfer.getData(Yu?"Text":"text/plain"),Yu?null:n.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!n[I4]);if(t.someProp("handleDrop",_=>_(t,n,s||He.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let u=s?Z6(t.state.doc,o.pos,s):o.pos;u==null&&(u=o.pos);let f=t.state.tr;l&&f.deleteSelection();let d=f.mapping.map(u),m=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,v=f.doc;if(m?f.replaceRangeWith(d,d,s.content.firstChild):f.replaceRange(d,d,s),f.doc.eq(v))return;let y=f.doc.resolve(d);if(m&&it.isSelectable(s.content.firstChild)&&y.nodeAfter&&y.nodeAfter.sameMarkup(s.content.firstChild))f.setSelection(new it(y));else{let _=f.mapping.map(u);f.mapping.maps[f.mapping.maps.length-1].forEach((C,x,k,A)=>_=A),f.setSelection(F_(t,y,f.doc.resolve(_)))}t.focus(),t.dispatch(f.setMeta("uiEvent","drop"))};Ar.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Uo(t)},20))};Ar.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};Ar.beforeinput=(t,e)=>{if(Tr&&Li&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,za(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in Or)Ar[t]=Or[t];function ad(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class U_{constructor(e,n){this.toDOM=e,this.spec=n||ol,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new hr(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof U_&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ad(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Xs{constructor(e,n){this.attrs=e,this.spec=n||ol}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new hr(o,s,this)}valid(e,n){return n.from=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;se){let l=this.children[s]+1;this.children[s+2].findInner(e-l,n-l,r,i+l,o)}}map(e,n,r){return this==ur||e.maps.length==0?this:this.mapInner(e,n,0,0,r||ol)}mapInner(e,n,r,i,o){let s;for(let l=0;l{let f=u+r,d;if(d=D4(n,l,f)){for(i||(i=this.children.slice());ol&&m.to=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+n.content.size;for(let l=0;lo&&u.type instanceof Xs){let f=Math.max(o,u.from)-o,d=Math.min(s,u.to)-o;fi.map(e,n,ol));return Hs.from(r)}forChild(e,n){if(n.isLeaf)return tn.empty;let r=[];for(let i=0;in instanceof tn)?e:e.reduce((n,r)=>n.concat(r instanceof tn?r:r.members),[]))}}}function Iq(t,e,n,r,i,o,s){let l=t.slice();for(let f=0,d=o;f{let x=C-_-(y-v);for(let k=0;kA+d-m)continue;let L=l[k]+d-m;y>=L?l[k+1]=v<=L?-2:-1:_>=i&&x&&(l[k]+=x,l[k+1]+=x)}m+=x}),d=n.maps[f].map(d,-1)}let u=!1;for(let f=0;f=r.content.size){u=!0;continue}let v=n.map(t[f+1]+o,-1),y=v-i,{index:_,offset:C}=r.content.findIndex(m),x=r.maybeChild(_);if(x&&C==m&&C+x.nodeSize==y){let k=l[f+2].mapInner(n,x,d+1,t[f]+o+1,s);k!=ur?(l[f]=m,l[f+1]=y,l[f+2]=k):(l[f+1]=-2,u=!0)}else u=!0}if(u){let f=Pq(l,t,e,n,i,o,s),d=Tm(f,r,0,s);e=d.local;for(let m=0;mn&&s.to{let f=D4(t,l,u+n);if(f){o=!0;let d=Tm(f,l,n+u+1,r);d!=ur&&i.push(u,u+l.nodeSize,d)}});let s=P4(o?R4(t):t,-n).sort(sl);for(let l=0;l0;)e++;t.splice(e,0,n)}function Vy(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=ur&&e.push(r)}),t.cursorWrapper&&e.push(tn.create(t.state.doc,[t.cursorWrapper.deco])),Hs.from(e)}const Dq={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Rq=Fr&&Js<=11;class zq{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Bq{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new zq,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),Rq&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Dq)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;nthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(FC(this.view)){if(this.suppressingSelectionUpdates)return Uo(this.view);if(Fr&&Js<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&yl(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let o=e.focusNode;o;o=od(o))n.add(o);for(let o=e.anchorNode;o;o=od(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.observer?this.observer.takeRecords():[];this.queue.length&&(n=this.queue.concat(n),this.queue.length=0);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&FC(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,u=[];if(e.editable)for(let d=0;d1){let d=u.filter(m=>m.nodeName=="BR");if(d.length==2){let m=d[0],v=d[1];m.parentNode&&m.parentNode.parentNode==v.parentNode?v.remove():m.remove()}}let f=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),$q(e)),this.handleDOMChange(o,s,l,u),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Uo(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;di;x--){let k=r.childNodes[x-1],A=k.pmViewDesc;if(k.nodeName=="BR"&&!A){o=x;break}if(!A||A.size)break}let m=t.state.doc,v=t.someProp("domParser")||Hg.fromSchema(t.state.schema),y=m.resolve(s),_=null,C=v.parse(r,{topNode:y.parent,topMatch:y.parent.contentMatchAt(y.index()),topOpen:!0,from:i,to:o,preserveWhitespace:y.parent.type.whitespace=="pre"?"full":!0,findPositions:f,ruleFromNode:Vq,context:y});if(f&&f[0].pos!=null){let x=f[0].pos,k=f[1]&&f[1].pos;k==null&&(k=x),_={anchor:x+s,head:k+s}}return{doc:C,sel:_,from:s,to:l}}function Vq(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Er&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Er&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const jq=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Wq(t,e,n,r,i){if(e<0){let P=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,z=H_(t,P);if(z&&!t.state.selection.eq(z)){if(Tr&&Li&&t.input.lastKeyCode===13&&Date.now()-100R(t,za(13,"Enter"))))return;let w=t.state.tr.setSelection(z);P=="pointer"?w.setMeta("pointer",!0):P=="key"&&w.scrollIntoView(),t.dispatch(w)}return}let o=t.state.doc.resolve(e),s=o.sharedDepth(n);e=o.before(s+1),n=t.state.doc.resolve(n).after(s+1);let l=t.state.selection,u=Fq(t,e,n),f=t.state.doc,d=f.slice(u.from,u.to),m,v;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Li)&&i.some(P=>P.nodeType==1&&!jq.test(P.nodeName))&&(!y||y.endA>=y.endB)&&t.someProp("handleKeyDown",P=>P(t,za(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!y)if(r&&l instanceof st&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))y={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let P=XC(t,t.state.doc,u.sel);P&&!P.eq(t.state.selection)&&t.dispatch(t.state.tr.setSelection(P))}return}if(Tr&&t.cursorWrapper&&u.sel&&u.sel.anchor==t.cursorWrapper.deco.from&&u.sel.head==u.sel.anchor){let P=y.endB-y.start;u.sel={anchor:u.sel.anchor+P,head:u.sel.anchor+P}}t.input.domChangeCount++,t.state.selection.fromt.state.selection.from&&y.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?y.start=t.state.selection.from:y.endA=t.state.selection.to-2&&t.state.selection.to<=u.to&&(y.endB+=t.state.selection.to-y.endA,y.endA=t.state.selection.to)),Fr&&Js<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>u.from&&u.doc.textBetween(y.start-u.from-1,y.start-u.from+1)=="  "&&(y.start--,y.endA--,y.endB--);let _=u.doc.resolveNoCache(y.start-u.from),C=u.doc.resolveNoCache(y.endB-u.from),x=f.resolve(y.start),k=_.sameParent(C)&&_.parent.inlineContent&&x.end()>=y.endA,A;if((Gu&&t.input.lastIOSEnter>Date.now()-225&&(!k||i.some(P=>P.nodeName=="DIV"||P.nodeName=="P"))||!k&&_.posP(t,za(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>y.start&&qq(f,y.start,y.endA,_,C)&&t.someProp("handleKeyDown",P=>P(t,za(8,"Backspace")))){Li&&Tr&&t.domObserver.suppressSelectionUpdates();return}Tr&&Li&&y.endB==y.start&&(t.input.lastAndroidDelete=Date.now()),Li&&!k&&_.start()!=C.start()&&C.parentOffset==0&&_.depth==C.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==y.endA&&(y.endB-=2,C=u.doc.resolveNoCache(y.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(P){return P(t,za(13,"Enter"))})},20));let L=y.start,E=y.endA,H,I,q;if(k){if(_.pos==C.pos)Fr&&Js<=11&&_.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Uo(t),20)),H=t.state.tr.delete(L,E),I=f.resolve(y.start).marksAcross(f.resolve(y.endA));else if(y.endA==y.endB&&(q=Uq(_.parent.content.cut(_.parentOffset,C.parentOffset),x.parent.content.cut(x.parentOffset,y.endA-x.start()))))H=t.state.tr,q.type=="add"?H.addMark(L,E,q.mark):H.removeMark(L,E,q.mark);else if(_.parent.child(_.index()).isText&&_.index()==C.index()-(C.textOffset?0:1)){let P=_.parent.textBetween(_.parentOffset,C.parentOffset);if(t.someProp("handleTextInput",z=>z(t,L,E,P)))return;H=t.state.tr.insertText(P,L,E)}}if(H||(H=t.state.tr.replace(L,E,u.doc.slice(y.start-u.from,y.endB-u.from))),u.sel){let P=XC(t,H.doc,u.sel);P&&!(Tr&&Li&&t.composing&&P.empty&&(y.start!=y.endB||t.input.lastAndroidDeletee.content.size?null:F_(t,e.resolve(n.anchor),e.resolve(n.head))}function Uq(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,l,u;for(let d=0;dd.mark(l.addToSet(d.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",u=d=>d.mark(l.removeFromSet(d.marks));else return null;let f=[];for(let d=0;dn||jy(s,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function Kq(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let u=Math.max(0,o-Math.min(s,l));r-=s+u-o}if(s=s?o-r:0;o-=u,l=o+(l-s),s=o}else if(l=l?o-r:0;o-=u,s=o+(s-l),l=o}return{start:o,endA:s,endB:l}}class Gq{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new pq,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(nT),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=eT(this),QC(this),this.nodeViews=tT(this),this.docView=DC(this.state.doc,ZC(this),Vy(this),this.dom,this),this.domObserver=new Bq(this,(r,i,o,s)=>Wq(this,r,i,o,s)),this.domObserver.start(),mq(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Pb(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(nT),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){let r=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(L4(this),o=!0),this.state=e;let s=r.plugins!=e.plugins||this._props.plugins!=n.plugins;if(s||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let v=tT(this);Jq(v,this.nodeViews)&&(this.nodeViews=v,i=!0)}(s||n.handleDOMEvents!=this._props.handleDOMEvents)&&Pb(this),this.editable=eT(this),QC(this);let l=Vy(this),u=ZC(this),f=r.plugins!=e.plugins&&!r.doc.eq(e.doc)?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(e.doc,u,l);(d||!e.selection.eq(r.selection))&&(o=!0);let m=f=="preserve"&&o&&this.dom.style.overflowAnchor==null&&IU(this);if(o){this.domObserver.stop();let v=d&&(Fr||Tr)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&Yq(r.selection,e.selection);if(d){let y=Tr?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=DC(e.doc,u,l,this.dom,this)),y&&!this.trackWrites&&(v=!0)}v||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&iq(this))?Uo(this,v):(b4(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),f=="reset"?this.dom.scrollTop=0:f=="to selection"?this.scrollToSelection():m&&PU(m)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof it){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&MC(this,n.getBoundingClientRect(),e)}else MC(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;nn.ownerDocument.getSelection()),this._root=n}return e||document}posAtCoords(e){return HU(this,e)}coordsAtPos(e,n=1){return f4(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return UU(this,n||this.state,e)}pasteHTML(e,n){return sd(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return sd(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(gq(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Vy(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return yq(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return Er&&this.root.nodeType===11&&AU(this.dom.ownerDocument)==this.dom?Hq(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function ZC(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),e.translate="no",t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"&&(e.class+=" "+n[r]),r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),[hr.node(0,t.state.doc.content.size,e)]}function QC(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:hr.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function eT(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Yq(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function tT(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Jq(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function nT(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var ia={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Em={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},rT=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),Xq=typeof navigator<"u"&&/Mac/.test(navigator.platform),Zq=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Qq=Xq||rT&&+rT[1]<57;for(var nr=0;nr<10;nr++)ia[48+nr]=ia[96+nr]=String(nr);for(var nr=1;nr<=24;nr++)ia[nr+111]="F"+nr;for(var nr=65;nr<=90;nr++)ia[nr]=String.fromCharCode(nr+32),Em[nr]=String.fromCharCode(nr);for(var Wy in ia)Em.hasOwnProperty(Wy)||(Em[Wy]=ia[Wy]);function eK(t){var e=Qq&&(t.ctrlKey||t.altKey||t.metaKey)||Zq&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Em:ia)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const tK=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function nK(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let l=0;l127)&&(o=ia[r.keyCode])&&o!=i){let l=e[Uy(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const oK=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function z4(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const sK=(t,e,n)=>{let r=z4(t,n);if(!r)return!1;let i=Y_(r);if(!i){let s=r.blockRange(),l=s&&lc(s);return l==null?!1:(e&&e(t.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&F4(t,i,e))return!0;if(r.parent.content.size==0&&(Ju(o,"end")||it.isSelectable(o))){let s=Vg(t.doc,r.before(),r.after(),He.empty);if(s&&s.slice.size{let r=z4(t,n);if(!r)return!1;let i=Y_(r);return i?B4(t,i,e):!1},lK=(t,e,n)=>{let r=$4(t,n);if(!r)return!1;let i=J_(r);return i?B4(t,i,e):!1};function B4(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let d=i.lastChild;if(!d)return!1;i=d}let s=e.nodeAfter,l=s,u=e.pos+1;for(;!l.isTextblock;u++){if(l.type.spec.isolating)return!1;let d=l.firstChild;if(!d)return!1;l=d}let f=Vg(t.doc,o,u,He.empty);if(!f||f.from!=o||f instanceof tr&&f.slice.size>=u-o)return!1;if(n){let d=t.tr.step(f);d.setSelection(st.create(d.doc,o)),n(d.scrollIntoView())}return!0}function Ju(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const uK=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=Y_(r)}let s=o&&o.nodeBefore;return!s||!it.isSelectable(s)?!1:(e&&e(t.tr.setSelection(it.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function Y_(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function $4(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=$4(t,n);if(!r)return!1;let i=J_(r);if(!i)return!1;let o=i.nodeAfter;if(F4(t,i,e))return!0;if(r.parent.content.size==0&&(Ju(o,"start")||it.isSelectable(o))){let s=Vg(t.doc,r.before(),r.after(),He.empty);if(s&&s.slice.size{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof it,i;if(r){if(n.node.isTextblock||!pa(t.doc,n.from))return!1;i=n.from}else if(i=Fg(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(it.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},hK=(t,e)=>{let n=t.selection,r;if(n instanceof it){if(n.node.isTextblock||!pa(t.doc,n.to))return!1;r=n.to}else if(r=Fg(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},pK=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&lc(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},mK=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` -`).scrollIntoView()),!0)};function H4(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=H4(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let l=n.after(),u=t.tr.replaceWith(l,l,s.createAndFill());u.setSelection(ht.near(u.doc.resolve(l),1)),e(u.scrollIntoView())}return!0},vK=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Hi||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=H4(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Mu(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&lc(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},bK=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(it.create(t.doc,i))),!0)};function _K(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||pa(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function F4(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(_K(t,e,n))return!0;let l=e.parent.canReplace(e.index(),e.index()+1);if(l&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(n){let m=e.pos+i.nodeSize,v=Oe.empty;for(let C=o.length-1;C>=0;C--)v=Oe.from(o[C].create(null,v));v=Oe.from(r.copy(v));let y=t.tr.step(new Un(e.pos-1,m,e.pos,m,new He(v,1,0),o.length,!0)),_=m+2*o.length;pa(y.doc,_)&&y.join(_),n(y.scrollIntoView())}return!0}let u=ht.findFrom(e,1),f=u&&u.$from.blockRange(u.$to),d=f&&lc(f);if(d!=null&&d>=e.depth)return n&&n(t.tr.lift(f,d).scrollIntoView()),!0;if(l&&Ju(i,"start",!0)&&Ju(r,"end")){let m=r,v=[];for(;v.push(m),!m.isTextblock;)m=m.lastChild;let y=i,_=1;for(;!y.isTextblock;y=y.firstChild)_++;if(m.canReplace(m.childCount,m.childCount,y.content)){if(n){let C=Oe.empty;for(let k=v.length-1;k>=0;k--)C=Oe.from(v[k].copy(C));let x=t.tr.step(new Un(e.pos-v.length,e.pos+i.nodeSize,e.pos+_,e.pos+i.nodeSize-_,new He(C,v.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function V4(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(e.tr.setSelection(st.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const wK=V4(-1),kK=V4(1);function xK(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&R_(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function iT(t,e=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!u.isTextblock||u.hasMarkup(t,e)))if(u.type==t)i=!0;else{let d=n.doc.resolve(f),m=d.index();i=d.parent.canReplaceWith(m,m+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s=2&&i.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let d=n.doc.resolve(s.start-2);u=new _m(d,d,s.depth),s.endIndex=0;d--)o=Oe.from(n[d].type.create(n[d].attrs,o));t.step(new Un(e.start-(r?2:0),e.end,e.start,e.end,new He(o,0,0),n.length,!0));let s=0;for(let d=0;ds.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?EK(e,n,t,o):AK(e,n,o):!0:!1}}function EK(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);oC;_--)y-=i.child(_).nodeSize,r.delete(y-1,y+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,u=n.endIndex==i.childCount,f=o.node(-1),d=o.index(-1);if(!f.canReplace(d+(l?0:1),d+1,s.content.append(u?Oe.empty:Oe.from(i))))return!1;let m=o.pos,v=m+s.nodeSize;return r.step(new Un(m-(l?1:0),v+(u?1:0),m+1,v-1,new He((l?Oe.empty:Oe.from(i.copy(Oe.empty))).append(u?Oe.empty:Oe.from(i.copy(Oe.empty))),l?0:1,u?0:1),l?0:1)),e(r.scrollIntoView()),!0}function OK(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,f=>f.childCount>0&&f.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let l=o.parent,u=l.child(s-1);if(u.type!=t)return!1;if(n){let f=u.lastChild&&u.lastChild.type==l.type,d=Oe.from(f?t.create():null),m=new He(Oe.from(t.create(null,Oe.from(l.type.create(null,d)))),f?3:1,0),v=o.start,y=o.end;n(e.tr.step(new Un(v-(f?3:1),y,v,y,m,1,!0)).scrollIntoView())}return!0}}function Ld(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class Id{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([l,u])=>[l,(...d)=>{const m=u(...d)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),m}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l=[],u=!!e,f=e||o.tr,d=()=>(!u&&n&&!f.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(f),l.every(v=>v===!0)),m={...Object.fromEntries(Object.entries(r).map(([v,y])=>[v,(...C)=>{const x=this.buildProps(f,n),k=y(...C)(x);return l.push(k),m}])),run:d};return m}createCan(e){const{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([u,f])=>[u,(...d)=>f(...d)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l={tr:e,editor:i,view:s,state:Ld({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([u,f])=>[u,(...d)=>f(...d)(l)]))}};return l}}class MK{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function Ye(t,e,n){return t.config[e]===void 0&&t.parent?Ye(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?Ye(t.parent,e,n):null}):t.config[e]}function Pd(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function X_(t){const e=[],{nodeExtensions:n,markExtensions:r}=Pd(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage},u=Ye(s,"addGlobalAttributes",l);if(!u)return;u().forEach(d=>{d.types.forEach(m=>{Object.entries(d.attributes).forEach(([v,y])=>{e.push({type:m,name:v,attribute:{...o,...y}})})})})}),i.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage},u=Ye(s,"addAttributes",l);if(!u)return;const f=u();Object.entries(f).forEach(([d,m])=>{const v={...o,...m};typeof(v==null?void 0:v.default)=="function"&&(v.default=v.default()),v!=null&&v.isRequired&&(v==null?void 0:v.default)===void 0&&delete v.default,e.push({type:s.name,name:d,attribute:v})})}),e}function Hn(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function zt(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const l=o?o.split(" "):[],u=r[i]?r[i].split(" "):[],f=l.filter(d=>!u.includes(d));r[i]=[...u,...f].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Am(t,e){return e.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>zt(n,r),{})}function Z_(t){return typeof t=="function"}function wt(t,e=void 0,...n){return Z_(t)?e?t.bind(e)(...n):t(...n):t}function j4(t={}){return Object.keys(t).length===0&&t.constructor===Object}function W4(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Db(t,e){return t.style?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((o,s)=>{const l=s.attribute.parseHTML?s.attribute.parseHTML(n):W4(n.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function oT(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&j4(n)?!1:n!=null))}function Q_(t,e){var n;const r=X_(t),{nodeExtensions:i,markExtensions:o}=Pd(t),s=(n=i.find(f=>Ye(f,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(i.map(f=>{const d=r.filter(k=>k.type===f.name),m={name:f.name,options:f.options,storage:f.storage,editor:e},v=t.reduce((k,A)=>{const L=Ye(A,"extendNodeSchema",m);return{...k,...L?L(f):{}}},{}),y=oT({...v,content:wt(Ye(f,"content",m)),marks:wt(Ye(f,"marks",m)),group:wt(Ye(f,"group",m)),inline:wt(Ye(f,"inline",m)),atom:wt(Ye(f,"atom",m)),selectable:wt(Ye(f,"selectable",m)),draggable:wt(Ye(f,"draggable",m)),code:wt(Ye(f,"code",m)),defining:wt(Ye(f,"defining",m)),isolating:wt(Ye(f,"isolating",m)),attrs:Object.fromEntries(d.map(k=>{var A;return[k.name,{default:(A=k==null?void 0:k.attribute)===null||A===void 0?void 0:A.default}]}))}),_=wt(Ye(f,"parseHTML",m));_&&(y.parseDOM=_.map(k=>Db(k,d)));const C=Ye(f,"renderHTML",m);C&&(y.toDOM=k=>C({node:k,HTMLAttributes:Am(k,d)}));const x=Ye(f,"renderText",m);return x&&(y.toText=x),[f.name,y]})),u=Object.fromEntries(o.map(f=>{const d=r.filter(x=>x.type===f.name),m={name:f.name,options:f.options,storage:f.storage,editor:e},v=t.reduce((x,k)=>{const A=Ye(k,"extendMarkSchema",m);return{...x,...A?A(f):{}}},{}),y=oT({...v,inclusive:wt(Ye(f,"inclusive",m)),excludes:wt(Ye(f,"excludes",m)),group:wt(Ye(f,"group",m)),spanning:wt(Ye(f,"spanning",m)),code:wt(Ye(f,"code",m)),attrs:Object.fromEntries(d.map(x=>{var k;return[x.name,{default:(k=x==null?void 0:x.attribute)===null||k===void 0?void 0:k.default}]}))}),_=wt(Ye(f,"parseHTML",m));_&&(y.parseDOM=_.map(x=>Db(x,d)));const C=Ye(f,"renderHTML",m);return C&&(y.toDOM=x=>C({mark:x,HTMLAttributes:Am(x,d)})),[f.name,y]}));return new KW({topNode:s,nodes:l,marks:u})}function Ap(t,e){return e.nodes[t]||e.marks[t]||null}function Rb(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const U4=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,l)=>{var u,f;const d=((f=(u=i.type.spec).toText)===null||f===void 0?void 0:f.call(u,{node:i,pos:o,parent:s,index:l}))||i.textContent||"%leaf%";n+=d.slice(0,Math.max(0,r-o))}),n};function Gg(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class uc{constructor(e){this.find=e.find,this.handler=e.handler}}const NK=(t,e)=>{if(Gg(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function qy(t){var e;const{editor:n,from:r,to:i,text:o,rules:s,plugin:l}=t,{view:u}=n;if(u.composing)return!1;const f=u.state.doc.resolve(r);if(f.parent.type.spec.code||!((e=f.nodeBefore||f.nodeAfter)===null||e===void 0)&&e.marks.find(v=>v.type.spec.code))return!1;let d=!1;const m=U4(f)+o;return s.forEach(v=>{if(d)return;const y=NK(m,v.find);if(!y)return;const _=u.state.tr,C=Ld({state:u.state,transaction:_}),x={from:r-(y[0].length-o.length),to:i},{commands:k,chain:A,can:L}=new Id({editor:n,state:C});v.handler({state:C,range:x,match:y,commands:k,chain:A,can:L})===null||!_.steps.length||(_.setMeta(l,{transform:_,from:r,to:i,text:o}),u.dispatch(_),d=!0)}),d}function q4(t){const{editor:e,rules:n}=t,r=new on({state:{init(){return null},apply(i,o){const s=i.getMeta(r);return s||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,s,l){return qy({editor:e,from:o,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&qy({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?qy({editor:e,from:s.pos,to:s.pos,text:` -`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function K4(t){return typeof t=="number"}class Yg{constructor(e){this.find=e.find,this.handler=e.handler}}const LK=(t,e,n)=>{if(Gg(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function IK(t){const{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=t,{commands:u,chain:f,can:d}=new Id({editor:e,state:n}),m=[];return n.doc.nodesBetween(r,i,(y,_)=>{if(!y.isTextblock||y.type.spec.code)return;const C=Math.max(r,_),x=Math.min(i,_+y.content.size),k=y.textBetween(C-_,x-_,void 0,"");LK(k,o.find,s).forEach(L=>{if(L.index===void 0)return;const E=C+L.index+1,H=E+L[0].length,I={from:n.tr.mapping.map(E),to:n.tr.mapping.map(H)},q=o.handler({state:n,range:I,match:L,commands:u,chain:f,can:d,pasteEvent:s,dropEvent:l});m.push(q)})}),m.every(y=>y!==null)}function G4(t){const{editor:e,rules:n}=t;let r=null,i=!1,o=!1,s=new ClipboardEvent("paste"),l=new DragEvent("drop");return n.map(f=>new on({view(d){const m=v=>{var y;r=!((y=d.dom.parentElement)===null||y===void 0)&&y.contains(v.target)?d.dom.parentElement:null};return window.addEventListener("dragstart",m),{destroy(){window.removeEventListener("dragstart",m)}}},props:{handleDOMEvents:{drop:(d,m)=>(o=r===d.dom.parentElement,l=m,!1),paste:(d,m)=>{var v;const y=(v=m.clipboardData)===null||v===void 0?void 0:v.getData("text/html");return s=m,i=!!(y!=null&&y.includes("data-pm-slice")),!1}}},appendTransaction:(d,m,v)=>{const y=d[0],_=y.getMeta("uiEvent")==="paste"&&!i,C=y.getMeta("uiEvent")==="drop"&&!o;if(!_&&!C)return;const x=m.doc.content.findDiffStart(v.doc.content),k=m.doc.content.findDiffEnd(v.doc.content);if(!K4(x)||!k||x===k.b)return;const A=v.tr,L=Ld({state:v,transaction:A});if(!(!IK({editor:e,state:L,from:Math.max(x-1,0),to:k.b-1,rule:f,pasteEvent:s,dropEvent:l})||!A.steps.length))return l=new DragEvent("drop"),s=new ClipboardEvent("paste"),A}}))}function Y4(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return[...new Set(e)]}class Ua{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=Ua.resolve(e),this.schema=Q_(this.extensions,n),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:Ap(r.name,this.schema)};r.type==="mark"&&(!((i=wt(Ye(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const s=Ye(r,"onBeforeCreate",o);s&&this.editor.on("beforeCreate",s);const l=Ye(r,"onCreate",o);l&&this.editor.on("create",l);const u=Ye(r,"onUpdate",o);u&&this.editor.on("update",u);const f=Ye(r,"onSelectionUpdate",o);f&&this.editor.on("selectionUpdate",f);const d=Ye(r,"onTransaction",o);d&&this.editor.on("transaction",d);const m=Ye(r,"onFocus",o);m&&this.editor.on("focus",m);const v=Ye(r,"onBlur",o);v&&this.editor.on("blur",v);const y=Ye(r,"onDestroy",o);y&&this.editor.on("destroy",y)})}static resolve(e){const n=Ua.sort(Ua.flatten(e)),r=Y4(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=Ye(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=Ye(r,"priority")||100,s=Ye(i,"priority")||100;return o>s?-1:o{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Ap(n.name,this.schema)},i=Ye(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=Ua.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{const l={name:s.name,options:s.options,storage:s.storage,editor:e,type:Ap(s.name,this.schema)},u=[],f=Ye(s,"addKeyboardShortcuts",l);let d={};if(s.type==="mark"&&s.config.exitable&&(d.ArrowRight=()=>or.handleExit({editor:e,mark:s})),f){const C=Object.fromEntries(Object.entries(f()).map(([x,k])=>[x,()=>k({editor:e})]));d={...d,...C}}const m=iK(d);u.push(m);const v=Ye(s,"addInputRules",l);Rb(s,e.options.enableInputRules)&&v&&r.push(...v());const y=Ye(s,"addPasteRules",l);Rb(s,e.options.enablePasteRules)&&y&&i.push(...y());const _=Ye(s,"addProseMirrorPlugins",l);if(_){const C=_();u.push(...C)}return u}).flat();return[q4({editor:e,rules:r}),...G4({editor:e,rules:i}),...o]}get attributes(){return X_(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=Pd(this.extensions);return Object.fromEntries(n.filter(r=>!!Ye(r,"addNodeView")).map(r=>{const i=this.attributes.filter(u=>u.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:Hn(r.name,this.schema)},s=Ye(r,"addNodeView",o);if(!s)return[];const l=(u,f,d,m)=>{const v=Am(u,i);return s()({editor:e,node:u,getPos:d,decorations:m,HTMLAttributes:v,extension:r})};return[r.name,l]}))}}function PK(t){return Object.prototype.toString.call(t).slice(8,-1)}function Op(t){return PK(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Dd(t,e){const n={...t};return Op(t)&&Op(e)&&Object.keys(e).forEach(r=>{Op(e[r])?r in t?n[r]=Dd(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})}),n}class ir{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=wt(Ye(this,"addOptions",{name:this.name}))),this.storage=wt(Ye(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new ir(e)}configure(e={}){const n=this.extend();return n.options=Dd(this.options,e),n.storage=wt(Ye(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new ir({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=wt(Ye(n,"addOptions",{name:n.name})),n.storage=wt(Ye(n,"addStorage",{name:n.name,options:n.options})),n}}function ew(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=` - -`,textSerializers:s={}}=n||{};let l="",u=!0;return t.nodesBetween(r,i,(f,d,m,v)=>{var y;const _=s==null?void 0:s[f.type.name];_?(f.isBlock&&!u&&(l+=o,u=!0),m&&(l+=_({node:f,pos:d,parent:m,index:v,range:e}))):f.isText?(l+=(y=f==null?void 0:f.text)===null||y===void 0?void 0:y.slice(Math.max(r,d)-d,i-d),u=!1):f.isBlock&&!u&&(l+=o,u=!0)}),l}function Jg(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const DK=ir.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new on({key:new xn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(d=>d.$from.pos)),l=Math.max(...o.map(d=>d.$to.pos)),u=Jg(n);return ew(r,{from:s,to:l},{textSerializers:u})}}})]}}),RK=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),zK=(t=!1)=>({commands:e})=>e.setContent("",t),BK=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(l,u)=>{if(l.type.isText)return;const{doc:f,mapping:d}=e,m=f.resolve(d.map(u)),v=f.resolve(d.map(u+l.nodeSize)),y=m.blockRange(v);if(!y)return;const _=lc(y);if(l.type.isTextblock){const{defaultType:C}=m.parent.contentMatchAt(m.index());e.setNodeMarkup(y.start,C)}(_||_===0)&&e.lift(y,_)})}),!0},$K=t=>e=>t(e),HK=()=>({state:t,dispatch:e})=>vK(t,e),FK=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new st(r.doc.resolve(s-1))),!0},VK=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const l=i.before(o),u=i.after(o);t.delete(l,u).scrollIntoView()}return!0}return!1},jK=t=>({tr:e,state:n,dispatch:r})=>{const i=Hn(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const u=o.before(s),f=o.after(s);e.delete(u,f).scrollIntoView()}return!0}return!1},WK=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},UK=()=>({state:t,dispatch:e})=>oK(t,e),qK=()=>({commands:t})=>t.keyboardShortcut("Enter"),KK=()=>({state:t,dispatch:e})=>gK(t,e);function ld(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Gg(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function zb(t,e,n={}){return t.find(r=>r.type===e&&ld(r.attrs,n))}function GK(t,e,n={}){return!!zb(t,e,n)}function Xg(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const i=zb([...r.node.marks],e,n);if(!i)return;let o=r.index,s=t.start()+r.offset,l=o+1,u=s+r.node.nodeSize;for(zb([...r.node.marks],e,n);o>0&&i.isInSet(t.parent.child(o-1).marks);)o-=1,s-=t.parent.child(o).nodeSize;for(;l({tr:n,state:r,dispatch:i})=>{const o=as(t,r.schema),{doc:s,selection:l}=n,{$from:u,from:f,to:d}=l;if(i){const m=Xg(u,o,e);if(m&&m.from<=f&&m.to>=d){const v=st.create(s,m.from,m.to);n.setSelection(v)}}return!0},JK=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{Rd()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!tw(n.state.selection))return s(),!0;const l=nw(i.doc,t)||n.state.selection,u=n.state.selection.eq(l);return o&&(u||i.setSelection(l),u&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},ZK=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),QK=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),J4=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&J4(r)}return t};function Om(t){const e=`${t}`,n=new window.DOMParser().parseFromString(e,"text/html").body;return J4(n)}function ud(t,e,n){if(n={slice:!0,parseOptions:{},...n},typeof t=="object"&&t!==null)try{return Array.isArray(t)&&t.length>0?Oe.fromArray(t.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(t)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",r),ud("",e,n)}if(typeof t=="string"){const r=Hg.fromSchema(e);return n.slice?r.parseSlice(Om(t),n.parseOptions).content:r.parse(Om(t),n.parseOptions)}return ud("",e,n)}function X4(t,e,n){const r=t.steps.length-1;if(r{s===0&&(s=d)}),t.setSelection(ht.near(t.doc.resolve(s),n))}const eG=t=>t.toString().startsWith("<"),tG=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,...n};const s=ud(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(s.toString()==="<>")return!0;let{from:l,to:u}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,d=!0;if((eG(s)?s:[s]).forEach(v=>{v.check(),f=f?v.isText&&v.marks.length===0:!1,d=d?v.isBlock:!1}),l===u&&d){const{parent:v}=r.doc.resolve(l);v.isTextblock&&!v.type.spec.code&&!v.childCount&&(l-=1,u+=1)}f?Array.isArray(e)?r.insertText(e.map(v=>v.text||"").join(""),l,u):typeof e=="object"&&e&&e.text?r.insertText(e.text,l,u):r.insertText(e,l,u):r.replaceWith(l,u,s),n.updateSelection&&X4(r,r.steps.length-1,-1)}return!0},nG=()=>({state:t,dispatch:e})=>dK(t,e),rG=()=>({state:t,dispatch:e})=>hK(t,e),iG=()=>({state:t,dispatch:e})=>sK(t,e),oG=()=>({state:t,dispatch:e})=>cK(t,e),sG=()=>({tr:t,state:e,dispatch:n})=>{try{const r=Fg(e.doc,e.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),n&&n(t),!0)}catch{return!1}},aG=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Fg(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},lG=()=>({state:t,dispatch:e})=>aK(t,e),uG=()=>({state:t,dispatch:e})=>lK(t,e);function Zg(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function cG(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let l=0;l({editor:e,view:n,tr:r,dispatch:i})=>{const o=cG(t).split(/-(?!$)/),s=o.find(f=>!["Alt","Ctrl","Meta","Shift"].includes(f)),l=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),u=e.captureTransaction(()=>{n.someProp("handleKeyDown",f=>f(n,l))});return u==null||u.steps.forEach(f=>{const d=f.map(r.mapping);d&&i&&r.maybeStep(d)}),!0};function Xu(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?Hn(e,t.schema):null,l=[];t.doc.nodesBetween(r,i,(m,v)=>{if(m.isText)return;const y=Math.max(r,v),_=Math.min(i,v+m.nodeSize);l.push({node:m,from:y,to:_})});const u=i-r,f=l.filter(m=>s?s.name===m.node.type.name:!0).filter(m=>ld(m.node.attrs,n,{strict:!1}));return o?!!f.length:f.reduce((m,v)=>m+v.to-v.from,0)>=u}const dG=(t,e={})=>({state:n,dispatch:r})=>{const i=Hn(t,n.schema);return Xu(n,i,e)?pK(n,r):!1},hG=()=>({state:t,dispatch:e})=>yK(t,e),pG=t=>({state:e,dispatch:n})=>{const r=Hn(t,e.schema);return TK(r)(e,n)},mG=()=>({state:t,dispatch:e})=>mK(t,e);function zd(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Bb(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const gG=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const l=zd(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Hn(t,r.schema)),l==="mark"&&(s=as(t,r.schema)),i&&n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(f,d)=>{o&&o===f.type&&n.setNodeMarkup(d,void 0,Bb(f.attrs,e)),s&&f.marks.length&&f.marks.forEach(m=>{s===m.type&&n.addMark(d,d+f.nodeSize,s.create(Bb(m.attrs,e)))})})}),!0):!1},vG=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),yG=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),bG=()=>({state:t,dispatch:e})=>uK(t,e),_G=()=>({state:t,dispatch:e})=>fK(t,e),wG=()=>({state:t,dispatch:e})=>bK(t,e),kG=()=>({state:t,dispatch:e})=>kK(t,e),xG=()=>({state:t,dispatch:e})=>wK(t,e);function rw(t,e,n={}){return ud(t,e,{slice:!1,parseOptions:n})}const SG=(t,e=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:s}=r,l=rw(t,i.schema,n);return o&&r.replaceWith(0,s.content.size,l).setMeta("preventUpdate",!e),!0};function cc(t,e){const n=as(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,u=>{s.push(...u.marks)});const l=s.find(u=>u.type.name===n.name);return l?{...l.attrs}:{}}function Z4(t,e){const n=new z_(t);return e.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function Q4(t){for(let e=0;e{e(r)&&n.push({node:r,pos:i})}),n}function eN(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function iw(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Bd(t){return e=>iw(e.$from,t)}function ow(t,e){const n=co.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function Qg(t,e){const n=Ua.resolve(t);return Q_(n,e)}function TG(t,e){const n=Qg(e),r=Wo.fromJSON(n,t);return ow(r.content,n)}function EG(t,e){const n=Qg(e),r=Om(t);return Hg.fromSchema(n).parse(r).toJSON()}function sw(t,e){const n={from:0,to:t.content.size};return ew(t,n,e)}function AG(t,e,n){const{blockSeparator:r=` - -`,textSerializers:i={}}=n||{},o=Qg(e),s=Wo.fromJSON(o,t);return sw(s,{blockSeparator:r,textSerializers:{...Jg(o),...i}})}function tN(t,e){const n=Hn(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,l=>{o.push(l)});const s=o.reverse().find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function aw(t,e){const n=zd(typeof e=="string"?e:e.name,t.schema);return n==="node"?tN(t,e):n==="mark"?cc(t,e):{}}function nN(t,e=JSON.stringify){const n={};return t.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function OG(t){const e=nN(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function rN(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,o)=>{const s=[];if(i.ranges.length)i.forEach((l,u)=>{s.push({from:l,to:u})});else{const{from:l,to:u}=n[o];if(l===void 0||u===void 0)return;s.push({from:l,to:u})}s.forEach(({from:l,to:u})=>{const f=e.slice(o).map(l,-1),d=e.slice(o).map(u),m=e.invert().map(f,-1),v=e.invert().map(d);r.push({oldRange:{from:m,to:v},newRange:{from:f,to:d}})})}),OG(r)}function iN(t,e=0){const r=t.type===t.type.schema.topNodeType?0:1,i=e,o=i+t.nodeSize,s=t.marks.map(f=>{const d={type:f.type.name};return Object.keys(f.attrs).length&&(d.attrs={...f.attrs}),d}),l={...t.attrs},u={type:t.type.name,from:i,to:o};return Object.keys(l).length&&(u.attrs=l),s.length&&(u.marks=s),t.content.childCount&&(u.content=[],t.forEach((f,d)=>{var m;(m=u.content)===null||m===void 0||m.push(iN(f,e+d+r))})),t.text&&(u.text=t.text),u}function ev(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t-1),s=Xg(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}const MG=(t,e,n,r=20)=>{const i=t.doc.resolve(n);let o=r,s=null;for(;o>0&&s===null;){const l=i.node(o);(l==null?void 0:l.type.name)===e?s=l:o-=1}return[s,o]};function Sf(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function Mm(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?as(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(m=>o?o.name===m.type.name:!0).find(m=>ld(m.attrs,n,{strict:!1}));let s=0;const l=[];if(i.forEach(({$from:m,$to:v})=>{const y=m.pos,_=v.pos;t.doc.nodesBetween(y,_,(C,x)=>{if(!C.isText&&!C.marks.length)return;const k=Math.max(y,x),A=Math.min(_,x+C.nodeSize),L=A-k;s+=L,l.push(...C.marks.map(E=>({mark:E,from:k,to:A})))})}),s===0)return!1;const u=l.filter(m=>o?o.name===m.mark.type.name:!0).filter(m=>ld(m.mark.attrs,n,{strict:!1})).reduce((m,v)=>m+v.to-v.from,0),f=l.filter(m=>o?m.mark.type!==o&&m.mark.type.excludes(o):!0).reduce((m,v)=>m+v.to-v.from,0);return(u>0?u+f:u)>=s}function oN(t,e,n={}){if(!e)return Xu(t,null,n)||Mm(t,null,n);const r=zd(e,t.schema);return r==="node"?Xu(t,e,n):r==="mark"?Mm(t,e,n):!1}const NG=(t,e)=>{const{$from:n,$to:r,$anchor:i}=t.selection;if(e){const o=Bd(l=>l.type.name===e)(t.selection);if(!o)return!1;const s=t.doc.resolve(o.pos+1);return i.pos+1===s.end()}return!(r.parentOffset{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function $b(t,e){const{nodeExtensions:n}=Pd(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=wt(Ye(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function lw(t){var e;const n=(e=t.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),r=t.toJSON();return JSON.stringify(n)===JSON.stringify(r)}function IG(t){return t instanceof it}function PG(t,e,n){const i=t.state.doc.content.size,o=ho(e,0,i),s=ho(n,0,i),l=t.coordsAtPos(o),u=t.coordsAtPos(s,-1),f=Math.min(l.top,u.top),d=Math.max(l.bottom,u.bottom),m=Math.min(l.left,u.left),v=Math.max(l.right,u.right),y=v-m,_=d-f,k={top:f,bottom:d,left:m,right:v,width:y,height:_,x:m,y:f};return{...k,toJSON:()=>k}}function DG(t,e,n){var r;const{selection:i}=e;let o=null;if(tw(i)&&(o=i.$cursor),o){const l=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(l)||!l.some(u=>u.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:l,$to:u})=>{let f=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,u.pos,(d,m,v)=>{if(f)return!1;if(d.isInline){const y=!v||v.type.allowsMarkType(n),_=!!n.isInSet(d.marks)||!d.marks.some(C=>C.type.excludes(n));f=y&&_}return!f}),f})}const RG=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:l}=o,u=as(t,r.schema);if(i)if(s){const f=cc(r,u);n.addStoredMark(u.create({...f,...e}))}else l.forEach(f=>{const d=f.$from.pos,m=f.$to.pos;r.doc.nodesBetween(d,m,(v,y)=>{const _=Math.max(y,d),C=Math.min(y+v.nodeSize,m);v.marks.find(k=>k.type===u)?v.marks.forEach(k=>{u===k.type&&n.addMark(_,C,u.create({...k.attrs,...e}))}):n.addMark(_,C,u.create(e))})});return DG(r,n,u)},zG=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),BG=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Hn(t,n.schema);return o.isTextblock?i().command(({commands:s})=>iT(o,e)(n)?!0:s.clearNodes()).command(({state:s})=>iT(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},$G=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=ho(t,0,r.content.size),o=it.create(r,i);e.setSelection(o)}return!0},HG=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=st.atStart(r).from,l=st.atEnd(r).to,u=ho(i,s,l),f=ho(o,s,l),d=st.create(r,u,f);e.setSelection(d)}return!0},FG=t=>({state:e,dispatch:n})=>{const r=Hn(t,e.schema);return OK(r)(e,n)};function sT(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const VG=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:l,$to:u}=o,f=i.extensionManager.attributes,d=Sf(f,l.node().type.name,l.node().attrs);if(o instanceof it&&o.node.isBlock)return!l.parentOffset||!Mu(s,l.pos)?!1:(r&&(t&&sT(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(r){const m=u.parentOffset===u.parent.content.size;o instanceof st&&e.deleteSelection();const v=l.depth===0?void 0:Q4(l.node(-1).contentMatchAt(l.indexAfter(-1)));let y=m&&v?[{type:v,attrs:d}]:void 0,_=Mu(e.doc,e.mapping.map(l.pos),1,y);if(!y&&!_&&Mu(e.doc,e.mapping.map(l.pos),1,v?[{type:v}]:void 0)&&(_=!0,y=v?[{type:v,attrs:d}]:void 0),_&&(e.split(e.mapping.map(l.pos),1,y),v&&!m&&!l.parentOffset&&l.parent.type!==v)){const C=e.mapping.map(l.before()),x=e.doc.resolve(C);l.node(-1).canReplaceWith(x.index(),x.index()+1,v)&&e.setNodeMarkup(e.mapping.map(l.before()),v)}t&&sT(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},jG=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var o;const s=Hn(t,n.schema),{$from:l,$to:u}=n.selection,f=n.selection.node;if(f&&f.isBlock||l.depth<2||!l.sameParent(u))return!1;const d=l.node(-1);if(d.type!==s)return!1;const m=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==s||l.index(-2)!==l.node(-2).childCount-1)return!1;if(r){let x=Oe.empty;const k=l.index(-1)?1:l.index(-2)?2:3;for(let q=l.depth-k;q>=l.depth-3;q-=1)x=Oe.from(l.node(q).copy(x));const A=l.indexAfter(-1){if(I>-1)return!1;q.isTextblock&&q.content.size===0&&(I=P+1)}),I>-1&&e.setSelection(st.near(e.doc.resolve(I))),e.scrollIntoView()}return!0}const v=u.pos===l.end()?d.contentMatchAt(0).defaultType:null,y=Sf(m,d.type.name,d.attrs),_=Sf(m,l.node().type.name,l.node().attrs);e.delete(l.pos,u.pos);const C=v?[{type:s,attrs:y},{type:v,attrs:_}]:[{type:s,attrs:y}];if(!Mu(e.doc,l.pos,2))return!1;if(r){const{selection:x,storedMarks:k}=n,{splittableMarks:A}=i.extensionManager,L=k||x.$to.parentOffset&&x.$from.marks();if(e.split(l.pos,2,C).scrollIntoView(),!L||!r)return!0;const E=L.filter(H=>A.includes(H.type.name));e.ensureMarks(E)}return!0},Ky=(t,e)=>{const n=Bd(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&pa(t.doc,n.pos)&&t.join(n.pos),!0},Gy=(t,e)=>{const n=Bd(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&pa(t.doc,r)&&t.join(r),!0},WG=(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:u,commands:f,can:d})=>{const{extensions:m,splittableMarks:v}=i.extensionManager,y=Hn(t,s.schema),_=Hn(e,s.schema),{selection:C,storedMarks:x}=s,{$from:k,$to:A}=C,L=k.blockRange(A),E=x||C.$to.parentOffset&&C.$from.marks();if(!L)return!1;const H=Bd(I=>$b(I.type.name,m))(C);if(L.depth>=1&&H&&L.depth-H.depth<=1){if(H.node.type===y)return f.liftListItem(_);if($b(H.node.type.name,m)&&y.validContent(H.node.content)&&l)return u().command(()=>(o.setNodeMarkup(H.pos,y),!0)).command(()=>Ky(o,y)).command(()=>Gy(o,y)).run()}return!n||!E||!l?u().command(()=>d().wrapInList(y,r)?!0:f.clearNodes()).wrapInList(y,r).command(()=>Ky(o,y)).command(()=>Gy(o,y)).run():u().command(()=>{const I=d().wrapInList(y,r),q=E.filter(P=>v.includes(P.type.name));return o.ensureMarks(q),I?!0:f.clearNodes()}).wrapInList(y,r).command(()=>Ky(o,y)).command(()=>Gy(o,y)).run()},UG=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=as(t,r.schema);return Mm(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},qG=(t,e,n={})=>({state:r,commands:i})=>{const o=Hn(t,r.schema),s=Hn(e,r.schema);return Xu(r,o,n)?i.setNode(s):i.setNode(o,n)},KG=(t,e={})=>({state:n,commands:r})=>{const i=Hn(t,n.schema);return Xu(n,i,e)?r.lift(i):r.wrapIn(i,e)},GG=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r=0;u-=1)s.step(l.steps[u].invert(l.docs[u]));if(o.text){const u=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,u))}else s.delete(o.from,o.to)}return!0}}return!1},YG=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},JG=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:l}=n,u=as(t,r.schema),{$from:f,empty:d,ranges:m}=l;if(!i)return!0;if(d&&s){let{from:v,to:y}=l;const _=(o=f.marks().find(x=>x.type===u))===null||o===void 0?void 0:o.attrs,C=Xg(f,u,_);C&&(v=C.from,y=C.to),n.removeMark(v,y,u)}else m.forEach(v=>{n.removeMark(v.$from.pos,v.$to.pos,u)});return n.removeStoredMark(u),!0},XG=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const l=zd(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(o=Hn(t,r.schema)),l==="mark"&&(s=as(t,r.schema)),i&&n.selection.ranges.forEach(u=>{const f=u.$from.pos,d=u.$to.pos;r.doc.nodesBetween(f,d,(m,v)=>{o&&o===m.type&&n.setNodeMarkup(v,void 0,{...m.attrs,...e}),s&&m.marks.length&&m.marks.forEach(y=>{if(s===y.type){const _=Math.max(v,f),C=Math.min(v+m.nodeSize,d);n.addMark(_,C,s.create({...y.attrs,...e}))}})})}),!0):!1},ZG=(t,e={})=>({state:n,dispatch:r})=>{const i=Hn(t,n.schema);return xK(i,e)(n,r)},QG=(t,e={})=>({state:n,dispatch:r})=>{const i=Hn(t,n.schema);return SK(i,e)(n,r)};var eY=Object.freeze({__proto__:null,blur:RK,clearContent:zK,clearNodes:BK,command:$K,createParagraphNear:HK,cut:FK,deleteCurrentNode:VK,deleteNode:jK,deleteRange:WK,deleteSelection:UK,enter:qK,exitCode:KK,extendMarkRange:YK,first:JK,focus:XK,forEach:ZK,insertContent:QK,insertContentAt:tG,joinUp:nG,joinDown:rG,joinBackward:iG,joinForward:oG,joinItemBackward:sG,joinItemForward:aG,joinTextblockBackward:lG,joinTextblockForward:uG,keyboardShortcut:fG,lift:dG,liftEmptyBlock:hG,liftListItem:pG,newlineInCode:mG,resetAttributes:gG,scrollIntoView:vG,selectAll:yG,selectNodeBackward:bG,selectNodeForward:_G,selectParentNode:wG,selectTextblockEnd:kG,selectTextblockStart:xG,setContent:SG,setMark:RG,setMeta:zG,setNode:BG,setNodeSelection:$G,setTextSelection:HG,sinkListItem:FG,splitBlock:VG,splitListItem:jG,toggleList:WG,toggleMark:UG,toggleNode:qG,toggleWrap:KG,undoInputRule:GG,unsetAllMarks:YG,unsetMark:JG,updateAttributes:XG,wrapIn:ZG,wrapInList:QG});const tY=ir.create({name:"commands",addCommands(){return{...eY}}}),nY=ir.create({name:"editable",addProseMirrorPlugins(){return[new on({key:new xn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),rY=ir.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new on({key:new xn("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),iY=ir.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{const{selection:u,doc:f}=l,{empty:d,$anchor:m}=u,{pos:v,parent:y}=m,_=m.parent.isTextblock?l.doc.resolve(v-1):m,C=_.parent.type.spec.isolating,x=m.pos-m.parentOffset,k=C&&_.parent.childCount===1?x===m.pos:ht.atStart(f).from===v;return!d||!k||!y.type.isTextblock||y.textContent.length?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Rd()||Zg()?o:i},addProseMirrorPlugins(){return[new on({key:new xn("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(_=>_.docChanged)&&!e.doc.eq(n.doc)))return;const{empty:i,from:o,to:s}=e.selection,l=ht.atStart(e.doc).from,u=ht.atEnd(e.doc).to;if(i||!(o===l&&s===u)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const m=n.tr,v=Ld({state:n,transaction:m}),{commands:y}=new Id({editor:this.editor,state:v});if(y.clearNodes(),!!m.steps.length)return m}})]}}),oY=ir.create({name:"tabindex",addProseMirrorPlugins(){return[new on({key:new xn("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var sN=Object.freeze({__proto__:null,ClipboardTextSerializer:DK,Commands:tY,Editable:nY,FocusEvents:rY,Keymap:iY,Tabindex:oY});class Fs{constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Fs(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Fs(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Fs(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=this.pos+r+(i?0:1),s=this.resolvedPos.doc.resolve(o);if(!i&&s.depth<=this.depth)return;const l=new Fs(s,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),e.push(new Fs(s,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let l=0;l{if(o.node.type.name===e){if(Object.keys(n).length>0){const s=o.node.attrs,l=Object.keys(n);for(let u=0;u>>>>>>> origin/craft-4:src/web/assets/field/dist/assets/vizy-91fcee7d.js - position: relative; -} - -.ProseMirror { - word-wrap: break-word; - white-space: pre-wrap; - white-space: break-spaces; - -webkit-font-variant-ligatures: none; - font-variant-ligatures: none; - font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ -} - -.ProseMirror [contenteditable="false"] { - white-space: normal; -} - -.ProseMirror [contenteditable="false"] [contenteditable="true"] { - white-space: pre-wrap; -} - -.ProseMirror pre { - white-space: pre-wrap; -} - -img.ProseMirror-separator { - display: inline !important; - border: none !important; - margin: 0 !important; - width: 1px !important; - height: 1px !important; -} - -.ProseMirror-gapcursor { - display: none; - pointer-events: none; - position: absolute; - margin: 0; -} - -.ProseMirror-gapcursor:after { - content: ""; - display: block; - position: absolute; - top: -2px; - width: 20px; - border-top: 1px solid black; - animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; -} - -@keyframes ProseMirror-cursor-blink { - to { - visibility: hidden; - } -} - -.ProseMirror-hideselection *::selection { - background: transparent; -} - -.ProseMirror-hideselection *::-moz-selection { - background: transparent; -} - -.ProseMirror-hideselection * { - caret-color: transparent; -} - -.ProseMirror-focused .ProseMirror-gapcursor { - display: block; -} - -.tippy-box[data-animation=fade][data-state=hidden] { - opacity: 0 -<<<<<<<< HEAD:src/web/assets/field/dist/assets/vizy-1d31d33d.js -}`;function sL(t,e,n){const r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute(`data-tiptap-style${n?`-${n}`:""}`,""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}let aL=class extends MK{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=sL(sY,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=Z_(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;const n=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){const n=[...this.options.enableCoreExtensions?Object.values(oL):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new Ua(n,this)}createCommandManager(){this.commandManager=new Nd({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=rw(this.options.content,this.schema,this.options.parseOptions),n=nw(e,this.options.autofocus);this.view=new Gq(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:du.create({doc:e,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var l;return(l=this.capturedTransaction)===null||l===void 0?void 0:l.step(s)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return aw(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return iL(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ow(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=` - -`,textSerializers:r={}}=e||{};return sw(this.state.doc,{blockSeparator:n,textSerializers:{...Yg(this.schema),...r}})}get isEmpty(){return lw(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new Fs(n,this)}get $doc(){return this.$pos(0)}};function oa(t){return new uc({find:t.find,handler:({state:e,range:n,match:r})=>{const i=wt(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],l=r[0];if(s){const u=l.search(/\S/),f=n.from+l.indexOf(s),d=f+s.length;if(Qg(n.from,n.to,e.doc).filter(y=>y.mark.type.excluded.find(C=>C===t.type&&C!==y.mark.type)).filter(y=>y.to>f).length)return null;dn.from&&o.delete(n.from+u,f);const v=n.from+u+s.length;o.addMark(n.from+u,v,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function uw(t){return new uc({find:t.find,handler:({state:e,range:n,match:r})=>{const i=wt(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from;let l=n.to;const u=t.type.create(i);if(r[1]){const f=r[0].lastIndexOf(r[1]);let d=s+f;d>l?d=l:l=d+r[1].length;const m=r[0][r[0].length-1];o.insertText(m,s+r[0].length-1),o.replaceWith(d,l,u)}else r[0]&&o.insert(s-1,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l));o.scrollIntoView()}})}function Mm(t){return new uc({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),o=wt(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function aY(t){return new uc({find:t.find,handler:({state:e,range:n,match:r})=>{let i=t.replace,o=n.from;const s=n.to;if(r[1]){const l=r[0].lastIndexOf(r[1]);i+=r[0].slice(l+r[1].length),o+=l;const u=o-s;u>0&&(i=r[0].slice(l-u,l)+i,o=s)}e.tr.insertText(i,o,s)}})}function Zu(t){return new uc({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const o=wt(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),u=s.doc.resolve(n.from).blockRange(),f=u&&R_(u,t.type,o);if(!f)return null;if(s.wrap(u,f),t.keepMarks&&t.editor){const{selection:m,storedMarks:v}=e,{splittableMarks:y}=t.editor.extensionManager,_=v||m.$to.parentOffset&&m.$from.marks();if(_){const C=_.filter(x=>y.includes(x.type.name));s.ensureMarks(C)}}if(t.keepAttributes){const m=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(m,o).run()}const d=s.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&pa(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,d))&&s.join(n.from-1)}})}class or{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=wt(Ye(this,"addOptions",{name:this.name}))),this.storage=wt(Ye(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new or(e)}configure(e={}){const n=this.extend();return n.options=Pd(this.options,e),n.storage=wt(Ye(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new or({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=wt(Ye(n,"addOptions",{name:n.name})),n.storage=wt(Ye(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(f=>(f==null?void 0:f.type.name)===n.name))return!1;const u=s.find(f=>(f==null?void 0:f.type.name)===n.name);return u&&r.removeStoredMark(u),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}let _n=class Hb{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=wt(Ye(this,"addOptions",{name:this.name}))),this.storage=wt(Ye(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Hb(e)}configure(e={}){const n=this.extend();return n.options=Pd(this.options,e),n.storage=wt(Ye(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new Hb({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=wt(Ye(n,"addOptions",{name:n.name})),n.storage=wt(Ye(n,"addStorage",{name:n.name,options:n.options})),n}};function lY(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}class lL{constructor(e,n,r){this.isDragging=!1,this.component=e,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var n,r,i,o,s,l,u;const{view:f}=this.editor,d=e.target,m=d.nodeType===3?(n=d.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):d.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(d)||!m)return;let v=0,y=0;if(this.dom!==m){const x=this.dom.getBoundingClientRect(),k=m.getBoundingClientRect(),A=(i=e.offsetX)!==null&&i!==void 0?i:(o=e.nativeEvent)===null||o===void 0?void 0:o.offsetX,N=(s=e.offsetY)!==null&&s!==void 0?s:(l=e.nativeEvent)===null||l===void 0?void 0:l.offsetY;v=k.x-x.x+A,y=k.y-x.y+N}(u=e.dataTransfer)===null||u===void 0||u.setDragImage(this.dom,v,y);const _=it.create(f.state.doc,this.getPos()),C=f.state.tr.setSelection(_);f.dispatch(C)}stopEvent(e){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const r=e.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const o=e.type.startsWith("drag"),s=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!s&&!o)return!0;const{isEditable:u}=this.editor,{isDragging:f}=this,d=!!this.node.type.spec.draggable,m=it.isSelectable(this.node),v=e.type==="copy",y=e.type==="paste",_=e.type==="cut",C=e.type==="mousedown";if(!d&&m&&o&&e.preventDefault(),d&&o&&!f)return e.preventDefault(),!1;if(d&&u&&!f&&C){const x=r.closest("[data-drag-handle]");x&&(this.dom===x||this.dom.contains(x))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(f||s||v||y||_||C&&m)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(Dd()||lY())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return n.setNodeMarkup(r,void 0,{...this.node.attrs,...e}),!0})}deleteNode(){const e=this.getPos(),n=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:n})}}function Yo(t){return new Gg({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const o=wt(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,l=r[r.length-1],u=r[0];let f=n.to;if(l){const d=u.search(/\S/),m=n.from+u.indexOf(l),v=m+l.length;if(Qg(n.from,n.to,e.doc).filter(_=>_.mark.type.excluded.find(x=>x===t.type&&x!==_.mark.type)).filter(_=>_.to>m).length)return null;vn.from&&s.delete(n.from+d,m),f=n.from+d+l.length,s.addMark(n.from+d,f,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}function uL(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function uY(t){return typeof t=="string"}function cY(t){return new Gg({find:t.find,handler({match:e,chain:n,range:r,pasteEvent:i}){const o=wt(t.getAttributes,void 0,e,i);if(o===!1||o===null)return null;e.input&&n().deleteRange(r).insertContentAt(r.from,{type:t.type.name,attrs:o})}})}function fY(t){return new Gg({find:t.find,handler:({state:e,range:n,match:r})=>{let i=t.replace,o=n.from;const s=n.to;if(r[1]){const l=r[0].lastIndexOf(r[1]);i+=r[0].slice(l+r[1].length),o+=l;const u=o-s;u>0&&(i=r[0].slice(l-u,l)+i,o=s)}e.tr.insertText(i,o,s)}})}class dY{constructor(e){this.transaction=e,this.currentStep=this.transaction.steps.length}map(e){let n=!1;return{position:this.transaction.steps.slice(this.currentStep).reduce((i,o)=>{const s=o.getMap().mapResult(i);return s.deleted&&(n=!0),s.pos},e),deleted:n}}}const hY=Object.freeze(Object.defineProperty({__proto__:null,CommandManager:Nd,Editor:aL,Extension:ir,InputRule:uc,Mark:or,Node:_n,NodePos:Fs,NodeView:lL,PasteRule:Gg,Tracker:dY,callOrReturn:wt,combineTransactionSteps:X4,createChainableState:Ld,createDocument:rw,createNodeFromContent:ld,createStyleTag:sL,defaultBlockAt:Z4,deleteProps:Bb,elementFromString:Am,escapeForRegEx:uL,extensions:oL,findChildren:CG,findChildrenInRange:Q4,findDuplicates:G4,findParentNode:zd,findParentNodeClosestToPos:iw,fromString:j4,generateHTML:TG,generateJSON:EG,generateText:AG,getAttributes:aw,getAttributesFromExtensions:X_,getChangedRanges:nL,getDebugJSON:rL,getExtensionField:Ye,getHTMLFromFragment:ow,getMarkAttributes:cc,getMarkRange:Jg,getMarkType:as,getMarksBetween:Qg,getNodeAtPosition:MG,getNodeAttributes:eL,getNodeType:Hn,getRenderedAttributes:Em,getSchema:Zg,getSchemaByResolvedExtensions:Q_,getSchemaTypeByName:Ep,getSchemaTypeNameByName:Rd,getSplittedAttributes:Sf,getText:sw,getTextBetween:ew,getTextContentFromNodes:W4,getTextSerializersFromSchema:Yg,injectExtensionAttributesToParseRule:Db,inputRulesPlugin:U4,isActive:iL,isAtEndOfNode:LG,isAtStartOfNode:NG,isEmptyObject:V4,isExtensionRulesEnabled:Rb,isFunction:Z_,isList:$b,isMacOS:Xg,isMarkActive:Om,isNodeActive:Xu,isNodeEmpty:lw,isNodeSelection:IG,isNumber:q4,isPlainObject:Ap,isRegExp:Kg,isString:uY,isTextSelection:tw,isiOS:Dd,markInputRule:oa,markPasteRule:Yo,mergeAttributes:zt,mergeDeep:Pd,minMax:ho,nodeInputRule:uw,nodePasteRule:cY,objectIncludes:ad,pasteRulesPlugin:K4,posToDOMRect:PG,removeDuplicates:tL,resolveFocusPosition:nw,selectionToInsertionEnd:J4,splitExtensions:Id,textInputRule:aY,textPasteRule:fY,textblockTypeInputRule:Mm,wrappingInputRule:Zu},Symbol.toStringTag,{value:"Module"})),pY=[{name:"bold",svg:"bold",title:Craft.t("vizy","Bold"),action:t=>t.chain().focus().toggleBold().run(),isActive:t=>t.isActive("bold")},{name:"italic",svg:"italic",title:Craft.t("vizy","Italic"),action:t=>t.chain().focus().toggleItalic().run(),isActive:t=>t.isActive("italic")},{name:"strikethrough",svg:"strikethrough",title:Craft.t("vizy","Strike"),action:t=>t.chain().focus().toggleStrike().run(),isActive:t=>t.isActive("strike")},{name:"subscript",svg:"subscript",title:Craft.t("vizy","Subscript"),action:t=>t.chain().focus().toggleSubscript().run(),isActive:t=>t.isActive("subscript")},{name:"superscript",svg:"superscript",title:Craft.t("vizy","Superscript"),action:t=>t.chain().focus().toggleSuperscript().run(),isActive:t=>t.isActive("superscript")},{name:"underline",svg:"underline",title:Craft.t("vizy","Underline"),action:t=>t.chain().focus().toggleUnderline().run(),isActive:t=>t.isActive("underline")},{name:"code",svg:"brackets-curly",title:Craft.t("vizy","Inline Code"),action:t=>t.chain().focus().toggleCode().run(),isActive:t=>t.isActive("code")},{name:"highlight",icon:"highlighter",title:Craft.t("vizy","Highlight"),action:t=>t.chain().focus().toggleHighlight().run(),isActive:t=>t.isActive("highlight")},{name:"paragraph",svg:"text",title:Craft.t("vizy","Paragraph"),action:t=>t.chain().focus().setParagraph().run(),isActive:t=>t.isActive("paragraph")},{name:"unordered-list",svg:"list-ul",title:Craft.t("vizy","Bullet List"),action:t=>t.chain().focus().toggleBulletList().run(),isActive:t=>t.isActive("bulletList")},{name:"ordered-list",svg:"list-ol",title:Craft.t("vizy","Ordered List"),action:t=>t.chain().focus().toggleOrderedList().run(),isActive:t=>t.isActive("orderedList")},{name:"code-block",svg:"code",title:Craft.t("vizy","Code Block"),action:t=>t.chain().focus().toggleCodeBlock().run(),isActive:t=>t.isActive("codeBlock")},{name:"blockquote",svg:"quote-right",title:Craft.t("vizy","Blockquote"),action:t=>t.chain().focus().toggleBlockquote().run(),isActive:t=>t.isActive("blockquote")},{name:"h1",svg:"h1",title:Craft.t("vizy","Heading 1"),action:t=>t.chain().focus().toggleHeading({level:1}).run(),isActive:t=>t.isActive("heading",{level:1})},{name:"h2",svg:"h2",title:Craft.t("vizy","Heading 2"),action:t=>t.chain().focus().toggleHeading({level:2}).run(),isActive:t=>t.isActive("heading",{level:2})},{name:"h3",svg:"h3",title:Craft.t("vizy","Heading 3"),action:t=>t.chain().focus().toggleHeading({level:3}).run(),isActive:t=>t.isActive("heading",{level:3})},{name:"h4",svg:"h4",title:Craft.t("vizy","Heading 4"),action:t=>t.chain().focus().toggleHeading({level:4}).run(),isActive:t=>t.isActive("heading",{level:4})},{name:"h5",svg:"h5",title:Craft.t("vizy","Heading 5"),action:t=>t.chain().focus().toggleHeading({level:5}).run(),isActive:t=>t.isActive("heading",{level:5})},{name:"h6",svg:"h6",title:Craft.t("vizy","Heading 6"),action:t=>t.chain().focus().toggleHeading({level:6}).run(),isActive:t=>t.isActive("heading",{level:6})},{name:"hr",svg:"horizontal-rule",title:Craft.t("vizy","Horizontal Rule"),action:t=>t.chain().focus().setHorizontalRule().run(),isActive:t=>t.isActive("hr")},{name:"line-break",svg:"page-break",title:Craft.t("vizy","Line Break"),action:t=>t.chain().focus().setHardBreak().run()},{name:"clear-format",svg:"remove-format",title:Craft.t("vizy","Clear Format"),action:t=>t.chain().focus().clearNodes().unsetAllMarks().run()},{name:"undo",svg:"undo",title:Craft.t("vizy","Undo"),action:t=>t.chain().focus().undo().run()},{name:"redo",svg:"redo",title:Craft.t("vizy","Redo"),action:t=>t.chain().focus().redo().run()},{name:"align-left",icon:"align-left",title:Craft.t("vizy","Align Left"),action:t=>t.chain().focus().setTextAlign("left").run(),isActive:t=>t.isActive({textAlign:"left"})},{name:"align-center",icon:"align-center",title:Craft.t("vizy","Align Center"),action:t=>t.chain().focus().setTextAlign("center").run(),isActive:t=>t.isActive({textAlign:"center"})},{name:"align-right",icon:"align-right",title:Craft.t("vizy","Align Right"),action:t=>t.chain().focus().setTextAlign("right").run(),isActive:t=>t.isActive({textAlign:"right"})},{name:"align-justify",icon:"align-justify",title:Craft.t("vizy","Align Justify"),action:t=>t.chain().focus().setTextAlign("justify").run(),isActive:t=>t.isActive({textAlign:"justify"})},{name:"formatting",icon:"paragraph",title:Craft.t("vizy","Formatting"),options:[{name:"paragraph",title:Craft.t("vizy","Paragraph"),action:t=>t.chain().focus().setParagraph().run(),isActive:t=>t.isActive("paragraph")},{name:"code-block",title:Craft.t("vizy","Code Block"),action:t=>t.chain().focus().toggleCodeBlock().run(),isActive:t=>t.isActive("codeBlock")},{name:"blockquote",title:Craft.t("vizy","Blockquote"),action:t=>t.chain().focus().toggleBlockquote().run(),isActive:t=>t.isActive("blockquote")},{name:"h1",title:Craft.t("vizy","Heading 1"),action:t=>t.chain().focus().toggleHeading({level:1}).run(),isActive:t=>t.isActive("heading",{level:1})},{name:"h2",title:Craft.t("vizy","Heading 2"),action:t=>t.chain().focus().toggleHeading({level:2}).run(),isActive:t=>t.isActive("heading",{level:2})},{name:"h3",title:Craft.t("vizy","Heading 3"),action:t=>t.chain().focus().toggleHeading({level:3}).run(),isActive:t=>t.isActive("heading",{level:3})},{name:"h4",title:Craft.t("vizy","Heading 4"),action:t=>t.chain().focus().toggleHeading({level:4}).run(),isActive:t=>t.isActive("heading",{level:4})},{name:"h5",title:Craft.t("vizy","Heading 5"),action:t=>t.chain().focus().toggleHeading({level:5}).run(),isActive:t=>t.isActive("heading",{level:5})},{name:"h6",title:Craft.t("vizy","Heading 6"),action:t=>t.chain().focus().toggleHeading({level:6}).run(),isActive:t=>t.isActive("heading",{level:6})}]},{name:"table",svg:"table",title:Craft.t("vizy","Table"),isActive:t=>t.isActive("table"),options:[{name:"insert-table",title:Craft.t("vizy","Insert Table"),action:t=>t.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run()},{name:"delete-table",title:Craft.t("vizy","Delete Table"),action:t=>t.chain().focus().deleteTable().run()},{name:"add-col-before",title:Craft.t("vizy","Add Column Before"),action:t=>t.chain().focus().addColumnBefore().run()},{name:"add-col-after",title:Craft.t("vizy","Add Column After"),action:t=>t.chain().focus().addColumnAfter().run()},{name:"delete-col",title:Craft.t("vizy","Delete Column"),action:t=>t.chain().focus().deleteColumn().run()},{name:"add-row-before",title:Craft.t("vizy","Add Row Before"),action:t=>t.chain().focus().addRowBefore().run()},{name:"add-row-after",title:Craft.t("vizy","Add Row After"),action:t=>t.chain().focus().addRowAfter().run()},{name:"delete-row",title:Craft.t("vizy","Delete Row"),action:t=>t.chain().focus().deleteRow().run()},{name:"merge-cells",title:Craft.t("vizy","Merge Cells"),action:t=>t.chain().focus().mergeCells().run()},{name:"split-cells",title:Craft.t("vizy","Split Cells"),action:t=>t.chain().focus().splitCell().run()},{name:"toggle-header-column",title:Craft.t("vizy","Toggle Header Column"),action:t=>t.chain().focus().toggleHeaderColumn().run()},{name:"toggle-header-row",title:Craft.t("vizy","Toggle Header Row"),action:t=>t.chain().focus().toggleHeaderRow().run()},{name:"toggle-header-cell",title:Craft.t("vizy","Toggle Header Cell"),action:t=>t.chain().focus().toggleHeaderCell().run()}]},{name:"link",svg:"link",title:Craft.t("vizy","Link"),component:"LinkMenuBarItem",isActive:t=>t.isActive("link")},{name:"image",icon:"image",title:Craft.t("vizy","Image"),component:"ImageMenuBarItem",isActive:t=>t.isActive("image")},{name:"html",svg:"file-code",title:Craft.t("vizy","HTML"),action:t=>t.emit("vui:code-editor-toggle")},{name:"iframe",svg:"rectangle-code",title:Craft.t("vizy","iFrame"),component:"IframeMenuBarItem",isActive:t=>t.isActive("iframe")},{name:"media-embed",svg:"photo-film",title:Craft.t("vizy","Media Embed"),component:"MediaEmbedMenuBarItem",isActive:t=>t.isActive("mediaEmbed")}],mY=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,gY=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,vY=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,yY=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,bY=or.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[oa({find:mY,type:this.type}),oa({find:vY,type:this.type})]},addPasteRules(){return[Yo({find:gY,type:this.type}),Yo({find:yY,type:this.type})]}}),_Y=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,wY=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,kY=or.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[oa({find:_Y,type:this.type})]},addPasteRules(){return[Yo({find:wY,type:this.type})]}}),xY=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,SY=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,CY=or.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[oa({find:xY,type:this.type})]},addPasteRules(){return[Yo({find:SY,type:this.type})]}}),TY=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,EY=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,AY=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,OY=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,MY=or.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[oa({find:TY,type:this.type}),oa({find:AY,type:this.type})]},addPasteRules(){return[Yo({find:EY,type:this.type}),Yo({find:OY,type:this.type})]}}),LY=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,NY=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,IY=or.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){const t={};return Xg()?t["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():t["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),t},addInputRules(){return[oa({find:LY,type:this.type})]},addPasteRules(){return[Yo({find:NY,type:this.type})]}}),PY=or.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),DY=or.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),RY=or.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),zY=/^\s*>\s$/,BY=_n.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Zu({find:zY,type:this.type})]}}),$Y=_n.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",zt(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),aT=or.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=cc(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),lT=/^\s*([-+*])\s$/,HY=_n.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes($Y.name,this.editor.getAttributes(aT.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Zu({find:lT,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Zu({find:lT,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(aT.name),editor:this.editor})),[t]}}),FY=/^```([a-z]+)?[\s\n]$/,VY=/^~~~([a-z]+)?[\s\n]$/,jY=_n.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",zt(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(` - -`);return!o||!s?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const l=i.after();return l===void 0||r.nodeAt(l)?!1:t.commands.exitCode()}}},addInputRules(){return[Mm({find:FY,type:this.type,getAttributes:t=>({language:t[1]})}),Mm({find:VY,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new on({key:new xn("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:s}=t.state;return s.replaceSelectionWith(this.type.create({language:o})),s.setSelection(st.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,` -`)),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),WY=_n.create({name:"doc",topNode:!0,content:"block+"}),UY=_n.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",zt(this.options.HTMLAttributes,t)]},renderText(){return` -`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,u=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:f,dispatch:d})=>{if(d&&u&&s){const m=u.filter(v=>l.includes(v.type.name));f.ensureMarks(m)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),qY=_n.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,zt(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Mm({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),KY=_n.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",zt(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{$to:n}=e.selection,r=t();return n.parentOffset===0?r.insertContentAt(Math.max(n.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var s;if(o){const{$to:l}=i.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?i.setSelection(st.create(i.doc,l.pos+1)):l.nodeAfter.isBlock?i.setSelection(it.create(i.doc,l.pos)):i.setSelection(st.create(i.doc,l.pos));else{const f=(s=l.parent.type.contentMatch.defaultType)===null||s===void 0?void 0:s.create();f&&(i.insert(u,f),i.setSelection(st.create(i.doc,u+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[uw({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),GY=_n.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",zt(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),YY=_n.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",zt(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),uT=or.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=cc(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),cT=/^(\d+)\.\s$/,JY=_n.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",zt(this.options.HTMLAttributes,n),0]:["ol",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(YY.name,this.editor.getAttributes(uT.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Zu({find:cT,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Zu({find:cT,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(uT.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),XY=_n.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}});var Fb,Vb;if(typeof WeakMap<"u"){let t=new WeakMap;Fb=e=>t.get(e),Vb=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;Fb=r=>{for(let i=0;i(n==10&&(n=0),t[n++]=r,t[n++]=i)}var vn=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e=n){(o||(o=[])).push({type:"overlong_rowspan",pos:d,n:k-N});break}const E=i+N*e;for(let H=0;Hr&&(o+=f.attrs.colspan)}}for(let s=0;s1&&(n=!0)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}function eJ(t,e,n){t.problems||(t.problems=[]);const r={};for(let i=0;i0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function nJ(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function Gi(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function ev(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=fc(e.$head)||rJ(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function rJ(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function jb(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function iJ(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function cw(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function cL(t,e,n){const r=t.node(-1),i=vn.get(r),o=t.start(-1),s=i.nextCell(t.pos-o,e,n);return s==null?null:t.node(0).resolve(o+s)}function wl(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function fL(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;if!=e.pos-i);l.unshift(e.pos-i);const u=l.map(f=>{const d=n.nodeAt(f);if(!d)throw RangeError(`No cell with offset ${f} found`);const m=i+f+1;return new n4(s.resolve(m),s.resolve(m+d.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=t,this.$headCell=e}map(t,e){const n=t.resolve(e.map(this.$anchorCell.pos)),r=t.resolve(e.map(this.$headCell.pos));if(jb(n)&&jb(r)&&cw(n,r)){const i=this.$anchorCell.node(-1)!=n.node(-1);return i&&this.isRowSelection()?Nt.rowSelection(n,r):i&&this.isColSelection()?Nt.colSelection(n,r):new Nt(n,r)}return st.between(n,r)}content(){const t=this.$anchorCell.node(-1),e=vn.get(t),n=this.$anchorCell.start(-1),r=e.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},o=[];for(let l=r.top;l0||C>0){let x=y.attrs;if(_>0&&(x=wl(x,0,_)),C>0&&(x=wl(x,x.colspan-C,C)),v.leftr.bottom){const x={...y.attrs,rowspan:Math.min(v.bottom,r.bottom)-Math.max(v.top,r.top)};v.top0)return!1;const n=t+this.$anchorCell.nodeAfter.attrs.rowspan,r=e+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,e=t){const n=t.node(-1),r=vn.get(n),i=t.start(-1),o=r.findCell(t.pos-i),s=r.findCell(e.pos-i),l=t.node(0);return o.top<=s.top?(o.top>0&&(t=l.resolve(i+r.map[o.left])),s.bottom0&&(e=l.resolve(i+r.map[s.left])),o.bottom0)return!1;const o=r+this.$anchorCell.nodeAfter.attrs.colspan,s=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,s)==e.width}eq(t){return t instanceof Nt&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,e=t){const n=t.node(-1),r=vn.get(n),i=t.start(-1),o=r.findCell(t.pos-i),s=r.findCell(e.pos-i),l=t.node(0);return o.left<=s.left?(o.left>0&&(t=l.resolve(i+r.map[o.top*r.width])),s.right0&&(e=l.resolve(i+r.map[s.top*r.width])),o.right{e.push(hr.node(r,r+n.nodeSize,{class:"selectedCell"}))}),tn.create(t.doc,e)}function aJ({$from:t,$to:e}){if(t.pos==e.pos||t.pos=0&&!(t.after(i+1)=0&&!(e.before(o+1)>e.start(o));o--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function lJ({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){const o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let i=e.depth;i>0;i--){const o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&e.parentOffset===0}function uJ(t,e,n){const r=(e||t).selection,i=(e||t).doc;let o,s;if(r instanceof it&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=Nt.create(i,r.from);else if(s=="row"){const l=i.resolve(r.from+1);o=Nt.rowSelection(l,l)}else if(!n){const l=vn.get(r.node),u=r.from+1,f=u+l.map[l.width*l.height-1];o=Nt.create(i,u+1,f)}}else r instanceof st&&aJ(r)?o=st.create(i,r.from):r instanceof st&&lJ(r)&&(o=st.create(i,r.$from.start(),r.$from.end()));return o&&(e||(e=t.tr)).setSelection(o),e}var cJ=new xn("fix-tables");function hL(t,e,n,r){const i=t.childCount,o=e.childCount;e:for(let s=0,l=0;s{i.type.spec.tableRole=="table"&&(n=fJ(t,i,o,n))};return e?e.doc!=t.doc&&hL(e.doc,t.doc,0,r):t.doc.descendants(r),n}function fJ(t,e,n,r){const i=vn.get(e);if(!i.problems)return r;r||(r=t.tr);const o=[];for(let u=0;u0){let y="cell";d.firstChild&&(y=d.firstChild.type.spec.tableRole);const _=[];for(let x=0;x0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const i=e.child(0),o=i.type.spec.tableRole,s=i.type.schema,l=[];if(o=="row")for(let u=0;u=0;s--){const{rowspan:l,colspan:u}=o.child(s).attrs;for(let f=i;f=e.length&&e.push(Oe.empty),n[i]r&&(v=v.type.createChecked(wl(v.attrs,v.attrs.colspan,d+v.attrs.colspan-r),v.content)),f.push(v),d+=v.attrs.colspan;for(let y=1;yi&&(m=m.type.create({...m.attrs,rowspan:Math.max(1,i-m.attrs.rowspan)},m.content)),u.push(m)}o.push(Oe.from(u))}n=o,e=i}return{width:t,height:e,rows:n}}function mJ(t,e,n,r,i,o,s){const l=t.doc.type.schema,u=vr(l);let f,d;if(i>e.width)for(let m=0,v=0;me.height){const m=[];for(let _=0,C=(e.height-1)*e.width;_=e.width?!1:n.nodeAt(e.map[C+_]).type==u.header_cell;m.push(x?d||(d=u.header_cell.createAndFill()):f||(f=u.cell.createAndFill()))}const v=u.row.create(null,Oe.from(m)),y=[];for(let _=e.height;_{if(!i)return!1;const o=n.selection;if(o instanceof Nt)return Op(n,r,ht.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return!1;const s=mL(i,t,e);if(s==null)return!1;if(t=="horiz")return Op(n,r,ht.near(n.doc.resolve(o.head+e),e));{const l=n.doc.resolve(s),u=cL(l,t,e);let f;return u?f=ht.near(u,1):e<0?f=ht.near(n.doc.resolve(l.before(-1)),-1):f=ht.near(n.doc.resolve(l.after(-1)),1),Op(n,r,f)}}}function Yh(t,e){return(n,r,i)=>{if(!i)return!1;const o=n.selection;let s;if(o instanceof Nt)s=o;else{const u=mL(i,t,e);if(u==null)return!1;s=new Nt(n.doc.resolve(u))}const l=cL(s.$headCell,t,e);return l?Op(n,r,new Nt(s.$anchorCell,l)):!1}}function Jh(t,e){const n=t.selection;if(!(n instanceof Nt))return!1;if(e){const r=t.tr,i=vr(t.schema).cell.createAndFill().content;n.forEachCell((o,s)=>{o.content.eq(i)||r.replace(r.mapping.map(s+1),r.mapping.map(s+o.nodeSize-1),new He(i,0,0))}),r.docChanged&&e(r)}return!0}function vJ(t,e){const n=t.state.doc,r=fc(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new Nt(r))),!0):!1}function yJ(t,e,n){if(!Gi(t.state))return!1;let r=dJ(n);const i=t.state.selection;if(i instanceof Nt){r||(r={width:1,height:1,rows:[Oe.from(Wb(vr(t.state.schema).cell,n))]});const o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),l=vn.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return r=pJ(r,l.right-l.left,l.bottom-l.top),hT(t.state,t.dispatch,s,l,r),!0}else if(r){const o=ev(t.state),s=o.start(-1);return hT(t.state,t.dispatch,s,vn.get(o.node(-1)).findCell(o.pos-s),r),!0}else return!1}function bJ(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=pT(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof Nt)o(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=fc(t.state.selection.$anchor))!=null&&((n=G0(t,e))==null?void 0:n.pos)!=i.pos)o(i,e),e.preventDefault();else if(!r)return;function o(u,f){let d=G0(t,f);const m=Vs.getState(t.state)==null;if(!d||!cw(u,d))if(m)d=u;else return;const v=new Nt(u,d);if(m||!t.state.selection.eq(v)){const y=t.state.tr.setSelection(v);m&&y.setMeta(Vs,u.pos),t.dispatch(y)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",l),Vs.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(Vs,-1))}function l(u){const f=u,d=Vs.getState(t.state);let m;if(d!=null)m=t.state.doc.resolve(d);else if(pT(t,f.target)!=r&&(m=G0(t,e),!m))return s();m&&o(m,f)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",l)}function mL(t,e,n){if(!(t.state.selection instanceof st))return null;const{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){const o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){const l=r.before(i),u=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(u)?l:null}}return null}function pT(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function G0(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?fc(t.state.doc.resolve(n.pos)):null}var _J=class{constructor(e,n){this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Ub(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,Ub(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function Ub(t,e,n,r,i,o){var s;let l=0,u=!0,f=e.firstChild;const d=t.firstChild;if(d){for(let m=0,v=0;mnew n(l,e,u),new Mp(-1,!1)},apply(o,s){return s.apply(o)}},props:{attributes:o=>{const s=gi.getState(o);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,s)=>{kJ(o,s,t,e,r)},mouseleave:o=>{xJ(o)},mousedown:(o,s)=>{SJ(o,s,e)}},decorations:o=>{const s=gi.getState(o);if(s&&s.activeHandle>-1)return MJ(o,s.activeHandle)},nodeViews:{}}});return i}var Mp=class{constructor(t,e){this.activeHandle=t,this.dragging=e}apply(t){const e=this,n=t.getMeta(gi);if(n&&n.setHandle!=null)return new Mp(n.setHandle,!1);if(n&&n.setDragging!==void 0)return new Mp(e.activeHandle,n.setDragging);if(e.activeHandle>-1&&t.docChanged){let r=t.mapping.map(e.activeHandle,-1);return jb(t.doc.resolve(r))||(r=-1),new Mp(r,e.dragging)}return e}};function kJ(t,e,n,r,i){const o=gi.getState(t.state);if(o&&!o.dragging){const s=TJ(e.target);let l=-1;if(s){const{left:u,right:f}=s.getBoundingClientRect();e.clientX-u<=n?l=mT(t,e,"left"):f-e.clientX<=n&&(l=mT(t,e,"right"))}if(l!=o.activeHandle){if(!i&&l!==-1){const u=t.state.doc.resolve(l),f=u.node(-1),d=vn.get(f),m=u.start(-1);if(d.colCount(u.pos-m)+u.nodeAfter.attrs.colspan-1==d.width-1)return}gL(t,l)}}}function xJ(t){const e=gi.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&gL(t,-1)}function SJ(t,e,n){const r=gi.getState(t.state);if(!r||r.activeHandle==-1||r.dragging)return!1;const i=t.state.doc.nodeAt(r.activeHandle),o=CJ(t,r.activeHandle,i.attrs);t.dispatch(t.state.tr.setMeta(gi,{setDragging:{startX:e.clientX,startWidth:o}}));function s(u){window.removeEventListener("mouseup",s),window.removeEventListener("mousemove",l);const f=gi.getState(t.state);f!=null&&f.dragging&&(EJ(t,f.activeHandle,gT(f.dragging,u,n)),t.dispatch(t.state.tr.setMeta(gi,{setDragging:null})))}function l(u){if(!u.which)return s(u);const f=gi.getState(t.state);if(f&&f.dragging){const d=gT(f.dragging,u,n);AJ(t,f.activeHandle,d,n)}}return window.addEventListener("mouseup",s),window.addEventListener("mousemove",l),e.preventDefault(),!0}function CJ(t,e,{colspan:n,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const o=t.domAtPos(e);let l=o.node.childNodes[o.offset].offsetWidth,u=n;if(r)for(let f=0;f0?-1:0;oJ(e,r,i+o)&&(o=i==0||i==e.width?null:0);for(let s=0;s0&&i0&&e.map[l-1]==u||i0?-1:0;DJ(e,r,i+u)&&(u=i==0||i==e.height?null:0);for(let f=0,d=e.width*i;f0&&i0&&d==e.map[f-e.width]){const m=n.nodeAt(d).attrs;t.setNodeMarkup(t.mapping.slice(l).map(d+r),null,{...m,rowspan:m.rowspan-1}),u+=m.colspan-1}else if(i0&&n[o]==n[o-1]||r.right0&&n[i]==n[i-t]||r.bottomn[r.type.spec.tableRole])(t,e)}function FJ(t){return(e,n)=>{var r;const i=e.selection;let o,s;if(i instanceof Nt){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos}else{if(o=nJ(i.$from),!o)return!1;s=(r=fc(i.$from))==null?void 0:r.pos}if(o==null||s==null||o.attrs.colspan==1&&o.attrs.rowspan==1)return!1;if(n){let l=o.attrs;const u=[],f=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});const d=ko(e),m=e.tr;for(let y=0;y{s.attrs[t]!==e&&o.setNodeMarkup(l,null,{...s.attrs,[t]:e})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),r(o)}return!0}}function jJ(t){return function(e,n){if(!Gi(e))return!1;if(n){const r=vr(e.schema),i=ko(e),o=e.tr,s=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),l=s.map(u=>i.table.nodeAt(u));for(let u=0;u{const _=y+o.tableStart,C=s.doc.nodeAt(_);C&&s.setNodeMarkup(_,v,C.attrs)}),r(s)}return!0}}ud("row",{useDeprecatedLogic:!0});ud("column",{useDeprecatedLogic:!0});var WJ=ud("cell",{useDeprecatedLogic:!0});function UJ(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){const o=t.node(-1).child(r),s=o.lastChild;if(s)return i-1-s.nodeSize;i-=o.nodeSize}}else{if(t.index()0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function KJ({allowTableNodeSelection:t=!1}={}){return new on({key:Vs,state:{init(){return null},apply(e,n){const r=e.getMeta(Vs);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:i,pos:o}=e.mapping.mapResult(n);return i?null:o}},props:{decorations:sJ,handleDOMEvents:{mousedown:bJ},createSelectionBetween(e){return Vs.getState(e.state)!=null?e.state.selection:null},handleTripleClick:vJ,handleKeyDown:gJ,handlePaste:yJ},appendTransaction(e,n,r){return uJ(r,pL(r,n),t)}})}function kT(t,e,n,r,i,o){let s=0,l=!0,u=e.firstChild;const f=t.firstChild;for(let d=0,m=0;d{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function XJ(t,e,n,r,i){const o=JJ(t),s=[],l=[];for(let f=0;f{const{selection:e}=t.state;if(!ZJ(e))return!1;let n=0;const r=iw(e.ranges[0].$from,o=>o.type.name==="table");return r==null||r.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},QJ=_n.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:GJ,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:n,tableWidth:r,tableMinWidth:i}=YJ(t,this.options.cellMinWidth);return["table",zt(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`minWidth: ${i}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{const s=XJ(o.schema,t,e,n);if(i){const l=r.selection.anchor+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(st.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>LJ(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>NJ(t,e),deleteColumn:()=>({state:t,dispatch:e})=>PJ(t,e),addRowBefore:()=>({state:t,dispatch:e})=>RJ(t,e),addRowAfter:()=>({state:t,dispatch:e})=>zJ(t,e),deleteRow:()=>({state:t,dispatch:e})=>$J(t,e),deleteTable:()=>({state:t,dispatch:e})=>qJ(t,e),mergeCells:()=>({state:t,dispatch:e})=>yT(t,e),splitCell:()=>({state:t,dispatch:e})=>bT(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>ud("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>ud("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>WJ(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>yT(t,e)?!0:bT(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>VJ(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>wT(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>wT(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&pL(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=Nt.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Xh,"Mod-Backspace":Xh,Delete:Xh,"Mod-Delete":Xh}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[wJ({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],KJ({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:wt(Ye(t,"tableRole",e))}}}),eX=_n.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",zt(this.options.HTMLAttributes,t),0]}}),tX=_n.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",zt(this.options.HTMLAttributes,t),0]}}),nX=_n.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",zt(this.options.HTMLAttributes,t),0]}}),rX=_n.create({name:"text",group:"inline"});function iX(t={}){return new on({view(e){return new oX(e,t)}})}class oX{constructor(e,n){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=n.width||1,this.color=n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let i=o=>{this[r](o)};return e.dom.addEventListener(r,i),{name:r,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let l=e.nodeBefore,u=e.nodeAfter;if(l||u){let f=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(f){let d=f.getBoundingClientRect(),m=l?d.bottom:d.top;l&&u&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:d.left,right:d.right,top:m-this.width/2,bottom:m+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let l=i.getBoundingClientRect();o=l.left-i.scrollLeft,s=l.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=X6(this.editorView.state.doc,s,this.editorView.dragging.slice);l!=null&&(s=l)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const sX=ir.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[iX(this.options)]}});ir.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new on({key:new xn("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=e,o=[];if(!n||!r)return tn.create(t,[]);let s=0;this.options.mode==="deepest"&&t.descendants((u,f)=>{if(u.isText)return;if(!(i>=f&&i<=f+u.nodeSize-1))return!1;s+=1});let l=0;return t.descendants((u,f)=>{if(u.isText||!(i>=f&&i<=f+u.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&s-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";o.push(hr.node(f,f+u.nodeSize,{class:this.options.className}))}),tn.create(t,o)}}})]}});class fn extends ht{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return fn.valid(r)?new fn(r):ht.near(r)}content(){return He.empty}eq(e){return e instanceof fn&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new fn(e.resolve(n.pos))}getBookmark(){return new fw(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!aX(e)||!lX(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&fn.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let l=e.node(s);if(n>0?e.indexAfter(s)0){o=l.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let u=e.doc.resolve(i);if(fn.valid(u))return u}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!it.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let l=e.doc.resolve(i);if(fn.valid(l))return l}return null}}}fn.prototype.visible=!1;fn.findFrom=fn.findGapCursorFrom;ht.jsonID("gapcursor",fn);class fw{constructor(e){this.pos=e}map(e){return new fw(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return fn.valid(n)?new fn(n):ht.near(n)}}function aX(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function lX(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function uX(){return new on({props:{decorations:hX,createSelectionBetween(t,e,n){return e.pos==n.pos&&fn.valid(n)?new fn(n):null},handleClick:fX,handleKeyDown:cX,handleDOMEvents:{beforeinput:dX}}})}const cX=G_({ArrowLeft:Zh("horiz",-1),ArrowRight:Zh("horiz",1),ArrowUp:Zh("vert",-1),ArrowDown:Zh("vert",1)});function Zh(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,l=e>0?s.$to:s.$from,u=s.empty;if(s instanceof st){if(!o.endOfTextblock(n)||l.depth==0)return!1;u=!1,l=r.doc.resolve(e>0?l.after():l.before())}let f=fn.findGapCursorFrom(l,e,u);return f?(i&&i(r.tr.setSelection(new fn(f))),!0):!1}}function fX(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!fn.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&it.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new fn(r))),!0)}function dX(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof fn))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=Oe.empty;for(let s=r.length-1;s>=0;s--)i=Oe.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new He(i,0,0));return o.setSelection(st.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function hX(t){if(!(t.selection instanceof fn))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",tn.create(t.doc,[hr.widget(t.selection.head,e,{key:"gapcursor"})])}const pX=ir.create({name:"gapCursor",addProseMirrorPlugins(){return[uX()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=wt(Ye(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}});var Lm=200,rr=function(){};rr.prototype.append=function(e){return e.length?(e=rr.from(e),!this.length&&e||e.length=n?rr.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};rr.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};rr.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};rr.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i};rr.from=function(e){return e instanceof rr?e:e&&e.length?new bL(e):rr.empty};var bL=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,l){for(var u=o;u=s;u--)if(i(this.values[u],l+u)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Lm)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Lm)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(rr);rr.empty=new bL([]);var mX=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return rl&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(rr),_L=rr;const gX=500;class Di{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,u,f=[],d=[];return this.items.forEach((m,v)=>{if(!m.step){i||(i=this.remapping(r,v+1),o=i.maps.length),o--,d.push(m);return}if(i){d.push(new ro(m.map));let y=m.step.map(i.slice(o)),_;y&&s.maybeStep(y).doc&&(_=s.mapping.maps[s.mapping.maps.length-1],f.push(new ro(_,void 0,void 0,f.length+d.length))),o--,_&&i.appendMap(_,o)}else s.maybeStep(m.step);if(m.selection)return l=i?m.selection.map(i.slice(o)):m.selection,u=new Di(this.items.slice(0,r).append(d.reverse().concat(f)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:s,selection:l}}addTransform(e,n,r,i){let o=[],s=this.eventCount,l=this.items,u=!i&&l.length?l.get(l.length-1):null;for(let d=0;dyX&&(l=vX(l,f),s-=f),new Di(l.append(o),s)}remapping(e,n){let r=new Ou;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new Di(this.items.append(e.map(n=>new ro(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(v=>{v.selection&&l--},i);let u=n;this.items.forEach(v=>{let y=o.getMirror(--u);if(y==null)return;s=Math.min(s,y);let _=o.maps[y];if(v.step){let C=e.steps[y].invert(e.docs[y]),x=v.selection&&v.selection.map(o.slice(u+1,y));x&&l++,r.push(new ro(_,C,x))}else r.push(new ro(_))},i);let f=[];for(let v=n;vgX&&(m=m.compress(this.items.length-r.length)),m}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let u=s.step.map(n.slice(r)),f=u&&u.getMap();if(r--,f&&n.appendMap(f,r),u){let d=s.selection&&s.selection.map(n.slice(r));d&&o++;let m=new ro(f.invert(),u,d),v,y=i.length-1;(v=i.length&&i[y].merge(m))?i[y]=v:i.push(m)}}else s.map&&r--},this.items.length,0),new Di(_L.from(i.reverse()),o)}}Di.empty=new Di(_L.empty,0);function vX(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class ro{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new ro(n.getMap().invert(),n,this.selection)}}}class Bs{constructor(e,n,r,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i}}const yX=20;function bX(t,e,n,r){let i=n.getMeta(Zs),o;if(i)return i.historyState;n.getMeta(wX)&&(t=new Bs(t.done,t.undone,null,0));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(Zs))return s.getMeta(Zs).redo?new Bs(t.done.addTransform(n,void 0,r,Lp(e)),t.undone,ST(n.mapping.maps[n.steps.length-1]),t.prevTime):new Bs(t.done,t.undone.addTransform(n,void 0,r,Lp(e)),null,t.prevTime);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=t.prevTime==0||!s&&(t.prevTime<(n.time||0)-r.newGroupDelay||!_X(n,t.prevRanges)),u=s?Y0(t.prevRanges,n.mapping):ST(n.mapping.maps[n.steps.length-1]);return new Bs(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Lp(e)),Di.empty,u,n.time)}else return(o=n.getMeta("rebased"))?new Bs(t.done.rebased(n,o),t.undone.rebased(n,o),Y0(t.prevRanges,n.mapping),t.prevTime):new Bs(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Y0(t.prevRanges,n.mapping),t.prevTime)}function _X(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=e[o]&&(n=!0)}),n}function ST(t){let e=[];return t.forEach((n,r,i,o)=>e.push(i,o)),e}function Y0(t,e){if(!t)return null;let n=[];for(let r=0;r{let n=Zs.getState(t);return!n||n.done.eventCount==0?!1:(e&&wL(n,t,e,!1),!0)},xL=(t,e)=>{let n=Zs.getState(t);return!n||n.undone.eventCount==0?!1:(e&&wL(n,t,e,!0),!0)},xX=ir.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>kL(t,e),redo:()=>({state:t,dispatch:e})=>xL(t,e)}},addProseMirrorPlugins(){return[kX(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),SX=ir.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>t.style.textAlign||this.options.defaultAlignment,renderHTML:t=>t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.every(n=>e.updateAttributes(n,{textAlign:t})):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),CX="aaa1rp3barth4b_ott3vie4c1le2ogado5udhabi7c_ademy5centure6ountant_s9o1tor4d_s1ult4e_g1ro2tna4f_l1rica5g_akhan5ency5i_g1rbus3force5tel5kdn3l_faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m_azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o_l2partments8p_le4q_uarelle8r_ab1mco4chi3my2pa2t_e3s_da2ia2sociates9t_hleta5torney7u_ction5di_ble3o3spost5thor3o_s4vianca6w_s2x_a2z_ure5ba_by2idu3namex3narepublic11d1k2r_celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b_c1t1va3cg1n2d1e_ats2uty4er2ntley5rlin4st_buy5t2f1g1h_arti5i_ble3d1ke2ng_o3o1z2j1lack_friday9ockbuster8g1omberg7ue3m_s1w2n_pparibas9o_ats3ehringer8fa2m1nd2o_k_ing5sch2tik2on4t1utique6x2r_adesco6idgestone9oadway5ker3ther5ussels7s1t1uild_ers6siness6y1zz3v1w1y1z_h3ca_b1fe2l_l1vinklein9m_era3p2non3petown5ital_one8r_avan4ds2e_er_s4s2sa1e1h1ino4t_ering5holic7ba1n1re2s2c1d1enter4o1rn3f_a1d2g1h_anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i_priani6rcle4sco3tadel4i_c2y_eats7k1l_aims4eaning6ick2nic1que6othing5ud3ub_med6m1n1o_ach3des3ffee4llege4ogne5m_cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking_channel11l1p2rsica5untry4pon_s4rses6pa2r_edit_card4union9icket5own3s1uise_s6u_isinella9v1w1x1y_mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e_al_er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si_gn4v2hl2iamonds6et2gital5rect_ory7scount3ver5h2y2j1k1m1np2o_cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c_o2deka3u_cation8e1g1mail3erck5nergy4gineer_ing9terprises10pson4quipment8r_icsson6ni3s_q1tate5t_isalat7u_rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n_s2rm_ers5shion4t3edex3edback6rrari3ero6i_at2delity5o2lm2nal1nce1ial7re_stone6mdale6sh_ing5t_ness6j1k1lickr3ghts4r2orist4wers5y2m1o_o_d_network8tball6rd1ex2sale4um3undation8x2r_ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n_d2rniture7tbol5yi3ga_l_lery3o1up4me_s3p1rden4y2b_iz3d_n2e_a1nt_ing5orge5f1g_ee3h1i_ft_s3ves2ing5l_ass3e1obal2o4m_ail3bh2o1x2n1odaddy5ld_point6f2o_dyear5g_le4p1t1v2p1q1r_ainger5phics5tis4een3ipe3ocery4up4s1t1u_ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc_bank7ealth_care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k_t2m1n1ockey4ldings5iday5medepot5goods5s_ense7nda3rse3spital5t_ing5t_eles2s3mail5use3w2r1sbc3t1u_ghes5yatt3undai7ibm2cbc2e1u2d1e_ee3fm2kano4l1m_amat4db2mo_bilien9n_c1dustries8finiti5o2g1k1stitute6urance4e4t_ernational10uit4vestments10o1piranga7q1r_ish4s_maili5t_anbul7t_au2v3jaguar4va3cb2e_ep2tzt3welry6io2ll2m_p2nj2o_bs1urg4t1y2p_morgan6rs3uegos4niper7kaufen5ddi3e_rryhotels6logistics9properties14fh2g1h1i_a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p_mg2n2r_d1ed3uokgroup8w1y_oto4z2la_caixa5mborghini8er3ncaster5ia3d_rover6xess5salle5t_ino3robe5w_yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i_dl2fe_insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan_s3cker3us3l1ndon4tte1o3ve3pl_financial11r1s1t_d_a3u_ndbeck6xe1ury5v1y2ma_cys3drid4if1son4keup4n_agement7go3p1rket_ing3s4riott5shalls7serati6ttel5ba2c_kinsey7d1e_d_ia3et2lbourne7me1orial6n_u2rckmsd7g1h1iami3crosoft7l1ni1t2t_subishi9k1l_b1s2m_a2n1o_bi_le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to_rcycles9v_ie4p1q1r1s_d2t_n1r2u_seum3ic3tual5v1w1x1y1z2na_b1goya4me2tura4vy3ba2c1e_c1t_bank4flix4work5ustar5w_s2xt_direct7us4f_l2g_o2hk2i_co2ke1on3nja3ssan1y5l1o_kia3rthwesternmutual14on4w_ruz3tv4p1r_a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan_group9dnavy5lo3m_ega4ne1g1l_ine5oo2pen3racle3nge4g_anic5igins6saka4tsuka4t2vh3pa_ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e_t2f_izer5g1h_armacy6d1ilips5one2to_graphy6s4ysio5ics1tet2ures6d1n_g1k2oneer5zza4k1l_ace2y_station9umbing5s3m1n_c2ohl2ker3litie5rn2st3r_america6xi3ess3ime3o_d_uctions8f1gressive8mo2perties3y5tection8u_dential9s1t1ub2w_c2y2qa1pon3uebec3st5racing4dio4e_ad1lestate6tor2y4cipes5d_stone5umbrella9hab3ise_n3t2liance6n_t_als5pair3ort3ublican8st_aurant8view_s5xroth6ich_ardli6oh3l1o1p2o_cher3ks3deo3gers4om3s_vp3u_gby3hr2n2w_e2yukyu6sa_arland6fe_ty4kura4le1on3msclub4ung5ndvik_coromant12ofi4p1rl2s1ve2xo3b_i1s2c_a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e_arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x_y3fr2g1h_angrila6rp2w2ell3ia1ksha5oes2p_ping5uji3w_time7i_lk2na1gles5te3j1k_i_n2y_pe4l_ing4m_art3ile4n_cf3o_ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa_ce3ort2t3r_l2s1t_ada2ples4r1tebank4farm7c_group6ockholm6rage3e3ream4udio2y3yle4u_cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y_dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x_i3c_i2d_k2eam2ch_nology8l1masek5nnis4va3f1g1h_d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j_maxx4x2k_maxx5l1m_all4n1o_day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r_ade1ing4ining5vel_channel7ers_insurance16ust3v2t1ube2i1nes3shu4v_s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va_cations7na1guard7c1e_gas3ntures6risign5mögensberater2ung14sicherung10t2g1i_ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u_elos6wales2mart4ter4ng_gou5tch_es6eather_channel12bcam3er2site5d_ding5ibo2r3f1hoswho6ien2ki2lliamhill9n_dows4e1ners6me2olterskluwer11odside6rk_s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u_tube6t1un3za_ppos4ra3ero3ip2m1one3uerich6w2",TX="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5تصالات6رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत_म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里_大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Qu=(t,e)=>{for(const n in e)t[n]=e[n];return t},qb="numeric",Kb="ascii",Gb="alpha",Np="asciinumeric",Qh="alphanumeric",Yb="domain",SL="emoji",EX="scheme",AX="slashscheme",TT="whitespace";function OX(t,e){return t in e||(e[t]=[]),e[t]}function qa(t,e,n){e[qb]&&(e[Np]=!0,e[Qh]=!0),e[Kb]&&(e[Np]=!0,e[Gb]=!0),e[Np]&&(e[Qh]=!0),e[Gb]&&(e[Qh]=!0),e[Qh]&&(e[Yb]=!0),e[SL]&&(e[Yb]=!0);for(const r in e){const i=OX(r,n);i.indexOf(t)<0&&i.push(t)}}function MX(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function zr(t){t===void 0&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}zr.groups={};zr.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;rt.ta(e,n,r,i),hi=(t,e,n,r,i)=>t.tr(e,n,r,i),ET=(t,e,n,r,i)=>t.ts(e,n,r,i),Pe=(t,e,n,r,i)=>t.tt(e,n,r,i),Do="WORD",Jb="UWORD",cd="LOCALHOST",Xb="TLD",Zb="UTLD",Ip="SCHEME",cu="SLASH_SCHEME",Nm="NUM",CL="WS",dw="NL",pu="OPENBRACE",Cf="OPENBRACKET",Tf="OPENANGLEBRACKET",Ef="OPENPAREN",$a="CLOSEBRACE",mu="CLOSEBRACKET",gu="CLOSEANGLEBRACKET",Ha="CLOSEPAREN",Im="AMPERSAND",Pm="APOSTROPHE",Dm="ASTERISK",$s="AT",Rm="BACKSLASH",zm="BACKTICK",Bm="CARET",js="COLON",hw="COMMA",$m="DOLLAR",io="DOT",Hm="EQUALS",pw="EXCLAMATION",oo="HYPHEN",Fm="PERCENT",Vm="PIPE",jm="PLUS",Wm="POUND",Um="QUERY",mw="QUOTE",gw="SEMI",zo="SLASH",Af="TILDE",qm="UNDERSCORE",TL="EMOJI",Km="SYM";var EL=Object.freeze({__proto__:null,WORD:Do,UWORD:Jb,LOCALHOST:cd,TLD:Xb,UTLD:Zb,SCHEME:Ip,SLASH_SCHEME:cu,NUM:Nm,WS:CL,NL:dw,OPENBRACE:pu,OPENBRACKET:Cf,OPENANGLEBRACKET:Tf,OPENPAREN:Ef,CLOSEBRACE:$a,CLOSEBRACKET:mu,CLOSEANGLEBRACKET:gu,CLOSEPAREN:Ha,AMPERSAND:Im,APOSTROPHE:Pm,ASTERISK:Dm,AT:$s,BACKSLASH:Rm,BACKTICK:zm,CARET:Bm,COLON:js,COMMA:hw,DOLLAR:$m,DOT:io,EQUALS:Hm,EXCLAMATION:pw,HYPHEN:oo,PERCENT:Fm,PIPE:Vm,PLUS:jm,POUND:Wm,QUERY:Um,QUOTE:mw,SEMI:gw,SLASH:zo,TILDE:Af,UNDERSCORE:qm,EMOJI:TL,SYM:Km});const iu=/[a-z]/,X0=/\p{L}/u,Z0=/\p{Emoji}/u,Q0=/\d/,AT=/\s/,OT=` -`,LX="️",NX="‍";let ep=null,tp=null;function IX(t){t===void 0&&(t=[]);const e={};zr.groups=e;const n=new zr;ep==null&&(ep=MT(CX)),tp==null&&(tp=MT(TX)),Pe(n,"'",Pm),Pe(n,"{",pu),Pe(n,"[",Cf),Pe(n,"<",Tf),Pe(n,"(",Ef),Pe(n,"}",$a),Pe(n,"]",mu),Pe(n,">",gu),Pe(n,")",Ha),Pe(n,"&",Im),Pe(n,"*",Dm),Pe(n,"@",$s),Pe(n,"`",zm),Pe(n,"^",Bm),Pe(n,":",js),Pe(n,",",hw),Pe(n,"$",$m),Pe(n,".",io),Pe(n,"=",Hm),Pe(n,"!",pw),Pe(n,"-",oo),Pe(n,"%",Fm),Pe(n,"|",Vm),Pe(n,"+",jm),Pe(n,"#",Wm),Pe(n,"?",Um),Pe(n,'"',mw),Pe(n,"/",zo),Pe(n,";",gw),Pe(n,"~",Af),Pe(n,"_",qm),Pe(n,"\\",Rm);const r=hi(n,Q0,Nm,{[qb]:!0});hi(r,Q0,r);const i=hi(n,iu,Do,{[Kb]:!0});hi(i,iu,i);const o=hi(n,X0,Jb,{[Gb]:!0});hi(o,iu),hi(o,X0,o);const s=hi(n,AT,CL,{[TT]:!0});Pe(n,OT,dw,{[TT]:!0}),Pe(s,OT),hi(s,AT,s);const l=hi(n,Z0,TL,{[SL]:!0});hi(l,Z0,l),Pe(l,LX,l);const u=Pe(l,NX);hi(u,Z0,l);const f=[[iu,i]],d=[[iu,null],[X0,o]];for(let m=0;mm[0]>v[0]?1:-1);for(let m=0;m=0?_[Yb]=!0:iu.test(v)?Q0.test(v)?_[Np]=!0:_[Kb]=!0:_[qb]=!0,ET(n,v,v,_)}return ET(n,"localhost",cd,{ascii:!0}),n.jd=new zr(Km),{start:n,tokens:Qu({groups:e},EL)}}function PX(t,e){const n=DX(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,i=[];let o=0,s=0;for(;s=0&&(m+=n[s].length,v++),f+=n[s].length,o+=n[s].length,s++;o-=m,s-=v,f-=m,i.push({t:d.t,v:e.slice(o-f,o),s:o-f,e:o})}return i}function DX(t){const e=[],n=t.length;let r=0;for(;r56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function Es(t,e,n,r,i){let o;const s=e.length;for(let l=0;l=0;)o++;if(o>0){e.push(n.join(""));let s=parseInt(t.substring(r,r+o),10);for(;s>0;s--)n.pop();r+=o}else t[r]==="_"?(e.push(n.join("")),r++):(n.push(t[r]),r++)}return e}const fd={defaultProtocol:"http",events:null,format:LT,formatHref:LT,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function vw(t,e){e===void 0&&(e=null);let n=Qu({},fd);t&&(n=Qu(n,t instanceof vw?t.o:t));const r=n.ignoreTags,i=[];for(let o=0;on?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return t===void 0&&(t=fd.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toFormattedHref(t),r=t.get("tagName",n,e),i=this.toFormattedString(t),o={},s=t.get("className",n,e),l=t.get("target",n,e),u=t.get("rel",n,e),f=t.getObj("attributes",n,e),d=t.getObj("events",n,e);return o.href=n,s&&(o.class=s),l&&(o.target=l),u&&(o.rel=u),f&&Qu(o,f),{tagName:r,attributes:o,content:i,eventListeners:d}}};function tv(t,e){class n extends AL{constructor(i,o){super(i,o),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const NT=tv("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),IT=tv("text"),RX=tv("nl"),La=tv("url",{isLink:!0,toHref(t){return t===void 0&&(t=fd.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==cd&&t[1].t===js}}),Wn=t=>new zr(t);function zX(t){let{groups:e}=t;const n=e.domain.concat([Im,Dm,$s,Rm,zm,Bm,$m,Hm,oo,Nm,Fm,Vm,jm,Wm,zo,Km,Af,qm]),r=[Pm,gu,$a,mu,Ha,js,hw,io,pw,Tf,pu,Cf,Ef,Um,mw,gw],i=[Im,Pm,Dm,Rm,zm,Bm,$a,$m,Hm,oo,Nm,pu,Fm,Vm,jm,Wm,Um,zo,Km,Af,qm],o=Wn(),s=Pe(o,Af);rt(s,i,s),rt(s,e.domain,s);const l=Wn(),u=Wn(),f=Wn();rt(o,e.domain,l),rt(o,e.scheme,u),rt(o,e.slashscheme,f),rt(l,i,s),rt(l,e.domain,l);const d=Pe(l,$s);Pe(s,$s,d),Pe(u,$s,d),Pe(f,$s,d);const m=Pe(s,io);rt(m,i,s),rt(m,e.domain,s);const v=Wn();rt(d,e.domain,v),rt(v,e.domain,v);const y=Pe(v,io);rt(y,e.domain,v);const _=Wn(NT);rt(y,e.tld,_),rt(y,e.utld,_),Pe(d,cd,_);const C=Pe(v,oo);rt(C,e.domain,v),rt(_,e.domain,v),Pe(_,io,y),Pe(_,oo,C);const x=Pe(_,js);rt(x,e.numeric,NT);const k=Pe(l,oo),A=Pe(l,io);rt(k,e.domain,l),rt(A,i,s),rt(A,e.domain,l);const N=Wn(La);rt(A,e.tld,N),rt(A,e.utld,N),rt(N,e.domain,l),rt(N,i,s),Pe(N,io,A),Pe(N,oo,k),Pe(N,$s,d);const E=Pe(N,js),H=Wn(La);rt(E,e.numeric,H);const I=Wn(La),q=Wn();rt(I,n,I),rt(I,r,q),rt(q,n,I),rt(q,r,q),Pe(N,zo,I),Pe(H,zo,I);const P=Pe(u,js),z=Pe(f,js),w=Pe(z,zo);Pe(w,zo,P),rt(u,e.domain,l),Pe(u,io,A),Pe(u,oo,k),rt(f,e.domain,l),Pe(f,io,A),Pe(f,oo,k),rt(P,e.domain,I),Pe(P,zo,I);const R=Pe(I,pu),U=Pe(I,Cf),K=Pe(I,Tf),oe=Pe(I,Ef);Pe(q,pu,R),Pe(q,Cf,U),Pe(q,Tf,K),Pe(q,Ef,oe),Pe(R,$a,I),Pe(U,mu,I),Pe(K,gu,I),Pe(oe,Ha,I),Pe(R,$a,I);const D=Wn(La),ae=Wn(La),ce=Wn(La),ve=Wn(La);rt(R,n,D),rt(U,n,ae),rt(K,n,ce),rt(oe,n,ve);const ze=Wn(),qe=Wn(),vt=Wn(),mt=Wn();return rt(R,r),rt(U,r),rt(K,r),rt(oe,r),rt(D,n,D),rt(ae,n,ae),rt(ce,n,ce),rt(ve,n,ve),rt(D,r,D),rt(ae,r,ae),rt(ce,r,ce),rt(ve,r,ve),rt(ze,n,ze),rt(qe,n,ae),rt(vt,n,ce),rt(mt,n,ve),rt(ze,r,ze),rt(qe,r,qe),rt(vt,r,vt),rt(mt,r,mt),Pe(ae,mu,I),Pe(ce,gu,I),Pe(ve,Ha,I),Pe(D,$a,I),Pe(qe,mu,I),Pe(vt,gu,I),Pe(mt,Ha,I),Pe(ze,Ha,I),Pe(o,cd,N),Pe(o,dw,RX),{start:o,tokens:EL}}function BX(t,e,n){let r=n.length,i=0,o=[],s=[];for(;i=0&&v++,i++,d++;if(v<0)i-=d,i0&&(o.push(ey(IT,e,s)),s=[]),i-=v,d-=v;const y=m.t,_=n.slice(i-d,i);o.push(ey(y,e,_))}}return s.length>0&&o.push(ey(IT,e,s)),o}function ey(t,e,n){const r=n[0].s,i=n[n.length-1].e,o=e.slice(r,i);return new t(o,n)}const $X=typeof console<"u"&&console&&console.warn||(()=>{}),HX="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",cn={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function FX(){zr.groups={},cn.scanner=null,cn.parser=null,cn.tokenQueue=[],cn.pluginQueue=[],cn.customSchemes=[],cn.initialized=!1}function PT(t,e){if(e===void 0&&(e=!1),cn.initialized&&$X(`linkifyjs: already initialized - will not register custom scheme "${t}" ${HX}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. - 1. Must only contain digits, lowercase ASCII letters or "-" - 2. Cannot start or end with "-" - 3. "-" cannot repeat`);cn.customSchemes.push([t,e])}function VX(){cn.scanner=IX(cn.customSchemes);for(let t=0;t{const i=e.some(f=>f.docChanged)&&!n.doc.eq(r.doc),o=e.some(f=>f.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,l=X4(n.doc,[...e]);if(nL(l).forEach(({newRange:f})=>{const d=Q4(r.doc,f,y=>y.isTextblock);let m,v;if(d.length>1?(m=d[0],v=r.doc.textBetween(m.pos,m.pos+m.node.nodeSize,void 0," ")):d.length&&r.doc.textBetween(f.from,f.to," "," ").endsWith(" ")&&(m=d[0],v=r.doc.textBetween(m.pos,f.to,void 0," ")),m&&v){const y=v.split(" ").filter(x=>x!=="");if(y.length<=0)return!1;const _=y[y.length-1],C=m.pos+v.lastIndexOf(_);if(!_)return!1;yw(_).filter(x=>x.isLink).map(x=>({...x,from:C+x.start+1,to:C+x.end+1})).filter(x=>r.schema.marks.code?!r.doc.rangeHasMark(x.from,x.to,r.schema.marks.code):!0).filter(x=>t.validate?t.validate(x.value):!0).forEach(x=>{Qg(x.from,x.to,r.doc).some(k=>k.mark.type===t.type)||s.addMark(x.from,x.to,t.type.create({href:x.href}))})}}),!!s.steps.length)return s}})}function UX(t){return new on({key:new xn("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(r.button!==0)return!1;let s=r.target;const l=[];for(;s.nodeName!=="DIV";)l.push(s),s=s.parentNode;if(!l.find(v=>v.nodeName==="A"))return!1;const u=aw(e.state,t.type.name),f=r.target,d=(i=f==null?void 0:f.href)!==null&&i!==void 0?i:u.href,m=(o=f==null?void 0:f.target)!==null&&o!==void 0?o:u.target;return f&&d?(window.open(d,m),!0):!1}}})}function qX(t){return new on({key:new xn("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let l="";r.content.forEach(f=>{l+=f.textContent});const u=yw(l).find(f=>f.isLink&&f.value===l);return!l||!u?!1:(t.editor.commands.setMark(t.type,{href:u.href}),!0)}}})}const KX=or.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(t=>{if(typeof t=="string"){PT(t);return}PT(t.scheme,t.optionalSlashes)})},onDestroy(){FX()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:t}){var e;return!((e=t.href)===null||e===void 0)&&e.startsWith("javascript:")?["a",zt(this.options.HTMLAttributes,{...t,href:""}),0]:["a",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Yo({find:(t,e)=>{var n;const r=(n=e==null?void 0:e.clipboardData)===null||n===void 0?void 0:n.getData("text/html"),i=[];if(r){const o=new DOMParser().parseFromString(r,"text/html"),s=o.querySelectorAll("a");s.length&&[...s].forEach(l=>i.push({text:l.innerText,data:{href:l.getAttribute("href")},index:o.body.innerText.indexOf(l.innerText)+l.innerText.length}))}if(t){const o=yw(t).filter(s=>s.isLink);o.length&&o.forEach(s=>i.push({text:s.value,data:{href:s.href},index:s.start}))}return i},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[];return this.options.autolink&&t.push(WX({type:this.type,validate:this.options.validate})),this.options.openOnClick&&t.push(UX({type:this.type})),this.options.linkOnPaste&&t.push(qX({editor:this.editor,type:this.type})),t}}),GX=KX.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),class:{default:null},title:{default:null}}},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{target:null,rel:null,class:null,title:null}}},renderHTML({HTMLAttributes:t}){const e=zt(this.options.HTMLAttributes,t);return e.target==="_blank"&&(e.rel="noopener noreferrer"),["a",e,0]},addProseMirrorPlugins(){return[new on({key:new xn("handleClick"),props:{handleClick:(t,e,n)=>{this.editor.getAttributes("link").href&&setTimeout(()=>{this.editor.emit("vui:link-clicked")},50)}}})]}}),YX=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,JX=_n.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",zt(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[uw({find:YX,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),XX=JX.extend({addAttributes(){return{id:{default:null},src:{default:null},alt:{default:null},title:{default:null},url:{default:null},target:{default:null},transform:{default:null}}},renderHTML({HTMLAttributes:t}){const e={class:"vui-editor-img-wrap",tabindex:"-1"},n={src:t.src,title:t.title,alt:t.alt},r={url:t.url,target:t.target};return t.url?["figure",e,["a",r,["img",n]]]:["figure",e,["img",n]]},addProseMirrorPlugins(){return[new on({key:new xn("handleClick"),props:{handleClick:(t,e,n)=>{this.editor.getAttributes("image").src&&setTimeout(()=>{this.editor.emit("vui:image-clicked",n)},50)}}})]}});var Vr="top",ki="bottom",xi="right",jr="left",bw="auto",Bd=[Vr,ki,xi,jr],ec="start",dd="end",ZX="clippingParents",OL="viewport",Yc="popper",QX="reference",DT=Bd.reduce(function(t,e){return t.concat([e+"-"+ec,e+"-"+dd])},[]),ML=[].concat(Bd,[bw]).reduce(function(t,e){return t.concat([e,e+"-"+ec,e+"-"+dd])},[]),eZ="beforeRead",tZ="read",nZ="afterRead",rZ="beforeMain",iZ="main",oZ="afterMain",sZ="beforeWrite",aZ="write",lZ="afterWrite",uZ=[eZ,tZ,nZ,rZ,iZ,oZ,sZ,aZ,lZ];function wo(t){return t?(t.nodeName||"").toLowerCase():null}function Si(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function kl(t){var e=Si(t).Element;return t instanceof e||t instanceof Element}function _i(t){var e=Si(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function _w(t){if(typeof ShadowRoot>"u")return!1;var e=Si(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function cZ(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!_i(o)||!wo(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function fZ(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(u,f){return u[f]="",u},{});!_i(i)||!wo(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(u){i.removeAttribute(u)}))})}}const LL={name:"applyStyles",enabled:!0,phase:"write",fn:cZ,effect:fZ,requires:["computeStyles"]};function vo(t){return t.split("-")[0]}var al=Math.max,Gm=Math.min,tc=Math.round;function Qb(){var t=navigator.userAgentData;return t!=null&&t.brands?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function NL(){return!/^((?!chrome|android).)*safari/i.test(Qb())}function nc(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&_i(t)&&(i=t.offsetWidth>0&&tc(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&tc(r.height)/t.offsetHeight||1);var s=kl(t)?Si(t):window,l=s.visualViewport,u=!NL()&&n,f=(r.left+(u&&l?l.offsetLeft:0))/i,d=(r.top+(u&&l?l.offsetTop:0))/o,m=r.width/i,v=r.height/o;return{width:m,height:v,top:d,right:f+m,bottom:d+v,left:f,x:f,y:d}}function ww(t){var e=nc(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function IL(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&_w(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Jo(t){return Si(t).getComputedStyle(t)}function dZ(t){return["table","td","th"].indexOf(wo(t))>=0}function ga(t){return((kl(t)?t.ownerDocument:t.document)||window.document).documentElement}function nv(t){return wo(t)==="html"?t:t.assignedSlot||t.parentNode||(_w(t)?t.host:null)||ga(t)}function RT(t){return!_i(t)||Jo(t).position==="fixed"?null:t.offsetParent}function hZ(t){var e=/firefox/i.test(Qb()),n=/Trident/i.test(Qb());if(n&&_i(t)){var r=Jo(t);if(r.position==="fixed")return null}var i=nv(t);for(_w(i)&&(i=i.host);_i(i)&&["html","body"].indexOf(wo(i))<0;){var o=Jo(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function $d(t){for(var e=Si(t),n=RT(t);n&&dZ(n)&&Jo(n).position==="static";)n=RT(n);return n&&(wo(n)==="html"||wo(n)==="body"&&Jo(n).position==="static")?e:n||hZ(t)||e}function kw(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Of(t,e,n){return al(t,Gm(e,n))}function pZ(t,e,n){var r=Of(t,e,n);return r>n?n:r}function PL(){return{top:0,right:0,bottom:0,left:0}}function DL(t){return Object.assign({},PL(),t)}function RL(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var mZ=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,DL(typeof e!="number"?e:RL(e,Bd))};function gZ(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,l=vo(n.placement),u=kw(l),f=[jr,xi].indexOf(l)>=0,d=f?"height":"width";if(!(!o||!s)){var m=mZ(i.padding,n),v=ww(o),y=u==="y"?Vr:jr,_=u==="y"?ki:xi,C=n.rects.reference[d]+n.rects.reference[u]-s[u]-n.rects.popper[d],x=s[u]-n.rects.reference[u],k=$d(o),A=k?u==="y"?k.clientHeight||0:k.clientWidth||0:0,N=C/2-x/2,E=m[y],H=A-v[d]-m[_],I=A/2-v[d]/2+N,q=Of(E,I,H),P=u;n.modifiersData[r]=(e={},e[P]=q,e.centerOffset=q-I,e)}}function vZ(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||IL(e.elements.popper,i)&&(e.elements.arrow=i))}const yZ={name:"arrow",enabled:!0,phase:"main",fn:gZ,effect:vZ,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function rc(t){return t.split("-")[1]}var bZ={top:"auto",right:"auto",bottom:"auto",left:"auto"};function _Z(t){var e=t.x,n=t.y,r=window,i=r.devicePixelRatio||1;return{x:tc(e*i)/i||0,y:tc(n*i)/i||0}}function zT(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,l=t.position,u=t.gpuAcceleration,f=t.adaptive,d=t.roundOffsets,m=t.isFixed,v=s.x,y=v===void 0?0:v,_=s.y,C=_===void 0?0:_,x=typeof d=="function"?d({x:y,y:C}):{x:y,y:C};y=x.x,C=x.y;var k=s.hasOwnProperty("x"),A=s.hasOwnProperty("y"),N=jr,E=Vr,H=window;if(f){var I=$d(n),q="clientHeight",P="clientWidth";if(I===Si(n)&&(I=ga(n),Jo(I).position!=="static"&&l==="absolute"&&(q="scrollHeight",P="scrollWidth")),I=I,i===Vr||(i===jr||i===xi)&&o===dd){E=ki;var z=m&&I===H&&H.visualViewport?H.visualViewport.height:I[q];C-=z-r.height,C*=u?1:-1}if(i===jr||(i===Vr||i===ki)&&o===dd){N=xi;var w=m&&I===H&&H.visualViewport?H.visualViewport.width:I[P];y-=w-r.width,y*=u?1:-1}}var R=Object.assign({position:l},f&&bZ),U=d===!0?_Z({x:y,y:C}):{x:y,y:C};if(y=U.x,C=U.y,u){var K;return Object.assign({},R,(K={},K[E]=A?"0":"",K[N]=k?"0":"",K.transform=(H.devicePixelRatio||1)<=1?"translate("+y+"px, "+C+"px)":"translate3d("+y+"px, "+C+"px, 0)",K))}return Object.assign({},R,(e={},e[E]=A?C+"px":"",e[N]=k?y+"px":"",e.transform="",e))}function wZ(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,l=n.roundOffsets,u=l===void 0?!0:l,f={placement:vo(e.placement),variation:rc(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,zT(Object.assign({},f,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,zT(Object.assign({},f,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const kZ={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:wZ,data:{}};var np={passive:!0};function xZ(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,l=s===void 0?!0:s,u=Si(e.elements.popper),f=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&f.forEach(function(d){d.addEventListener("scroll",n.update,np)}),l&&u.addEventListener("resize",n.update,np),function(){o&&f.forEach(function(d){d.removeEventListener("scroll",n.update,np)}),l&&u.removeEventListener("resize",n.update,np)}}const SZ={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:xZ,data:{}};var CZ={left:"right",right:"left",bottom:"top",top:"bottom"};function Pp(t){return t.replace(/left|right|bottom|top/g,function(e){return CZ[e]})}var TZ={start:"end",end:"start"};function BT(t){return t.replace(/start|end/g,function(e){return TZ[e]})}function xw(t){var e=Si(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Sw(t){return nc(ga(t)).left+xw(t).scrollLeft}function EZ(t,e){var n=Si(t),r=ga(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,u=0;if(i){o=i.width,s=i.height;var f=NL();(f||!f&&e==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:o,height:s,x:l+Sw(t),y:u}}function AZ(t){var e,n=ga(t),r=xw(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=al(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=al(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+Sw(t),u=-r.scrollTop;return Jo(i||n).direction==="rtl"&&(l+=al(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:u}}function Cw(t){var e=Jo(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function zL(t){return["html","body","#document"].indexOf(wo(t))>=0?t.ownerDocument.body:_i(t)&&Cw(t)?t:zL(nv(t))}function Mf(t,e){var n;e===void 0&&(e=[]);var r=zL(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Si(r),s=i?[o].concat(o.visualViewport||[],Cw(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(Mf(nv(s)))}function e1(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function OZ(t,e){var n=nc(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function $T(t,e,n){return e===OL?e1(EZ(t,n)):kl(e)?OZ(e,n):e1(AZ(ga(t)))}function MZ(t){var e=Mf(nv(t)),n=["absolute","fixed"].indexOf(Jo(t).position)>=0,r=n&&_i(t)?$d(t):t;return kl(r)?e.filter(function(i){return kl(i)&&IL(i,r)&&wo(i)!=="body"}):[]}function LZ(t,e,n,r){var i=e==="clippingParents"?MZ(t):[].concat(e),o=[].concat(i,[n]),s=o[0],l=o.reduce(function(u,f){var d=$T(t,f,r);return u.top=al(d.top,u.top),u.right=Gm(d.right,u.right),u.bottom=Gm(d.bottom,u.bottom),u.left=al(d.left,u.left),u},$T(t,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function BL(t){var e=t.reference,n=t.element,r=t.placement,i=r?vo(r):null,o=r?rc(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,u;switch(i){case Vr:u={x:s,y:e.y-n.height};break;case ki:u={x:s,y:e.y+e.height};break;case xi:u={x:e.x+e.width,y:l};break;case jr:u={x:e.x-n.width,y:l};break;default:u={x:e.x,y:e.y}}var f=i?kw(i):null;if(f!=null){var d=f==="y"?"height":"width";switch(o){case ec:u[f]=u[f]-(e[d]/2-n[d]/2);break;case dd:u[f]=u[f]+(e[d]/2-n[d]/2);break}}return u}function hd(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,l=n.boundary,u=l===void 0?ZX:l,f=n.rootBoundary,d=f===void 0?OL:f,m=n.elementContext,v=m===void 0?Yc:m,y=n.altBoundary,_=y===void 0?!1:y,C=n.padding,x=C===void 0?0:C,k=DL(typeof x!="number"?x:RL(x,Bd)),A=v===Yc?QX:Yc,N=t.rects.popper,E=t.elements[_?A:v],H=LZ(kl(E)?E:E.contextElement||ga(t.elements.popper),u,d,s),I=nc(t.elements.reference),q=BL({reference:I,element:N,strategy:"absolute",placement:i}),P=e1(Object.assign({},N,q)),z=v===Yc?P:I,w={top:H.top-z.top+k.top,bottom:z.bottom-H.bottom+k.bottom,left:H.left-z.left+k.left,right:z.right-H.right+k.right},R=t.modifiersData.offset;if(v===Yc&&R){var U=R[i];Object.keys(w).forEach(function(K){var oe=[xi,ki].indexOf(K)>=0?1:-1,D=[Vr,ki].indexOf(K)>=0?"y":"x";w[K]+=U[D]*oe})}return w}function NZ(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,f=u===void 0?ML:u,d=rc(r),m=d?l?DT:DT.filter(function(_){return rc(_)===d}):Bd,v=m.filter(function(_){return f.indexOf(_)>=0});v.length===0&&(v=m);var y=v.reduce(function(_,C){return _[C]=hd(t,{placement:C,boundary:i,rootBoundary:o,padding:s})[vo(C)],_},{});return Object.keys(y).sort(function(_,C){return y[_]-y[C]})}function IZ(t){if(vo(t)===bw)return[];var e=Pp(t);return[BT(t),e,BT(e)]}function PZ(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!0:s,u=n.fallbackPlacements,f=n.padding,d=n.boundary,m=n.rootBoundary,v=n.altBoundary,y=n.flipVariations,_=y===void 0?!0:y,C=n.allowedAutoPlacements,x=e.options.placement,k=vo(x),A=k===x,N=u||(A||!_?[Pp(x)]:IZ(x)),E=[x].concat(N).reduce(function(yt,Xe){return yt.concat(vo(Xe)===bw?NZ(e,{placement:Xe,boundary:d,rootBoundary:m,padding:f,flipVariations:_,allowedAutoPlacements:C}):Xe)},[]),H=e.rects.reference,I=e.rects.popper,q=new Map,P=!0,z=E[0],w=0;w=0,D=oe?"width":"height",ae=hd(e,{placement:R,boundary:d,rootBoundary:m,altBoundary:v,padding:f}),ce=oe?K?xi:jr:K?ki:Vr;H[D]>I[D]&&(ce=Pp(ce));var ve=Pp(ce),ze=[];if(o&&ze.push(ae[U]<=0),l&&ze.push(ae[ce]<=0,ae[ve]<=0),ze.every(function(yt){return yt})){z=R,P=!1;break}q.set(R,ze)}if(P)for(var qe=_?3:1,vt=function(Xe){var Ie=E.find(function(Be){var Ee=q.get(Be);if(Ee)return Ee.slice(0,Xe).every(function(Ze){return Ze})});if(Ie)return z=Ie,"break"},mt=qe;mt>0;mt--){var bt=vt(mt);if(bt==="break")break}e.placement!==z&&(e.modifiersData[r]._skip=!0,e.placement=z,e.reset=!0)}}const DZ={name:"flip",enabled:!0,phase:"main",fn:PZ,requiresIfExists:["offset"],data:{_skip:!1}};function HT(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function FT(t){return[Vr,xi,ki,jr].some(function(e){return t[e]>=0})}function RZ(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=hd(e,{elementContext:"reference"}),l=hd(e,{altBoundary:!0}),u=HT(s,r),f=HT(l,i,o),d=FT(u),m=FT(f);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:f,isReferenceHidden:d,hasPopperEscaped:m},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":m})}const zZ={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:RZ};function BZ(t,e,n){var r=vo(t),i=[jr,Vr].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[jr,xi].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function $Z(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=ML.reduce(function(d,m){return d[m]=BZ(m,e.rects,o),d},{}),l=s[e.placement],u=l.x,f=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=f),e.modifiersData[r]=s}const HZ={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:$Z};function FZ(t){var e=t.state,n=t.name;e.modifiersData[n]=BL({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const VZ={name:"popperOffsets",enabled:!0,phase:"read",fn:FZ,data:{}};function jZ(t){return t==="x"?"y":"x"}function WZ(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!1:s,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,m=n.padding,v=n.tether,y=v===void 0?!0:v,_=n.tetherOffset,C=_===void 0?0:_,x=hd(e,{boundary:u,rootBoundary:f,padding:m,altBoundary:d}),k=vo(e.placement),A=rc(e.placement),N=!A,E=kw(k),H=jZ(E),I=e.modifiersData.popperOffsets,q=e.rects.reference,P=e.rects.popper,z=typeof C=="function"?C(Object.assign({},e.rects,{placement:e.placement})):C,w=typeof z=="number"?{mainAxis:z,altAxis:z}:Object.assign({mainAxis:0,altAxis:0},z),R=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,U={x:0,y:0};if(I){if(o){var K,oe=E==="y"?Vr:jr,D=E==="y"?ki:xi,ae=E==="y"?"height":"width",ce=I[E],ve=ce+x[oe],ze=ce-x[D],qe=y?-P[ae]/2:0,vt=A===ec?q[ae]:P[ae],mt=A===ec?-P[ae]:-q[ae],bt=e.elements.arrow,yt=y&&bt?ww(bt):{width:0,height:0},Xe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:PL(),Ie=Xe[oe],Be=Xe[D],Ee=Of(0,q[ae],yt[ae]),Ze=N?q[ae]/2-qe-Ee-Ie-w.mainAxis:vt-Ee-Ie-w.mainAxis,Ke=N?-q[ae]/2+qe+Ee+Be+w.mainAxis:mt+Ee+Be+w.mainAxis,Fe=e.elements.arrow&&$d(e.elements.arrow),at=Fe?E==="y"?Fe.clientTop||0:Fe.clientLeft||0:0,ie=(K=R==null?void 0:R[E])!=null?K:0,ne=ce+Ze-ie-at,be=ce+Ke-ie,_e=Of(y?Gm(ve,ne):ve,ce,y?al(ze,be):ze);I[E]=_e,U[E]=_e-ce}if(l){var xe,G=E==="x"?Vr:jr,Z=E==="x"?ki:xi,L=I[H],W=H==="y"?"height":"width",O=L+x[G],j=L-x[Z],F=[Vr,jr].indexOf(k)!==-1,Q=(xe=R==null?void 0:R[H])!=null?xe:0,le=F?O:L-q[W]-P[W]-Q+w.altAxis,pe=F?L+q[W]+P[W]-Q-w.altAxis:j,ye=y&&F?pZ(le,L,pe):Of(y?le:O,L,y?pe:j);I[H]=ye,U[H]=ye-L}e.modifiersData[r]=U}}const UZ={name:"preventOverflow",enabled:!0,phase:"main",fn:WZ,requiresIfExists:["offset"]};function qZ(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function KZ(t){return t===Si(t)||!_i(t)?xw(t):qZ(t)}function GZ(t){var e=t.getBoundingClientRect(),n=tc(e.width)/t.offsetWidth||1,r=tc(e.height)/t.offsetHeight||1;return n!==1||r!==1}function YZ(t,e,n){n===void 0&&(n=!1);var r=_i(e),i=_i(e)&&GZ(e),o=ga(e),s=nc(t,i,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((wo(e)!=="body"||Cw(o))&&(l=KZ(e)),_i(e)?(u=nc(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):o&&(u.x=Sw(o))),{x:s.left+l.scrollLeft-u.x,y:s.top+l.scrollTop-u.y,width:s.width,height:s.height}}function JZ(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var u=e.get(l);u&&i(u)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function XZ(t){var e=JZ(t);return uZ.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function ZZ(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function QZ(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var VT={placement:"bottom",modifiers:[],strategy:"absolute"};function jT(){for(var t=arguments.length,e=new Array(t),n=0;n-1}function jL(t,e){return typeof t=="function"?t.apply(void 0,e):t}function WT(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function oQ(t){return t.split(/\s+/).filter(Boolean)}function fu(t){return[].concat(t)}function UT(t,e){t.indexOf(e)===-1&&t.push(e)}function sQ(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function aQ(t){return t.split("-")[0]}function Ym(t){return[].slice.call(t)}function qT(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Lf(){return document.createElement("div")}function rv(t){return["Element","Fragment"].some(function(e){return Tw(t,e)})}function lQ(t){return Tw(t,"NodeList")}function uQ(t){return Tw(t,"MouseEvent")}function cQ(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function fQ(t){return rv(t)?[t]:lQ(t)?Ym(t):Array.isArray(t)?t:Ym(document.querySelectorAll(t))}function ny(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function KT(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function dQ(t){var e,n=fu(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function hQ(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,l=i.props,u=l.interactiveBorder,f=aQ(s.placement),d=s.modifiersData.offset;if(!d)return!0;var m=f==="bottom"?d.top.y:0,v=f==="top"?d.bottom.y:0,y=f==="right"?d.left.x:0,_=f==="left"?d.right.x:0,C=o.top-r+m>u,x=r-o.bottom-v>u,k=o.left-n+y>u,A=n-o.right-_>u;return C||x||k||A})}function ry(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function GT(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var ao={isTouch:!1},YT=0;function pQ(){ao.isTouch||(ao.isTouch=!0,window.performance&&document.addEventListener("mousemove",WL))}function WL(){var t=performance.now();t-YT<20&&(ao.isTouch=!1,document.removeEventListener("mousemove",WL)),YT=t}function mQ(){var t=document.activeElement;if(cQ(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function gQ(){document.addEventListener("touchstart",pQ,Da),window.addEventListener("blur",mQ)}var vQ=typeof window<"u"&&typeof document<"u",yQ=vQ?!!window.msCrypto:!1,bQ={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},_Q={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},zi=Object.assign({appendTo:VL,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},bQ,_Q),wQ=Object.keys(zi),kQ=function(e){var n=Object.keys(e);n.forEach(function(r){zi[r]=e[r]})};function UL(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var l;r[o]=t[o]!==void 0?t[o]:(l=zi[o])!=null?l:s}return r},{});return Object.assign({},t,n)}function xQ(t,e){var n=e?Object.keys(UL(Object.assign({},zi,{plugins:e}))):wQ,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function JT(t,e){var n=Object.assign({},e,{content:jL(e.content,[t])},e.ignoreAttributes?{}:xQ(t,e.plugins));return n.aria=Object.assign({},zi.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var SQ=function(){return"innerHTML"};function t1(t,e){t[SQ()]=e}function XT(t){var e=Lf();return t===!0?e.className=HL:(e.className=FL,rv(t)?e.appendChild(t):t1(e,t)),e}function ZT(t,e){rv(e.content)?(t1(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?t1(t,e.content):t.textContent=e.content)}function n1(t){var e=t.firstElementChild,n=Ym(e.children);return{box:e,content:n.find(function(r){return r.classList.contains($L)}),arrow:n.find(function(r){return r.classList.contains(HL)||r.classList.contains(FL)}),backdrop:n.find(function(r){return r.classList.contains(iQ)})}}function qL(t){var e=Lf(),n=Lf();n.className=rQ,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Lf();r.className=$L,r.setAttribute("data-state","hidden"),ZT(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var l=n1(e),u=l.box,f=l.content,d=l.arrow;s.theme?u.setAttribute("data-theme",s.theme):u.removeAttribute("data-theme"),typeof s.animation=="string"?u.setAttribute("data-animation",s.animation):u.removeAttribute("data-animation"),s.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?u.setAttribute("role",s.role):u.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&ZT(f,t.props),s.arrow?d?o.arrow!==s.arrow&&(u.removeChild(d),u.appendChild(XT(s.arrow))):u.appendChild(XT(s.arrow)):d&&u.removeChild(d)}return{popper:e,onUpdate:i}}qL.$$tippy=!0;var CQ=1,rp=[],iy=[];function TQ(t,e){var n=JT(t,Object.assign({},zi,UL(qT(e)))),r,i,o,s=!1,l=!1,u=!1,f=!1,d,m,v,y=[],_=WT(ne,n.interactiveDebounce),C,x=CQ++,k=null,A=sQ(n.plugins),N={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},E={id:x,reference:t,popper:Lf(),popperInstance:k,props:n,state:N,plugins:A,clearDelayTimeouts:le,setProps:pe,setContent:ye,show:Y,hide:X,hideWithInteractivity:de,enable:F,disable:Q,unmount:Te,destroy:je};if(!n.render)return E;var H=n.render(E),I=H.popper,q=H.onUpdate;I.setAttribute("data-tippy-root",""),I.id="tippy-"+E.id,E.popper=I,t._tippy=E,I._tippy=E;var P=A.map(function(he){return he.fn(E)}),z=t.hasAttribute("aria-expanded");return Fe(),qe(),ce(),ve("onCreate",[E]),n.showOnCreate&&O(),I.addEventListener("mouseenter",function(){E.props.interactive&&E.state.isVisible&&E.clearDelayTimeouts()}),I.addEventListener("mouseleave",function(){E.props.interactive&&E.props.trigger.indexOf("mouseenter")>=0&&oe().addEventListener("mousemove",_)}),E;function w(){var he=E.props.touch;return Array.isArray(he)?he:[he,0]}function R(){return w()[0]==="hold"}function U(){var he;return!!((he=E.props.render)!=null&&he.$$tippy)}function K(){return C||t}function oe(){var he=K().parentNode;return he?dQ(he):document}function D(){return n1(I)}function ae(he){return E.state.isMounted&&!E.state.isVisible||ao.isTouch||d&&d.type==="focus"?0:ty(E.props.delay,he?0:1,zi.delay)}function ce(he){he===void 0&&(he=!1),I.style.pointerEvents=E.props.interactive&&!he?"":"none",I.style.zIndex=""+E.props.zIndex}function ve(he,Ae,Le){if(Le===void 0&&(Le=!0),P.forEach(function(Je){Je[he]&&Je[he].apply(Je,Ae)}),Le){var me;(me=E.props)[he].apply(me,Ae)}}function ze(){var he=E.props.aria;if(he.content){var Ae="aria-"+he.content,Le=I.id,me=fu(E.props.triggerTarget||t);me.forEach(function(Je){var ct=Je.getAttribute(Ae);if(E.state.isVisible)Je.setAttribute(Ae,ct?ct+" "+Le:Le);else{var ot=ct&&ct.replace(Le,"").trim();ot?Je.setAttribute(Ae,ot):Je.removeAttribute(Ae)}})}}function qe(){if(!(z||!E.props.aria.expanded)){var he=fu(E.props.triggerTarget||t);he.forEach(function(Ae){E.props.interactive?Ae.setAttribute("aria-expanded",E.state.isVisible&&Ae===K()?"true":"false"):Ae.removeAttribute("aria-expanded")})}}function vt(){oe().removeEventListener("mousemove",_),rp=rp.filter(function(he){return he!==_})}function mt(he){if(!(ao.isTouch&&(u||he.type==="mousedown"))){var Ae=he.composedPath&&he.composedPath()[0]||he.target;if(!(E.props.interactive&>(I,Ae))){if(fu(E.props.triggerTarget||t).some(function(Le){return GT(Le,Ae)})){if(ao.isTouch||E.state.isVisible&&E.props.trigger.indexOf("click")>=0)return}else ve("onClickOutside",[E,he]);E.props.hideOnClick===!0&&(E.clearDelayTimeouts(),E.hide(),l=!0,setTimeout(function(){l=!1}),E.state.isMounted||Ie())}}}function bt(){u=!0}function yt(){u=!1}function Xe(){var he=oe();he.addEventListener("mousedown",mt,!0),he.addEventListener("touchend",mt,Da),he.addEventListener("touchstart",yt,Da),he.addEventListener("touchmove",bt,Da)}function Ie(){var he=oe();he.removeEventListener("mousedown",mt,!0),he.removeEventListener("touchend",mt,Da),he.removeEventListener("touchstart",yt,Da),he.removeEventListener("touchmove",bt,Da)}function Be(he,Ae){Ze(he,function(){!E.state.isVisible&&I.parentNode&&I.parentNode.contains(I)&&Ae()})}function Ee(he,Ae){Ze(he,Ae)}function Ze(he,Ae){var Le=D().box;function me(Je){Je.target===Le&&(ry(Le,"remove",me),Ae())}if(he===0)return Ae();ry(Le,"remove",m),ry(Le,"add",me),m=me}function Ke(he,Ae,Le){Le===void 0&&(Le=!1);var me=fu(E.props.triggerTarget||t);me.forEach(function(Je){Je.addEventListener(he,Ae,Le),y.push({node:Je,eventType:he,handler:Ae,options:Le})})}function Fe(){R()&&(Ke("touchstart",ie,{passive:!0}),Ke("touchend",be,{passive:!0})),oQ(E.props.trigger).forEach(function(he){if(he!=="manual")switch(Ke(he,ie),he){case"mouseenter":Ke("mouseleave",be);break;case"focus":Ke(yQ?"focusout":"blur",_e);break;case"focusin":Ke("focusout",_e);break}})}function at(){y.forEach(function(he){var Ae=he.node,Le=he.eventType,me=he.handler,Je=he.options;Ae.removeEventListener(Le,me,Je)}),y=[]}function ie(he){var Ae,Le=!1;if(!(!E.state.isEnabled||xe(he)||l)){var me=((Ae=d)==null?void 0:Ae.type)==="focus";d=he,C=he.currentTarget,qe(),!E.state.isVisible&&uQ(he)&&rp.forEach(function(Je){return Je(he)}),he.type==="click"&&(E.props.trigger.indexOf("mouseenter")<0||s)&&E.props.hideOnClick!==!1&&E.state.isVisible?Le=!0:O(he),he.type==="click"&&(s=!Le),Le&&!me&&j(he)}}function ne(he){var Ae=he.target,Le=K().contains(Ae)||I.contains(Ae);if(!(he.type==="mousemove"&&Le)){var me=W().concat(I).map(function(Je){var ct,ot=Je._tippy,Ct=(ct=ot.popperInstance)==null?void 0:ct.state;return Ct?{popperRect:Je.getBoundingClientRect(),popperState:Ct,props:n}:null}).filter(Boolean);hQ(me,he)&&(vt(),j(he))}}function be(he){var Ae=xe(he)||E.props.trigger.indexOf("click")>=0&&s;if(!Ae){if(E.props.interactive){E.hideWithInteractivity(he);return}j(he)}}function _e(he){E.props.trigger.indexOf("focusin")<0&&he.target!==K()||E.props.interactive&&he.relatedTarget&&I.contains(he.relatedTarget)||j(he)}function xe(he){return ao.isTouch?R()!==he.type.indexOf("touch")>=0:!1}function G(){Z();var he=E.props,Ae=he.popperOptions,Le=he.placement,me=he.offset,Je=he.getReferenceClientRect,ct=he.moveTransition,ot=U()?n1(I).arrow:null,Ct=Je?{getBoundingClientRect:Je,contextElement:Je.contextElement||K()}:t,yr={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Gt){var Kn=Gt.state;if(U()){var Gr=D(),Yr=Gr.box;["placement","reference-hidden","escaped"].forEach(function(Sn){Sn==="placement"?Yr.setAttribute("data-placement",Kn.placement):Kn.attributes.popper["data-popper-"+Sn]?Yr.setAttribute("data-"+Sn,""):Yr.removeAttribute("data-"+Sn)}),Kn.attributes.popper={}}}},Kt=[{name:"offset",options:{offset:me}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ct}},yr];U()&&ot&&Kt.push({name:"arrow",options:{element:ot,padding:3}}),Kt.push.apply(Kt,(Ae==null?void 0:Ae.modifiers)||[]),E.popperInstance=nQ(Ct,I,Object.assign({},Ae,{placement:Le,onFirstUpdate:v,modifiers:Kt}))}function Z(){E.popperInstance&&(E.popperInstance.destroy(),E.popperInstance=null)}function L(){var he=E.props.appendTo,Ae,Le=K();E.props.interactive&&he===VL||he==="parent"?Ae=Le.parentNode:Ae=jL(he,[Le]),Ae.contains(I)||Ae.appendChild(I),E.state.isMounted=!0,G()}function W(){return Ym(I.querySelectorAll("[data-tippy-root]"))}function O(he){E.clearDelayTimeouts(),he&&ve("onTrigger",[E,he]),Xe();var Ae=ae(!0),Le=w(),me=Le[0],Je=Le[1];ao.isTouch&&me==="hold"&&Je&&(Ae=Je),Ae?r=setTimeout(function(){E.show()},Ae):E.show()}function j(he){if(E.clearDelayTimeouts(),ve("onUntrigger",[E,he]),!E.state.isVisible){Ie();return}if(!(E.props.trigger.indexOf("mouseenter")>=0&&E.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(he.type)>=0&&s)){var Ae=ae(!1);Ae?i=setTimeout(function(){E.state.isVisible&&E.hide()},Ae):o=requestAnimationFrame(function(){E.hide()})}}function F(){E.state.isEnabled=!0}function Q(){E.hide(),E.state.isEnabled=!1}function le(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function pe(he){if(!E.state.isDestroyed){ve("onBeforeUpdate",[E,he]),at();var Ae=E.props,Le=JT(t,Object.assign({},Ae,qT(he),{ignoreAttributes:!0}));E.props=Le,Fe(),Ae.interactiveDebounce!==Le.interactiveDebounce&&(vt(),_=WT(ne,Le.interactiveDebounce)),Ae.triggerTarget&&!Le.triggerTarget?fu(Ae.triggerTarget).forEach(function(me){me.removeAttribute("aria-expanded")}):Le.triggerTarget&&t.removeAttribute("aria-expanded"),qe(),ce(),q&&q(Ae,Le),E.popperInstance&&(G(),W().forEach(function(me){requestAnimationFrame(me._tippy.popperInstance.forceUpdate)})),ve("onAfterUpdate",[E,he])}}function ye(he){E.setProps({content:he})}function Y(){var he=E.state.isVisible,Ae=E.state.isDestroyed,Le=!E.state.isEnabled,me=ao.isTouch&&!E.props.touch,Je=ty(E.props.duration,0,zi.duration);if(!(he||Ae||Le||me)&&!K().hasAttribute("disabled")&&(ve("onShow",[E],!1),E.props.onShow(E)!==!1)){if(E.state.isVisible=!0,U()&&(I.style.visibility="visible"),ce(),Xe(),E.state.isMounted||(I.style.transition="none"),U()){var ct=D(),ot=ct.box,Ct=ct.content;ny([ot,Ct],0)}v=function(){var Kt;if(!(!E.state.isVisible||f)){if(f=!0,I.offsetHeight,I.style.transition=E.props.moveTransition,U()&&E.props.animation){var Xt=D(),Gt=Xt.box,Kn=Xt.content;ny([Gt,Kn],Je),KT([Gt,Kn],"visible")}ze(),qe(),UT(iy,E),(Kt=E.popperInstance)==null||Kt.forceUpdate(),ve("onMount",[E]),E.props.animation&&U()&&Ee(Je,function(){E.state.isShown=!0,ve("onShown",[E])})}},L()}}function X(){var he=!E.state.isVisible,Ae=E.state.isDestroyed,Le=!E.state.isEnabled,me=ty(E.props.duration,1,zi.duration);if(!(he||Ae||Le)&&(ve("onHide",[E],!1),E.props.onHide(E)!==!1)){if(E.state.isVisible=!1,E.state.isShown=!1,f=!1,s=!1,U()&&(I.style.visibility="hidden"),vt(),Ie(),ce(!0),U()){var Je=D(),ct=Je.box,ot=Je.content;E.props.animation&&(ny([ct,ot],me),KT([ct,ot],"hidden"))}ze(),qe(),E.props.animation?U()&&Be(me,E.unmount):E.unmount()}}function de(he){oe().addEventListener("mousemove",_),UT(rp,_),_(he)}function Te(){E.state.isVisible&&E.hide(),E.state.isMounted&&(Z(),W().forEach(function(he){he._tippy.unmount()}),I.parentNode&&I.parentNode.removeChild(I),iy=iy.filter(function(he){return he!==E}),E.state.isMounted=!1,ve("onHidden",[E]))}function je(){E.state.isDestroyed||(E.clearDelayTimeouts(),E.unmount(),at(),delete t._tippy,E.state.isDestroyed=!0,ve("onDestroy",[E]))}}function Kr(t,e){e===void 0&&(e={});var n=zi.plugins.concat(e.plugins||[]);gQ();var r=Object.assign({},e,{plugins:n}),i=fQ(t),o=i.reduce(function(s,l){var u=l&&TQ(l,r);return u&&s.push(u),s},[]);return rv(t)?o[0]:o}Kr.defaultProps=zi;Kr.setDefaultProps=kQ;Kr.currentInput=ao;Object.assign({},LL,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});Kr.setDefaultProps({render:qL});function QT(t){return I1((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class EQ extends aL{constructor(e={}){return super(e),this.vueRenderers=Al(new Map),this.contentComponent=null,this.reactiveState=QT(this.view.state),this.reactiveExtensionStorage=QT(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),fa(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){super.registerPlugin(e,n),this.reactiveState.value=this.view.state}unregisterPlugin(e){super.unregisterPlugin(e),this.reactiveState.value=this.view.state}}const AQ=Vn({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=Ot(),n=qi();return l3(()=>{const r=t.editor;r&&r.options.element&&e.value&&Ri(()=>{if(!e.value||!r.options.element.firstChild)return;const i=fr(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,r.setOptions({element:i}),r.createNodeViews()})}),Ml(()=>{const r=t.editor;if(!r||(r.isDestroyed||r.view.setProps({nodeViews:{}}),r.contentComponent=null,!r.options.element.firstChild))return;const i=document.createElement("div");i.append(...r.options.element.childNodes),r.setOptions({element:i})}),{rootEl:e}},render(){const t=[];return this.editor&&this.editor.vueRenderers.forEach(e=>{const n=Hr(z3,{to:e.teleportElement,key:e.id},Hr(e.component,{ref:e.id,...e.props}));t.push(n)}),Hr("div",{ref:e=>{this.rootEl=e}},...t)}}),Ew=Vn({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return Hr(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))}});class KL{constructor(e,{props:n={},editor:r}){if(this.id=Math.floor(Math.random()*4294967295).toString(),this.editor=r,this.component=fa(e),this.teleportElement=document.createElement("div"),this.element=this.teleportElement,this.props=Al(n),this.editor.vueRenderers.set(this.id,this),this.editor.contentComponent){if(this.editor.contentComponent.update(),this.teleportElement.children.length!==1)throw Error("VueRenderer doesn’t support multiple child elements.");this.element=this.teleportElement.firstElementChild}}get ref(){var e;return(e=this.editor.contentComponent)===null||e===void 0?void 0:e.refs[this.id]}updateProps(e={}){Object.entries(e).forEach(([n,r])=>{this.props[n]=r})}destroy(){this.editor.vueRenderers.delete(this.id)}}class OQ extends lL{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(i={})=>this.updateAttributes(i),deleteNode:()=>this.deleteNode()},n=this.onDragStart.bind(this);this.decorationClasses=Ot(this.getDecorationClasses());const r=Vn({extends:{...this.component},props:Object.keys(e),template:this.component.template,setup:i=>{var o,s;return Wp("onDragStart",n),Wp("decorationClasses",this.decorationClasses),(s=(o=this.component).setup)===null||s===void 0?void 0:s.call(o,i,{expose:()=>{}})},__scopeId:this.component.__scopeId,__cssModules:this.component.__cssModules,__name:this.component.__name,__file:this.component.__file});this.renderer=new KL(r,{editor:this.editor,props:e})}get dom(){if(!this.renderer.element.hasAttribute("data-node-view-wrapper"))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.dom.querySelector("[data-node-view-content]")||this.dom}update(e,n){const r=i=>{this.decorationClasses.value=this.getDecorationClasses(),this.renderer.updateProps(i)};if(typeof this.options.update=="function"){const i=this.node,o=this.decorations;return this.node=e,this.decorations=n,this.options.update({oldNode:i,oldDecorations:o,newNode:e,newDecorations:n,updateProps:()=>r({node:e,decorations:n})})}return e.type!==this.node.type?!1:(e===this.node&&this.decorations===n||(this.node=e,this.decorations=n,r({node:e,decorations:n})),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}getDecorationClasses(){return this.decorations.map(e=>e.type.attrs.class).flat().join(" ")}destroy(){this.renderer.destroy()}}function Aw(t,e){return n=>n.editor.contentComponent?new OQ(t,n,e):{}}const Bt=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},MQ={name:"IframeView",components:{NodeViewWrapper:Ew},props:{editor:{type:Object,default:()=>{}},node:{type:Object,default:()=>{}},decorations:{type:Array,default:()=>[]},selected:{type:Boolean,default:!1},extension:{type:Object,default:()=>{}},getPos:{type:Function,default:()=>{}},updateAttributes:{type:Function,default:()=>{}}}},LQ={class:"vui-iframe-wrap"},NQ=["src"];function IQ(t,e,n,r,i,o){const s=ut("node-view-wrapper");return ge(),Et(s,{class:gt(["vui-iframe",{selected:n.selected}])},{default:Vt(()=>[ee("div",LQ,[ee("iframe",wi(n.node.attrs,{src:n.node.attrs.url}),null,16,NQ)])]),_:1},8,["class"])}const PQ=Bt(MQ,[["render",IQ]]),DQ=_n.create({name:"iframe",group:"block",atom:!0,addAttributes(){return{url:{default:null},frameborder:{default:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen}}},parseHTML(){return[{tag:"iframe"}]},renderHTML({HTMLAttributes:t}){return["iframe",t]},addNodeView(){return Aw(PQ)},addCommands(){return{setIframe:t=>({tr:e,dispatch:n})=>{const{selection:r}=e,i=this.type.create(t);return n&&e.replaceRangeWith(r.from,r.to,i),!0}}},addProseMirrorPlugins(){return[new on({key:new xn("handleClick"),props:{handleClick:(t,e,n)=>{n.target.classList.contains("vui-iframe")&&setTimeout(()=>{this.editor.emit("vui:iframe-clicked",n)},50)}}})]}}),GL=(t="")=>{try{const e=new URL(t);return e!==null&&e.protocol.startsWith("http")}catch{return!1}},r1=t=>new URL(t).host.replace("www.",""),YL=fetch,RQ=async(t,e={})=>{const{target:n,headers:r={}}=e;return await YL(n+encodeURIComponent(t),{headers:r})},zQ=async(t,e={})=>{const{headers:n={"user-agent":"Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0"},proxy:r=null}=e,i=r?await RQ(t,r):await YL(t,{headers:n}),o=i.status;if(o>=400)throw new Error(`Request failed with error code ${o}`);try{const s=await i.text();return JSON.parse(s.trim())}catch{throw new Error("Failed to convert data to JSON object")}},BQ=t=>r1(t)==="graph.facebook.com",$Q=()=>{const t=process.env||{},e=t.FACEBOOK_APP_ID,n=t.FACEBOOK_CLIENT_TOKEN;return`${e}|${n}`},HQ=async(t,e={},n="",r={})=>{const i={url:t,format:"json",...e};i.maxwidth<=0&&delete i.maxwidth,i.maxheight<=0&&delete i.maxheight,BQ(n)&&(i.access_token=$Q());const o=new URLSearchParams(i).toString(),s=n+"?"+o;return zQ(s,r)},FQ=[{s:["www\\.23hq\\.com/*/photo/*"],e:"www.23hq.com/23/oembed"},{s:["store\\.abraia\\.me/*"],e:"api.abraia.me/oembed"},{s:["play\\.acast\\.com/s/*"],e:"oembed.acast.com/v1/embed-player"},{s:["secure\\.actblue\\.com/donate/*"],e:"secure.actblue.com/cf/oembed"},{s:["adilo\\.bigcommand\\.com/watch/*"],e:"adilo.bigcommand.com/web/oembed"},{s:["v\\.afree\\.ca/ST/","vod\\.afreecatv\\.com/ST/","vod\\.afreecatv\\.com/PLAYER/STATION/","play\\.afreecatv\\.com/"],e:"openapi.afreecatv.com/oembed/embedinfo"},{s:["altium\\.com/viewer/*"],e:"viewer.altium.com/shell/oembed"},{s:["app\\.altrulabs\\.com/*/*?answer_id=*","app\\.altrulabs\\.com/player/*"],e:"api.altrulabs.com/api/v1/social/oembed"},{s:["live\\.amcharts\\.com/*"],e:"live.amcharts.com/oembed"},{s:["amtraker\\.com/trains/*","beta\\.amtraker\\.com/trains/*"],e:"api.amtraker.com/v2/oembed"},{s:["www\\.animatron\\.com/project/*","animatron\\.com/project/*"],e:"animatron.com/oembed/json"},{s:["animoto\\.com/play/*"],e:"animoto.com/oembeds/create"},{s:["anniemusic\\.app/t/*","anniemusic\\.app/p/*"],e:"api.anniemusic.app/api/v1/oembed"},{s:["storymaps\\.arcgis\\.com/stories/*"],e:"storymaps.arcgis.com/oembed"},{s:["app\\.archivos\\.digital/app/view/*"],e:"app.archivos.digital/oembed/"},{s:["audioboom\\.com/channels/*","audioboom\\.com/channel/*","audioboom\\.com/playlists/*","audioboom\\.com/podcasts/*","audioboom\\.com/podcast/*","audioboom\\.com/posts/*","audioboom\\.com/episodes/*"],e:"audioboom.com/publishing/oembed.json"},{s:["audioclip\\.naver\\.com/channels/*/clips/*","audioclip\\.naver\\.com/audiobooks/*"],e:"audioclip.naver.com/oembed"},{s:["audiomack\\.com/*/song/*","audiomack\\.com/*/album/*","audiomack\\.com/*/playlist/*"],e:"audiomack.com/oembed"},{s:["podcasts\\.audiomeans\\.fr/*"],e:"podcasts.audiomeans.fr/services/oembed"},{s:["app\\.avocode\\.com/view/*"],e:"stage-embed.avocode.com/api/oembed"},{s:["backtracks\\.fm/*/*/e/*","backtracks\\.fm/*/s/*/*","backtracks\\.fm/*/*/*/*/e/*/*","backtracks\\.fm/*"],e:"backtracks.fm/oembed"},{s:["beams\\.fm/*"],e:"api.beams.fm/oEmbed"},{s:[],e:"www.beautiful.ai/api/oembed"},{s:["blackfire\\.io/profiles/*/graph","blackfire\\.io/profiles/compare/*/graph"],e:"blackfire.io/oembed"},{s:["blogcast\\.host/embed/*","blogcast\\.host/embedly/*"],e:"blogcast.host/oembed"},{s:["www\\.bookingmood\\.com/embed/*/*"],e:"bookingmood.com/api/oembed"},{s:[],e:"boxofficebuz.com/oembed"},{s:["view\\.briovr\\.com/api/v1/worlds/oembed/*"],e:"view.briovr.com/api/v1/worlds/oembed/"},{s:["www\\.bumper\\.com/oembed/bumper","www\\.bumper\\.com/oembed-s/bumper"],e:"www.bumper.com/oembed/bumper"},{s:["buttondown\\.email/*"],e:"buttondown.email/embed"},{s:["cmc\\.byzart\\.eu/files/*"],e:"cmc.byzart.eu/oembed/"},{s:["cacoo\\.com/diagrams/*"],e:"cacoo.com/oembed.json"},{s:["minesweeper\\.today/*"],e:"minesweeper.today/api/oembed"},{s:["img\\.catbo\\.at/*"],e:"img.catbo.at/oembed.json"},{s:["view\\.ceros\\.com/*"],e:"view.ceros.com/oembed"},{s:["chainflix\\.net/video/*","chainflix\\.net/video/embed/*","*\\.chainflix\\.net/video/*","*\\.chainflix\\.net/video/embed/*"],e:"www.chainflix.net/video/oembed"},{s:["public\\.chartblocks\\.com/c/*"],e:"embed.chartblocks.com/1.0/oembed"},{s:["chirb\\.it/*"],e:"chirb.it/oembed.json"},{s:["chroco\\.ooo/mypage/*","chroco\\.ooo/story/*"],e:"chroco.ooo/embed"},{s:["www\\.circuitlab\\.com/circuit/*"],e:"www.circuitlab.com/circuit/oembed/"},{s:["www\\.clipland\\.com/v/*"],e:"www.clipland.com/api/oembed"},{s:["clyp\\.it/*","clyp\\.it/playlist/*"],e:"api.clyp.it/oembed/"},{s:["app\\.ilovecoco\\.video/*/embed"],e:"app.ilovecoco.video/api/oembed.json"},{s:["codehs\\.com/editor/share_abacus/*"],e:"codehs.com/api/sharedprogram/1/oembed/"},{s:["codepen\\.io/*"],e:"codepen.io/api/oembed"},{s:["codepoints\\.net/*","www\\.codepoints\\.net/*"],e:"codepoints.net/api/v1/oembed"},{s:["codesandbox\\.io/s/*","codesandbox\\.io/embed/*"],e:"codesandbox.io/oembed"},{s:["www\\.collegehumor\\.com/video/*"],e:"www.collegehumor.com/oembed.json"},{s:["commaful\\.com/play/*"],e:"commaful.com/api/oembed/"},{s:["coub\\.com/view/*","coub\\.com/embed/*"],e:"coub.com/api/oembed.json"},{s:["crowdranking\\.com/*/*"],e:"crowdranking.com/api/oembed.json"},{s:["crumb\\.sh/*"],e:"crumb.sh/oembed/"},{s:["cueup\\.io/user/*/sounds/*"],e:"gql.cueup.io/oembed"},{s:["*\\.curated\\.co/*"],e:"api.curated.co/oembed"},{s:["app\\.customerdb\\.com/share/*"],e:"app.customerdb.com/embed"},{s:["app\\.dadan\\.io/*","stage\\.dadan\\.io/*"],e:"app.dadan.io/api/video/oembed"},{s:["www\\.dailymotion\\.com/video/*"],e:"www.dailymotion.com/services/oembed"},{s:["dalexni\\.com/i/*"],e:"dalexni.com/oembed/"},{s:["datawrapper\\.dwcdn\\.net/*"],e:"api.datawrapper.de/v3/oembed/"},{s:["*\\.deseret\\.com/*"],e:"embed.deseret.com/"},{s:["*\\.deviantart\\.com/art/*","*\\.deviantart\\.com/*#/d*","fav\\.me/*","sta\\.sh/*","*\\.deviantart\\.com/*/art/*",'sta\\.sh/*",','*\\.deviantart\\.com/*#/d*"'],e:"backend.deviantart.com/oembed"},{s:["www\\.ultimedia\\.com/central/video/edit/id/*/topic_id/*/","www\\.ultimedia\\.com/default/index/videogeneric/id/*/showtitle/1/viewnc/1","www\\.ultimedia\\.com/default/index/videogeneric/id/*"],e:"www.ultimedia.com/api/search/oembed"},{s:["*\\.docdroid\\.net/*","docdro\\.id/*","*\\.docdroid\\.com/*"],e:"www.docdroid.net/api/oembed"},{s:["docswell\\.com/*/*","www\\.docswell\\.com/*/*"],e:"www.docswell.com/service/oembed"},{s:["dotsub\\.com/view/*"],e:"dotsub.com/services/oembed"},{s:["www\\.dreambroker\\.com/channel/*/*"],e:"dreambroker.com/channel/oembed"},{s:["d\\.tube/v/*"],e:"api.d.tube/oembed"},{s:[],e:"www.edumedia-sciences.com/oembed.json"},{s:[],e:"www.edumedia-sciences.com/oembed.xml"},{s:["egliseinfo\\.catholique\\.fr/*"],e:"egliseinfo.catholique.fr/api/oembed"},{s:["embedery\\.com/widget/*"],e:"embedery.com/api/oembed"},{s:["music\\.enystre\\.com/lyrics/*"],e:"music.enystre.com/oembed"},{s:["ethfiddle\\.com/*"],e:"ethfiddle.com/services/oembed/"},{s:["evt\\.live/*","evt\\.live/*/*","live\\.eventlive\\.pro/*","live\\.eventlive\\.pro/*/*"],e:"evt.live/api/oembed"},{s:["app\\.everviz\\.com/embed/*"],e:"api.everviz.com/oembed"},{s:["app\\.ex\\.co/stories/*","www\\.playbuzz\\.com/*"],e:"oembed.ex.co/item"},{s:["eyrie\\.io/board/*","eyrie\\.io/sparkfun/*"],e:"eyrie.io/v1/oembed"},{s:["www\\.facebook\\.com/*/posts/*","www\\.facebook\\.com/*/activity/*","www\\.facebook\\.com/*/photos/*","www\\.facebook\\.com/photo\\.php?fbid=*","www\\.facebook\\.com/photos/*","www\\.facebook\\.com/permalink\\.php?story_fbid=*","www\\.facebook\\.com/media/set?set=*","www\\.facebook\\.com/questions/*","www\\.facebook\\.com/notes/*/*/*"],e:"graph.facebook.com/v10.0/oembed_post"},{s:["www\\.facebook\\.com/*/videos/*","www\\.facebook\\.com/video\\.php?id=*","www\\.facebook\\.com/video\\.php?v=*"],e:"graph.facebook.com/v10.0/oembed_video"},{s:["www\\.facebook\\.com/*"],e:"graph.facebook.com/v10.0/oembed_page"},{s:["app\\.getfader\\.com/projects/*/publish"],e:"app.getfader.com/api/oembed"},{s:["faithlifetv\\.com/items/*","faithlifetv\\.com/items/resource/*/*","faithlifetv\\.com/media/*","faithlifetv\\.com/media/assets/*","faithlifetv\\.com/media/resource/*/*"],e:"faithlifetv.com/api/oembed"},{s:["*\\.fireworktv\\.com/*","*\\.fireworktv\\.com/embed/*/v/*"],e:"www.fireworktv.com/oembed"},{s:["www\\.fite\\.tv/watch/*"],e:"www.fite.tv/oembed"},{s:["flat\\.io/score/*","*\\.flat\\.io/score/*"],e:"flat.io/services/oembed"},{s:["*\\.flickr\\.com/photos/*","flic\\.kr/p/*","*\\.*\\.flickr\\.com/*/*"],e:"www.flickr.com/services/oembed/"},{s:["public\\.flourish\\.studio/visualisation/*","public\\.flourish\\.studio/story/*"],e:"app.flourish.studio/api/v1/oembed"},{s:["fiso\\.foxsports\\.com\\.au/isomorphic-widget/*"],e:"fiso.foxsports.com.au/oembed"},{s:["framebuzz\\.com/v/*"],e:"framebuzz.com/oembed/"},{s:["framer\\.com/share/*","framer\\.com/embed/*"],e:"api.framer.com/web/oembed"},{s:["*\\.geograph\\.org\\.uk/*","*\\.geograph\\.co\\.uk/*","*\\.geograph\\.ie/*","*\\.wikimedia\\.org/*_geograph\\.org\\.uk_*"],e:"api.geograph.org.uk/api/oembed"},{s:["*\\.geograph\\.org\\.gg/*","*\\.geograph\\.org\\.je/*","channel-islands\\.geograph\\.org/*","channel-islands\\.geographs\\.org/*","*\\.channel\\.geographs\\.org/*"],e:"www.geograph.org.gg/api/oembed"},{s:["geo-en\\.hlipp\\.de/*","geo\\.hlipp\\.de/*","germany\\.geograph\\.org/*"],e:"geo.hlipp.de/restapi.php/api/oembed"},{s:["gty\\.im/*"],e:"embed.gettyimages.com/oembed"},{s:["gfycat\\.com/*","www\\.gfycat\\.com/*"],e:"api.gfycat.com/v1/oembed"},{s:["www\\.gifnote\\.com/play/*"],e:"www.gifnote.com/services/oembed"},{s:["giphy\\.com/gifs/*","giphy\\.com/clips/*","gph\\.is/*","media\\.giphy\\.com/media/*/giphy\\.gif"],e:"giphy.com/services/oembed"},{s:[],e:"gloria.tv/oembed/"},{s:["view\\.gmetri\\.com/*","*\\.gmetri\\.com/*"],e:"embed.gmetri.com/oembed/"},{s:["app\\.gong\\.io/call?id=*"],e:"app.gong.io/oembed"},{s:["grain\\.co/highlight/*","grain\\.co/share/*","grain\\.com/share/*"],e:"api.grain.com/_/api/oembed"},{s:["gtchannel\\.com/watch/*"],e:"api.luminery.com/oembed"},{s:["gyazo\\.com/*"],e:"api.gyazo.com/api/oembed"},{s:["core\\.hash\\.ai/@*"],e:"api.hash.ai/oembed"},{s:["hearthis\\.at/*/*/","hearthis\\.at/*/set/*/"],e:"hearthis.at/oembed/?format=json"},{s:["heyzine\\.com/flip-book/*","*\\.hflip\\.co/*","*\\.aflip\\.in/*"],e:"heyzine.com/api1/oembed"},{s:["player\\.hihaho\\.com/*"],e:"player.hihaho.com/services/oembed"},{s:["*\\.hippovideo\\.io/*"],e:"www.hippovideo.io/services/oembed"},{s:["homey\\.app/f/*","homey\\.app/*/flow/*"],e:"homey.app/api/oembed/flow"},{s:["huffduffer\\.com/*/*"],e:"huffduffer.com/oembed"},{s:["www\\.hulu\\.com/watch/*"],e:"www.hulu.com/api/oembed.json"},{s:["*\\.idomoo\\.com/*"],e:"oembed.idomoo.com/oembed"},{s:["www\\.ifixit\\.com/Guide/View/*"],e:"www.ifixit.com/Embed"},{s:["ifttt\\.com/recipes/*"],e:"www.ifttt.com/oembed/"},{s:["www\\.iheart\\.com/podcast/*/*"],e:"www.iheart.com/oembed"},{s:["qr\\.imenupro\\.com/*"],e:"qr.imenupro.com/api/oembed"},{s:["incredible\\.dev/watch/*"],e:"oembed.incredible.dev/oembed"},{s:["player\\.indacolive\\.com/player/jwp/clients/*"],e:"player.indacolive.com/services/oembed"},{s:["infogram\\.com/*"],e:"infogram.com/oembed"},{s:["*\\.infoveave\\.net/E/*","*\\.infoveave\\.net/P/*"],e:"infoveave.net/services/oembed/"},{s:["www\\.injurymap\\.com/exercises/*"],e:"www.injurymap.com/services/oembed"},{s:["www\\.inoreader\\.com/oembed/"],e:"www.inoreader.com/oembed/api/"},{s:["*\\.inphood\\.com/*"],e:"api.inphood.com/oembed"},{s:["instagram\\.com/*/p/*,","www\\.instagram\\.com/*/p/*,","instagram\\.com/p/*","instagr\\.am/p/*","www\\.instagram\\.com/p/*","www\\.instagr\\.am/p/*","instagram\\.com/tv/*","instagr\\.am/tv/*","www\\.instagram\\.com/tv/*","www\\.instagr\\.am/tv/*","www\\.instagram\\.com/reel/*","instagram\\.com/reel/*","instagr\\.am/reel/*"],e:"graph.facebook.com/v10.0/instagram_oembed"},{s:["ppa\\.insticator\\.com/embed-unit/*"],e:"www.insticator.com/oembed"},{s:["issuu\\.com/*/docs/*"],e:"issuu.com/oembed"},{s:["jovian\\.ml/*","jovian\\.ml/viewer*","*\\.jovian\\.ml/*","jovian\\.ai/*","jovian\\.ai/viewer*","*\\.jovian\\.ai/*","jovian\\.com/*","jovian\\.com/viewer*","*\\.jovian\\.com/*"],e:"api.jovian.com/oembed.json"},{s:["tv\\.kakao\\.com/channel/*/cliplink/*","tv\\.kakao\\.com/m/channel/*/cliplink/*","tv\\.kakao\\.com/channel/v/*","tv\\.kakao\\.com/channel/*/livelink/*","tv\\.kakao\\.com/m/channel/*/livelink/*","tv\\.kakao\\.com/channel/l/*"],e:"tv.kakao.com/oembed"},{s:["www\\.kickstarter\\.com/projects/*"],e:"www.kickstarter.com/services/oembed"},{s:["www\\.kidoju\\.com/en/x/*/*","www\\.kidoju\\.com/fr/x/*/*"],e:"www.kidoju.com/api/oembed"},{s:["halaman\\.email/form/*","aplikasi\\.kirim\\.email/form/*"],e:"halaman.email/service/oembed"},{s:["kit\\.co/*/*"],e:"embed.kit.co/oembed"},{s:["www\\.kitchenbowl\\.com/recipe/*"],e:"www.kitchenbowl.com/oembed"},{s:["app\\.kmdr\\.sh/h/*","app\\.kmdr\\.sh/history/*"],e:"api.kmdr.sh/services/oembed"},{s:["jdr\\.knacki\\.info/meuh/*"],e:"jdr.knacki.info/oembed"},{s:["knowledgepad\\.co/#/knowledge/*"],e:"api.spoonacular.com/knowledge/oembed"},{s:["*\\.kooapp\\.com/koo/*"],e:"embed.kooapp.com/services/oembed"},{s:["kurozora\\.app/episodes*","kurozora\\.app/songs*"],e:"kurozora.app/oembed"},{s:["learningapps\\.org/*"],e:"learningapps.org/oembed.php"},{s:["umotion-test\\.univ-lemans\\.fr/video/*"],e:"umotion-test.univ-lemans.fr/oembed"},{s:["pod\\.univ-lille\\.fr/video/*"],e:"pod.univ-lille.fr/video/oembed"},{s:["place\\.line\\.me/businesses/*"],e:"place.line.me/oembed"},{s:["livestream\\.com/accounts/*/events/*","livestream\\.com/accounts/*/events/*/videos/*","livestream\\.com/*/events/*","livestream\\.com/*/events/*/videos/*","livestream\\.com/*/*","livestream\\.com/*/*/videos/*"],e:"livestream.com/oembed"},{s:["lottiefiles\\.com/*","*\\.lottiefiles\\.com/*"],e:"embed.lottiefiles.com/oembed"},{s:["app\\.ludus\\.one/*"],e:"app.ludus.one/oembed"},{s:["*\\.lumiere\\.is/v/*"],e:"admin.lumiere.is/api/services/oembed"},{s:["mathembed\\.com/latex?inputText=*"],e:"mathembed.com/oembed"},{s:[],e:"my.matterport.com/api/v1/models/oembed/"},{s:["me\\.me/i/*"],e:"me.me/oembed"},{s:["mdstrm\\.com/embed/*","mdstrm\\.com/live-stream/*","mdstrm\\.com/image/*"],e:"mdstrm.com/oembed"},{s:["medienarchiv\\.zhdk\\.ch/entries/*"],e:"medienarchiv.zhdk.ch/oembed.json"},{s:["mermaid\\.ink/img/*","mermaid\\.ink/svg/*"],e:"mermaid.ink/services/oembed"},{s:["*\\.microsoftstream\\.com/video/*","*\\.microsoftstream\\.com/channel/*"],e:"web.microsoftstream.com/oembed"},{s:["www\\.minervaknows\\.com/featured-recipes/*","www\\.minervaknows\\.com/themes/*","www\\.minervaknows\\.com/themes/*/recipes/*","app\\.minervaknows\\.com/recipes/*","app\\.minervaknows\\.com/recipes/*/follow"],e:"oembed.minervaknows.com"},{s:["miro\\.com/app/board/*"],e:"miro.com/api/v1/oembed"},{s:["www\\.mixcloud\\.com/*/*/"],e:"www.mixcloud.com/oembed/"},{s:["mixpanel\\.com/*"],e:"mixpanel.com/api/app/embed/oembed/"},{s:["www\\.mobypicture\\.com/user/*/view/*","moby\\.to/*"],e:"api.mobypicture.com/oEmbed"},{s:["musicboxmaniacs\\.com/explore/melody/*"],e:"musicboxmaniacs.com/embed/"},{s:["mybeweeg\\.com/w/*"],e:"mybeweeg.com/services/oembed"},{s:["namchey\\.com/embeds/*"],e:"namchey.com/api/oembed"},{s:["*\\.nanoo\\.tv/link/*","nanoo\\.tv/link/*","*\\.nanoo\\.pro/link/*","nanoo\\.pro/link/*","media\\.zhdk\\.ch/signatur/*","new\\.media\\.zhdk\\.ch/signatur/*"],e:"www.nanoo.tv/services/oembed"},{s:["www\\.nb\\.no/items/*"],e:"api.nb.no/catalog/v1/oembed"},{s:["naturalatlas\\.com/*","naturalatlas\\.com/*/*","naturalatlas\\.com/*/*/*","naturalatlas\\.com/*/*/*/*"],e:"naturalatlas.com/oembed.json"},{s:["ndla\\.no/*"],e:"ndla.no/oembed"},{s:["liste\\.ndla\\.no/*"],e:"liste.ndla.no/oembed"},{s:["*\\.nfb\\.ca/film/*"],e:"www.nfb.ca/remote/services/oembed/"},{s:["nopaste\\.ml/*"],e:"oembed.nopaste.ml"},{s:["observablehq\\.com/@*/*","observablehq\\.com/d/*","observablehq\\.com/embed/*"],e:"api.observablehq.com/oembed"},{s:["www\\.odds\\.com\\.au/*","odds\\.com\\.au/*"],e:"www.odds.com.au/api/oembed/"},{s:["song\\.link/*","album\\.link/*","artist\\.link/*","playlist\\.link/*","pods\\.link/*","mylink\\.page/*","odesli\\.co/*"],e:"song.link/oembed"},{s:["odysee\\.com/*/*","odysee\\.com/*"],e:"odysee.com/$/oembed"},{s:["official\\.fm/tracks/*","official\\.fm/playlists/*"],e:"official.fm/services/oembed.json"},{s:["omniscope\\.me/*"],e:"omniscope.me/_global_/oembed/json"},{s:["omny\\.fm/shows/*"],e:"omny.fm/oembed"},{s:["orbitvu\\.co/001/*/ov3601/view","orbitvu\\.co/001/*/ov3601/*/view","orbitvu\\.co/001/*/ov3602/*/view","orbitvu\\.co/001/*/2/orbittour/*/view","orbitvu\\.co/001/*/1/2/orbittour/*/view"],e:"orbitvu.co/service/oembed"},{s:["outplayed\\.tv/media/*"],e:"outplayed.tv/oembed"},{s:["overflow\\.io/s/*","overflow\\.io/embed/*"],e:"overflow.io/services/oembed"},{s:["www\\.oz\\.com/*/video/*"],e:"core.oz.com/oembed"},{s:["padlet\\.com/*"],e:"padlet.com/oembed/"},{s:["*\\.tv\\.pandavideo\\.com\\.br/embed/?v=*","*\\.tv\\.pandavideo\\.com\\.br/*/playlist\\.m3u8","dashboard\\.pandavideo\\.com\\.br/#/videos/*"],e:"api-v2.pandavideo.com.br/oembed"},{s:["pastery\\.net/*","www\\.pastery\\.net/*"],e:"www.pastery.net/oembed"},{s:["www\\.picturelfy\\.com/p/*"],e:"api.picturelfy.com/service/oembed/"},{s:["*\\.builder\\.pikasso\\.xyz/embed/*"],e:"builder.pikasso.xyz/api/oembed"},{s:[],e:"beta.pingvp.com.kpnis.nl/p/oembed.php"},{s:["tools\\.pinpoll\\.com/embed/*"],e:"tools.pinpoll.com/oembed"},{s:["www\\.pinterest\\.com/*"],e:"www.pinterest.com/oembed.json"},{s:["player\\.pitchhub\\.com/en/public/player/*"],e:"player.pitchhub.com/en/public/oembed"},{s:["store\\.pixdor\\.com/place-marker-widget/*/show","store\\.pixdor\\.com/map/*/show"],e:"store.pixdor.com/oembed"},{s:["app\\.plusdocs\\.com/*/snapshots/*","app\\.plusdocs\\.com/*/pages/edit/*","app\\.plusdocs\\.com/*/pages/share/*"],e:"app.plusdocs.com/oembed"},{s:["*\\.podbean\\.com/e/*"],e:"api.podbean.com/v1/oembed"},{s:["*\\.polldaddy\\.com/s/*","*\\.polldaddy\\.com/poll/*","*\\.polldaddy\\.com/ratings/*"],e:"polldaddy.com/oembed/"},{s:["portfolium\\.com/entry/*"],e:"api.portfolium.com/oembed"},{s:["present\\.do/decks/*"],e:"gateway.cobalt.run/present/decks/oembed"},{s:["prezi\\.com/v/*","*\\.prezi\\.com/v/*"],e:"prezi.com/v/oembed"},{s:["qtpi\\.gg/fashion/*"],e:"qtpi.gg/fashion/oembed"},{s:["www\\.quiz\\.biz/quizz-*\\.html"],e:"www.quiz.biz/api/oembed"},{s:["www\\.quizz\\.biz/quizz-*\\.html"],e:"www.quizz.biz/api/oembed"},{s:["play\\.radiopublic\\.com/*","radiopublic\\.com/*","www\\.radiopublic\\.com/*","*\\.radiopublic\\.com/*"],e:"oembed.radiopublic.com/oembed"},{s:["raindrop\\.io/*","raindrop\\.io/*/*","raindrop\\.io/*/*/*","raindrop\\.io/*/*/*/*"],e:"pub.raindrop.io/api/oembed"},{s:["www\\.rcvis\\.com/v/*","www\\.rcvis\\.com/visualize=*","www\\.rcvis\\.com/ve/*","www\\.rcvis\\.com/visualizeEmbedded=*"],e:"animatron.com/oembed"},{s:["reddit\\.com/r/*/comments/*/*","www\\.reddit\\.com/r/*/comments/*/*"],e:"www.reddit.com/oembed"},{s:["rwire\\.com/*"],e:"publisher.releasewire.com/oembed/"},{s:["repl\\.it/@*/*","replit\\.com/@*/*"],e:"replit.com/data/oembed"},{s:["www\\.reverbnation\\.com/*","www\\.reverbnation\\.com/*/songs/*"],e:"www.reverbnation.com/oembed"},{s:["roomshare\\.jp/post/*","roomshare\\.jp/en/post/*"],e:"roomshare.jp/en/oembed.json"},{s:["roosterteeth\\.com/*"],e:"roosterteeth.com/oembed"},{s:[],e:"rumble.com/api/Media/oembed.json"},{s:["embed\\.runkit\\.com/*,"],e:"embed.runkit.com/oembed"},{s:["octopus\\.saooti\\.com/main/pub/podcast/*"],e:"octopus.saooti.com/oembed"},{s:["videos\\.sapo\\.pt/*"],e:"videos.sapo.pt/oembed"},{s:["console\\.screen9\\.com/*","*\\.screen9\\.tv/*"],e:"api.screen9.com/oembed"},{s:["www\\.screencast\\.com/*"],e:"api.screencast.com/external/oembed"},{s:["www\\.screenr\\.com/*/"],e:"www.screenr.com/api/oembed.json"},{s:["www\\.scribblemaps\\.com/maps/view/*","scribblemaps\\.com/maps/view/*"],e:"scribblemaps.com/api/services/oembed.json"},{s:["www\\.scribd\\.com/doc/*"],e:"www.scribd.com/services/oembed/"},{s:["embed\\.sendtonews\\.com/oembed/*"],e:"embed.sendtonews.com/services/oembed"},{s:["www\\.shortnote\\.jp/view/notes/*"],e:"www.shortnote.jp/oembed/"},{s:["shoudio\\.com/*","shoud\\.io/*"],e:"shoudio.com/api/oembed"},{s:["app\\.getshow\\.io/iframe/*","*\\.getshow\\.io/share/*"],e:"api.getshow.io/oembed.json"},{s:["showtheway\\.io/to/*"],e:"showtheway.io/oembed"},{s:["simplecast\\.com/s/*"],e:"simplecast.com/oembed"},{s:["onsizzle\\.com/i/*"],e:"onsizzle.com/oembed"},{s:["sketchfab\\.com/*models/*","sketchfab\\.com/*/folders/*"],e:"sketchfab.com/oembed"},{s:["www\\.slideshare\\.net/*/*","fr\\.slideshare\\.net/*/*","de\\.slideshare\\.net/*/*","es\\.slideshare\\.net/*/*","pt\\.slideshare\\.net/*/*"],e:"www.slideshare.net/api/oembed/2"},{s:["smashnotes\\.com/p/*","smashnotes\\.com/p/*/e/* - https://smashnotes\\.com/p/*/e/*/s/*"],e:"smashnotes.com/services/oembed"},{s:["open\\.smeme\\.com/*"],e:"open.smeme.com/api/oembed"},{s:["www\\.smrthi\\.com/book/*"],e:"www.smrthi.com/api/oembed"},{s:["*\\.smugmug\\.com/*"],e:"api.smugmug.com/services/oembed/"},{s:["www\\.socialexplorer\\.com/*/explore","www\\.socialexplorer\\.com/*/view","www\\.socialexplorer\\.com/*/edit","www\\.socialexplorer\\.com/*/embed"],e:"www.socialexplorer.com/services/oembed/"},{s:["soundcloud\\.com/*","on\\.soundcloud\\.com/*","soundcloud\\.app\\.goog\\.gl/*"],e:"soundcloud.com/oembed"},{s:["speakerdeck\\.com/*/*"],e:"speakerdeck.com/oembed.json"},{s:["open\\.spotify\\.com/*","spotify:*"],e:"open.spotify.com/oembed"},{s:["*\\.spotlightr\\.com/watch/*","*\\.spotlightr\\.com/publish/*","*\\.cdn\\.spotlightr\\.com/watch/*","*\\.cdn\\.spotlightr\\.com/publish/*"],e:"api.spotlightr.com/getOEmbed"},{s:["*\\.spreaker\\.com/*"],e:"api.spreaker.com/oembed"},{s:["sproutvideo\\.com/videos/*","*\\.vids\\.io/videos/*"],e:"sproutvideo.com/oembed.json"},{s:["purl\\.stanford\\.edu/*"],e:"purl.stanford.edu/embed.json"},{s:["streamable\\.com/*"],e:"api.streamable.com/oembed.json"},{s:["s3m\\.io/*","23m\\.io/*"],e:"streamio.com/api/v1/oembed"},{s:["subscribi\\.io/api/oembed*"],e:"subscribi.io/api/oembed"},{s:["www\\.sudomemo\\.net/watch/*","flipnot\\.es/*"],e:"www.sudomemo.net/oembed"},{s:["www\\.sutori\\.com/story/*"],e:"www.sutori.com/api/oembed"},{s:["sway\\.com/*","www\\.sway\\.com/*"],e:"sway.com/api/v1.0/oembed"},{s:["sway\\.office\\.com/*"],e:"sway.office.com/api/v1.0/oembed"},{s:["share\\.synthesia\\.io/*"],e:"69jr5v75rc.execute-api.eu-west-1.amazonaws.com/prod/v2/oembed"},{s:["ted\\.com/talks/*","www\\.ted\\.com/talks/*"],e:"www.ted.com/services/v1/oembed.json"},{s:["www\\.nytimes\\.com/svc/oembed","nytimes\\.com/*","*\\.nytimes\\.com/*"],e:"www.nytimes.com/svc/oembed/json/"},{s:["theysaidso\\.com/image/*"],e:"theysaidso.com/extensions/oembed/"},{s:["www\\.tickcounter\\.com/countdown/*","www\\.tickcounter\\.com/countup/*","www\\.tickcounter\\.com/ticker/*","www\\.tickcounter\\.com/worldclock/*"],e:"www.tickcounter.com/oembed"},{s:["www\\.tiktok\\.com/*","www\\.tiktok\\.com/*/video/*"],e:"www.tiktok.com/oembed"},{s:["www\\.toornament\\.com/tournaments/*/information","www\\.toornament\\.com/tournaments/*/registration/","www\\.toornament\\.com/tournaments/*/matches/schedule","www\\.toornament\\.com/tournaments/*/stages/*/"],e:"widget.toornament.com/oembed"},{s:["www\\.topy\\.se/image/*"],e:"www.topy.se/oembed/"},{s:["app-test\\.totango\\.com/*"],e:"app-test.totango.com/oembed"},{s:["trinitymedia\\.ai/player/*"],e:"trinitymedia.ai/player/trinity-oembed"},{s:["*\\.tumblr\\.com/post/*"],e:"www.tumblr.com/oembed/1.0"},{s:["www\\.tuxx\\.be/*"],e:"www.tuxx.be/services/oembed"},{s:["play\\.tvcf\\.co\\.kr/*","*\\.tvcf\\.co\\.kr/*"],e:"play.tvcf.co.kr/rest/oembed"},{s:["twinmotion\\.unrealengine\\.com/presentation/*","twinmotion\\.unrealengine\\.com/panorama/*"],e:"twinmotion.unrealengine.com/oembed"},{s:["twitter\\.com/*","twitter\\.com/*/status/*","*\\.twitter\\.com/*/status/*"],e:"publish.twitter.com/oembed"},{s:["play\\.typecast\\.ai/s/*","play\\.typecast\\.ai/e/*","play\\.typecast\\.ai/*"],e:"play.typecast.ai/oembed"},{s:[],e:"typlog.com/oembed"},{s:["uapod\\.univ-antilles\\.fr/video/*"],e:"uapod.univ-antilles.fr/oembed"},{s:["map\\.cam\\.ac\\.uk/*"],e:"map.cam.ac.uk/oembed/"},{s:["mediatheque\\.univ-paris1\\.fr/video/*"],e:"mediatheque.univ-paris1.fr/oembed"},{s:["pod\\.u-pec\\.fr/video/*"],e:"pod.u-pec.fr/oembed"},{s:["*\\.ustream\\.tv/*","*\\.ustream\\.com/*"],e:"www.ustream.tv/oembed"},{s:["*\\.ustudio\\.com/embed/*","*\\.ustudio\\.com/embed/*/*"],e:"app.ustudio.com/api/v2/oembed"},{s:["veer\\.tv/videos/*"],e:"api.veer.tv/oembed"},{s:["veervr\\.tv/videos/*"],e:"api.veervr.tv/oembed"},{s:["www\\.vevo\\.com/*"],e:"www.vevo.com/oembed"},{s:["videfit\\.com/videos/*"],e:"videfit.com/oembed"},{s:["vidmount\\.com/*"],e:"vidmount.com/oembed"},{s:["*\\.vidyard\\.com/*","*\\.hubs\\.vidyard\\.com/*"],e:"api.vidyard.com/dashboard/v1.1/oembed"},{s:["vimeo\\.com/*","vimeo\\.com/album/*/video/*","vimeo\\.com/channels/*/*","vimeo\\.com/groups/*/videos/*","vimeo\\.com/ondemand/*/*","player\\.vimeo\\.com/video/*"],e:"vimeo.com/api/oembed.json"},{s:["www\\.viously\\.com/*/*"],e:"www.viously.com/oembed"},{s:["vizydrop\\.com/shared/*"],e:"vizydrop.com/oembed"},{s:["vlipsy\\.com/*"],e:"vlipsy.com/oembed"},{s:["www\\.vlive\\.tv/video/*"],e:"www.vlive.tv/oembed"},{s:["*\\.vouchfor\\.com/*"],e:"embed.vouchfor.com/v1/oembed"},{s:["article\\.voxsnap\\.com/*/*"],e:"data.voxsnap.com/oembed"},{s:["waltrack\\.net/product/*"],e:"waltrack.net/oembed"},{s:["watch\\.wave\\.video/*","embed\\.wave\\.video/*"],e:"embed.wave.video/oembed"},{s:["play\\.wecandeo\\.com/video/v/*"],e:"play.wecandeo.com/oembed/"},{s:["whimsical\\.com/*"],e:"whimsical.com/api/oembed"},{s:["fast\\.wistia\\.com/embed/iframe/*","fast\\.wistia\\.com/embed/playlists/*","*\\.wistia\\.com/medias/*"],e:"fast.wistia.com/oembed.json"},{s:["*\\.wizer\\.me/learn/*","*\\.wizer\\.me/preview/*"],e:"app.wizer.me/api/oembed.json"},{s:["wokwi\\.com/share/*"],e:"wokwi.com/api/oembed"},{s:["*\\.wolframcloud\\.com/*"],e:"www.wolframcloud.com/oembed"},{s:["wordpress\\.com/*","*\\.wordpress\\.com/*","*\\.*\\.wordpress\\.com/*","wp\\.me/*"],e:"public-api.wordpress.com/oembed/"},{s:["*\\.youtube\\.com/watch*","*\\.youtube\\.com/v/*","youtu\\.be/*","*\\.youtube\\.com/playlist?list=*","youtube\\.com/playlist?list=*","*\\.youtube\\.com/shorts*"],e:"www.youtube.com/oembed"},{s:["app\\.zeplin\\.io/project/*/screen/*","app\\.zeplin\\.io/project/*/screen/*/version/*","app\\.zeplin\\.io/project/*/styleguide/components?coid=*","app\\.zeplin\\.io/styleguide/*/components?coid=*"],e:"app.zeplin.io/embed"},{s:["app\\.zingsoft\\.com/embed/*","app\\.zingsoft\\.com/view/*"],e:"app.zingsoft.com/oembed"},{s:["*\\.znipe\\.tv/*"],e:"api.znipe.tv/v3/oembed/"},{s:["srv2\\.zoomable\\.ca/viewer\\.php*"],e:"srv2.zoomable.ca/oembed"}],VQ=(t="")=>new RegExp(t.replace(/\\./g,".").replace(/\*/g,"(.*)").replace(/\?/g,"\\?").replace(/,$/g,""),"i"),jQ=(t=[])=>t.map(e=>{const{e:n,s:r}=e;return{endpoint:`https://${n}`,schemes:r.map(VQ)}}),WQ={providers:jQ(FQ)},UQ=()=>[...WQ.providers],qQ=(t="",e="",n=[])=>{if(!n.length){const r=r1(t),i=r1(e);return r===i}return n.some(r=>t.match(r))},KQ=(t="")=>{if(!GL(t))return null;const e=UQ();for(let n=0;n{const e=KQ(t);return e?e.endpoint:null},YQ=async(t,e={},n={})=>{if(!GL(t))throw new Error("Invalid input URL");const r=GQ(t);if(!r)throw new Error(`No provider found with given url "${t}"`);return await HQ(t,e,r,n)},JQ=function(t){const e={heading:"",text:"",trace:""};e.heading=Qn(t,"response.statusText","An error has occurred"),e.text=Qn(t,"response.data.message",Qn(t,"response.data.error",t));const n=Qn(t,"response.data.file",""),r=Qn(t,"response.data.line","");n&&r&&(e.trace=`${n}:${r}`);const i=Qn(t,"response.data.trace.0.file",""),o=Qn(t,"response.data.trace.0.line","");i&&o&&(e.trace+=`
${i}:${o}`);const s=Qn(t,"stack","");return s&&(e.trace+=s),e},XQ={name:"MediaEmbedView",components:{NodeViewWrapper:Ew},props:{editor:{type:Object,default:()=>{}},node:{type:Object,default:()=>{}},decorations:{type:Array,default:()=>[]},selected:{type:Boolean,default:!1},extension:{type:Object,default:()=>{}},getPos:{type:Function,default:()=>{}},updateAttributes:{type:Function,default:()=>{}}},data(){return{error:!1,errorMessage:""}},computed:{html(){var t;return this.node.attrs.url?(t=this.data)==null?void 0:t.html:""},data:{get(){return this.node.attrs.data},set(t){return this.updateAttributes({data:t})}}},watch:{"node.attrs.url":function(t,e){this.initEmbed()}},created(){this.editor.on("vui:code-editor-toggle",()=>{this.initEmbed()})},mounted(){this.$nextTick(()=>{this.html||this.initEmbed()})},methods:{async initEmbed(){if(this.error=!1,this.errorMessage="",this.node.attrs.url)try{let{url:t}=this.node.attrs;const e=t.match(/youtube\.com\/live\/(\w+)/);e&&(t=`https://www.youtube.com/watch?v=${e[1]}`);const n=await YQ(t);this.data=n}catch(t){console.error(t),this.data=null,this.error=!0;const e=JQ(t);this.errorMessage=`${e.heading}
${e.text}
${e.trace}
`}}}},ZQ={key:0,class:"vui-media-wrap"},QQ={class:"vui-media-wrap-error"},eee=["innerHTML"],tee=["innerHTML"];function nee(t,e,n,r,i,o){const s=ut("node-view-wrapper");return ge(),Et(s,{class:gt(["vui-media-embed",{selected:n.selected}])},{default:Vt(()=>[i.error?(ge(),Se("div",ZQ,[ee("div",QQ,[ee("span",{class:"error",innerHTML:i.errorMessage},null,8,eee)])])):(ge(),Se("div",{key:1,class:"vui-media-wrap vui-loading vui-loading-lg",innerHTML:o.html},null,8,tee))]),_:1},8,["class"])}const ree=Bt(XQ,[["render",nee]]),iee=_n.create({name:"mediaEmbed",group:"block",atom:!0,addAttributes(){return{url:{default:null},data:{default:null}}},parseHTML(){return[{tag:"media-embed",getAttrs:t=>JSON.parse(t.innerHTML)}]},renderHTML({HTMLAttributes:t}){return["media-embed",JSON.stringify(t)]},addNodeView(){return Aw(ree)},addCommands(){return{setEmbed:t=>({tr:e,dispatch:n})=>{const{selection:r}=e,i=this.type.create(t);return n&&e.replaceRangeWith(r.from,r.to,i),!0}}},addProseMirrorPlugins(){return[new on({key:new xn("handleClick"),props:{handleClick:(t,e,n)=>{n.target.classList.contains("vui-media-embed")&&setTimeout(()=>{this.editor.emit("vui:media-embed-clicked",n)},50)}}})]}}),oee=[bY,kY,CY,MY,IY,PY,DY,RY,BY,HY,jY,qY.configure({levels:[1,2,3,4,5,6]}),KY,GY,JY,QJ.configure({resizable:!0}),nX,tX,eX,xX,SX.configure({types:["heading","paragraph"],defaultAlignment:"start"}),GX.configure({openOnClick:!1}),XX,DQ,iee],see=[{name:"h1",svg:"h1",title:Craft.t("vizy","Heading 1"),commandInfo:{shortcut:"Mod-Alt-1"},command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:1}).run()}},{name:"h2",svg:"h2",title:Craft.t("vizy","Heading 2"),commandInfo:{shortcut:"Mod-Alt-2"},command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:2}).run()}},{name:"h3",svg:"h3",title:Craft.t("vizy","Heading 3"),commandInfo:{shortcut:"Mod-Alt-3"},command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:3}).run()}},{name:"unordered-list",svg:"list-ul",title:Craft.t("vizy","Bullet List"),commandInfo:{shortcut:"Mod-Shift-8"},command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleBulletList().run()}},{name:"ordered-list",svg:"list-ol",title:Craft.t("vizy","Ordered List"),commandInfo:{shortcut:"Mod-Shift-7"},command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleOrderedList().run()}},{name:"media-embed",svg:"photo-film",title:Craft.t("vizy","Media Embed"),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).run(),t.emit("vui:media-embed-modal-open")}},{name:"link",svg:"link",title:Craft.t("vizy","Link"),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).run(),t.emit("vui:link-modal-open")}},{name:"image",icon:"image",title:Craft.t("vizy","Image"),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).run(),t.emit("vui:image-modal-open")}},{name:"code-block",svg:"code",title:Craft.t("vizy","Code Block"),commandInfo:{shortcut:"Mod-Alt-c"},command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleCodeBlock().run()}},{name:"blockquote",svg:"quote-right",title:Craft.t("vizy","Blockquote"),commandInfo:{shortcut:"Mod-Shift-b"},command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleBlockquote().run()}},{name:"hr",svg:"horizontal-rule",title:Craft.t("vizy","Horizontal Rule"),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setHorizontalRule().run()}}];class aee{constructor(e){this.instance=e,this.registeredExtensions=[],this.registeredButtons=[],this.registeredCommands=[]}registerExtensions(e){this.registeredExtensions.push(e)}registerButtons(e){this.registeredButtons.push(e)}registerCommands(e){this.registeredCommands.push(e)}getExtensions(){return this._getComponents(this.registeredExtensions,oee)}getButtons(){return this._getComponents(this.registeredButtons,pY)}getCommands(){return this._getComponents(this.registeredCommands,see)}_getComponents(e,n){return e.forEach(r=>{const i=r(n);i&&(n=n.concat(Array.isArray(i)?i:[i]))}),n.filter(r=>!!r)}get tiptap(){return{core:hY}}}const lee=or.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=cc(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),uee={name:"CollapseTransition",props:{name:{type:String,required:!1,default:"collapse"},dimension:{type:String,required:!1,default:"height",validator:t=>["height","width"].includes(t)},duration:{type:Number,required:!1,default:300},easing:{type:String,required:!1,default:"ease-in-out"}},watch:{dimension(){this.clearCachedDimensions()}},data(){return{cachedStyles:null}},computed:{transition(){let t=[];return Object.keys(this.cachedStyles).forEach(e=>{t.push(`${this.convertToCssProperty(e)} ${this.duration}ms ${this.easing}`)}),t.join(", ")}},methods:{beforeAppear(t){this.$emit("before-appear",t)},appear(t){this.$emit("appear",t)},afterAppear(t){this.$emit("after-appear",t)},appearCancelled(t){this.$emit("appear-cancelled",t)},beforeEnter(t){this.$emit("before-enter",t)},enter(t,e){this.detectAndCacheDimensions(t),this.setClosedDimensions(t),this.hideOverflow(t),this.forceRepaint(t),this.setTransition(t),this.setOpenedDimensions(t),this.$emit("enter",t,e),setTimeout(e,this.duration)},afterEnter(t){this.unsetOverflow(t),this.unsetTransition(t),this.unsetDimensions(t),this.clearCachedDimensions(),this.$emit("after-enter",t)},enterCancelled(t){this.$emit("enter-cancelled",t)},beforeLeave(t){this.$emit("before-leave",t)},leave(t,e){this.detectAndCacheDimensions(t),this.setOpenedDimensions(t),this.hideOverflow(t),this.forceRepaint(t),this.setTransition(t),this.setClosedDimensions(t),this.$emit("leave",t,e),setTimeout(e,this.duration)},afterLeave(t){this.unsetOverflow(t),this.unsetTransition(t),this.unsetDimensions(t),this.clearCachedDimensions(),this.$emit("after-leave",t)},leaveCancelled(t){this.$emit("leave-cancelled",t)},detectAndCacheDimensions(t){if(this.cachedStyles)return;const e=t.style.visibility,n=t.style.display;t.style.visibility="hidden",t.style.display="",this.cachedStyles=this.detectRelevantDimensions(t),t.style.visibility=e,t.style.display=n},clearCachedDimensions(){this.cachedStyles=null},detectRelevantDimensions(t){return this.dimension==="height"?{height:t.offsetHeight+"px",paddingTop:t.style.paddingTop||this.getCssValue(t,"padding-top"),paddingBottom:t.style.paddingBottom||this.getCssValue(t,"padding-bottom")}:this.dimension==="width"?{width:t.offsetWidth+"px",paddingLeft:t.style.paddingLeft||this.getCssValue(t,"padding-left"),paddingRight:t.style.paddingRight||this.getCssValue(t,"padding-right")}:{}},setTransition(t){t.style.transition=this.transition},unsetTransition(t){t.style.transition=""},hideOverflow(t){t.style.overflow="hidden"},unsetOverflow(t){t.style.overflow=""},setClosedDimensions(t){Object.keys(this.cachedStyles).forEach(e=>{t.style[e]="0"})},setOpenedDimensions(t){Object.keys(this.cachedStyles).forEach(e=>{t.style[e]=this.cachedStyles[e]})},unsetDimensions(t){Object.keys(this.cachedStyles).forEach(e=>{t.style[e]=""})},forceRepaint(t){getComputedStyle(t)[this.dimension]},getCssValue(t,e){return getComputedStyle(t,null).getPropertyValue(e)},convertToCssProperty(t){const e=t.match(/([A-Z])/g);if(!e)return t;for(let n=0,r=e.length;n[pn(t.$slots,"default")]),_:3},8,["name","onBeforeAppear","onAppear","onAfterAppear","onAppearCancelled","onBeforeEnter","onEnter","onAfterEnter","onEnterCancelled","onBeforeLeave","onLeave","onAfterLeave","onLeaveCancelled"])}const fee=Bt(uee,[["render",cee]]);function eE(t,e){let n,r;const i=t.toLowerCase();for(e=[].concat(e),n=0;n{if(typeof t=="number"&&(t=`${t}`),typeof t!="string")return!!t;if(t=t.trim(),eE(t,e||["true","1"]))return!0;if(eE(t,n||["false","0"]))return!1},hee={name:"LightswitchField",props:{small:{type:Boolean,default:!1},extraSmall:{type:Boolean,default:!1},modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{id:`lightswitch-${Craft.randomString(10)}`,dragger:null,dragging:!1,innerStyle:{},proxyValue:!1,indeterminate:!1}},computed:{offMargin(){return this.small?-10:-12}},watch:{proxyValue(t){this.$emit("update:modelValue",t)}},created(){this.proxyValue=this.modelValue},mounted(){const{container:t}=this.$refs;this.$nextTick(()=>{const e=$(t).data("lightswitch");e&&e.destroy(),this.dragger=new Garnish.BaseDrag(t,{axis:Garnish.X_AXIS,ignoreHandleSelector:null,onDragStart:this.onDragStart.bind(this),onDrag:this.onDrag.bind(this),onDragStop:this.onDragStop.bind(this)})})},beforeUnmount(){this.dragger&&this.dragger.destroy()},methods:{turnOn(){this.proxyValue=!0,this.indeterminate=!1,this.dragging=!0;const{innerContainer:t}=this.$refs,e={[`margin-${Craft.left}`]:0};$(t).velocity("stop").velocity(e,Craft.LightSwitch.animationDuration,this.onSettle.bind(this))},turnOff(){this.proxyValue=!1,this.indeterminate=!1,this.dragging=!0;const{innerContainer:t}=this.$refs,e={[`margin-${Craft.left}`]:this.offMargin};$(t).velocity("stop").velocity(e,Craft.LightSwitch.animationDuration,this.onSettle.bind(this))},toggle(){this.indeterminate||!this.proxyValue?this.turnOn():this.turnOff()},onMouseUp(){this.dragger.dragging||this.toggle()},onKeyDown(t){switch(t.keyCode){case Garnish.SPACE_KEY:{this.toggle(),t.preventDefault();break}case Garnish.RIGHT_KEY:{Craft.orientation==="ltr"?this.turnOn():this.turnOff(),t.preventDefault();break}case Garnish.LEFT_KEY:{Craft.orientation==="ltr"?this.turnOff():this.turnOn(),t.preventDefault();break}}},onDragStart(){this.dragging=!0,this.dragStartMargin=this.getMargin()},onDrag(){let t;Craft.orientation==="ltr"?t=this.dragStartMargin+this.dragger.mouseDistX:t=this.dragStartMargin-this.dragger.mouseDistX,t0&&(t=0);const{innerContainer:e}=this.$refs;$(e).css(`margin-${Craft.left}`,t)},onDragStop(){this.getMargin()>this.offMargin/2?this.turnOn():this.turnOff()},onSettle(){this.dragging=!1},getMargin(){const{innerContainer:t}=this.$refs,e=t.currentStyle||window.getComputedStyle(t);return parseInt(e.marginLeft)},toBoolean(t){return dee(t)}}},pee=["id","aria-labelledby","aria-checked"],mee={ref:"innerContainer",class:"lightswitch-container"},gee=ee("div",{class:"handle"},null,-1),vee=[gee];function yee(t,e,n,r,i,o){return ge(),Se("div",{id:i.id,ref:"container",tabindex:"0",role:"checkbox",class:gt(["lightswitch",[{on:o.toBoolean(i.proxyValue),indeterminate:i.indeterminate,dragging:i.dragging,small:n.small,"extra-small":n.extraSmall}]]),"aria-labelledby":`${i.id}-label`,"aria-checked":i.proxyValue?"true":i.indeterminate?"mixed":"false",onMouseup:e[1]||(e[1]=(...s)=>o.onMouseUp&&o.onMouseUp(...s)),onKeydown:e[2]||(e[2]=(...s)=>o.onKeyDown&&o.onKeyDown(...s))},[ee("div",mee,vee,512),Ut(ee("input",{"onUpdate:modelValue":e[0]||(e[0]=s=>i.proxyValue=s),type:"hidden"},null,512),[[Mn,i.proxyValue]])],42,pee)}const JL=Bt(hee,[["render",yee]]),bee={name:"VizyBlockFields",delimiters:["$!{","}!$"],props:{template:{type:String,default:""}},emits:["update"],mounted(){this.$nextTick(()=>{this.$el&&(Craft.initUiElements(this.$el),this.$el.querySelectorAll(".vizy-input-component").forEach(t=>{t.parentElement.__vueInit=!0}),this.$nextTick(()=>{this.watchFieldChanges(),this.applyRedactorFix(),this.applyTabIndexFix(),this.applyNeoFix()}))})},methods:{vizyBlock(){return this.$parent.$parent.$parent.$parent},watchFieldChanges(){const t=Ej(this.emitUpdate,50);new MutationObserver(n=>{t()}).observe(this.$el,{childList:!0,attributes:!0,subtree:!0,characterData:!0}),$(this.$el).on("input change","input, textarea, select",n=>{this.emitUpdate()})},applyRedactorFix(){const t=this.$el.querySelectorAll(".redactor-toolbar");t.length&&t.forEach(e=>{e.addEventListener("mousedown",n=>{n.preventDefault()})})},applyNeoFix(){if(!this.$el.querySelector('[data-type="benf\\\\neo\\\\Field"]'))return;const t=$("form#main-form"),e=encodeURIComponent(this.vizyBlock().vizyField.name);let n=t.data("initialSerializedValue");n=n.replace(new RegExp(`${Craft.escapeRegex(e)}[^&]*&?`),""),t.data("initialSerializedValue",n),this.$el.querySelectorAll('[data-type="benf\\\\neo\\\\Field"]').forEach(r=>{const i=r.querySelectorAll(".ni_buttons");i.length>1&&i.forEach((o,s)=>{s!=i.length-1&&o.remove()})})},applyTabIndexFix(){this.$el.querySelectorAll(".field").forEach(t=>{t.setAttribute("tabindex",-1)})},emitUpdate(){setTimeout(()=>{this.$emit("update")},50),setTimeout(()=>{this.$emit("update")},200)}},render(){try{return Hr(tb(`
${this.template}
`))}catch(t){console.error(t),console.log("Vue template compile error: %o",{template:this.template});const e=this.t("vizy","Unable to parse block definition.");return Hr(tb(`

${e}

`))}}};(function(t){var e=["input","textarea","select","option"],n=["value","selected","checked","disabled"];t.fn.htmlizeClone=function(r){return this.each(function(){var i=this;i.nodeName==="TEXTAREA"?i.innerHTML=i.value:i.nodeName==="OPTION"?i.selected?i.setAttribute("selected","selected"):i.removeAttribute("selected"):i.children&&i.children.length&&t(i).find("textarea, option").htmlizeClone(!0)}),r?this:this.clone()},t.fn.htmlizeSyncAttributes=function(){return this.each(function(){var r=this,i;for(var o in n)n.hasOwnProperty(o)&&(i=n[o],i in r&&(r.getAttribute(i)!==null||r[i])&&!((r.nodeName==="TEXTAREA"||r.nodeName==="SELECT")&&i==="value")&&(i==="value"?r.setAttribute(i,r[i]):r[i]?r.setAttribute(i,i):r.removeAttribute(i)));r.children&&r.children.length&&t(r).find(e.join(", ")).htmlizeSyncAttributes()})},t.fn.htmlize=function(r){r=t.extend({innerHTML:!1,clone:!0},r);var i=t(this).htmlizeClone().htmlizeSyncAttributes();if(r.innerHTML){var o="";return i.each(function(){o+=this.innerHTML}),o}else return i.length?i.appendTo("
").parent().get(0).innerHTML:""}})(jQuery);const _ee={name:"VizyBlock",components:{NodeViewWrapper:Ew,LightswitchField:JL,VizyBlockFields:bee,CollapseTransition:fee},props:{editor:{type:Object,default:()=>{}},node:{type:Object,default:()=>{}},decorations:{type:Array,default:()=>[]},selected:{type:Boolean,default:!1},extension:{type:Object,default:()=>{}},getPos:{type:Function,default:()=>{}},updateAttributes:{type:Function,default:()=>{}}},data(){return{activeTab:null,tippy:null,fieldsHtml:"",mounted:!1,updateFieldsHtml:0}},computed:{options(){return this.extension.options},vizyField(){return this.editor.vizyField},values(){return this.node.attrs.values},blockGroups(){return this.vizyField.settings.blockGroups},blockType(){let t={};return Mi(this.blockGroups)||this.blockGroups.forEach(e=>{const n=gb(e.blockTypes,{id:this.values.type});n&&(t=n)}),t},tabs(){return this.blockType.tabs||{}},enabled:{get(){return this.node.attrs.enabled&&this.blockType.enabled},set(t){this.node.attrs.enabled=t}},collapsed:{get(){return this.node.attrs.collapsed},set(t){this.node.attrs.collapsed=t}},canCollapseAll(){var e,n;let t=!1;return(n=(e=this.editor.state.doc)==null?void 0:e.content)==null||n.content.forEach(r=>{r.type.name==="vizyBlock"&&(r.attrs.collapsed||(t=!0))}),t},canExpandAll(){var e,n;let t=!1;return(n=(e=this.editor.state.doc)==null?void 0:e.content)==null||n.content.forEach(r=>{r.type.name==="vizyBlock"&&r.attrs.collapsed&&(t=!0)}),t},preview(){let t="";if(this.mounted){const e=$(this.$refs.fields.$el).children().children();for(let n=0;n| ":"")+o)}}return t}},watch:{"node.attrs.enabled":function(t,e){this.collapsed=!t},"node.attrs.id":function(t,e){this.fieldsHtml=this.vizyField.getCachedFieldHtml(t),this.updateFieldsHtml+=1,this.$nextTick(()=>{this.appendJs(),this.setFirstActiveTab()})}},created(){this.$nextTick(()=>{this.$events.on("vizy-blocks:updateDOM",this.onUpdateDOM)}),this.fieldsHtml=this.vizyField.getCachedFieldHtml(this.node.attrs.id),this.$events.on("vizy-blocks:collapseAll",this.collapseBlock),this.$events.on("vizy-blocks:expandAll",this.expandBlock),setTimeout(()=>{this.onFieldUpdate()},50)},mounted(){this.$nextTick(()=>{this.appendJs(),this.setFirstActiveTab(),this.mounted=!0;const t=this.$el.querySelector("#vizy-block-settings-template");t&&(t.style.display="block",this.tippy=Kr(this.$el.querySelector(".vizyblock-header .ellipsis"),{content:t,trigger:"click",allowHTML:!0,arrow:!0,interactive:!0,appendTo:document.body,placement:"bottom",theme:"light-border vizy-tippy-menu",maxWidth:"300px",duration:200,zIndex:1e3,hideOnClick:!0})),this.$el.setAttribute("draggable",!1),this.$el.addEventListener("dragstart",e=>{if(e.srcElement instanceof Element||e.srcElement instanceof HTMLDocument){let n=null;if(e.srcElement.classList.contains("vizyblock")?n=e.srcElement.querySelector(".vizyblock-header"):n=e.srcElement.closest(".vizyblock-header"),n){const r=`vui-${this.uid}-ghost`,i=document.querySelector(`#${r}`)?document.querySelector(`#${r}`):document.createElement("div");i.id=r,i.classList="vui-block-ghost",i.innerHTML=n.outerHTML,document.body.appendChild(i),e.dataTransfer.setDragImage(i,0,0)}}},!1)})},beforeUnmount(){this.onUpdateDOM(),this.$events.off("vizy-blocks:updateDOM",this.onUpdateDOM),this.$events.off("vizy-blocks:collapseAll",this.collapseBlock),this.$events.off("vizy-blocks:expandAll",this.expandBlock)},methods:{isEmpty(t){return Mi(t)},tabError(t){return(this.vizyField.getBlockSettings(this.node.attrs.id).tabErrors||[]).includes(t.tabId)},_inputPreviewText(t){if(t.is("select,multiselect")){const e=[],n=t.find("option:selected");for(let r=0;r{if($(r).parents(".vui-editor").length)return;const i=$(r).find("textarea").htmlize();$(r).replaceWith(i)}),t.find(".ck-editor").length&&t.find(".ck-editor").each((n,r)=>{if($(r).parents(".vui-editor").length)return;const i=$(r).find("textarea").htmlize();$(r).replaceWith(i)}),t.find(".selectize").length&&t.find(".selectize").each((n,r)=>{const i=$(r).parents("[data-type]").data("layout-element");if(i){const o=$(this.blockType.fieldsHtml).find(`[data-layout-element="${i}"] .selectize`);o.length&&(o.find("select").attr("id",$(r).find("select").attr("id")),o.find("select").attr("name",$(r).find("select").attr("name")),o.find("select").val($(r).find("select").val()),r.outerHTML=o.htmlize())}});const e=t.htmlize();this.vizyField.setCachedFieldHtml(this.node.attrs.id,e)}},clickBlock(t){if(!t.target.hasAttribute("data-node-view-wrapper"))return;const e=this.editor.view.posAtCoords({left:t.clientX,top:t.clientY});if(e&&e.inside>-1&&!it.isSelectable(this.editor.view.state.doc.nodeAt(e.inside)))return!1;const n=this.editor.view.state.doc.resolve(e.pos);this.editor.view.dispatch(this.editor.view.state.tr.setSelection(new fn(n)))},clickTab(t){this.activeTab=t,this.$refs.fields.$el.querySelectorAll(":scope > div").forEach(n=>{n.getAttribute("id").includes(this.activeTab)?n.classList.remove("hidden"):n.classList.add("hidden")})},toggleTitle(t){this.$el.querySelector(".actions-tabs").contains(t.target)||(this.collapsed?this.expandBlock():this.collapseBlock())},setFirstActiveTab(){this.tabs&&([this.activeTab]=Object.keys(this.tabs))},appendJs(){if(Mi(this.blockType))return;const t=this.vizyField.getCachedFieldJs(this.node.attrs.id),e=document.querySelector(`#script-${this.node.attrs.id}`);t&&(e&&e.parentElement.removeChild(e),Craft.appendBodyHtml(t))},deleteBlock(){this.tippy&&this.tippy.hide(),setTimeout(()=>{const t=this.getPos(),e={from:t,to:t+(this.node.nodeSize-1)};this.editor.chain().focus().deleteRange(e).run()},200)},collapseBlock(){this.collapsed=!0,this.tippy&&this.tippy.hide()},expandBlock(){this.collapsed=!1,this.tippy&&this.tippy.hide()},collapseAll(){this.$events.emit("vizy-blocks:collapseAll")},expandAll(){this.$events.emit("vizy-blocks:expandAll")},clickMove(){this.$events.emit("vizy-blocks:updateDOM"),this.vizyField.selectedBlockType=this.blockType.id},onFieldUpdate(){this.serializeFieldContent()},findContentBlocksForBlock(t){let e={};if(!Mi(t)){this.$el.closest(".slideout[data-element-editor] .so-body")&&(t=Object.values(t)[0],Mi(t.fields)&&(t={fields:t}));let r=t.vizyBlockFields;Mi(r)&&(r=t.fields),Mi(r)||Object.entries(r).forEach(([i,o])=>{o.blocks===void 0&&o.entries===void 0&&(e={fields:r});const s=o.blocks??o.entries??[];Mi(s)||Object.entries(s).forEach(([l,u])=>{l===this.node.attrs.id?e=u:Mi(e)&&(e=this.findContentBlocksForBlock(u))})})}return e},fixSuperTableMatrixContent(t){const e=/^__BLOCK_[a-zA-Z0-9]+__$/;if(Ur(t))t.forEach(n=>{this.fixSuperTableMatrixContent(n)});else if(gr(t)){const n=Object.keys(t);if(n.forEach(r=>{gr(t[r])&&this.fixSuperTableMatrixContent(t[r])}),n.includes("blocks")){const r=Object.keys(t.blocks);if(r.some(i=>e.test(i))){const i=r.find(o=>/^new\d+$/.test(o));if(i&&r.length===2){const o=Jj(t.blocks[r[0]],t.blocks[r[1]]);t.blocks={},t.blocks[i]=o}}}}return t},fixArrayIndexes(t){if(Array.isArray(t)){const e=Object.keys(t).map(Number).sort();!Array.from({length:t.length},(i,o)=>o).every(i=>e.includes(i))&&(t=t.filter(i=>i!==void 0))}else if(typeof t=="object"&&t!==null)for(const e in t)t[e]=this.fixArrayIndexes(t[e]);return t},serializeFieldContent(){if(Mi(this.blockType)||!this.vizyField.listenForChanges)return;const t=Garnish.getPostData(this.$refs.fields.$el),e=Object.keys(t).sort().reduce((o,s)=>(o[s]=t[s],o),{});let n=Craft.expandPostArray(e);n=this.fixArrayIndexes(n);let r=this.findContentBlocksForBlock(n);r=this.fixSuperTableMatrixContent(r);const i={...this.values};i.content=r,this.node.attrs.values=i}}},wee={key:0,class:"vizyblock-wrap"},kee={class:"titlebar"},xee={class:"blocktype"},See={key:0},Cee=["innerHTML"],Tee={class:"actions-tabs"},Eee={key:0,class:"titlebar-tabs"},Aee=["onClick"],Oee={class:"actions"},Mee=["title","aria-title"],Lee=["title","aria-title"],Nee={id:"vizy-block-settings-template",class:"vizy-menu",style:{display:"none"}},Iee={key:0},Pee=ee("span",{class:"icon"},[ee("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},[ee("path",{d:"M344 0H488c13.3 0 24 10.7 24 24V168c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39-87 87c-9.4 9.4-24.6 9.4-33.9 0l-32-32c-9.4-9.4-9.4-24.6 0-33.9l87-87L327 41c-6.9-6.9-8.9-17.2-5.2-26.2S334.3 0 344 0zM168 512H24c-13.3 0-24-10.7-24-24V344c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l39 39 87-87c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8z"})])],-1),Dee={class:"menu-item-label"},Ree={key:1},zee=ee("span",{class:"icon"},[ee("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},[ee("path",{d:"M439 7c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8H296c-13.3 0-24-10.7-24-24V72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l39 39L439 7zM72 272H216c13.3 0 24 10.7 24 24V440c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39L73 505c-9.4 9.4-24.6 9.4-33.9 0L7 473c-9.4-9.4-9.4-24.6 0-33.9l87-87L55 313c-6.9-6.9-8.9-17.2-5.2-26.2s12.5-14.8 22.2-14.8z"})])],-1),Bee={class:"menu-item-label"},$ee={key:2},Hee=ee("span",{class:"icon"},[ee("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},[ee("path",{d:"M439 7c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8H296c-13.3 0-24-10.7-24-24V72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l39 39L439 7zM72 272H216c13.3 0 24 10.7 24 24V440c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39L73 505c-9.4 9.4-24.6 9.4-33.9 0L7 473c-9.4-9.4-9.4-24.6 0-33.9l87-87L55 313c-6.9-6.9-8.9-17.2-5.2-26.2s12.5-14.8 22.2-14.8z"})])],-1),Fee={class:"menu-item-label"},Vee={key:3},jee=ee("span",{class:"icon"},[ee("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},[ee("path",{d:"M344 0H488c13.3 0 24 10.7 24 24V168c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39-87 87c-9.4 9.4-24.6 9.4-33.9 0l-32-32c-9.4-9.4-9.4-24.6 0-33.9l87-87L327 41c-6.9-6.9-8.9-17.2-5.2-26.2S334.3 0 344 0zM168 512H24c-13.3 0-24-10.7-24-24V344c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l39 39 87-87c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8z"})])],-1),Wee={class:"menu-item-label"},Uee=ee("hr",{class:"padded"},null,-1),qee=ee("span",{class:"icon"},[ee("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512"},[ee("path",{d:"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"})])],-1),Kee={class:"menu-item-label"},Gee={key:1,class:"vizyblock-wrap"},Yee={class:"vizyblock-invalid"},Jee={class:"error"};function Xee(t,e,n,r,i,o){const s=ut("lightswitch-field"),l=ut("vizy-block-fields"),u=ut("collapse-transition"),f=ut("node-view-wrapper");return ge(),Et(f,{class:"vizyblock",contenteditable:"false","data-vizy-block":!0,"data-type":o.blockType.handle,onCopy:e[9]||(e[9]=lt(()=>{},["stop"])),onPaste:e[10]||(e[10]=lt(()=>{},["stop"])),onCut:e[11]||(e[11]=lt(()=>{},["stop"])),onClick:o.clickBlock},{default:Vt(()=>[o.isEmpty(o.blockType)?(ge(),Se("div",Gee,[ee("div",Yee,[ee("p",Jee,Ne(t.t("vizy","Unable to parse block definition.")),1),ee("a",{class:"error","data-icon":"remove",role:"option",tabindex:"-1",onClick:e[8]||(e[8]=lt((...d)=>o.deleteBlock&&o.deleteBlock(...d),["prevent"]))})])])):(ge(),Se("div",wee,[ee("div",{class:"vizyblock-header",onDblclick:e[7]||(e[7]=lt((...d)=>o.toggleTitle&&o.toggleTitle(...d),["prevent"]))},[ee("div",kee,[ee("div",xee,[t.$isDebug?(ge(),Se("span",See,Ne(t.uid)+" "+Ne(n.node.attrs.id),1)):_t("",!0),Ui(Ne(o.blockType.name),1)]),o.collapsed?(ge(),Se("div",{key:0,class:"preview",innerHTML:o.preview},null,8,Cee)):_t("",!0)]),ee("div",Tee,[Object.keys(o.tabs).length>1?(ge(),Se("div",Eee,[(ge(!0),Se(kt,null,Zt(o.tabs,(d,m)=>(ge(),Se("a",{key:m,class:gt(["tab",{active:m===i.activeTab,error:o.tabError(d)}]),onClick:lt(v=>o.clickTab(m),["prevent"])},Ne(d.label),11,Aee))),128))])):_t("",!0),ee("div",Oee,[Qe(s,{modelValue:o.enabled,"onUpdate:modelValue":e[0]||(e[0]=d=>o.enabled=d),"extra-small":!0},null,8,["modelValue"]),ee("a",{class:"ellipsis icon",title:t.t("vizy","Actions"),"aria-title":t.t("vizy","Actions"),role:"button",tabindex:"0","aria-haspopup":"listbox","aria-expanded":"false"},null,8,Mee),ee("a",{class:"move icon",title:t.t("vizy","Reorder"),"aria-title":t.t("vizy","Reorder"),"data-drag-handle":"",role:"button",onMousedown:e[1]||(e[1]=(...d)=>o.clickMove&&o.clickMove(...d))},null,40,Lee)]),ee("div",Nee,[ee("ul",null,[o.collapsed?(ge(),Se("li",Iee,[ee("a",{class:"menu-item",role:"option",tabindex:"-1",onClick:e[2]||(e[2]=lt((...d)=>o.expandBlock&&o.expandBlock(...d),["prevent"]))},[Pee,ee("span",Dee,Ne(t.t("vizy","Expand")),1)])])):(ge(),Se("li",Ree,[ee("a",{class:"menu-item",role:"option",tabindex:"-1",onClick:e[3]||(e[3]=lt((...d)=>o.collapseBlock&&o.collapseBlock(...d),["prevent"]))},[zee,ee("span",Bee,Ne(t.t("vizy","Collapse")),1)])])),o.canCollapseAll?(ge(),Se("li",$ee,[ee("a",{class:"menu-item",role:"option",tabindex:"-1",onClick:e[4]||(e[4]=lt((...d)=>o.collapseAll&&o.collapseAll(...d),["prevent"]))},[Hee,ee("span",Fee,Ne(t.t("vizy","Collapse All")),1)])])):_t("",!0),o.canExpandAll?(ge(),Se("li",Vee,[ee("a",{class:"menu-item",role:"option",tabindex:"-1",onClick:e[5]||(e[5]=lt((...d)=>o.expandAll&&o.expandAll(...d),["prevent"]))},[jee,ee("span",Wee,Ne(t.t("vizy","Expand All")),1)])])):_t("",!0)]),Uee,ee("ul",null,[ee("li",null,[ee("a",{class:"menu-item error",role:"option",tabindex:"-1",onClick:e[6]||(e[6]=lt((...d)=>o.deleteBlock&&o.deleteBlock(...d),["prevent"]))},[qee,ee("span",Kee,Ne(t.t("vizy","Delete")),1)])])])])])],32),Qe(u,null,{default:Vt(()=>[Ut(ee("div",null,[i.fieldsHtml?(ge(),Et(l,{ref:"fields",key:i.updateFieldsHtml,class:"vizyblock-fields",template:i.fieldsHtml,onUpdate:o.onFieldUpdate},null,8,["template","onUpdate"])):_t("",!0)],512),[[Bu,!o.collapsed]])]),_:1})]))]),_:1},8,["data-type","onClick"])}const Zee=Bt(_ee,[["render",Xee]]),Qee=_n.create({name:"vizyBlock",isBlock:!0,inline:!1,group:"block",draggable:!0,defining:!0,selectable:!0,addAttributes(){return{id:{default:null},enabled:{default:!0},collapsed:{default:!1},values:{default:null}}},addStorage(){return{isNew:!1}},parseHTML(){return[{tag:"vizy-block",getAttrs:t=>JSON.parse(t.innerHTML)}]},renderHTML({HTMLAttributes:t}){return["vizy-block",JSON.stringify(t)]},addCommands(){return{setVizyBlock:t=>({tr:e,dispatch:n,view:r,state:i})=>{const{selection:o}=e,s=this.type.create(t);return n&&(e.insert(o.from,i.schema.nodes.paragraph.create()),e.replaceRangeWith(o.from,o.to,s)),this.storage.isNew=!0,!0}}},addNodeView(){return Aw(Zee,{stopEvent:({event:t})=>t.target.hasAttribute("data-drag-handle")?(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}),!1):!this.isDragging})},addProseMirrorPlugins(){return[new on({props:{handleKeyDown:(t,e)=>{if(t.state.typing=!0,e.key==="Escape"){const n=t.state.selection.$from.pos;t.state.selection.$to.pos;const r=n-1<0?0:n-1;return this.editor.chain().setTextSelection({from:r,to:r}).blur().run(),!0}},handlePaste:(t,e,n)=>{t.state.pasting=!0;const{supportedBlockTypes:r}=this.editor.vizyField;n.content.content.forEach((i,o)=>{i.type.name=="vizyBlock"&&(r.includes(i.attrs.values.type)||n.content.content.splice(o,1))})},handleClickOn:(t,e,n,r,i,o)=>{const s=i.target.closest(".vizyblock");if(!s)return!1;if(s.closest(".ProseMirror")!==t.dom)return!0;const u=i.target.closest(".vizyblock-header"),f=i.target.closest(".vizyblock-header .actions-tabs");if(!u||f)return!0}},filterTransaction:(t,e)=>{let n=!0;return(e.typing||e.pasting)&&t.mapping.maps.forEach(r=>{r.forEach((i,o,s,l)=>{e.doc.nodesBetween(i,o,(u,f,d,m,v)=>{u.type.name==="vizyBlock"&&(n=!1)})})}),n}})]}});function ete(t){var e;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:s}=t,l=uL(n),u=new RegExp(`\\s${l}$`),f=o?"^":"",d=r?new RegExp(`${f}${l}.*?(?=\\s${l}|$)`,"gm"):new RegExp(`${f}(?:^)?${l}[^\\s${l}]*`,"gm"),m=((e=s.nodeBefore)===null||e===void 0?void 0:e.isText)&&s.nodeBefore.text;if(!m)return null;const v=s.pos-m.length,y=Array.from(m.matchAll(d)).pop();if(!y||y.input===void 0||y.index===void 0)return null;const _=y.input.slice(Math.max(0,y.index-1),y.index),C=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(_);if(i!==null&&!C)return null;const x=v+y.index;let k=x+y[0].length;return r&&u.test(m.slice(k-1,k+1))&&(y[0]+=" ",k+=1),x=s.pos?{range:{from:x,to:k},query:y[0].slice(n.length),text:y[0]}:null}const tte=new xn("suggestion");function nte({pluginKey:t=tte,editor:e,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:s="span",decorationClass:l="suggestion",command:u=()=>null,items:f=()=>[],render:d=()=>({}),allow:m=()=>!0,findSuggestionMatch:v=ete}){let y;const _=d==null?void 0:d(),C=new on({key:t,view(){return{update:async(x,k)=>{var A,N,E,H,I,q,P;const z=(A=this.key)===null||A===void 0?void 0:A.getState(k),w=(N=this.key)===null||N===void 0?void 0:N.getState(x.state),R=z.active&&w.active&&z.range.from!==w.range.from,U=!z.active&&w.active,K=z.active&&!w.active,oe=!U&&!K&&z.query!==w.query,D=U||R,ae=oe&&!R,ce=K||R;if(!D&&!ae&&!ce)return;const ve=ce&&!D?z:w,ze=x.dom.querySelector(`[data-decoration-id="${ve.decorationId}"]`);y={editor:e,range:ve.range,query:ve.query,text:ve.text,items:[],command:qe=>{u({editor:e,range:ve.range,props:qe})},decorationNode:ze,clientRect:ze?()=>{var qe;const{decorationId:vt}=(qe=this.key)===null||qe===void 0?void 0:qe.getState(e.state),mt=x.dom.querySelector(`[data-decoration-id="${vt}"]`);return(mt==null?void 0:mt.getBoundingClientRect())||null}:null},D&&((E=_==null?void 0:_.onBeforeStart)===null||E===void 0||E.call(_,y)),ae&&((H=_==null?void 0:_.onBeforeUpdate)===null||H===void 0||H.call(_,y)),(ae||D)&&(y.items=await f({editor:e,query:ve.query})),ce&&((I=_==null?void 0:_.onExit)===null||I===void 0||I.call(_,y)),ae&&((q=_==null?void 0:_.onUpdate)===null||q===void 0||q.call(_,y)),D&&((P=_==null?void 0:_.onStart)===null||P===void 0||P.call(_,y))},destroy:()=>{var x;y&&((x=_==null?void 0:_.onExit)===null||x===void 0||x.call(_,y))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(x,k,A,N){const{isEditable:E}=e,{composing:H}=e.view,{selection:I}=x,{empty:q,from:P}=I,z={...k};if(z.composing=H,E&&(q||e.view.composing)){(Pk.range.to)&&!H&&!k.composing&&(z.active=!1);const w=v({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:I.$from}),R=`id_${Math.floor(Math.random()*4294967295)}`;w&&m({editor:e,state:N,range:w.range})?(z.active=!0,z.decorationId=k.decorationId?k.decorationId:R,z.range=w.range,z.query=w.query,z.text=w.text):z.active=!1}else z.active=!1;return z.active||(z.decorationId=null,z.range={from:0,to:0},z.query=null,z.text=null),z}},props:{handleKeyDown(x,k){var A;const{active:N,range:E}=C.getState(x.state);return N&&((A=_==null?void 0:_.onKeyDown)===null||A===void 0?void 0:A.call(_,{view:x,event:k,range:E}))||!1},decorations(x){const{active:k,range:A,decorationId:N}=C.getState(x);return k?tn.create(x.doc,[hr.inline(A.from,A.to,{nodeName:s,class:l,"data-decoration-id":N})]):null}}});return C}const rte=ir.create({name:"Commands",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:n})=>{n.command({editor:t,range:e})}}}},addProseMirrorPlugins(){return[nte({editor:this.editor,...this.options.suggestion})]}}),ite=function(t){let e=t.replace("/<(.*?)>/g","");e=e.replace(/['"‘’“”[]\(\){}:]/g,""),e=e.toLowerCase(),e=Craft.asciiString(e);const n=Craft.filterArray(e.split(/[^a-z0-9]+/));e="";for(let r=0;rt.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1;i--){var o=n[i],s=(o.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(s)>-1&&(r=o)}return rn.head.insertBefore(e,r),t}}var Ote="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function yd(){for(var t=12,e="";t-- >0;)e+=Ote[Math.random()*62|0];return e}function dc(t){for(var e=[],n=(t||[]).length>>>0;n--;)e[n]=t[n];return e}function Pw(t){return t.classList?dc(t.classList):(t.getAttribute("class")||"").split(" ").filter(function(e){return e})}function uN(t){return"".concat(t).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function Mte(t){return Object.keys(t||{}).reduce(function(e,n){return e+"".concat(n,'="').concat(uN(t[n]),'" ')},"").trim()}function iv(t){return Object.keys(t||{}).reduce(function(e,n){return e+"".concat(n,": ").concat(t[n].trim(),";")},"")}function Dw(t){return t.size!==po.size||t.x!==po.x||t.y!==po.y||t.rotate!==po.rotate||t.flipX||t.flipY}function Lte(t){var e=t.transform,n=t.containerWidth,r=t.iconWidth,i={transform:"translate(".concat(n/2," 256)")},o="translate(".concat(e.x*32,", ").concat(e.y*32,") "),s="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),l="rotate(".concat(e.rotate," 0 0)"),u={transform:"".concat(o," ").concat(s," ").concat(l)},f={transform:"translate(".concat(r/2*-1," -256)")};return{outer:i,inner:u,path:f}}function Nte(t){var e=t.transform,n=t.width,r=n===void 0?o1:n,i=t.height,o=i===void 0?o1:i,s=t.startCentered,l=s===void 0?!1:s,u="";return l&&nN?u+="translate(".concat(e.x/As-r/2,"em, ").concat(e.y/As-o/2,"em) "):l?u+="translate(calc(-50% + ".concat(e.x/As,"em), calc(-50% + ").concat(e.y/As,"em)) "):u+="translate(".concat(e.x/As,"em, ").concat(e.y/As,"em) "),u+="scale(".concat(e.size/As*(e.flipX?-1:1),", ").concat(e.size/As*(e.flipY?-1:1),") "),u+="rotate(".concat(e.rotate,"deg) "),u}var Ite=`:root, :host { -======== -}`;function aN(t,e,n){const r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute(`data-tiptap-style${n?`-${n}`:""}`,""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}let lN=class extends MK{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=aN(sY,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=Z_(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;const n=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){const n=[...this.options.enableCoreExtensions?Object.values(sN):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new Ua(n,this)}createCommandManager(){this.commandManager=new Id({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=rw(this.options.content,this.schema,this.options.parseOptions),n=nw(e,this.options.autofocus);this.view=new Gq(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:du.create({doc:e,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var l;return(l=this.capturedTransaction)===null||l===void 0?void 0:l.step(s)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return aw(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return oN(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ow(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=` - -`,textSerializers:r={}}=e||{};return sw(this.state.doc,{blockSeparator:n,textSerializers:{...Jg(this.schema),...r}})}get isEmpty(){return lw(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new Fs(n,this)}get $doc(){return this.$pos(0)}};function oa(t){return new uc({find:t.find,handler:({state:e,range:n,match:r})=>{const i=wt(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],l=r[0];if(s){const u=l.search(/\S/),f=n.from+l.indexOf(s),d=f+s.length;if(ev(n.from,n.to,e.doc).filter(y=>y.mark.type.excluded.find(C=>C===t.type&&C!==y.mark.type)).filter(y=>y.to>f).length)return null;dn.from&&o.delete(n.from+u,f);const v=n.from+u+s.length;o.addMark(n.from+u,v,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function uw(t){return new uc({find:t.find,handler:({state:e,range:n,match:r})=>{const i=wt(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from;let l=n.to;const u=t.type.create(i);if(r[1]){const f=r[0].lastIndexOf(r[1]);let d=s+f;d>l?d=l:l=d+r[1].length;const m=r[0][r[0].length-1];o.insertText(m,s+r[0].length-1),o.replaceWith(d,l,u)}else r[0]&&o.insert(s-1,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l));o.scrollIntoView()}})}function Nm(t){return new uc({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),o=wt(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function aY(t){return new uc({find:t.find,handler:({state:e,range:n,match:r})=>{let i=t.replace,o=n.from;const s=n.to;if(r[1]){const l=r[0].lastIndexOf(r[1]);i+=r[0].slice(l+r[1].length),o+=l;const u=o-s;u>0&&(i=r[0].slice(l-u,l)+i,o=s)}e.tr.insertText(i,o,s)}})}function Zu(t){return new uc({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const o=wt(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),u=s.doc.resolve(n.from).blockRange(),f=u&&R_(u,t.type,o);if(!f)return null;if(s.wrap(u,f),t.keepMarks&&t.editor){const{selection:m,storedMarks:v}=e,{splittableMarks:y}=t.editor.extensionManager,_=v||m.$to.parentOffset&&m.$from.marks();if(_){const C=_.filter(x=>y.includes(x.type.name));s.ensureMarks(C)}}if(t.keepAttributes){const m=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(m,o).run()}const d=s.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&pa(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,d))&&s.join(n.from-1)}})}class or{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=wt(Ye(this,"addOptions",{name:this.name}))),this.storage=wt(Ye(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new or(e)}configure(e={}){const n=this.extend();return n.options=Dd(this.options,e),n.storage=wt(Ye(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new or({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=wt(Ye(n,"addOptions",{name:n.name})),n.storage=wt(Ye(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(f=>(f==null?void 0:f.type.name)===n.name))return!1;const u=s.find(f=>(f==null?void 0:f.type.name)===n.name);return u&&r.removeStoredMark(u),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}let _n=class Hb{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=wt(Ye(this,"addOptions",{name:this.name}))),this.storage=wt(Ye(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Hb(e)}configure(e={}){const n=this.extend();return n.options=Dd(this.options,e),n.storage=wt(Ye(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new Hb({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=wt(Ye(n,"addOptions",{name:n.name})),n.storage=wt(Ye(n,"addStorage",{name:n.name,options:n.options})),n}};function lY(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}class uN{constructor(e,n,r){this.isDragging=!1,this.component=e,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var n,r,i,o,s,l,u;const{view:f}=this.editor,d=e.target,m=d.nodeType===3?(n=d.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):d.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(d)||!m)return;let v=0,y=0;if(this.dom!==m){const x=this.dom.getBoundingClientRect(),k=m.getBoundingClientRect(),A=(i=e.offsetX)!==null&&i!==void 0?i:(o=e.nativeEvent)===null||o===void 0?void 0:o.offsetX,L=(s=e.offsetY)!==null&&s!==void 0?s:(l=e.nativeEvent)===null||l===void 0?void 0:l.offsetY;v=k.x-x.x+A,y=k.y-x.y+L}(u=e.dataTransfer)===null||u===void 0||u.setDragImage(this.dom,v,y);const _=it.create(f.state.doc,this.getPos()),C=f.state.tr.setSelection(_);f.dispatch(C)}stopEvent(e){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const r=e.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const o=e.type.startsWith("drag"),s=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!s&&!o)return!0;const{isEditable:u}=this.editor,{isDragging:f}=this,d=!!this.node.type.spec.draggable,m=it.isSelectable(this.node),v=e.type==="copy",y=e.type==="paste",_=e.type==="cut",C=e.type==="mousedown";if(!d&&m&&o&&e.preventDefault(),d&&o&&!f)return e.preventDefault(),!1;if(d&&u&&!f&&C){const x=r.closest("[data-drag-handle]");x&&(this.dom===x||this.dom.contains(x))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(f||s||v||y||_||C&&m)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(Rd()||lY())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return n.setNodeMarkup(r,void 0,{...this.node.attrs,...e}),!0})}deleteNode(){const e=this.getPos(),n=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:n})}}function Yo(t){return new Yg({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const o=wt(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,l=r[r.length-1],u=r[0];let f=n.to;if(l){const d=u.search(/\S/),m=n.from+u.indexOf(l),v=m+l.length;if(ev(n.from,n.to,e.doc).filter(_=>_.mark.type.excluded.find(x=>x===t.type&&x!==_.mark.type)).filter(_=>_.to>m).length)return null;vn.from&&s.delete(n.from+d,m),f=n.from+d+l.length,s.addMark(n.from+d,f,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}function cN(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function uY(t){return typeof t=="string"}function cY(t){return new Yg({find:t.find,handler({match:e,chain:n,range:r,pasteEvent:i}){const o=wt(t.getAttributes,void 0,e,i);if(o===!1||o===null)return null;e.input&&n().deleteRange(r).insertContentAt(r.from,{type:t.type.name,attrs:o})}})}function fY(t){return new Yg({find:t.find,handler:({state:e,range:n,match:r})=>{let i=t.replace,o=n.from;const s=n.to;if(r[1]){const l=r[0].lastIndexOf(r[1]);i+=r[0].slice(l+r[1].length),o+=l;const u=o-s;u>0&&(i=r[0].slice(l-u,l)+i,o=s)}e.tr.insertText(i,o,s)}})}class dY{constructor(e){this.transaction=e,this.currentStep=this.transaction.steps.length}map(e){let n=!1;return{position:this.transaction.steps.slice(this.currentStep).reduce((i,o)=>{const s=o.getMap().mapResult(i);return s.deleted&&(n=!0),s.pos},e),deleted:n}}}const hY=Object.freeze(Object.defineProperty({__proto__:null,CommandManager:Id,Editor:lN,Extension:ir,InputRule:uc,Mark:or,Node:_n,NodePos:Fs,NodeView:uN,PasteRule:Yg,Tracker:dY,callOrReturn:wt,combineTransactionSteps:Z4,createChainableState:Ld,createDocument:rw,createNodeFromContent:ud,createStyleTag:aN,defaultBlockAt:Q4,deleteProps:Bb,elementFromString:Om,escapeForRegEx:cN,extensions:sN,findChildren:CG,findChildrenInRange:eN,findDuplicates:Y4,findParentNode:Bd,findParentNodeClosestToPos:iw,fromString:W4,generateHTML:TG,generateJSON:EG,generateText:AG,getAttributes:aw,getAttributesFromExtensions:X_,getChangedRanges:rN,getDebugJSON:iN,getExtensionField:Ye,getHTMLFromFragment:ow,getMarkAttributes:cc,getMarkRange:Xg,getMarkType:as,getMarksBetween:ev,getNodeAtPosition:MG,getNodeAttributes:tN,getNodeType:Hn,getRenderedAttributes:Am,getSchema:Qg,getSchemaByResolvedExtensions:Q_,getSchemaTypeByName:Ap,getSchemaTypeNameByName:zd,getSplittedAttributes:Sf,getText:sw,getTextBetween:ew,getTextContentFromNodes:U4,getTextSerializersFromSchema:Jg,injectExtensionAttributesToParseRule:Db,inputRulesPlugin:q4,isActive:oN,isAtEndOfNode:NG,isAtStartOfNode:LG,isEmptyObject:j4,isExtensionRulesEnabled:Rb,isFunction:Z_,isList:$b,isMacOS:Zg,isMarkActive:Mm,isNodeActive:Xu,isNodeEmpty:lw,isNodeSelection:IG,isNumber:K4,isPlainObject:Op,isRegExp:Gg,isString:uY,isTextSelection:tw,isiOS:Rd,markInputRule:oa,markPasteRule:Yo,mergeAttributes:zt,mergeDeep:Dd,minMax:ho,nodeInputRule:uw,nodePasteRule:cY,objectIncludes:ld,pasteRulesPlugin:G4,posToDOMRect:PG,removeDuplicates:nN,resolveFocusPosition:nw,selectionToInsertionEnd:X4,splitExtensions:Pd,textInputRule:aY,textPasteRule:fY,textblockTypeInputRule:Nm,wrappingInputRule:Zu},Symbol.toStringTag,{value:"Module"})),pY=[{name:"bold",svg:"bold",title:Craft.t("vizy","Bold"),action:t=>t.chain().focus().toggleBold().run(),isActive:t=>t.isActive("bold")},{name:"italic",svg:"italic",title:Craft.t("vizy","Italic"),action:t=>t.chain().focus().toggleItalic().run(),isActive:t=>t.isActive("italic")},{name:"strikethrough",svg:"strikethrough",title:Craft.t("vizy","Strike"),action:t=>t.chain().focus().toggleStrike().run(),isActive:t=>t.isActive("strike")},{name:"subscript",svg:"subscript",title:Craft.t("vizy","Subscript"),action:t=>t.chain().focus().toggleSubscript().run(),isActive:t=>t.isActive("subscript")},{name:"superscript",svg:"superscript",title:Craft.t("vizy","Superscript"),action:t=>t.chain().focus().toggleSuperscript().run(),isActive:t=>t.isActive("superscript")},{name:"underline",svg:"underline",title:Craft.t("vizy","Underline"),action:t=>t.chain().focus().toggleUnderline().run(),isActive:t=>t.isActive("underline")},{name:"code",svg:"brackets-curly",title:Craft.t("vizy","Inline Code"),action:t=>t.chain().focus().toggleCode().run(),isActive:t=>t.isActive("code")},{name:"highlight",icon:"highlighter",title:Craft.t("vizy","Highlight"),action:t=>t.chain().focus().toggleHighlight().run(),isActive:t=>t.isActive("highlight")},{name:"paragraph",svg:"text",title:Craft.t("vizy","Paragraph"),action:t=>t.chain().focus().setParagraph().run(),isActive:t=>t.isActive("paragraph")},{name:"unordered-list",svg:"list-ul",title:Craft.t("vizy","Bullet List"),action:t=>t.chain().focus().toggleBulletList().run(),isActive:t=>t.isActive("bulletList")},{name:"ordered-list",svg:"list-ol",title:Craft.t("vizy","Ordered List"),action:t=>t.chain().focus().toggleOrderedList().run(),isActive:t=>t.isActive("orderedList")},{name:"code-block",svg:"code",title:Craft.t("vizy","Code Block"),action:t=>t.chain().focus().toggleCodeBlock().run(),isActive:t=>t.isActive("codeBlock")},{name:"blockquote",svg:"quote-right",title:Craft.t("vizy","Blockquote"),action:t=>t.chain().focus().toggleBlockquote().run(),isActive:t=>t.isActive("blockquote")},{name:"h1",svg:"h1",title:Craft.t("vizy","Heading 1"),action:t=>t.chain().focus().toggleHeading({level:1}).run(),isActive:t=>t.isActive("heading",{level:1})},{name:"h2",svg:"h2",title:Craft.t("vizy","Heading 2"),action:t=>t.chain().focus().toggleHeading({level:2}).run(),isActive:t=>t.isActive("heading",{level:2})},{name:"h3",svg:"h3",title:Craft.t("vizy","Heading 3"),action:t=>t.chain().focus().toggleHeading({level:3}).run(),isActive:t=>t.isActive("heading",{level:3})},{name:"h4",svg:"h4",title:Craft.t("vizy","Heading 4"),action:t=>t.chain().focus().toggleHeading({level:4}).run(),isActive:t=>t.isActive("heading",{level:4})},{name:"h5",svg:"h5",title:Craft.t("vizy","Heading 5"),action:t=>t.chain().focus().toggleHeading({level:5}).run(),isActive:t=>t.isActive("heading",{level:5})},{name:"h6",svg:"h6",title:Craft.t("vizy","Heading 6"),action:t=>t.chain().focus().toggleHeading({level:6}).run(),isActive:t=>t.isActive("heading",{level:6})},{name:"hr",svg:"horizontal-rule",title:Craft.t("vizy","Horizontal Rule"),action:t=>t.chain().focus().setHorizontalRule().run(),isActive:t=>t.isActive("hr")},{name:"line-break",svg:"page-break",title:Craft.t("vizy","Line Break"),action:t=>t.chain().focus().setHardBreak().run()},{name:"clear-format",svg:"remove-format",title:Craft.t("vizy","Clear Format"),action:t=>t.chain().focus().clearNodes().unsetAllMarks().run()},{name:"undo",svg:"undo",title:Craft.t("vizy","Undo"),action:t=>t.chain().focus().undo().run()},{name:"redo",svg:"redo",title:Craft.t("vizy","Redo"),action:t=>t.chain().focus().redo().run()},{name:"align-left",icon:"align-left",title:Craft.t("vizy","Align Left"),action:t=>t.chain().focus().setTextAlign("left").run(),isActive:t=>t.isActive({textAlign:"left"})},{name:"align-center",icon:"align-center",title:Craft.t("vizy","Align Center"),action:t=>t.chain().focus().setTextAlign("center").run(),isActive:t=>t.isActive({textAlign:"center"})},{name:"align-right",icon:"align-right",title:Craft.t("vizy","Align Right"),action:t=>t.chain().focus().setTextAlign("right").run(),isActive:t=>t.isActive({textAlign:"right"})},{name:"align-justify",icon:"align-justify",title:Craft.t("vizy","Align Justify"),action:t=>t.chain().focus().setTextAlign("justify").run(),isActive:t=>t.isActive({textAlign:"justify"})},{name:"formatting",icon:"paragraph",title:Craft.t("vizy","Formatting"),options:[{name:"paragraph",title:Craft.t("vizy","Paragraph"),action:t=>t.chain().focus().setParagraph().run(),isActive:t=>t.isActive("paragraph")},{name:"code-block",title:Craft.t("vizy","Code Block"),action:t=>t.chain().focus().toggleCodeBlock().run(),isActive:t=>t.isActive("codeBlock")},{name:"blockquote",title:Craft.t("vizy","Blockquote"),action:t=>t.chain().focus().toggleBlockquote().run(),isActive:t=>t.isActive("blockquote")},{name:"h1",title:Craft.t("vizy","Heading 1"),action:t=>t.chain().focus().toggleHeading({level:1}).run(),isActive:t=>t.isActive("heading",{level:1})},{name:"h2",title:Craft.t("vizy","Heading 2"),action:t=>t.chain().focus().toggleHeading({level:2}).run(),isActive:t=>t.isActive("heading",{level:2})},{name:"h3",title:Craft.t("vizy","Heading 3"),action:t=>t.chain().focus().toggleHeading({level:3}).run(),isActive:t=>t.isActive("heading",{level:3})},{name:"h4",title:Craft.t("vizy","Heading 4"),action:t=>t.chain().focus().toggleHeading({level:4}).run(),isActive:t=>t.isActive("heading",{level:4})},{name:"h5",title:Craft.t("vizy","Heading 5"),action:t=>t.chain().focus().toggleHeading({level:5}).run(),isActive:t=>t.isActive("heading",{level:5})},{name:"h6",title:Craft.t("vizy","Heading 6"),action:t=>t.chain().focus().toggleHeading({level:6}).run(),isActive:t=>t.isActive("heading",{level:6})}]},{name:"table",svg:"table",title:Craft.t("vizy","Table"),isActive:t=>t.isActive("table"),options:[{name:"insert-table",title:Craft.t("vizy","Insert Table"),action:t=>t.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run()},{name:"delete-table",title:Craft.t("vizy","Delete Table"),action:t=>t.chain().focus().deleteTable().run()},{name:"add-col-before",title:Craft.t("vizy","Add Column Before"),action:t=>t.chain().focus().addColumnBefore().run()},{name:"add-col-after",title:Craft.t("vizy","Add Column After"),action:t=>t.chain().focus().addColumnAfter().run()},{name:"delete-col",title:Craft.t("vizy","Delete Column"),action:t=>t.chain().focus().deleteColumn().run()},{name:"add-row-before",title:Craft.t("vizy","Add Row Before"),action:t=>t.chain().focus().addRowBefore().run()},{name:"add-row-after",title:Craft.t("vizy","Add Row After"),action:t=>t.chain().focus().addRowAfter().run()},{name:"delete-row",title:Craft.t("vizy","Delete Row"),action:t=>t.chain().focus().deleteRow().run()},{name:"merge-cells",title:Craft.t("vizy","Merge Cells"),action:t=>t.chain().focus().mergeCells().run()},{name:"split-cells",title:Craft.t("vizy","Split Cells"),action:t=>t.chain().focus().splitCell().run()},{name:"toggle-header-column",title:Craft.t("vizy","Toggle Header Column"),action:t=>t.chain().focus().toggleHeaderColumn().run()},{name:"toggle-header-row",title:Craft.t("vizy","Toggle Header Row"),action:t=>t.chain().focus().toggleHeaderRow().run()},{name:"toggle-header-cell",title:Craft.t("vizy","Toggle Header Cell"),action:t=>t.chain().focus().toggleHeaderCell().run()}]},{name:"link",svg:"link",title:Craft.t("vizy","Link"),component:"LinkMenuBarItem",isActive:t=>t.isActive("link")},{name:"image",icon:"image",title:Craft.t("vizy","Image"),component:"ImageMenuBarItem",isActive:t=>t.isActive("image")},{name:"html",svg:"file-code",title:Craft.t("vizy","HTML"),action:t=>t.emit("vui:code-editor-toggle")},{name:"iframe",svg:"rectangle-code",title:Craft.t("vizy","iFrame"),component:"IframeMenuBarItem",isActive:t=>t.isActive("iframe")},{name:"media-embed",svg:"photo-film",title:Craft.t("vizy","Media Embed"),component:"MediaEmbedMenuBarItem",isActive:t=>t.isActive("mediaEmbed")}],mY=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,gY=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,vY=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,yY=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,bY=or.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[oa({find:mY,type:this.type}),oa({find:vY,type:this.type})]},addPasteRules(){return[Yo({find:gY,type:this.type}),Yo({find:yY,type:this.type})]}}),_Y=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,wY=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,kY=or.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[oa({find:_Y,type:this.type})]},addPasteRules(){return[Yo({find:wY,type:this.type})]}}),xY=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,SY=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,CY=or.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[oa({find:xY,type:this.type})]},addPasteRules(){return[Yo({find:SY,type:this.type})]}}),TY=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,EY=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,AY=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,OY=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,MY=or.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[oa({find:TY,type:this.type}),oa({find:AY,type:this.type})]},addPasteRules(){return[Yo({find:EY,type:this.type}),Yo({find:OY,type:this.type})]}}),NY=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,LY=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,IY=or.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){const t={};return Zg()?t["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():t["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),t},addInputRules(){return[oa({find:NY,type:this.type})]},addPasteRules(){return[Yo({find:LY,type:this.type})]}}),PY=or.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),DY=or.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),RY=or.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),zY=/^\s*>\s$/,BY=_n.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Zu({find:zY,type:this.type})]}}),$Y=_n.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",zt(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),aT=or.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=cc(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),lT=/^\s*([-+*])\s$/,HY=_n.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes($Y.name,this.editor.getAttributes(aT.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Zu({find:lT,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Zu({find:lT,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(aT.name),editor:this.editor})),[t]}}),FY=/^```([a-z]+)?[\s\n]$/,VY=/^~~~([a-z]+)?[\s\n]$/,jY=_n.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",zt(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(` - -`);return!o||!s?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const l=i.after();return l===void 0||r.nodeAt(l)?!1:t.commands.exitCode()}}},addInputRules(){return[Nm({find:FY,type:this.type,getAttributes:t=>({language:t[1]})}),Nm({find:VY,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new on({key:new xn("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:s}=t.state;return s.replaceSelectionWith(this.type.create({language:o})),s.setSelection(st.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,` -`)),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),WY=_n.create({name:"doc",topNode:!0,content:"block+"}),UY=_n.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",zt(this.options.HTMLAttributes,t)]},renderText(){return` -`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,u=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:f,dispatch:d})=>{if(d&&u&&s){const m=u.filter(v=>l.includes(v.type.name));f.ensureMarks(m)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),qY=_n.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,zt(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Nm({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),KY=_n.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",zt(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{$to:n}=e.selection,r=t();return n.parentOffset===0?r.insertContentAt(Math.max(n.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var s;if(o){const{$to:l}=i.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?i.setSelection(st.create(i.doc,l.pos+1)):l.nodeAfter.isBlock?i.setSelection(it.create(i.doc,l.pos)):i.setSelection(st.create(i.doc,l.pos));else{const f=(s=l.parent.type.contentMatch.defaultType)===null||s===void 0?void 0:s.create();f&&(i.insert(u,f),i.setSelection(st.create(i.doc,u+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[uw({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),GY=_n.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",zt(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),YY=_n.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",zt(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),uT=or.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=cc(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),cT=/^(\d+)\.\s$/,JY=_n.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",zt(this.options.HTMLAttributes,n),0]:["ol",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(YY.name,this.editor.getAttributes(uT.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Zu({find:cT,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Zu({find:cT,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(uT.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),XY=_n.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}});var Fb,Vb;if(typeof WeakMap<"u"){let t=new WeakMap;Fb=e=>t.get(e),Vb=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;Fb=r=>{for(let i=0;i(n==10&&(n=0),t[n++]=r,t[n++]=i)}var vn=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e=n){(o||(o=[])).push({type:"overlong_rowspan",pos:d,n:k-L});break}const E=i+L*e;for(let H=0;Hr&&(o+=f.attrs.colspan)}}for(let s=0;s1&&(n=!0)}e==-1?e=o:e!=o&&(e=Math.max(e,o))}return e}function eJ(t,e,n){t.problems||(t.problems=[]);const r={};for(let i=0;i0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function nJ(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function Gi(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function tv(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=fc(e.$head)||rJ(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function rJ(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function jb(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function iJ(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function cw(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function fN(t,e,n){const r=t.node(-1),i=vn.get(r),o=t.start(-1),s=i.nextCell(t.pos-o,e,n);return s==null?null:t.node(0).resolve(o+s)}function wl(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function dN(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;if!=e.pos-i);l.unshift(e.pos-i);const u=l.map(f=>{const d=n.nodeAt(f);if(!d)throw RangeError(`No cell with offset ${f} found`);const m=i+f+1;return new r4(s.resolve(m),s.resolve(m+d.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=t,this.$headCell=e}map(t,e){const n=t.resolve(e.map(this.$anchorCell.pos)),r=t.resolve(e.map(this.$headCell.pos));if(jb(n)&&jb(r)&&cw(n,r)){const i=this.$anchorCell.node(-1)!=n.node(-1);return i&&this.isRowSelection()?Lt.rowSelection(n,r):i&&this.isColSelection()?Lt.colSelection(n,r):new Lt(n,r)}return st.between(n,r)}content(){const t=this.$anchorCell.node(-1),e=vn.get(t),n=this.$anchorCell.start(-1),r=e.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},o=[];for(let l=r.top;l0||C>0){let x=y.attrs;if(_>0&&(x=wl(x,0,_)),C>0&&(x=wl(x,x.colspan-C,C)),v.leftr.bottom){const x={...y.attrs,rowspan:Math.min(v.bottom,r.bottom)-Math.max(v.top,r.top)};v.top0)return!1;const n=t+this.$anchorCell.nodeAfter.attrs.rowspan,r=e+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,e=t){const n=t.node(-1),r=vn.get(n),i=t.start(-1),o=r.findCell(t.pos-i),s=r.findCell(e.pos-i),l=t.node(0);return o.top<=s.top?(o.top>0&&(t=l.resolve(i+r.map[o.left])),s.bottom0&&(e=l.resolve(i+r.map[s.left])),o.bottom0)return!1;const o=r+this.$anchorCell.nodeAfter.attrs.colspan,s=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,s)==e.width}eq(t){return t instanceof Lt&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,e=t){const n=t.node(-1),r=vn.get(n),i=t.start(-1),o=r.findCell(t.pos-i),s=r.findCell(e.pos-i),l=t.node(0);return o.left<=s.left?(o.left>0&&(t=l.resolve(i+r.map[o.top*r.width])),s.right0&&(e=l.resolve(i+r.map[s.top*r.width])),o.right{e.push(hr.node(r,r+n.nodeSize,{class:"selectedCell"}))}),tn.create(t.doc,e)}function aJ({$from:t,$to:e}){if(t.pos==e.pos||t.pos=0&&!(t.after(i+1)=0&&!(e.before(o+1)>e.start(o));o--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}function lJ({$from:t,$to:e}){let n,r;for(let i=t.depth;i>0;i--){const o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let i=e.depth;i>0;i--){const o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&e.parentOffset===0}function uJ(t,e,n){const r=(e||t).selection,i=(e||t).doc;let o,s;if(r instanceof it&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=Lt.create(i,r.from);else if(s=="row"){const l=i.resolve(r.from+1);o=Lt.rowSelection(l,l)}else if(!n){const l=vn.get(r.node),u=r.from+1,f=u+l.map[l.width*l.height-1];o=Lt.create(i,u+1,f)}}else r instanceof st&&aJ(r)?o=st.create(i,r.from):r instanceof st&&lJ(r)&&(o=st.create(i,r.$from.start(),r.$from.end()));return o&&(e||(e=t.tr)).setSelection(o),e}var cJ=new xn("fix-tables");function pN(t,e,n,r){const i=t.childCount,o=e.childCount;e:for(let s=0,l=0;s{i.type.spec.tableRole=="table"&&(n=fJ(t,i,o,n))};return e?e.doc!=t.doc&&pN(e.doc,t.doc,0,r):t.doc.descendants(r),n}function fJ(t,e,n,r){const i=vn.get(e);if(!i.problems)return r;r||(r=t.tr);const o=[];for(let u=0;u0){let y="cell";d.firstChild&&(y=d.firstChild.type.spec.tableRole);const _=[];for(let x=0;x0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const i=e.child(0),o=i.type.spec.tableRole,s=i.type.schema,l=[];if(o=="row")for(let u=0;u=0;s--){const{rowspan:l,colspan:u}=o.child(s).attrs;for(let f=i;f=e.length&&e.push(Oe.empty),n[i]r&&(v=v.type.createChecked(wl(v.attrs,v.attrs.colspan,d+v.attrs.colspan-r),v.content)),f.push(v),d+=v.attrs.colspan;for(let y=1;yi&&(m=m.type.create({...m.attrs,rowspan:Math.max(1,i-m.attrs.rowspan)},m.content)),u.push(m)}o.push(Oe.from(u))}n=o,e=i}return{width:t,height:e,rows:n}}function mJ(t,e,n,r,i,o,s){const l=t.doc.type.schema,u=yr(l);let f,d;if(i>e.width)for(let m=0,v=0;me.height){const m=[];for(let _=0,C=(e.height-1)*e.width;_=e.width?!1:n.nodeAt(e.map[C+_]).type==u.header_cell;m.push(x?d||(d=u.header_cell.createAndFill()):f||(f=u.cell.createAndFill()))}const v=u.row.create(null,Oe.from(m)),y=[];for(let _=e.height;_{if(!i)return!1;const o=n.selection;if(o instanceof Lt)return Mp(n,r,ht.near(o.$headCell,e));if(t!="horiz"&&!o.empty)return!1;const s=gN(i,t,e);if(s==null)return!1;if(t=="horiz")return Mp(n,r,ht.near(n.doc.resolve(o.head+e),e));{const l=n.doc.resolve(s),u=fN(l,t,e);let f;return u?f=ht.near(u,1):e<0?f=ht.near(n.doc.resolve(l.before(-1)),-1):f=ht.near(n.doc.resolve(l.after(-1)),1),Mp(n,r,f)}}}function Jh(t,e){return(n,r,i)=>{if(!i)return!1;const o=n.selection;let s;if(o instanceof Lt)s=o;else{const u=gN(i,t,e);if(u==null)return!1;s=new Lt(n.doc.resolve(u))}const l=fN(s.$headCell,t,e);return l?Mp(n,r,new Lt(s.$anchorCell,l)):!1}}function Xh(t,e){const n=t.selection;if(!(n instanceof Lt))return!1;if(e){const r=t.tr,i=yr(t.schema).cell.createAndFill().content;n.forEachCell((o,s)=>{o.content.eq(i)||r.replace(r.mapping.map(s+1),r.mapping.map(s+o.nodeSize-1),new He(i,0,0))}),r.docChanged&&e(r)}return!0}function vJ(t,e){const n=t.state.doc,r=fc(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new Lt(r))),!0):!1}function yJ(t,e,n){if(!Gi(t.state))return!1;let r=dJ(n);const i=t.state.selection;if(i instanceof Lt){r||(r={width:1,height:1,rows:[Oe.from(Wb(yr(t.state.schema).cell,n))]});const o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),l=vn.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return r=pJ(r,l.right-l.left,l.bottom-l.top),hT(t.state,t.dispatch,s,l,r),!0}else if(r){const o=tv(t.state),s=o.start(-1);return hT(t.state,t.dispatch,s,vn.get(o.node(-1)).findCell(o.pos-s),r),!0}else return!1}function bJ(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=pT(t,e.target);let i;if(e.shiftKey&&t.state.selection instanceof Lt)o(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(i=fc(t.state.selection.$anchor))!=null&&((n=Yy(t,e))==null?void 0:n.pos)!=i.pos)o(i,e),e.preventDefault();else if(!r)return;function o(u,f){let d=Yy(t,f);const m=Vs.getState(t.state)==null;if(!d||!cw(u,d))if(m)d=u;else return;const v=new Lt(u,d);if(m||!t.state.selection.eq(v)){const y=t.state.tr.setSelection(v);m&&y.setMeta(Vs,u.pos),t.dispatch(y)}}function s(){t.root.removeEventListener("mouseup",s),t.root.removeEventListener("dragstart",s),t.root.removeEventListener("mousemove",l),Vs.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(Vs,-1))}function l(u){const f=u,d=Vs.getState(t.state);let m;if(d!=null)m=t.state.doc.resolve(d);else if(pT(t,f.target)!=r&&(m=Yy(t,e),!m))return s();m&&o(m,f)}t.root.addEventListener("mouseup",s),t.root.addEventListener("dragstart",s),t.root.addEventListener("mousemove",l)}function gN(t,e,n){if(!(t.state.selection instanceof st))return null;const{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){const o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){const l=r.before(i),u=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(u)?l:null}}return null}function pT(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Yy(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?fc(t.state.doc.resolve(n.pos)):null}var _J=class{constructor(e,n){this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Ub(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,Ub(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function Ub(t,e,n,r,i,o){var s;let l=0,u=!0,f=e.firstChild;const d=t.firstChild;if(d){for(let m=0,v=0;mnew n(l,e,u),new Np(-1,!1)},apply(o,s){return s.apply(o)}},props:{attributes:o=>{const s=gi.getState(o);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,s)=>{kJ(o,s,t,e,r)},mouseleave:o=>{xJ(o)},mousedown:(o,s)=>{SJ(o,s,e)}},decorations:o=>{const s=gi.getState(o);if(s&&s.activeHandle>-1)return MJ(o,s.activeHandle)},nodeViews:{}}});return i}var Np=class{constructor(t,e){this.activeHandle=t,this.dragging=e}apply(t){const e=this,n=t.getMeta(gi);if(n&&n.setHandle!=null)return new Np(n.setHandle,!1);if(n&&n.setDragging!==void 0)return new Np(e.activeHandle,n.setDragging);if(e.activeHandle>-1&&t.docChanged){let r=t.mapping.map(e.activeHandle,-1);return jb(t.doc.resolve(r))||(r=-1),new Np(r,e.dragging)}return e}};function kJ(t,e,n,r,i){const o=gi.getState(t.state);if(o&&!o.dragging){const s=TJ(e.target);let l=-1;if(s){const{left:u,right:f}=s.getBoundingClientRect();e.clientX-u<=n?l=mT(t,e,"left"):f-e.clientX<=n&&(l=mT(t,e,"right"))}if(l!=o.activeHandle){if(!i&&l!==-1){const u=t.state.doc.resolve(l),f=u.node(-1),d=vn.get(f),m=u.start(-1);if(d.colCount(u.pos-m)+u.nodeAfter.attrs.colspan-1==d.width-1)return}vN(t,l)}}}function xJ(t){const e=gi.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&vN(t,-1)}function SJ(t,e,n){const r=gi.getState(t.state);if(!r||r.activeHandle==-1||r.dragging)return!1;const i=t.state.doc.nodeAt(r.activeHandle),o=CJ(t,r.activeHandle,i.attrs);t.dispatch(t.state.tr.setMeta(gi,{setDragging:{startX:e.clientX,startWidth:o}}));function s(u){window.removeEventListener("mouseup",s),window.removeEventListener("mousemove",l);const f=gi.getState(t.state);f!=null&&f.dragging&&(EJ(t,f.activeHandle,gT(f.dragging,u,n)),t.dispatch(t.state.tr.setMeta(gi,{setDragging:null})))}function l(u){if(!u.which)return s(u);const f=gi.getState(t.state);if(f&&f.dragging){const d=gT(f.dragging,u,n);AJ(t,f.activeHandle,d,n)}}return window.addEventListener("mouseup",s),window.addEventListener("mousemove",l),e.preventDefault(),!0}function CJ(t,e,{colspan:n,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const o=t.domAtPos(e);let l=o.node.childNodes[o.offset].offsetWidth,u=n;if(r)for(let f=0;f0?-1:0;oJ(e,r,i+o)&&(o=i==0||i==e.width?null:0);for(let s=0;s0&&i0&&e.map[l-1]==u||i0?-1:0;DJ(e,r,i+u)&&(u=i==0||i==e.height?null:0);for(let f=0,d=e.width*i;f0&&i0&&d==e.map[f-e.width]){const m=n.nodeAt(d).attrs;t.setNodeMarkup(t.mapping.slice(l).map(d+r),null,{...m,rowspan:m.rowspan-1}),u+=m.colspan-1}else if(i0&&n[o]==n[o-1]||r.right0&&n[i]==n[i-t]||r.bottomn[r.type.spec.tableRole])(t,e)}function FJ(t){return(e,n)=>{var r;const i=e.selection;let o,s;if(i instanceof Lt){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos}else{if(o=nJ(i.$from),!o)return!1;s=(r=fc(i.$from))==null?void 0:r.pos}if(o==null||s==null||o.attrs.colspan==1&&o.attrs.rowspan==1)return!1;if(n){let l=o.attrs;const u=[],f=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});const d=ko(e),m=e.tr;for(let y=0;y{s.attrs[t]!==e&&o.setNodeMarkup(l,null,{...s.attrs,[t]:e})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),r(o)}return!0}}function jJ(t){return function(e,n){if(!Gi(e))return!1;if(n){const r=yr(e.schema),i=ko(e),o=e.tr,s=i.map.cellsInRect(t=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:t=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),l=s.map(u=>i.table.nodeAt(u));for(let u=0;u{const _=y+o.tableStart,C=s.doc.nodeAt(_);C&&s.setNodeMarkup(_,v,C.attrs)}),r(s)}return!0}}cd("row",{useDeprecatedLogic:!0});cd("column",{useDeprecatedLogic:!0});var WJ=cd("cell",{useDeprecatedLogic:!0});function UJ(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,i=t.before();r>=0;r--){const o=t.node(-1).child(r),s=o.lastChild;if(s)return i-1-s.nodeSize;i-=o.nodeSize}}else{if(t.index()0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function KJ({allowTableNodeSelection:t=!1}={}){return new on({key:Vs,state:{init(){return null},apply(e,n){const r=e.getMeta(Vs);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:i,pos:o}=e.mapping.mapResult(n);return i?null:o}},props:{decorations:sJ,handleDOMEvents:{mousedown:bJ},createSelectionBetween(e){return Vs.getState(e.state)!=null?e.state.selection:null},handleTripleClick:vJ,handleKeyDown:gJ,handlePaste:yJ},appendTransaction(e,n,r){return uJ(r,mN(r,n),t)}})}function kT(t,e,n,r,i,o){let s=0,l=!0,u=e.firstChild;const f=t.firstChild;for(let d=0,m=0;d{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function XJ(t,e,n,r,i){const o=JJ(t),s=[],l=[];for(let f=0;f{const{selection:e}=t.state;if(!ZJ(e))return!1;let n=0;const r=iw(e.ranges[0].$from,o=>o.type.name==="table");return r==null||r.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},QJ=_n.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:GJ,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:n,tableWidth:r,tableMinWidth:i}=YJ(t,this.options.cellMinWidth);return["table",zt(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`minWidth: ${i}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{const s=XJ(o.schema,t,e,n);if(i){const l=r.selection.anchor+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(st.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>NJ(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>LJ(t,e),deleteColumn:()=>({state:t,dispatch:e})=>PJ(t,e),addRowBefore:()=>({state:t,dispatch:e})=>RJ(t,e),addRowAfter:()=>({state:t,dispatch:e})=>zJ(t,e),deleteRow:()=>({state:t,dispatch:e})=>$J(t,e),deleteTable:()=>({state:t,dispatch:e})=>qJ(t,e),mergeCells:()=>({state:t,dispatch:e})=>yT(t,e),splitCell:()=>({state:t,dispatch:e})=>bT(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>cd("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>cd("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>WJ(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>yT(t,e)?!0:bT(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>VJ(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>wT(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>wT(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&mN(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=Lt.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Zh,"Mod-Backspace":Zh,Delete:Zh,"Mod-Delete":Zh}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[wJ({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],KJ({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:wt(Ye(t,"tableRole",e))}}}),eX=_n.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",zt(this.options.HTMLAttributes,t),0]}}),tX=_n.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",zt(this.options.HTMLAttributes,t),0]}}),nX=_n.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",zt(this.options.HTMLAttributes,t),0]}}),rX=_n.create({name:"text",group:"inline"});function iX(t={}){return new on({view(e){return new oX(e,t)}})}class oX{constructor(e,n){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=n.width||1,this.color=n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let i=o=>{this[r](o)};return e.dom.addEventListener(r,i),{name:r,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let l=e.nodeBefore,u=e.nodeAfter;if(l||u){let f=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(f){let d=f.getBoundingClientRect(),m=l?d.bottom:d.top;l&&u&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:d.left,right:d.right,top:m-this.width/2,bottom:m+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let l=i.getBoundingClientRect();o=l.left-i.scrollLeft,s=l.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Z6(this.editorView.state.doc,s,this.editorView.dragging.slice);l!=null&&(s=l)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const sX=ir.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[iX(this.options)]}});ir.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new on({key:new xn("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=e,o=[];if(!n||!r)return tn.create(t,[]);let s=0;this.options.mode==="deepest"&&t.descendants((u,f)=>{if(u.isText)return;if(!(i>=f&&i<=f+u.nodeSize-1))return!1;s+=1});let l=0;return t.descendants((u,f)=>{if(u.isText||!(i>=f&&i<=f+u.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&s-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";o.push(hr.node(f,f+u.nodeSize,{class:this.options.className}))}),tn.create(t,o)}}})]}});class fn extends ht{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return fn.valid(r)?new fn(r):ht.near(r)}content(){return He.empty}eq(e){return e instanceof fn&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new fn(e.resolve(n.pos))}getBookmark(){return new fw(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!aX(e)||!lX(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&fn.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let l=e.node(s);if(n>0?e.indexAfter(s)0){o=l.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let u=e.doc.resolve(i);if(fn.valid(u))return u}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!it.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let l=e.doc.resolve(i);if(fn.valid(l))return l}return null}}}fn.prototype.visible=!1;fn.findFrom=fn.findGapCursorFrom;ht.jsonID("gapcursor",fn);class fw{constructor(e){this.pos=e}map(e){return new fw(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return fn.valid(n)?new fn(n):ht.near(n)}}function aX(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function lX(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function uX(){return new on({props:{decorations:hX,createSelectionBetween(t,e,n){return e.pos==n.pos&&fn.valid(n)?new fn(n):null},handleClick:fX,handleKeyDown:cX,handleDOMEvents:{beforeinput:dX}}})}const cX=G_({ArrowLeft:Qh("horiz",-1),ArrowRight:Qh("horiz",1),ArrowUp:Qh("vert",-1),ArrowDown:Qh("vert",1)});function Qh(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,l=e>0?s.$to:s.$from,u=s.empty;if(s instanceof st){if(!o.endOfTextblock(n)||l.depth==0)return!1;u=!1,l=r.doc.resolve(e>0?l.after():l.before())}let f=fn.findGapCursorFrom(l,e,u);return f?(i&&i(r.tr.setSelection(new fn(f))),!0):!1}}function fX(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!fn.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&it.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new fn(r))),!0)}function dX(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof fn))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=Oe.empty;for(let s=r.length-1;s>=0;s--)i=Oe.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new He(i,0,0));return o.setSelection(st.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function hX(t){if(!(t.selection instanceof fn))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",tn.create(t.doc,[hr.widget(t.selection.head,e,{key:"gapcursor"})])}const pX=ir.create({name:"gapCursor",addProseMirrorPlugins(){return[uX()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=wt(Ye(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}});var Lm=200,rr=function(){};rr.prototype.append=function(e){return e.length?(e=rr.from(e),!this.length&&e||e.length=n?rr.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};rr.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};rr.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};rr.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i};rr.from=function(e){return e instanceof rr?e:e&&e.length?new _N(e):rr.empty};var _N=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,l){for(var u=o;u=s;u--)if(i(this.values[u],l+u)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Lm)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Lm)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(rr);rr.empty=new _N([]);var mX=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return rl&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(rr),wN=rr;const gX=500;class Di{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,u,f=[],d=[];return this.items.forEach((m,v)=>{if(!m.step){i||(i=this.remapping(r,v+1),o=i.maps.length),o--,d.push(m);return}if(i){d.push(new ro(m.map));let y=m.step.map(i.slice(o)),_;y&&s.maybeStep(y).doc&&(_=s.mapping.maps[s.mapping.maps.length-1],f.push(new ro(_,void 0,void 0,f.length+d.length))),o--,_&&i.appendMap(_,o)}else s.maybeStep(m.step);if(m.selection)return l=i?m.selection.map(i.slice(o)):m.selection,u=new Di(this.items.slice(0,r).append(d.reverse().concat(f)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:s,selection:l}}addTransform(e,n,r,i){let o=[],s=this.eventCount,l=this.items,u=!i&&l.length?l.get(l.length-1):null;for(let d=0;dyX&&(l=vX(l,f),s-=f),new Di(l.append(o),s)}remapping(e,n){let r=new Ou;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new Di(this.items.append(e.map(n=>new ro(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(v=>{v.selection&&l--},i);let u=n;this.items.forEach(v=>{let y=o.getMirror(--u);if(y==null)return;s=Math.min(s,y);let _=o.maps[y];if(v.step){let C=e.steps[y].invert(e.docs[y]),x=v.selection&&v.selection.map(o.slice(u+1,y));x&&l++,r.push(new ro(_,C,x))}else r.push(new ro(_))},i);let f=[];for(let v=n;vgX&&(m=m.compress(this.items.length-r.length)),m}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let u=s.step.map(n.slice(r)),f=u&&u.getMap();if(r--,f&&n.appendMap(f,r),u){let d=s.selection&&s.selection.map(n.slice(r));d&&o++;let m=new ro(f.invert(),u,d),v,y=i.length-1;(v=i.length&&i[y].merge(m))?i[y]=v:i.push(m)}}else s.map&&r--},this.items.length,0),new Di(wN.from(i.reverse()),o)}}Di.empty=new Di(wN.empty,0);function vX(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class ro{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new ro(n.getMap().invert(),n,this.selection)}}}class Bs{constructor(e,n,r,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i}}const yX=20;function bX(t,e,n,r){let i=n.getMeta(Zs),o;if(i)return i.historyState;n.getMeta(wX)&&(t=new Bs(t.done,t.undone,null,0));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(Zs))return s.getMeta(Zs).redo?new Bs(t.done.addTransform(n,void 0,r,Lp(e)),t.undone,ST(n.mapping.maps[n.steps.length-1]),t.prevTime):new Bs(t.done,t.undone.addTransform(n,void 0,r,Lp(e)),null,t.prevTime);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=t.prevTime==0||!s&&(t.prevTime<(n.time||0)-r.newGroupDelay||!_X(n,t.prevRanges)),u=s?Jy(t.prevRanges,n.mapping):ST(n.mapping.maps[n.steps.length-1]);return new Bs(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Lp(e)),Di.empty,u,n.time)}else return(o=n.getMeta("rebased"))?new Bs(t.done.rebased(n,o),t.undone.rebased(n,o),Jy(t.prevRanges,n.mapping),t.prevTime):new Bs(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Jy(t.prevRanges,n.mapping),t.prevTime)}function _X(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=e[o]&&(n=!0)}),n}function ST(t){let e=[];return t.forEach((n,r,i,o)=>e.push(i,o)),e}function Jy(t,e){if(!t)return null;let n=[];for(let r=0;r{let n=Zs.getState(t);return!n||n.done.eventCount==0?!1:(e&&kN(n,t,e,!1),!0)},SN=(t,e)=>{let n=Zs.getState(t);return!n||n.undone.eventCount==0?!1:(e&&kN(n,t,e,!0),!0)},xX=ir.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>xN(t,e),redo:()=>({state:t,dispatch:e})=>SN(t,e)}},addProseMirrorPlugins(){return[kX(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),SX=ir.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>t.style.textAlign||this.options.defaultAlignment,renderHTML:t=>t.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${t.textAlign}`}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.every(n=>e.updateAttributes(n,{textAlign:t})):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),CX="aaa1rp3barth4b_ott3vie4c1le2ogado5udhabi7c_ademy5centure6ountant_s9o1tor4d_s1ult4e_g1ro2tna4f_l1rica5g_akhan5ency5i_g1rbus3force5tel5kdn3l_faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m_azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o_l2partments8p_le4q_uarelle8r_ab1mco4chi3my2pa2t_e3s_da2ia2sociates9t_hleta5torney7u_ction5di_ble3o3spost5thor3o_s4vianca6w_s2x_a2z_ure5ba_by2idu3namex3narepublic11d1k2r_celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b_c1t1va3cg1n2d1e_ats2uty4er2ntley5rlin4st_buy5t2f1g1h_arti5i_ble3d1ke2ng_o3o1z2j1lack_friday9ockbuster8g1omberg7ue3m_s1w2n_pparibas9o_ats3ehringer8fa2m1nd2o_k_ing5sch2tik2on4t1utique6x2r_adesco6idgestone9oadway5ker3ther5ussels7s1t1uild_ers6siness6y1zz3v1w1y1z_h3ca_b1fe2l_l1vinklein9m_era3p2non3petown5ital_one8r_avan4ds2e_er_s4s2sa1e1h1ino4t_ering5holic7ba1n1re2s2c1d1enter4o1rn3f_a1d2g1h_anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i_priani6rcle4sco3tadel4i_c2y_eats7k1l_aims4eaning6ick2nic1que6othing5ud3ub_med6m1n1o_ach3des3ffee4llege4ogne5m_cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking_channel11l1p2rsica5untry4pon_s4rses6pa2r_edit_card4union9icket5own3s1uise_s6u_isinella9v1w1x1y_mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e_al_er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si_gn4v2hl2iamonds6et2gital5rect_ory7scount3ver5h2y2j1k1m1np2o_cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c_o2deka3u_cation8e1g1mail3erck5nergy4gineer_ing9terprises10pson4quipment8r_icsson6ni3s_q1tate5t_isalat7u_rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n_s2rm_ers5shion4t3edex3edback6rrari3ero6i_at2delity5o2lm2nal1nce1ial7re_stone6mdale6sh_ing5t_ness6j1k1lickr3ghts4r2orist4wers5y2m1o_o_d_network8tball6rd1ex2sale4um3undation8x2r_ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n_d2rniture7tbol5yi3ga_l_lery3o1up4me_s3p1rden4y2b_iz3d_n2e_a1nt_ing5orge5f1g_ee3h1i_ft_s3ves2ing5l_ass3e1obal2o4m_ail3bh2o1x2n1odaddy5ld_point6f2o_dyear5g_le4p1t1v2p1q1r_ainger5phics5tis4een3ipe3ocery4up4s1t1u_ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc_bank7ealth_care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k_t2m1n1ockey4ldings5iday5medepot5goods5s_ense7nda3rse3spital5t_ing5t_eles2s3mail5use3w2r1sbc3t1u_ghes5yatt3undai7ibm2cbc2e1u2d1e_ee3fm2kano4l1m_amat4db2mo_bilien9n_c1dustries8finiti5o2g1k1stitute6urance4e4t_ernational10uit4vestments10o1piranga7q1r_ish4s_maili5t_anbul7t_au2v3jaguar4va3cb2e_ep2tzt3welry6io2ll2m_p2nj2o_bs1urg4t1y2p_morgan6rs3uegos4niper7kaufen5ddi3e_rryhotels6logistics9properties14fh2g1h1i_a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p_mg2n2r_d1ed3uokgroup8w1y_oto4z2la_caixa5mborghini8er3ncaster5ia3d_rover6xess5salle5t_ino3robe5w_yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i_dl2fe_insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan_s3cker3us3l1ndon4tte1o3ve3pl_financial11r1s1t_d_a3u_ndbeck6xe1ury5v1y2ma_cys3drid4if1son4keup4n_agement7go3p1rket_ing3s4riott5shalls7serati6ttel5ba2c_kinsey7d1e_d_ia3et2lbourne7me1orial6n_u2rckmsd7g1h1iami3crosoft7l1ni1t2t_subishi9k1l_b1s2m_a2n1o_bi_le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to_rcycles9v_ie4p1q1r1s_d2t_n1r2u_seum3ic3tual5v1w1x1y1z2na_b1goya4me2tura4vy3ba2c1e_c1t_bank4flix4work5ustar5w_s2xt_direct7us4f_l2g_o2hk2i_co2ke1on3nja3ssan1y5l1o_kia3rthwesternmutual14on4w_ruz3tv4p1r_a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan_group9dnavy5lo3m_ega4ne1g1l_ine5oo2pen3racle3nge4g_anic5igins6saka4tsuka4t2vh3pa_ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e_t2f_izer5g1h_armacy6d1ilips5one2to_graphy6s4ysio5ics1tet2ures6d1n_g1k2oneer5zza4k1l_ace2y_station9umbing5s3m1n_c2ohl2ker3litie5rn2st3r_america6xi3ess3ime3o_d_uctions8f1gressive8mo2perties3y5tection8u_dential9s1t1ub2w_c2y2qa1pon3uebec3st5racing4dio4e_ad1lestate6tor2y4cipes5d_stone5umbrella9hab3ise_n3t2liance6n_t_als5pair3ort3ublican8st_aurant8view_s5xroth6ich_ardli6oh3l1o1p2o_cher3ks3deo3gers4om3s_vp3u_gby3hr2n2w_e2yukyu6sa_arland6fe_ty4kura4le1on3msclub4ung5ndvik_coromant12ofi4p1rl2s1ve2xo3b_i1s2c_a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e_arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x_y3fr2g1h_angrila6rp2w2ell3ia1ksha5oes2p_ping5uji3w_time7i_lk2na1gles5te3j1k_i_n2y_pe4l_ing4m_art3ile4n_cf3o_ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa_ce3ort2t3r_l2s1t_ada2ples4r1tebank4farm7c_group6ockholm6rage3e3ream4udio2y3yle4u_cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y_dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x_i3c_i2d_k2eam2ch_nology8l1masek5nnis4va3f1g1h_d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j_maxx4x2k_maxx5l1m_all4n1o_day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r_ade1ing4ining5vel_channel7ers_insurance16ust3v2t1ube2i1nes3shu4v_s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va_cations7na1guard7c1e_gas3ntures6risign5mögensberater2ung14sicherung10t2g1i_ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u_elos6wales2mart4ter4ng_gou5tch_es6eather_channel12bcam3er2site5d_ding5ibo2r3f1hoswho6ien2ki2lliamhill9n_dows4e1ners6me2olterskluwer11odside6rk_s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u_tube6t1un3za_ppos4ra3ero3ip2m1one3uerich6w2",TX="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5تصالات6رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत_म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里_大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Qu=(t,e)=>{for(const n in e)t[n]=e[n];return t},qb="numeric",Kb="ascii",Gb="alpha",Ip="asciinumeric",ep="alphanumeric",Yb="domain",CN="emoji",EX="scheme",AX="slashscheme",TT="whitespace";function OX(t,e){return t in e||(e[t]=[]),e[t]}function qa(t,e,n){e[qb]&&(e[Ip]=!0,e[ep]=!0),e[Kb]&&(e[Ip]=!0,e[Gb]=!0),e[Ip]&&(e[ep]=!0),e[Gb]&&(e[ep]=!0),e[ep]&&(e[Yb]=!0),e[CN]&&(e[Yb]=!0);for(const r in e){const i=OX(r,n);i.indexOf(t)<0&&i.push(t)}}function MX(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function Br(t){t===void 0&&(t=null),this.j={},this.jr=[],this.jd=null,this.t=t}Br.groups={};Br.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;rt.ta(e,n,r,i),hi=(t,e,n,r,i)=>t.tr(e,n,r,i),ET=(t,e,n,r,i)=>t.ts(e,n,r,i),Pe=(t,e,n,r,i)=>t.tt(e,n,r,i),Do="WORD",Jb="UWORD",fd="LOCALHOST",Xb="TLD",Zb="UTLD",Pp="SCHEME",cu="SLASH_SCHEME",Im="NUM",TN="WS",dw="NL",pu="OPENBRACE",Cf="OPENBRACKET",Tf="OPENANGLEBRACKET",Ef="OPENPAREN",$a="CLOSEBRACE",mu="CLOSEBRACKET",gu="CLOSEANGLEBRACKET",Ha="CLOSEPAREN",Pm="AMPERSAND",Dm="APOSTROPHE",Rm="ASTERISK",$s="AT",zm="BACKSLASH",Bm="BACKTICK",$m="CARET",js="COLON",hw="COMMA",Hm="DOLLAR",io="DOT",Fm="EQUALS",pw="EXCLAMATION",oo="HYPHEN",Vm="PERCENT",jm="PIPE",Wm="PLUS",Um="POUND",qm="QUERY",mw="QUOTE",gw="SEMI",zo="SLASH",Af="TILDE",Km="UNDERSCORE",EN="EMOJI",Gm="SYM";var AN=Object.freeze({__proto__:null,WORD:Do,UWORD:Jb,LOCALHOST:fd,TLD:Xb,UTLD:Zb,SCHEME:Pp,SLASH_SCHEME:cu,NUM:Im,WS:TN,NL:dw,OPENBRACE:pu,OPENBRACKET:Cf,OPENANGLEBRACKET:Tf,OPENPAREN:Ef,CLOSEBRACE:$a,CLOSEBRACKET:mu,CLOSEANGLEBRACKET:gu,CLOSEPAREN:Ha,AMPERSAND:Pm,APOSTROPHE:Dm,ASTERISK:Rm,AT:$s,BACKSLASH:zm,BACKTICK:Bm,CARET:$m,COLON:js,COMMA:hw,DOLLAR:Hm,DOT:io,EQUALS:Fm,EXCLAMATION:pw,HYPHEN:oo,PERCENT:Vm,PIPE:jm,PLUS:Wm,POUND:Um,QUERY:qm,QUOTE:mw,SEMI:gw,SLASH:zo,TILDE:Af,UNDERSCORE:Km,EMOJI:EN,SYM:Gm});const iu=/[a-z]/,Zy=/\p{L}/u,Qy=/\p{Emoji}/u,e0=/\d/,AT=/\s/,OT=` -`,NX="️",LX="‍";let tp=null,np=null;function IX(t){t===void 0&&(t=[]);const e={};Br.groups=e;const n=new Br;tp==null&&(tp=MT(CX)),np==null&&(np=MT(TX)),Pe(n,"'",Dm),Pe(n,"{",pu),Pe(n,"[",Cf),Pe(n,"<",Tf),Pe(n,"(",Ef),Pe(n,"}",$a),Pe(n,"]",mu),Pe(n,">",gu),Pe(n,")",Ha),Pe(n,"&",Pm),Pe(n,"*",Rm),Pe(n,"@",$s),Pe(n,"`",Bm),Pe(n,"^",$m),Pe(n,":",js),Pe(n,",",hw),Pe(n,"$",Hm),Pe(n,".",io),Pe(n,"=",Fm),Pe(n,"!",pw),Pe(n,"-",oo),Pe(n,"%",Vm),Pe(n,"|",jm),Pe(n,"+",Wm),Pe(n,"#",Um),Pe(n,"?",qm),Pe(n,'"',mw),Pe(n,"/",zo),Pe(n,";",gw),Pe(n,"~",Af),Pe(n,"_",Km),Pe(n,"\\",zm);const r=hi(n,e0,Im,{[qb]:!0});hi(r,e0,r);const i=hi(n,iu,Do,{[Kb]:!0});hi(i,iu,i);const o=hi(n,Zy,Jb,{[Gb]:!0});hi(o,iu),hi(o,Zy,o);const s=hi(n,AT,TN,{[TT]:!0});Pe(n,OT,dw,{[TT]:!0}),Pe(s,OT),hi(s,AT,s);const l=hi(n,Qy,EN,{[CN]:!0});hi(l,Qy,l),Pe(l,NX,l);const u=Pe(l,LX);hi(u,Qy,l);const f=[[iu,i]],d=[[iu,null],[Zy,o]];for(let m=0;mm[0]>v[0]?1:-1);for(let m=0;m=0?_[Yb]=!0:iu.test(v)?e0.test(v)?_[Ip]=!0:_[Kb]=!0:_[qb]=!0,ET(n,v,v,_)}return ET(n,"localhost",fd,{ascii:!0}),n.jd=new Br(Gm),{start:n,tokens:Qu({groups:e},AN)}}function PX(t,e){const n=DX(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,i=[];let o=0,s=0;for(;s=0&&(m+=n[s].length,v++),f+=n[s].length,o+=n[s].length,s++;o-=m,s-=v,f-=m,i.push({t:d.t,v:e.slice(o-f,o),s:o-f,e:o})}return i}function DX(t){const e=[],n=t.length;let r=0;for(;r56319||r+1===n||(o=t.charCodeAt(r+1))<56320||o>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function Es(t,e,n,r,i){let o;const s=e.length;for(let l=0;l=0;)o++;if(o>0){e.push(n.join(""));let s=parseInt(t.substring(r,r+o),10);for(;s>0;s--)n.pop();r+=o}else t[r]==="_"?(e.push(n.join("")),r++):(n.push(t[r]),r++)}return e}const dd={defaultProtocol:"http",events:null,format:NT,formatHref:NT,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function vw(t,e){e===void 0&&(e=null);let n=Qu({},dd);t&&(n=Qu(n,t instanceof vw?t.o:t));const r=n.ignoreTags,i=[];for(let o=0;on?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t){return t===void 0&&(t=dd.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toFormattedHref(t),r=t.get("tagName",n,e),i=this.toFormattedString(t),o={},s=t.get("className",n,e),l=t.get("target",n,e),u=t.get("rel",n,e),f=t.getObj("attributes",n,e),d=t.getObj("events",n,e);return o.href=n,s&&(o.class=s),l&&(o.target=l),u&&(o.rel=u),f&&Qu(o,f),{tagName:r,attributes:o,content:i,eventListeners:d}}};function nv(t,e){class n extends ON{constructor(i,o){super(i,o),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const LT=nv("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),IT=nv("text"),RX=nv("nl"),Na=nv("url",{isLink:!0,toHref(t){return t===void 0&&(t=dd.defaultProtocol),this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==fd&&t[1].t===js}}),Wn=t=>new Br(t);function zX(t){let{groups:e}=t;const n=e.domain.concat([Pm,Rm,$s,zm,Bm,$m,Hm,Fm,oo,Im,Vm,jm,Wm,Um,zo,Gm,Af,Km]),r=[Dm,gu,$a,mu,Ha,js,hw,io,pw,Tf,pu,Cf,Ef,qm,mw,gw],i=[Pm,Dm,Rm,zm,Bm,$m,$a,Hm,Fm,oo,Im,pu,Vm,jm,Wm,Um,qm,zo,Gm,Af,Km],o=Wn(),s=Pe(o,Af);rt(s,i,s),rt(s,e.domain,s);const l=Wn(),u=Wn(),f=Wn();rt(o,e.domain,l),rt(o,e.scheme,u),rt(o,e.slashscheme,f),rt(l,i,s),rt(l,e.domain,l);const d=Pe(l,$s);Pe(s,$s,d),Pe(u,$s,d),Pe(f,$s,d);const m=Pe(s,io);rt(m,i,s),rt(m,e.domain,s);const v=Wn();rt(d,e.domain,v),rt(v,e.domain,v);const y=Pe(v,io);rt(y,e.domain,v);const _=Wn(LT);rt(y,e.tld,_),rt(y,e.utld,_),Pe(d,fd,_);const C=Pe(v,oo);rt(C,e.domain,v),rt(_,e.domain,v),Pe(_,io,y),Pe(_,oo,C);const x=Pe(_,js);rt(x,e.numeric,LT);const k=Pe(l,oo),A=Pe(l,io);rt(k,e.domain,l),rt(A,i,s),rt(A,e.domain,l);const L=Wn(Na);rt(A,e.tld,L),rt(A,e.utld,L),rt(L,e.domain,l),rt(L,i,s),Pe(L,io,A),Pe(L,oo,k),Pe(L,$s,d);const E=Pe(L,js),H=Wn(Na);rt(E,e.numeric,H);const I=Wn(Na),q=Wn();rt(I,n,I),rt(I,r,q),rt(q,n,I),rt(q,r,q),Pe(L,zo,I),Pe(H,zo,I);const P=Pe(u,js),z=Pe(f,js),w=Pe(z,zo);Pe(w,zo,P),rt(u,e.domain,l),Pe(u,io,A),Pe(u,oo,k),rt(f,e.domain,l),Pe(f,io,A),Pe(f,oo,k),rt(P,e.domain,I),Pe(P,zo,I);const R=Pe(I,pu),U=Pe(I,Cf),K=Pe(I,Tf),oe=Pe(I,Ef);Pe(q,pu,R),Pe(q,Cf,U),Pe(q,Tf,K),Pe(q,Ef,oe),Pe(R,$a,I),Pe(U,mu,I),Pe(K,gu,I),Pe(oe,Ha,I),Pe(R,$a,I);const D=Wn(Na),ae=Wn(Na),ce=Wn(Na),ve=Wn(Na);rt(R,n,D),rt(U,n,ae),rt(K,n,ce),rt(oe,n,ve);const ze=Wn(),qe=Wn(),yt=Wn(),mt=Wn();return rt(R,r),rt(U,r),rt(K,r),rt(oe,r),rt(D,n,D),rt(ae,n,ae),rt(ce,n,ce),rt(ve,n,ve),rt(D,r,D),rt(ae,r,ae),rt(ce,r,ce),rt(ve,r,ve),rt(ze,n,ze),rt(qe,n,ae),rt(yt,n,ce),rt(mt,n,ve),rt(ze,r,ze),rt(qe,r,qe),rt(yt,r,yt),rt(mt,r,mt),Pe(ae,mu,I),Pe(ce,gu,I),Pe(ve,Ha,I),Pe(D,$a,I),Pe(qe,mu,I),Pe(yt,gu,I),Pe(mt,Ha,I),Pe(ze,Ha,I),Pe(o,fd,L),Pe(o,dw,RX),{start:o,tokens:AN}}function BX(t,e,n){let r=n.length,i=0,o=[],s=[];for(;i=0&&v++,i++,d++;if(v<0)i-=d,i0&&(o.push(t0(IT,e,s)),s=[]),i-=v,d-=v;const y=m.t,_=n.slice(i-d,i);o.push(t0(y,e,_))}}return s.length>0&&o.push(t0(IT,e,s)),o}function t0(t,e,n){const r=n[0].s,i=n[n.length-1].e,o=e.slice(r,i);return new t(o,n)}const $X=typeof console<"u"&&console&&console.warn||(()=>{}),HX="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",cn={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function FX(){Br.groups={},cn.scanner=null,cn.parser=null,cn.tokenQueue=[],cn.pluginQueue=[],cn.customSchemes=[],cn.initialized=!1}function PT(t,e){if(e===void 0&&(e=!1),cn.initialized&&$X(`linkifyjs: already initialized - will not register custom scheme "${t}" ${HX}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. - 1. Must only contain digits, lowercase ASCII letters or "-" - 2. Cannot start or end with "-" - 3. "-" cannot repeat`);cn.customSchemes.push([t,e])}function VX(){cn.scanner=IX(cn.customSchemes);for(let t=0;t{const i=e.some(f=>f.docChanged)&&!n.doc.eq(r.doc),o=e.some(f=>f.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,l=Z4(n.doc,[...e]);if(rN(l).forEach(({newRange:f})=>{const d=eN(r.doc,f,y=>y.isTextblock);let m,v;if(d.length>1?(m=d[0],v=r.doc.textBetween(m.pos,m.pos+m.node.nodeSize,void 0," ")):d.length&&r.doc.textBetween(f.from,f.to," "," ").endsWith(" ")&&(m=d[0],v=r.doc.textBetween(m.pos,f.to,void 0," ")),m&&v){const y=v.split(" ").filter(x=>x!=="");if(y.length<=0)return!1;const _=y[y.length-1],C=m.pos+v.lastIndexOf(_);if(!_)return!1;yw(_).filter(x=>x.isLink).map(x=>({...x,from:C+x.start+1,to:C+x.end+1})).filter(x=>r.schema.marks.code?!r.doc.rangeHasMark(x.from,x.to,r.schema.marks.code):!0).filter(x=>t.validate?t.validate(x.value):!0).forEach(x=>{ev(x.from,x.to,r.doc).some(k=>k.mark.type===t.type)||s.addMark(x.from,x.to,t.type.create({href:x.href}))})}}),!!s.steps.length)return s}})}function UX(t){return new on({key:new xn("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(r.button!==0)return!1;let s=r.target;const l=[];for(;s.nodeName!=="DIV";)l.push(s),s=s.parentNode;if(!l.find(v=>v.nodeName==="A"))return!1;const u=aw(e.state,t.type.name),f=r.target,d=(i=f==null?void 0:f.href)!==null&&i!==void 0?i:u.href,m=(o=f==null?void 0:f.target)!==null&&o!==void 0?o:u.target;return f&&d?(window.open(d,m),!0):!1}}})}function qX(t){return new on({key:new xn("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let l="";r.content.forEach(f=>{l+=f.textContent});const u=yw(l).find(f=>f.isLink&&f.value===l);return!l||!u?!1:(t.editor.commands.setMark(t.type,{href:u.href}),!0)}}})}const KX=or.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(t=>{if(typeof t=="string"){PT(t);return}PT(t.scheme,t.optionalSlashes)})},onDestroy(){FX()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:t}){var e;return!((e=t.href)===null||e===void 0)&&e.startsWith("javascript:")?["a",zt(this.options.HTMLAttributes,{...t,href:""}),0]:["a",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{setLink:t=>({chain:e})=>e().setMark(this.name,t).setMeta("preventAutolink",!0).run(),toggleLink:t=>({chain:e})=>e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Yo({find:(t,e)=>{var n;const r=(n=e==null?void 0:e.clipboardData)===null||n===void 0?void 0:n.getData("text/html"),i=[];if(r){const o=new DOMParser().parseFromString(r,"text/html"),s=o.querySelectorAll("a");s.length&&[...s].forEach(l=>i.push({text:l.innerText,data:{href:l.getAttribute("href")},index:o.body.innerText.indexOf(l.innerText)+l.innerText.length}))}if(t){const o=yw(t).filter(s=>s.isLink);o.length&&o.forEach(s=>i.push({text:s.value,data:{href:s.href},index:s.start}))}return i},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[];return this.options.autolink&&t.push(WX({type:this.type,validate:this.options.validate})),this.options.openOnClick&&t.push(UX({type:this.type})),this.options.linkOnPaste&&t.push(qX({editor:this.editor,type:this.type})),t}}),GX=KX.extend({addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),class:{default:null},title:{default:null}}},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),HTMLAttributes:{target:null,rel:null,class:null,title:null}}},renderHTML({HTMLAttributes:t}){const e=zt(this.options.HTMLAttributes,t);return e.target==="_blank"&&(e.rel="noopener noreferrer"),["a",e,0]},addProseMirrorPlugins(){return[new on({key:new xn("handleClick"),props:{handleClick:(t,e,n)=>{this.editor.getAttributes("link").href&&setTimeout(()=>{this.editor.emit("vui:link-clicked")},50)}}})]}}),YX=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,JX=_n.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",zt(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[uw({find:YX,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),XX=JX.extend({addAttributes(){return{id:{default:null},src:{default:null},alt:{default:null},title:{default:null},url:{default:null},target:{default:null},transform:{default:null}}},renderHTML({HTMLAttributes:t}){const e={class:"vui-editor-img-wrap",tabindex:"-1"},n={src:t.src,title:t.title,alt:t.alt},r={url:t.url,target:t.target};return t.url?["figure",e,["a",r,["img",n]]]:["figure",e,["img",n]]},addProseMirrorPlugins(){return[new on({key:new xn("handleClick"),props:{handleClick:(t,e,n)=>{this.editor.getAttributes("image").src&&setTimeout(()=>{this.editor.emit("vui:image-clicked",n)},50)}}})]}});var Vr="top",ki="bottom",xi="right",jr="left",bw="auto",$d=[Vr,ki,xi,jr],ec="start",hd="end",ZX="clippingParents",MN="viewport",Yc="popper",QX="reference",DT=$d.reduce(function(t,e){return t.concat([e+"-"+ec,e+"-"+hd])},[]),NN=[].concat($d,[bw]).reduce(function(t,e){return t.concat([e,e+"-"+ec,e+"-"+hd])},[]),eZ="beforeRead",tZ="read",nZ="afterRead",rZ="beforeMain",iZ="main",oZ="afterMain",sZ="beforeWrite",aZ="write",lZ="afterWrite",uZ=[eZ,tZ,nZ,rZ,iZ,oZ,sZ,aZ,lZ];function wo(t){return t?(t.nodeName||"").toLowerCase():null}function Si(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function kl(t){var e=Si(t).Element;return t instanceof e||t instanceof Element}function _i(t){var e=Si(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function _w(t){if(typeof ShadowRoot>"u")return!1;var e=Si(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function cZ(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!_i(o)||!wo(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function fZ(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=s.reduce(function(u,f){return u[f]="",u},{});!_i(i)||!wo(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(u){i.removeAttribute(u)}))})}}const LN={name:"applyStyles",enabled:!0,phase:"write",fn:cZ,effect:fZ,requires:["computeStyles"]};function vo(t){return t.split("-")[0]}var al=Math.max,Ym=Math.min,tc=Math.round;function Qb(){var t=navigator.userAgentData;return t!=null&&t.brands?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function IN(){return!/^((?!chrome|android).)*safari/i.test(Qb())}function nc(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&_i(t)&&(i=t.offsetWidth>0&&tc(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&tc(r.height)/t.offsetHeight||1);var s=kl(t)?Si(t):window,l=s.visualViewport,u=!IN()&&n,f=(r.left+(u&&l?l.offsetLeft:0))/i,d=(r.top+(u&&l?l.offsetTop:0))/o,m=r.width/i,v=r.height/o;return{width:m,height:v,top:d,right:f+m,bottom:d+v,left:f,x:f,y:d}}function ww(t){var e=nc(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function PN(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&_w(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Jo(t){return Si(t).getComputedStyle(t)}function dZ(t){return["table","td","th"].indexOf(wo(t))>=0}function ga(t){return((kl(t)?t.ownerDocument:t.document)||window.document).documentElement}function rv(t){return wo(t)==="html"?t:t.assignedSlot||t.parentNode||(_w(t)?t.host:null)||ga(t)}function RT(t){return!_i(t)||Jo(t).position==="fixed"?null:t.offsetParent}function hZ(t){var e=/firefox/i.test(Qb()),n=/Trident/i.test(Qb());if(n&&_i(t)){var r=Jo(t);if(r.position==="fixed")return null}var i=rv(t);for(_w(i)&&(i=i.host);_i(i)&&["html","body"].indexOf(wo(i))<0;){var o=Jo(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function Hd(t){for(var e=Si(t),n=RT(t);n&&dZ(n)&&Jo(n).position==="static";)n=RT(n);return n&&(wo(n)==="html"||wo(n)==="body"&&Jo(n).position==="static")?e:n||hZ(t)||e}function kw(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Of(t,e,n){return al(t,Ym(e,n))}function pZ(t,e,n){var r=Of(t,e,n);return r>n?n:r}function DN(){return{top:0,right:0,bottom:0,left:0}}function RN(t){return Object.assign({},DN(),t)}function zN(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var mZ=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,RN(typeof e!="number"?e:zN(e,$d))};function gZ(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,l=vo(n.placement),u=kw(l),f=[jr,xi].indexOf(l)>=0,d=f?"height":"width";if(!(!o||!s)){var m=mZ(i.padding,n),v=ww(o),y=u==="y"?Vr:jr,_=u==="y"?ki:xi,C=n.rects.reference[d]+n.rects.reference[u]-s[u]-n.rects.popper[d],x=s[u]-n.rects.reference[u],k=Hd(o),A=k?u==="y"?k.clientHeight||0:k.clientWidth||0:0,L=C/2-x/2,E=m[y],H=A-v[d]-m[_],I=A/2-v[d]/2+L,q=Of(E,I,H),P=u;n.modifiersData[r]=(e={},e[P]=q,e.centerOffset=q-I,e)}}function vZ(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||PN(e.elements.popper,i)&&(e.elements.arrow=i))}const yZ={name:"arrow",enabled:!0,phase:"main",fn:gZ,effect:vZ,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function rc(t){return t.split("-")[1]}var bZ={top:"auto",right:"auto",bottom:"auto",left:"auto"};function _Z(t){var e=t.x,n=t.y,r=window,i=r.devicePixelRatio||1;return{x:tc(e*i)/i||0,y:tc(n*i)/i||0}}function zT(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,l=t.position,u=t.gpuAcceleration,f=t.adaptive,d=t.roundOffsets,m=t.isFixed,v=s.x,y=v===void 0?0:v,_=s.y,C=_===void 0?0:_,x=typeof d=="function"?d({x:y,y:C}):{x:y,y:C};y=x.x,C=x.y;var k=s.hasOwnProperty("x"),A=s.hasOwnProperty("y"),L=jr,E=Vr,H=window;if(f){var I=Hd(n),q="clientHeight",P="clientWidth";if(I===Si(n)&&(I=ga(n),Jo(I).position!=="static"&&l==="absolute"&&(q="scrollHeight",P="scrollWidth")),I=I,i===Vr||(i===jr||i===xi)&&o===hd){E=ki;var z=m&&I===H&&H.visualViewport?H.visualViewport.height:I[q];C-=z-r.height,C*=u?1:-1}if(i===jr||(i===Vr||i===ki)&&o===hd){L=xi;var w=m&&I===H&&H.visualViewport?H.visualViewport.width:I[P];y-=w-r.width,y*=u?1:-1}}var R=Object.assign({position:l},f&&bZ),U=d===!0?_Z({x:y,y:C}):{x:y,y:C};if(y=U.x,C=U.y,u){var K;return Object.assign({},R,(K={},K[E]=A?"0":"",K[L]=k?"0":"",K.transform=(H.devicePixelRatio||1)<=1?"translate("+y+"px, "+C+"px)":"translate3d("+y+"px, "+C+"px, 0)",K))}return Object.assign({},R,(e={},e[E]=A?C+"px":"",e[L]=k?y+"px":"",e.transform="",e))}function wZ(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,l=n.roundOffsets,u=l===void 0?!0:l,f={placement:vo(e.placement),variation:rc(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,zT(Object.assign({},f,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,zT(Object.assign({},f,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const kZ={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:wZ,data:{}};var rp={passive:!0};function xZ(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,l=s===void 0?!0:s,u=Si(e.elements.popper),f=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&f.forEach(function(d){d.addEventListener("scroll",n.update,rp)}),l&&u.addEventListener("resize",n.update,rp),function(){o&&f.forEach(function(d){d.removeEventListener("scroll",n.update,rp)}),l&&u.removeEventListener("resize",n.update,rp)}}const SZ={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:xZ,data:{}};var CZ={left:"right",right:"left",bottom:"top",top:"bottom"};function Dp(t){return t.replace(/left|right|bottom|top/g,function(e){return CZ[e]})}var TZ={start:"end",end:"start"};function BT(t){return t.replace(/start|end/g,function(e){return TZ[e]})}function xw(t){var e=Si(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Sw(t){return nc(ga(t)).left+xw(t).scrollLeft}function EZ(t,e){var n=Si(t),r=ga(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,u=0;if(i){o=i.width,s=i.height;var f=IN();(f||!f&&e==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:o,height:s,x:l+Sw(t),y:u}}function AZ(t){var e,n=ga(t),r=xw(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=al(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=al(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+Sw(t),u=-r.scrollTop;return Jo(i||n).direction==="rtl"&&(l+=al(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:u}}function Cw(t){var e=Jo(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function BN(t){return["html","body","#document"].indexOf(wo(t))>=0?t.ownerDocument.body:_i(t)&&Cw(t)?t:BN(rv(t))}function Mf(t,e){var n;e===void 0&&(e=[]);var r=BN(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=Si(r),s=i?[o].concat(o.visualViewport||[],Cw(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(Mf(rv(s)))}function e1(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function OZ(t,e){var n=nc(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function $T(t,e,n){return e===MN?e1(EZ(t,n)):kl(e)?OZ(e,n):e1(AZ(ga(t)))}function MZ(t){var e=Mf(rv(t)),n=["absolute","fixed"].indexOf(Jo(t).position)>=0,r=n&&_i(t)?Hd(t):t;return kl(r)?e.filter(function(i){return kl(i)&&PN(i,r)&&wo(i)!=="body"}):[]}function NZ(t,e,n,r){var i=e==="clippingParents"?MZ(t):[].concat(e),o=[].concat(i,[n]),s=o[0],l=o.reduce(function(u,f){var d=$T(t,f,r);return u.top=al(d.top,u.top),u.right=Ym(d.right,u.right),u.bottom=Ym(d.bottom,u.bottom),u.left=al(d.left,u.left),u},$T(t,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function $N(t){var e=t.reference,n=t.element,r=t.placement,i=r?vo(r):null,o=r?rc(r):null,s=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,u;switch(i){case Vr:u={x:s,y:e.y-n.height};break;case ki:u={x:s,y:e.y+e.height};break;case xi:u={x:e.x+e.width,y:l};break;case jr:u={x:e.x-n.width,y:l};break;default:u={x:e.x,y:e.y}}var f=i?kw(i):null;if(f!=null){var d=f==="y"?"height":"width";switch(o){case ec:u[f]=u[f]-(e[d]/2-n[d]/2);break;case hd:u[f]=u[f]+(e[d]/2-n[d]/2);break}}return u}function pd(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,l=n.boundary,u=l===void 0?ZX:l,f=n.rootBoundary,d=f===void 0?MN:f,m=n.elementContext,v=m===void 0?Yc:m,y=n.altBoundary,_=y===void 0?!1:y,C=n.padding,x=C===void 0?0:C,k=RN(typeof x!="number"?x:zN(x,$d)),A=v===Yc?QX:Yc,L=t.rects.popper,E=t.elements[_?A:v],H=NZ(kl(E)?E:E.contextElement||ga(t.elements.popper),u,d,s),I=nc(t.elements.reference),q=$N({reference:I,element:L,strategy:"absolute",placement:i}),P=e1(Object.assign({},L,q)),z=v===Yc?P:I,w={top:H.top-z.top+k.top,bottom:z.bottom-H.bottom+k.bottom,left:H.left-z.left+k.left,right:z.right-H.right+k.right},R=t.modifiersData.offset;if(v===Yc&&R){var U=R[i];Object.keys(w).forEach(function(K){var oe=[xi,ki].indexOf(K)>=0?1:-1,D=[Vr,ki].indexOf(K)>=0?"y":"x";w[K]+=U[D]*oe})}return w}function LZ(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,f=u===void 0?NN:u,d=rc(r),m=d?l?DT:DT.filter(function(_){return rc(_)===d}):$d,v=m.filter(function(_){return f.indexOf(_)>=0});v.length===0&&(v=m);var y=v.reduce(function(_,C){return _[C]=pd(t,{placement:C,boundary:i,rootBoundary:o,padding:s})[vo(C)],_},{});return Object.keys(y).sort(function(_,C){return y[_]-y[C]})}function IZ(t){if(vo(t)===bw)return[];var e=Dp(t);return[BT(t),e,BT(e)]}function PZ(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!0:s,u=n.fallbackPlacements,f=n.padding,d=n.boundary,m=n.rootBoundary,v=n.altBoundary,y=n.flipVariations,_=y===void 0?!0:y,C=n.allowedAutoPlacements,x=e.options.placement,k=vo(x),A=k===x,L=u||(A||!_?[Dp(x)]:IZ(x)),E=[x].concat(L).reduce(function(bt,Xe){return bt.concat(vo(Xe)===bw?LZ(e,{placement:Xe,boundary:d,rootBoundary:m,padding:f,flipVariations:_,allowedAutoPlacements:C}):Xe)},[]),H=e.rects.reference,I=e.rects.popper,q=new Map,P=!0,z=E[0],w=0;w=0,D=oe?"width":"height",ae=pd(e,{placement:R,boundary:d,rootBoundary:m,altBoundary:v,padding:f}),ce=oe?K?xi:jr:K?ki:Vr;H[D]>I[D]&&(ce=Dp(ce));var ve=Dp(ce),ze=[];if(o&&ze.push(ae[U]<=0),l&&ze.push(ae[ce]<=0,ae[ve]<=0),ze.every(function(bt){return bt})){z=R,P=!1;break}q.set(R,ze)}if(P)for(var qe=_?3:1,yt=function(Xe){var Ie=E.find(function(Be){var Ee=q.get(Be);if(Ee)return Ee.slice(0,Xe).every(function(Ze){return Ze})});if(Ie)return z=Ie,"break"},mt=qe;mt>0;mt--){var _t=yt(mt);if(_t==="break")break}e.placement!==z&&(e.modifiersData[r]._skip=!0,e.placement=z,e.reset=!0)}}const DZ={name:"flip",enabled:!0,phase:"main",fn:PZ,requiresIfExists:["offset"],data:{_skip:!1}};function HT(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function FT(t){return[Vr,xi,ki,jr].some(function(e){return t[e]>=0})}function RZ(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=pd(e,{elementContext:"reference"}),l=pd(e,{altBoundary:!0}),u=HT(s,r),f=HT(l,i,o),d=FT(u),m=FT(f);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:f,isReferenceHidden:d,hasPopperEscaped:m},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":m})}const zZ={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:RZ};function BZ(t,e,n){var r=vo(t),i=[jr,Vr].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[jr,xi].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function $Z(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=NN.reduce(function(d,m){return d[m]=BZ(m,e.rects,o),d},{}),l=s[e.placement],u=l.x,f=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=f),e.modifiersData[r]=s}const HZ={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:$Z};function FZ(t){var e=t.state,n=t.name;e.modifiersData[n]=$N({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const VZ={name:"popperOffsets",enabled:!0,phase:"read",fn:FZ,data:{}};function jZ(t){return t==="x"?"y":"x"}function WZ(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,l=s===void 0?!1:s,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,m=n.padding,v=n.tether,y=v===void 0?!0:v,_=n.tetherOffset,C=_===void 0?0:_,x=pd(e,{boundary:u,rootBoundary:f,padding:m,altBoundary:d}),k=vo(e.placement),A=rc(e.placement),L=!A,E=kw(k),H=jZ(E),I=e.modifiersData.popperOffsets,q=e.rects.reference,P=e.rects.popper,z=typeof C=="function"?C(Object.assign({},e.rects,{placement:e.placement})):C,w=typeof z=="number"?{mainAxis:z,altAxis:z}:Object.assign({mainAxis:0,altAxis:0},z),R=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,U={x:0,y:0};if(I){if(o){var K,oe=E==="y"?Vr:jr,D=E==="y"?ki:xi,ae=E==="y"?"height":"width",ce=I[E],ve=ce+x[oe],ze=ce-x[D],qe=y?-P[ae]/2:0,yt=A===ec?q[ae]:P[ae],mt=A===ec?-P[ae]:-q[ae],_t=e.elements.arrow,bt=y&&_t?ww(_t):{width:0,height:0},Xe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:DN(),Ie=Xe[oe],Be=Xe[D],Ee=Of(0,q[ae],bt[ae]),Ze=L?q[ae]/2-qe-Ee-Ie-w.mainAxis:yt-Ee-Ie-w.mainAxis,Ke=L?-q[ae]/2+qe+Ee+Be+w.mainAxis:mt+Ee+Be+w.mainAxis,Fe=e.elements.arrow&&Hd(e.elements.arrow),at=Fe?E==="y"?Fe.clientTop||0:Fe.clientLeft||0:0,ie=(K=R==null?void 0:R[E])!=null?K:0,te=ce+Ze-ie-at,be=ce+Ke-ie,_e=Of(y?Ym(ve,te):ve,ce,y?al(ze,be):ze);I[E]=_e,U[E]=_e-ce}if(l){var xe,G=E==="x"?Vr:jr,Z=E==="x"?ki:xi,N=I[H],W=H==="y"?"height":"width",O=N+x[G],j=N-x[Z],F=[Vr,jr].indexOf(k)!==-1,Q=(xe=R==null?void 0:R[H])!=null?xe:0,le=F?O:N-q[W]-P[W]-Q+w.altAxis,pe=F?N+q[W]+P[W]-Q-w.altAxis:j,ye=y&&F?pZ(le,N,pe):Of(y?le:O,N,y?pe:j);I[H]=ye,U[H]=ye-N}e.modifiersData[r]=U}}const UZ={name:"preventOverflow",enabled:!0,phase:"main",fn:WZ,requiresIfExists:["offset"]};function qZ(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function KZ(t){return t===Si(t)||!_i(t)?xw(t):qZ(t)}function GZ(t){var e=t.getBoundingClientRect(),n=tc(e.width)/t.offsetWidth||1,r=tc(e.height)/t.offsetHeight||1;return n!==1||r!==1}function YZ(t,e,n){n===void 0&&(n=!1);var r=_i(e),i=_i(e)&&GZ(e),o=ga(e),s=nc(t,i,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((wo(e)!=="body"||Cw(o))&&(l=KZ(e)),_i(e)?(u=nc(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):o&&(u.x=Sw(o))),{x:s.left+l.scrollLeft-u.x,y:s.top+l.scrollTop-u.y,width:s.width,height:s.height}}function JZ(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var u=e.get(l);u&&i(u)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function XZ(t){var e=JZ(t);return uZ.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function ZZ(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function QZ(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var VT={placement:"bottom",modifiers:[],strategy:"absolute"};function jT(){for(var t=arguments.length,e=new Array(t),n=0;n-1}function WN(t,e){return typeof t=="function"?t.apply(void 0,e):t}function WT(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function oQ(t){return t.split(/\s+/).filter(Boolean)}function fu(t){return[].concat(t)}function UT(t,e){t.indexOf(e)===-1&&t.push(e)}function sQ(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function aQ(t){return t.split("-")[0]}function Jm(t){return[].slice.call(t)}function qT(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Nf(){return document.createElement("div")}function iv(t){return["Element","Fragment"].some(function(e){return Tw(t,e)})}function lQ(t){return Tw(t,"NodeList")}function uQ(t){return Tw(t,"MouseEvent")}function cQ(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function fQ(t){return iv(t)?[t]:lQ(t)?Jm(t):Array.isArray(t)?t:Jm(document.querySelectorAll(t))}function r0(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function KT(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function dQ(t){var e,n=fu(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function hQ(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,l=i.props,u=l.interactiveBorder,f=aQ(s.placement),d=s.modifiersData.offset;if(!d)return!0;var m=f==="bottom"?d.top.y:0,v=f==="top"?d.bottom.y:0,y=f==="right"?d.left.x:0,_=f==="left"?d.right.x:0,C=o.top-r+m>u,x=r-o.bottom-v>u,k=o.left-n+y>u,A=n-o.right-_>u;return C||x||k||A})}function i0(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function GT(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var ao={isTouch:!1},YT=0;function pQ(){ao.isTouch||(ao.isTouch=!0,window.performance&&document.addEventListener("mousemove",UN))}function UN(){var t=performance.now();t-YT<20&&(ao.isTouch=!1,document.removeEventListener("mousemove",UN)),YT=t}function mQ(){var t=document.activeElement;if(cQ(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function gQ(){document.addEventListener("touchstart",pQ,Da),window.addEventListener("blur",mQ)}var vQ=typeof window<"u"&&typeof document<"u",yQ=vQ?!!window.msCrypto:!1,bQ={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},_Q={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},zi=Object.assign({appendTo:jN,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},bQ,_Q),wQ=Object.keys(zi),kQ=function(e){var n=Object.keys(e);n.forEach(function(r){zi[r]=e[r]})};function qN(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var l;r[o]=t[o]!==void 0?t[o]:(l=zi[o])!=null?l:s}return r},{});return Object.assign({},t,n)}function xQ(t,e){var n=e?Object.keys(qN(Object.assign({},zi,{plugins:e}))):wQ,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function JT(t,e){var n=Object.assign({},e,{content:WN(e.content,[t])},e.ignoreAttributes?{}:xQ(t,e.plugins));return n.aria=Object.assign({},zi.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var SQ=function(){return"innerHTML"};function t1(t,e){t[SQ()]=e}function XT(t){var e=Nf();return t===!0?e.className=FN:(e.className=VN,iv(t)?e.appendChild(t):t1(e,t)),e}function ZT(t,e){iv(e.content)?(t1(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?t1(t,e.content):t.textContent=e.content)}function n1(t){var e=t.firstElementChild,n=Jm(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(HN)}),arrow:n.find(function(r){return r.classList.contains(FN)||r.classList.contains(VN)}),backdrop:n.find(function(r){return r.classList.contains(iQ)})}}function KN(t){var e=Nf(),n=Nf();n.className=rQ,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Nf();r.className=HN,r.setAttribute("data-state","hidden"),ZT(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var l=n1(e),u=l.box,f=l.content,d=l.arrow;s.theme?u.setAttribute("data-theme",s.theme):u.removeAttribute("data-theme"),typeof s.animation=="string"?u.setAttribute("data-animation",s.animation):u.removeAttribute("data-animation"),s.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?u.setAttribute("role",s.role):u.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&ZT(f,t.props),s.arrow?d?o.arrow!==s.arrow&&(u.removeChild(d),u.appendChild(XT(s.arrow))):u.appendChild(XT(s.arrow)):d&&u.removeChild(d)}return{popper:e,onUpdate:i}}KN.$$tippy=!0;var CQ=1,ip=[],o0=[];function TQ(t,e){var n=JT(t,Object.assign({},zi,qN(qT(e)))),r,i,o,s=!1,l=!1,u=!1,f=!1,d,m,v,y=[],_=WT(te,n.interactiveDebounce),C,x=CQ++,k=null,A=sQ(n.plugins),L={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},E={id:x,reference:t,popper:Nf(),popperInstance:k,props:n,state:L,plugins:A,clearDelayTimeouts:le,setProps:pe,setContent:ye,show:Y,hide:X,hideWithInteractivity:de,enable:F,disable:Q,unmount:Te,destroy:je};if(!n.render)return E;var H=n.render(E),I=H.popper,q=H.onUpdate;I.setAttribute("data-tippy-root",""),I.id="tippy-"+E.id,E.popper=I,t._tippy=E,I._tippy=E;var P=A.map(function(he){return he.fn(E)}),z=t.hasAttribute("aria-expanded");return Fe(),qe(),ce(),ve("onCreate",[E]),n.showOnCreate&&O(),I.addEventListener("mouseenter",function(){E.props.interactive&&E.state.isVisible&&E.clearDelayTimeouts()}),I.addEventListener("mouseleave",function(){E.props.interactive&&E.props.trigger.indexOf("mouseenter")>=0&&oe().addEventListener("mousemove",_)}),E;function w(){var he=E.props.touch;return Array.isArray(he)?he:[he,0]}function R(){return w()[0]==="hold"}function U(){var he;return!!((he=E.props.render)!=null&&he.$$tippy)}function K(){return C||t}function oe(){var he=K().parentNode;return he?dQ(he):document}function D(){return n1(I)}function ae(he){return E.state.isMounted&&!E.state.isVisible||ao.isTouch||d&&d.type==="focus"?0:n0(E.props.delay,he?0:1,zi.delay)}function ce(he){he===void 0&&(he=!1),I.style.pointerEvents=E.props.interactive&&!he?"":"none",I.style.zIndex=""+E.props.zIndex}function ve(he,Ae,Ne){if(Ne===void 0&&(Ne=!0),P.forEach(function(Je){Je[he]&&Je[he].apply(Je,Ae)}),Ne){var me;(me=E.props)[he].apply(me,Ae)}}function ze(){var he=E.props.aria;if(he.content){var Ae="aria-"+he.content,Ne=I.id,me=fu(E.props.triggerTarget||t);me.forEach(function(Je){var ct=Je.getAttribute(Ae);if(E.state.isVisible)Je.setAttribute(Ae,ct?ct+" "+Ne:Ne);else{var ot=ct&&ct.replace(Ne,"").trim();ot?Je.setAttribute(Ae,ot):Je.removeAttribute(Ae)}})}}function qe(){if(!(z||!E.props.aria.expanded)){var he=fu(E.props.triggerTarget||t);he.forEach(function(Ae){E.props.interactive?Ae.setAttribute("aria-expanded",E.state.isVisible&&Ae===K()?"true":"false"):Ae.removeAttribute("aria-expanded")})}}function yt(){oe().removeEventListener("mousemove",_),ip=ip.filter(function(he){return he!==_})}function mt(he){if(!(ao.isTouch&&(u||he.type==="mousedown"))){var Ae=he.composedPath&&he.composedPath()[0]||he.target;if(!(E.props.interactive&>(I,Ae))){if(fu(E.props.triggerTarget||t).some(function(Ne){return GT(Ne,Ae)})){if(ao.isTouch||E.state.isVisible&&E.props.trigger.indexOf("click")>=0)return}else ve("onClickOutside",[E,he]);E.props.hideOnClick===!0&&(E.clearDelayTimeouts(),E.hide(),l=!0,setTimeout(function(){l=!1}),E.state.isMounted||Ie())}}}function _t(){u=!0}function bt(){u=!1}function Xe(){var he=oe();he.addEventListener("mousedown",mt,!0),he.addEventListener("touchend",mt,Da),he.addEventListener("touchstart",bt,Da),he.addEventListener("touchmove",_t,Da)}function Ie(){var he=oe();he.removeEventListener("mousedown",mt,!0),he.removeEventListener("touchend",mt,Da),he.removeEventListener("touchstart",bt,Da),he.removeEventListener("touchmove",_t,Da)}function Be(he,Ae){Ze(he,function(){!E.state.isVisible&&I.parentNode&&I.parentNode.contains(I)&&Ae()})}function Ee(he,Ae){Ze(he,Ae)}function Ze(he,Ae){var Ne=D().box;function me(Je){Je.target===Ne&&(i0(Ne,"remove",me),Ae())}if(he===0)return Ae();i0(Ne,"remove",m),i0(Ne,"add",me),m=me}function Ke(he,Ae,Ne){Ne===void 0&&(Ne=!1);var me=fu(E.props.triggerTarget||t);me.forEach(function(Je){Je.addEventListener(he,Ae,Ne),y.push({node:Je,eventType:he,handler:Ae,options:Ne})})}function Fe(){R()&&(Ke("touchstart",ie,{passive:!0}),Ke("touchend",be,{passive:!0})),oQ(E.props.trigger).forEach(function(he){if(he!=="manual")switch(Ke(he,ie),he){case"mouseenter":Ke("mouseleave",be);break;case"focus":Ke(yQ?"focusout":"blur",_e);break;case"focusin":Ke("focusout",_e);break}})}function at(){y.forEach(function(he){var Ae=he.node,Ne=he.eventType,me=he.handler,Je=he.options;Ae.removeEventListener(Ne,me,Je)}),y=[]}function ie(he){var Ae,Ne=!1;if(!(!E.state.isEnabled||xe(he)||l)){var me=((Ae=d)==null?void 0:Ae.type)==="focus";d=he,C=he.currentTarget,qe(),!E.state.isVisible&&uQ(he)&&ip.forEach(function(Je){return Je(he)}),he.type==="click"&&(E.props.trigger.indexOf("mouseenter")<0||s)&&E.props.hideOnClick!==!1&&E.state.isVisible?Ne=!0:O(he),he.type==="click"&&(s=!Ne),Ne&&!me&&j(he)}}function te(he){var Ae=he.target,Ne=K().contains(Ae)||I.contains(Ae);if(!(he.type==="mousemove"&&Ne)){var me=W().concat(I).map(function(Je){var ct,ot=Je._tippy,Tt=(ct=ot.popperInstance)==null?void 0:ct.state;return Tt?{popperRect:Je.getBoundingClientRect(),popperState:Tt,props:n}:null}).filter(Boolean);hQ(me,he)&&(yt(),j(he))}}function be(he){var Ae=xe(he)||E.props.trigger.indexOf("click")>=0&&s;if(!Ae){if(E.props.interactive){E.hideWithInteractivity(he);return}j(he)}}function _e(he){E.props.trigger.indexOf("focusin")<0&&he.target!==K()||E.props.interactive&&he.relatedTarget&&I.contains(he.relatedTarget)||j(he)}function xe(he){return ao.isTouch?R()!==he.type.indexOf("touch")>=0:!1}function G(){Z();var he=E.props,Ae=he.popperOptions,Ne=he.placement,me=he.offset,Je=he.getReferenceClientRect,ct=he.moveTransition,ot=U()?n1(I).arrow:null,Tt=Je?{getBoundingClientRect:Je,contextElement:Je.contextElement||K()}:t,br={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Gt){var Kn=Gt.state;if(U()){var Gr=D(),Yr=Gr.box;["placement","reference-hidden","escaped"].forEach(function(Sn){Sn==="placement"?Yr.setAttribute("data-placement",Kn.placement):Kn.attributes.popper["data-popper-"+Sn]?Yr.setAttribute("data-"+Sn,""):Yr.removeAttribute("data-"+Sn)}),Kn.attributes.popper={}}}},Kt=[{name:"offset",options:{offset:me}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ct}},br];U()&&ot&&Kt.push({name:"arrow",options:{element:ot,padding:3}}),Kt.push.apply(Kt,(Ae==null?void 0:Ae.modifiers)||[]),E.popperInstance=nQ(Tt,I,Object.assign({},Ae,{placement:Ne,onFirstUpdate:v,modifiers:Kt}))}function Z(){E.popperInstance&&(E.popperInstance.destroy(),E.popperInstance=null)}function N(){var he=E.props.appendTo,Ae,Ne=K();E.props.interactive&&he===jN||he==="parent"?Ae=Ne.parentNode:Ae=WN(he,[Ne]),Ae.contains(I)||Ae.appendChild(I),E.state.isMounted=!0,G()}function W(){return Jm(I.querySelectorAll("[data-tippy-root]"))}function O(he){E.clearDelayTimeouts(),he&&ve("onTrigger",[E,he]),Xe();var Ae=ae(!0),Ne=w(),me=Ne[0],Je=Ne[1];ao.isTouch&&me==="hold"&&Je&&(Ae=Je),Ae?r=setTimeout(function(){E.show()},Ae):E.show()}function j(he){if(E.clearDelayTimeouts(),ve("onUntrigger",[E,he]),!E.state.isVisible){Ie();return}if(!(E.props.trigger.indexOf("mouseenter")>=0&&E.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(he.type)>=0&&s)){var Ae=ae(!1);Ae?i=setTimeout(function(){E.state.isVisible&&E.hide()},Ae):o=requestAnimationFrame(function(){E.hide()})}}function F(){E.state.isEnabled=!0}function Q(){E.hide(),E.state.isEnabled=!1}function le(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function pe(he){if(!E.state.isDestroyed){ve("onBeforeUpdate",[E,he]),at();var Ae=E.props,Ne=JT(t,Object.assign({},Ae,qT(he),{ignoreAttributes:!0}));E.props=Ne,Fe(),Ae.interactiveDebounce!==Ne.interactiveDebounce&&(yt(),_=WT(te,Ne.interactiveDebounce)),Ae.triggerTarget&&!Ne.triggerTarget?fu(Ae.triggerTarget).forEach(function(me){me.removeAttribute("aria-expanded")}):Ne.triggerTarget&&t.removeAttribute("aria-expanded"),qe(),ce(),q&&q(Ae,Ne),E.popperInstance&&(G(),W().forEach(function(me){requestAnimationFrame(me._tippy.popperInstance.forceUpdate)})),ve("onAfterUpdate",[E,he])}}function ye(he){E.setProps({content:he})}function Y(){var he=E.state.isVisible,Ae=E.state.isDestroyed,Ne=!E.state.isEnabled,me=ao.isTouch&&!E.props.touch,Je=n0(E.props.duration,0,zi.duration);if(!(he||Ae||Ne||me)&&!K().hasAttribute("disabled")&&(ve("onShow",[E],!1),E.props.onShow(E)!==!1)){if(E.state.isVisible=!0,U()&&(I.style.visibility="visible"),ce(),Xe(),E.state.isMounted||(I.style.transition="none"),U()){var ct=D(),ot=ct.box,Tt=ct.content;r0([ot,Tt],0)}v=function(){var Kt;if(!(!E.state.isVisible||f)){if(f=!0,I.offsetHeight,I.style.transition=E.props.moveTransition,U()&&E.props.animation){var Xt=D(),Gt=Xt.box,Kn=Xt.content;r0([Gt,Kn],Je),KT([Gt,Kn],"visible")}ze(),qe(),UT(o0,E),(Kt=E.popperInstance)==null||Kt.forceUpdate(),ve("onMount",[E]),E.props.animation&&U()&&Ee(Je,function(){E.state.isShown=!0,ve("onShown",[E])})}},N()}}function X(){var he=!E.state.isVisible,Ae=E.state.isDestroyed,Ne=!E.state.isEnabled,me=n0(E.props.duration,1,zi.duration);if(!(he||Ae||Ne)&&(ve("onHide",[E],!1),E.props.onHide(E)!==!1)){if(E.state.isVisible=!1,E.state.isShown=!1,f=!1,s=!1,U()&&(I.style.visibility="hidden"),yt(),Ie(),ce(!0),U()){var Je=D(),ct=Je.box,ot=Je.content;E.props.animation&&(r0([ct,ot],me),KT([ct,ot],"hidden"))}ze(),qe(),E.props.animation?U()&&Be(me,E.unmount):E.unmount()}}function de(he){oe().addEventListener("mousemove",_),UT(ip,_),_(he)}function Te(){E.state.isVisible&&E.hide(),E.state.isMounted&&(Z(),W().forEach(function(he){he._tippy.unmount()}),I.parentNode&&I.parentNode.removeChild(I),o0=o0.filter(function(he){return he!==E}),E.state.isMounted=!1,ve("onHidden",[E]))}function je(){E.state.isDestroyed||(E.clearDelayTimeouts(),E.unmount(),at(),delete t._tippy,E.state.isDestroyed=!0,ve("onDestroy",[E]))}}function Kr(t,e){e===void 0&&(e={});var n=zi.plugins.concat(e.plugins||[]);gQ();var r=Object.assign({},e,{plugins:n}),i=fQ(t),o=i.reduce(function(s,l){var u=l&&TQ(l,r);return u&&s.push(u),s},[]);return iv(t)?o[0]:o}Kr.defaultProps=zi;Kr.setDefaultProps=kQ;Kr.currentInput=ao;Object.assign({},LN,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});Kr.setDefaultProps({render:KN});function QT(t){return I1((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class EQ extends lN{constructor(e={}){return super(e),this.vueRenderers=Al(new Map),this.contentComponent=null,this.reactiveState=QT(this.view.state),this.reactiveExtensionStorage=QT(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),fa(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){super.registerPlugin(e,n),this.reactiveState.value=this.view.state}unregisterPlugin(e){super.unregisterPlugin(e),this.reactiveState.value=this.view.state}}const AQ=Vn({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=Ot(),n=qi();return lO(()=>{const r=t.editor;r&&r.options.element&&e.value&&Ri(()=>{if(!e.value||!r.options.element.firstChild)return;const i=fr(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,r.setOptions({element:i}),r.createNodeViews()})}),Ml(()=>{const r=t.editor;if(!r||(r.isDestroyed||r.view.setProps({nodeViews:{}}),r.contentComponent=null,!r.options.element.firstChild))return;const i=document.createElement("div");i.append(...r.options.element.childNodes),r.setOptions({element:i})}),{rootEl:e}},render(){const t=[];return this.editor&&this.editor.vueRenderers.forEach(e=>{const n=mr(zO,{to:e.teleportElement,key:e.id},mr(e.component,{ref:e.id,...e.props}));t.push(n)}),mr("div",{ref:e=>{this.rootEl=e}},...t)}}),Ew=Vn({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return mr(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))}});class GN{constructor(e,{props:n={},editor:r}){if(this.id=Math.floor(Math.random()*4294967295).toString(),this.editor=r,this.component=fa(e),this.teleportElement=document.createElement("div"),this.element=this.teleportElement,this.props=Al(n),this.editor.vueRenderers.set(this.id,this),this.editor.contentComponent){if(this.editor.contentComponent.update(),this.teleportElement.children.length!==1)throw Error("VueRenderer doesn’t support multiple child elements.");this.element=this.teleportElement.firstElementChild}}get ref(){var e;return(e=this.editor.contentComponent)===null||e===void 0?void 0:e.refs[this.id]}updateProps(e={}){Object.entries(e).forEach(([n,r])=>{this.props[n]=r})}destroy(){this.editor.vueRenderers.delete(this.id)}}class OQ extends uN{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(i={})=>this.updateAttributes(i),deleteNode:()=>this.deleteNode()},n=this.onDragStart.bind(this);this.decorationClasses=Ot(this.getDecorationClasses());const r=Vn({extends:{...this.component},props:Object.keys(e),template:this.component.template,setup:i=>{var o,s;return Up("onDragStart",n),Up("decorationClasses",this.decorationClasses),(s=(o=this.component).setup)===null||s===void 0?void 0:s.call(o,i,{expose:()=>{}})},__scopeId:this.component.__scopeId,__cssModules:this.component.__cssModules,__name:this.component.__name,__file:this.component.__file});this.renderer=new GN(r,{editor:this.editor,props:e})}get dom(){if(!this.renderer.element.hasAttribute("data-node-view-wrapper"))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.dom.querySelector("[data-node-view-content]")||this.dom}update(e,n){const r=i=>{this.decorationClasses.value=this.getDecorationClasses(),this.renderer.updateProps(i)};if(typeof this.options.update=="function"){const i=this.node,o=this.decorations;return this.node=e,this.decorations=n,this.options.update({oldNode:i,oldDecorations:o,newNode:e,newDecorations:n,updateProps:()=>r({node:e,decorations:n})})}return e.type!==this.node.type?!1:(e===this.node&&this.decorations===n||(this.node=e,this.decorations=n,r({node:e,decorations:n})),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}getDecorationClasses(){return this.decorations.map(e=>e.type.attrs.class).flat().join(" ")}destroy(){this.renderer.destroy()}}function Aw(t,e){return n=>n.editor.contentComponent?new OQ(t,n,e):{}}const Bt=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},MQ={name:"IframeView",components:{NodeViewWrapper:Ew},props:{editor:{type:Object,default:()=>{}},node:{type:Object,default:()=>{}},decorations:{type:Array,default:()=>[]},selected:{type:Boolean,default:!1},extension:{type:Object,default:()=>{}},getPos:{type:Function,default:()=>{}},updateAttributes:{type:Function,default:()=>{}}}},NQ={class:"vui-iframe-wrap"},LQ=["src"];function IQ(t,e,n,r,i,o){const s=ut("node-view-wrapper");return ge(),Ct(s,{class:vt(["vui-iframe",{selected:n.selected}])},{default:Vt(()=>[re("div",NQ,[re("iframe",wi(n.node.attrs,{src:n.node.attrs.url}),null,16,LQ)])]),_:1},8,["class"])}const PQ=Bt(MQ,[["render",IQ]]),DQ=_n.create({name:"iframe",group:"block",atom:!0,addAttributes(){return{url:{default:null},frameborder:{default:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen}}},parseHTML(){return[{tag:"iframe"}]},renderHTML({HTMLAttributes:t}){return["iframe",t]},addNodeView(){return Aw(PQ)},addCommands(){return{setIframe:t=>({tr:e,dispatch:n})=>{const{selection:r}=e,i=this.type.create(t);return n&&e.replaceRangeWith(r.from,r.to,i),!0}}},addProseMirrorPlugins(){return[new on({key:new xn("handleClick"),props:{handleClick:(t,e,n)=>{n.target.classList.contains("vui-iframe")&&setTimeout(()=>{this.editor.emit("vui:iframe-clicked",n)},50)}}})]}}),YN=(t="")=>{try{const e=new URL(t);return e!==null&&e.protocol.startsWith("http")}catch{return!1}},r1=t=>new URL(t).host.replace("www.",""),JN=fetch,RQ=async(t,e={})=>{const{target:n,headers:r={}}=e;return await JN(n+encodeURIComponent(t),{headers:r})},zQ=async(t,e={})=>{const{headers:n={"user-agent":"Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0"},proxy:r=null}=e,i=r?await RQ(t,r):await JN(t,{headers:n}),o=i.status;if(o>=400)throw new Error(`Request failed with error code ${o}`);try{const s=await i.text();return JSON.parse(s.trim())}catch{throw new Error("Failed to convert data to JSON object")}},BQ=t=>r1(t)==="graph.facebook.com",$Q=()=>{const t=process.env||{},e=t.FACEBOOK_APP_ID,n=t.FACEBOOK_CLIENT_TOKEN;return`${e}|${n}`},HQ=async(t,e={},n="",r={})=>{const i={url:t,format:"json",...e};i.maxwidth<=0&&delete i.maxwidth,i.maxheight<=0&&delete i.maxheight,BQ(n)&&(i.access_token=$Q());const o=new URLSearchParams(i).toString(),s=n+"?"+o;return zQ(s,r)},FQ=[{s:["www\\.23hq\\.com/*/photo/*"],e:"www.23hq.com/23/oembed"},{s:["store\\.abraia\\.me/*"],e:"api.abraia.me/oembed"},{s:["play\\.acast\\.com/s/*"],e:"oembed.acast.com/v1/embed-player"},{s:["secure\\.actblue\\.com/donate/*"],e:"secure.actblue.com/cf/oembed"},{s:["adilo\\.bigcommand\\.com/watch/*"],e:"adilo.bigcommand.com/web/oembed"},{s:["v\\.afree\\.ca/ST/","vod\\.afreecatv\\.com/ST/","vod\\.afreecatv\\.com/PLAYER/STATION/","play\\.afreecatv\\.com/"],e:"openapi.afreecatv.com/oembed/embedinfo"},{s:["altium\\.com/viewer/*"],e:"viewer.altium.com/shell/oembed"},{s:["app\\.altrulabs\\.com/*/*?answer_id=*","app\\.altrulabs\\.com/player/*"],e:"api.altrulabs.com/api/v1/social/oembed"},{s:["live\\.amcharts\\.com/*"],e:"live.amcharts.com/oembed"},{s:["amtraker\\.com/trains/*","beta\\.amtraker\\.com/trains/*"],e:"api.amtraker.com/v2/oembed"},{s:["www\\.animatron\\.com/project/*","animatron\\.com/project/*"],e:"animatron.com/oembed/json"},{s:["animoto\\.com/play/*"],e:"animoto.com/oembeds/create"},{s:["anniemusic\\.app/t/*","anniemusic\\.app/p/*"],e:"api.anniemusic.app/api/v1/oembed"},{s:["storymaps\\.arcgis\\.com/stories/*"],e:"storymaps.arcgis.com/oembed"},{s:["app\\.archivos\\.digital/app/view/*"],e:"app.archivos.digital/oembed/"},{s:["audioboom\\.com/channels/*","audioboom\\.com/channel/*","audioboom\\.com/playlists/*","audioboom\\.com/podcasts/*","audioboom\\.com/podcast/*","audioboom\\.com/posts/*","audioboom\\.com/episodes/*"],e:"audioboom.com/publishing/oembed.json"},{s:["audioclip\\.naver\\.com/channels/*/clips/*","audioclip\\.naver\\.com/audiobooks/*"],e:"audioclip.naver.com/oembed"},{s:["audiomack\\.com/*/song/*","audiomack\\.com/*/album/*","audiomack\\.com/*/playlist/*"],e:"audiomack.com/oembed"},{s:["podcasts\\.audiomeans\\.fr/*"],e:"podcasts.audiomeans.fr/services/oembed"},{s:["app\\.avocode\\.com/view/*"],e:"stage-embed.avocode.com/api/oembed"},{s:["backtracks\\.fm/*/*/e/*","backtracks\\.fm/*/s/*/*","backtracks\\.fm/*/*/*/*/e/*/*","backtracks\\.fm/*"],e:"backtracks.fm/oembed"},{s:["beams\\.fm/*"],e:"api.beams.fm/oEmbed"},{s:[],e:"www.beautiful.ai/api/oembed"},{s:["blackfire\\.io/profiles/*/graph","blackfire\\.io/profiles/compare/*/graph"],e:"blackfire.io/oembed"},{s:["blogcast\\.host/embed/*","blogcast\\.host/embedly/*"],e:"blogcast.host/oembed"},{s:["www\\.bookingmood\\.com/embed/*/*"],e:"bookingmood.com/api/oembed"},{s:[],e:"boxofficebuz.com/oembed"},{s:["view\\.briovr\\.com/api/v1/worlds/oembed/*"],e:"view.briovr.com/api/v1/worlds/oembed/"},{s:["www\\.bumper\\.com/oembed/bumper","www\\.bumper\\.com/oembed-s/bumper"],e:"www.bumper.com/oembed/bumper"},{s:["buttondown\\.email/*"],e:"buttondown.email/embed"},{s:["cmc\\.byzart\\.eu/files/*"],e:"cmc.byzart.eu/oembed/"},{s:["cacoo\\.com/diagrams/*"],e:"cacoo.com/oembed.json"},{s:["minesweeper\\.today/*"],e:"minesweeper.today/api/oembed"},{s:["img\\.catbo\\.at/*"],e:"img.catbo.at/oembed.json"},{s:["view\\.ceros\\.com/*"],e:"view.ceros.com/oembed"},{s:["chainflix\\.net/video/*","chainflix\\.net/video/embed/*","*\\.chainflix\\.net/video/*","*\\.chainflix\\.net/video/embed/*"],e:"www.chainflix.net/video/oembed"},{s:["public\\.chartblocks\\.com/c/*"],e:"embed.chartblocks.com/1.0/oembed"},{s:["chirb\\.it/*"],e:"chirb.it/oembed.json"},{s:["chroco\\.ooo/mypage/*","chroco\\.ooo/story/*"],e:"chroco.ooo/embed"},{s:["www\\.circuitlab\\.com/circuit/*"],e:"www.circuitlab.com/circuit/oembed/"},{s:["www\\.clipland\\.com/v/*"],e:"www.clipland.com/api/oembed"},{s:["clyp\\.it/*","clyp\\.it/playlist/*"],e:"api.clyp.it/oembed/"},{s:["app\\.ilovecoco\\.video/*/embed"],e:"app.ilovecoco.video/api/oembed.json"},{s:["codehs\\.com/editor/share_abacus/*"],e:"codehs.com/api/sharedprogram/1/oembed/"},{s:["codepen\\.io/*"],e:"codepen.io/api/oembed"},{s:["codepoints\\.net/*","www\\.codepoints\\.net/*"],e:"codepoints.net/api/v1/oembed"},{s:["codesandbox\\.io/s/*","codesandbox\\.io/embed/*"],e:"codesandbox.io/oembed"},{s:["www\\.collegehumor\\.com/video/*"],e:"www.collegehumor.com/oembed.json"},{s:["commaful\\.com/play/*"],e:"commaful.com/api/oembed/"},{s:["coub\\.com/view/*","coub\\.com/embed/*"],e:"coub.com/api/oembed.json"},{s:["crowdranking\\.com/*/*"],e:"crowdranking.com/api/oembed.json"},{s:["crumb\\.sh/*"],e:"crumb.sh/oembed/"},{s:["cueup\\.io/user/*/sounds/*"],e:"gql.cueup.io/oembed"},{s:["*\\.curated\\.co/*"],e:"api.curated.co/oembed"},{s:["app\\.customerdb\\.com/share/*"],e:"app.customerdb.com/embed"},{s:["app\\.dadan\\.io/*","stage\\.dadan\\.io/*"],e:"app.dadan.io/api/video/oembed"},{s:["www\\.dailymotion\\.com/video/*"],e:"www.dailymotion.com/services/oembed"},{s:["dalexni\\.com/i/*"],e:"dalexni.com/oembed/"},{s:["datawrapper\\.dwcdn\\.net/*"],e:"api.datawrapper.de/v3/oembed/"},{s:["*\\.deseret\\.com/*"],e:"embed.deseret.com/"},{s:["*\\.deviantart\\.com/art/*","*\\.deviantart\\.com/*#/d*","fav\\.me/*","sta\\.sh/*","*\\.deviantart\\.com/*/art/*",'sta\\.sh/*",','*\\.deviantart\\.com/*#/d*"'],e:"backend.deviantart.com/oembed"},{s:["www\\.ultimedia\\.com/central/video/edit/id/*/topic_id/*/","www\\.ultimedia\\.com/default/index/videogeneric/id/*/showtitle/1/viewnc/1","www\\.ultimedia\\.com/default/index/videogeneric/id/*"],e:"www.ultimedia.com/api/search/oembed"},{s:["*\\.docdroid\\.net/*","docdro\\.id/*","*\\.docdroid\\.com/*"],e:"www.docdroid.net/api/oembed"},{s:["docswell\\.com/*/*","www\\.docswell\\.com/*/*"],e:"www.docswell.com/service/oembed"},{s:["dotsub\\.com/view/*"],e:"dotsub.com/services/oembed"},{s:["www\\.dreambroker\\.com/channel/*/*"],e:"dreambroker.com/channel/oembed"},{s:["d\\.tube/v/*"],e:"api.d.tube/oembed"},{s:[],e:"www.edumedia-sciences.com/oembed.json"},{s:[],e:"www.edumedia-sciences.com/oembed.xml"},{s:["egliseinfo\\.catholique\\.fr/*"],e:"egliseinfo.catholique.fr/api/oembed"},{s:["embedery\\.com/widget/*"],e:"embedery.com/api/oembed"},{s:["music\\.enystre\\.com/lyrics/*"],e:"music.enystre.com/oembed"},{s:["ethfiddle\\.com/*"],e:"ethfiddle.com/services/oembed/"},{s:["evt\\.live/*","evt\\.live/*/*","live\\.eventlive\\.pro/*","live\\.eventlive\\.pro/*/*"],e:"evt.live/api/oembed"},{s:["app\\.everviz\\.com/embed/*"],e:"api.everviz.com/oembed"},{s:["app\\.ex\\.co/stories/*","www\\.playbuzz\\.com/*"],e:"oembed.ex.co/item"},{s:["eyrie\\.io/board/*","eyrie\\.io/sparkfun/*"],e:"eyrie.io/v1/oembed"},{s:["www\\.facebook\\.com/*/posts/*","www\\.facebook\\.com/*/activity/*","www\\.facebook\\.com/*/photos/*","www\\.facebook\\.com/photo\\.php?fbid=*","www\\.facebook\\.com/photos/*","www\\.facebook\\.com/permalink\\.php?story_fbid=*","www\\.facebook\\.com/media/set?set=*","www\\.facebook\\.com/questions/*","www\\.facebook\\.com/notes/*/*/*"],e:"graph.facebook.com/v10.0/oembed_post"},{s:["www\\.facebook\\.com/*/videos/*","www\\.facebook\\.com/video\\.php?id=*","www\\.facebook\\.com/video\\.php?v=*"],e:"graph.facebook.com/v10.0/oembed_video"},{s:["www\\.facebook\\.com/*"],e:"graph.facebook.com/v10.0/oembed_page"},{s:["app\\.getfader\\.com/projects/*/publish"],e:"app.getfader.com/api/oembed"},{s:["faithlifetv\\.com/items/*","faithlifetv\\.com/items/resource/*/*","faithlifetv\\.com/media/*","faithlifetv\\.com/media/assets/*","faithlifetv\\.com/media/resource/*/*"],e:"faithlifetv.com/api/oembed"},{s:["*\\.fireworktv\\.com/*","*\\.fireworktv\\.com/embed/*/v/*"],e:"www.fireworktv.com/oembed"},{s:["www\\.fite\\.tv/watch/*"],e:"www.fite.tv/oembed"},{s:["flat\\.io/score/*","*\\.flat\\.io/score/*"],e:"flat.io/services/oembed"},{s:["*\\.flickr\\.com/photos/*","flic\\.kr/p/*","*\\.*\\.flickr\\.com/*/*"],e:"www.flickr.com/services/oembed/"},{s:["public\\.flourish\\.studio/visualisation/*","public\\.flourish\\.studio/story/*"],e:"app.flourish.studio/api/v1/oembed"},{s:["fiso\\.foxsports\\.com\\.au/isomorphic-widget/*"],e:"fiso.foxsports.com.au/oembed"},{s:["framebuzz\\.com/v/*"],e:"framebuzz.com/oembed/"},{s:["framer\\.com/share/*","framer\\.com/embed/*"],e:"api.framer.com/web/oembed"},{s:["*\\.geograph\\.org\\.uk/*","*\\.geograph\\.co\\.uk/*","*\\.geograph\\.ie/*","*\\.wikimedia\\.org/*_geograph\\.org\\.uk_*"],e:"api.geograph.org.uk/api/oembed"},{s:["*\\.geograph\\.org\\.gg/*","*\\.geograph\\.org\\.je/*","channel-islands\\.geograph\\.org/*","channel-islands\\.geographs\\.org/*","*\\.channel\\.geographs\\.org/*"],e:"www.geograph.org.gg/api/oembed"},{s:["geo-en\\.hlipp\\.de/*","geo\\.hlipp\\.de/*","germany\\.geograph\\.org/*"],e:"geo.hlipp.de/restapi.php/api/oembed"},{s:["gty\\.im/*"],e:"embed.gettyimages.com/oembed"},{s:["gfycat\\.com/*","www\\.gfycat\\.com/*"],e:"api.gfycat.com/v1/oembed"},{s:["www\\.gifnote\\.com/play/*"],e:"www.gifnote.com/services/oembed"},{s:["giphy\\.com/gifs/*","giphy\\.com/clips/*","gph\\.is/*","media\\.giphy\\.com/media/*/giphy\\.gif"],e:"giphy.com/services/oembed"},{s:[],e:"gloria.tv/oembed/"},{s:["view\\.gmetri\\.com/*","*\\.gmetri\\.com/*"],e:"embed.gmetri.com/oembed/"},{s:["app\\.gong\\.io/call?id=*"],e:"app.gong.io/oembed"},{s:["grain\\.co/highlight/*","grain\\.co/share/*","grain\\.com/share/*"],e:"api.grain.com/_/api/oembed"},{s:["gtchannel\\.com/watch/*"],e:"api.luminery.com/oembed"},{s:["gyazo\\.com/*"],e:"api.gyazo.com/api/oembed"},{s:["core\\.hash\\.ai/@*"],e:"api.hash.ai/oembed"},{s:["hearthis\\.at/*/*/","hearthis\\.at/*/set/*/"],e:"hearthis.at/oembed/?format=json"},{s:["heyzine\\.com/flip-book/*","*\\.hflip\\.co/*","*\\.aflip\\.in/*"],e:"heyzine.com/api1/oembed"},{s:["player\\.hihaho\\.com/*"],e:"player.hihaho.com/services/oembed"},{s:["*\\.hippovideo\\.io/*"],e:"www.hippovideo.io/services/oembed"},{s:["homey\\.app/f/*","homey\\.app/*/flow/*"],e:"homey.app/api/oembed/flow"},{s:["huffduffer\\.com/*/*"],e:"huffduffer.com/oembed"},{s:["www\\.hulu\\.com/watch/*"],e:"www.hulu.com/api/oembed.json"},{s:["*\\.idomoo\\.com/*"],e:"oembed.idomoo.com/oembed"},{s:["www\\.ifixit\\.com/Guide/View/*"],e:"www.ifixit.com/Embed"},{s:["ifttt\\.com/recipes/*"],e:"www.ifttt.com/oembed/"},{s:["www\\.iheart\\.com/podcast/*/*"],e:"www.iheart.com/oembed"},{s:["qr\\.imenupro\\.com/*"],e:"qr.imenupro.com/api/oembed"},{s:["incredible\\.dev/watch/*"],e:"oembed.incredible.dev/oembed"},{s:["player\\.indacolive\\.com/player/jwp/clients/*"],e:"player.indacolive.com/services/oembed"},{s:["infogram\\.com/*"],e:"infogram.com/oembed"},{s:["*\\.infoveave\\.net/E/*","*\\.infoveave\\.net/P/*"],e:"infoveave.net/services/oembed/"},{s:["www\\.injurymap\\.com/exercises/*"],e:"www.injurymap.com/services/oembed"},{s:["www\\.inoreader\\.com/oembed/"],e:"www.inoreader.com/oembed/api/"},{s:["*\\.inphood\\.com/*"],e:"api.inphood.com/oembed"},{s:["instagram\\.com/*/p/*,","www\\.instagram\\.com/*/p/*,","instagram\\.com/p/*","instagr\\.am/p/*","www\\.instagram\\.com/p/*","www\\.instagr\\.am/p/*","instagram\\.com/tv/*","instagr\\.am/tv/*","www\\.instagram\\.com/tv/*","www\\.instagr\\.am/tv/*","www\\.instagram\\.com/reel/*","instagram\\.com/reel/*","instagr\\.am/reel/*"],e:"graph.facebook.com/v10.0/instagram_oembed"},{s:["ppa\\.insticator\\.com/embed-unit/*"],e:"www.insticator.com/oembed"},{s:["issuu\\.com/*/docs/*"],e:"issuu.com/oembed"},{s:["jovian\\.ml/*","jovian\\.ml/viewer*","*\\.jovian\\.ml/*","jovian\\.ai/*","jovian\\.ai/viewer*","*\\.jovian\\.ai/*","jovian\\.com/*","jovian\\.com/viewer*","*\\.jovian\\.com/*"],e:"api.jovian.com/oembed.json"},{s:["tv\\.kakao\\.com/channel/*/cliplink/*","tv\\.kakao\\.com/m/channel/*/cliplink/*","tv\\.kakao\\.com/channel/v/*","tv\\.kakao\\.com/channel/*/livelink/*","tv\\.kakao\\.com/m/channel/*/livelink/*","tv\\.kakao\\.com/channel/l/*"],e:"tv.kakao.com/oembed"},{s:["www\\.kickstarter\\.com/projects/*"],e:"www.kickstarter.com/services/oembed"},{s:["www\\.kidoju\\.com/en/x/*/*","www\\.kidoju\\.com/fr/x/*/*"],e:"www.kidoju.com/api/oembed"},{s:["halaman\\.email/form/*","aplikasi\\.kirim\\.email/form/*"],e:"halaman.email/service/oembed"},{s:["kit\\.co/*/*"],e:"embed.kit.co/oembed"},{s:["www\\.kitchenbowl\\.com/recipe/*"],e:"www.kitchenbowl.com/oembed"},{s:["app\\.kmdr\\.sh/h/*","app\\.kmdr\\.sh/history/*"],e:"api.kmdr.sh/services/oembed"},{s:["jdr\\.knacki\\.info/meuh/*"],e:"jdr.knacki.info/oembed"},{s:["knowledgepad\\.co/#/knowledge/*"],e:"api.spoonacular.com/knowledge/oembed"},{s:["*\\.kooapp\\.com/koo/*"],e:"embed.kooapp.com/services/oembed"},{s:["kurozora\\.app/episodes*","kurozora\\.app/songs*"],e:"kurozora.app/oembed"},{s:["learningapps\\.org/*"],e:"learningapps.org/oembed.php"},{s:["umotion-test\\.univ-lemans\\.fr/video/*"],e:"umotion-test.univ-lemans.fr/oembed"},{s:["pod\\.univ-lille\\.fr/video/*"],e:"pod.univ-lille.fr/video/oembed"},{s:["place\\.line\\.me/businesses/*"],e:"place.line.me/oembed"},{s:["livestream\\.com/accounts/*/events/*","livestream\\.com/accounts/*/events/*/videos/*","livestream\\.com/*/events/*","livestream\\.com/*/events/*/videos/*","livestream\\.com/*/*","livestream\\.com/*/*/videos/*"],e:"livestream.com/oembed"},{s:["lottiefiles\\.com/*","*\\.lottiefiles\\.com/*"],e:"embed.lottiefiles.com/oembed"},{s:["app\\.ludus\\.one/*"],e:"app.ludus.one/oembed"},{s:["*\\.lumiere\\.is/v/*"],e:"admin.lumiere.is/api/services/oembed"},{s:["mathembed\\.com/latex?inputText=*"],e:"mathembed.com/oembed"},{s:[],e:"my.matterport.com/api/v1/models/oembed/"},{s:["me\\.me/i/*"],e:"me.me/oembed"},{s:["mdstrm\\.com/embed/*","mdstrm\\.com/live-stream/*","mdstrm\\.com/image/*"],e:"mdstrm.com/oembed"},{s:["medienarchiv\\.zhdk\\.ch/entries/*"],e:"medienarchiv.zhdk.ch/oembed.json"},{s:["mermaid\\.ink/img/*","mermaid\\.ink/svg/*"],e:"mermaid.ink/services/oembed"},{s:["*\\.microsoftstream\\.com/video/*","*\\.microsoftstream\\.com/channel/*"],e:"web.microsoftstream.com/oembed"},{s:["www\\.minervaknows\\.com/featured-recipes/*","www\\.minervaknows\\.com/themes/*","www\\.minervaknows\\.com/themes/*/recipes/*","app\\.minervaknows\\.com/recipes/*","app\\.minervaknows\\.com/recipes/*/follow"],e:"oembed.minervaknows.com"},{s:["miro\\.com/app/board/*"],e:"miro.com/api/v1/oembed"},{s:["www\\.mixcloud\\.com/*/*/"],e:"www.mixcloud.com/oembed/"},{s:["mixpanel\\.com/*"],e:"mixpanel.com/api/app/embed/oembed/"},{s:["www\\.mobypicture\\.com/user/*/view/*","moby\\.to/*"],e:"api.mobypicture.com/oEmbed"},{s:["musicboxmaniacs\\.com/explore/melody/*"],e:"musicboxmaniacs.com/embed/"},{s:["mybeweeg\\.com/w/*"],e:"mybeweeg.com/services/oembed"},{s:["namchey\\.com/embeds/*"],e:"namchey.com/api/oembed"},{s:["*\\.nanoo\\.tv/link/*","nanoo\\.tv/link/*","*\\.nanoo\\.pro/link/*","nanoo\\.pro/link/*","media\\.zhdk\\.ch/signatur/*","new\\.media\\.zhdk\\.ch/signatur/*"],e:"www.nanoo.tv/services/oembed"},{s:["www\\.nb\\.no/items/*"],e:"api.nb.no/catalog/v1/oembed"},{s:["naturalatlas\\.com/*","naturalatlas\\.com/*/*","naturalatlas\\.com/*/*/*","naturalatlas\\.com/*/*/*/*"],e:"naturalatlas.com/oembed.json"},{s:["ndla\\.no/*"],e:"ndla.no/oembed"},{s:["liste\\.ndla\\.no/*"],e:"liste.ndla.no/oembed"},{s:["*\\.nfb\\.ca/film/*"],e:"www.nfb.ca/remote/services/oembed/"},{s:["nopaste\\.ml/*"],e:"oembed.nopaste.ml"},{s:["observablehq\\.com/@*/*","observablehq\\.com/d/*","observablehq\\.com/embed/*"],e:"api.observablehq.com/oembed"},{s:["www\\.odds\\.com\\.au/*","odds\\.com\\.au/*"],e:"www.odds.com.au/api/oembed/"},{s:["song\\.link/*","album\\.link/*","artist\\.link/*","playlist\\.link/*","pods\\.link/*","mylink\\.page/*","odesli\\.co/*"],e:"song.link/oembed"},{s:["odysee\\.com/*/*","odysee\\.com/*"],e:"odysee.com/$/oembed"},{s:["official\\.fm/tracks/*","official\\.fm/playlists/*"],e:"official.fm/services/oembed.json"},{s:["omniscope\\.me/*"],e:"omniscope.me/_global_/oembed/json"},{s:["omny\\.fm/shows/*"],e:"omny.fm/oembed"},{s:["orbitvu\\.co/001/*/ov3601/view","orbitvu\\.co/001/*/ov3601/*/view","orbitvu\\.co/001/*/ov3602/*/view","orbitvu\\.co/001/*/2/orbittour/*/view","orbitvu\\.co/001/*/1/2/orbittour/*/view"],e:"orbitvu.co/service/oembed"},{s:["outplayed\\.tv/media/*"],e:"outplayed.tv/oembed"},{s:["overflow\\.io/s/*","overflow\\.io/embed/*"],e:"overflow.io/services/oembed"},{s:["www\\.oz\\.com/*/video/*"],e:"core.oz.com/oembed"},{s:["padlet\\.com/*"],e:"padlet.com/oembed/"},{s:["*\\.tv\\.pandavideo\\.com\\.br/embed/?v=*","*\\.tv\\.pandavideo\\.com\\.br/*/playlist\\.m3u8","dashboard\\.pandavideo\\.com\\.br/#/videos/*"],e:"api-v2.pandavideo.com.br/oembed"},{s:["pastery\\.net/*","www\\.pastery\\.net/*"],e:"www.pastery.net/oembed"},{s:["www\\.picturelfy\\.com/p/*"],e:"api.picturelfy.com/service/oembed/"},{s:["*\\.builder\\.pikasso\\.xyz/embed/*"],e:"builder.pikasso.xyz/api/oembed"},{s:[],e:"beta.pingvp.com.kpnis.nl/p/oembed.php"},{s:["tools\\.pinpoll\\.com/embed/*"],e:"tools.pinpoll.com/oembed"},{s:["www\\.pinterest\\.com/*"],e:"www.pinterest.com/oembed.json"},{s:["player\\.pitchhub\\.com/en/public/player/*"],e:"player.pitchhub.com/en/public/oembed"},{s:["store\\.pixdor\\.com/place-marker-widget/*/show","store\\.pixdor\\.com/map/*/show"],e:"store.pixdor.com/oembed"},{s:["app\\.plusdocs\\.com/*/snapshots/*","app\\.plusdocs\\.com/*/pages/edit/*","app\\.plusdocs\\.com/*/pages/share/*"],e:"app.plusdocs.com/oembed"},{s:["*\\.podbean\\.com/e/*"],e:"api.podbean.com/v1/oembed"},{s:["*\\.polldaddy\\.com/s/*","*\\.polldaddy\\.com/poll/*","*\\.polldaddy\\.com/ratings/*"],e:"polldaddy.com/oembed/"},{s:["portfolium\\.com/entry/*"],e:"api.portfolium.com/oembed"},{s:["present\\.do/decks/*"],e:"gateway.cobalt.run/present/decks/oembed"},{s:["prezi\\.com/v/*","*\\.prezi\\.com/v/*"],e:"prezi.com/v/oembed"},{s:["qtpi\\.gg/fashion/*"],e:"qtpi.gg/fashion/oembed"},{s:["www\\.quiz\\.biz/quizz-*\\.html"],e:"www.quiz.biz/api/oembed"},{s:["www\\.quizz\\.biz/quizz-*\\.html"],e:"www.quizz.biz/api/oembed"},{s:["play\\.radiopublic\\.com/*","radiopublic\\.com/*","www\\.radiopublic\\.com/*","*\\.radiopublic\\.com/*"],e:"oembed.radiopublic.com/oembed"},{s:["raindrop\\.io/*","raindrop\\.io/*/*","raindrop\\.io/*/*/*","raindrop\\.io/*/*/*/*"],e:"pub.raindrop.io/api/oembed"},{s:["www\\.rcvis\\.com/v/*","www\\.rcvis\\.com/visualize=*","www\\.rcvis\\.com/ve/*","www\\.rcvis\\.com/visualizeEmbedded=*"],e:"animatron.com/oembed"},{s:["reddit\\.com/r/*/comments/*/*","www\\.reddit\\.com/r/*/comments/*/*"],e:"www.reddit.com/oembed"},{s:["rwire\\.com/*"],e:"publisher.releasewire.com/oembed/"},{s:["repl\\.it/@*/*","replit\\.com/@*/*"],e:"replit.com/data/oembed"},{s:["www\\.reverbnation\\.com/*","www\\.reverbnation\\.com/*/songs/*"],e:"www.reverbnation.com/oembed"},{s:["roomshare\\.jp/post/*","roomshare\\.jp/en/post/*"],e:"roomshare.jp/en/oembed.json"},{s:["roosterteeth\\.com/*"],e:"roosterteeth.com/oembed"},{s:[],e:"rumble.com/api/Media/oembed.json"},{s:["embed\\.runkit\\.com/*,"],e:"embed.runkit.com/oembed"},{s:["octopus\\.saooti\\.com/main/pub/podcast/*"],e:"octopus.saooti.com/oembed"},{s:["videos\\.sapo\\.pt/*"],e:"videos.sapo.pt/oembed"},{s:["console\\.screen9\\.com/*","*\\.screen9\\.tv/*"],e:"api.screen9.com/oembed"},{s:["www\\.screencast\\.com/*"],e:"api.screencast.com/external/oembed"},{s:["www\\.screenr\\.com/*/"],e:"www.screenr.com/api/oembed.json"},{s:["www\\.scribblemaps\\.com/maps/view/*","scribblemaps\\.com/maps/view/*"],e:"scribblemaps.com/api/services/oembed.json"},{s:["www\\.scribd\\.com/doc/*"],e:"www.scribd.com/services/oembed/"},{s:["embed\\.sendtonews\\.com/oembed/*"],e:"embed.sendtonews.com/services/oembed"},{s:["www\\.shortnote\\.jp/view/notes/*"],e:"www.shortnote.jp/oembed/"},{s:["shoudio\\.com/*","shoud\\.io/*"],e:"shoudio.com/api/oembed"},{s:["app\\.getshow\\.io/iframe/*","*\\.getshow\\.io/share/*"],e:"api.getshow.io/oembed.json"},{s:["showtheway\\.io/to/*"],e:"showtheway.io/oembed"},{s:["simplecast\\.com/s/*"],e:"simplecast.com/oembed"},{s:["onsizzle\\.com/i/*"],e:"onsizzle.com/oembed"},{s:["sketchfab\\.com/*models/*","sketchfab\\.com/*/folders/*"],e:"sketchfab.com/oembed"},{s:["www\\.slideshare\\.net/*/*","fr\\.slideshare\\.net/*/*","de\\.slideshare\\.net/*/*","es\\.slideshare\\.net/*/*","pt\\.slideshare\\.net/*/*"],e:"www.slideshare.net/api/oembed/2"},{s:["smashnotes\\.com/p/*","smashnotes\\.com/p/*/e/* - https://smashnotes\\.com/p/*/e/*/s/*"],e:"smashnotes.com/services/oembed"},{s:["open\\.smeme\\.com/*"],e:"open.smeme.com/api/oembed"},{s:["www\\.smrthi\\.com/book/*"],e:"www.smrthi.com/api/oembed"},{s:["*\\.smugmug\\.com/*"],e:"api.smugmug.com/services/oembed/"},{s:["www\\.socialexplorer\\.com/*/explore","www\\.socialexplorer\\.com/*/view","www\\.socialexplorer\\.com/*/edit","www\\.socialexplorer\\.com/*/embed"],e:"www.socialexplorer.com/services/oembed/"},{s:["soundcloud\\.com/*","on\\.soundcloud\\.com/*","soundcloud\\.app\\.goog\\.gl/*"],e:"soundcloud.com/oembed"},{s:["speakerdeck\\.com/*/*"],e:"speakerdeck.com/oembed.json"},{s:["open\\.spotify\\.com/*","spotify:*"],e:"open.spotify.com/oembed"},{s:["*\\.spotlightr\\.com/watch/*","*\\.spotlightr\\.com/publish/*","*\\.cdn\\.spotlightr\\.com/watch/*","*\\.cdn\\.spotlightr\\.com/publish/*"],e:"api.spotlightr.com/getOEmbed"},{s:["*\\.spreaker\\.com/*"],e:"api.spreaker.com/oembed"},{s:["sproutvideo\\.com/videos/*","*\\.vids\\.io/videos/*"],e:"sproutvideo.com/oembed.json"},{s:["purl\\.stanford\\.edu/*"],e:"purl.stanford.edu/embed.json"},{s:["streamable\\.com/*"],e:"api.streamable.com/oembed.json"},{s:["s3m\\.io/*","23m\\.io/*"],e:"streamio.com/api/v1/oembed"},{s:["subscribi\\.io/api/oembed*"],e:"subscribi.io/api/oembed"},{s:["www\\.sudomemo\\.net/watch/*","flipnot\\.es/*"],e:"www.sudomemo.net/oembed"},{s:["www\\.sutori\\.com/story/*"],e:"www.sutori.com/api/oembed"},{s:["sway\\.com/*","www\\.sway\\.com/*"],e:"sway.com/api/v1.0/oembed"},{s:["sway\\.office\\.com/*"],e:"sway.office.com/api/v1.0/oembed"},{s:["share\\.synthesia\\.io/*"],e:"69jr5v75rc.execute-api.eu-west-1.amazonaws.com/prod/v2/oembed"},{s:["ted\\.com/talks/*","www\\.ted\\.com/talks/*"],e:"www.ted.com/services/v1/oembed.json"},{s:["www\\.nytimes\\.com/svc/oembed","nytimes\\.com/*","*\\.nytimes\\.com/*"],e:"www.nytimes.com/svc/oembed/json/"},{s:["theysaidso\\.com/image/*"],e:"theysaidso.com/extensions/oembed/"},{s:["www\\.tickcounter\\.com/countdown/*","www\\.tickcounter\\.com/countup/*","www\\.tickcounter\\.com/ticker/*","www\\.tickcounter\\.com/worldclock/*"],e:"www.tickcounter.com/oembed"},{s:["www\\.tiktok\\.com/*","www\\.tiktok\\.com/*/video/*"],e:"www.tiktok.com/oembed"},{s:["www\\.toornament\\.com/tournaments/*/information","www\\.toornament\\.com/tournaments/*/registration/","www\\.toornament\\.com/tournaments/*/matches/schedule","www\\.toornament\\.com/tournaments/*/stages/*/"],e:"widget.toornament.com/oembed"},{s:["www\\.topy\\.se/image/*"],e:"www.topy.se/oembed/"},{s:["app-test\\.totango\\.com/*"],e:"app-test.totango.com/oembed"},{s:["trinitymedia\\.ai/player/*"],e:"trinitymedia.ai/player/trinity-oembed"},{s:["*\\.tumblr\\.com/post/*"],e:"www.tumblr.com/oembed/1.0"},{s:["www\\.tuxx\\.be/*"],e:"www.tuxx.be/services/oembed"},{s:["play\\.tvcf\\.co\\.kr/*","*\\.tvcf\\.co\\.kr/*"],e:"play.tvcf.co.kr/rest/oembed"},{s:["twinmotion\\.unrealengine\\.com/presentation/*","twinmotion\\.unrealengine\\.com/panorama/*"],e:"twinmotion.unrealengine.com/oembed"},{s:["twitter\\.com/*","twitter\\.com/*/status/*","*\\.twitter\\.com/*/status/*"],e:"publish.twitter.com/oembed"},{s:["play\\.typecast\\.ai/s/*","play\\.typecast\\.ai/e/*","play\\.typecast\\.ai/*"],e:"play.typecast.ai/oembed"},{s:[],e:"typlog.com/oembed"},{s:["uapod\\.univ-antilles\\.fr/video/*"],e:"uapod.univ-antilles.fr/oembed"},{s:["map\\.cam\\.ac\\.uk/*"],e:"map.cam.ac.uk/oembed/"},{s:["mediatheque\\.univ-paris1\\.fr/video/*"],e:"mediatheque.univ-paris1.fr/oembed"},{s:["pod\\.u-pec\\.fr/video/*"],e:"pod.u-pec.fr/oembed"},{s:["*\\.ustream\\.tv/*","*\\.ustream\\.com/*"],e:"www.ustream.tv/oembed"},{s:["*\\.ustudio\\.com/embed/*","*\\.ustudio\\.com/embed/*/*"],e:"app.ustudio.com/api/v2/oembed"},{s:["veer\\.tv/videos/*"],e:"api.veer.tv/oembed"},{s:["veervr\\.tv/videos/*"],e:"api.veervr.tv/oembed"},{s:["www\\.vevo\\.com/*"],e:"www.vevo.com/oembed"},{s:["videfit\\.com/videos/*"],e:"videfit.com/oembed"},{s:["vidmount\\.com/*"],e:"vidmount.com/oembed"},{s:["*\\.vidyard\\.com/*","*\\.hubs\\.vidyard\\.com/*"],e:"api.vidyard.com/dashboard/v1.1/oembed"},{s:["vimeo\\.com/*","vimeo\\.com/album/*/video/*","vimeo\\.com/channels/*/*","vimeo\\.com/groups/*/videos/*","vimeo\\.com/ondemand/*/*","player\\.vimeo\\.com/video/*"],e:"vimeo.com/api/oembed.json"},{s:["www\\.viously\\.com/*/*"],e:"www.viously.com/oembed"},{s:["vizydrop\\.com/shared/*"],e:"vizydrop.com/oembed"},{s:["vlipsy\\.com/*"],e:"vlipsy.com/oembed"},{s:["www\\.vlive\\.tv/video/*"],e:"www.vlive.tv/oembed"},{s:["*\\.vouchfor\\.com/*"],e:"embed.vouchfor.com/v1/oembed"},{s:["article\\.voxsnap\\.com/*/*"],e:"data.voxsnap.com/oembed"},{s:["waltrack\\.net/product/*"],e:"waltrack.net/oembed"},{s:["watch\\.wave\\.video/*","embed\\.wave\\.video/*"],e:"embed.wave.video/oembed"},{s:["play\\.wecandeo\\.com/video/v/*"],e:"play.wecandeo.com/oembed/"},{s:["whimsical\\.com/*"],e:"whimsical.com/api/oembed"},{s:["fast\\.wistia\\.com/embed/iframe/*","fast\\.wistia\\.com/embed/playlists/*","*\\.wistia\\.com/medias/*"],e:"fast.wistia.com/oembed.json"},{s:["*\\.wizer\\.me/learn/*","*\\.wizer\\.me/preview/*"],e:"app.wizer.me/api/oembed.json"},{s:["wokwi\\.com/share/*"],e:"wokwi.com/api/oembed"},{s:["*\\.wolframcloud\\.com/*"],e:"www.wolframcloud.com/oembed"},{s:["wordpress\\.com/*","*\\.wordpress\\.com/*","*\\.*\\.wordpress\\.com/*","wp\\.me/*"],e:"public-api.wordpress.com/oembed/"},{s:["*\\.youtube\\.com/watch*","*\\.youtube\\.com/v/*","youtu\\.be/*","*\\.youtube\\.com/playlist?list=*","youtube\\.com/playlist?list=*","*\\.youtube\\.com/shorts*"],e:"www.youtube.com/oembed"},{s:["app\\.zeplin\\.io/project/*/screen/*","app\\.zeplin\\.io/project/*/screen/*/version/*","app\\.zeplin\\.io/project/*/styleguide/components?coid=*","app\\.zeplin\\.io/styleguide/*/components?coid=*"],e:"app.zeplin.io/embed"},{s:["app\\.zingsoft\\.com/embed/*","app\\.zingsoft\\.com/view/*"],e:"app.zingsoft.com/oembed"},{s:["*\\.znipe\\.tv/*"],e:"api.znipe.tv/v3/oembed/"},{s:["srv2\\.zoomable\\.ca/viewer\\.php*"],e:"srv2.zoomable.ca/oembed"}],VQ=(t="")=>new RegExp(t.replace(/\\./g,".").replace(/\*/g,"(.*)").replace(/\?/g,"\\?").replace(/,$/g,""),"i"),jQ=(t=[])=>t.map(e=>{const{e:n,s:r}=e;return{endpoint:`https://${n}`,schemes:r.map(VQ)}}),WQ={providers:jQ(FQ)},UQ=()=>[...WQ.providers],qQ=(t="",e="",n=[])=>{if(!n.length){const r=r1(t),i=r1(e);return r===i}return n.some(r=>t.match(r))},KQ=(t="")=>{if(!YN(t))return null;const e=UQ();for(let n=0;n{const e=KQ(t);return e?e.endpoint:null},YQ=async(t,e={},n={})=>{if(!YN(t))throw new Error("Invalid input URL");const r=GQ(t);if(!r)throw new Error(`No provider found with given url "${t}"`);return await HQ(t,e,r,n)},JQ=function(t){const e={heading:"",text:"",trace:""};e.heading=Qn(t,"response.statusText","An error has occurred"),e.text=Qn(t,"response.data.message",Qn(t,"response.data.error",t));const n=Qn(t,"response.data.file",""),r=Qn(t,"response.data.line","");n&&r&&(e.trace=`${n}:${r}`);const i=Qn(t,"response.data.trace.0.file",""),o=Qn(t,"response.data.trace.0.line","");i&&o&&(e.trace+=`
${i}:${o}`);const s=Qn(t,"stack","");return s&&(e.trace+=s),e},XQ={name:"MediaEmbedView",components:{NodeViewWrapper:Ew},props:{editor:{type:Object,default:()=>{}},node:{type:Object,default:()=>{}},decorations:{type:Array,default:()=>[]},selected:{type:Boolean,default:!1},extension:{type:Object,default:()=>{}},getPos:{type:Function,default:()=>{}},updateAttributes:{type:Function,default:()=>{}}},data(){return{error:!1,errorMessage:""}},computed:{html(){var t;return this.node.attrs.url?(t=this.data)==null?void 0:t.html:""},data:{get(){return this.node.attrs.data},set(t){return this.updateAttributes({data:t})}}},watch:{"node.attrs.url":function(t,e){this.initEmbed()}},created(){this.editor.on("vui:code-editor-toggle",()=>{this.initEmbed()})},mounted(){this.$nextTick(()=>{this.html||this.initEmbed()})},methods:{async initEmbed(){if(this.error=!1,this.errorMessage="",this.node.attrs.url)try{let{url:t}=this.node.attrs;const e=t.match(/youtube\.com\/live\/(\w+)/);e&&(t=`https://www.youtube.com/watch?v=${e[1]}`);const n=await YQ(t);this.data=n}catch(t){console.error(t),this.data=null,this.error=!0;const e=JQ(t);this.errorMessage=`${e.heading}
${e.text}
${e.trace}
`}}}},ZQ={key:0,class:"vui-media-wrap"},QQ={class:"vui-media-wrap-error"},eee=["innerHTML"],tee=["innerHTML"];function nee(t,e,n,r,i,o){const s=ut("node-view-wrapper");return ge(),Ct(s,{class:vt(["vui-media-embed",{selected:n.selected}])},{default:Vt(()=>[i.error?(ge(),Se("div",ZQ,[re("div",QQ,[re("span",{class:"error",innerHTML:i.errorMessage},null,8,eee)])])):(ge(),Se("div",{key:1,class:"vui-media-wrap vui-loading vui-loading-lg",innerHTML:o.html},null,8,tee))]),_:1},8,["class"])}const ree=Bt(XQ,[["render",nee]]),iee=_n.create({name:"mediaEmbed",group:"block",atom:!0,addAttributes(){return{url:{default:null},data:{default:null}}},parseHTML(){return[{tag:"media-embed",getAttrs:t=>JSON.parse(t.innerHTML)}]},renderHTML({HTMLAttributes:t}){return["media-embed",JSON.stringify(t)]},addNodeView(){return Aw(ree)},addCommands(){return{setEmbed:t=>({tr:e,dispatch:n})=>{const{selection:r}=e,i=this.type.create(t);return n&&e.replaceRangeWith(r.from,r.to,i),!0}}},addProseMirrorPlugins(){return[new on({key:new xn("handleClick"),props:{handleClick:(t,e,n)=>{n.target.classList.contains("vui-media-embed")&&setTimeout(()=>{this.editor.emit("vui:media-embed-clicked",n)},50)}}})]}}),oee=[bY,kY,CY,MY,IY,PY,DY,RY,BY,HY,jY,qY.configure({levels:[1,2,3,4,5,6]}),KY,GY,JY,QJ.configure({resizable:!0}),nX,tX,eX,xX,SX.configure({types:["heading","paragraph"],defaultAlignment:"start"}),GX.configure({openOnClick:!1}),XX,DQ,iee],see=[{name:"h1",svg:"h1",title:Craft.t("vizy","Heading 1"),commandInfo:{shortcut:"Mod-Alt-1"},command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:1}).run()}},{name:"h2",svg:"h2",title:Craft.t("vizy","Heading 2"),commandInfo:{shortcut:"Mod-Alt-2"},command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:2}).run()}},{name:"h3",svg:"h3",title:Craft.t("vizy","Heading 3"),commandInfo:{shortcut:"Mod-Alt-3"},command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:3}).run()}},{name:"unordered-list",svg:"list-ul",title:Craft.t("vizy","Bullet List"),commandInfo:{shortcut:"Mod-Shift-8"},command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleBulletList().run()}},{name:"ordered-list",svg:"list-ol",title:Craft.t("vizy","Ordered List"),commandInfo:{shortcut:"Mod-Shift-7"},command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleOrderedList().run()}},{name:"media-embed",svg:"photo-film",title:Craft.t("vizy","Media Embed"),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).run(),t.emit("vui:media-embed-modal-open")}},{name:"link",svg:"link",title:Craft.t("vizy","Link"),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).run(),t.emit("vui:link-modal-open")}},{name:"image",icon:"image",title:Craft.t("vizy","Image"),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).run(),t.emit("vui:image-modal-open")}},{name:"code-block",svg:"code",title:Craft.t("vizy","Code Block"),commandInfo:{shortcut:"Mod-Alt-c"},command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleCodeBlock().run()}},{name:"blockquote",svg:"quote-right",title:Craft.t("vizy","Blockquote"),commandInfo:{shortcut:"Mod-Shift-b"},command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleBlockquote().run()}},{name:"hr",svg:"horizontal-rule",title:Craft.t("vizy","Horizontal Rule"),command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setHorizontalRule().run()}}];class aee{constructor(e){this.instance=e,this.registeredTemplates=[],this.registeredExtensions=[],this.registeredButtons=[],this.registeredCommands=[]}registerTemplates(e){this.registeredTemplates.push(e)}registerExtensions(e){this.registeredExtensions.push(e)}registerButtons(e){this.registeredButtons.push(e)}registerCommands(e){this.registeredCommands.push(e)}getTemplates(){return this._getComponents(this.registeredTemplates,[])}getExtensions(){return this._getComponents(this.registeredExtensions,oee)}getButtons(){return this._getComponents(this.registeredButtons,pY)}getCommands(){return this._getComponents(this.registeredCommands,see)}_getComponents(e,n){return e.forEach(r=>{const i=r(n);i&&(n=n.concat(Array.isArray(i)?i:[i]))}),n.filter(r=>!!r)}get tiptap(){return{core:hY}}}const lee=or.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",zt(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=cc(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),uee={name:"CollapseTransition",props:{name:{type:String,required:!1,default:"collapse"},dimension:{type:String,required:!1,default:"height",validator:t=>["height","width"].includes(t)},duration:{type:Number,required:!1,default:300},easing:{type:String,required:!1,default:"ease-in-out"}},watch:{dimension(){this.clearCachedDimensions()}},data(){return{cachedStyles:null}},computed:{transition(){let t=[];return Object.keys(this.cachedStyles).forEach(e=>{t.push(`${this.convertToCssProperty(e)} ${this.duration}ms ${this.easing}`)}),t.join(", ")}},methods:{beforeAppear(t){this.$emit("before-appear",t)},appear(t){this.$emit("appear",t)},afterAppear(t){this.$emit("after-appear",t)},appearCancelled(t){this.$emit("appear-cancelled",t)},beforeEnter(t){this.$emit("before-enter",t)},enter(t,e){this.detectAndCacheDimensions(t),this.setClosedDimensions(t),this.hideOverflow(t),this.forceRepaint(t),this.setTransition(t),this.setOpenedDimensions(t),this.$emit("enter",t,e),setTimeout(e,this.duration)},afterEnter(t){this.unsetOverflow(t),this.unsetTransition(t),this.unsetDimensions(t),this.clearCachedDimensions(),this.$emit("after-enter",t)},enterCancelled(t){this.$emit("enter-cancelled",t)},beforeLeave(t){this.$emit("before-leave",t)},leave(t,e){this.detectAndCacheDimensions(t),this.setOpenedDimensions(t),this.hideOverflow(t),this.forceRepaint(t),this.setTransition(t),this.setClosedDimensions(t),this.$emit("leave",t,e),setTimeout(e,this.duration)},afterLeave(t){this.unsetOverflow(t),this.unsetTransition(t),this.unsetDimensions(t),this.clearCachedDimensions(),this.$emit("after-leave",t)},leaveCancelled(t){this.$emit("leave-cancelled",t)},detectAndCacheDimensions(t){if(this.cachedStyles)return;const e=t.style.visibility,n=t.style.display;t.style.visibility="hidden",t.style.display="",this.cachedStyles=this.detectRelevantDimensions(t),t.style.visibility=e,t.style.display=n},clearCachedDimensions(){this.cachedStyles=null},detectRelevantDimensions(t){return this.dimension==="height"?{height:t.offsetHeight+"px",paddingTop:t.style.paddingTop||this.getCssValue(t,"padding-top"),paddingBottom:t.style.paddingBottom||this.getCssValue(t,"padding-bottom")}:this.dimension==="width"?{width:t.offsetWidth+"px",paddingLeft:t.style.paddingLeft||this.getCssValue(t,"padding-left"),paddingRight:t.style.paddingRight||this.getCssValue(t,"padding-right")}:{}},setTransition(t){t.style.transition=this.transition},unsetTransition(t){t.style.transition=""},hideOverflow(t){t.style.overflow="hidden"},unsetOverflow(t){t.style.overflow=""},setClosedDimensions(t){Object.keys(this.cachedStyles).forEach(e=>{t.style[e]="0"})},setOpenedDimensions(t){Object.keys(this.cachedStyles).forEach(e=>{t.style[e]=this.cachedStyles[e]})},unsetDimensions(t){Object.keys(this.cachedStyles).forEach(e=>{t.style[e]=""})},forceRepaint(t){getComputedStyle(t)[this.dimension]},getCssValue(t,e){return getComputedStyle(t,null).getPropertyValue(e)},convertToCssProperty(t){const e=t.match(/([A-Z])/g);if(!e)return t;for(let n=0,r=e.length;n[pn(t.$slots,"default")]),_:3},8,["name","onBeforeAppear","onAppear","onAfterAppear","onAppearCancelled","onBeforeEnter","onEnter","onAfterEnter","onEnterCancelled","onBeforeLeave","onLeave","onAfterLeave","onLeaveCancelled"])}const fee=Bt(uee,[["render",cee]]);function eE(t,e){let n,r;const i=t.toLowerCase();for(e=[].concat(e),n=0;n{if(typeof t=="number"&&(t=`${t}`),typeof t!="string")return!!t;if(t=t.trim(),eE(t,e||["true","1"]))return!0;if(eE(t,n||["false","0"]))return!1},hee={name:"LightswitchField",props:{small:{type:Boolean,default:!1},extraSmall:{type:Boolean,default:!1},modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],data(){return{id:`lightswitch-${Craft.randomString(10)}`,dragger:null,dragging:!1,innerStyle:{},proxyValue:!1,indeterminate:!1}},computed:{offMargin(){return this.small?-10:-12}},watch:{proxyValue(t){this.$emit("update:modelValue",t)}},created(){this.proxyValue=this.modelValue},mounted(){const{container:t}=this.$refs;this.$nextTick(()=>{const e=$(t).data("lightswitch");e&&e.destroy(),this.dragger=new Garnish.BaseDrag(t,{axis:Garnish.X_AXIS,ignoreHandleSelector:null,onDragStart:this.onDragStart.bind(this),onDrag:this.onDrag.bind(this),onDragStop:this.onDragStop.bind(this)})})},beforeUnmount(){this.dragger&&this.dragger.destroy()},methods:{turnOn(){this.proxyValue=!0,this.indeterminate=!1,this.dragging=!0;const{innerContainer:t}=this.$refs,e={[`margin-${Craft.left}`]:0};$(t).velocity("stop").velocity(e,Craft.LightSwitch.animationDuration,this.onSettle.bind(this))},turnOff(){this.proxyValue=!1,this.indeterminate=!1,this.dragging=!0;const{innerContainer:t}=this.$refs,e={[`margin-${Craft.left}`]:this.offMargin};$(t).velocity("stop").velocity(e,Craft.LightSwitch.animationDuration,this.onSettle.bind(this))},toggle(){this.indeterminate||!this.proxyValue?this.turnOn():this.turnOff()},onMouseUp(){this.dragger.dragging||this.toggle()},onKeyDown(t){switch(t.keyCode){case Garnish.SPACE_KEY:{this.toggle(),t.preventDefault();break}case Garnish.RIGHT_KEY:{Craft.orientation==="ltr"?this.turnOn():this.turnOff(),t.preventDefault();break}case Garnish.LEFT_KEY:{Craft.orientation==="ltr"?this.turnOff():this.turnOn(),t.preventDefault();break}}},onDragStart(){this.dragging=!0,this.dragStartMargin=this.getMargin()},onDrag(){let t;Craft.orientation==="ltr"?t=this.dragStartMargin+this.dragger.mouseDistX:t=this.dragStartMargin-this.dragger.mouseDistX,t0&&(t=0);const{innerContainer:e}=this.$refs;$(e).css(`margin-${Craft.left}`,t)},onDragStop(){this.getMargin()>this.offMargin/2?this.turnOn():this.turnOff()},onSettle(){this.dragging=!1},getMargin(){const{innerContainer:t}=this.$refs,e=t.currentStyle||window.getComputedStyle(t);return parseInt(e.marginLeft)},toBoolean(t){return dee(t)}}},pee=["id","aria-labelledby","aria-checked"],mee={ref:"innerContainer",class:"lightswitch-container"},gee=re("div",{class:"handle"},null,-1),vee=[gee];function yee(t,e,n,r,i,o){return ge(),Se("div",{id:i.id,ref:"container",tabindex:"0",role:"checkbox",class:vt(["lightswitch",[{on:o.toBoolean(i.proxyValue),indeterminate:i.indeterminate,dragging:i.dragging,small:n.small,"extra-small":n.extraSmall}]]),"aria-labelledby":`${i.id}-label`,"aria-checked":i.proxyValue?"true":i.indeterminate?"mixed":"false",onMouseup:e[1]||(e[1]=(...s)=>o.onMouseUp&&o.onMouseUp(...s)),onKeydown:e[2]||(e[2]=(...s)=>o.onKeyDown&&o.onKeyDown(...s))},[re("div",mee,vee,512),Ut(re("input",{"onUpdate:modelValue":e[0]||(e[0]=s=>i.proxyValue=s),type:"hidden"},null,512),[[Mn,i.proxyValue]])],42,pee)}const XN=Bt(hee,[["render",yee]]),bee={name:"VizyBlockFields",delimiters:["$!{","}!$"],props:{template:{type:String,default:""}},emits:["update"],mounted(){this.$nextTick(()=>{this.$el&&(Craft.initUiElements(this.$el),this.$el.querySelectorAll(".vizy-input-component").forEach(t=>{t.parentElement.__vueInit=!0}),this.$nextTick(()=>{this.watchFieldChanges(),this.applyRedactorFix(),this.applyTabIndexFix(),this.applyNeoFix()}))})},methods:{vizyBlock(){return this.$parent.$parent.$parent.$parent},watchFieldChanges(){const t=y6(this.emitUpdate,50);new MutationObserver(n=>{t()}).observe(this.$el,{childList:!0,attributes:!0,subtree:!0,characterData:!0}),$(this.$el).on("input change","input, textarea, select",n=>{this.emitUpdate()})},applyRedactorFix(){const t=this.$el.querySelectorAll(".redactor-toolbar");t.length&&t.forEach(e=>{e.addEventListener("mousedown",n=>{n.preventDefault()})})},applyNeoFix(){if(!this.$el.querySelector('[data-type="benf\\\\neo\\\\Field"]'))return;const t=$("form#main-form"),e=encodeURIComponent(this.vizyBlock().vizyField.name);let n=t.data("initialSerializedValue");n=n.replace(new RegExp(`${Craft.escapeRegex(e)}[^&]*&?`),""),t.data("initialSerializedValue",n),this.$el.querySelectorAll('[data-type="benf\\\\neo\\\\Field"]').forEach(r=>{const i=r.querySelectorAll(".ni_buttons");i.length>1&&i.forEach((o,s)=>{s!=i.length-1&&o.remove()})})},applyTabIndexFix(){this.$el.querySelectorAll(".field").forEach(t=>{t.setAttribute("tabindex",-1)})},emitUpdate(){setTimeout(()=>{this.$emit("update")},50),setTimeout(()=>{this.$emit("update")},200)}},render(){try{return mr(Zf(`
${this.template}
`))}catch(t){console.error(t),console.log("Vue template compile error: %o",{template:this.template});const e=this.t("vizy","Unable to parse block definition.");return mr(Zf(`

${e}

`))}}};(function(t){var e=["input","textarea","select","option"],n=["value","selected","checked","disabled"];t.fn.htmlizeClone=function(r){return this.each(function(){var i=this;i.nodeName==="TEXTAREA"?i.innerHTML=i.value:i.nodeName==="OPTION"?i.selected?i.setAttribute("selected","selected"):i.removeAttribute("selected"):i.children&&i.children.length&&t(i).find("textarea, option").htmlizeClone(!0)}),r?this:this.clone()},t.fn.htmlizeSyncAttributes=function(){return this.each(function(){var r=this,i;for(var o in n)n.hasOwnProperty(o)&&(i=n[o],i in r&&(r.getAttribute(i)!==null||r[i])&&!((r.nodeName==="TEXTAREA"||r.nodeName==="SELECT")&&i==="value")&&(i==="value"?r.setAttribute(i,r[i]):r[i]?r.setAttribute(i,i):r.removeAttribute(i)));r.children&&r.children.length&&t(r).find(e.join(", ")).htmlizeSyncAttributes()})},t.fn.htmlize=function(r){r=t.extend({innerHTML:!1,clone:!0},r);var i=t(this).htmlizeClone().htmlizeSyncAttributes();if(r.innerHTML){var o="";return i.each(function(){o+=this.innerHTML}),o}else return i.length?i.appendTo("
").parent().get(0).innerHTML:""}})(jQuery);const _ee={name:"VizyBlock",components:{NodeViewWrapper:Ew,LightswitchField:XN,VizyBlockFields:bee,CollapseTransition:fee},props:{editor:{type:Object,default:()=>{}},node:{type:Object,default:()=>{}},decorations:{type:Array,default:()=>[]},selected:{type:Boolean,default:!1},extension:{type:Object,default:()=>{}},getPos:{type:Function,default:()=>{}},updateAttributes:{type:Function,default:()=>{}}},data(){return{activeTab:null,tippy:null,fieldsHtml:"",mounted:!1,updateFieldsHtml:0}},computed:{options(){return this.extension.options},vizyField(){return this.editor.vizyField},values(){return this.node.attrs.values},blockGroups(){return this.vizyField.settings.blockGroups},blockType(){let t={};return Mi(this.blockGroups)||this.blockGroups.forEach(e=>{const n=gb(e.blockTypes,{id:this.values.type});n&&(t=n)}),t},tabs(){return this.blockType.tabs||{}},enabled:{get(){return this.node.attrs.enabled&&this.blockType.enabled},set(t){this.node.attrs.enabled=t}},collapsed:{get(){return this.node.attrs.collapsed},set(t){this.node.attrs.collapsed=t}},canCollapseAll(){var e,n;let t=!1;return(n=(e=this.editor.state.doc)==null?void 0:e.content)==null||n.content.forEach(r=>{r.type.name==="vizyBlock"&&(r.attrs.collapsed||(t=!0))}),t},canExpandAll(){var e,n;let t=!1;return(n=(e=this.editor.state.doc)==null?void 0:e.content)==null||n.content.forEach(r=>{r.type.name==="vizyBlock"&&r.attrs.collapsed&&(t=!0)}),t},preview(){let t="";if(this.mounted){const e=$(this.$refs.fields.$el).children().children();for(let n=0;n| ":"")+o)}}return t}},watch:{"node.attrs.enabled":function(t,e){this.collapsed=!t},"node.attrs.id":function(t,e){this.fieldsHtml=this.vizyField.getCachedFieldHtml(t),this.updateFieldsHtml+=1,this.$nextTick(()=>{this.appendJs(),this.setFirstActiveTab()})}},created(){this.$nextTick(()=>{this.$events.on("vizy-blocks:updateDOM",this.onUpdateDOM)}),this.fieldsHtml=this.vizyField.getCachedFieldHtml(this.node.attrs.id),this.$events.on("vizy-blocks:collapseAll",this.collapseBlock),this.$events.on("vizy-blocks:expandAll",this.expandBlock),setTimeout(()=>{this.onFieldUpdate()},50)},mounted(){this.$nextTick(()=>{this.appendJs(),this.setFirstActiveTab(),this.mounted=!0;const t=this.$el.querySelector("#vizy-block-settings-template");t&&(t.style.display="block",this.tippy=Kr(this.$el.querySelector(".vizyblock-header .settings"),{content:t,trigger:"click",allowHTML:!0,arrow:!0,interactive:!0,appendTo:document.body,placement:"bottom",theme:"light-border vizy-tippy-menu",maxWidth:"300px",duration:200,zIndex:1e3,hideOnClick:!0})),this.$el.setAttribute("draggable",!1),this.$el.addEventListener("dragstart",e=>{if(e.srcElement instanceof Element||e.srcElement instanceof HTMLDocument){let n=null;if(e.srcElement.classList.contains("vizyblock")?n=e.srcElement.querySelector(".vizyblock-header"):n=e.srcElement.closest(".vizyblock-header"),n){const r=`vui-${this.uid}-ghost`,i=document.querySelector(`#${r}`)?document.querySelector(`#${r}`):document.createElement("div");i.id=r,i.classList="vui-block-ghost",i.innerHTML=n.outerHTML,document.body.appendChild(i),e.dataTransfer.setDragImage(i,0,0)}}},!1)})},beforeUnmount(){this.onUpdateDOM(),this.$events.off("vizy-blocks:updateDOM",this.onUpdateDOM),this.$events.off("vizy-blocks:collapseAll",this.collapseBlock),this.$events.off("vizy-blocks:expandAll",this.expandBlock)},methods:{isEmpty(t){return Mi(t)},tabError(t){return(this.vizyField.getBlockSettings(this.node.attrs.id).tabErrors||[]).includes(t.tabId)},_inputPreviewText(t){if(t.is("select,multiselect")){const e=[],n=t.find("option:selected");for(let r=0;r{if($(r).parents(".vui-editor").length)return;const i=$(r).find("textarea").htmlize();$(r).replaceWith(i)}),t.find(".ck-editor").length&&t.find(".ck-editor").each((n,r)=>{if($(r).parents(".vui-editor").length)return;const i=$(r).find("textarea").htmlize();$(r).replaceWith(i)}),t.find(".selectize").length&&t.find(".selectize").each((n,r)=>{const i=$(r).parents("[data-type]").data("layout-element");if(i){const o=$(this.blockType.fieldsHtml).find(`[data-layout-element="${i}"] .selectize`);o.length&&(o.find("select").attr("id",$(r).find("select").attr("id")),o.find("select").attr("name",$(r).find("select").attr("name")),o.find("select").val($(r).find("select").val()),r.outerHTML=o.htmlize())}});const e=t.htmlize();this.vizyField.setCachedFieldHtml(this.node.attrs.id,e)}},clickBlock(t){if(!t.target.hasAttribute("data-node-view-wrapper"))return;const e=this.editor.view.posAtCoords({left:t.clientX,top:t.clientY});if(e&&e.inside>-1&&!it.isSelectable(this.editor.view.state.doc.nodeAt(e.inside)))return!1;const n=this.editor.view.state.doc.resolve(e.pos);this.editor.view.dispatch(this.editor.view.state.tr.setSelection(new fn(n)))},clickTab(t){this.activeTab=t,this.$refs.fields.$el.querySelectorAll(":scope > div").forEach(n=>{n.getAttribute("id").includes(this.activeTab)?n.classList.remove("hidden"):n.classList.add("hidden")})},toggleTitle(t){this.$el.querySelector(".actions-tabs").contains(t.target)||(this.collapsed?this.expandBlock():this.collapseBlock())},setFirstActiveTab(){this.tabs&&([this.activeTab]=Object.keys(this.tabs))},appendJs(){if(Mi(this.blockType))return;const t=this.vizyField.getCachedFieldJs(this.node.attrs.id),e=document.querySelector(`#script-${this.node.attrs.id}`);t&&(e&&e.parentElement.removeChild(e),Craft.appendBodyHtml(t))},deleteBlock(){this.tippy&&this.tippy.hide(),setTimeout(()=>{const t=this.getPos(),e={from:t,to:t+(this.node.nodeSize-1)};this.editor.chain().focus().deleteRange(e).run()},200)},collapseBlock(){this.collapsed=!0,this.tippy&&this.tippy.hide()},expandBlock(){this.collapsed=!1,this.tippy&&this.tippy.hide()},collapseAll(){this.$events.emit("vizy-blocks:collapseAll")},expandAll(){this.$events.emit("vizy-blocks:expandAll")},clickMove(){this.$events.emit("vizy-blocks:updateDOM"),this.vizyField.selectedBlockType=this.blockType.id},onFieldUpdate(){this.serializeFieldContent()},findContentBlocksForBlock(t){let e={};if(!Mi(t)){this.$el.closest(".slideout[data-element-editor] .so-body")&&(t=Object.values(t)[0],Mi(t.fields)&&(t={fields:t}));let r=t.vizyBlockFields;Mi(r)&&(r=t.fields),Mi(r)||Object.entries(r).forEach(([i,o])=>{o.blocks===void 0&&(e={fields:r}),Mi(o.blocks)||Object.entries(o.blocks).forEach(([s,l])=>{s===this.node.attrs.id?e=l:Mi(e)&&(e=this.findContentBlocksForBlock(l))})})}return e},fixSuperTableMatrixContent(t){const e=/^__BLOCK_[a-zA-Z0-9]+__$/;if(Ur(t))t.forEach(n=>{this.fixSuperTableMatrixContent(n)});else if(vr(t)){const n=Object.keys(t);if(n.forEach(r=>{vr(t[r])&&this.fixSuperTableMatrixContent(t[r])}),n.includes("blocks")){const r=Object.keys(t.blocks);if(r.some(i=>e.test(i))){const i=r.find(o=>/^new\d+$/.test(o));if(i&&r.length===2){const o=Jj(t.blocks[r[0]],t.blocks[r[1]]);t.blocks={},t.blocks[i]=o}}}}return t},fixArrayIndexes(t){if(Array.isArray(t)){const e=Object.keys(t).map(Number).sort();!Array.from({length:t.length},(i,o)=>o).every(i=>e.includes(i))&&(t=t.filter(i=>i!==void 0))}else if(typeof t=="object"&&t!==null)for(const e in t)t[e]=this.fixArrayIndexes(t[e]);return t},serializeFieldContent(){if(Mi(this.blockType))return;const t=Garnish.getPostData(this.$refs.fields.$el),e=Object.keys(t).sort().reduce((o,s)=>(o[s]=t[s],o),{});let n=Craft.expandPostArray(e);n=this.fixArrayIndexes(n);let r=this.findContentBlocksForBlock(n);r=this.fixSuperTableMatrixContent(r);const i={...this.values};i.content=r,this.node.attrs.values=i}}},wee={key:0,class:"vizyblock-wrap"},kee={class:"titlebar"},xee={class:"blocktype"},See={key:0},Cee=["innerHTML"],Tee={class:"actions-tabs"},Eee={key:0,class:"titlebar-tabs"},Aee=["onClick"],Oee={class:"actions"},Mee=["title","aria-title"],Nee=["title","aria-title"],Lee={id:"vizy-block-settings-template",class:"vizy-menu",style:{display:"none"}},Iee={class:"padded",role:"listbox","aria-hidden":"true"},Pee={key:0},Dee={key:1},Ree={key:2},zee={key:3},Bee=re("hr",null,null,-1),$ee={key:1,class:"vizyblock-wrap"},Hee={class:"vizyblock-invalid"},Fee={class:"error"};function Vee(t,e,n,r,i,o){const s=ut("lightswitch-field"),l=ut("vizy-block-fields"),u=ut("collapse-transition"),f=ut("node-view-wrapper");return ge(),Ct(f,{class:"vizyblock",contenteditable:"false","data-vizy-block":!0,"data-type":o.blockType.handle,onCopy:e[9]||(e[9]=lt(()=>{},["stop"])),onPaste:e[10]||(e[10]=lt(()=>{},["stop"])),onCut:e[11]||(e[11]=lt(()=>{},["stop"])),onClick:o.clickBlock},{default:Vt(()=>[o.isEmpty(o.blockType)?(ge(),Se("div",$ee,[re("div",Hee,[re("p",Fee,Le(t.t("vizy","Unable to parse block definition.")),1),re("a",{class:"error","data-icon":"remove",role:"option",tabindex:"-1",onClick:e[8]||(e[8]=lt((...d)=>o.deleteBlock&&o.deleteBlock(...d),["prevent"]))})])])):(ge(),Se("div",wee,[re("div",{class:"vizyblock-header",onDblclick:e[7]||(e[7]=lt((...d)=>o.toggleTitle&&o.toggleTitle(...d),["prevent"]))},[re("div",kee,[re("div",xee,[t.$isDebug?(ge(),Se("span",See,Le(t.uid)+" "+Le(n.node.attrs.id),1)):gt("",!0),Ui(Le(o.blockType.name),1)]),o.collapsed?(ge(),Se("div",{key:0,class:"preview",innerHTML:o.preview},null,8,Cee)):gt("",!0)]),re("div",Tee,[Object.keys(o.tabs).length>1?(ge(),Se("div",Eee,[(ge(!0),Se(kt,null,Zt(o.tabs,(d,m)=>(ge(),Se("a",{key:m,class:vt(["tab",{active:m===i.activeTab,error:o.tabError(d)}]),onClick:lt(v=>o.clickTab(m),["prevent"])},Le(d.label),11,Aee))),128))])):gt("",!0),re("div",Oee,[Qe(s,{modelValue:o.enabled,"onUpdate:modelValue":e[0]||(e[0]=d=>o.enabled=d),"extra-small":!0},null,8,["modelValue"]),re("a",{class:"settings icon",title:t.t("vizy","Actions"),"aria-title":t.t("vizy","Actions"),role:"button",tabindex:"0","aria-haspopup":"listbox","aria-expanded":"false"},null,8,Mee),re("a",{class:"move icon",title:t.t("vizy","Reorder"),"aria-title":t.t("vizy","Reorder"),"data-drag-handle":"",role:"button",onMousedown:e[1]||(e[1]=(...d)=>o.clickMove&&o.clickMove(...d))},null,40,Nee)]),re("div",Lee,[re("ul",Iee,[o.collapsed?(ge(),Se("li",Pee,[re("a",{"data-icon":"expand",role:"option",tabindex:"-1",onClick:e[2]||(e[2]=lt((...d)=>o.expandBlock&&o.expandBlock(...d),["prevent"]))},Le(t.t("vizy","Expand")),1)])):(ge(),Se("li",Dee,[re("a",{"data-icon":"collapse",role:"option",tabindex:"-1",onClick:e[3]||(e[3]=lt((...d)=>o.collapseBlock&&o.collapseBlock(...d),["prevent"]))},Le(t.t("vizy","Collapse")),1)])),o.canCollapseAll?(ge(),Se("li",Ree,[re("a",{"data-icon":"collapse",role:"option",tabindex:"-1",onClick:e[4]||(e[4]=lt((...d)=>o.collapseAll&&o.collapseAll(...d),["prevent"]))},Le(t.t("vizy","Collapse All")),1)])):gt("",!0),o.canExpandAll?(ge(),Se("li",zee,[re("a",{"data-icon":"expand",role:"option",tabindex:"-1",onClick:e[5]||(e[5]=lt((...d)=>o.expandAll&&o.expandAll(...d),["prevent"]))},Le(t.t("vizy","Expand All")),1)])):gt("",!0),Bee,re("li",null,[re("a",{class:"error","data-icon":"remove",role:"option",tabindex:"-1",onClick:e[6]||(e[6]=lt((...d)=>o.deleteBlock&&o.deleteBlock(...d),["prevent"]))},Le(t.t("vizy","Delete")),1)])])])])],32),Qe(u,null,{default:Vt(()=>[Ut(re("div",null,[i.fieldsHtml?(ge(),Ct(l,{ref:"fields",key:i.updateFieldsHtml,class:"vizyblock-fields",template:i.fieldsHtml,onUpdate:o.onFieldUpdate},null,8,["template","onUpdate"])):gt("",!0)],512),[[Bu,!o.collapsed]])]),_:1})]))]),_:1},8,["data-type","onClick"])}const jee=Bt(_ee,[["render",Vee]]),Wee=_n.create({name:"vizyBlock",isBlock:!0,inline:!1,group:"block",draggable:!0,defining:!0,selectable:!0,addAttributes(){return{id:{default:null},enabled:{default:!0},collapsed:{default:!1},values:{default:null}}},addStorage(){return{isNew:!1}},parseHTML(){return[{tag:"vizy-block",getAttrs:t=>JSON.parse(t.innerHTML)}]},renderHTML({HTMLAttributes:t}){return["vizy-block",JSON.stringify(t)]},addCommands(){return{setVizyBlock:t=>({tr:e,dispatch:n,view:r,state:i})=>{const{selection:o}=e,s=this.type.create(t);return n&&(e.insert(o.from,i.schema.nodes.paragraph.create()),e.replaceRangeWith(o.from,o.to,s)),this.storage.isNew=!0,!0}}},addNodeView(){return Aw(jee,{stopEvent:({event:t})=>t.target.hasAttribute("data-drag-handle")?(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}),!1):!this.isDragging})},addProseMirrorPlugins(){return[new on({props:{handleKeyDown:(t,e)=>{if(t.state.typing=!0,e.key==="Escape"){const n=t.state.selection.$from.pos;t.state.selection.$to.pos;const r=n-1<0?0:n-1;return this.editor.chain().setTextSelection({from:r,to:r}).blur().run(),!0}},handlePaste:(t,e,n)=>{t.state.pasting=!0;const{supportedBlockTypes:r}=this.editor.vizyField;n.content.content.forEach((i,o)=>{i.type.name=="vizyBlock"&&(r.includes(i.attrs.values.type)||n.content.content.splice(o,1))})},handleClickOn:(t,e,n,r,i,o)=>{const s=i.target.closest(".vizyblock");if(!s)return!1;if(s.closest(".ProseMirror")!==t.dom)return!0;const u=i.target.closest(".vizyblock-header"),f=i.target.closest(".vizyblock-header .actions-tabs");if(!u||f)return!0}},filterTransaction:(t,e)=>{let n=!0;return(e.typing||e.pasting)&&t.mapping.maps.forEach(r=>{r.forEach((i,o,s,l)=>{e.doc.nodesBetween(i,o,(u,f,d,m,v)=>{u.type.name==="vizyBlock"&&(n=!1)})})}),n}})]}});function Uee(t){var e;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:s}=t,l=cN(n),u=new RegExp(`\\s${l}$`),f=o?"^":"",d=r?new RegExp(`${f}${l}.*?(?=\\s${l}|$)`,"gm"):new RegExp(`${f}(?:^)?${l}[^\\s${l}]*`,"gm"),m=((e=s.nodeBefore)===null||e===void 0?void 0:e.isText)&&s.nodeBefore.text;if(!m)return null;const v=s.pos-m.length,y=Array.from(m.matchAll(d)).pop();if(!y||y.input===void 0||y.index===void 0)return null;const _=y.input.slice(Math.max(0,y.index-1),y.index),C=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(_);if(i!==null&&!C)return null;const x=v+y.index;let k=x+y[0].length;return r&&u.test(m.slice(k-1,k+1))&&(y[0]+=" ",k+=1),x=s.pos?{range:{from:x,to:k},query:y[0].slice(n.length),text:y[0]}:null}const qee=new xn("suggestion");function Kee({pluginKey:t=qee,editor:e,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:s="span",decorationClass:l="suggestion",command:u=()=>null,items:f=()=>[],render:d=()=>({}),allow:m=()=>!0,findSuggestionMatch:v=Uee}){let y;const _=d==null?void 0:d(),C=new on({key:t,view(){return{update:async(x,k)=>{var A,L,E,H,I,q,P;const z=(A=this.key)===null||A===void 0?void 0:A.getState(k),w=(L=this.key)===null||L===void 0?void 0:L.getState(x.state),R=z.active&&w.active&&z.range.from!==w.range.from,U=!z.active&&w.active,K=z.active&&!w.active,oe=!U&&!K&&z.query!==w.query,D=U||R,ae=oe&&!R,ce=K||R;if(!D&&!ae&&!ce)return;const ve=ce&&!D?z:w,ze=x.dom.querySelector(`[data-decoration-id="${ve.decorationId}"]`);y={editor:e,range:ve.range,query:ve.query,text:ve.text,items:[],command:qe=>{u({editor:e,range:ve.range,props:qe})},decorationNode:ze,clientRect:ze?()=>{var qe;const{decorationId:yt}=(qe=this.key)===null||qe===void 0?void 0:qe.getState(e.state),mt=x.dom.querySelector(`[data-decoration-id="${yt}"]`);return(mt==null?void 0:mt.getBoundingClientRect())||null}:null},D&&((E=_==null?void 0:_.onBeforeStart)===null||E===void 0||E.call(_,y)),ae&&((H=_==null?void 0:_.onBeforeUpdate)===null||H===void 0||H.call(_,y)),(ae||D)&&(y.items=await f({editor:e,query:ve.query})),ce&&((I=_==null?void 0:_.onExit)===null||I===void 0||I.call(_,y)),ae&&((q=_==null?void 0:_.onUpdate)===null||q===void 0||q.call(_,y)),D&&((P=_==null?void 0:_.onStart)===null||P===void 0||P.call(_,y))},destroy:()=>{var x;y&&((x=_==null?void 0:_.onExit)===null||x===void 0||x.call(_,y))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(x,k,A,L){const{isEditable:E}=e,{composing:H}=e.view,{selection:I}=x,{empty:q,from:P}=I,z={...k};if(z.composing=H,E&&(q||e.view.composing)){(Pk.range.to)&&!H&&!k.composing&&(z.active=!1);const w=v({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:I.$from}),R=`id_${Math.floor(Math.random()*4294967295)}`;w&&m({editor:e,state:L,range:w.range})?(z.active=!0,z.decorationId=k.decorationId?k.decorationId:R,z.range=w.range,z.query=w.query,z.text=w.text):z.active=!1}else z.active=!1;return z.active||(z.decorationId=null,z.range={from:0,to:0},z.query=null,z.text=null),z}},props:{handleKeyDown(x,k){var A;const{active:L,range:E}=C.getState(x.state);return L&&((A=_==null?void 0:_.onKeyDown)===null||A===void 0?void 0:A.call(_,{view:x,event:k,range:E}))||!1},decorations(x){const{active:k,range:A,decorationId:L}=C.getState(x);return k?tn.create(x.doc,[hr.inline(A.from,A.to,{nodeName:s,class:l,"data-decoration-id":L})]):null}}});return C}const Gee=ir.create({name:"Commands",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:n})=>{n.command({editor:t,range:e})}}}},addProseMirrorPlugins(){return[Kee({editor:this.editor,...this.options.suggestion})]}}),Yee=function(t){let e=t.replace("/<(.*?)>/g","");e=e.replace(/['"‘’“”[]\(\){}:]/g,""),e=e.toLowerCase(),e=Craft.asciiString(e);const n=Craft.filterArray(e.split(/[^a-z0-9]+/));e="";for(let r=0;rt.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1;i--){var o=n[i],s=(o.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(s)>-1&&(r=o)}return rn.head.insertBefore(e,r),t}}var _te="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function bd(){for(var t=12,e="";t-- >0;)e+=_te[Math.random()*62|0];return e}function dc(t){for(var e=[],n=(t||[]).length>>>0;n--;)e[n]=t[n];return e}function Pw(t){return t.classList?dc(t.classList):(t.getAttribute("class")||"").split(" ").filter(function(e){return e})}function cL(t){return"".concat(t).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function wte(t){return Object.keys(t||{}).reduce(function(e,n){return e+"".concat(n,'="').concat(cL(t[n]),'" ')},"").trim()}function ov(t){return Object.keys(t||{}).reduce(function(e,n){return e+"".concat(n,": ").concat(t[n].trim(),";")},"")}function Dw(t){return t.size!==po.size||t.x!==po.x||t.y!==po.y||t.rotate!==po.rotate||t.flipX||t.flipY}function kte(t){var e=t.transform,n=t.containerWidth,r=t.iconWidth,i={transform:"translate(".concat(n/2," 256)")},o="translate(".concat(e.x*32,", ").concat(e.y*32,") "),s="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),l="rotate(".concat(e.rotate," 0 0)"),u={transform:"".concat(o," ").concat(s," ").concat(l)},f={transform:"translate(".concat(r/2*-1," -256)")};return{outer:i,inner:u,path:f}}function xte(t){var e=t.transform,n=t.width,r=n===void 0?o1:n,i=t.height,o=i===void 0?o1:i,s=t.startCentered,l=s===void 0?!1:s,u="";return l&&rL?u+="translate(".concat(e.x/As-r/2,"em, ").concat(e.y/As-o/2,"em) "):l?u+="translate(calc(-50% + ".concat(e.x/As,"em), calc(-50% + ").concat(e.y/As,"em)) "):u+="translate(".concat(e.x/As,"em, ").concat(e.y/As,"em) "),u+="scale(".concat(e.size/As*(e.flipX?-1:1),", ").concat(e.size/As*(e.flipY?-1:1),") "),u+="rotate(".concat(e.rotate,"deg) "),u}var Ste=`:root, :host { ->>>>>>>> origin/craft-4:src/web/assets/field/dist/assets/vizy-91fcee7d.js - --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Solid"; - --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Regular"; - --fa-font-light: normal 300 1em/1 "Font Awesome 6 Light"; - --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Thin"; - --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone"; - --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp"; - --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp"; - --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp"; - --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands"; -} - -svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { - overflow: visible; - box-sizing: content-box; -} - -.svg-inline--fa { - display: var(--fa-display, inline-block); - height: 1em; - overflow: visible; - vertical-align: -0.125em; -} -.svg-inline--fa.fa-2xs { - vertical-align: 0.1em; -} -.svg-inline--fa.fa-xs { - vertical-align: 0em; -} -.svg-inline--fa.fa-sm { - vertical-align: -0.0714285705em; -} -.svg-inline--fa.fa-lg { - vertical-align: -0.2em; -} -.svg-inline--fa.fa-xl { - vertical-align: -0.25em; -} -.svg-inline--fa.fa-2xl { - vertical-align: -0.3125em; -} -.svg-inline--fa.fa-pull-left { - margin-right: var(--fa-pull-margin, 0.3em); - width: auto; -} -.svg-inline--fa.fa-pull-right { - margin-left: var(--fa-pull-margin, 0.3em); - width: auto; -} -.svg-inline--fa.fa-li { - width: var(--fa-li-width, 2em); - top: 0.25em; -} -.svg-inline--fa.fa-fw { - width: var(--fa-fw-width, 1.25em); -} - -.fa-layers svg.svg-inline--fa { - bottom: 0; - left: 0; - margin: auto; - position: absolute; - right: 0; - top: 0; -} - -.fa-layers-counter, .fa-layers-text { - display: inline-block; - position: absolute; - text-align: center; -} - -.fa-layers { - display: inline-block; - height: 1em; - position: relative; - text-align: center; - vertical-align: -0.125em; - width: 1em; -} -.fa-layers svg.svg-inline--fa { - -webkit-transform-origin: center center; - transform-origin: center center; -} - -.fa-layers-text { - left: 50%; - top: 50%; - -webkit-transform: translate(-50%, -50%); - transform: translate(-50%, -50%); - -webkit-transform-origin: center center; - transform-origin: center center; -} - -.fa-layers-counter { - background-color: var(--fa-counter-background-color, #ff253a); - border-radius: var(--fa-counter-border-radius, 1em); - box-sizing: border-box; - color: var(--fa-inverse, #fff); - line-height: var(--fa-counter-line-height, 1); - max-width: var(--fa-counter-max-width, 5em); - min-width: var(--fa-counter-min-width, 1.5em); - overflow: hidden; - padding: var(--fa-counter-padding, 0.25em 0.5em); - right: var(--fa-right, 0); - text-overflow: ellipsis; - top: var(--fa-top, 0); - -webkit-transform: scale(var(--fa-counter-scale, 0.25)); - transform: scale(var(--fa-counter-scale, 0.25)); - -webkit-transform-origin: top right; - transform-origin: top right; -} - -.fa-layers-bottom-right { - bottom: var(--fa-bottom, 0); - right: var(--fa-right, 0); - top: auto; - -webkit-transform: scale(var(--fa-layers-scale, 0.25)); - transform: scale(var(--fa-layers-scale, 0.25)); - -webkit-transform-origin: bottom right; - transform-origin: bottom right; -} - -.fa-layers-bottom-left { - bottom: var(--fa-bottom, 0); - left: var(--fa-left, 0); - right: auto; - top: auto; - -webkit-transform: scale(var(--fa-layers-scale, 0.25)); - transform: scale(var(--fa-layers-scale, 0.25)); - -webkit-transform-origin: bottom left; - transform-origin: bottom left; -} - -.fa-layers-top-right { - top: var(--fa-top, 0); - right: var(--fa-right, 0); - -webkit-transform: scale(var(--fa-layers-scale, 0.25)); - transform: scale(var(--fa-layers-scale, 0.25)); - -webkit-transform-origin: top right; - transform-origin: top right; -} - -.fa-layers-top-left { - left: var(--fa-left, 0); - right: auto; - top: var(--fa-top, 0); - -webkit-transform: scale(var(--fa-layers-scale, 0.25)); - transform: scale(var(--fa-layers-scale, 0.25)); - -webkit-transform-origin: top left; - transform-origin: top left; -} - -.fa-1x { - font-size: 1em; -} - -.fa-2x { - font-size: 2em; -} - -.fa-3x { - font-size: 3em; -} - -.fa-4x { - font-size: 4em; -} - -.fa-5x { - font-size: 5em; -} - -.fa-6x { - font-size: 6em; -} - -.fa-7x { - font-size: 7em; -} - -.fa-8x { - font-size: 8em; -} - -.fa-9x { - font-size: 9em; -} - -.fa-10x { - font-size: 10em; -} - -.fa-2xs { - font-size: 0.625em; - line-height: 0.1em; - vertical-align: 0.225em; -} - -.fa-xs { - font-size: 0.75em; - line-height: 0.0833333337em; - vertical-align: 0.125em; -} - -.fa-sm { - font-size: 0.875em; - line-height: 0.0714285718em; - vertical-align: 0.0535714295em; -} - -.fa-lg { - font-size: 1.25em; - line-height: 0.05em; - vertical-align: -0.075em; -} - -.fa-xl { - font-size: 1.5em; - line-height: 0.0416666682em; - vertical-align: -0.125em; -} - -.fa-2xl { - font-size: 2em; - line-height: 0.03125em; - vertical-align: -0.1875em; -} - -.fa-fw { - text-align: center; - width: 1.25em; -} - -.fa-ul { - list-style-type: none; - margin-left: var(--fa-li-margin, 2.5em); - padding-left: 0; -} -.fa-ul > li { - position: relative; -} - -.fa-li { - left: calc(var(--fa-li-width, 2em) * -1); - position: absolute; - text-align: center; - width: var(--fa-li-width, 2em); - line-height: inherit; -} - -.fa-border { - border-color: var(--fa-border-color, #eee); - border-radius: var(--fa-border-radius, 0.1em); - border-style: var(--fa-border-style, solid); - border-width: var(--fa-border-width, 0.08em); - padding: var(--fa-border-padding, 0.2em 0.25em 0.15em); -} - -.fa-pull-left { - float: left; - margin-right: var(--fa-pull-margin, 0.3em); -} - -.fa-pull-right { - float: right; - margin-left: var(--fa-pull-margin, 0.3em); -} - -.fa-beat { - -webkit-animation-name: fa-beat; - animation-name: fa-beat; - -webkit-animation-delay: var(--fa-animation-delay, 0s); - animation-delay: var(--fa-animation-delay, 0s); - -webkit-animation-direction: var(--fa-animation-direction, normal); - animation-direction: var(--fa-animation-direction, normal); - -webkit-animation-duration: var(--fa-animation-duration, 1s); - animation-duration: var(--fa-animation-duration, 1s); - -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out); - animation-timing-function: var(--fa-animation-timing, ease-in-out); -} - -.fa-bounce { - -webkit-animation-name: fa-bounce; - animation-name: fa-bounce; - -webkit-animation-delay: var(--fa-animation-delay, 0s); - animation-delay: var(--fa-animation-delay, 0s); - -webkit-animation-direction: var(--fa-animation-direction, normal); - animation-direction: var(--fa-animation-direction, normal); - -webkit-animation-duration: var(--fa-animation-duration, 1s); - animation-duration: var(--fa-animation-duration, 1s); - -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); - animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); -} - -.fa-fade { - -webkit-animation-name: fa-fade; - animation-name: fa-fade; - -webkit-animation-delay: var(--fa-animation-delay, 0s); - animation-delay: var(--fa-animation-delay, 0s); - -webkit-animation-direction: var(--fa-animation-direction, normal); - animation-direction: var(--fa-animation-direction, normal); - -webkit-animation-duration: var(--fa-animation-duration, 1s); - animation-duration: var(--fa-animation-duration, 1s); - -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); - animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); -} - -.fa-beat-fade { - -webkit-animation-name: fa-beat-fade; - animation-name: fa-beat-fade; - -webkit-animation-delay: var(--fa-animation-delay, 0s); - animation-delay: var(--fa-animation-delay, 0s); - -webkit-animation-direction: var(--fa-animation-direction, normal); - animation-direction: var(--fa-animation-direction, normal); - -webkit-animation-duration: var(--fa-animation-duration, 1s); - animation-duration: var(--fa-animation-duration, 1s); - -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); - animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); -} - -.fa-flip { - -webkit-animation-name: fa-flip; - animation-name: fa-flip; - -webkit-animation-delay: var(--fa-animation-delay, 0s); - animation-delay: var(--fa-animation-delay, 0s); - -webkit-animation-direction: var(--fa-animation-direction, normal); - animation-direction: var(--fa-animation-direction, normal); - -webkit-animation-duration: var(--fa-animation-duration, 1s); - animation-duration: var(--fa-animation-duration, 1s); - -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out); - animation-timing-function: var(--fa-animation-timing, ease-in-out); -} - -.fa-shake { - -webkit-animation-name: fa-shake; - animation-name: fa-shake; - -webkit-animation-delay: var(--fa-animation-delay, 0s); - animation-delay: var(--fa-animation-delay, 0s); - -webkit-animation-direction: var(--fa-animation-direction, normal); - animation-direction: var(--fa-animation-direction, normal); - -webkit-animation-duration: var(--fa-animation-duration, 1s); - animation-duration: var(--fa-animation-duration, 1s); - -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - -webkit-animation-timing-function: var(--fa-animation-timing, linear); - animation-timing-function: var(--fa-animation-timing, linear); -} - -.fa-spin { - -webkit-animation-name: fa-spin; - animation-name: fa-spin; - -webkit-animation-delay: var(--fa-animation-delay, 0s); - animation-delay: var(--fa-animation-delay, 0s); - -webkit-animation-direction: var(--fa-animation-direction, normal); - animation-direction: var(--fa-animation-direction, normal); - -webkit-animation-duration: var(--fa-animation-duration, 2s); - animation-duration: var(--fa-animation-duration, 2s); - -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - -webkit-animation-timing-function: var(--fa-animation-timing, linear); - animation-timing-function: var(--fa-animation-timing, linear); -} - -.fa-spin-reverse { - --fa-animation-direction: reverse; -} - -.fa-pulse, -.fa-spin-pulse { - -webkit-animation-name: fa-spin; - animation-name: fa-spin; - -webkit-animation-direction: var(--fa-animation-direction, normal); - animation-direction: var(--fa-animation-direction, normal); - -webkit-animation-duration: var(--fa-animation-duration, 1s); - animation-duration: var(--fa-animation-duration, 1s); - -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - -webkit-animation-timing-function: var(--fa-animation-timing, steps(8)); - animation-timing-function: var(--fa-animation-timing, steps(8)); -} - -@media (prefers-reduced-motion: reduce) { - .fa-beat, -.fa-bounce, -.fa-fade, -.fa-beat-fade, -.fa-flip, -.fa-pulse, -.fa-shake, -.fa-spin, -.fa-spin-pulse { - -webkit-animation-delay: -1ms; - animation-delay: -1ms; - -webkit-animation-duration: 1ms; - animation-duration: 1ms; - -webkit-animation-iteration-count: 1; - animation-iteration-count: 1; - -webkit-transition-delay: 0s; - transition-delay: 0s; - -webkit-transition-duration: 0s; - transition-duration: 0s; - } -} -@-webkit-keyframes fa-beat { - 0%, 90% { - -webkit-transform: scale(1); - transform: scale(1); - } - 45% { - -webkit-transform: scale(var(--fa-beat-scale, 1.25)); - transform: scale(var(--fa-beat-scale, 1.25)); - } -} -@keyframes fa-beat { - 0%, 90% { - -webkit-transform: scale(1); - transform: scale(1); - } - 45% { - -webkit-transform: scale(var(--fa-beat-scale, 1.25)); - transform: scale(var(--fa-beat-scale, 1.25)); - } -} -@-webkit-keyframes fa-bounce { - 0% { - -webkit-transform: scale(1, 1) translateY(0); - transform: scale(1, 1) translateY(0); - } - 10% { - -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); - transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); - } - 30% { - -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); - transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); - } - 50% { - -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); - transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); - } - 57% { - -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); - transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); - } - 64% { - -webkit-transform: scale(1, 1) translateY(0); - transform: scale(1, 1) translateY(0); - } - 100% { - -webkit-transform: scale(1, 1) translateY(0); - transform: scale(1, 1) translateY(0); - } -} -@keyframes fa-bounce { - 0% { - -webkit-transform: scale(1, 1) translateY(0); - transform: scale(1, 1) translateY(0); - } - 10% { - -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); - transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); - } - 30% { - -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); - transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); - } - 50% { - -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); - transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); - } - 57% { - -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); - transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); - } - 64% { - -webkit-transform: scale(1, 1) translateY(0); - transform: scale(1, 1) translateY(0); - } - 100% { - -webkit-transform: scale(1, 1) translateY(0); - transform: scale(1, 1) translateY(0); - } -} -@-webkit-keyframes fa-fade { - 50% { - opacity: var(--fa-fade-opacity, 0.4); - } -} -@keyframes fa-fade { - 50% { - opacity: var(--fa-fade-opacity, 0.4); - } -} -@-webkit-keyframes fa-beat-fade { - 0%, 100% { - opacity: var(--fa-beat-fade-opacity, 0.4); - -webkit-transform: scale(1); - transform: scale(1); - } - 50% { - opacity: 1; - -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125)); - transform: scale(var(--fa-beat-fade-scale, 1.125)); - } -} -@keyframes fa-beat-fade { - 0%, 100% { - opacity: var(--fa-beat-fade-opacity, 0.4); - -webkit-transform: scale(1); - transform: scale(1); - } - 50% { - opacity: 1; - -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125)); - transform: scale(var(--fa-beat-fade-scale, 1.125)); - } -} -@-webkit-keyframes fa-flip { - 50% { - -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); - transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); - } -} -@keyframes fa-flip { - 50% { - -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); - transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); - } -} -@-webkit-keyframes fa-shake { - 0% { - -webkit-transform: rotate(-15deg); - transform: rotate(-15deg); - } - 4% { - -webkit-transform: rotate(15deg); - transform: rotate(15deg); - } - 8%, 24% { - -webkit-transform: rotate(-18deg); - transform: rotate(-18deg); - } - 12%, 28% { - -webkit-transform: rotate(18deg); - transform: rotate(18deg); - } - 16% { - -webkit-transform: rotate(-22deg); - transform: rotate(-22deg); - } - 20% { - -webkit-transform: rotate(22deg); - transform: rotate(22deg); - } - 32% { - -webkit-transform: rotate(-12deg); - transform: rotate(-12deg); - } - 36% { - -webkit-transform: rotate(12deg); - transform: rotate(12deg); - } - 40%, 100% { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - } -} -@keyframes fa-shake { - 0% { - -webkit-transform: rotate(-15deg); - transform: rotate(-15deg); - } - 4% { - -webkit-transform: rotate(15deg); - transform: rotate(15deg); - } - 8%, 24% { - -webkit-transform: rotate(-18deg); - transform: rotate(-18deg); - } - 12%, 28% { - -webkit-transform: rotate(18deg); - transform: rotate(18deg); - } - 16% { - -webkit-transform: rotate(-22deg); - transform: rotate(-22deg); - } - 20% { - -webkit-transform: rotate(22deg); - transform: rotate(22deg); - } - 32% { - -webkit-transform: rotate(-12deg); - transform: rotate(-12deg); - } - 36% { - -webkit-transform: rotate(12deg); - transform: rotate(12deg); - } - 40%, 100% { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - } -} -@-webkit-keyframes fa-spin { - 0% { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - } - 100% { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); - } -} -@keyframes fa-spin { - 0% { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - } - 100% { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); - } -} -.fa-rotate-90 { - -webkit-transform: rotate(90deg); - transform: rotate(90deg); -} - -.fa-rotate-180 { - -webkit-transform: rotate(180deg); - transform: rotate(180deg); -} - -.fa-rotate-270 { - -webkit-transform: rotate(270deg); - transform: rotate(270deg); -} - -.fa-flip-horizontal { - -webkit-transform: scale(-1, 1); - transform: scale(-1, 1); -} - -.fa-flip-vertical { - -webkit-transform: scale(1, -1); - transform: scale(1, -1); -} - -.fa-flip-both, -.fa-flip-horizontal.fa-flip-vertical { - -webkit-transform: scale(-1, -1); - transform: scale(-1, -1); -} - -.fa-rotate-by { - -webkit-transform: rotate(var(--fa-rotate-angle, none)); - transform: rotate(var(--fa-rotate-angle, none)); -} - -.fa-stack { - display: inline-block; - vertical-align: middle; - height: 2em; - position: relative; - width: 2.5em; -} - -.fa-stack-1x, -.fa-stack-2x { - bottom: 0; - left: 0; - margin: auto; - position: absolute; - right: 0; - top: 0; - z-index: var(--fa-stack-z-index, auto); -} - -.svg-inline--fa.fa-stack-1x { - height: 1em; - width: 1.25em; -} -.svg-inline--fa.fa-stack-2x { - height: 2em; - width: 2.5em; -} - -.fa-inverse { - color: var(--fa-inverse, #fff); -} - -.sr-only, -.fa-sr-only { - position: absolute; - width: 1px; - height: 1px; - padding: 0; - margin: -1px; - overflow: hidden; - clip: rect(0, 0, 0, 0); - white-space: nowrap; - border-width: 0; -} - -.sr-only-focusable:not(:focus), -.fa-sr-only-focusable:not(:focus) { - position: absolute; - width: 1px; - height: 1px; - padding: 0; - margin: -1px; - overflow: hidden; - clip: rect(0, 0, 0, 0); - white-space: nowrap; - border-width: 0; -} - -.svg-inline--fa .fa-primary { - fill: var(--fa-primary-color, currentColor); - opacity: var(--fa-primary-opacity, 1); -} - -.svg-inline--fa .fa-secondary { - fill: var(--fa-secondary-color, currentColor); - opacity: var(--fa-secondary-opacity, 0.4); -} - -.svg-inline--fa.fa-swap-opacity .fa-primary { - opacity: var(--fa-secondary-opacity, 0.4); -} - -.svg-inline--fa.fa-swap-opacity .fa-secondary { - opacity: var(--fa-primary-opacity, 1); -} - -.svg-inline--fa mask .fa-primary, -.svg-inline--fa mask .fa-secondary { - fill: black; -} - -.fad.fa-inverse, -.fa-duotone.fa-inverse { - color: var(--fa-inverse, #fff); -<<<<<<<< HEAD:src/web/assets/field/dist/assets/vizy-1d31d33d.js -}`;function cN(){var t=rN,e=iN,n=tt.cssPrefix,r=tt.replacementClass,i=Ite;if(n!==t||r!==e){var o=new RegExp("\\.".concat(t,"\\-"),"g"),s=new RegExp("\\--".concat(t,"\\-"),"g"),l=new RegExp("\\.".concat(e),"g");i=i.replace(o,".".concat(n,"-")).replace(s,"--".concat(n,"-")).replace(l,".".concat(r))}return i}var lE=!1;function oy(){tt.autoAddCss&&!lE&&(Ate(cN()),lE=!0)}var Pte={mixout:function(){return{dom:{css:cN,insertCss:oy}}},hooks:function(){return{beforeDOMElementCreation:function(){oy()},beforeI2svg:function(){oy()}}}},Zo=sa||{};Zo[Xo]||(Zo[Xo]={});Zo[Xo].styles||(Zo[Xo].styles={});Zo[Xo].hooks||(Zo[Xo].hooks={});Zo[Xo].shims||(Zo[Xo].shims=[]);var Bi=Zo[Xo],fN=[],Dte=function t(){rn.removeEventListener("DOMContentLoaded",t),Zm=1,fN.map(function(e){return e()})},Zm=!1;ls&&(Zm=(rn.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(rn.readyState),Zm||rn.addEventListener("DOMContentLoaded",Dte));function Rte(t){ls&&(Zm?setTimeout(t,0):fN.push(t))}function Vd(t){var e=t.tag,n=t.attributes,r=n===void 0?{}:n,i=t.children,o=i===void 0?[]:i;return typeof t=="string"?uN(t):"<".concat(e," ").concat(Mte(r),">").concat(o.map(Vd).join(""),"")}function uE(t,e,n){if(t&&t[e]&&t[e][n])return{prefix:e,iconName:n,icon:t[e][n]}}var zte=function(e,n){return function(r,i,o,s){return e.call(n,r,i,o,s)}},sy=function(e,n,r,i){var o=Object.keys(e),s=o.length,l=i!==void 0?zte(n,i):n,u,f,d;for(r===void 0?(u=1,d=e[o[0]]):(u=0,d=r);u=55296&&i<=56319&&n=55296&&r<=56319&&n>e+1&&(i=t.charCodeAt(e+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}function cE(t){return Object.keys(t).reduce(function(e,n){var r=t[n],i=!!r.icon;return i?e[r.iconName]=r.icon:e[n]=r,e},{})}function l1(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.skipHooks,i=r===void 0?!1:r,o=cE(e);typeof Bi.hooks.addPack=="function"&&!i?Bi.hooks.addPack(t,cE(e)):Bi.styles[t]=Ue(Ue({},Bi.styles[t]||{}),o),t==="fas"&&l1("fa",e)}var cp,fp,dp,vu=Bi.styles,Hte=Bi.shims,Fte=(cp={},Fn(cp,nn,Object.values(gd[nn])),Fn(cp,mn,Object.values(gd[mn])),cp),Rw=null,dN={},hN={},pN={},mN={},gN={},Vte=(fp={},Fn(fp,nn,Object.keys(pd[nn])),Fn(fp,mn,Object.keys(pd[mn])),fp);function jte(t){return~xte.indexOf(t)}function Wte(t,e){var n=e.split("-"),r=n[0],i=n.slice(1).join("-");return r===t&&i!==""&&!jte(i)?i:null}var vN=function(){var e=function(o){return sy(vu,function(s,l,u){return s[u]=sy(l,o,{}),s},{})};dN=e(function(i,o,s){if(o[3]&&(i[o[3]]=s),o[2]){var l=o[2].filter(function(u){return typeof u=="number"});l.forEach(function(u){i[u.toString(16)]=s})}return i}),hN=e(function(i,o,s){if(i[s]=s,o[2]){var l=o[2].filter(function(u){return typeof u=="string"});l.forEach(function(u){i[u]=s})}return i}),gN=e(function(i,o,s){var l=o[2];return i[s]=s,l.forEach(function(u){i[u]=s}),i});var n="far"in vu||tt.autoFetchSvg,r=sy(Hte,function(i,o){var s=o[0],l=o[1],u=o[2];return l==="far"&&!n&&(l="fas"),typeof s=="string"&&(i.names[s]={prefix:l,iconName:u}),typeof s=="number"&&(i.unicodes[s.toString(16)]={prefix:l,iconName:u}),i},{names:{},unicodes:{}});pN=r.names,mN=r.unicodes,Rw=ov(tt.styleDefault,{family:tt.familyDefault})};Ete(function(t){Rw=ov(t.styleDefault,{family:tt.familyDefault})});vN();function zw(t,e){return(dN[t]||{})[e]}function Ute(t,e){return(hN[t]||{})[e]}function Ga(t,e){return(gN[t]||{})[e]}function yN(t){return pN[t]||{prefix:null,iconName:null}}function qte(t){var e=mN[t],n=zw("fas",t);return e||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}function aa(){return Rw}var Bw=function(){return{prefix:null,iconName:null,rest:[]}};function ov(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.family,r=n===void 0?nn:n,i=pd[r][t],o=md[r][t]||md[r][i],s=t in Bi.styles?t:null;return o||s||null}var fE=(dp={},Fn(dp,nn,Object.keys(gd[nn])),Fn(dp,mn,Object.keys(gd[mn])),dp);function sv(t){var e,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.skipLookups,i=r===void 0?!1:r,o=(e={},Fn(e,nn,"".concat(tt.cssPrefix,"-").concat(nn)),Fn(e,mn,"".concat(tt.cssPrefix,"-").concat(mn)),e),s=null,l=nn;(t.includes(o[nn])||t.some(function(f){return fE[nn].includes(f)}))&&(l=nn),(t.includes(o[mn])||t.some(function(f){return fE[mn].includes(f)}))&&(l=mn);var u=t.reduce(function(f,d){var m=Wte(tt.cssPrefix,d);if(vu[d]?(d=Fte[l].includes(d)?vte[l][d]:d,s=d,f.prefix=d):Vte[l].indexOf(d)>-1?(s=d,f.prefix=ov(d,{family:l})):m?f.iconName=m:d!==tt.replacementClass&&d!==o[nn]&&d!==o[mn]&&f.rest.push(d),!i&&f.prefix&&f.iconName){var v=s==="fa"?yN(f.iconName):{},y=Ga(f.prefix,f.iconName);v.prefix&&(s=null),f.iconName=v.iconName||y||f.iconName,f.prefix=v.prefix||f.prefix,f.prefix==="far"&&!vu.far&&vu.fas&&!tt.autoFetchSvg&&(f.prefix="fas")}return f},Bw());return(t.includes("fa-brands")||t.includes("fab"))&&(u.prefix="fab"),(t.includes("fa-duotone")||t.includes("fad"))&&(u.prefix="fad"),!u.prefix&&l===mn&&(vu.fass||tt.autoFetchSvg)&&(u.prefix="fass",u.iconName=Ga(u.prefix,u.iconName)||u.iconName),(u.prefix==="fa"||s==="fa")&&(u.prefix=aa()||"fas"),u}var Kte=function(){function t(){ote(this,t),this.definitions={}}return ste(t,[{key:"add",value:function(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o0&&d.forEach(function(m){typeof m=="string"&&(n[l][m]=f)}),n[l][u]=f}),n}}]),t}(),dE=[],yu={},Iu={},Gte=Object.keys(Iu);function Yte(t,e){var n=e.mixoutsTo;return dE=t,yu={},Object.keys(Iu).forEach(function(r){Gte.indexOf(r)===-1&&delete Iu[r]}),dE.forEach(function(r){var i=r.mixout?r.mixout():{};if(Object.keys(i).forEach(function(s){typeof i[s]=="function"&&(n[s]=i[s]),Xm(i[s])==="object"&&Object.keys(i[s]).forEach(function(l){n[s]||(n[s]={}),n[s][l]=i[s][l]})}),r.hooks){var o=r.hooks();Object.keys(o).forEach(function(s){yu[s]||(yu[s]=[]),yu[s].push(o[s])})}r.provides&&r.provides(Iu)}),n}function u1(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i1?e-1:0),r=1;r0&&arguments[0]!==void 0?arguments[0]:{};return ls?(Sl("beforeI2svg",e),Qo("pseudoElements2svg",e),Qo("i2svg",e)):Promise.reject("Operation requires a DOM of some kind.")},watch:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.autoReplaceSvgRoot;tt.autoReplaceSvg===!1&&(tt.autoReplaceSvg=!0),tt.observeMutations=!0,Rte(function(){Qte({autoReplaceSvgRoot:n}),Sl("watch",e)})}},Zte={icon:function(e){if(e===null)return null;if(Xm(e)==="object"&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:Ga(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&e.length===2){var n=e[1].indexOf("fa-")===0?e[1].slice(3):e[1],r=ov(e[0]);return{prefix:r,iconName:Ga(r,n)||n}}if(typeof e=="string"&&(e.indexOf("".concat(tt.cssPrefix,"-"))>-1||e.match(yte))){var i=sv(e.split(" "),{skipLookups:!0});return{prefix:i.prefix||aa(),iconName:Ga(i.prefix,i.iconName)||i.iconName}}if(typeof e=="string"){var o=aa();return{prefix:o,iconName:Ga(o,e)||e}}}},ui={noAuto:Jte,config:tt,dom:Xte,parse:Zte,library:bN,findIconDefinition:c1,toHtml:Vd},Qte=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.autoReplaceSvgRoot,r=n===void 0?rn:n;(Object.keys(Bi.styles).length>0||tt.autoFetchSvg)&&ls&&tt.autoReplaceSvg&&ui.dom.i2svg({node:r})};function av(t,e){return Object.defineProperty(t,"abstract",{get:e}),Object.defineProperty(t,"html",{get:function(){return t.abstract.map(function(r){return Vd(r)})}}),Object.defineProperty(t,"node",{get:function(){if(ls){var r=rn.createElement("div");return r.innerHTML=t.html,r.children}}}),t}function ene(t){var e=t.children,n=t.main,r=t.mask,i=t.attributes,o=t.styles,s=t.transform;if(Dw(s)&&n.found&&!r.found){var l=n.width,u=n.height,f={x:l/u/2,y:.5};i.style=iv(Ue(Ue({},o),{},{"transform-origin":"".concat(f.x+s.x/16,"em ").concat(f.y+s.y/16,"em")}))}return[{tag:"svg",attributes:i,children:e}]}function tne(t){var e=t.prefix,n=t.iconName,r=t.children,i=t.attributes,o=t.symbol,s=o===!0?"".concat(e,"-").concat(tt.cssPrefix,"-").concat(n):o;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:Ue(Ue({},i),{},{id:s}),children:r}]}]}function $w(t){var e=t.icons,n=e.main,r=e.mask,i=t.prefix,o=t.iconName,s=t.transform,l=t.symbol,u=t.title,f=t.maskId,d=t.titleId,m=t.extra,v=t.watchable,y=v===void 0?!1:v,_=r.found?r:n,C=_.width,x=_.height,k=i==="fak",A=[tt.replacementClass,o?"".concat(tt.cssPrefix,"-").concat(o):""].filter(function(z){return m.classes.indexOf(z)===-1}).filter(function(z){return z!==""||!!z}).concat(m.classes).join(" "),N={children:[],attributes:Ue(Ue({},m.attributes),{},{"data-prefix":i,"data-icon":o,class:A,role:m.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(C," ").concat(x)})},E=k&&!~m.classes.indexOf("fa-fw")?{width:"".concat(C/x*16*.0625,"em")}:{};y&&(N.attributes[xl]=""),u&&(N.children.push({tag:"title",attributes:{id:N.attributes["aria-labelledby"]||"title-".concat(d||yd())},children:[u]}),delete N.attributes.title);var H=Ue(Ue({},N),{},{prefix:i,iconName:o,main:n,mask:r,maskId:f,transform:s,symbol:l,styles:Ue(Ue({},E),m.styles)}),I=r.found&&n.found?Qo("generateAbstractMask",H)||{children:[],attributes:{}}:Qo("generateAbstractIcon",H)||{children:[],attributes:{}},q=I.children,P=I.attributes;return H.children=q,H.attributes=P,l?tne(H):ene(H)}function hE(t){var e=t.content,n=t.width,r=t.height,i=t.transform,o=t.title,s=t.extra,l=t.watchable,u=l===void 0?!1:l,f=Ue(Ue(Ue({},s.attributes),o?{title:o}:{}),{},{class:s.classes.join(" ")});u&&(f[xl]="");var d=Ue({},s.styles);Dw(i)&&(d.transform=Nte({transform:i,startCentered:!0,width:n,height:r}),d["-webkit-transform"]=d.transform);var m=iv(d);m.length>0&&(f.style=m);var v=[];return v.push({tag:"span",attributes:f,children:[e]}),o&&v.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),v}function nne(t){var e=t.content,n=t.title,r=t.extra,i=Ue(Ue(Ue({},r.attributes),n?{title:n}:{}),{},{class:r.classes.join(" ")}),o=iv(r.styles);o.length>0&&(i.style=o);var s=[];return s.push({tag:"span",attributes:i,children:[e]}),n&&s.push({tag:"span",attributes:{class:"sr-only"},children:[n]}),s}var ay=Bi.styles;function f1(t){var e=t[0],n=t[1],r=t.slice(4),i=Ow(r,1),o=i[0],s=null;return Array.isArray(o)?s={tag:"g",attributes:{class:"".concat(tt.cssPrefix,"-").concat(Ka.GROUP)},children:[{tag:"path",attributes:{class:"".concat(tt.cssPrefix,"-").concat(Ka.SECONDARY),fill:"currentColor",d:o[0]}},{tag:"path",attributes:{class:"".concat(tt.cssPrefix,"-").concat(Ka.PRIMARY),fill:"currentColor",d:o[1]}}]}:s={tag:"path",attributes:{fill:"currentColor",d:o}},{found:!0,width:e,height:n,icon:s}}var rne={found:!1,width:512,height:512};function ine(t,e){!oN&&!tt.showMissingIcons&&t&&console.error('Icon with name "'.concat(t,'" and prefix "').concat(e,'" is missing.'))}function d1(t,e){var n=e;return e==="fa"&&tt.styleDefault!==null&&(e=aa()),new Promise(function(r,i){if(Qo("missingIconAbstract"),n==="fa"){var o=yN(t)||{};t=o.iconName||t,e=o.prefix||e}if(t&&e&&ay[e]&&ay[e][t]){var s=ay[e][t];return r(f1(s))}ine(t,e),r(Ue(Ue({},rne),{},{icon:tt.showMissingIcons&&t?Qo("missingIconAbstract")||{}:{}}))})}var pE=function(){},h1=tt.measurePerformance&&ip&&ip.mark&&ip.measure?ip:{mark:pE,measure:pE},of='FA "6.4.0"',one=function(e){return h1.mark("".concat(of," ").concat(e," begins")),function(){return _N(e)}},_N=function(e){h1.mark("".concat(of," ").concat(e," ends")),h1.measure("".concat(of," ").concat(e),"".concat(of," ").concat(e," begins"),"".concat(of," ").concat(e," ends"))},Hw={begin:one,end:_N},Dp=function(){};function mE(t){var e=t.getAttribute?t.getAttribute(xl):null;return typeof e=="string"}function sne(t){var e=t.getAttribute?t.getAttribute(Lw):null,n=t.getAttribute?t.getAttribute(Nw):null;return e&&n}function ane(t){return t&&t.classList&&t.classList.contains&&t.classList.contains(tt.replacementClass)}function lne(){if(tt.autoReplaceSvg===!0)return Rp.replace;var t=Rp[tt.autoReplaceSvg];return t||Rp.replace}function une(t){return rn.createElementNS("http://www.w3.org/2000/svg",t)}function cne(t){return rn.createElement(t)}function wN(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.ceFn,r=n===void 0?t.tag==="svg"?une:cne:n;if(typeof t=="string")return rn.createTextNode(t);var i=r(t.tag);Object.keys(t.attributes||[]).forEach(function(s){i.setAttribute(s,t.attributes[s])});var o=t.children||[];return o.forEach(function(s){i.appendChild(wN(s,{ceFn:r}))}),i}function fne(t){var e=" ".concat(t.outerHTML," ");return e="".concat(e,"Font Awesome fontawesome.com "),e}var Rp={replace:function(e){var n=e[0];if(n.parentNode)if(e[1].forEach(function(i){n.parentNode.insertBefore(wN(i),n)}),n.getAttribute(xl)===null&&tt.keepOriginalSource){var r=rn.createComment(fne(n));n.parentNode.replaceChild(r,n)}else n.remove()},nest:function(e){var n=e[0],r=e[1];if(~Pw(n).indexOf(tt.replacementClass))return Rp.replace(e);var i=new RegExp("".concat(tt.cssPrefix,"-.*"));if(delete r[0].attributes.id,r[0].attributes.class){var o=r[0].attributes.class.split(" ").reduce(function(l,u){return u===tt.replacementClass||u.match(i)?l.toSvg.push(u):l.toNode.push(u),l},{toNode:[],toSvg:[]});r[0].attributes.class=o.toSvg.join(" "),o.toNode.length===0?n.removeAttribute("class"):n.setAttribute("class",o.toNode.join(" "))}var s=r.map(function(l){return Vd(l)}).join(` -`);n.setAttribute(xl,""),n.innerHTML=s}};function gE(t){t()}function kN(t,e){var n=typeof e=="function"?e:Dp;if(t.length===0)n();else{var r=gE;tt.mutateApproach===mte&&(r=sa.requestAnimationFrame||gE),r(function(){var i=lne(),o=Hw.begin("mutate");t.map(i),o(),n()})}}var Fw=!1;function xN(){Fw=!0}function p1(){Fw=!1}var Qm=null;function vE(t){if(sE&&tt.observeMutations){var e=t.treeCallback,n=e===void 0?Dp:e,r=t.nodeCallback,i=r===void 0?Dp:r,o=t.pseudoElementsCallback,s=o===void 0?Dp:o,l=t.observeMutationsRoot,u=l===void 0?rn:l;Qm=new sE(function(f){if(!Fw){var d=aa();dc(f).forEach(function(m){if(m.type==="childList"&&m.addedNodes.length>0&&!mE(m.addedNodes[0])&&(tt.searchPseudoElements&&s(m.target),n(m.target)),m.type==="attributes"&&m.target.parentNode&&tt.searchPseudoElements&&s(m.target.parentNode),m.type==="attributes"&&mE(m.target)&&~kte.indexOf(m.attributeName))if(m.attributeName==="class"&&sne(m.target)){var v=sv(Pw(m.target)),y=v.prefix,_=v.iconName;m.target.setAttribute(Lw,y||d),_&&m.target.setAttribute(Nw,_)}else ane(m.target)&&i(m.target)})}}),ls&&Qm.observe(u,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function dne(){Qm&&Qm.disconnect()}function hne(t){var e=t.getAttribute("style"),n=[];return e&&(n=e.split(";").reduce(function(r,i){var o=i.split(":"),s=o[0],l=o.slice(1);return s&&l.length>0&&(r[s]=l.join(":").trim()),r},{})),n}function pne(t){var e=t.getAttribute("data-prefix"),n=t.getAttribute("data-icon"),r=t.innerText!==void 0?t.innerText.trim():"",i=sv(Pw(t));return i.prefix||(i.prefix=aa()),e&&n&&(i.prefix=e,i.iconName=n),i.iconName&&i.prefix||(i.prefix&&r.length>0&&(i.iconName=Ute(i.prefix,t.innerText)||zw(i.prefix,a1(t.innerText))),!i.iconName&&tt.autoFetchSvg&&t.firstChild&&t.firstChild.nodeType===Node.TEXT_NODE&&(i.iconName=t.firstChild.data)),i}function mne(t){var e=dc(t.attributes).reduce(function(i,o){return i.name!=="class"&&i.name!=="style"&&(i[o.name]=o.value),i},{}),n=t.getAttribute("title"),r=t.getAttribute("data-fa-title-id");return tt.autoA11y&&(n?e["aria-labelledby"]="".concat(tt.replacementClass,"-title-").concat(r||yd()):(e["aria-hidden"]="true",e.focusable="false")),e}function gne(){return{iconName:null,title:null,titleId:null,prefix:null,transform:po,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function yE(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0},n=pne(t),r=n.iconName,i=n.prefix,o=n.rest,s=mne(t),l=u1("parseNodeAttributes",{},t),u=e.styleParser?hne(t):[];return Ue({iconName:r,title:t.getAttribute("title"),titleId:t.getAttribute("data-fa-title-id"),prefix:i,transform:po,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:o,styles:u,attributes:s}},l)}var vne=Bi.styles;function SN(t){var e=tt.autoReplaceSvg==="nest"?yE(t,{styleParser:!1}):yE(t);return~e.extra.classes.indexOf(sN)?Qo("generateLayersText",t,e):Qo("generateSvgReplacementMutation",t,e)}var la=new Set;Iw.map(function(t){la.add("fa-".concat(t))});Object.keys(pd[nn]).map(la.add.bind(la));Object.keys(pd[mn]).map(la.add.bind(la));la=Hd(la);function bE(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!ls)return Promise.resolve();var n=rn.documentElement.classList,r=function(m){return n.add("".concat(aE,"-").concat(m))},i=function(m){return n.remove("".concat(aE,"-").concat(m))},o=tt.autoFetchSvg?la:Iw.map(function(d){return"fa-".concat(d)}).concat(Object.keys(vne));o.includes("fa")||o.push("fa");var s=[".".concat(sN,":not([").concat(xl,"])")].concat(o.map(function(d){return".".concat(d,":not([").concat(xl,"])")})).join(", ");if(s.length===0)return Promise.resolve();var l=[];try{l=dc(t.querySelectorAll(s))}catch{}if(l.length>0)r("pending"),i("complete");else return Promise.resolve();var u=Hw.begin("onTree"),f=l.reduce(function(d,m){try{var v=SN(m);v&&d.push(v)}catch(y){oN||y.name==="MissingIcon"&&console.error(y)}return d},[]);return new Promise(function(d,m){Promise.all(f).then(function(v){kN(v,function(){r("active"),r("complete"),i("pending"),typeof e=="function"&&e(),u(),d()})}).catch(function(v){u(),m(v)})})}function yne(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;SN(t).then(function(n){n&&kN([n],e)})}function bne(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=(e||{}).icon?e:c1(e||{}),i=n.mask;return i&&(i=(i||{}).icon?i:c1(i||{})),t(r,Ue(Ue({},n),{},{mask:i}))}}var _ne=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.transform,i=r===void 0?po:r,o=n.symbol,s=o===void 0?!1:o,l=n.mask,u=l===void 0?null:l,f=n.maskId,d=f===void 0?null:f,m=n.title,v=m===void 0?null:m,y=n.titleId,_=y===void 0?null:y,C=n.classes,x=C===void 0?[]:C,k=n.attributes,A=k===void 0?{}:k,N=n.styles,E=N===void 0?{}:N;if(e){var H=e.prefix,I=e.iconName,q=e.icon;return av(Ue({type:"icon"},e),function(){return Sl("beforeDOMElementCreation",{iconDefinition:e,params:n}),tt.autoA11y&&(v?A["aria-labelledby"]="".concat(tt.replacementClass,"-title-").concat(_||yd()):(A["aria-hidden"]="true",A.focusable="false")),$w({icons:{main:f1(q),mask:u?f1(u.icon):{found:!1,width:null,height:null,icon:{}}},prefix:H,iconName:I,transform:Ue(Ue({},po),i),symbol:s,title:v,maskId:d,titleId:_,extra:{attributes:A,styles:E,classes:x}})})}},wne={mixout:function(){return{icon:bne(_ne)}},hooks:function(){return{mutationObserverCallbacks:function(n){return n.treeCallback=bE,n.nodeCallback=yne,n}}},provides:function(e){e.i2svg=function(n){var r=n.node,i=r===void 0?rn:r,o=n.callback,s=o===void 0?function(){}:o;return bE(i,s)},e.generateSvgReplacementMutation=function(n,r){var i=r.iconName,o=r.title,s=r.titleId,l=r.prefix,u=r.transform,f=r.symbol,d=r.mask,m=r.maskId,v=r.extra;return new Promise(function(y,_){Promise.all([d1(i,l),d.iconName?d1(d.iconName,d.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(function(C){var x=Ow(C,2),k=x[0],A=x[1];y([n,$w({icons:{main:k,mask:A},prefix:l,iconName:i,transform:u,symbol:f,maskId:m,title:o,titleId:s,extra:v,watchable:!0})])}).catch(_)})},e.generateAbstractIcon=function(n){var r=n.children,i=n.attributes,o=n.main,s=n.transform,l=n.styles,u=iv(l);u.length>0&&(i.style=u);var f;return Dw(s)&&(f=Qo("generateAbstractTransformGrouping",{main:o,transform:s,containerWidth:o.width,iconWidth:o.width})),r.push(f||o.icon),{children:r,attributes:i}}}},kne={mixout:function(){return{layer:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.classes,o=i===void 0?[]:i;return av({type:"layer"},function(){Sl("beforeDOMElementCreation",{assembler:n,params:r});var s=[];return n(function(l){Array.isArray(l)?l.map(function(u){s=s.concat(u.abstract)}):s=s.concat(l.abstract)}),[{tag:"span",attributes:{class:["".concat(tt.cssPrefix,"-layers")].concat(Hd(o)).join(" ")},children:s}]})}}}},xne={mixout:function(){return{counter:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.title,o=i===void 0?null:i,s=r.classes,l=s===void 0?[]:s,u=r.attributes,f=u===void 0?{}:u,d=r.styles,m=d===void 0?{}:d;return av({type:"counter",content:n},function(){return Sl("beforeDOMElementCreation",{content:n,params:r}),nne({content:n.toString(),title:o,extra:{attributes:f,styles:m,classes:["".concat(tt.cssPrefix,"-layers-counter")].concat(Hd(l))}})})}}}},Sne={mixout:function(){return{text:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.transform,o=i===void 0?po:i,s=r.title,l=s===void 0?null:s,u=r.classes,f=u===void 0?[]:u,d=r.attributes,m=d===void 0?{}:d,v=r.styles,y=v===void 0?{}:v;return av({type:"text",content:n},function(){return Sl("beforeDOMElementCreation",{content:n,params:r}),hE({content:n,transform:Ue(Ue({},po),o),title:l,extra:{attributes:m,styles:y,classes:["".concat(tt.cssPrefix,"-layers-text")].concat(Hd(f))}})})}}},provides:function(e){e.generateLayersText=function(n,r){var i=r.title,o=r.transform,s=r.extra,l=null,u=null;if(nN){var f=parseInt(getComputedStyle(n).fontSize,10),d=n.getBoundingClientRect();l=d.width/f,u=d.height/f}return tt.autoA11y&&!i&&(s.attributes["aria-hidden"]="true"),Promise.resolve([n,hE({content:n.innerHTML,width:l,height:u,transform:o,title:i,extra:s,watchable:!0})])}}},Cne=new RegExp('"',"ug"),_E=[1105920,1112319];function Tne(t){var e=t.replace(Cne,""),n=$te(e,0),r=n>=_E[0]&&n<=_E[1],i=e.length===2?e[0]===e[1]:!1;return{value:a1(i?e[0]:e),isSecondary:r||i}}function wE(t,e){var n="".concat(pte).concat(e.replace(":","-"));return new Promise(function(r,i){if(t.getAttribute(n)!==null)return r();var o=dc(t.children),s=o.filter(function(q){return q.getAttribute(s1)===e})[0],l=sa.getComputedStyle(t,e),u=l.getPropertyValue("font-family").match(bte),f=l.getPropertyValue("font-weight"),d=l.getPropertyValue("content");if(s&&!u)return t.removeChild(s),r();if(u&&d!=="none"&&d!==""){var m=l.getPropertyValue("content"),v=~["Sharp"].indexOf(u[2])?mn:nn,y=~["Solid","Regular","Light","Thin","Duotone","Brands","Kit"].indexOf(u[2])?md[v][u[2].toLowerCase()]:_te[v][f],_=Tne(m),C=_.value,x=_.isSecondary,k=u[0].startsWith("FontAwesome"),A=zw(y,C),N=A;if(k){var E=qte(C);E.iconName&&E.prefix&&(A=E.iconName,y=E.prefix)}if(A&&!x&&(!s||s.getAttribute(Lw)!==y||s.getAttribute(Nw)!==N)){t.setAttribute(n,N),s&&t.removeChild(s);var H=gne(),I=H.extra;I.attributes[s1]=e,d1(A,y).then(function(q){var P=$w(Ue(Ue({},H),{},{icons:{main:q,mask:Bw()},prefix:y,iconName:N,extra:I,watchable:!0})),z=rn.createElement("svg");e==="::before"?t.insertBefore(z,t.firstChild):t.appendChild(z),z.outerHTML=P.map(function(w){return Vd(w)}).join(` -`),t.removeAttribute(n),r()}).catch(i)}else r()}else r()})}function Ene(t){return Promise.all([wE(t,"::before"),wE(t,"::after")])}function Ane(t){return t.parentNode!==document.head&&!~gte.indexOf(t.tagName.toUpperCase())&&!t.getAttribute(s1)&&(!t.parentNode||t.parentNode.tagName!=="svg")}function kE(t){if(ls)return new Promise(function(e,n){var r=dc(t.querySelectorAll("*")).filter(Ane).map(Ene),i=Hw.begin("searchPseudoElements");xN(),Promise.all(r).then(function(){i(),p1(),e()}).catch(function(){i(),p1(),n()})})}var One={hooks:function(){return{mutationObserverCallbacks:function(n){return n.pseudoElementsCallback=kE,n}}},provides:function(e){e.pseudoElements2svg=function(n){var r=n.node,i=r===void 0?rn:r;tt.searchPseudoElements&&kE(i)}}},xE=!1,Mne={mixout:function(){return{dom:{unwatch:function(){xN(),xE=!0}}}},hooks:function(){return{bootstrap:function(){vE(u1("mutationObserverCallbacks",{}))},noAuto:function(){dne()},watch:function(n){var r=n.observeMutationsRoot;xE?p1():vE(u1("mutationObserverCallbacks",{observeMutationsRoot:r}))}}}},SE=function(e){var n={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return e.toLowerCase().split(" ").reduce(function(r,i){var o=i.toLowerCase().split("-"),s=o[0],l=o.slice(1).join("-");if(s&&l==="h")return r.flipX=!0,r;if(s&&l==="v")return r.flipY=!0,r;if(l=parseFloat(l),isNaN(l))return r;switch(s){case"grow":r.size=r.size+l;break;case"shrink":r.size=r.size-l;break;case"left":r.x=r.x-l;break;case"right":r.x=r.x+l;break;case"up":r.y=r.y-l;break;case"down":r.y=r.y+l;break;case"rotate":r.rotate=r.rotate+l;break}return r},n)},Lne={mixout:function(){return{parse:{transform:function(n){return SE(n)}}}},hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-transform");return i&&(n.transform=SE(i)),n}}},provides:function(e){e.generateAbstractTransformGrouping=function(n){var r=n.main,i=n.transform,o=n.containerWidth,s=n.iconWidth,l={transform:"translate(".concat(o/2," 256)")},u="translate(".concat(i.x*32,", ").concat(i.y*32,") "),f="scale(".concat(i.size/16*(i.flipX?-1:1),", ").concat(i.size/16*(i.flipY?-1:1),") "),d="rotate(".concat(i.rotate," 0 0)"),m={transform:"".concat(u," ").concat(f," ").concat(d)},v={transform:"translate(".concat(s/2*-1," -256)")},y={outer:l,inner:m,path:v};return{tag:"g",attributes:Ue({},y.outer),children:[{tag:"g",attributes:Ue({},y.inner),children:[{tag:r.icon.tag,children:r.icon.children,attributes:Ue(Ue({},r.icon.attributes),y.path)}]}]}}}},ly={x:0,y:0,width:"100%",height:"100%"};function CE(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t.attributes&&(t.attributes.fill||e)&&(t.attributes.fill="black"),t}function Nne(t){return t.tag==="g"?t.children:[t]}var Ine={hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-mask"),o=i?sv(i.split(" ").map(function(s){return s.trim()})):Bw();return o.prefix||(o.prefix=aa()),n.mask=o,n.maskId=r.getAttribute("data-fa-mask-id"),n}}},provides:function(e){e.generateAbstractMask=function(n){var r=n.children,i=n.attributes,o=n.main,s=n.mask,l=n.maskId,u=n.transform,f=o.width,d=o.icon,m=s.width,v=s.icon,y=Lte({transform:u,containerWidth:m,iconWidth:f}),_={tag:"rect",attributes:Ue(Ue({},ly),{},{fill:"white"})},C=d.children?{children:d.children.map(CE)}:{},x={tag:"g",attributes:Ue({},y.inner),children:[CE(Ue({tag:d.tag,attributes:Ue(Ue({},d.attributes),y.path)},C))]},k={tag:"g",attributes:Ue({},y.outer),children:[x]},A="mask-".concat(l||yd()),N="clip-".concat(l||yd()),E={tag:"mask",attributes:Ue(Ue({},ly),{},{id:A,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[_,k]},H={tag:"defs",children:[{tag:"clipPath",attributes:{id:N},children:Nne(v)},E]};return r.push(H,{tag:"rect",attributes:Ue({fill:"currentColor","clip-path":"url(#".concat(N,")"),mask:"url(#".concat(A,")")},ly)}),{children:r,attributes:i}}}},Pne={provides:function(e){var n=!1;sa.matchMedia&&(n=sa.matchMedia("(prefers-reduced-motion: reduce)").matches),e.missingIconAbstract=function(){var r=[],i={fill:"currentColor"},o={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};r.push({tag:"path",attributes:Ue(Ue({},i),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});var s=Ue(Ue({},o),{},{attributeName:"opacity"}),l={tag:"circle",attributes:Ue(Ue({},i),{},{cx:"256",cy:"364",r:"28"}),children:[]};return n||l.children.push({tag:"animate",attributes:Ue(Ue({},o),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:Ue(Ue({},s),{},{values:"1;0;1;1;0;1;"})}),r.push(l),r.push({tag:"path",attributes:Ue(Ue({},i),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:n?[]:[{tag:"animate",attributes:Ue(Ue({},s),{},{values:"1;0;0;0;0;1;"})}]}),n||r.push({tag:"path",attributes:Ue(Ue({},i),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:Ue(Ue({},s),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:r}}}},Dne={hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-symbol"),o=i===null?!1:i===""?!0:i;return n.symbol=o,n}}}},Rne=[Pte,wne,kne,xne,Sne,One,Mne,Lne,Ine,Pne,Dne];Yte(Rne,{mixoutsTo:ui});ui.noAuto;ui.config;var zne=ui.library;ui.dom;var m1=ui.parse;ui.findIconDefinition;ui.toHtml;var Bne=ui.icon;ui.layer;ui.text;ui.counter;function TE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ho(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function Hne(t,e){if(t==null)return{};var n=$ne(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}var Fne=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},CN={exports:{}};(function(t){(function(e){var n=function(k,A,N){if(!f(A)||m(A)||v(A)||y(A)||u(A))return A;var E,H=0,I=0;if(d(A))for(E=[],I=A.length;H1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof t=="string")return t;var r=(t.children||[]).map(function(u){return TN(u)}),i=Object.keys(t.attributes||{}).reduce(function(u,f){var d=t.attributes[f];switch(f){case"class":u.class=Une(d);break;case"style":u.style=Wne(d);break;default:u.attrs[f]=d}return u},{attrs:{},class:{},style:{}});n.class;var o=n.style,s=o===void 0?{}:o,l=Hne(n,jne);return Hr(t.tag,Ho(Ho(Ho({},e),{},{class:i.class,style:Ho(Ho({},i.style),s)},i.attrs),l),r)}var EN=!1;try{EN=!0}catch{}function qne(){if(!EN&&console&&typeof console.error=="function"){var t;(t=console).error.apply(t,arguments)}}function uy(t,e){return Array.isArray(e)&&e.length>0||!Array.isArray(e)&&e?Pr({},t,e):{}}function Kne(t){var e,n=(e={"fa-spin":t.spin,"fa-pulse":t.pulse,"fa-fw":t.fixedWidth,"fa-border":t.border,"fa-li":t.listItem,"fa-inverse":t.inverse,"fa-flip":t.flip===!0,"fa-flip-horizontal":t.flip==="horizontal"||t.flip==="both","fa-flip-vertical":t.flip==="vertical"||t.flip==="both"},Pr(e,"fa-".concat(t.size),t.size!==null),Pr(e,"fa-rotate-".concat(t.rotation),t.rotation!==null),Pr(e,"fa-pull-".concat(t.pull),t.pull!==null),Pr(e,"fa-swap-opacity",t.swapOpacity),Pr(e,"fa-bounce",t.bounce),Pr(e,"fa-shake",t.shake),Pr(e,"fa-beat",t.beat),Pr(e,"fa-fade",t.fade),Pr(e,"fa-beat-fade",t.beatFade),Pr(e,"fa-flash",t.flash),Pr(e,"fa-spin-pulse",t.spinPulse),Pr(e,"fa-spin-reverse",t.spinReverse),e);return Object.keys(n).map(function(r){return n[r]?r:null}).filter(function(r){return r})}function EE(t){if(t&&eg(t)==="object"&&t.prefix&&t.iconName&&t.icon)return t;if(m1.icon)return m1.icon(t);if(t===null)return null;if(eg(t)==="object"&&t.prefix&&t.iconName)return t;if(Array.isArray(t)&&t.length===2)return{prefix:t[0],iconName:t[1]};if(typeof t=="string")return{prefix:"fas",iconName:t}}var Gne=Vn({name:"FontAwesomeIcon",props:{border:{type:Boolean,default:!1},fixedWidth:{type:Boolean,default:!1},flip:{type:[Boolean,String],default:!1,validator:function(e){return[!0,!1,"horizontal","vertical","both"].indexOf(e)>-1}},icon:{type:[Object,Array,String],required:!0},mask:{type:[Object,Array,String],default:null},listItem:{type:Boolean,default:!1},pull:{type:String,default:null,validator:function(e){return["right","left"].indexOf(e)>-1}},pulse:{type:Boolean,default:!1},rotation:{type:[String,Number],default:null,validator:function(e){return[90,180,270].indexOf(Number.parseInt(e,10))>-1}},swapOpacity:{type:Boolean,default:!1},size:{type:String,default:null,validator:function(e){return["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"].indexOf(e)>-1}},spin:{type:Boolean,default:!1},transform:{type:[String,Object],default:null},symbol:{type:[Boolean,String],default:!1},title:{type:String,default:null},inverse:{type:Boolean,default:!1},bounce:{type:Boolean,default:!1},shake:{type:Boolean,default:!1},beat:{type:Boolean,default:!1},fade:{type:Boolean,default:!1},beatFade:{type:Boolean,default:!1},flash:{type:Boolean,default:!1},spinPulse:{type:Boolean,default:!1},spinReverse:{type:Boolean,default:!1}},setup:function(e,n){var r=n.attrs,i=er(function(){return EE(e.icon)}),o=er(function(){return uy("classes",Kne(e))}),s=er(function(){return uy("transform",typeof e.transform=="string"?m1.transform(e.transform):e.transform)}),l=er(function(){return uy("mask",EE(e.mask))}),u=er(function(){return Bne(i.value,Ho(Ho(Ho(Ho({},o.value),s.value),l.value),{},{symbol:e.symbol,title:e.title}))});En(u,function(d){if(!d)return qne("Could not find one or more icon(s)",i.value,l.value)},{immediate:!0});var f=er(function(){return u.value?TN(u.value.abstract[0],{},r):null});return function(){return f.value}}}),Yne={prefix:"fas",iconName:"align-justify",icon:[448,512,[],"f039","M448 64c0-17.7-14.3-32-32-32H32C14.3 32 0 46.3 0 64S14.3 96 32 96H416c17.7 0 32-14.3 32-32zm0 256c0-17.7-14.3-32-32-32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32zM0 192c0 17.7 14.3 32 32 32H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H32c-17.7 0-32 14.3-32 32zM448 448c0-17.7-14.3-32-32-32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32z"]},Jne={prefix:"fas",iconName:"highlighter",icon:[576,512,[],"f591","M315 315l158.4-215L444.1 70.6 229 229 315 315zm-187 5l0 0V248.3c0-15.3 7.2-29.6 19.5-38.6L420.6 8.4C428 2.9 437 0 446.2 0c11.4 0 22.4 4.5 30.5 12.6l54.8 54.8c8.1 8.1 12.6 19 12.6 30.5c0 9.2-2.9 18.2-8.4 25.6L334.4 396.5c-9 12.3-23.4 19.5-38.6 19.5H224l-25.4 25.4c-12.5 12.5-32.8 12.5-45.3 0l-50.7-50.7c-12.5-12.5-12.5-32.8 0-45.3L128 320zM7 466.3l63-63 70.6 70.6-31 31c-4.5 4.5-10.6 7-17 7H24c-13.3 0-24-10.7-24-24v-4.7c0-6.4 2.5-12.5 7-17z"]},Xne={prefix:"fas",iconName:"image",icon:[512,512,[],"f03e","M0 96C0 60.7 28.7 32 64 32H448c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6h96 32H424c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]},Zne={prefix:"fas",iconName:"align-left",icon:[448,512,[],"f036","M288 64c0 17.7-14.3 32-32 32H32C14.3 96 0 81.7 0 64S14.3 32 32 32H256c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H256c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"]},Qne={prefix:"fas",iconName:"align-center",icon:[448,512,[],"f037","M352 64c0-17.7-14.3-32-32-32H128c-17.7 0-32 14.3-32 32s14.3 32 32 32H320c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H32c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32H128c-17.7 0-32 14.3-32 32s14.3 32 32 32H320c17.7 0 32-14.3 32-32z"]},ere={prefix:"fas",iconName:"paragraph",icon:[448,512,[182],"f1dd","M192 32h64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H384l0 352c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-352H288V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V352H192c-88.4 0-160-71.6-160-160s71.6-160 160-160z"]},tre={prefix:"fas",iconName:"align-right",icon:[448,512,[],"f038","M448 64c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"]};zne.add(ere,Jne,Zne,tre,Qne,Yne,Xne);const nre={name:"SvgIcon",components:{FontAwesomeIcon:Gne},props:{content:{type:Object,default:()=>{}}},data(){return{defaultSvgs:{bold:'',underline:'',italic:'',strikethrough:'',link:'',unlink:'',"file-code":'',"page-break":'',"remove-format":'',"quote-right":'',"list-ul":'',"list-ol":'',h1:'',h2:'',h3:'',h4:'',h5:'',h6:'',"horizontal-rule":'',code:'',"brackets-curly":'',undo:'',redo:'',subscript:'',superscript:'',table:'',"rectangle-code":'',"photo-film":'',text:''}}},computed:{getSvg(){return this.content.svg&&this.content.svg.startsWith("0&&this.selectedIndex--},moveSelectionDown(){this.selectedIndex=0&&Math.floor(this.selectedIndex/Math.ceil(this.items.length/3))>0){const e=this.selectedIndex-Math.ceil(this.items.length/3);this.selectedIndex=e}},moveSelectionRight(){if(this.selectedIndex>=0&&Math.floor(this.selectedIndex/Math.ceil(this.items.length/3))<2){const e=this.selectedIndex+Math.ceil(this.items.length/3);e=0,n={Mod:e?"⌘":"Ctrl",Alt:e?"⌥":"Alt",Shift:e?"⇧":"Shift",Ctrl:e?"⌃":"Ctrl"};return t.split("-").map(r=>n[r]||r)}}},sre={key:0,class:"vui-command-items",style:{"max-height":"216px"}},are={class:"vui-command-items-wrap"},lre=["onClick"],ure={class:"vui-command-item-label"},cre={class:"vui-command-info",style:{"min-height":"32px"}},fre={class:"vui-command-info-left"},dre={class:"vui-command-info-shortcut"},hre={key:0,class:"vui-command-info-shortcut-label"},pre={key:1,class:"vui-command-items-empty"};function mre(t,e,n,r,i,o){const s=ut("svg-icon");return n.items.length?(ge(),Se("div",sre,[ee("div",are,[(ge(!0),Se(kt,null,Zt(o.columns,(l,u)=>(ge(),Se("div",{key:u,class:"vui-command-column"},[(ge(!0),Se(kt,null,Zt(l,(f,d)=>(ge(),Se("button",{key:d,class:gt(["vui-command-item",{"is-selected":i.selectedIndex===o.getItemIndex(d,u)}]),onClick:m=>o.selectItem(o.getItemIndex(d,u))},[Qe(s,{content:f,class:"vui-command-item-icon"},null,8,["content"]),ee("span",ure,Ne(f.title),1)],10,lre))),128))]))),128))]),ee("div",cre,[ee("div",fre,[ee("div",dre,[o.shortcutInfo.label?(ge(),Se("div",hre,Ne(o.shortcutInfo.label),1)):_t("",!0),(ge(!0),Se(kt,null,Zt(o.shortcutInfo.icons,(l,u)=>(ge(),Se("div",{key:u,class:"vui-command-info-shortcut-img"},Ne(l),1))),128))])])])])):(ge(),Se("div",pre,Ne(t.t("vizy","No items found.")),1))}const gre=Bt(ore,[["render",mre]]),vre={items:t=>{const{vizyField:e}=t.editor,n=e.settings,r=Craft.Vizy.Config.getCommands();let i=[],o=["h1","h2","h3","unordered-list","ordered-list","media-embed","link","image","code-block","blockquote","hr"];n.vizyConfig.commands&&(o=n.vizyConfig.commands),o.forEach(l=>{const u=r.find(f=>f.name===l);u&&i.push(u)});let s=["paragraph","code-block","blockquote","h1","h2","h3","h4","h5","h6"];return n.vizyConfig.formatting&&n.vizyConfig.formatting.length&&(s=n.vizyConfig.formatting),s=[...s,...e.buttons],i.forEach((l,u)=>{s.includes(l.name)||i.splice(u,1)}),e.richTextEnabled||(i=[]),n.blockGroups.forEach(l=>{l.blockTypes.forEach(u=>{i.push({name:u.handle,svg:u.icon.svg,title:u.name,command:({editor:f,range:d})=>{const m=Jm("vizy-block-"),v={type:u.id},{fieldsHtml:y,footHtml:_}=u;f.vizyField.setCachedFieldHtml(m,y),f.vizyField.setCachedFieldJs(m,_),f.chain().focus().deleteRange(d).setVizyBlock({id:m,values:v}).run(),setTimeout(()=>{f.vizyField.$events.emit("vizy-blocks:addedBlock")},50)}})})}),i.filter(l=>l.title.toLowerCase().startsWith(t.query.toLowerCase()))},render:()=>{let t,e;return{onStart:n=>{t=new KL(gre,{props:n,editor:n.editor}),n.clientRect&&(e=Kr("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"top-start",theme:"light-border vui-command-dropdown",maxWidth:"600px",duration:200}))},onUpdate(n){t.updateProps(n),n.clientRect&&e[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(n){var r;return n.event.key==="Escape"?(e[0].hide(),!0):(r=t.ref)==null?void 0:r.onKeyDown(n)},onExit(){e[0].destroy(),t.destroy()}}}},yre=t=>{const e=[],n={},r=[];return Object.entries(t.settings.vizyConfig).forEach(([i,o])=>{(i==="buttons"||i==="formatting")&&o.forEach(s=>{gr(s)&&(Array.isArray(n[s.type])||(n[s.type]=[]),Object.keys(s.attrs).forEach(l=>{n[s.type].includes(l)||n[s.type].push(l)}),s.editorStyle&&e.push(s))})}),e.forEach(i=>{const o=Gj(`${i.type} ${i.title}`);if(!document.querySelector(`style#${o}`)){const s=document.createElement("style");s.id=o,s.innerHTML=`.vui-editor ${i.editorStyle}`,document.head.appendChild(s)}}),Object.entries(n).forEach(([i,o])=>{const s={};o.forEach(l=>{s[l]={default:null}}),r.push(ir.create({name:`${i}CustomAttributes`,addGlobalAttributes(){return[{types:[i],attributes:s}]}}))}),r},bre={name:"MenuBarItem",components:{SvgIcon:hc},props:{field:{type:Object,default:null},editor:{type:Object,default:null},icon:{type:String,default:null},svg:{type:String,default:null},name:{type:String,default:null},title:{type:String,default:null},action:{type:Function,default:()=>{}},isActive:{type:Function,default:()=>{}},options:{type:Array,default:()=>[]}},data(){return{tippy:null}},computed:{active(){return this.isActive&&this.isActive(this.editor)}},mounted(){this.$nextTick(()=>{if(this.hasDropdown){const t=this.$el.querySelector(`.vui-toolbar-dropdown-${this.name}`),e=this.$el;t&&e&&(t.style.display="block",this.tippy=Kr(e,{content:t,trigger:"click",allowHTML:!0,arrow:!1,interactive:!0,placement:"bottom-start",theme:"light-border toolbar-dropdown",duration:200,zIndex:1e3,hideOnClick:!0,offset:[0,1],onShown(n){n.popper.querySelector("button").focus()}}))}}),this._keyListener=function(t){t.key==="Escape"&&(t.preventDefault(),this.closeDropdown())},document.addEventListener("keydown",this._keyListener.bind(this))},beforeUnmount(){document.removeEventListener("keydown",this._keyListener)},methods:{hasDropdown(){return!!(this.options&&this.options.length)},optionActive(t){return t.isActive&&t.isActive(this.editor)},runAction(t){this.tippy&&this.tippy.hide(),t&&t(this.editor)},onMouseDown(t){t.preventDefault()},closeDropdown(){this.tippy&&this.tippy.hide()}}},_re={class:"vui-toolbar-dropdown-wrap"},wre=["onClick"];function kre(t,e,n,r,i,o){const s=ut("svg-icon"),l=sc("tooltip");return Ut((ge(),Se("button",{class:gt(["btn vui-toolbar-btn",{active:o.active}]),onClick:e[0]||(e[0]=lt(u=>o.runAction(n.action),["prevent"])),onMousedown:e[1]||(e[1]=(...u)=>o.onMouseDown&&o.onMouseDown(...u))},[Qe(s,{content:{icon:n.icon,svg:n.svg}},null,8,["content"]),o.hasDropdown()?(ge(),Se("div",{key:0,class:gt(["vui-toolbar-dropdown-container","vui-toolbar-dropdown-"+n.name]),style:{display:"none"}},[ee("div",_re,[(ge(!0),Se(kt,null,Zt(n.options,(u,f)=>(ge(),Se("button",{key:f,class:gt(["vui-toolbar-dropdown",["vui-toolbar-dropdown-item-"+u.name,{active:o.optionActive(u)}]]),onClick:lt(d=>o.runAction(u.action),["prevent"])},Ne(u.title),11,wre))),128))])],2)):_t("",!0)],34)),[[l,{content:n.title,theme:"vui-tooltip"}]])}const xre=Bt(bre,[["render",kre]]),AN=(t,e)=>{if(!t||!e)return;const n=t.parent.childAfter(t.parentOffset);if(!n.node)return;const r=n.node.marks.find(u=>u.type===e);if(!r)return;let i=t.index(),o=t.start()+n.offset,s=i+1,l=o+n.node.nodeSize;for(;i>0&&r.isInSet(t.parent.child(i-1).marks);)i-=1,o-=t.parent.child(i).nodeSize;for(;s{this.$nextTick().then(()=>{const t=this.$el.querySelector('input[type="text"]');t&&t.focus()})},50)}}},Cre={class:"vui-modal-header"},Tre={class:"vui-modal-body"},Ere={class:"vui-modal-footer footer"},Are=ee("div",{class:"spinner hidden"},null,-1),Ore={class:"buttons right"},Mre=["onClick"],Lre=["onClick"];function Nre(t,e,n,r,i,o){const s=ut("vue-final-modal");return ge(),Et(s,wi({class:"vui-modal-wrap"},t.$attrs,{classes:"vui-modal-container","content-class":"vui-modal-content","overlay-class":"vui-modal-overlay",attach:"body","lock-scroll":!1,"esc-to-close":!0,"click-to-close":!0,"focus-trap":!0,onOpened:o.opened,onClickOutside:e[1]||(e[1]=l=>t.$emit("cancel")),onCancel:e[2]||(e[2]=l=>t.$emit("cancel"))}),{default:Vt(({params:l,close:u})=>[ee("div",Cre,[pn(t.$slots,"title"),ee("div",{class:"vui-modal-close",onClick:e[0]||(e[0]=lt(f=>t.$emit("update:modelValue",!1),["prevent"]))})]),ee("div",Tre,[pn(t.$slots,"default",{params:l})]),ee("div",Ere,[Are,ee("div",Ore,[ee("div",{role:"button",class:"btn",tabindex:"0",onClick:lt(f=>t.$emit("cancel",u),["prevent"])},Ne(t.t("vizy",n.cancelButton)),9,Mre),ee("div",{role:"button",class:"btn submit",onClick:lt(f=>t.$emit("confirm",u),["prevent"])},Ne(t.t("vizy",n.confirmButton)),9,Lre)])])]),_:3},16,["onOpened"])}const lv=Bt(Sre,[["render",Nre]]),Ire={name:"LinkMenuModal",components:{MenuBarModal:lv},props:{field:{type:Object,default:null},editor:{type:Object,default:null},show:{type:Boolean,default:!1},modelValue:{type:Object,default:()=>globalThis.proxyValue}},emits:["update:modelValue","close"],data(){return{targetId:`target-${Craft.randomString(10)}`,proxyShow:!1,proxyValue:{url:null,text:null,target:null,class:null,title:null},errors:[],advancedPane:!1}},computed:{elementSiteId(){return this.field.settings.elementSiteId},newWindow:{get(){return this.modelValue.target==="_blank"},set(t){this.modelValue.target=t?"_blank":""}}},watch:{show(t){this.proxyShow=t},proxyShow(t){t===!1&&this.$emit("close")},proxyValue(t){this.$emit("update:modelValue",t)}},methods:{cancelModal(){this.proxyShow=!1},toggleAdvanced(){this.advancedPane=!this.advancedPane},confirmModal(){if(this.errors=[],!this.modelValue.url){this.errors.push("url");return}const t={href:this.modelValue.url,target:this.modelValue.target?"_blank":"",class:this.modelValue.class,title:this.modelValue.title},{selection:e}=this.editor.state.tr,n=e.$cursor?e.$cursor.pos:e.from;this.editor.chain().focus().command(({commands:r,tr:i,state:o,dispatch:s})=>{let l=AN(o.doc.resolve(i.selection.anchor),o.schema.marks.link);if(l||(l={from:i.selection.from,to:i.selection.to}),this.modelValue.text){const u=this.modelValue.text.toString();i.insertText(u,l.from,l.to);const f=i.doc.resolve(l.from),d=i.doc.resolve(l.from+u.length);i.setSelection(new st(f,d))}}).setLink(t).command(({commands:r,tr:i,state:o,dispatch:s})=>{n&&i.setSelection(st.create(i.doc,n))}).run(),this.proxyShow=!1}}},Pre={class:"heading"},Dre={id:"url-label",class:"required",for:"url"},Rre={key:0,class:"errors"},zre={id:"text-field",class:"field"},Bre={class:"heading"},$re={id:"text-label",for:"text"},Hre={class:"input ltr"},Fre={id:"target-field",class:"checkboxfield field"},Vre={class:"input ltr"},jre=["id"],Wre=["for"],Ure={id:"title-field",class:"field"},qre={class:"heading"},Kre={id:"title-label",for:"title"},Gre={class:"input ltr"},Yre={id:"classes-field",class:"field"},Jre={class:"heading"},Xre={id:"classes-label",for:"classes"},Zre={class:"input ltr"};function Qre(t,e,n,r,i,o){const s=ut("menu-bar-modal");return ge(),Et(s,{modelValue:i.proxyShow,"onUpdate:modelValue":e[6]||(e[6]=l=>i.proxyShow=l),"confirm-button":t.$attrs["confirm-button"],onConfirm:o.confirmModal,onCancel:o.cancelModal},{title:Vt(()=>[Ui(Ne(t.t("vizy",t.$attrs["modal-title"])),1)]),default:Vt(()=>[ee("div",{id:"url-field",class:gt(["field",{"has-errors":i.errors.includes("url")}])},[ee("div",Pre,[ee("label",Dre,Ne(t.t("vizy","URL")),1)]),ee("div",{class:gt(["input ltr",{errors:i.errors.includes("url")}])},[Ut(ee("input",{id:"url","onUpdate:modelValue":e[0]||(e[0]=l=>n.modelValue.url=l),type:"text",class:"text fullwidth",autofocus:"",autocomplete:"off",required:""},null,512),[[Mn,n.modelValue.url]])],2),i.errors.includes("url")?(ge(),Se("ul",Rre,[ee("li",null,Ne(t.t("vizy","URL cannot be blank.")),1)])):_t("",!0)],2),ee("div",zre,[ee("div",Bre,[ee("label",$re,Ne(t.t("vizy","Text")),1)]),ee("div",Hre,[Ut(ee("input",{id:"text","onUpdate:modelValue":e[1]||(e[1]=l=>n.modelValue.text=l),type:"text",class:"text fullwidth",autofocus:"",autocomplete:"off"},null,512),[[Mn,n.modelValue.text]])])]),ee("div",Fre,[ee("div",Vre,[Ut(ee("input",{id:i.targetId,"onUpdate:modelValue":e[2]||(e[2]=l=>o.newWindow=l),type:"checkbox",class:"checkbox"},null,8,jre),[[kd,o.newWindow]]),ee("label",{for:i.targetId},Ne(t.t("vizy","Open link in new tab")),9,Wre)])]),ee("a",{class:gt(["fieldtoggle",{expanded:i.advancedPane}]),"data-target":"advanced",onClick:e[3]||(e[3]=lt((...l)=>o.toggleAdvanced&&o.toggleAdvanced(...l),["prevent"]))},Ne(t.t("app","Advanced")),3),ee("div",{class:gt({hidden:!i.advancedPane})},[ee("div",Ure,[ee("div",qre,[ee("label",Kre,Ne(t.t("vizy","Title")),1)]),ee("div",Gre,[Ut(ee("input",{id:"title","onUpdate:modelValue":e[4]||(e[4]=l=>n.modelValue.title=l),type:"text",class:"text fullwidth",autofocus:"",autocomplete:"off"},null,512),[[Mn,n.modelValue.title]])])]),ee("div",Yre,[ee("div",Jre,[ee("label",Xre,Ne(t.t("vizy","Classes")),1)]),ee("div",Zre,[Ut(ee("input",{id:"classes","onUpdate:modelValue":e[5]||(e[5]=l=>n.modelValue.class=l),type:"text",class:"text fullwidth",autofocus:"",autocomplete:"off"},null,512),[[Mn,n.modelValue.class]])])])],2)]),_:1},8,["modelValue","confirm-button","onConfirm","onCancel"])}const ON=Bt(Ire,[["render",Qre]]),eie={name:"LinkMenuBubble",components:{LinkMenuModal:ON},props:{field:{type:Object,default:null},editor:{type:Object,default:null}},data(){return{tippy:null,showEditModal:!1,model:{url:null,text:null,target:null,class:null,title:null}}},watch:{editor:{immediate:!0,handler(t){t&&this.$nextTick(()=>{t.on("vui:link-clicked",this.renderBubble)})}}},methods:{renderBubble(){const{doc:t,selection:e,schema:n}=this.editor.view.state,r=AN(t.resolve(e.anchor),n.marks.link);if(r){const i=this.editor.view.docView.domFromPos(r.from).node;if(i){this.$el.style.display="block";const o=this.editor.getAttributes("link");this.model.text=i.textContent,this.model.url=o.href,this.model.target=o.target,this.model.class=o.class,this.model.title=o.title,this.tippy=Kr(i.parentNode,{content:this.$el,showOnCreate:!0,trigger:"manual",allowHTML:!0,arrow:!0,interactive:!0,placement:"top",theme:"vui-menu-bubble",hideOnClick:!0,duration:200,zIndex:1e3,appendTo:()=>document.body})}}},destroyBubble(){this.tippy&&(this.tippy.destroy(),this.tippy=null)},truncate(t,e){return t&&t.length>e?`${t.substr(0,e-1)}…`:t},edit(){this.showEditModal=!0,this.destroyBubble(),this.editor.chain().blur().run()},closeModal(){this.showEditModal=!1},unlink(){this.editor.chain().focus().unsetLink().run(),this.destroyBubble()}}},tie={class:"vui-link-menu-bubble",style:{display:"none"}},nie=["href","innerHTML"];function rie(t,e,n,r,i,o){const s=ut("link-menu-modal");return ge(),Se("div",tie,[ee("a",{href:i.model.url,target:"_blank",innerHTML:o.truncate(i.model.url,30)},null,8,nie),ee("a",{href:"#",onClick:e[0]||(e[0]=lt((...l)=>o.edit&&o.edit(...l),["prevent"]))},Ne(t.t("vizy","Edit")),1),ee("a",{href:"#",onClick:e[1]||(e[1]=lt((...l)=>o.unlink&&o.unlink(...l),["prevent"]))},Ne(t.t("vizy","Unlink")),1),Qe(s,{modelValue:i.model,"onUpdate:modelValue":e[2]||(e[2]=l=>i.model=l),show:i.showEditModal,editor:n.editor,field:n.field,"confirm-button":"Update","modal-title":"Edit Link",onClose:o.closeModal},null,8,["modelValue","show","editor","field","onClose"])])}const iie=Bt(eie,[["render",rie]]),oie={name:"MenuBarItem",components:{SvgIcon:hc,LinkMenuModal:ON,LinkMenuBubble:iie},props:{field:{type:Object,default:null},editor:{type:Object,default:null},icon:{type:String,default:null},svg:{type:String,default:null},title:{type:String,default:null},isActive:{type:Function,default:()=>{}}},data(){return{tippy:null,showEditModal:!1,model:{}}},computed:{active(){return this.isActive&&this.isActive(this.editor)},linkOptions(){return this.field.settings.linkOptions}},created(){this.resetModel(),this.editor.on("vui:link-modal-open",()=>{this.openNewModal()})},mounted(){this.$nextTick(()=>{const t=this.$el.querySelector(".vui-toolbar-dropdown-link"),e=this.$el;t&&e&&(t.style.display="block",this.tippy=Kr(e,{content:t,trigger:"click",allowHTML:!0,arrow:!1,interactive:!0,placement:"bottom-start",theme:"light-border toolbar-dropdown",duration:200,zIndex:1e3,hideOnClick:!0,offset:[0,1],onShown(n){n.popper.querySelector("button").focus()}}))}),this._keyListener=function(t){t.key==="Escape"&&(t.preventDefault(),this.closeDropdown()),this.editor.vizyField.isFocused()&&t.key==="k"&&(t.ctrlKey||t.metaKey)&&(t.preventDefault(),this.openNewModal())},document.addEventListener("keydown",this._keyListener.bind(this))},beforeUnmount(){document.removeEventListener("keydown",this._keyListener)},methods:{resetModel(){this.model={url:null,text:null,target:null,class:null,title:null}},openNewModal(){this.tippy.hide(),this.resetModel();const t=this.getSelectedText();t&&(this.model.text=t),this.showEditModal=!0},openEditModal(){this.tippy.hide();const{from:t,to:e}=this.editor.view.state.selection,n=this.editor.view.docView.domFromPos(t).node,r=this.editor.getAttributes("link");this.model.text=n.textContent,this.model.url=r.href,this.model.target=r.target,this.model.class=r.class,this.model.title=r.title,this.showEditModal=!0},closeModal(){this.showEditModal=!1},openElementModal(t){this.tippy.hide(),this.resetModel(),Craft.createElementSelectorModal(t.elementType,{storageKey:`VizyInput.LinkTo.${t.elementType}`,sources:t.sources,criteria:t.criteria,defaultSiteId:this.elementSiteId,autoFocusSearchBox:!1,onSelect:$.proxy(e=>{if(e.length){const[n]=e;this.model.url=`${n.url}#${t.refHandle}:${n.id}@${n.siteId}`,this.model.text=this.getSelectedText()||n.label,this.tippy.hide(),this.showEditModal=!0}},this),closeOtherModals:!1})},getSelectedText(){const{from:t,to:e}=this.editor.state.selection,n=this.editor.state.doc.textBetween(t,e," ");return n||!1},unlinkAction(){this.tippy&&this.tippy.hide(),this.editor.chain().focus().unsetLink().run()},onMouseDown(t){t.preventDefault()},closeDropdown(){this.tippy&&this.tippy.hide()}}},sie={class:"vui-toolbar-dropdown-container vui-toolbar-dropdown-link",style:{display:"none"}},aie={key:0},lie=["onClick"],uie={key:1};function cie(t,e,n,r,i,o){const s=ut("svg-icon"),l=ut("link-menu-bubble"),u=ut("link-menu-modal"),f=sc("tooltip");return ge(),Se("div",null,[Ut((ge(),Se("button",{class:gt(["btn vui-toolbar-btn",{active:o.active}]),onClick:lt(()=>{},["prevent"]),onMousedown:e[0]||(e[0]=(...d)=>o.onMouseDown&&o.onMouseDown(...d))},[Qe(s,{content:{icon:n.icon,svg:n.svg}},null,8,["content"])],34)),[[f,{content:n.title,theme:"vui-tooltip"}]]),ee("div",sie,[o.active?(ge(),Se("div",uie,[ee("button",{class:"vui-toolbar-dropdown vui-toolbar-dropdown-item-link",onClick:e[2]||(e[2]=lt((...d)=>o.openEditModal&&o.openEditModal(...d),["prevent"]))},Ne(t.t("vizy","Edit Link")),1)])):(ge(),Se("div",aie,[(ge(!0),Se(kt,null,Zt(o.linkOptions,(d,m)=>(ge(),Se("button",{key:m,class:gt(["vui-toolbar-dropdown","vui-toolbar-dropdown-item-link-"+d.refHandle]),onClick:lt(v=>o.openElementModal(d),["prevent"])},Ne(d.optionTitle),11,lie))),128)),ee("button",{class:"vui-toolbar-dropdown vui-toolbar-dropdown-item-link",onClick:e[1]||(e[1]=lt((...d)=>o.openNewModal&&o.openNewModal(...d),["prevent"]))},Ne(t.t("vizy","Insert Link")),1)])),ee("button",{class:"vui-toolbar-dropdown vui-toolbar-dropdown-item-unlink",onClick:e[3]||(e[3]=lt((...d)=>o.unlinkAction&&o.unlinkAction(...d),["prevent"]))},Ne(t.t("vizy","Unlink")),1)]),Qe(l,{editor:n.editor,field:n.field},null,8,["editor","field"]),Qe(u,{modelValue:i.model,"onUpdate:modelValue":e[4]||(e[4]=d=>i.model=d),show:i.showEditModal,editor:n.editor,field:n.field,"confirm-button":"Insert","modal-title":"Insert Link",onClose:o.closeModal},null,8,["modelValue","show","editor","field","onClose"])])}const fie=Bt(oie,[["render",cie]]),die={name:"ImageMenuModal",components:{MenuBarModal:lv},props:{field:{type:Object,default:null},editor:{type:Object,default:null},show:{type:Boolean,default:!1},modelValue:{type:Object,default:()=>globalThis.proxyValue}},emits:["update:modelValue","close"],data(){return{targetId:`target-${Craft.randomString(10)}`,proxyShow:!1,proxyValue:{id:null,src:null,alt:null,title:null,url:null,target:null,transform:null},errors:[]}},computed:{elementSiteId(){return this.field.settings.elementSiteId},transforms(){return this.field.settings.transforms}},watch:{show(t){this.proxyShow=t},proxyShow(t){t===!1&&this.$emit("close")},proxyValue(t){this.$emit("update:modelValue",t)}},methods:{_buildAssetUrl:(t,e,n)=>`${e}#asset:${t}:${n?`transform:${n}`:"url"}`,_removeTransformFromUrl:t=>t.replace(/(.*)(_[a-z0-9+].*\/)(.*)/,"$1$3"),_getTransformUrl(t,e,n){const r={assetId:t,handle:e};Craft.sendActionRequest("POST","assets/generate-transform",{data:r}).then(i=>{n(i.data.url)}).catch(({response:i})=>{alert("There was an error generating the transform URL.")})},cancelModal(){this.proxyShow=!1},confirmModal(){this.errors=[];const t=this._removeTransformFromUrl(this.modelValue.src.split("#")[0]);this.modelValue.target=this.modelValue.target?"_blank":"",this.modelValue.transform?this._getTransformUrl(this.modelValue.id,this.modelValue.transform,e=>{this.modelValue.src=this._buildAssetUrl(this.modelValue.id,e,this.modelValue.transform),this.editor.chain().focus().setImage(this.modelValue).run()}):(this.modelValue.src=t,this.editor.chain().focus().setImage(this.modelValue).run()),this.proxyShow=!1}}},hie={class:"vui-modal-body-wrap"},pie={class:"vizy-modal-image-preview"},mie=["src"],gie={class:"vizy-modal-image-fields"},vie={id:"alt-field",class:"field"},yie={class:"heading"},bie={id:"alt-label",for:"alt"},_ie={class:"input ltr"},wie={id:"title-field",class:"field"},kie={class:"heading"},xie={id:"title-label",for:"title"},Sie={class:"input ltr"},Cie={id:"url-field",class:"field"},Tie={class:"heading"},Eie={id:"url-label",for:"url"},Aie={class:"input ltr"},Oie={id:"target-field",class:"checkboxfield field"},Mie={class:"input ltr"},Lie=["id"],Nie=["for"],Iie={id:"transform-field",class:"field first"},Pie={class:"heading"},Die={id:"transform-label",for:"transform"},Rie={class:"input ltr"},zie={class:"select"},Bie={value:""},$ie=["value"];function Hie(t,e,n,r,i,o){const s=ut("menu-bar-modal");return ge(),Et(s,{modelValue:i.proxyShow,"onUpdate:modelValue":e[5]||(e[5]=l=>i.proxyShow=l),class:"vui-modal-image-edit","confirm-button":t.$attrs["confirm-button"],onConfirm:o.confirmModal,onCancel:o.cancelModal},{title:Vt(()=>[Ui(Ne(t.t("vizy",t.$attrs["modal-title"])),1)]),default:Vt(()=>[ee("div",hie,[ee("div",pie,[ee("img",{src:n.modelValue.src},null,8,mie)]),ee("div",gie,[ee("div",vie,[ee("div",yie,[ee("label",bie,Ne(t.t("vizy","Alt Text")),1)]),ee("div",_ie,[Ut(ee("input",{id:"alt","onUpdate:modelValue":e[0]||(e[0]=l=>n.modelValue.alt=l),type:"text",class:"text fullwidth",autofocus:"",autocomplete:"off"},null,512),[[Mn,n.modelValue.alt]])])]),ee("div",wie,[ee("div",kie,[ee("label",xie,Ne(t.t("vizy","Title")),1)]),ee("div",Sie,[Ut(ee("input",{id:"title","onUpdate:modelValue":e[1]||(e[1]=l=>n.modelValue.title=l),type:"text",class:"text fullwidth",autofocus:"",autocomplete:"off"},null,512),[[Mn,n.modelValue.title]])])]),ee("div",Cie,[ee("div",Tie,[ee("label",Eie,Ne(t.t("vizy","URL")),1)]),ee("div",Aie,[Ut(ee("input",{id:"url","onUpdate:modelValue":e[2]||(e[2]=l=>n.modelValue.url=l),type:"text",class:"text fullwidth",autofocus:"",autocomplete:"off"},null,512),[[Mn,n.modelValue.url]])])]),ee("div",Oie,[ee("div",Mie,[Ut(ee("input",{id:i.targetId,"onUpdate:modelValue":e[3]||(e[3]=l=>n.modelValue.target=l),type:"checkbox",class:"checkbox"},null,8,Lie),[[kd,n.modelValue.target]]),ee("label",{for:i.targetId},Ne(t.t("vizy","Open link in new tab")),9,Nie)])]),ee("div",Iie,[ee("div",Pie,[ee("label",Die,Ne(t.t("vizy","Transform")),1)]),ee("div",Rie,[ee("div",zie,[Ut(ee("select",{id:"transform","onUpdate:modelValue":e[4]||(e[4]=l=>n.modelValue.transform=l)},[ee("option",Bie,Ne(t.t("vizy","No Transform")),1),(ge(!0),Se(kt,null,Zt(o.transforms,(l,u)=>(ge(),Se("option",{key:u,value:l.handle},Ne(l.name),9,$ie))),128))],512),[[Z1,n.modelValue.transform]])])])])])])]),_:1},8,["modelValue","confirm-button","onConfirm","onCancel"])}const MN=Bt(die,[["render",Hie]]),Fie=(t,e=!0)=>{if(!t)throw new Error('Invalid "node" parameter');const n=[];return t.descendants((r,i)=>{if(n.push({node:r,pos:i}),!e)return!1}),n},Vie=(t,e,n)=>{if(t){if(!e)throw new Error('Invalid "predicate" parameter')}else throw new Error('Invalid "node" parameter');return Fie(t,n).filter(r=>e(r.node))},jie=(t,e,n)=>Vie(t,r=>r.type===e,n),Vw={name:"followCursor",defaultValue:!1,fn(t){const{reference:e}=t;return{onMount(){const n=t.props.mouseEvent,r=n.target?e.contains(n.target):!0,{clientX:i,clientY:o}=n,s=e.getBoundingClientRect(),l=i-s.left,u=o-s.top;(r||!t.props.interactive)&&t.setProps({getReferenceClientRect(){const f=e.getBoundingClientRect(),d=f.left+l,m=f.top+u;return{width:0,height:0,top:m,right:d,bottom:m,left:d}}})}}}},Wie={name:"ImageMenuBubble",components:{ImageMenuModal:MN},props:{field:{type:Object,default:null},editor:{type:Object,default:null}},data(){return{tippy:null,showEditModal:!1,model:{id:null,src:null,alt:null,title:null,url:null,target:null,transform:null}}},watch:{editor:{immediate:!0,handler(t){t&&this.$nextTick(()=>{t.on("vui:image-clicked",this.renderBubble)})}}},methods:{renderBubble(t){const{view:e}=this.editor,n=this.editor.getAttributes("image");P_(n)&&(this.model=n,this.$el.style.display="block",this.destroyBubble(),this.tippy=Kr(e.dom,{content:this.$el,trigger:"manual",showOnCreate:!0,allowHTML:!0,arrow:!0,interactive:!0,placement:"top",followCursor:"initial",plugins:[Vw],theme:"vui-menu-bubble",duration:200,mouseEvent:t,zIndex:1e3,appendTo:()=>document.body}))},destroyBubble(){this.tippy&&(this.tippy.destroy(),this.tippy=null)},edit(){this.showEditModal=!0,this.editor.chain().blur().run()},closeModal(){this.showEditModal=!1},imageEditor(){if(this.model.id){const t={allowSavingAsNew:!1,onSave:this.reloadImage.bind(this),allowDegreeFractions:Craft.isImagick};new Craft.AssetImageEditor(this.model.id,t),this.destroyBubble()}},reloadImage(){jie(this.editor.state.doc,this.editor.schema.nodes.image).forEach(e=>{if(!e.node.attrs.src)return;const n=e.node.attrs.src.match(/(.*)#asset:(\d+)(:transform:(.*))?/i);if(n&&n[2]==this.model.id)if(n[4]){const r={assetId:n[2],handle:n[4]};Craft.sendActionRequest("POST","assets/generate-transform",{data:r}).then(i=>{const o={src:`${i.data.url}?${new Date().getTime()}#asset:${n[2]}:transform:${n[4]}`};this.editor.view.dispatch(this.editor.state.tr.setNodeMarkup(e.pos,null,{...e.node.attrs,...o}))}).catch(({response:i})=>{alert("There was an error generating the transform URL.")})}else{const r={src:`${n[1]}?${new Date().getTime()}#asset:${n[2]}`};this.editor.view.dispatch(this.editor.state.tr.setNodeMarkup(e.pos,null,{...e.node.attrs,...r}))}})},unlink(){this.editor.chain().focus().deleteSelection().run(),this.destroyBubble()}}},Uie={class:"vui-image-menu-bubble",style:{display:"none"}};function qie(t,e,n,r,i,o){const s=ut("image-menu-modal");return ge(),Se("div",Uie,[ee("a",{href:"#",onClick:e[0]||(e[0]=lt((...l)=>o.imageEditor&&o.imageEditor(...l),["prevent"]))},Ne(t.t("vizy","Image Editor")),1),ee("a",{href:"#",onClick:e[1]||(e[1]=lt((...l)=>o.edit&&o.edit(...l),["prevent"]))},Ne(t.t("vizy","Edit")),1),ee("a",{href:"#",onClick:e[2]||(e[2]=lt((...l)=>o.unlink&&o.unlink(...l),["prevent"]))},Ne(t.t("vizy","Delete")),1),Qe(s,{modelValue:i.model,"onUpdate:modelValue":e[3]||(e[3]=l=>i.model=l),show:i.showEditModal,editor:n.editor,field:n.field,"confirm-button":"Update","modal-title":"Edit Image",onClose:o.closeModal},null,8,["modelValue","show","editor","field","onClose"])])}const Kie=Bt(Wie,[["render",qie]]),Gie={name:"ImageMenuBarItem",components:{SvgIcon:hc,ImageMenuBubble:Kie,ImageMenuModal:MN},props:{field:{type:Object,default:null},editor:{type:Object,default:null},icon:{type:String,default:null},svg:{type:String,default:null},name:{type:String,default:null},title:{type:String,default:null},action:{type:Function,default:()=>{}},isActive:{type:Function,default:()=>{}}},data(){return{showEditModal:!1,model:{}}},computed:{active(){return this.isActive&&this.isActive(this.editor)},volumes(){return this.field.settings.volumes},transforms(){return this.field.settings.transforms},elementSiteId(){return this.field.settings.elementSiteId},defaultTransform(){return this.field.settings.defaultTransform},allowAllUploaders(){return this.field.settings.allowAllUploaders},defaultSource(){return this.field.settings.defaultSource}},created(){this.resetModel(),this.editor.on("vui:image-modal-open",()=>{this.runAction()})},mounted(){this._keyListener=function(t){t.key==="Escape"&&(t.preventDefault(),this.closeDropdown())},document.addEventListener("keydown",this._keyListener.bind(this))},beforeUnmount(){document.removeEventListener("keydown",this._keyListener)},methods:{_buildAssetUrl:(t,e,n)=>`${e}#asset:${t}:${n?`transform:${n}`:"url"}`,_isTransformUrl:t=>/(.*)(_[a-z0-9+].*\/)(.*)/.test(t),_getTransformUrl(t,e,n){const r={assetId:t,handle:e};Craft.sendActionRequest("POST","assets/generate-transform",{data:r}).then(i=>{n(i.data.url)}).catch(({response:i})=>{alert("There was an error generating the transform URL.")})},runAction(){const t={siteId:this.elementSiteId,kind:"image"};this.allowAllUploaders&&(t.uploaderId=null),this.assetSelectionModal=Craft.createElementSelectorModal("craft\\elements\\Asset",{storageKey:"VizyInput.ChooseImage",multiSelect:!0,sources:this.volumes,defaultSource:this.defaultSource??null,criteria:t,onSelect:function(e,n){if(e.length){const r={};e.length>1;const i=function(o,s){const l=o.pop(),u=this._isTransformUrl(l.url);u||!this.defaultTransform?(r[`asset${l.id}`]={id:l.id,src:this._buildAssetUrl(l.id,l.url,u?n:this.defaultTransform),alt:l.label,title:l.label,transform:u?n:this.defaultTransform},o.length?i(o,s):s()):this._getTransformUrl(l.id,this.defaultTransform,f=>{r[`asset${l.id}`]={id:l.id,src:this._buildAssetUrl(l.id,f,this.defaultTransform),alt:l.label,title:l.label,transform:this.defaultTransform},o.length?i(o,s):s()})}.bind(this);i(e,()=>{Object.keys(r).forEach(o=>{this.model={...this.model,...r[o]},this.showEditModal=!0})})}}.bind(this),transforms:this.transforms,closeOtherModals:!1})},resetModel(){this.model={id:null,src:null,alt:null,title:null,url:null,target:null,transform:this.defaultTransform}},closeModal(){this.showEditModal=!1},onMouseDown(t){t.preventDefault()},closeDropdown(){this.tippy&&this.tippy.hide()}}};function Yie(t,e,n,r,i,o){const s=ut("svg-icon"),l=ut("image-menu-bubble"),u=ut("image-menu-modal"),f=sc("tooltip");return ge(),Se("div",null,[Ut((ge(),Se("button",{class:gt(["btn vui-toolbar-btn",{active:o.active}]),onClick:e[0]||(e[0]=lt((...d)=>o.runAction&&o.runAction(...d),["prevent"])),onMousedown:e[1]||(e[1]=(...d)=>o.onMouseDown&&o.onMouseDown(...d))},[Qe(s,{content:{icon:n.icon,svg:n.svg}},null,8,["content"])],34)),[[f,{content:n.title,theme:"vui-tooltip"}]]),Qe(l,{editor:n.editor,field:n.field},null,8,["editor","field"]),Qe(u,{modelValue:i.model,"onUpdate:modelValue":e[2]||(e[2]=d=>i.model=d),show:i.showEditModal,editor:n.editor,field:n.field,"confirm-button":"Insert","modal-title":"Insert Image",onClose:o.closeModal},null,8,["modelValue","show","editor","field","onClose"])])}const Jie=Bt(Gie,[["render",Yie]]),Xie={name:"IframeEmbedMenuModal",components:{MenuBarModal:lv},props:{field:{type:Object,default:null},editor:{type:Object,default:null},show:{type:Boolean,default:!1},modelValue:{type:Object,default:()=>globalThis.proxyValue}},emits:["update:modelValue","close"],data(){return{targetId:`target-${Craft.randomString(10)}`,proxyShow:!1,proxyValue:{url:null},errors:[]}},watch:{show(t){this.proxyShow=t},proxyShow(t){t===!1&&this.$emit("close")},proxyValue(t){this.$emit("update:modelValue",t)}},methods:{cancelModal(){this.proxyShow=!1},confirmModal(){if(this.errors=[],!this.modelValue.url){this.errors.push("url");return}this.editor.chain().focus().setIframe(this.modelValue).run(),this.proxyShow=!1}}},Zie={class:"heading"},Qie={id:"url-label",class:"required",for:"url"},eoe={key:0,class:"errors"};function toe(t,e,n,r,i,o){const s=ut("menu-bar-modal");return ge(),Et(s,{modelValue:i.proxyShow,"onUpdate:modelValue":e[1]||(e[1]=l=>i.proxyShow=l),class:"vui-modal-iframe-edit","confirm-button":t.$attrs["confirm-button"],onConfirm:o.confirmModal,onCancel:o.cancelModal},{title:Vt(()=>[Ui(Ne(t.t("vizy",t.$attrs["modal-title"])),1)]),default:Vt(()=>[ee("div",{id:"url-field",class:gt(["field",{"has-errors":i.errors.includes("url")}])},[ee("div",Zie,[ee("label",Qie,Ne(t.t("vizy","URL")),1)]),ee("div",{class:gt(["input ltr",{errors:i.errors.includes("url")}])},[Ut(ee("input",{id:"url","onUpdate:modelValue":e[0]||(e[0]=l=>n.modelValue.url=l),type:"text",class:"text fullwidth",autofocus:"",autocomplete:"off",required:""},null,512),[[Mn,n.modelValue.url]])],2),i.errors.includes("url")?(ge(),Se("ul",eoe,[ee("li",null,Ne(t.t("vizy","URL cannot be blank.")),1)])):_t("",!0)],2)]),_:1},8,["modelValue","confirm-button","onConfirm","onCancel"])}const LN=Bt(Xie,[["render",toe]]),noe={name:"IframeMenuBubble",components:{IframeMenuModal:LN},props:{field:{type:Object,default:null},editor:{type:Object,default:null}},data(){return{tippy:null,showEditModal:!1,model:{url:null}}},watch:{editor:{immediate:!0,handler(t){t&&this.$nextTick(()=>{t.on("vui:iframe-clicked",this.renderBubble)})}}},methods:{renderBubble(t){const{view:e}=this.editor,n=this.editor.getAttributes("iframe");P_(n)&&(this.model=n,this.$el.style.display="block",this.destroyBubble(),this.tippy=Kr(e.dom,{content:this.$el,trigger:"manual",showOnCreate:!0,allowHTML:!0,arrow:!0,interactive:!0,placement:"top",followCursor:"initial",plugins:[Vw],theme:"vui-menu-bubble",mouseEvent:t,duration:200,zIndex:1e3,appendTo:()=>document.body}))},destroyBubble(){this.tippy&&(this.tippy.destroy(),this.tippy=null)},edit(){this.showEditModal=!0,this.editor.chain().blur().run()},closeModal(){this.showEditModal=!1},unlink(){this.editor.chain().focus().deleteSelection().run(),this.destroyBubble()}}},roe={class:"vui-iframe-menu-bubble",style:{display:"none"}};function ioe(t,e,n,r,i,o){const s=ut("iframe-menu-modal");return ge(),Se("div",roe,[ee("a",{href:"#",onClick:e[0]||(e[0]=lt((...l)=>o.edit&&o.edit(...l),["prevent"]))},Ne(t.t("vizy","Edit")),1),ee("a",{href:"#",onClick:e[1]||(e[1]=lt((...l)=>o.unlink&&o.unlink(...l),["prevent"]))},Ne(t.t("vizy","Delete")),1),Qe(s,{modelValue:i.model,"onUpdate:modelValue":e[2]||(e[2]=l=>i.model=l),show:i.showEditModal,editor:n.editor,field:n.field,"confirm-button":"Update","modal-title":"Edit iFrame",onClose:o.closeModal},null,8,["modelValue","show","editor","field","onClose"])])}const ooe=Bt(noe,[["render",ioe]]),soe={name:"IframeMenuBarItem",components:{SvgIcon:hc,IframeMenuBubble:ooe,IframeMenuModal:LN},props:{field:{type:Object,default:null},editor:{type:Object,default:null},icon:{type:String,default:null},svg:{type:String,default:null},name:{type:String,default:null},title:{type:String,default:null},action:{type:Function,default:()=>{}},isActive:{type:Function,default:()=>{}}},data(){return{showEditModal:!1,model:{}}},computed:{active(){return this.isActive&&this.isActive(this.editor)}},created(){this.resetModel()},mounted(){this._keyListener=function(t){t.key==="Escape"&&(t.preventDefault(),this.closeDropdown())},document.addEventListener("keydown",this._keyListener.bind(this))},beforeUnmount(){document.removeEventListener("keydown",this._keyListener)},methods:{runAction(){this.showEditModal=!0},resetModel(){this.model={url:null,data:null}},closeModal(){this.showEditModal=!1},onMouseDown(t){t.preventDefault()},closeDropdown(){this.tippy&&this.tippy.hide()}}};function aoe(t,e,n,r,i,o){const s=ut("svg-icon"),l=ut("iframe-menu-bubble"),u=ut("iframe-menu-modal"),f=sc("tooltip");return ge(),Se("div",null,[Ut((ge(),Se("button",{class:gt(["btn vui-toolbar-btn",{active:o.active}]),onClick:e[0]||(e[0]=lt((...d)=>o.runAction&&o.runAction(...d),["prevent"])),onMousedown:e[1]||(e[1]=(...d)=>o.onMouseDown&&o.onMouseDown(...d))},[Qe(s,{content:{icon:n.icon,svg:n.svg}},null,8,["content"])],34)),[[f,{content:n.title,theme:"vui-tooltip"}]]),Qe(l,{editor:n.editor,field:n.field},null,8,["editor","field"]),Qe(u,{modelValue:i.model,"onUpdate:modelValue":e[2]||(e[2]=d=>i.model=d),show:i.showEditModal,editor:n.editor,field:n.field,"confirm-button":"Insert","modal-title":"Insert iFrame",onClose:o.closeModal},null,8,["modelValue","show","editor","field","onClose"])])}const loe=Bt(soe,[["render",aoe]]),uoe={name:"MediaEmbedMenuModal",components:{MenuBarModal:lv},props:{field:{type:Object,default:null},editor:{type:Object,default:null},show:{type:Boolean,default:!1},modelValue:{type:Object,default:()=>globalThis.proxyValue}},emits:["update:modelValue","close"],data(){return{targetId:`target-${Craft.randomString(10)}`,proxyShow:!1,proxyValue:{url:null,data:null},errors:[]}},watch:{show(t){this.proxyShow=t},proxyShow(t){t===!1&&this.$emit("close")},proxyValue(t){this.$emit("update:modelValue",t)}},methods:{cancelModal(){this.proxyShow=!1},confirmModal(){if(this.errors=[],!this.modelValue.url){this.errors.push("url");return}this.editor.chain().focus().setEmbed(this.modelValue).run(),this.proxyShow=!1}}},coe={class:"heading"},foe={id:"url-label",class:"required",for:"url"},doe={key:0,class:"errors"};function hoe(t,e,n,r,i,o){const s=ut("menu-bar-modal");return ge(),Et(s,{modelValue:i.proxyShow,"onUpdate:modelValue":e[1]||(e[1]=l=>i.proxyShow=l),class:"vui-modal-media-embed-edit","confirm-button":t.$attrs["confirm-button"],onConfirm:o.confirmModal,onCancel:o.cancelModal},{title:Vt(()=>[Ui(Ne(t.t("vizy",t.$attrs["modal-title"])),1)]),default:Vt(()=>[ee("div",{id:"url-field",class:gt(["field",{"has-errors":i.errors.includes("url")}])},[ee("div",coe,[ee("label",foe,Ne(t.t("vizy","URL")),1)]),ee("div",{class:gt(["input ltr",{errors:i.errors.includes("url")}])},[Ut(ee("input",{id:"url","onUpdate:modelValue":e[0]||(e[0]=l=>n.modelValue.url=l),type:"text",class:"text fullwidth",autofocus:"",autocomplete:"off",required:""},null,512),[[Mn,n.modelValue.url]])],2),i.errors.includes("url")?(ge(),Se("ul",doe,[ee("li",null,Ne(t.t("vizy","URL cannot be blank.")),1)])):_t("",!0)],2)]),_:1},8,["modelValue","confirm-button","onConfirm","onCancel"])}const NN=Bt(uoe,[["render",hoe]]),poe={name:"MediaEmbedMenuBubble",components:{MediaEmbedMenuModal:NN},props:{field:{type:Object,default:null},editor:{type:Object,default:null}},data(){return{tippy:null,showEditModal:!1,model:{url:null,data:null}}},watch:{editor:{immediate:!0,handler(t){t&&this.$nextTick(()=>{t.on("vui:media-embed-clicked",this.renderBubble)})}}},methods:{renderBubble(t){const{view:e}=this.editor,n=this.editor.getAttributes("mediaEmbed");P_(n)&&(this.model=n,this.$el.style.display="block",this.destroyBubble(),this.tippy=Kr(e.dom,{content:this.$el,trigger:"manual",showOnCreate:!0,allowHTML:!0,arrow:!0,interactive:!0,placement:"top",followCursor:"initial",plugins:[Vw],theme:"vui-menu-bubble",mouseEvent:t,duration:200,zIndex:1e3,appendTo:()=>document.body}))},destroyBubble(){this.tippy&&(this.tippy.destroy(),this.tippy=null)},edit(){this.showEditModal=!0,this.editor.chain().blur().run()},closeModal(){this.showEditModal=!1},unlink(){this.editor.chain().focus().deleteSelection().run(),this.destroyBubble()}}},moe={class:"vui-media-embed-menu-bubble",style:{display:"none"}};function goe(t,e,n,r,i,o){const s=ut("media-embed-menu-modal");return ge(),Se("div",moe,[ee("a",{href:"#",onClick:e[0]||(e[0]=lt((...l)=>o.edit&&o.edit(...l),["prevent"]))},Ne(t.t("vizy","Edit")),1),ee("a",{href:"#",onClick:e[1]||(e[1]=lt((...l)=>o.unlink&&o.unlink(...l),["prevent"]))},Ne(t.t("vizy","Delete")),1),Qe(s,{modelValue:i.model,"onUpdate:modelValue":e[2]||(e[2]=l=>i.model=l),show:i.showEditModal,editor:n.editor,field:n.field,"confirm-button":"Update","modal-title":"Edit Media Embed",onClose:o.closeModal},null,8,["modelValue","show","editor","field","onClose"])])}const voe=Bt(poe,[["render",goe]]),yoe={name:"MediaEmbedMenuBarItem",components:{SvgIcon:hc,MediaEmbedMenuBubble:voe,MediaEmbedMenuModal:NN},props:{field:{type:Object,default:null},editor:{type:Object,default:null},icon:{type:String,default:null},svg:{type:String,default:null},name:{type:String,default:null},title:{type:String,default:null},action:{type:Function,default:()=>{}},isActive:{type:Function,default:()=>{}}},data(){return{showEditModal:!1,model:{}}},computed:{active(){return this.isActive&&this.isActive(this.editor)}},created(){this.resetModel(),this.editor.on("vui:media-embed-modal-open",()=>{this.runAction()})},mounted(){this._keyListener=function(t){t.key==="Escape"&&(t.preventDefault(),this.closeDropdown())},document.addEventListener("keydown",this._keyListener.bind(this))},beforeUnmount(){document.removeEventListener("keydown",this._keyListener)},methods:{runAction(){this.showEditModal=!0},resetModel(){this.model={url:null,data:null}},closeModal(){this.showEditModal=!1},onMouseDown(t){t.preventDefault()},closeDropdown(){this.tippy&&this.tippy.hide()}}};function boe(t,e,n,r,i,o){const s=ut("svg-icon"),l=ut("media-embed-menu-bubble"),u=ut("media-embed-menu-modal"),f=sc("tooltip");return ge(),Se("div",null,[Ut((ge(),Se("button",{class:gt(["btn vui-toolbar-btn",{active:o.active}]),onClick:e[0]||(e[0]=lt((...d)=>o.runAction&&o.runAction(...d),["prevent"])),onMousedown:e[1]||(e[1]=(...d)=>o.onMouseDown&&o.onMouseDown(...d))},[Qe(s,{content:{icon:n.icon,svg:n.svg}},null,8,["content"])],34)),[[f,{content:n.title,theme:"vui-tooltip"}]]),Qe(l,{editor:n.editor,field:n.field},null,8,["editor","field"]),Qe(u,{modelValue:i.model,"onUpdate:modelValue":e[2]||(e[2]=d=>i.model=d),show:i.showEditModal,editor:n.editor,field:n.field,"confirm-button":"Insert","modal-title":"Insert Media Embed",onClose:o.closeModal},null,8,["modelValue","show","editor","field","onClose"])])}const _oe=Bt(yoe,[["render",boe]]),woe={components:{MenuBarItem:xre,LinkMenuBarItem:fie,ImageMenuBarItem:Jie,IframeMenuBarItem:loe,MediaEmbedMenuBarItem:_oe},props:{field:{type:Object,default:null},editor:{type:Object,default:null},buttons:{type:Array,default:()=>[]}},computed:{availableButtons(){const t=[];return this.buttons.forEach(e=>{gr(e)&&t.push(this.dynamicButton(e));const n=this.allButtons.find(r=>r.name===e);n&&(n.name==="formatting"&&(n.options=this.getEnabledOptions(n.options,this.getFormattingOptions())),n.name==="table"&&(n.options=this.getEnabledOptions(n.options,this.getTableOptions())),t.push(n))}),t}},created(){this.allButtons=Craft.Vizy.Config.getButtons()},methods:{getFormattingOptions(){let t=["paragraph","code-block","blockquote","h1","h2","h3","h4","h5","h6"];return this.field.settings.vizyConfig.formatting&&this.field.settings.vizyConfig.formatting.length&&(t=this.field.settings.vizyConfig.formatting),t},getTableOptions(){let t=["insert-table","delete-table","add-col-before","add-col-after","delete-col","add-row-before","add-row-after","delete-row","merge-cells","split-cells","toggle-header-column","toggle-header-row","toggle-header-cell"];return this.field.settings.vizyConfig.table&&this.field.settings.vizyConfig.table.length&&(t=this.field.settings.vizyConfig.table),t},getEnabledOptions(t,e){const n=[];return e.forEach(r=>{gr(r)&&n.push(this.dynamicButton(r));const i=t.find(o=>o.name===r);i&&n.push(i)}),n},dynamicButton(t){return{name:t.type,svg:t.svg,title:t.title,action:e=>{const n=e.state.schema.nodes[t.type],r=e.state.schema.marks[t.type];if(n)return e.chain().focus().toggleNode(t.type,"paragraph",t.attrs).run();if(r)return e.chain().focus().toggleMark(t.type,t.attrs).run()},isActive:e=>e.isActive(t.type,t.attrs)}}}},koe={class:"vui-editor-toolbar"};function xoe(t,e,n,r,i,o){return ge(),Se("div",koe,[(ge(!0),Se(kt,null,Zt(o.availableButtons,(s,l)=>(ge(),Et(Qs(s.component||"MenuBarItem"),wi({key:l},s,{editor:n.editor,field:n.field}),null,16,["editor","field"]))),128))])}const Soe=Bt(woe,[["render",xoe]]);class Coe{constructor({options:e,editorView:n}){this.options={element:null,onUpdate:()=>!1,...e},this.preventHide=!1,this.editorView=n,this.isActive=!1,this.top=0,this.behaviour=this.options.editor.vizyField.settings.blockTypeBehaviour,this.behaviour==="click"&&(this.options.element.addEventListener("mousedown",this.mousedownHandler.bind(this),{capture:!0}),this.options.editor.on("focus",this.focusHandler.bind(this)),this.options.editor.on("blur",this.blurHandler.bind(this)),this.options.editor.on("resize",this.resizeHandler.bind(this))),this.behaviour==="hover"&&(this.options.editor.view.dom.addEventListener("mousemove",this.mouseenterHandler.bind(this)),this.options.editor.view.dom.addEventListener("mouseleave",this.mouseleaveHandler.bind(this)))}mouseenterHandler(e){const{view:n}=this.options.editor,r=n.posAtCoords({left:e.clientX,top:e.clientY});if(r.pos&&r.inside>-1){const i=r.pos,o=n.state.doc.resolve(i).parent;lw(o)?setTimeout(()=>{const s=this.options.element.offsetParent;if(s){const l=s.getBoundingClientRect(),f=n.coordsAtPos(i).top-l.top;this.isActive=!0,this.top=f,this.options.editor.vizyField.currentNodeHoverPosition=i,this.sendUpdate()}},10):this.hide()}}mouseleaveHandler(e){e.relatedTarget&&e.relatedTarget.classList.contains("vui-editor-insert-btn")||this.hide()}mousedownHandler(){this.preventHide=!0}focusHandler(){this.update(this.options.editor.view)}blurHandler(e){if(this.preventHide){this.preventHide=!1;return}this.hide(e)}resizeHandler(){this.isActive&&this.update(this.options.editor.view)}isNodeEmpty(e){return!e.toJSON().content}update(e,n){const{state:r,composing:i}=e,{doc:o,selection:s}=r,l=n&&n.doc.eq(o)&&n.selection.eq(s);if(i||l)return;const{$anchor:u,anchor:f,empty:d}=s,m=this.options.element.offsetParent,v=u.depth===1,y=u.parent.type===r.doc.type.contentMatch.defaultType,_=this.isNodeEmpty(s.$anchor.parent);if(!d||!m||!(v&&y&&_)){this.hide();return}setTimeout(()=>{const x=m.getBoundingClientRect(),A=e.coordsAtPos(f).top-x.top;this.isActive=!0,this.top=A,this.sendUpdate()},10)}sendUpdate(){this.options.onUpdate({isActive:this.isActive,top:this.top})}hide(e){e&&e.relatedTarget&&this.options.element.parentNode&&this.options.element.parentNode.contains(e.relatedTarget)||(this.isActive=!1,this.sendUpdate())}destroy(){this.behaviour==="click"&&(this.options.element.removeEventListener("mousedown",this.mousedownHandler),this.options.editor.off("focus",this.focusHandler),this.options.editor.off("blur",this.blurHandler),this.options.editor.off("resize",this.resizeHandler)),this.behaviour==="hover"&&(this.options.editor.view.dom.removeEventListener("mousemove",this.mouseenterHandler),this.options.editor.view.dom.removeEventListener("mouseleave",this.mouseleaveHandler))}}function Toe(t){return new on({key:new xn("floatingMenu"),view(e){return new Coe({editorView:e,options:t})}})}const Eoe={props:{editor:{type:Object,default:null}},emits:["show","hide"],data(){return{menu:{isActive:!1,left:0,bottom:0}}},computed:{variables(){return{focused:this.editor.view.focused,focus:this.editor.focus,commands:this.editor.commands,isActive:this.editor.isActive,getMarkAttrs:this.editor.getAttributes.bind(this.editor),getNodeAttrs:this.editor.getAttributes.bind(this.editor),menu:this.menu}}},watch:{editor:{immediate:!0,handler(t){t&&this.$nextTick(()=>{t.registerPlugin(Toe({editor:t,element:this.$el,onUpdate:e=>{e.isActive&&this.menu.isActive===!1?this.$emit("show",e):!e.isActive&&this.menu.isActive===!0&&this.$emit("hide",e),this.menu=e}}))})}}},beforeUnmount(){},render(){return this.editor?Hr("div",null,this.$slots.default({focused:this.editor.view.focused,focus:this.editor.focus,commands:this.editor.commands,isActive:this.editor.isActive,getMarkAttrs:this.editor.getAttributes.bind(this.editor),getNodeAttrs:this.editor.getAttributes.bind(this.editor),menu:this.menu})):null}},Aoe={name:"BlockPicker",components:{FloatingMenu:Eoe},props:{field:{type:Object,default:null},editor:{type:Object,default:null},blockGroups:{type:Array,default:()=>[]}},data(){return{tippy:null,search:"",selectedIndex:0}},computed:{filteredBlockGroups(){const{blockGroups:t}=this;let e=0;return t.forEach(n=>{Array.isArray(n.blockTypes)&&n.blockTypes.forEach(r=>{r.countIndex=e,e++})}),t.reduce((n,r)=>{let i=[];return Array.isArray(r.blockTypes)&&(i=r.blockTypes.filter(o=>o.name.toLowerCase().includes(this.search.toLowerCase()))),i.length?n.concat({...r,blockTypes:i}):n},[])},totalBlockCount(){let t=0;return this.blockGroups.forEach(e=>{Array.isArray(e.blockTypes)&&(t+=e.blockTypes.length)}),t}},mounted(){this.$nextTick(()=>{const t=this.$el.querySelector("#vizy-blocks-template");t&&(t.style.display="block",this.tippy=Kr(this.$el.querySelector(".vui-editor-insert-btn"),{content:t,trigger:"click",allowHTML:!0,arrow:!0,interactive:!0,placement:"right",theme:"vui-block-picker light-border",maxWidth:"300px",duration:200,zIndex:100,appendTo:()=>document.body,hideOnClick:!0}))})},methods:{moveSelectionLeft(){this.selectedIndex>0&&this.selectedIndex--},moveSelectionRight(){const t=Object.values(this.filteredBlockGroups).map(e=>e.blockTypes).flat();this.selectedIndex{this.$events.emit("vizy-blocks:addedBlock")},50),this.tippy.hide()},blockTypeDisabled(t){var l,u;let e=0;const n={};this.blockGroups.forEach(f=>{f.blockTypes.forEach(d=>{n[d.id]=0})}),(u=(l=this.editor.state.doc)==null?void 0:l.content)==null||u.content.forEach(f=>{const d=Qn(f,"type.name"),m=Qn(f,"type.attrs.enabled"),v=Qn(f,"attrs.values.type");d==="vizyBlock"&&m&&(e+=1,n[v]+=1)});const{maxBlocks:r,maxBlockTypeBlocks:i}=this.editor.vizyField.settings;if(r&&e>=r)return!0;const o=Qn(i,t.id);return Qn(n,t.id)>=o},onClick(){const{blockTypeBehaviour:t}=this.editor.vizyField.settings;if(t==="hover"){const{view:e}=this.editor,n=st.create(e.state.doc,this.editor.vizyField.currentNodeHoverPosition),r=e.state.tr.setSelection(n);e.dispatch(r)}},closePane(){this.tippy&&this.tippy.hide()}}},Ooe=ee("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512"},[ee("path",{fill:"currentColor",d:"M368 224H224V80c0-8.84-7.16-16-16-16h-32c-8.84 0-16 7.16-16 16v144H16c-8.84 0-16 7.16-16 16v32c0 8.84 7.16 16 16 16h144v144c0 8.84 7.16 16 16 16h32c8.84 0 16-7.16 16-16V288h144c8.84 0 16-7.16 16-16v-32c0-8.84-7.16-16-16-16z"})],-1),Moe=[Ooe],Loe={id:"vizy-blocks-template",style:{display:"none"}},Noe={key:0},Ioe={key:1},Poe=ee("hr",null,null,-1),Doe={class:"vui-block-items-header"},Roe={class:"vui-block-items"},zoe=["onClick"],Boe=["innerHTML"],$oe={class:"vui-block-item-heading"},Hoe={key:2,class:"vui-block-items-none"},Foe=ee("hr",null,null,-1),Voe={key:3,class:"vui-block-items-empty"};function joe(t,e,n,r,i,o){const s=ut("floating-menu");return Ut((ge(),Et(s,{ref:"menu",editor:n.editor},{default:Vt(({menu:l})=>[ee("div",{class:gt(["vui-editor-insert",{"is-active":l.isActive}]),style:oi(`top: ${l.top}px`),onKeydown:[e[2]||(e[2]=Tu(lt((...u)=>o.moveSelectionLeft&&o.moveSelectionLeft(...u),["prevent"]),["left"])),e[3]||(e[3]=Tu(lt((...u)=>o.moveSelectionRight&&o.moveSelectionRight(...u),["prevent"]),["right"])),e[4]||(e[4]=Tu(lt((...u)=>o.closePane&&o.closePane(...u),["prevent"]),["escape"]))]},[ee("button",{type:"button","aria-label":"Add block","aria-haspopup":"true","aria-expanded":"false",class:"vui-editor-insert-btn",onClick:e[0]||(e[0]=(...u)=>o.onClick&&o.onClick(...u))},Moe),ee("div",Loe,[o.totalBlockCount?(ge(),Se("div",Noe,[Ut(ee("input",{"onUpdate:modelValue":e[1]||(e[1]=u=>i.search=u),type:"text",class:"text fullwidth",placeholder:"Search for blocks"},null,512),[[Mn,i.search]])])):_t("",!0),o.filteredBlockGroups.length?(ge(),Se("div",Ioe,[(ge(!0),Se(kt,null,Zt(o.filteredBlockGroups,(u,f)=>(ge(),Se("div",{key:f,class:"vui-block-group"},[Poe,ee("div",Doe,Ne(u.name),1),ee("div",Roe,[(ge(!0),Se(kt,null,Zt(u.blockTypes,(d,m)=>(ge(),Se("div",{key:m,class:gt(["vui-block-item",{disabled:o.blockTypeDisabled(d),"is-selected":i.selectedIndex===d.countIndex}]),onClick:v=>o.addBlock(d)},[ee("div",{innerHTML:d.icon.svg},null,8,Boe),ee("span",$oe,Ne(d.name),1)],10,zoe))),128))])]))),128))])):i.search?(ge(),Se("div",Hoe,[Foe,Ui(" "+Ne(t.t("vizy","No blocks found for “{search}”.",{search:i.search})),1)])):(ge(),Se("div",Voe,Ne(t.t("vizy","No blocks available.")),1))])],38)]),_:1},8,["editor"])),[[Bu,n.blockGroups.length]])}const Woe=Bt(Aoe,[["render",joe]]);var Uoe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qoe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var tg={},Koe={get exports(){return tg},set exports(t){tg=t}},AE;function Or(){return AE||(AE=1,function(t,e){(function(n,r){t.exports=r()})(Uoe,function(){var n=navigator.userAgent,r=navigator.platform,i=/gecko\/\d/i.test(n),o=/MSIE \d/.test(n),s=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(n),l=/Edge\/(\d+)/.exec(n),u=o||s||l,f=u&&(o?document.documentMode||6:+(l||s)[1]),d=!l&&/WebKit\//.test(n),m=d&&/Qt\/\d+\.\d+/.test(n),v=!l&&/Chrome\/(\d+)/.exec(n),y=v&&+v[1],_=/Opera\//.test(n),C=/Apple Computer/.test(navigator.vendor),x=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(n),k=/PhantomJS/.test(n),A=C&&(/Mobile\/\w+/.test(n)||navigator.maxTouchPoints>2),N=/Android/.test(n),E=A||N||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(n),H=A||/Mac/.test(r),I=/\bCrOS\b/.test(n),q=/win/i.test(r),P=_&&n.match(/Version\/(\d*\.\d*)/);P&&(P=Number(P[1])),P&&P>=15&&(_=!1,d=!0);var z=H&&(m||_&&(P==null||P<12.11)),w=i||u&&f>=9;function R(a){return new RegExp("(^|\\s)"+a+"(?:$|\\s)\\s*")}var U=function(a,c){var p=a.className,h=R(c).exec(p);if(h){var g=p.slice(h.index+h[0].length);a.className=p.slice(0,h.index)+(g?h[1]+g:"")}};function K(a){for(var c=a.childNodes.length;c>0;--c)a.removeChild(a.firstChild);return a}function oe(a,c){return K(a).appendChild(c)}function D(a,c,p,h){var g=document.createElement(a);if(p&&(g.className=p),h&&(g.style.cssText=h),typeof c=="string")g.appendChild(document.createTextNode(c));else if(c)for(var b=0;b=c)return S+(c-b);S+=T-b,S+=p-S%p,b=T+1}}var Ee=function(){this.id=null,this.f=null,this.time=0,this.handler=Xe(this.onTimeout,this)};Ee.prototype.onTimeout=function(a){a.id=0,a.time<=+new Date?a.f():setTimeout(a.handler,a.time-+new Date)},Ee.prototype.set=function(a,c){this.f=c;var p=+new Date+a;(!this.id||p=c)return h+Math.min(S,c-g);if(g+=b-h,g+=p-g%p,h=b+1,g>=c)return h}}var _e=[""];function xe(a){for(;_e.length<=a;)_e.push(G(_e)+" ");return _e[a]}function G(a){return a[a.length-1]}function Z(a,c){for(var p=[],h=0;h"€"&&(a.toUpperCase()!=a.toLowerCase()||j.test(a))}function Q(a,c){return c?c.source.indexOf("\\w")>-1&&F(a)?!0:c.test(a):F(a)}function le(a){for(var c in a)if(a.hasOwnProperty(c)&&a[c])return!1;return!0}var pe=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ye(a){return a.charCodeAt(0)>=768&&pe.test(a)}function Y(a,c,p){for(;(p<0?c>0:cp?-1:1;;){if(c==p)return c;var g=(c+p)/2,b=h<0?Math.ceil(g):Math.floor(g);if(b==c)return a(b)?c:p;a(b)?p=b:c=b+h}}function de(a,c,p,h){if(!a)return h(c,p,"ltr",0);for(var g=!1,b=0;bc||c==p&&S.to==c)&&(h(Math.max(S.from,c),Math.min(S.to,p),S.level==1?"rtl":"ltr",b),g=!0)}g||h(c,p,"ltr")}var Te=null;function je(a,c,p){var h;Te=null;for(var g=0;gc)return g;b.to==c&&(b.from!=b.to&&p=="before"?h=g:Te=g),b.from==c&&(b.from!=b.to&&p!="before"?h=g:Te=g)}return h??Te}var he=function(){var a="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",c="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function p(B){return B<=247?a.charAt(B):1424<=B&&B<=1524?"R":1536<=B&&B<=1785?c.charAt(B-1536):1774<=B&&B<=2220?"r":8192<=B&&B<=8203?"w":B==8204?"b":"L"}var h=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,g=/[stwN]/,b=/[LRr]/,S=/[Lb1n]/,T=/[1n]/;function M(B,J,te){this.level=B,this.from=J,this.to=te}return function(B,J){var te=J=="ltr"?"L":"R";if(B.length==0||J=="ltr"&&!h.test(B))return!1;for(var fe=B.length,ue=[],ke=0;ke-1&&(h[c]=g.slice(0,b).concat(g.slice(b+1)))}}}function ot(a,c){var p=Je(a,c);if(p.length)for(var h=Array.prototype.slice.call(arguments,2),g=0;g0}function Xt(a){a.prototype.on=function(c,p){me(this,c,p)},a.prototype.off=function(c,p){ct(this,c,p)}}function Gt(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function Kn(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function Gr(a){return a.defaultPrevented!=null?a.defaultPrevented:a.returnValue==!1}function Yr(a){Gt(a),Kn(a)}function Sn(a){return a.target||a.srcElement}function pc(a){var c=a.which;return c==null&&(a.button&1?c=1:a.button&2?c=3:a.button&4&&(c=2)),H&&a.ctrlKey&&c==1&&(c=3),c}var fv=function(){if(u&&f<9)return!1;var a=D("div");return"draggable"in a||"dragDrop"in a}(),ci;function dv(a){if(ci==null){var c=D("span","​");oe(a,D("span",[c,document.createTextNode("x")])),a.firstChild.offsetHeight!=0&&(ci=c.offsetWidth<=1&&c.offsetHeight>2&&!(u&&f<8))}var p=ci?D("span","​"):D("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return p.setAttribute("cm-text",""),p}var Pl;function Wd(a){if(Pl!=null)return Pl;var c=oe(a,document.createTextNode("AخA")),p=ce(c,0,1).getBoundingClientRect(),h=ce(c,1,2).getBoundingClientRect();return K(a),!p||p.left==p.right?!1:Pl=h.right-p.right<3}var mc=` - -b`.split(/\n/).length!=3?function(a){for(var c=0,p=[],h=a.length;c<=h;){var g=a.indexOf(` -`,c);g==-1&&(g=a.length);var b=a.slice(c,a.charAt(g-1)=="\r"?g-1:g),S=b.indexOf("\r");S!=-1?(p.push(b.slice(0,S)),c+=S+1):(p.push(b),c=g+1)}return p}:function(a){return a.split(/\r\n?|\n/)},us=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch{return!1}}:function(a){var c;try{c=a.ownerDocument.selection.createRange()}catch{}return!c||c.parentElement()!=a?!1:c.compareEndPoints("StartToEnd",c)!=0},Yi=function(){var a=D("div");return"oncopy"in a?!0:(a.setAttribute("oncopy","return;"),typeof a.oncopy=="function")}(),Ji=null;function Ud(a){if(Ji!=null)return Ji;var c=oe(a,D("span","x")),p=c.getBoundingClientRect(),h=ce(c,0,1).getBoundingClientRect();return Ji=Math.abs(p.left-h.left)>1}var Ci={},cs={};function qd(a,c){arguments.length>2&&(c.dependencies=Array.prototype.slice.call(arguments,2)),Ci[a]=c}function Dl(a,c){cs[a]=c}function Mr(a){if(typeof a=="string"&&cs.hasOwnProperty(a))a=cs[a];else if(a&&typeof a.name=="string"&&cs.hasOwnProperty(a.name)){var c=cs[a.name];typeof c=="string"&&(c={name:c}),a=O(c,a),a.name=c.name}else{if(typeof a=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return Mr("application/xml");if(typeof a=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(a))return Mr("application/json")}return typeof a=="string"?{name:a}:a||{name:"null"}}function xo(a,c){c=Mr(c);var p=Ci[c.name];if(!p)return xo(a,"text/plain");var h=p(a,c);if(fs.hasOwnProperty(c.name)){var g=fs[c.name];for(var b in g)g.hasOwnProperty(b)&&(h.hasOwnProperty(b)&&(h["_"+b]=h[b]),h[b]=g[b])}if(h.name=c.name,c.helperType&&(h.helperType=c.helperType),c.modeProps)for(var S in c.modeProps)h[S]=c.modeProps[S];return h}var fs={};function Kd(a,c){var p=fs.hasOwnProperty(a)?fs[a]:fs[a]={};Ie(c,p)}function So(a,c){if(c===!0)return c;if(a.copyState)return a.copyState(c);var p={};for(var h in c){var g=c[h];g instanceof Array&&(g=g.concat([])),p[h]=g}return p}function ds(a,c){for(var p;a.innerMode&&(p=a.innerMode(c),!(!p||p.mode==a));)c=p.state,a=p.mode;return p||{mode:a,state:c}}function gc(a,c,p){return a.startState?a.startState(c,p):!0}var ln=function(a,c,p){this.pos=this.start=0,this.string=a,this.tabSize=c||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=p};ln.prototype.eol=function(){return this.pos>=this.string.length},ln.prototype.sol=function(){return this.pos==this.lineStart},ln.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ln.prototype.next=function(){if(this.posc},ln.prototype.eatSpace=function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},ln.prototype.skipToEnd=function(){this.pos=this.string.length},ln.prototype.skipTo=function(a){var c=this.string.indexOf(a,this.pos);if(c>-1)return this.pos=c,!0},ln.prototype.backUp=function(a){this.pos-=a},ln.prototype.column=function(){return this.lastColumnPos0?null:(b&&c!==!1&&(this.pos+=b[0].length),b)}},ln.prototype.current=function(){return this.string.slice(this.start,this.pos)},ln.prototype.hideFirstChars=function(a,c){this.lineStart+=a;try{return c()}finally{this.lineStart-=a}},ln.prototype.lookAhead=function(a){var c=this.lineOracle;return c&&c.lookAhead(a)},ln.prototype.baseToken=function(){var a=this.lineOracle;return a&&a.baseToken(this.pos)};function Ge(a,c){if(c-=a.first,c<0||c>=a.size)throw new Error("There is no line "+(c+a.first)+" in the document.");for(var p=a;!p.lines;)for(var h=0;;++h){var g=p.children[h],b=g.chunkSize();if(c=a.first&&cp?se(p,Ge(a,p).text.length):VN(c,Ge(a,c.line).text.length)}function VN(a,c){var p=a.ch;return p==null||p>c?se(a.line,c):p<0?se(a.line,0):a}function Jw(a,c){for(var p=[],h=0;hthis.maxLookAhead&&(this.maxLookAhead=a),c},Zi.prototype.baseToken=function(a){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=a;)this.baseTokenPos+=2;var c=this.baseTokens[this.baseTokenPos+1];return{type:c&&c.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-a}},Zi.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Zi.fromSaved=function(a,c,p){return c instanceof Gd?new Zi(a,So(a.mode,c.state),p,c.lookAhead):new Zi(a,So(a.mode,c),p)},Zi.prototype.save=function(a){var c=a!==!1?So(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Gd(c,this.maxLookAhead):c};function Xw(a,c,p,h){var g=[a.state.modeGen],b={};rk(a,c.text,a.doc.mode,p,function(B,J){return g.push(B,J)},b,h);for(var S=p.state,T=function(B){p.baseTokens=g;var J=a.state.overlays[B],te=1,fe=0;p.state=!0,rk(a,c.text,J.mode,p,function(ue,ke){for(var Ce=te;feue&&g.splice(te,1,ue,g[te+1],Me),te+=2,fe=Math.min(ue,Me)}if(ke)if(J.opaque)g.splice(Ce,te-Ce,ue,"overlay "+ke),te=Ce+2;else for(;Cea.options.maxHighlightLength&&So(a.doc.mode,h.state),b=Xw(a,c,h);g&&(h.state=g),c.stateAfter=h.save(!g),c.styles=b.styles,b.classes?c.styleClasses=b.classes:c.styleClasses&&(c.styleClasses=null),p===a.doc.highlightFrontier&&(a.doc.modeFrontier=Math.max(a.doc.modeFrontier,++a.doc.highlightFrontier))}return c.styles}function vc(a,c,p){var h=a.doc,g=a.display;if(!h.mode.startState)return new Zi(h,!0,c);var b=jN(a,c,p),S=b>h.first&&Ge(h,b-1).stateAfter,T=S?Zi.fromSaved(h,S,b):new Zi(h,gc(h.mode),b);return h.iter(b,c,function(M){hv(a,M.text,T);var B=T.line;M.stateAfter=B==c-1||B%5==0||B>=g.viewFrom&&Bc.start)return b}throw new Error("Mode "+a.name+" failed to advance stream.")}var ek=function(a,c,p){this.start=a.start,this.end=a.pos,this.string=a.current(),this.type=c||null,this.state=p};function tk(a,c,p,h){var g=a.doc,b=g.mode,S;c=dt(g,c);var T=Ge(g,c.line),M=vc(a,c.line,p),B=new ln(T.text,a.options.tabSize,M),J;for(h&&(J=[]);(h||B.posa.options.maxHighlightLength?(T=!1,S&&hv(a,c,h,J.pos),J.pos=c.length,te=null):te=nk(pv(p,J,h.state,fe),b),fe){var ue=fe[0].name;ue&&(te="m-"+(te?ue+" "+te:ue))}if(!T||B!=te){for(;MS;--T){if(T<=b.first)return b.first;var M=Ge(b,T-1),B=M.stateAfter;if(B&&(!p||T+(B instanceof Gd?B.lookAhead:0)<=b.modeFrontier))return T;var J=Be(M.text,null,a.options.tabSize);(g==null||h>J)&&(g=T-1,h=J)}return g}function WN(a,c){if(a.modeFrontier=Math.min(a.modeFrontier,c),!(a.highlightFrontierp;h--){var g=Ge(a,h).stateAfter;if(g&&(!(g instanceof Gd)||h+g.lookAhead=c:b.to>c);(h||(h=[])).push(new Yd(S,b.from,M?null:b.to))}}return h}function JN(a,c,p){var h;if(a)for(var g=0;g=c:b.to>c);if(T||b.from==c&&S.type=="bookmark"&&(!p||b.marker.insertLeft)){var M=b.from==null||(S.inclusiveLeft?b.from<=c:b.from0&&T)for(var Ve=0;Ve0)){var J=[M,1],te=we(B.from,T.from),fe=we(B.to,T.to);(te<0||!S.inclusiveLeft&&!te)&&J.push({from:B.from,to:T.from}),(fe>0||!S.inclusiveRight&&!fe)&&J.push({from:T.to,to:B.to}),g.splice.apply(g,J),M+=J.length-3}}return g}function sk(a){var c=a.markedSpans;if(c){for(var p=0;pc)&&(!h||gv(h,b.marker)<0)&&(h=b.marker)}return h}function ck(a,c,p,h,g){var b=Ge(a,c),S=To&&b.markedSpans;if(S)for(var T=0;T=0&&te<=0||J<=0&&te>=0)&&(J<=0&&(M.marker.inclusiveRight&&g.inclusiveLeft?we(B.to,p)>=0:we(B.to,p)>0)||J>=0&&(M.marker.inclusiveRight&&g.inclusiveLeft?we(B.from,h)<=0:we(B.from,h)<0)))return!0}}}function Ti(a){for(var c;c=uk(a);)a=c.find(-1,!0).line;return a}function QN(a){for(var c;c=Zd(a);)a=c.find(1,!0).line;return a}function eI(a){for(var c,p;c=Zd(a);)a=c.find(1,!0).line,(p||(p=[])).push(a);return p}function vv(a,c){var p=Ge(a,c),h=Ti(p);return p==h?c:$t(h)}function fk(a,c){if(c>a.lastLine())return c;var p=Ge(a,c),h;if(!hs(a,p))return c;for(;h=Zd(p);)p=h.find(1,!0).line;return $t(p)+1}function hs(a,c){var p=To&&c.markedSpans;if(p){for(var h=void 0,g=0;gc.maxLineLength&&(c.maxLineLength=g,c.maxLine=h)})}var zl=function(a,c,p){this.text=a,ak(this,c),this.height=p?p(this):1};zl.prototype.lineNo=function(){return $t(this)},Xt(zl);function tI(a,c,p,h){a.text=c,a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null),a.order!=null&&(a.order=null),sk(a),ak(a,p);var g=h?h(a):1;g!=a.height&&fi(a,g)}function nI(a){a.parent=null,sk(a)}var rI={},iI={};function dk(a,c){if(!a||/^\s*$/.test(a))return null;var p=c.addModeClass?iI:rI;return p[a]||(p[a]=a.replace(/\S+/g,"cm-$&"))}function hk(a,c){var p=ae("span",null,null,d?"padding-right: .1px":null),h={pre:ae("pre",[p],"CodeMirror-line"),content:p,col:0,pos:0,cm:a,trailingSpace:!1,splitSpaces:a.getOption("lineWrapping")};c.measure={};for(var g=0;g<=(c.rest?c.rest.length:0);g++){var b=g?c.rest[g-1]:c.line,S=void 0;h.pos=0,h.addToken=sI,Wd(a.display.measure)&&(S=Ae(b,a.doc.direction))&&(h.addToken=lI(h.addToken,S)),h.map=[];var T=c!=a.display.externalMeasured&&$t(b);uI(b,h,Zw(a,b,T)),b.styleClasses&&(b.styleClasses.bgClass&&(h.bgClass=vt(b.styleClasses.bgClass,h.bgClass||"")),b.styleClasses.textClass&&(h.textClass=vt(b.styleClasses.textClass,h.textClass||""))),h.map.length==0&&h.map.push(0,0,h.content.appendChild(dv(a.display.measure))),g==0?(c.measure.map=h.map,c.measure.cache={}):((c.measure.maps||(c.measure.maps=[])).push(h.map),(c.measure.caches||(c.measure.caches=[])).push({}))}if(d){var M=h.content.lastChild;(/\bcm-tab\b/.test(M.className)||M.querySelector&&M.querySelector(".cm-tab"))&&(h.content.className="cm-tab-wrap-hack")}return ot(a,"renderLine",a,c.line,h.pre),h.pre.className&&(h.textClass=vt(h.pre.className,h.textClass||"")),h}function oI(a){var c=D("span","•","cm-invalidchar");return c.title="\\u"+a.charCodeAt(0).toString(16),c.setAttribute("aria-label",c.title),c}function sI(a,c,p,h,g,b,S){if(c){var T=a.splitSpaces?aI(c,a.trailingSpace):c,M=a.cm.state.specialChars,B=!1,J;if(!M.test(c))a.col+=c.length,J=document.createTextNode(T),a.map.push(a.pos,a.pos+c.length,J),u&&f<9&&(B=!0),a.pos+=c.length;else{J=document.createDocumentFragment();for(var te=0;;){M.lastIndex=te;var fe=M.exec(c),ue=fe?fe.index-te:c.length-te;if(ue){var ke=document.createTextNode(T.slice(te,te+ue));u&&f<9?J.appendChild(D("span",[ke])):J.appendChild(ke),a.map.push(a.pos,a.pos+ue,ke),a.col+=ue,a.pos+=ue}if(!fe)break;te+=ue+1;var Ce=void 0;if(fe[0]==" "){var Me=a.cm.options.tabSize,De=Me-a.col%Me;Ce=J.appendChild(D("span",xe(De),"cm-tab")),Ce.setAttribute("role","presentation"),Ce.setAttribute("cm-text"," "),a.col+=De}else fe[0]=="\r"||fe[0]==` -`?(Ce=J.appendChild(D("span",fe[0]=="\r"?"␍":"␤","cm-invalidchar")),Ce.setAttribute("cm-text",fe[0]),a.col+=1):(Ce=a.cm.options.specialCharPlaceholder(fe[0]),Ce.setAttribute("cm-text",fe[0]),u&&f<9?J.appendChild(D("span",[Ce])):J.appendChild(Ce),a.col+=1);a.map.push(a.pos,a.pos+1,Ce),a.pos++}}if(a.trailingSpace=T.charCodeAt(c.length-1)==32,p||h||g||B||b||S){var $e=p||"";h&&($e+=h),g&&($e+=g);var Re=D("span",[J],$e,b);if(S)for(var Ve in S)S.hasOwnProperty(Ve)&&Ve!="style"&&Ve!="class"&&Re.setAttribute(Ve,S[Ve]);return a.content.appendChild(Re)}a.content.appendChild(J)}}function aI(a,c){if(a.length>1&&!/ /.test(a))return a;for(var p=c,h="",g=0;gB&&te.from<=B));fe++);if(te.to>=J)return a(p,h,g,b,S,T,M);a(p,h.slice(0,te.to-B),g,b,null,T,M),b=null,h=h.slice(te.to-B),B=te.to}}}function pk(a,c,p,h){var g=!h&&p.widgetNode;g&&a.map.push(a.pos,a.pos+c,g),!h&&a.cm.display.input.needsContentAttribute&&(g||(g=a.content.appendChild(document.createElement("span"))),g.setAttribute("cm-marker",p.id)),g&&(a.cm.display.input.setUneditable(g),a.content.appendChild(g)),a.pos+=c,a.trailingSpace=!1}function uI(a,c,p){var h=a.markedSpans,g=a.text,b=0;if(!h){for(var S=1;SM||St.collapsed&&et.to==M&&et.from==M)){if(et.to!=null&&et.to!=M&&ue>et.to&&(ue=et.to,Ce=""),St.className&&(ke+=" "+St.className),St.css&&(fe=(fe?fe+";":"")+St.css),St.startStyle&&et.from==M&&(Me+=" "+St.startStyle),St.endStyle&&et.to==ue&&(Ve||(Ve=[])).push(St.endStyle,et.to),St.title&&(($e||($e={})).title=St.title),St.attributes)for(var Yt in St.attributes)($e||($e={}))[Yt]=St.attributes[Yt];St.collapsed&&(!De||gv(De.marker,St)<0)&&(De=et)}else et.from>M&&ue>et.from&&(ue=et.from)}if(Ve)for(var Pn=0;Pn=T)break;for(var Nr=Math.min(T,ue);;){if(J){var wr=M+J.length;if(!De){var wn=wr>Nr?J.slice(0,Nr-M):J;c.addToken(c,wn,te?te+ke:ke,Me,M+wn.length==ue?Ce:"",fe,$e)}if(wr>=Nr){J=J.slice(Nr-M),M=Nr;break}M=wr,Me=""}J=g.slice(b,b=p[B++]),te=dk(p[B++],c.cm.options)}}}function mk(a,c,p){this.line=c,this.rest=eI(c),this.size=this.rest?$t(G(this.rest))-p+1:1,this.node=this.text=null,this.hidden=hs(a,c)}function eh(a,c,p){for(var h=[],g,b=c;b2&&b.push((M.bottom+B.top)/2-p.top)}}b.push(p.bottom-p.top)}}function kk(a,c,p){if(a.line==c)return{map:a.measure.map,cache:a.measure.cache};if(a.rest){for(var h=0;hp)return{map:a.measure.maps[g],cache:a.measure.caches[g],before:!0}}}function _I(a,c){c=Ti(c);var p=$t(c),h=a.display.externalMeasured=new mk(a.doc,c,p);h.lineN=p;var g=h.built=hk(a,h);return h.text=g.pre,oe(a.display.lineMeasure,g.pre),h}function xk(a,c,p,h){return eo(a,$l(a,c),p,h)}function xv(a,c){if(c>=a.display.viewFrom&&c=p.lineN&&cc)&&(b=M-T,g=b-1,c>=M&&(S="right")),g!=null){if(h=a[B+2],T==M&&p==(h.insertLeft?"left":"right")&&(S=p),p=="left"&&g==0)for(;B&&a[B-2]==a[B-3]&&a[B-1].insertLeft;)h=a[(B-=3)+2],S="left";if(p=="right"&&g==M-T)for(;B=0&&(p=a[g]).left==p.right;g--);return p}function kI(a,c,p,h){var g=Ck(c.map,p,h),b=g.node,S=g.start,T=g.end,M=g.collapse,B;if(b.nodeType==3){for(var J=0;J<4;J++){for(;S&&ye(c.line.text.charAt(g.coverStart+S));)--S;for(;g.coverStart+T0&&(M=h="right");var te;a.options.lineWrapping&&(te=b.getClientRects()).length>1?B=te[h=="right"?te.length-1:0]:B=b.getBoundingClientRect()}if(u&&f<9&&!S&&(!B||!B.left&&!B.right)){var fe=b.parentNode.getClientRects()[0];fe?B={left:fe.left,right:fe.left+Fl(a.display),top:fe.top,bottom:fe.bottom}:B=Sk}for(var ue=B.top-c.rect.top,ke=B.bottom-c.rect.top,Ce=(ue+ke)/2,Me=c.view.measure.heights,De=0;De=h.text.length?(M=h.text.length,B="before"):M<=0&&(M=0,B="after"),!T)return S(B=="before"?M-1:M,B=="before");function J(ke,Ce,Me){var De=T[Ce],$e=De.level==1;return S(Me?ke-1:ke,$e!=Me)}var te=je(T,M,B),fe=Te,ue=J(M,te,B=="before");return fe!=null&&(ue.other=J(M,fe,B!="before")),ue}function Lk(a,c){var p=0;c=dt(a.doc,c),a.options.lineWrapping||(p=Fl(a.display)*c.ch);var h=Ge(a.doc,c.line),g=Eo(h)+th(a.display);return{left:p,right:p,top:g,bottom:g+h.height}}function Cv(a,c,p,h,g){var b=se(a,c,p);return b.xRel=g,h&&(b.outside=h),b}function Tv(a,c,p){var h=a.doc;if(p+=a.display.viewOffset,p<0)return Cv(h.first,0,null,-1,-1);var g=Xi(h,p),b=h.first+h.size-1;if(g>b)return Cv(h.first+h.size-1,Ge(h,b).text.length,null,1,1);c<0&&(c=0);for(var S=Ge(h,g);;){var T=SI(a,S,g,c,p),M=ZN(S,T.ch+(T.xRel>0||T.outside>0?1:0));if(!M)return T;var B=M.find(1);if(B.line==g)return B;S=Ge(h,g=B.line)}}function Nk(a,c,p,h){h-=Sv(c);var g=c.text.length,b=X(function(S){return eo(a,p,S-1).bottom<=h},g,0);return g=X(function(S){return eo(a,p,S).top>h},b,g),{begin:b,end:g}}function Ik(a,c,p,h){p||(p=$l(a,c));var g=nh(a,c,eo(a,p,h),"line").top;return Nk(a,c,p,g)}function Ev(a,c,p,h){return a.bottom<=p?!1:a.top>p?!0:(h?a.left:a.right)>c}function SI(a,c,p,h,g){g-=Eo(c);var b=$l(a,c),S=Sv(c),T=0,M=c.text.length,B=!0,J=Ae(c,a.doc.direction);if(J){var te=(a.options.lineWrapping?TI:CI)(a,c,p,b,J,h,g);B=te.level!=1,T=B?te.from:te.to-1,M=B?te.to:te.from-1}var fe=null,ue=null,ke=X(function(nt){var et=eo(a,b,nt);return et.top+=S,et.bottom+=S,Ev(et,h,g,!1)?(et.top<=g&&et.left<=h&&(fe=nt,ue=et),!0):!1},T,M),Ce,Me,De=!1;if(ue){var $e=h-ue.left=Ve.bottom?1:0}return ke=Y(c.text,ke,1),Cv(p,ke,Me,De,h-Ce)}function CI(a,c,p,h,g,b,S){var T=X(function(te){var fe=g[te],ue=fe.level!=1;return Ev(Ei(a,se(p,ue?fe.to:fe.from,ue?"before":"after"),"line",c,h),b,S,!0)},0,g.length-1),M=g[T];if(T>0){var B=M.level!=1,J=Ei(a,se(p,B?M.from:M.to,B?"after":"before"),"line",c,h);Ev(J,b,S,!0)&&J.top>S&&(M=g[T-1])}return M}function TI(a,c,p,h,g,b,S){var T=Nk(a,c,h,S),M=T.begin,B=T.end;/\s/.test(c.text.charAt(B-1))&&B--;for(var J=null,te=null,fe=0;fe=B||ue.to<=M)){var ke=ue.level!=1,Ce=eo(a,h,ke?Math.min(B,ue.to)-1:Math.max(M,ue.from)).right,Me=CeMe)&&(J=ue,te=Me)}}return J||(J=g[g.length-1]),J.fromB&&(J={from:J.from,to:B,level:J.level}),J}var ya;function Hl(a){if(a.cachedTextHeight!=null)return a.cachedTextHeight;if(ya==null){ya=D("pre",null,"CodeMirror-line-like");for(var c=0;c<49;++c)ya.appendChild(document.createTextNode("x")),ya.appendChild(D("br"));ya.appendChild(document.createTextNode("x"))}oe(a.measure,ya);var p=ya.offsetHeight/50;return p>3&&(a.cachedTextHeight=p),K(a.measure),p||1}function Fl(a){if(a.cachedCharWidth!=null)return a.cachedCharWidth;var c=D("span","xxxxxxxxxx"),p=D("pre",[c],"CodeMirror-line-like");oe(a.measure,p);var h=c.getBoundingClientRect(),g=(h.right-h.left)/10;return g>2&&(a.cachedCharWidth=g),g||10}function Av(a){for(var c=a.display,p={},h={},g=c.gutters.clientLeft,b=c.gutters.firstChild,S=0;b;b=b.nextSibling,++S){var T=a.display.gutterSpecs[S].className;p[T]=b.offsetLeft+b.clientLeft+g,h[T]=b.clientWidth}return{fixedPos:Ov(c),gutterTotalWidth:c.gutters.offsetWidth,gutterLeft:p,gutterWidth:h,wrapperWidth:c.wrapper.clientWidth}}function Ov(a){return a.scroller.getBoundingClientRect().left-a.sizer.getBoundingClientRect().left}function Pk(a){var c=Hl(a.display),p=a.options.lineWrapping,h=p&&Math.max(5,a.display.scroller.clientWidth/Fl(a.display)-3);return function(g){if(hs(a.doc,g))return 0;var b=0;if(g.widgets)for(var S=0;S0&&(B=Ge(a.doc,M.line).text).length==M.ch){var J=Be(B,B.length,a.options.tabSize)-B.length;M=se(M.line,Math.max(0,Math.round((b-wk(a.display).left)/Fl(a.display))-J))}return M}function _a(a,c){if(c>=a.display.viewTo||(c-=a.display.viewFrom,c<0))return null;for(var p=a.display.view,h=0;hc)&&(g.updateLineNumbers=c),a.curOp.viewChanged=!0,c>=g.viewTo)To&&vv(a.doc,c)g.viewFrom?ms(a):(g.viewFrom+=h,g.viewTo+=h);else if(c<=g.viewFrom&&p>=g.viewTo)ms(a);else if(c<=g.viewFrom){var b=ih(a,p,p+h,1);b?(g.view=g.view.slice(b.index),g.viewFrom=b.lineN,g.viewTo+=h):ms(a)}else if(p>=g.viewTo){var S=ih(a,c,c,-1);S?(g.view=g.view.slice(0,S.index),g.viewTo=S.lineN):ms(a)}else{var T=ih(a,c,c,-1),M=ih(a,p,p+h,1);T&&M?(g.view=g.view.slice(0,T.index).concat(eh(a,T.lineN,M.lineN)).concat(g.view.slice(M.index)),g.viewTo+=h):ms(a)}var B=g.externalMeasured;B&&(p=g.lineN&&c=h.viewTo)){var b=h.view[_a(a,c)];if(b.node!=null){var S=b.changes||(b.changes=[]);Ze(S,p)==-1&&S.push(p)}}}function ms(a){a.display.viewFrom=a.display.viewTo=a.doc.first,a.display.view=[],a.display.viewOffset=0}function ih(a,c,p,h){var g=_a(a,c),b,S=a.display.view;if(!To||p==a.doc.first+a.doc.size)return{index:g,lineN:p};for(var T=a.display.viewFrom,M=0;M0){if(g==S.length-1)return null;b=T+S[g].size-c,g++}else b=T-c;c+=b,p+=b}for(;vv(a.doc,p)!=p;){if(g==(h<0?0:S.length-1))return null;p+=h*S[g-(h<0?1:0)].size,g+=h}return{index:g,lineN:p}}function EI(a,c,p){var h=a.display,g=h.view;g.length==0||c>=h.viewTo||p<=h.viewFrom?(h.view=eh(a,c,p),h.viewFrom=c):(h.viewFrom>c?h.view=eh(a,c,h.viewFrom).concat(h.view):h.viewFromp&&(h.view=h.view.slice(0,_a(a,p)))),h.viewTo=p}function Dk(a){for(var c=a.display.view,p=0,h=0;h=a.display.viewTo||M.to().line0?S:a.defaultCharWidth())+"px"}if(h.other){var T=p.appendChild(D("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));T.style.display="",T.style.left=h.other.left+"px",T.style.top=h.other.top+"px",T.style.height=(h.other.bottom-h.other.top)*.85+"px"}}function oh(a,c){return a.top-c.top||a.left-c.left}function AI(a,c,p){var h=a.display,g=a.doc,b=document.createDocumentFragment(),S=wk(a.display),T=S.left,M=Math.max(h.sizerWidth,va(a)-h.sizer.offsetLeft)-S.right,B=g.direction=="ltr";function J(Re,Ve,nt,et){Ve<0&&(Ve=0),Ve=Math.round(Ve),et=Math.round(et),b.appendChild(D("div",null,"CodeMirror-selected","position: absolute; left: "+Re+`px; - top: `+Ve+"px; width: "+(nt??M-Re)+`px; - height: `+(et-Ve)+"px"))}function te(Re,Ve,nt){var et=Ge(g,Re),St=et.text.length,Yt,Pn;function sn(wn,kr){return rh(a,se(Re,wn),"div",et,kr)}function Nr(wn,kr,jn){var Tn=Ik(a,et,null,wn),kn=kr=="ltr"==(jn=="after")?"left":"right",un=jn=="after"?Tn.begin:Tn.end-(/\s/.test(et.text.charAt(Tn.end-1))?2:1);return sn(un,kn)[kn]}var wr=Ae(et,g.direction);return de(wr,Ve||0,nt??St,function(wn,kr,jn,Tn){var kn=jn=="ltr",un=sn(wn,kn?"left":"right"),xr=sn(kr-1,kn?"right":"left"),eu=Ve==null&&wn==0,ws=nt==null&&kr==St,Yn=Tn==0,to=!wr||Tn==wr.length-1;if(xr.top-un.top<=3){var Dn=(B?eu:ws)&&Yn,i0=(B?ws:eu)&&to,Lo=Dn?T:(kn?un:xr).left,Ca=i0?M:(kn?xr:un).right;J(Lo,un.top,Ca-Lo,un.bottom)}else{var Ta,ar,tu,o0;kn?(Ta=B&&eu&&Yn?T:un.left,ar=B?M:Nr(wn,jn,"before"),tu=B?T:Nr(kr,jn,"after"),o0=B&&ws&&to?M:xr.right):(Ta=B?Nr(wn,jn,"before"):T,ar=!B&&eu&&Yn?M:un.right,tu=!B&&ws&&to?T:xr.left,o0=B?Nr(kr,jn,"after"):M),J(Ta,un.top,ar-Ta,un.bottom),un.bottom0?c.blinker=setInterval(function(){a.hasFocus()||Vl(a),c.cursorDiv.style.visibility=(p=!p)?"":"hidden"},a.options.cursorBlinkRate):a.options.cursorBlinkRate<0&&(c.cursorDiv.style.visibility="hidden")}}function zk(a){a.hasFocus()||(a.display.input.focus(),a.state.focused||Pv(a))}function Iv(a){a.state.delayingBlurEvent=!0,setTimeout(function(){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1,a.state.focused&&Vl(a))},100)}function Pv(a,c){a.state.delayingBlurEvent&&!a.state.draggingText&&(a.state.delayingBlurEvent=!1),a.options.readOnly!="nocursor"&&(a.state.focused||(ot(a,"focus",a,c),a.state.focused=!0,qe(a.display.wrapper,"CodeMirror-focused"),!a.curOp&&a.display.selForContextMenu!=a.doc.sel&&(a.display.input.reset(),d&&setTimeout(function(){return a.display.input.reset(!0)},20)),a.display.input.receivedFocus()),Nv(a))}function Vl(a,c){a.state.delayingBlurEvent||(a.state.focused&&(ot(a,"blur",a,c),a.state.focused=!1,U(a.display.wrapper,"CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.display.shift=!1)},150))}function sh(a){for(var c=a.display,p=c.lineDiv.offsetTop,h=Math.max(0,c.scroller.getBoundingClientRect().top),g=c.lineDiv.getBoundingClientRect().top,b=0,S=0;S.005||ue<-.005)&&(ga.display.sizerWidth){var Ce=Math.ceil(J/Fl(a.display));Ce>a.display.maxLineLength&&(a.display.maxLineLength=Ce,a.display.maxLine=T.line,a.display.maxLineChanged=!0)}}}Math.abs(b)>2&&(c.scroller.scrollTop+=b)}function Bk(a){if(a.widgets)for(var c=0;c=S&&(b=Xi(c,Eo(Ge(c,M))-a.wrapper.clientHeight),S=M)}return{from:b,to:Math.max(S,b+1)}}function OI(a,c){if(!Ct(a,"scrollCursorIntoView")){var p=a.display,h=p.sizer.getBoundingClientRect(),g=null,b=p.wrapper.ownerDocument;if(c.top+h.top<0?g=!0:c.bottom+h.top>(b.defaultView.innerHeight||b.documentElement.clientHeight)&&(g=!1),g!=null&&!k){var S=D("div","​",null,`position: absolute; - top: `+(c.top-p.viewOffset-th(a.display))+`px; - height: `+(c.bottom-c.top+Qi(a)+p.barHeight)+`px; - left: `+c.left+"px; width: "+Math.max(2,c.right-c.left)+"px;");a.display.lineSpace.appendChild(S),S.scrollIntoView(g),a.display.lineSpace.removeChild(S)}}}function MI(a,c,p,h){h==null&&(h=0);var g;!a.options.lineWrapping&&c==p&&(p=c.sticky=="before"?se(c.line,c.ch+1,"before"):c,c=c.ch?se(c.line,c.sticky=="before"?c.ch-1:c.ch,"after"):c);for(var b=0;b<5;b++){var S=!1,T=Ei(a,c),M=!p||p==c?T:Ei(a,p);g={left:Math.min(T.left,M.left),top:Math.min(T.top,M.top)-h,right:Math.max(T.left,M.left),bottom:Math.max(T.bottom,M.bottom)+h};var B=Dv(a,g),J=a.doc.scrollTop,te=a.doc.scrollLeft;if(B.scrollTop!=null&&(Cc(a,B.scrollTop),Math.abs(a.doc.scrollTop-J)>1&&(S=!0)),B.scrollLeft!=null&&(wa(a,B.scrollLeft),Math.abs(a.doc.scrollLeft-te)>1&&(S=!0)),!S)break}return g}function LI(a,c){var p=Dv(a,c);p.scrollTop!=null&&Cc(a,p.scrollTop),p.scrollLeft!=null&&wa(a,p.scrollLeft)}function Dv(a,c){var p=a.display,h=Hl(a.display);c.top<0&&(c.top=0);var g=a.curOp&&a.curOp.scrollTop!=null?a.curOp.scrollTop:p.scroller.scrollTop,b=kv(a),S={};c.bottom-c.top>b&&(c.bottom=c.top+b);var T=a.doc.height+wv(p),M=c.topT-h;if(c.topg+b){var J=Math.min(c.top,(B?T:c.bottom)-b);J!=g&&(S.scrollTop=J)}var te=a.options.fixedGutter?0:p.gutters.offsetWidth,fe=a.curOp&&a.curOp.scrollLeft!=null?a.curOp.scrollLeft:p.scroller.scrollLeft-te,ue=va(a)-p.gutters.offsetWidth,ke=c.right-c.left>ue;return ke&&(c.right=c.left+ue),c.left<10?S.scrollLeft=0:c.leftue+fe-3&&(S.scrollLeft=c.right+(ke?0:10)-ue),S}function Rv(a,c){c!=null&&(lh(a),a.curOp.scrollTop=(a.curOp.scrollTop==null?a.doc.scrollTop:a.curOp.scrollTop)+c)}function jl(a){lh(a);var c=a.getCursor();a.curOp.scrollToPos={from:c,to:c,margin:a.options.cursorScrollMargin}}function Sc(a,c,p){(c!=null||p!=null)&&lh(a),c!=null&&(a.curOp.scrollLeft=c),p!=null&&(a.curOp.scrollTop=p)}function NI(a,c){lh(a),a.curOp.scrollToPos=c}function lh(a){var c=a.curOp.scrollToPos;if(c){a.curOp.scrollToPos=null;var p=Lk(a,c.from),h=Lk(a,c.to);$k(a,p,h,c.margin)}}function $k(a,c,p,h){var g=Dv(a,{left:Math.min(c.left,p.left),top:Math.min(c.top,p.top)-h,right:Math.max(c.right,p.right),bottom:Math.max(c.bottom,p.bottom)+h});Sc(a,g.scrollLeft,g.scrollTop)}function Cc(a,c){Math.abs(a.doc.scrollTop-c)<2||(i||Bv(a,{top:c}),Hk(a,c,!0),i&&Bv(a),Ac(a,100))}function Hk(a,c,p){c=Math.max(0,Math.min(a.display.scroller.scrollHeight-a.display.scroller.clientHeight,c)),!(a.display.scroller.scrollTop==c&&!p)&&(a.doc.scrollTop=c,a.display.scrollbars.setScrollTop(c),a.display.scroller.scrollTop!=c&&(a.display.scroller.scrollTop=c))}function wa(a,c,p,h){c=Math.max(0,Math.min(c,a.display.scroller.scrollWidth-a.display.scroller.clientWidth)),!((p?c==a.doc.scrollLeft:Math.abs(a.doc.scrollLeft-c)<2)&&!h)&&(a.doc.scrollLeft=c,Uk(a),a.display.scroller.scrollLeft!=c&&(a.display.scroller.scrollLeft=c),a.display.scrollbars.setScrollLeft(c))}function Tc(a){var c=a.display,p=c.gutters.offsetWidth,h=Math.round(a.doc.height+wv(a.display));return{clientHeight:c.scroller.clientHeight,viewHeight:c.wrapper.clientHeight,scrollWidth:c.scroller.scrollWidth,clientWidth:c.scroller.clientWidth,viewWidth:c.wrapper.clientWidth,barLeft:a.options.fixedGutter?p:0,docHeight:h,scrollHeight:h+Qi(a)+c.barHeight,nativeBarWidth:c.nativeBarWidth,gutterWidth:p}}var ka=function(a,c,p){this.cm=p;var h=this.vert=D("div",[D("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),g=this.horiz=D("div",[D("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");h.tabIndex=g.tabIndex=-1,a(h),a(g),me(h,"scroll",function(){h.clientHeight&&c(h.scrollTop,"vertical")}),me(g,"scroll",function(){g.clientWidth&&c(g.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,u&&f<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ka.prototype.update=function(a){var c=a.scrollWidth>a.clientWidth+1,p=a.scrollHeight>a.clientHeight+1,h=a.nativeBarWidth;if(p){this.vert.style.display="block",this.vert.style.bottom=c?h+"px":"0";var g=a.viewHeight-(c?h:0);this.vert.firstChild.style.height=Math.max(0,a.scrollHeight-a.clientHeight+g)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(c){this.horiz.style.display="block",this.horiz.style.right=p?h+"px":"0",this.horiz.style.left=a.barLeft+"px";var b=a.viewWidth-a.barLeft-(p?h:0);this.horiz.firstChild.style.width=Math.max(0,a.scrollWidth-a.clientWidth+b)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&a.clientHeight>0&&(h==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:p?h:0,bottom:c?h:0}},ka.prototype.setScrollLeft=function(a){this.horiz.scrollLeft!=a&&(this.horiz.scrollLeft=a),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ka.prototype.setScrollTop=function(a){this.vert.scrollTop!=a&&(this.vert.scrollTop=a),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ka.prototype.zeroWidthHack=function(){var a=H&&!x?"12px":"18px";this.horiz.style.height=this.vert.style.width=a,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Ee,this.disableVert=new Ee},ka.prototype.enableZeroWidthBar=function(a,c,p){a.style.visibility="";function h(){var g=a.getBoundingClientRect(),b=p=="vert"?document.elementFromPoint(g.right-1,(g.top+g.bottom)/2):document.elementFromPoint((g.right+g.left)/2,g.bottom-1);b!=a?a.style.visibility="hidden":c.set(1e3,h)}c.set(1e3,h)},ka.prototype.clear=function(){var a=this.horiz.parentNode;a.removeChild(this.horiz),a.removeChild(this.vert)};var Ec=function(){};Ec.prototype.update=function(){return{bottom:0,right:0}},Ec.prototype.setScrollLeft=function(){},Ec.prototype.setScrollTop=function(){},Ec.prototype.clear=function(){};function Wl(a,c){c||(c=Tc(a));var p=a.display.barWidth,h=a.display.barHeight;Fk(a,c);for(var g=0;g<4&&p!=a.display.barWidth||h!=a.display.barHeight;g++)p!=a.display.barWidth&&a.options.lineWrapping&&sh(a),Fk(a,Tc(a)),p=a.display.barWidth,h=a.display.barHeight}function Fk(a,c){var p=a.display,h=p.scrollbars.update(c);p.sizer.style.paddingRight=(p.barWidth=h.right)+"px",p.sizer.style.paddingBottom=(p.barHeight=h.bottom)+"px",p.heightForcer.style.borderBottom=h.bottom+"px solid transparent",h.right&&h.bottom?(p.scrollbarFiller.style.display="block",p.scrollbarFiller.style.height=h.bottom+"px",p.scrollbarFiller.style.width=h.right+"px"):p.scrollbarFiller.style.display="",h.bottom&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(p.gutterFiller.style.display="block",p.gutterFiller.style.height=h.bottom+"px",p.gutterFiller.style.width=c.gutterWidth+"px"):p.gutterFiller.style.display=""}var Vk={native:ka,null:Ec};function jk(a){a.display.scrollbars&&(a.display.scrollbars.clear(),a.display.scrollbars.addClass&&U(a.display.wrapper,a.display.scrollbars.addClass)),a.display.scrollbars=new Vk[a.options.scrollbarStyle](function(c){a.display.wrapper.insertBefore(c,a.display.scrollbarFiller),me(c,"mousedown",function(){a.state.focused&&setTimeout(function(){return a.display.input.focus()},0)}),c.setAttribute("cm-not-content","true")},function(c,p){p=="horizontal"?wa(a,c):Cc(a,c)},a),a.display.scrollbars.addClass&&qe(a.display.wrapper,a.display.scrollbars.addClass)}var II=0;function xa(a){a.curOp={cm:a,viewChanged:!1,startHeight:a.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++II,markArrays:null},cI(a.curOp)}function Sa(a){var c=a.curOp;c&&dI(c,function(p){for(var h=0;h=p.viewTo)||p.maxLineChanged&&c.options.lineWrapping,a.update=a.mustUpdate&&new uh(c,a.mustUpdate&&{top:a.scrollTop,ensure:a.scrollToPos},a.forceUpdate)}function RI(a){a.updatedDisplay=a.mustUpdate&&zv(a.cm,a.update)}function zI(a){var c=a.cm,p=c.display;a.updatedDisplay&&sh(c),a.barMeasure=Tc(c),p.maxLineChanged&&!c.options.lineWrapping&&(a.adjustWidthTo=xk(c,p.maxLine,p.maxLine.text.length).left+3,c.display.sizerWidth=a.adjustWidthTo,a.barMeasure.scrollWidth=Math.max(p.scroller.clientWidth,p.sizer.offsetLeft+a.adjustWidthTo+Qi(c)+c.display.barWidth),a.maxScrollLeft=Math.max(0,p.sizer.offsetLeft+a.adjustWidthTo-va(c))),(a.updatedDisplay||a.selectionChanged)&&(a.preparedSelection=p.input.prepareSelection())}function BI(a){var c=a.cm;a.adjustWidthTo!=null&&(c.display.sizer.style.minWidth=a.adjustWidthTo+"px",a.maxScrollLeft=a.display.viewTo)){var p=+new Date+a.options.workTime,h=vc(a,c.highlightFrontier),g=[];c.iter(h.line,Math.min(c.first+c.size,a.display.viewTo+500),function(b){if(h.line>=a.display.viewFrom){var S=b.styles,T=b.text.length>a.options.maxHighlightLength?So(c.mode,h.state):null,M=Xw(a,b,h,!0);T&&(h.state=T),b.styles=M.styles;var B=b.styleClasses,J=M.classes;J?b.styleClasses=J:B&&(b.styleClasses=null);for(var te=!S||S.length!=b.styles.length||B!=J&&(!B||!J||B.bgClass!=J.bgClass||B.textClass!=J.textClass),fe=0;!te&&fep)return Ac(a,a.options.workDelay),!0}),c.highlightFrontier=h.line,c.modeFrontier=Math.max(c.modeFrontier,h.line),g.length&&Lr(a,function(){for(var b=0;b=p.viewFrom&&c.visible.to<=p.viewTo&&(p.updateLineNumbers==null||p.updateLineNumbers>=p.viewTo)&&p.renderedView==p.view&&Dk(a)==0)return!1;qk(a)&&(ms(a),c.dims=Av(a));var g=h.first+h.size,b=Math.max(c.visible.from-a.options.viewportMargin,h.first),S=Math.min(g,c.visible.to+a.options.viewportMargin);p.viewFromS&&p.viewTo-S<20&&(S=Math.min(g,p.viewTo)),To&&(b=vv(a.doc,b),S=fk(a.doc,S));var T=b!=p.viewFrom||S!=p.viewTo||p.lastWrapHeight!=c.wrapperHeight||p.lastWrapWidth!=c.wrapperWidth;EI(a,b,S),p.viewOffset=Eo(Ge(a.doc,p.viewFrom)),a.display.mover.style.top=p.viewOffset+"px";var M=Dk(a);if(!T&&M==0&&!c.force&&p.renderedView==p.view&&(p.updateLineNumbers==null||p.updateLineNumbers>=p.viewTo))return!1;var B=VI(a);return M>4&&(p.lineDiv.style.display="none"),WI(a,p.updateLineNumbers,c.dims),M>4&&(p.lineDiv.style.display=""),p.renderedView=p.view,jI(B),K(p.cursorDiv),K(p.selectionDiv),p.gutters.style.height=p.sizer.style.minHeight=0,T&&(p.lastWrapHeight=c.wrapperHeight,p.lastWrapWidth=c.wrapperWidth,Ac(a,400)),p.updateLineNumbers=null,!0}function Wk(a,c){for(var p=c.viewport,h=!0;;h=!1){if(!h||!a.options.lineWrapping||c.oldDisplayWidth==va(a)){if(p&&p.top!=null&&(p={top:Math.min(a.doc.height+wv(a.display)-kv(a),p.top)}),c.visible=ah(a.display,a.doc,p),c.visible.from>=a.display.viewFrom&&c.visible.to<=a.display.viewTo)break}else h&&(c.visible=ah(a.display,a.doc,p));if(!zv(a,c))break;sh(a);var g=Tc(a);xc(a),Wl(a,g),Hv(a,g),c.force=!1}c.signal(a,"update",a),(a.display.viewFrom!=a.display.reportedViewFrom||a.display.viewTo!=a.display.reportedViewTo)&&(c.signal(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo),a.display.reportedViewFrom=a.display.viewFrom,a.display.reportedViewTo=a.display.viewTo)}function Bv(a,c){var p=new uh(a,c);if(zv(a,p)){sh(a),Wk(a,p);var h=Tc(a);xc(a),Wl(a,h),Hv(a,h),p.finish()}}function WI(a,c,p){var h=a.display,g=a.options.lineNumbers,b=h.lineDiv,S=b.firstChild;function T(ke){var Ce=ke.nextSibling;return d&&H&&a.display.currentWheelTarget==ke?ke.style.display="none":ke.parentNode.removeChild(ke),Ce}for(var M=h.view,B=h.viewFrom,J=0;J-1&&(ue=!1),gk(a,te,B,p)),ue&&(K(te.lineNumber),te.lineNumber.appendChild(document.createTextNode(re(a.options,B)))),S=te.node.nextSibling}B+=te.size}for(;S;)S=T(S)}function $v(a){var c=a.gutters.offsetWidth;a.sizer.style.marginLeft=c+"px",Ln(a,"gutterChanged",a)}function Hv(a,c){a.display.sizer.style.minHeight=c.docHeight+"px",a.display.heightForcer.style.top=c.docHeight+"px",a.display.gutters.style.height=c.docHeight+a.display.barHeight+Qi(a)+"px"}function Uk(a){var c=a.display,p=c.view;if(!(!c.alignWidgets&&(!c.gutters.firstChild||!a.options.fixedGutter))){for(var h=Ov(c)-c.scroller.scrollLeft+a.doc.scrollLeft,g=c.gutters.offsetWidth,b=h+"px",S=0;S=105&&(g.wrapper.style.clipPath="inset(0px)"),g.wrapper.setAttribute("translate","no"),u&&f<8&&(g.gutters.style.zIndex=-1,g.scroller.style.paddingRight=0),!d&&!(i&&E)&&(g.scroller.draggable=!0),a&&(a.appendChild?a.appendChild(g.wrapper):a(g.wrapper)),g.viewFrom=g.viewTo=c.first,g.reportedViewFrom=g.reportedViewTo=c.first,g.view=[],g.renderedView=null,g.externalMeasured=null,g.viewOffset=0,g.lastWrapHeight=g.lastWrapWidth=0,g.updateLineNumbers=null,g.nativeBarWidth=g.barHeight=g.barWidth=0,g.scrollbarsClipped=!1,g.lineNumWidth=g.lineNumInnerWidth=g.lineNumChars=null,g.alignWidgets=!1,g.cachedCharWidth=g.cachedTextHeight=g.cachedPaddingH=null,g.maxLine=null,g.maxLineLength=0,g.maxLineChanged=!1,g.wheelDX=g.wheelDY=g.wheelStartX=g.wheelStartY=null,g.shift=!1,g.selForContextMenu=null,g.activeTouch=null,g.gutterSpecs=Fv(h.gutters,h.lineNumbers),Kk(g),p.init(g)}var ch=0,Oo=null;u?Oo=-.53:i?Oo=15:v?Oo=-.7:C&&(Oo=-1/3);function Gk(a){var c=a.wheelDeltaX,p=a.wheelDeltaY;return c==null&&a.detail&&a.axis==a.HORIZONTAL_AXIS&&(c=a.detail),p==null&&a.detail&&a.axis==a.VERTICAL_AXIS?p=a.detail:p==null&&(p=a.wheelDelta),{x:c,y:p}}function qI(a){var c=Gk(a);return c.x*=Oo,c.y*=Oo,c}function Yk(a,c){v&&y==102&&(a.display.chromeScrollHack==null?a.display.sizer.style.pointerEvents="none":clearTimeout(a.display.chromeScrollHack),a.display.chromeScrollHack=setTimeout(function(){a.display.chromeScrollHack=null,a.display.sizer.style.pointerEvents=""},100));var p=Gk(c),h=p.x,g=p.y,b=Oo;c.deltaMode===0&&(h=c.deltaX,g=c.deltaY,b=1);var S=a.display,T=S.scroller,M=T.scrollWidth>T.clientWidth,B=T.scrollHeight>T.clientHeight;if(h&&M||g&&B){if(g&&H&&d){e:for(var J=c.target,te=S.view;J!=T;J=J.parentNode)for(var fe=0;fe=0&&we(a,h.to())<=0)return p}return-1};var Ht=function(a,c){this.anchor=a,this.head=c};Ht.prototype.from=function(){return Cn(this.anchor,this.head)},Ht.prototype.to=function(){return It(this.anchor,this.head)},Ht.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ai(a,c,p){var h=a&&a.options.selectionsMayTouch,g=c[p];c.sort(function(fe,ue){return we(fe.from(),ue.from())}),p=Ze(c,g);for(var b=1;b0:M>=0){var B=Cn(T.from(),S.from()),J=It(T.to(),S.to()),te=T.empty()?S.from()==S.head:T.from()==T.head;b<=p&&--p,c.splice(--b,2,new Ht(te?J:B,te?B:J))}}return new Xr(c,p)}function gs(a,c){return new Xr([new Ht(a,c||a)],0)}function vs(a){return a.text?se(a.from.line+a.text.length-1,G(a.text).length+(a.text.length==1?a.from.ch:0)):a.to}function Jk(a,c){if(we(a,c.from)<0)return a;if(we(a,c.to)<=0)return vs(c);var p=a.line+c.text.length-(c.to.line-c.from.line)-1,h=a.ch;return a.line==c.to.line&&(h+=vs(c).ch-c.to.ch),se(p,h)}function Vv(a,c){for(var p=[],h=0;h1&&a.remove(T.line+1,ke-1),a.insert(T.line+1,De)}Ln(a,"change",a,c)}function ys(a,c,p){function h(g,b,S){if(g.linked)for(var T=0;T1&&!a.done[a.done.length-2].ranges)return a.done.pop(),G(a.done)}function nx(a,c,p,h){var g=a.history;g.undone.length=0;var b=+new Date,S,T;if((g.lastOp==h||g.lastOrigin==c.origin&&c.origin&&(c.origin.charAt(0)=="+"&&g.lastModTime>b-(a.cm?a.cm.options.historyEventDelay:500)||c.origin.charAt(0)=="*"))&&(S=YI(g,g.lastOp==h)))T=G(S.changes),we(c.from,c.to)==0&&we(c.from,T.to)==0?T.to=vs(c):S.changes.push(Uv(a,c));else{var M=G(g.done);for((!M||!M.ranges)&&dh(a.sel,g.done),S={changes:[Uv(a,c)],generation:g.generation},g.done.push(S);g.done.length>g.undoDepth;)g.done.shift(),g.done[0].ranges||g.done.shift()}g.done.push(p),g.generation=++g.maxGeneration,g.lastModTime=g.lastSelTime=b,g.lastOp=g.lastSelOp=h,g.lastOrigin=g.lastSelOrigin=c.origin,T||ot(a,"historyAdded")}function JI(a,c,p,h){var g=c.charAt(0);return g=="*"||g=="+"&&p.ranges.length==h.ranges.length&&p.somethingSelected()==h.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}function XI(a,c,p,h){var g=a.history,b=h&&h.origin;p==g.lastSelOp||b&&g.lastSelOrigin==b&&(g.lastModTime==g.lastSelTime&&g.lastOrigin==b||JI(a,b,G(g.done),c))?g.done[g.done.length-1]=c:dh(c,g.done),g.lastSelTime=+new Date,g.lastSelOrigin=b,g.lastSelOp=p,h&&h.clearRedo!==!1&&tx(g.undone)}function dh(a,c){var p=G(c);p&&p.ranges&&p.equals(a)||c.push(a)}function rx(a,c,p,h){var g=c["spans_"+a.id],b=0;a.iter(Math.max(a.first,p),Math.min(a.first+a.size,h),function(S){S.markedSpans&&((g||(g=c["spans_"+a.id]={}))[b]=S.markedSpans),++b})}function ZI(a){if(!a)return null;for(var c,p=0;p-1&&(G(T)[te]=B[te],delete B[te])}}return h}function qv(a,c,p,h){if(h){var g=a.anchor;if(p){var b=we(c,g)<0;b!=we(p,g)<0?(g=c,c=p):b!=we(c,p)<0&&(c=p)}return new Ht(g,c)}else return new Ht(p||c,c)}function hh(a,c,p,h,g){g==null&&(g=a.cm&&(a.cm.display.shift||a.extend)),Gn(a,new Xr([qv(a.sel.primary(),c,p,g)],0),h)}function ox(a,c,p){for(var h=[],g=a.cm&&(a.cm.display.shift||a.extend),b=0;b=c.ch:T.to>c.ch))){if(g&&(ot(M,"beforeCursorEnter"),M.explicitlyCleared))if(b.markedSpans){--S;continue}else break;if(!M.atomic)continue;if(p){var te=M.find(h<0?1:-1),fe=void 0;if((h<0?J:B)&&(te=fx(a,te,-h,te&&te.line==c.line?b:null)),te&&te.line==c.line&&(fe=we(te,p))&&(h<0?fe<0:fe>0))return ql(a,te,c,h,g)}var ue=M.find(h<0?-1:1);return(h<0?B:J)&&(ue=fx(a,ue,h,ue.line==c.line?b:null)),ue?ql(a,ue,c,h,g):null}}return c}function mh(a,c,p,h,g){var b=h||1,S=ql(a,c,p,b,g)||!g&&ql(a,c,p,b,!0)||ql(a,c,p,-b,g)||!g&&ql(a,c,p,-b,!0);return S||(a.cantEdit=!0,se(a.first,0))}function fx(a,c,p,h){return p<0&&c.ch==0?c.line>a.first?dt(a,se(c.line-1)):null:p>0&&c.ch==(h||Ge(a,c.line)).text.length?c.line=0;--g)px(a,{from:h[g].from,to:h[g].to,text:g?[""]:c.text,origin:c.origin});else px(a,c)}}function px(a,c){if(!(c.text.length==1&&c.text[0]==""&&we(c.from,c.to)==0)){var p=Vv(a,c);nx(a,c,p,a.cm?a.cm.curOp.id:NaN),Lc(a,c,p,mv(a,c));var h=[];ys(a,function(g,b){!b&&Ze(h,g.history)==-1&&(yx(g.history,c),h.push(g.history)),Lc(g,c,null,mv(g,c))})}}function gh(a,c,p){var h=a.cm&&a.cm.state.suppressEdits;if(!(h&&!p)){for(var g=a.history,b,S=a.sel,T=c=="undo"?g.done:g.undone,M=c=="undo"?g.undone:g.done,B=0;B=0;--ue){var ke=fe(ue);if(ke)return ke.v}}}}function mx(a,c){if(c!=0&&(a.first+=c,a.sel=new Xr(Z(a.sel.ranges,function(g){return new Ht(se(g.anchor.line+c,g.anchor.ch),se(g.head.line+c,g.head.ch))}),a.sel.primIndex),a.cm)){br(a.cm,a.first,a.first-c,c);for(var p=a.cm.display,h=p.viewFrom;ha.lastLine())){if(c.from.lineb&&(c={from:c.from,to:se(b,Ge(a,b).text.length),text:[c.text[0]],origin:c.origin}),c.removed=Co(a,c.from,c.to),p||(p=Vv(a,c)),a.cm?tP(a.cm,c,h):Wv(a,c,h),ph(a,p,at),a.cantEdit&&mh(a,se(a.firstLine(),0))&&(a.cantEdit=!1)}}function tP(a,c,p){var h=a.doc,g=a.display,b=c.from,S=c.to,T=!1,M=b.line;a.options.lineWrapping||(M=$t(Ti(Ge(h,b.line))),h.iter(M,S.line+1,function(ue){if(ue==g.maxLine)return T=!0,!0})),h.sel.contains(c.from,c.to)>-1&&yr(a),Wv(h,c,p,Pk(a)),a.options.lineWrapping||(h.iter(M,b.line+c.text.length,function(ue){var ke=Qd(ue);ke>g.maxLineLength&&(g.maxLine=ue,g.maxLineLength=ke,g.maxLineChanged=!0,T=!1)}),T&&(a.curOp.updateMaxLine=!0)),WN(h,b.line),Ac(a,400);var B=c.text.length-(S.line-b.line)-1;c.full?br(a):b.line==S.line&&c.text.length==1&&!Zk(a.doc,c)?ps(a,b.line,"text"):br(a,b.line,S.line+1,B);var J=Kt(a,"changes"),te=Kt(a,"change");if(te||J){var fe={from:b,to:S,text:c.text,removed:c.removed,origin:c.origin};te&&Ln(a,"change",a,fe),J&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(fe)}a.display.selForContextMenu=null}function Gl(a,c,p,h,g){var b;h||(h=p),we(h,p)<0&&(b=[h,p],p=b[0],h=b[1]),typeof c=="string"&&(c=a.splitLines(c)),Kl(a,{from:p,to:h,text:c,origin:g})}function gx(a,c,p,h){p1||!(this.children[0]instanceof Ic))){var T=[];this.collapse(T),this.children=[new Ic(T)],this.children[0].parent=this}},collapse:function(a){for(var c=0;c50){for(var S=g.lines.length%25+25,T=S;T10);a.parent.maybeSpill()}},iterN:function(a,c,p){for(var h=0;ha.display.maxLineLength&&(a.display.maxLine=B,a.display.maxLineLength=J,a.display.maxLineChanged=!0)}h!=null&&a&&this.collapsed&&br(a,h,g+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&ux(a.doc)),a&&Ln(a,"markerCleared",a,this,h,g),c&&Sa(a),this.parent&&this.parent.clear()}},bs.prototype.find=function(a,c){a==null&&this.type=="bookmark"&&(a=1);for(var p,h,g=0;g0||S==0&&b.clearWhenEmpty!==!1)return b;if(b.replacedWith&&(b.collapsed=!0,b.widgetNode=ae("span",[b.replacedWith],"CodeMirror-widget"),h.handleMouseEvents||b.widgetNode.setAttribute("cm-ignore-events","true"),h.insertLeft&&(b.widgetNode.insertLeft=!0)),b.collapsed){if(ck(a,c.line,c,p,b)||c.line!=p.line&&ck(a,p.line,c,p,b))throw new Error("Inserting collapsed marker partially overlapping an existing one");qN()}b.addToHistory&&nx(a,{from:c,to:p,origin:"markText"},a.sel,NaN);var T=c.line,M=a.cm,B;if(a.iter(T,p.line+1,function(te){M&&b.collapsed&&!M.options.lineWrapping&&Ti(te)==M.display.maxLine&&(B=!0),b.collapsed&&T!=c.line&&fi(te,0),GN(te,new Yd(b,T==c.line?c.ch:null,T==p.line?p.ch:null),a.cm&&a.cm.curOp),++T}),b.collapsed&&a.iter(c.line,p.line+1,function(te){hs(a,te)&&fi(te,0)}),b.clearOnEnter&&me(b,"beforeCursorEnter",function(){return b.clear()}),b.readOnly&&(UN(),(a.history.done.length||a.history.undone.length)&&a.clearHistory()),b.collapsed&&(b.id=++_x,b.atomic=!0),M){if(B&&(M.curOp.updateMaxLine=!0),b.collapsed)br(M,c.line,p.line+1);else if(b.className||b.startStyle||b.endStyle||b.css||b.attributes||b.title)for(var J=c.line;J<=p.line;J++)ps(M,J,"text");b.atomic&&ux(M.doc),Ln(M,"markerAdded",M,b)}return b}var Rc=function(a,c){this.markers=a,this.primary=c;for(var p=0;p=0;M--)Kl(this,h[M]);T?ax(this,T):this.cm&&jl(this.cm)}),undo:In(function(){gh(this,"undo")}),redo:In(function(){gh(this,"redo")}),undoSelection:In(function(){gh(this,"undo",!0)}),redoSelection:In(function(){gh(this,"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,c=0,p=0,h=0;h=a.ch)&&c.push(g.marker.parent||g.marker)}return c},findMarks:function(a,c,p){a=dt(this,a),c=dt(this,c);var h=[],g=a.line;return this.iter(a.line,c.line+1,function(b){var S=b.markedSpans;if(S)for(var T=0;T=M.to||M.from==null&&g!=a.line||M.from!=null&&g==c.line&&M.from>=c.ch)&&(!p||p(M.marker))&&h.push(M.marker.parent||M.marker)}++g}),h},getAllMarks:function(){var a=[];return this.iter(function(c){var p=c.markedSpans;if(p)for(var h=0;ha)return c=a,!0;a-=b,++p}),dt(this,se(p,c))},indexFromPos:function(a){a=dt(this,a);var c=a.ch;if(a.linec&&(c=a.from),a.to!=null&&a.to-1){c.state.draggingText(a),setTimeout(function(){return c.display.input.focus()},20);return}try{var J=a.dataTransfer.getData("Text");if(J){var te;if(c.state.draggingText&&!c.state.draggingText.copy&&(te=c.listSelections()),ph(c.doc,gs(p,p)),te)for(var fe=0;fe=0;T--)Gl(a.doc,"",h[T].from,h[T].to,"+delete");jl(a)})}function Gv(a,c,p){var h=Y(a.text,c+p,p);return h<0||h>a.text.length?null:h}function Yv(a,c,p){var h=Gv(a,c.ch,p);return h==null?null:new se(c.line,h,p<0?"after":"before")}function Jv(a,c,p,h,g){if(a){c.doc.direction=="rtl"&&(g=-g);var b=Ae(p,c.doc.direction);if(b){var S=g<0?G(b):b[0],T=g<0==(S.level==1),M=T?"after":"before",B;if(S.level>0||c.doc.direction=="rtl"){var J=$l(c,p);B=g<0?p.text.length-1:0;var te=eo(c,J,B).top;B=X(function(fe){return eo(c,J,fe).top==te},g<0==(S.level==1)?S.from:S.to-1,B),M=="before"&&(B=Gv(p,B,1))}else B=g<0?S.to:S.from;return new se(h,B,M)}}return new se(h,g<0?p.text.length:0,g<0?"before":"after")}function mP(a,c,p,h){var g=Ae(c,a.doc.direction);if(!g)return Yv(c,p,h);p.ch>=c.text.length?(p.ch=c.text.length,p.sticky="before"):p.ch<=0&&(p.ch=0,p.sticky="after");var b=je(g,p.ch,p.sticky),S=g[b];if(a.doc.direction=="ltr"&&S.level%2==0&&(h>0?S.to>p.ch:S.from=S.from&&fe>=J.begin)){var ue=te?"before":"after";return new se(p.line,fe,ue)}}var ke=function(De,$e,Re){for(var Ve=function(Yt,Pn){return Pn?new se(p.line,T(Yt,1),"before"):new se(p.line,Yt,"after")};De>=0&&De0==(nt.level!=1),St=et?Re.begin:T(Re.end,-1);if(nt.from<=St&&St0?J.end:T(J.begin,-1);return Me!=null&&!(h>0&&Me==c.text.length)&&(Ce=ke(h>0?0:g.length-1,h,B(Me)),Ce)?Ce:null}var $c={selectAll:dx,singleSelection:function(a){return a.setSelection(a.getCursor("anchor"),a.getCursor("head"),at)},killLine:function(a){return Xl(a,function(c){if(c.empty()){var p=Ge(a.doc,c.head.line).text.length;return c.head.ch==p&&c.head.line0)g=new se(g.line,g.ch+1),a.replaceRange(b.charAt(g.ch-1)+b.charAt(g.ch-2),se(g.line,g.ch-2),g,"+transpose");else if(g.line>a.doc.first){var S=Ge(a.doc,g.line-1).text;S&&(g=new se(g.line,1),a.replaceRange(b.charAt(0)+a.doc.lineSeparator()+S.charAt(S.length-1),se(g.line-1,S.length-1),g,"+transpose"))}}p.push(new Ht(g,g))}a.setSelections(p)})},newlineAndIndent:function(a){return Lr(a,function(){for(var c=a.listSelections(),p=c.length-1;p>=0;p--)a.replaceRange(a.doc.lineSeparator(),c[p].anchor,c[p].head,"+input");c=a.listSelections();for(var h=0;ha&&we(c,this.pos)==0&&p==this.button};var Fc,Vc;function kP(a,c){var p=+new Date;return Vc&&Vc.compare(p,a,c)?(Fc=Vc=null,"triple"):Fc&&Fc.compare(p,a,c)?(Vc=new Zv(p,a,c),Fc=null,"double"):(Fc=new Zv(p,a,c),Vc=null,"single")}function Rx(a){var c=this,p=c.display;if(!(Ct(c,a)||p.activeTouch&&p.input.supportsTouch())){if(p.input.ensurePolled(),p.shift=a.shiftKey,Ao(p,a)){d||(p.scroller.draggable=!1,setTimeout(function(){return p.scroller.draggable=!0},100));return}if(!Qv(c,a)){var h=ba(c,a),g=pc(a),b=h?kP(h,g):"single";yt(c).focus(),g==1&&c.state.selectingText&&c.state.selectingText(a),!(h&&xP(c,g,h,b,a))&&(g==1?h?CP(c,h,b,a):Sn(a)==p.scroller&&Gt(a):g==2?(h&&hh(c.doc,h),setTimeout(function(){return p.input.focus()},20)):g==3&&(w?c.display.input.onContextMenu(a):Iv(c)))}}}function xP(a,c,p,h,g){var b="Click";return h=="double"?b="Double"+b:h=="triple"&&(b="Triple"+b),b=(c==1?"Left":c==2?"Middle":"Right")+b,Hc(a,Ex(b,g),g,function(S){if(typeof S=="string"&&(S=$c[S]),!S)return!1;var T=!1;try{a.isReadOnly()&&(a.state.suppressEdits=!0),T=S(a,p)!=Fe}finally{a.state.suppressEdits=!1}return T})}function SP(a,c,p){var h=a.getOption("configureMouse"),g=h?h(a,c,p):{};if(g.unit==null){var b=I?p.shiftKey&&p.metaKey:p.altKey;g.unit=b?"rectangle":c=="single"?"char":c=="double"?"word":"line"}return(g.extend==null||a.doc.extend)&&(g.extend=a.doc.extend||p.shiftKey),g.addNew==null&&(g.addNew=H?p.metaKey:p.ctrlKey),g.moveOnDrag==null&&(g.moveOnDrag=!(H?p.altKey:p.ctrlKey)),g}function CP(a,c,p,h){u?setTimeout(Xe(zk,a),0):a.curOp.focus=ze(bt(a));var g=SP(a,p,h),b=a.doc.sel,S;a.options.dragDrop&&fv&&!a.isReadOnly()&&p=="single"&&(S=b.contains(c))>-1&&(we((S=b.ranges[S]).from(),c)<0||c.xRel>0)&&(we(S.to(),c)>0||c.xRel<0)?TP(a,h,c,g):EP(a,h,c,g)}function TP(a,c,p,h){var g=a.display,b=!1,S=Nn(a,function(B){d&&(g.scroller.draggable=!1),a.state.draggingText=!1,a.state.delayingBlurEvent&&(a.hasFocus()?a.state.delayingBlurEvent=!1:Iv(a)),ct(g.wrapper.ownerDocument,"mouseup",S),ct(g.wrapper.ownerDocument,"mousemove",T),ct(g.scroller,"dragstart",M),ct(g.scroller,"drop",S),b||(Gt(B),h.addNew||hh(a.doc,p,null,null,h.extend),d&&!C||u&&f==9?setTimeout(function(){g.wrapper.ownerDocument.body.focus({preventScroll:!0}),g.input.focus()},20):g.input.focus())}),T=function(B){b=b||Math.abs(c.clientX-B.clientX)+Math.abs(c.clientY-B.clientY)>=10},M=function(){return b=!0};d&&(g.scroller.draggable=!0),a.state.draggingText=S,S.copy=!h.moveOnDrag,me(g.wrapper.ownerDocument,"mouseup",S),me(g.wrapper.ownerDocument,"mousemove",T),me(g.scroller,"dragstart",M),me(g.scroller,"drop",S),a.state.delayingBlurEvent=!0,setTimeout(function(){return g.input.focus()},20),g.scroller.dragDrop&&g.scroller.dragDrop()}function zx(a,c,p){if(p=="char")return new Ht(c,c);if(p=="word")return a.findWordAt(c);if(p=="line")return new Ht(se(c.line,0),dt(a.doc,se(c.line+1,0)));var h=p(a,c);return new Ht(h.from,h.to)}function EP(a,c,p,h){u&&Iv(a);var g=a.display,b=a.doc;Gt(c);var S,T,M=b.sel,B=M.ranges;if(h.addNew&&!h.extend?(T=b.sel.contains(p),T>-1?S=B[T]:S=new Ht(p,p)):(S=b.sel.primary(),T=b.sel.primIndex),h.unit=="rectangle")h.addNew||(S=new Ht(p,p)),p=ba(a,c,!0,!0),T=-1;else{var J=zx(a,p,h.unit);h.extend?S=qv(S,J.anchor,J.head,h.extend):S=J}h.addNew?T==-1?(T=B.length,Gn(b,Ai(a,B.concat([S]),T),{scroll:!1,origin:"*mouse"})):B.length>1&&B[T].empty()&&h.unit=="char"&&!h.extend?(Gn(b,Ai(a,B.slice(0,T).concat(B.slice(T+1)),0),{scroll:!1,origin:"*mouse"}),M=b.sel):Kv(b,T,S,ie):(T=0,Gn(b,new Xr([S],0),ie),M=b.sel);var te=p;function fe(Re){if(we(te,Re)!=0)if(te=Re,h.unit=="rectangle"){for(var Ve=[],nt=a.options.tabSize,et=Be(Ge(b,p.line).text,p.ch,nt),St=Be(Ge(b,Re.line).text,Re.ch,nt),Yt=Math.min(et,St),Pn=Math.max(et,St),sn=Math.min(p.line,Re.line),Nr=Math.min(a.lastLine(),Math.max(p.line,Re.line));sn<=Nr;sn++){var wr=Ge(b,sn).text,wn=be(wr,Yt,nt);Yt==Pn?Ve.push(new Ht(se(sn,wn),se(sn,wn))):wr.length>wn&&Ve.push(new Ht(se(sn,wn),se(sn,be(wr,Pn,nt))))}Ve.length||Ve.push(new Ht(p,p)),Gn(b,Ai(a,M.ranges.slice(0,T).concat(Ve),T),{origin:"*mouse",scroll:!1}),a.scrollIntoView(Re)}else{var kr=S,jn=zx(a,Re,h.unit),Tn=kr.anchor,kn;we(jn.anchor,Tn)>0?(kn=jn.head,Tn=Cn(kr.from(),jn.anchor)):(kn=jn.anchor,Tn=It(kr.to(),jn.head));var un=M.ranges.slice(0);un[T]=AP(a,new Ht(dt(b,Tn),kn)),Gn(b,Ai(a,un,T),ie)}}var ue=g.wrapper.getBoundingClientRect(),ke=0;function Ce(Re){var Ve=++ke,nt=ba(a,Re,!0,h.unit=="rectangle");if(nt)if(we(nt,te)!=0){a.curOp.focus=ze(bt(a)),fe(nt);var et=ah(g,b);(nt.line>=et.to||nt.lineue.bottom?20:0;St&&setTimeout(Nn(a,function(){ke==Ve&&(g.scroller.scrollTop+=St,Ce(Re))}),50)}}function Me(Re){a.state.selectingText=!1,ke=1/0,Re&&(Gt(Re),g.input.focus()),ct(g.wrapper.ownerDocument,"mousemove",De),ct(g.wrapper.ownerDocument,"mouseup",$e),b.history.lastSelOrigin=null}var De=Nn(a,function(Re){Re.buttons===0||!pc(Re)?Me(Re):Ce(Re)}),$e=Nn(a,Me);a.state.selectingText=$e,me(g.wrapper.ownerDocument,"mousemove",De),me(g.wrapper.ownerDocument,"mouseup",$e)}function AP(a,c){var p=c.anchor,h=c.head,g=Ge(a.doc,p.line);if(we(p,h)==0&&p.sticky==h.sticky)return c;var b=Ae(g);if(!b)return c;var S=je(b,p.ch,p.sticky),T=b[S];if(T.from!=p.ch&&T.to!=p.ch)return c;var M=S+(T.from==p.ch==(T.level!=1)?0:1);if(M==0||M==b.length)return c;var B;if(h.line!=p.line)B=(h.line-p.line)*(a.doc.direction=="ltr"?1:-1)>0;else{var J=je(b,h.ch,h.sticky),te=J-S||(h.ch-p.ch)*(T.level==1?-1:1);J==M-1||J==M?B=te<0:B=te>0}var fe=b[M+(B?-1:0)],ue=B==(fe.level==1),ke=ue?fe.from:fe.to,Ce=ue?"after":"before";return p.ch==ke&&p.sticky==Ce?c:new Ht(new se(p.line,ke,Ce),h)}function Bx(a,c,p,h){var g,b;if(c.touches)g=c.touches[0].clientX,b=c.touches[0].clientY;else try{g=c.clientX,b=c.clientY}catch{return!1}if(g>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;h&&Gt(c);var S=a.display,T=S.lineDiv.getBoundingClientRect();if(b>T.bottom||!Kt(a,p))return Gr(c);b-=T.top-S.viewOffset;for(var M=0;M=g){var J=Xi(a.doc,b),te=a.display.gutterSpecs[M];return ot(a,p,a,J,te.className,c),Gr(c)}}}function Qv(a,c){return Bx(a,c,"gutterClick",!0)}function $x(a,c){Ao(a.display,c)||OP(a,c)||Ct(a,c,"contextmenu")||w||a.display.input.onContextMenu(c)}function OP(a,c){return Kt(a,"gutterContextMenu")?Bx(a,c,"gutterContextMenu",!1):!1}function Hx(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-"),kc(a)}var Zl={toString:function(){return"CodeMirror.Init"}},Fx={},_h={};function MP(a){var c=a.optionHandlers;function p(h,g,b,S){a.defaults[h]=g,b&&(c[h]=S?function(T,M,B){B!=Zl&&b(T,M,B)}:b)}a.defineOption=p,a.Init=Zl,p("value","",function(h,g){return h.setValue(g)},!0),p("mode",null,function(h,g){h.doc.modeOption=g,jv(h)},!0),p("indentUnit",2,jv,!0),p("indentWithTabs",!1),p("smartIndent",!0),p("tabSize",4,function(h){Mc(h),kc(h),br(h)},!0),p("lineSeparator",null,function(h,g){if(h.doc.lineSep=g,!!g){var b=[],S=h.doc.first;h.doc.iter(function(M){for(var B=0;;){var J=M.text.indexOf(g,B);if(J==-1)break;B=J+g.length,b.push(se(S,J))}S++});for(var T=b.length-1;T>=0;T--)Gl(h.doc,g,b[T],se(b[T].line,b[T].ch+g.length))}}),p("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(h,g,b){h.state.specialChars=new RegExp(g.source+(g.test(" ")?"":"| "),"g"),b!=Zl&&h.refresh()}),p("specialCharPlaceholder",oI,function(h){return h.refresh()},!0),p("electricChars",!0),p("inputStyle",E?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),p("spellcheck",!1,function(h,g){return h.getInputField().spellcheck=g},!0),p("autocorrect",!1,function(h,g){return h.getInputField().autocorrect=g},!0),p("autocapitalize",!1,function(h,g){return h.getInputField().autocapitalize=g},!0),p("rtlMoveVisually",!q),p("wholeLineUpdateBefore",!0),p("theme","default",function(h){Hx(h),Oc(h)},!0),p("keyMap","default",function(h,g,b){var S=yh(g),T=b!=Zl&&yh(b);T&&T.detach&&T.detach(h,S),S.attach&&S.attach(h,T||null)}),p("extraKeys",null),p("configureMouse",null),p("lineWrapping",!1,NP,!0),p("gutters",[],function(h,g){h.display.gutterSpecs=Fv(g,h.options.lineNumbers),Oc(h)},!0),p("fixedGutter",!0,function(h,g){h.display.gutters.style.left=g?Ov(h.display)+"px":"0",h.refresh()},!0),p("coverGutterNextToScrollbar",!1,function(h){return Wl(h)},!0),p("scrollbarStyle","native",function(h){jk(h),Wl(h),h.display.scrollbars.setScrollTop(h.doc.scrollTop),h.display.scrollbars.setScrollLeft(h.doc.scrollLeft)},!0),p("lineNumbers",!1,function(h,g){h.display.gutterSpecs=Fv(h.options.gutters,g),Oc(h)},!0),p("firstLineNumber",1,Oc,!0),p("lineNumberFormatter",function(h){return h},Oc,!0),p("showCursorWhenSelecting",!1,xc,!0),p("resetSelectionOnContextMenu",!0),p("lineWiseCopyCut",!0),p("pasteLinesPerSelection",!0),p("selectionsMayTouch",!1),p("readOnly",!1,function(h,g){g=="nocursor"&&(Vl(h),h.display.input.blur()),h.display.input.readOnlyChanged(g)}),p("screenReaderLabel",null,function(h,g){g=g===""?null:g,h.display.input.screenReaderLabelChanged(g)}),p("disableInput",!1,function(h,g){g||h.display.input.reset()},!0),p("dragDrop",!0,LP),p("allowDropFileTypes",null),p("cursorBlinkRate",530),p("cursorScrollMargin",0),p("cursorHeight",1,xc,!0),p("singleCursorHeightPerLine",!0,xc,!0),p("workTime",100),p("workDelay",100),p("flattenSpans",!0,Mc,!0),p("addModeClass",!1,Mc,!0),p("pollInterval",100),p("undoDepth",200,function(h,g){return h.doc.history.undoDepth=g}),p("historyEventDelay",1250),p("viewportMargin",10,function(h){return h.refresh()},!0),p("maxHighlightLength",1e4,Mc,!0),p("moveInputWithCursor",!0,function(h,g){g||h.display.input.resetPosition()}),p("tabindex",null,function(h,g){return h.display.input.getField().tabIndex=g||""}),p("autofocus",null),p("direction","ltr",function(h,g){return h.doc.setDirection(g)},!0),p("phrases",null)}function LP(a,c,p){var h=p&&p!=Zl;if(!c!=!h){var g=a.display.dragFunctions,b=c?me:ct;b(a.display.scroller,"dragstart",g.start),b(a.display.scroller,"dragenter",g.enter),b(a.display.scroller,"dragover",g.over),b(a.display.scroller,"dragleave",g.leave),b(a.display.scroller,"drop",g.drop)}}function NP(a){a.options.lineWrapping?(qe(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth="",a.display.sizerWidth=null):(U(a.display.wrapper,"CodeMirror-wrap"),bv(a)),Mv(a),br(a),kc(a),setTimeout(function(){return Wl(a)},100)}function Qt(a,c){var p=this;if(!(this instanceof Qt))return new Qt(a,c);this.options=c=c?Ie(c):{},Ie(Fx,c,!1);var h=c.value;typeof h=="string"?h=new _r(h,c.mode,null,c.lineSeparator,c.direction):c.mode&&(h.modeOption=c.mode),this.doc=h;var g=new Qt.inputStyles[c.inputStyle](this),b=this.display=new UI(a,h,g,c);b.wrapper.CodeMirror=this,Hx(this),c.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),jk(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Ee,keySeq:null,specialChars:null},c.autofocus&&!E&&b.input.focus(),u&&f<11&&setTimeout(function(){return p.display.input.reset(!0)},20),IP(this),cP(),xa(this),this.curOp.forceUpdate=!0,Qk(this,h),c.autofocus&&!E||this.hasFocus()?setTimeout(function(){p.hasFocus()&&!p.state.focused&&Pv(p)},20):Vl(this);for(var S in _h)_h.hasOwnProperty(S)&&_h[S](this,c[S],Zl);qk(this),c.finishInit&&c.finishInit(this);for(var T=0;T20*20}me(c.scroller,"touchstart",function(M){if(!Ct(a,M)&&!b(M)&&!Qv(a,M)){c.input.ensurePolled(),clearTimeout(p);var B=+new Date;c.activeTouch={start:B,moved:!1,prev:B-h.end<=300?h:null},M.touches.length==1&&(c.activeTouch.left=M.touches[0].pageX,c.activeTouch.top=M.touches[0].pageY)}}),me(c.scroller,"touchmove",function(){c.activeTouch&&(c.activeTouch.moved=!0)}),me(c.scroller,"touchend",function(M){var B=c.activeTouch;if(B&&!Ao(c,M)&&B.left!=null&&!B.moved&&new Date-B.start<300){var J=a.coordsChar(c.activeTouch,"page"),te;!B.prev||S(B,B.prev)?te=new Ht(J,J):!B.prev.prev||S(B,B.prev.prev)?te=a.findWordAt(J):te=new Ht(se(J.line,0),dt(a.doc,se(J.line+1,0))),a.setSelection(te.anchor,te.head),a.focus(),Gt(M)}g()}),me(c.scroller,"touchcancel",g),me(c.scroller,"scroll",function(){c.scroller.clientHeight&&(Cc(a,c.scroller.scrollTop),wa(a,c.scroller.scrollLeft,!0),ot(a,"scroll",a))}),me(c.scroller,"mousewheel",function(M){return Yk(a,M)}),me(c.scroller,"DOMMouseScroll",function(M){return Yk(a,M)}),me(c.wrapper,"scroll",function(){return c.wrapper.scrollTop=c.wrapper.scrollLeft=0}),c.dragFunctions={enter:function(M){Ct(a,M)||Yr(M)},over:function(M){Ct(a,M)||(uP(a,M),Yr(M))},start:function(M){return lP(a,M)},drop:Nn(a,aP),leave:function(M){Ct(a,M)||xx(a)}};var T=c.input.getField();me(T,"keyup",function(M){return Px.call(a,M)}),me(T,"keydown",Nn(a,Ix)),me(T,"keypress",Nn(a,Dx)),me(T,"focus",function(M){return Pv(a,M)}),me(T,"blur",function(M){return Vl(a,M)})}var e0=[];Qt.defineInitHook=function(a){return e0.push(a)};function jc(a,c,p,h){var g=a.doc,b;p==null&&(p="add"),p=="smart"&&(g.mode.indent?b=vc(a,c).state:p="prev");var S=a.options.tabSize,T=Ge(g,c),M=Be(T.text,null,S);T.stateAfter&&(T.stateAfter=null);var B=T.text.match(/^\s*/)[0],J;if(!h&&!/\S/.test(T.text))J=0,p="not";else if(p=="smart"&&(J=g.mode.indent(b,T.text.slice(B.length),T.text),J==Fe||J>150)){if(!h)return;p="prev"}p=="prev"?c>g.first?J=Be(Ge(g,c-1).text,null,S):J=0:p=="add"?J=M+a.options.indentUnit:p=="subtract"?J=M-a.options.indentUnit:typeof p=="number"&&(J=M+p),J=Math.max(0,J);var te="",fe=0;if(a.options.indentWithTabs)for(var ue=Math.floor(J/S);ue;--ue)fe+=S,te+=" ";if(feS,M=mc(c),B=null;if(T&&h.ranges.length>1)if(Oi&&Oi.text.join(` -`)==c){if(h.ranges.length%Oi.text.length==0){B=[];for(var J=0;J=0;fe--){var ue=h.ranges[fe],ke=ue.from(),Ce=ue.to();ue.empty()&&(p&&p>0?ke=se(ke.line,ke.ch-p):a.state.overwrite&&!T?Ce=se(Ce.line,Math.min(Ge(b,Ce.line).text.length,Ce.ch+G(M).length)):T&&Oi&&Oi.lineWise&&Oi.text.join(` -`)==M.join(` -`)&&(ke=Ce=se(ke.line,0)));var Me={from:ke,to:Ce,text:B?B[fe%B.length]:M,origin:g||(T?"paste":a.state.cutIncoming>S?"cut":"+input")};Kl(a.doc,Me),Ln(a,"inputRead",a,Me)}c&&!T&&jx(a,c),jl(a),a.curOp.updateInput<2&&(a.curOp.updateInput=te),a.curOp.typing=!0,a.state.pasteIncoming=a.state.cutIncoming=-1}function Vx(a,c){var p=a.clipboardData&&a.clipboardData.getData("Text");if(p)return a.preventDefault(),!c.isReadOnly()&&!c.options.disableInput&&c.hasFocus()&&Lr(c,function(){return t0(c,p,0,null,"paste")}),!0}function jx(a,c){if(!(!a.options.electricChars||!a.options.smartIndent))for(var p=a.doc.sel,h=p.ranges.length-1;h>=0;h--){var g=p.ranges[h];if(!(g.head.ch>100||h&&p.ranges[h-1].head.line==g.head.line)){var b=a.getModeAt(g.head),S=!1;if(b.electricChars){for(var T=0;T-1){S=jc(a,g.head.line,"smart");break}}else b.electricInput&&b.electricInput.test(Ge(a.doc,g.head.line).text.slice(0,g.head.ch))&&(S=jc(a,g.head.line,"smart"));S&&Ln(a,"electricInput",a,g.head.line)}}}function Wx(a){for(var c=[],p=[],h=0;hb&&(jc(this,T.head.line,h,!0),b=T.head.line,S==this.doc.sel.primIndex&&jl(this));else{var M=T.from(),B=T.to(),J=Math.max(b,M.line);b=Math.min(this.lastLine(),B.line-(B.ch?0:1))+1;for(var te=J;te0&&Kv(this.doc,S,new Ht(M,fe[S].to()),at)}}}),getTokenAt:function(h,g){return tk(this,h,g)},getLineTokens:function(h,g){return tk(this,se(h),g,!0)},getTokenTypeAt:function(h){h=dt(this.doc,h);var g=Zw(this,Ge(this.doc,h.line)),b=0,S=(g.length-1)/2,T=h.ch,M;if(T==0)M=g[2];else for(;;){var B=b+S>>1;if((B?g[B*2-1]:0)>=T)S=B;else if(g[B*2+1]M&&(h=M,S=!0),T=Ge(this.doc,h)}else T=h;return nh(this,T,{top:0,left:0},g||"page",b||S).top+(S?this.doc.height-Eo(T):0)},defaultTextHeight:function(){return Hl(this.display)},defaultCharWidth:function(){return Fl(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(h,g,b,S,T){var M=this.display;h=Ei(this,dt(this.doc,h));var B=h.bottom,J=h.left;if(g.style.position="absolute",g.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(g),M.sizer.appendChild(g),S=="over")B=h.top;else if(S=="above"||S=="near"){var te=Math.max(M.wrapper.clientHeight,this.doc.height),fe=Math.max(M.sizer.clientWidth,M.lineSpace.clientWidth);(S=="above"||h.bottom+g.offsetHeight>te)&&h.top>g.offsetHeight?B=h.top-g.offsetHeight:h.bottom+g.offsetHeight<=te&&(B=h.bottom),J+g.offsetWidth>fe&&(J=fe-g.offsetWidth)}g.style.top=B+"px",g.style.left=g.style.right="",T=="right"?(J=M.sizer.clientWidth-g.offsetWidth,g.style.right="0px"):(T=="left"?J=0:T=="middle"&&(J=(M.sizer.clientWidth-g.offsetWidth)/2),g.style.left=J+"px"),b&&LI(this,{left:J,top:B,right:J+g.offsetWidth,bottom:B+g.offsetHeight})},triggerOnKeyDown:sr(Ix),triggerOnKeyPress:sr(Dx),triggerOnKeyUp:Px,triggerOnMouseDown:sr(Rx),execCommand:function(h){if($c.hasOwnProperty(h))return $c[h].call(null,this)},triggerElectric:sr(function(h){jx(this,h)}),findPosH:function(h,g,b,S){var T=1;g<0&&(T=-1,g=-g);for(var M=dt(this.doc,h),B=0;B0&&J(b.charAt(S-1));)--S;for(;T.5||this.options.lineWrapping)&&Mv(this),ot(this,"refresh",this)}),swapDoc:sr(function(h){var g=this.doc;return g.cm=null,this.state.selectingText&&this.state.selectingText(),Qk(this,h),kc(this),this.display.input.reset(),Sc(this,h.scrollLeft,h.scrollTop),this.curOp.forceScroll=!0,Ln(this,"swapDoc",this,g),g}),phrase:function(h){var g=this.options.phrases;return g&&Object.prototype.hasOwnProperty.call(g,h)?g[h]:h},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Xt(a),a.registerHelper=function(h,g,b){p.hasOwnProperty(h)||(p[h]=a[h]={_global:[]}),p[h][g]=b},a.registerGlobalHelper=function(h,g,b,S){a.registerHelper(h,g,S),p[h]._global.push({pred:b,val:S})}}function r0(a,c,p,h,g){var b=c,S=p,T=Ge(a,c.line),M=g&&a.direction=="rtl"?-p:p;function B(){var $e=c.line+M;return $e=a.first+a.size?!1:(c=new se($e,c.ch,c.sticky),T=Ge(a,$e))}function J($e){var Re;if(h=="codepoint"){var Ve=T.text.charCodeAt(c.ch+(p>0?0:-1));if(isNaN(Ve))Re=null;else{var nt=p>0?Ve>=55296&&Ve<56320:Ve>=56320&&Ve<57343;Re=new se(c.line,Math.max(0,Math.min(T.text.length,c.ch+p*(nt?2:1))),-p)}}else g?Re=mP(a.cm,T,c,p):Re=Yv(T,c,p);if(Re==null)if(!$e&&B())c=Jv(g,a.cm,T,c.line,M);else return!1;else c=Re;return!0}if(h=="char"||h=="codepoint")J();else if(h=="column")J(!0);else if(h=="word"||h=="group")for(var te=null,fe=h=="group",ue=a.cm&&a.cm.getHelper(c,"wordChars"),ke=!0;!(p<0&&!J(!ke));ke=!1){var Ce=T.text.charAt(c.ch)||` -`,Me=Q(Ce,ue)?"w":fe&&Ce==` -`?"n":!fe||/\s/.test(Ce)?null:"p";if(fe&&!ke&&!Me&&(Me="s"),te&&te!=Me){p<0&&(p=1,J(),c.sticky="after");break}if(Me&&(te=Me),p>0&&!J(!ke))break}var De=mh(a,c,b,S,!0);return ft(b,De)&&(De.hitSide=!0),De}function qx(a,c,p,h){var g=a.doc,b=c.left,S;if(h=="page"){var T=Math.min(a.display.wrapper.clientHeight,yt(a).innerHeight||g(a).documentElement.clientHeight),M=Math.max(T-.5*Hl(a.display),3);S=(p>0?c.bottom:c.top)+p*M}else h=="line"&&(S=p>0?c.bottom+3:c.top-3);for(var B;B=Tv(a,b,S),!!B.outside;){if(p<0?S<=0:S>=g.height){B.hitSide=!0;break}S+=p*5}return B}var Wt=function(a){this.cm=a,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ee,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Wt.prototype.init=function(a){var c=this,p=this,h=p.cm,g=p.div=a.lineDiv;g.contentEditable=!0,n0(g,h.options.spellcheck,h.options.autocorrect,h.options.autocapitalize);function b(T){for(var M=T.target;M;M=M.parentNode){if(M==g)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(M.className))break}return!1}me(g,"paste",function(T){!b(T)||Ct(h,T)||Vx(T,h)||f<=11&&setTimeout(Nn(h,function(){return c.updateFromDOM()}),20)}),me(g,"compositionstart",function(T){c.composing={data:T.data,done:!1}}),me(g,"compositionupdate",function(T){c.composing||(c.composing={data:T.data,done:!1})}),me(g,"compositionend",function(T){c.composing&&(T.data!=c.composing.data&&c.readFromDOMSoon(),c.composing.done=!0)}),me(g,"touchstart",function(){return p.forceCompositionEnd()}),me(g,"input",function(){c.composing||c.readFromDOMSoon()});function S(T){if(!(!b(T)||Ct(h,T))){if(h.somethingSelected())wh({lineWise:!1,text:h.getSelections()}),T.type=="cut"&&h.replaceSelection("",null,"cut");else if(h.options.lineWiseCopyCut){var M=Wx(h);wh({lineWise:!0,text:M.text}),T.type=="cut"&&h.operation(function(){h.setSelections(M.ranges,0,at),h.replaceSelection("",null,"cut")})}else return;if(T.clipboardData){T.clipboardData.clearData();var B=Oi.text.join(` -`);if(T.clipboardData.setData("Text",B),T.clipboardData.getData("Text")==B){T.preventDefault();return}}var J=Ux(),te=J.firstChild;n0(te),h.display.lineSpace.insertBefore(J,h.display.lineSpace.firstChild),te.value=Oi.text.join(` -`);var fe=ze(g.ownerDocument);mt(te),setTimeout(function(){h.display.lineSpace.removeChild(J),fe.focus(),fe==g&&p.showPrimarySelection()},50)}}me(g,"copy",S),me(g,"cut",S)},Wt.prototype.screenReaderLabelChanged=function(a){a?this.div.setAttribute("aria-label",a):this.div.removeAttribute("aria-label")},Wt.prototype.prepareSelection=function(){var a=Rk(this.cm,!1);return a.focus=ze(this.div.ownerDocument)==this.div,a},Wt.prototype.showSelection=function(a,c){!a||!this.cm.display.view.length||((a.focus||c)&&this.showPrimarySelection(),this.showMultipleSelections(a))},Wt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Wt.prototype.showPrimarySelection=function(){var a=this.getSelection(),c=this.cm,p=c.doc.sel.primary(),h=p.from(),g=p.to();if(c.display.viewTo==c.display.viewFrom||h.line>=c.display.viewTo||g.line=c.display.viewFrom&&Kx(c,h)||{node:T[0].measure.map[2],offset:0},B=g.linea.firstLine()&&(h=se(h.line-1,Ge(a.doc,h.line-1).length)),g.ch==Ge(a.doc,g.line).text.length&&g.linec.viewTo-1)return!1;var b,S,T;h.line==c.viewFrom||(b=_a(a,h.line))==0?(S=$t(c.view[0].line),T=c.view[0].node):(S=$t(c.view[b].line),T=c.view[b-1].node.nextSibling);var M=_a(a,g.line),B,J;if(M==c.view.length-1?(B=c.viewTo-1,J=c.lineDiv.lastChild):(B=$t(c.view[M+1].line)-1,J=c.view[M+1].node.previousSibling),!T)return!1;for(var te=a.doc.splitLines(RP(a,T,J,S,B)),fe=Co(a.doc,se(S,0),se(B,Ge(a.doc,B).text.length));te.length>1&&fe.length>1;)if(G(te)==G(fe))te.pop(),fe.pop(),B--;else if(te[0]==fe[0])te.shift(),fe.shift(),S++;else break;for(var ue=0,ke=0,Ce=te[0],Me=fe[0],De=Math.min(Ce.length,Me.length);ueh.ch&&$e.charCodeAt($e.length-ke-1)==Re.charCodeAt(Re.length-ke-1);)ue--,ke++;te[te.length-1]=$e.slice(0,$e.length-ke).replace(/^\u200b+/,""),te[0]=te[0].slice(ue).replace(/\u200b+$/,"");var nt=se(S,ue),et=se(B,fe.length?G(fe).length-ke:0);if(te.length>1||te[0]||we(nt,et))return Gl(a.doc,te,nt,et,"+input"),!0},Wt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Wt.prototype.reset=function(){this.forceCompositionEnd()},Wt.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Wt.prototype.readFromDOMSoon=function(){var a=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(a.readDOMTimeout=null,a.composing)if(a.composing.done)a.composing=null;else return;a.updateFromDOM()},80))},Wt.prototype.updateFromDOM=function(){var a=this;(this.cm.isReadOnly()||!this.pollContent())&&Lr(this.cm,function(){return br(a.cm)})},Wt.prototype.setUneditable=function(a){a.contentEditable="false"},Wt.prototype.onKeyPress=function(a){a.charCode==0||this.composing||(a.preventDefault(),this.cm.isReadOnly()||Nn(this.cm,t0)(this.cm,String.fromCharCode(a.charCode==null?a.keyCode:a.charCode),0))},Wt.prototype.readOnlyChanged=function(a){this.div.contentEditable=String(a!="nocursor")},Wt.prototype.onContextMenu=function(){},Wt.prototype.resetPosition=function(){},Wt.prototype.needsContentAttribute=!0;function Kx(a,c){var p=xv(a,c.line);if(!p||p.hidden)return null;var h=Ge(a.doc,c.line),g=kk(p,h,c.line),b=Ae(h,a.doc.direction),S="left";if(b){var T=je(b,c.ch);S=T%2?"right":"left"}var M=Ck(g.map,c.ch,S);return M.offset=M.collapse=="right"?M.end:M.start,M}function DP(a){for(var c=a;c;c=c.parentNode)if(/CodeMirror-gutter-wrapper/.test(c.className))return!0;return!1}function Ql(a,c){return c&&(a.bad=!0),a}function RP(a,c,p,h,g){var b="",S=!1,T=a.doc.lineSeparator(),M=!1;function B(ue){return function(ke){return ke.id==ue}}function J(){S&&(b+=T,M&&(b+=T),S=M=!1)}function te(ue){ue&&(J(),b+=ue)}function fe(ue){if(ue.nodeType==1){var ke=ue.getAttribute("cm-text");if(ke){te(ke);return}var Ce=ue.getAttribute("cm-marker"),Me;if(Ce){var De=a.findMarks(se(h,0),se(g+1,0),B(+Ce));De.length&&(Me=De[0].find(0))&&te(Co(a.doc,Me.from,Me.to).join(T));return}if(ue.getAttribute("contenteditable")=="false")return;var $e=/^(pre|div|p|li|table|br)$/i.test(ue.nodeName);if(!/^br$/i.test(ue.nodeName)&&ue.textContent.length==0)return;$e&&J();for(var Re=0;Re=9&&c.hasSelection&&(c.hasSelection=null),p.poll()}),me(g,"paste",function(S){Ct(h,S)||Vx(S,h)||(h.state.pasteIncoming=+new Date,p.fastPoll())});function b(S){if(!Ct(h,S)){if(h.somethingSelected())wh({lineWise:!1,text:h.getSelections()});else if(h.options.lineWiseCopyCut){var T=Wx(h);wh({lineWise:!0,text:T.text}),S.type=="cut"?h.setSelections(T.ranges,null,at):(p.prevInput="",g.value=T.text.join(` -`),mt(g))}else return;S.type=="cut"&&(h.state.cutIncoming=+new Date)}}me(g,"cut",b),me(g,"copy",b),me(a.scroller,"paste",function(S){if(!(Ao(a,S)||Ct(h,S))){if(!g.dispatchEvent){h.state.pasteIncoming=+new Date,p.focus();return}var T=new Event("paste");T.clipboardData=S.clipboardData,g.dispatchEvent(T)}}),me(a.lineSpace,"selectstart",function(S){Ao(a,S)||Gt(S)}),me(g,"compositionstart",function(){var S=h.getCursor("from");p.composing&&p.composing.range.clear(),p.composing={start:S,range:h.markText(S,h.getCursor("to"),{className:"CodeMirror-composing"})}}),me(g,"compositionend",function(){p.composing&&(p.poll(),p.composing.range.clear(),p.composing=null)})},dn.prototype.createField=function(a){this.wrapper=Ux(),this.textarea=this.wrapper.firstChild;var c=this.cm.options;n0(this.textarea,c.spellcheck,c.autocorrect,c.autocapitalize)},dn.prototype.screenReaderLabelChanged=function(a){a?this.textarea.setAttribute("aria-label",a):this.textarea.removeAttribute("aria-label")},dn.prototype.prepareSelection=function(){var a=this.cm,c=a.display,p=a.doc,h=Rk(a);if(a.options.moveInputWithCursor){var g=Ei(a,p.sel.primary().head,"div"),b=c.wrapper.getBoundingClientRect(),S=c.lineDiv.getBoundingClientRect();h.teTop=Math.max(0,Math.min(c.wrapper.clientHeight-10,g.top+S.top-b.top)),h.teLeft=Math.max(0,Math.min(c.wrapper.clientWidth-10,g.left+S.left-b.left))}return h},dn.prototype.showSelection=function(a){var c=this.cm,p=c.display;oe(p.cursorDiv,a.cursors),oe(p.selectionDiv,a.selection),a.teTop!=null&&(this.wrapper.style.top=a.teTop+"px",this.wrapper.style.left=a.teLeft+"px")},dn.prototype.reset=function(a){if(!(this.contextMenuPending||this.composing&&a)){var c=this.cm;if(this.resetting=!0,c.somethingSelected()){this.prevInput="";var p=c.getSelection();this.textarea.value=p,c.state.focused&&mt(this.textarea),u&&f>=9&&(this.hasSelection=p)}else a||(this.prevInput=this.textarea.value="",u&&f>=9&&(this.hasSelection=null));this.resetting=!1}},dn.prototype.getField=function(){return this.textarea},dn.prototype.supportsTouch=function(){return!1},dn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!E||ze(this.textarea.ownerDocument)!=this.textarea))try{this.textarea.focus()}catch{}},dn.prototype.blur=function(){this.textarea.blur()},dn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},dn.prototype.receivedFocus=function(){this.slowPoll()},dn.prototype.slowPoll=function(){var a=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){a.poll(),a.cm.state.focused&&a.slowPoll()})},dn.prototype.fastPoll=function(){var a=!1,c=this;c.pollingFast=!0;function p(){var h=c.poll();!h&&!a?(a=!0,c.polling.set(60,p)):(c.pollingFast=!1,c.slowPoll())}c.polling.set(20,p)},dn.prototype.poll=function(){var a=this,c=this.cm,p=this.textarea,h=this.prevInput;if(this.contextMenuPending||this.resetting||!c.state.focused||us(p)&&!h&&!this.composing||c.isReadOnly()||c.options.disableInput||c.state.keySeq)return!1;var g=p.value;if(g==h&&!c.somethingSelected())return!1;if(u&&f>=9&&this.hasSelection===g||H&&/[\uf700-\uf7ff]/.test(g))return c.display.input.reset(),!1;if(c.doc.sel==c.display.selForContextMenu){var b=g.charCodeAt(0);if(b==8203&&!h&&(h="​"),b==8666)return this.reset(),this.cm.execCommand("undo")}for(var S=0,T=Math.min(h.length,g.length);S1e3||g.indexOf(` -`)>-1?p.value=a.prevInput="":a.prevInput=g,a.composing&&(a.composing.range.clear(),a.composing.range=c.markText(a.composing.start,c.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},dn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},dn.prototype.onKeyPress=function(){u&&f>=9&&(this.hasSelection=null),this.fastPoll()},dn.prototype.onContextMenu=function(a){var c=this,p=c.cm,h=p.display,g=c.textarea;c.contextMenuPending&&c.contextMenuPending();var b=ba(p,a),S=h.scroller.scrollTop;if(!b||_)return;var T=p.options.resetSelectionOnContextMenu;T&&p.doc.sel.contains(b)==-1&&Nn(p,Gn)(p.doc,gs(b),at);var M=g.style.cssText,B=c.wrapper.style.cssText,J=c.wrapper.offsetParent.getBoundingClientRect();c.wrapper.style.cssText="position: static",g.style.cssText=`position: absolute; width: 30px; height: 30px; - top: `+(a.clientY-J.top-5)+"px; left: "+(a.clientX-J.left-5)+`px; - z-index: 1000; background: `+(u?"rgba(255, 255, 255, .05)":"transparent")+`; - outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var te;d&&(te=g.ownerDocument.defaultView.scrollY),h.input.focus(),d&&g.ownerDocument.defaultView.scrollTo(null,te),h.input.reset(),p.somethingSelected()||(g.value=c.prevInput=" "),c.contextMenuPending=ue,h.selForContextMenu=p.doc.sel,clearTimeout(h.detectingSelectAll);function fe(){if(g.selectionStart!=null){var Ce=p.somethingSelected(),Me="​"+(Ce?g.value:"");g.value="⇚",g.value=Me,c.prevInput=Ce?"":"​",g.selectionStart=1,g.selectionEnd=Me.length,h.selForContextMenu=p.doc.sel}}function ue(){if(c.contextMenuPending==ue&&(c.contextMenuPending=!1,c.wrapper.style.cssText=B,g.style.cssText=M,u&&f<9&&h.scrollbars.setScrollTop(h.scroller.scrollTop=S),g.selectionStart!=null)){(!u||u&&f<9)&&fe();var Ce=0,Me=function(){h.selForContextMenu==p.doc.sel&&g.selectionStart==0&&g.selectionEnd>0&&c.prevInput=="​"?Nn(p,dx)(p):Ce++<10?h.detectingSelectAll=setTimeout(Me,500):(h.selForContextMenu=null,h.input.reset())};h.detectingSelectAll=setTimeout(Me,200)}}if(u&&f>=9&&fe(),w){Yr(a);var ke=function(){ct(window,"mouseup",ke),setTimeout(ue,20)};me(window,"mouseup",ke)}else setTimeout(ue,50)},dn.prototype.readOnlyChanged=function(a){a||this.reset(),this.textarea.disabled=a=="nocursor",this.textarea.readOnly=!!a},dn.prototype.setUneditable=function(){},dn.prototype.needsContentAttribute=!1;function BP(a,c){if(c=c?Ie(c):{},c.value=a.value,!c.tabindex&&a.tabIndex&&(c.tabindex=a.tabIndex),!c.placeholder&&a.placeholder&&(c.placeholder=a.placeholder),c.autofocus==null){var p=ze(a.ownerDocument);c.autofocus=p==a||a.getAttribute("autofocus")!=null&&p==document.body}function h(){a.value=T.getValue()}var g;if(a.form&&(me(a.form,"submit",h),!c.leaveSubmitMethodAlone)){var b=a.form;g=b.submit;try{var S=b.submit=function(){h(),b.submit=g,b.submit(),b.submit=S}}catch{}}c.finishInit=function(M){M.save=h,M.getTextArea=function(){return a},M.toTextArea=function(){M.toTextArea=isNaN,h(),a.parentNode.removeChild(M.getWrapperElement()),a.style.display="",a.form&&(ct(a.form,"submit",h),!c.leaveSubmitMethodAlone&&typeof a.form.submit=="function"&&(a.form.submit=g))}},a.style.display="none";var T=Qt(function(M){return a.parentNode.insertBefore(M,a.nextSibling)},c);return T}function $P(a){a.off=ct,a.on=me,a.wheelEventPixels=qI,a.Doc=_r,a.splitLines=mc,a.countColumn=Be,a.findColumn=be,a.isWordChar=F,a.Pass=Fe,a.signal=ot,a.Line=zl,a.changeEnd=vs,a.scrollbarModel=Vk,a.Pos=se,a.cmpPos=we,a.modes=Ci,a.mimeModes=cs,a.resolveMode=Mr,a.getMode=xo,a.modeExtensions=fs,a.extendMode=Kd,a.copyState=So,a.startState=gc,a.innerMode=ds,a.commands=$c,a.keyMap=Mo,a.keyName=Ax,a.isModifierKey=Tx,a.lookupKey=Jl,a.normalizeKeyMap=pP,a.StringStream=ln,a.SharedTextMarker=Rc,a.TextMarker=bs,a.LineWidget=Dc,a.e_preventDefault=Gt,a.e_stopPropagation=Kn,a.e_stop=Yr,a.addClass=qe,a.contains=ve,a.rmClass=U,a.keyNames=_s}MP(Qt),PP(Qt);var HP="iter insert remove copy getEditor constructor".split(" ");for(var xh in _r.prototype)_r.prototype.hasOwnProperty(xh)&&Ze(HP,xh)<0&&(Qt.prototype[xh]=function(a){return function(){return a.apply(this.doc,arguments)}}(_r.prototype[xh]));return Xt(_r),Qt.inputStyles={textarea:dn,contenteditable:Wt},Qt.defineMode=function(a){!Qt.defaults.mode&&a!="null"&&(Qt.defaults.mode=a),qd.apply(this,arguments)},Qt.defineMIME=Dl,Qt.defineMode("null",function(){return{token:function(a){return a.skipToEnd()}}}),Qt.defineMIME("text/plain","null"),Qt.defineExtension=function(a,c){Qt.prototype[a]=c},Qt.defineDocExtension=function(a,c){_r.prototype[a]=c},Qt.fromTextArea=BP,$P(Qt),Qt.version="5.65.12",Qt})}(Koe)),tg}var Goe=Or();const IN=qoe(Goe);(function(t,e){(function(n){n(Or())})(function(n){var r=n.Pos,i="http://www.w3.org/2000/svg";function o(L,W){this.mv=L,this.type=W,this.classes=W=="left"?{chunk:"CodeMirror-merge-l-chunk",start:"CodeMirror-merge-l-chunk-start",end:"CodeMirror-merge-l-chunk-end",insert:"CodeMirror-merge-l-inserted",del:"CodeMirror-merge-l-deleted",connect:"CodeMirror-merge-l-connect"}:{chunk:"CodeMirror-merge-r-chunk",start:"CodeMirror-merge-r-chunk-start",end:"CodeMirror-merge-r-chunk-end",insert:"CodeMirror-merge-r-inserted",del:"CodeMirror-merge-r-deleted",connect:"CodeMirror-merge-r-connect"}}o.prototype={constructor:o,init:function(L,W,O){this.edit=this.mv.edit,(this.edit.state.diffViews||(this.edit.state.diffViews=[])).push(this),this.orig=n(L,Ee({value:W,readOnly:!this.mv.options.allowEditingOriginals},Ee(O))),this.mv.options.connect=="align"&&(this.edit.state.trackAlignable||(this.edit.state.trackAlignable=new ie(this.edit)),this.orig.state.trackAlignable=new ie(this.orig)),this.lockButton.title=this.edit.phrase("Toggle locked scrolling"),this.lockButton.setAttribute("aria-label",this.lockButton.title),this.orig.state.diffViews=[this];var j=O.chunkClassLocation||"background";Object.prototype.toString.call(j)!="[object Array]"&&(j=[j]),this.classes.classLocation=j,this.diff=ae(oe(W),oe(O.value),this.mv.options.ignoreWhitespace),this.chunks=ce(this.diff),this.diffOutOfDate=this.dealigned=!1,this.needsScrollSync=null,this.showDifferences=O.showDifferences!==!1},registerEvents:function(L){this.forceUpdate=u(this),v(this,!0,!1),f(this,L)},setShowDifferences:function(L){L=L!==!1,L!=this.showDifferences&&(this.showDifferences=L,this.forceUpdate("full"))}};function s(L){L.diffOutOfDate&&(L.diff=ae(L.orig.getValue(),L.edit.getValue(),L.mv.options.ignoreWhitespace),L.chunks=ce(L.diff),L.diffOutOfDate=!1,n.signal(L.edit,"updateDiff",L.diff))}var l=!1;function u(L){var W={from:0,to:0,marked:[]},O={from:0,to:0,marked:[]},j,F=!1;function Q(X){l=!0,F=!1,X=="full"&&(L.svg&&Ie(L.svg),L.copyButtons&&Ie(L.copyButtons),_(L.edit,W.marked,L.classes),_(L.orig,O.marked,L.classes),W.from=W.to=O.from=O.to=0),s(L),L.showDifferences&&(C(L.edit,L.diff,W,DIFF_INSERT,L.classes),C(L.orig,L.diff,O,DIFF_DELETE,L.classes)),L.mv.options.connect=="align"&&q(L),A(L),L.needsScrollSync!=null&&d(L,L.needsScrollSync),l=!1}function le(X){l||(L.dealigned=!0,pe(X))}function pe(X){l||F||(clearTimeout(j),X===!0&&(F=!0),j=setTimeout(Q,X===!0?20:250))}function ye(X,de){L.diffOutOfDate||(L.diffOutOfDate=!0,W.from=W.to=O.from=O.to=0),le(de.text.length-1!=de.to.line-de.from.line)}function Y(){L.diffOutOfDate=!0,L.dealigned=!0,Q("full")}return L.edit.on("change",ye),L.orig.on("change",ye),L.edit.on("swapDoc",Y),L.orig.on("swapDoc",Y),L.mv.options.connect=="align"&&(n.on(L.edit.state.trackAlignable,"realign",le),n.on(L.orig.state.trackAlignable,"realign",le)),L.edit.on("viewportChange",function(){pe(!1)}),L.orig.on("viewportChange",function(){pe(!1)}),Q(),Q}function f(L,W){L.edit.on("scroll",function(){d(L,!0)&&A(L)}),L.orig.on("scroll",function(){d(L,!1)&&A(L),W&&d(W,!0)&&A(W)})}function d(L,W){if(L.diffOutOfDate)return L.lockScroll&&L.needsScrollSync==null&&(L.needsScrollSync=W),!1;if(L.needsScrollSync=null,!L.lockScroll)return!0;var O,j,F=+new Date;if(W?(O=L.edit,j=L.orig):(O=L.orig,j=L.edit),O.state.scrollSetBy==L&&(O.state.scrollSetAt||0)+250>F)return!1;var Q=O.getScrollInfo();if(L.mv.options.connect=="align")je=Q.top;else{var le=.5*Q.clientHeight,pe=Q.top+le,ye=O.lineAtHeight(pe,"local"),Y=qe(L.chunks,ye,W),X=m(O,W?Y.edit:Y.orig),de=m(j,W?Y.orig:Y.edit),Te=(pe-X.top)/(X.bot-X.top),je=de.top-le+Te*(de.bot-de.top),he,Ae;if(je>Q.top&&(Ae=Q.top/le)<1)je=je*Ae+Q.top*(1-Ae);else if((he=Q.height-Q.clientHeight-Q.top)he&&(Ae=he/le)<1&&(je=je*Ae+(Le.height-Le.clientHeight-he)*(1-Ae))}}return j.scrollTo(Q.left,je),j.state.scrollSetAt=F,j.state.scrollSetBy=L,!0}function m(L,W){var O=W.after;return O==null&&(O=L.lastLine()+1),{top:L.heightAtLine(W.before||0,"local"),bot:L.heightAtLine(O,"local")}}function v(L,W,O){L.lockScroll=W,W&&O!=!1&&d(L,DIFF_INSERT)&&A(L),(W?n.addClass:n.rmClass)(L.lockButton,"CodeMirror-merge-scrolllock-enabled")}function y(L,W,O){for(var j=O.classLocation,F=0;F20||O.from-Q.to>20?(_(L,O.marked,F),k(L,W,j,O.marked,Q.from,Q.to,F),O.from=Q.from,O.to=Q.to):(Q.fromO.to&&(k(L,W,j,O.marked,O.to,Q.to,F),O.to=Q.to))})}function x(L,W,O,j,F,Q){for(var le=O.classLocation,pe=L.getLineHandle(W),ye=0;yeJe&&(je&&(de(Te,Je),je=!1),Te=ct)}else if(je=!0,Le==O){var ot=Ze(pe,me,!0),Ct=be(ye,pe),yr=ne(Y,ot);_e(Ct,yr)||j.push(L.markText(Ct,yr,{className:X})),pe=ot}}je&&de(Te,pe.line+1)}function A(L){if(L.showDifferences){if(L.svg){Ie(L.svg);var W=L.gap.offsetWidth;Be(L.svg,"width",W,"height",L.gap.offsetHeight)}L.copyButtons&&Ie(L.copyButtons);for(var O=L.edit.getViewport(),j=L.orig.getViewport(),F=L.mv.wrap.getBoundingClientRect().top,Q=F-L.edit.getScrollerElement().getBoundingClientRect().top+L.edit.getScrollInfo().top,le=F-L.orig.getScrollerElement().getBoundingClientRect().top+L.orig.getScrollInfo().top,pe=0;pe=O.from&&ye.origFrom<=j.to&&ye.origTo>=j.from&&w(L,ye,le,Q,W)}}}function N(L,W){for(var O=0,j=0,F=0;FL&&Q.editFrom<=L)return null;if(Q.editFrom>L)break;O=Q.editTo,j=Q.origTo}return j+(L-O)}function E(L,W,O){for(var j=L.state.trackAlignable,F=L.firstLine(),Q=0,le=[],pe=0;;pe++){for(var ye=W[pe],Y=ye?O?ye.origFrom:ye.editFrom:1e9;Qde){Q++,F--;continue e}if(Te.editTo>X){if(Te.editFrom<=X)continue e;break}pe+=Te.origTo-Te.origFrom-(Te.editTo-Te.editFrom),le++}if(X==de-pe)ye[j]=de,Q++;else if(X1&&j.push(z(L[le],O[le],ye))}}function z(L,W,O){var j=!0;W>L.lastLine()&&(W--,j=!1);var F=document.createElement("div");return F.className="CodeMirror-merge-spacer",F.style.height=O+"px",F.style.minWidth="1px",L.addLineWidget(W,F,{height:O,above:j,mergeSpacer:!0,handleMouseEvents:!0})}function w(L,W,O,j,F){var Q=L.type=="left",le=L.orig.heightAtLine(W.origFrom,"local",!0)-O;if(L.svg){var pe=le,ye=L.edit.heightAtLine(W.editFrom,"local",!0)-j;if(Q){var Y=pe;pe=ye,ye=Y}var X=L.orig.heightAtLine(W.origTo,"local",!0)-O,de=L.edit.heightAtLine(W.editTo,"local",!0)-j;if(Q){var Y=X;X=de,de=Y}var Te=" C "+F/2+" "+ye+" "+F/2+" "+pe+" "+(F+2)+" "+pe,je=" C "+F/2+" "+X+" "+F/2+" "+de+" -1 "+de;Be(L.svg.appendChild(document.createElementNS(i,"path")),"d","M -1 "+ye+Te+" L "+(F+2)+" "+X+je+" z","class",L.classes.connect)}if(L.copyButtons){var he=L.copyButtons.appendChild(Xe("div",L.type=="left"?"⇝":"⇜","CodeMirror-merge-copy")),Ae=L.mv.options.allowEditingOriginals;if(he.title=L.edit.phrase(Ae?"Push to left":"Revert chunk"),he.chunk=W,he.style.top=(W.origTo>W.origFrom?le:L.edit.heightAtLine(W.editFrom,"local")-j)+"px",he.setAttribute("role","button"),he.setAttribute("tabindex","0"),he.setAttribute("aria-label",he.title),Ae){var Le=L.edit.heightAtLine(W.editFrom,"local")-j,me=L.copyButtons.appendChild(Xe("div",L.type=="right"?"⇝":"⇜","CodeMirror-merge-copy-reverse"));me.title="Push to right",me.chunk={editFrom:W.origFrom,editTo:W.origTo,origFrom:W.editFrom,origTo:W.editTo},me.style.top=Le+"px",L.type=="right"?me.style.left="2px":me.style.right="2px",me.setAttribute("role","button"),me.setAttribute("tabindex","0"),me.setAttribute("aria-label",me.title)}}}function R(L,W,O,j){if(!L.diffOutOfDate){var F=j.origTo>O.lastLine()?r(j.origFrom-1):r(j.origFrom,0),Q=r(j.origTo,0),le=j.editTo>W.lastLine()?r(j.editFrom-1):r(j.editFrom,0),pe=r(j.editTo,0),ye=L.mv.options.revertChunk;ye?ye(L.mv,O,F,Q,W,le,pe):W.replaceRange(O.getRange(F,Q),le,pe)}}var U=n.MergeView=function(L,W){if(!(this instanceof U))return new U(L,W);this.options=W;var O=W.origLeft,j=W.origRight==null?W.orig:W.origRight,F=O!=null,Q=j!=null,le=1+(F?1:0)+(Q?1:0),pe=[],ye=this.left=null,Y=this.right=null,X=this;if(F){ye=this.left=new o(this,"left");var de=Xe("div",null,"CodeMirror-merge-pane CodeMirror-merge-left");pe.push(de),pe.push(K(ye))}var Te=Xe("div",null,"CodeMirror-merge-pane CodeMirror-merge-editor");if(pe.push(Te),Q){Y=this.right=new o(this,"right"),pe.push(K(Y));var je=Xe("div",null,"CodeMirror-merge-pane CodeMirror-merge-right");pe.push(je)}(Q?je:Te).className+=" CodeMirror-merge-pane-rightmost",pe.push(Xe("div",null,null,"height: 0; clear: both;"));var he=this.wrap=L.appendChild(Xe("div",pe,"CodeMirror-merge CodeMirror-merge-"+le+"pane"));this.edit=n(Te,Ee(W)),ye&&ye.init(de,O,W),Y&&Y.init(je,j,W),W.collapseIdentical&&this.editor().operation(function(){yt(X,W.collapseIdentical)}),W.connect=="align"&&(this.aligners=[],q(this.left||this.right,!0)),ye&&ye.registerEvents(Y),Y&&Y.registerEvents(ye);var Ae=function(){ye&&A(ye),Y&&A(Y)};n.on(window,"resize",Ae);var Le=setInterval(function(){for(var me=he.parentNode;me&&me!=document.body;me=me.parentNode);me||(clearInterval(Le),n.off(window,"resize",Ae))},5e3)};function K(L){var W=L.lockButton=Xe("div",null,"CodeMirror-merge-scrolllock");W.setAttribute("role","button"),W.setAttribute("tabindex","0");var O=Xe("div",[W],"CodeMirror-merge-scrolllock-wrap");n.on(W,"click",function(){v(L,!L.lockScroll)}),n.on(W,"keyup",function(le){(le.key==="Enter"||le.code==="Space")&&v(L,!L.lockScroll)});var j=[O];if(L.mv.options.revertButtons!==!1){L.copyButtons=Xe("div",null,"CodeMirror-merge-copybuttons-"+L.type);var F=function(le){var pe=le.target||le.srcElement;if(pe.chunk){if(pe.className=="CodeMirror-merge-copy-reverse"){R(L,L.orig,L.edit,pe.chunk);return}R(L,L.edit,L.orig,pe.chunk)}};n.on(L.copyButtons,"click",F),n.on(L.copyButtons,"keyup",function(le){(le.key==="Enter"||le.code==="Space")&&F(le)}),j.unshift(L.copyButtons)}if(L.mv.options.connect!="align"){var Q=document.createElementNS&&document.createElementNS(i,"svg");Q&&!Q.createSVGRect&&(Q=null),L.svg=Q,Q&&j.push(Q)}return L.gap=Xe("div",j,"CodeMirror-merge-gap")}U.prototype={constructor:U,editor:function(){return this.edit},rightOriginal:function(){return this.right&&this.right.orig},leftOriginal:function(){return this.left&&this.left.orig},setShowDifferences:function(L){this.right&&this.right.setShowDifferences(L),this.left&&this.left.setShowDifferences(L)},rightChunks:function(){if(this.right)return s(this.right),this.right.chunks},leftChunks:function(){if(this.left)return s(this.left),this.left.chunks}};function oe(L){return typeof L=="string"?L:L.getValue()}var D;function ae(L,W,O){D||(D=new diff_match_patch);for(var j=D.diff_main(L,W),F=0;FX&&(le&&W.push({origFrom:j,origTo:de,editFrom:O,editTo:X}),O=je,j=he)}else Ze(ye==DIFF_INSERT?F:Q,pe[1])}return(O<=F.line||j<=Q.line)&&W.push({origFrom:j,origTo:Q.line+1,editFrom:O,editTo:F.line+1}),W}function ve(L,W){if(W==L.length-1)return!0;var O=L[W+1][1];return O.length==1&&W1||W==L.length-3)&&O.charCodeAt(0)==10)}function ze(L,W){if(W==0)return!0;var O=L[W-1][1];return O.charCodeAt(O.length-1)!=10?!1:W==1?!0:(O=L[W-2][1],O.charCodeAt(O.length-1)==10)}function qe(L,W,O){for(var j,F,Q,le,pe=0;peW?(F=ye.editFrom,le=ye.origFrom):X>W&&(F=ye.editTo,le=ye.origTo)),X<=W?(j=ye.editTo,Q=ye.origTo):Y<=W&&(j=ye.editFrom,Q=ye.origFrom)}return{edit:{before:j,after:F},orig:{before:Q,after:le}}}function vt(L,W,O){L.addLineClass(W,"wrap","CodeMirror-merge-collapsed-line");var j=document.createElement("span");j.className="CodeMirror-merge-collapsed-widget",j.title=L.phrase("Identical text collapsed. Click to expand.");var F=L.markText(r(W,0),r(O-1),{inclusiveLeft:!0,inclusiveRight:!0,replacedWith:j,clearOnEnter:!0});function Q(){F.clear(),L.removeLineClass(W,"wrap","CodeMirror-merge-collapsed-line")}return F.explicitlyCleared&&Q(),n.on(j,"click",Q),F.on("clear",Q),n.on(j,"click",Q),{mark:F,clear:Q}}function mt(L,W){var O=[];function j(){for(var pe=0;pe=0&&peW){var X=[{line:ye,cm:j}];L.left&&X.push({line:N(ye,L.left.chunks),cm:L.left.orig}),L.right&&X.push({line:N(ye,L.right.chunks),cm:L.right.orig});var de=mt(Y,X);L.options.onCollapse&&L.options.onCollapse(L,ye,Y,de)}}}function Xe(L,W,O,j){var F=document.createElement(L);if(O&&(F.className=O),j&&(F.style.cssText=j),typeof W=="string")F.appendChild(document.createTextNode(W));else if(W)for(var Q=0;Q0;--W)L.removeChild(L.firstChild)}function Be(L){for(var W=1;W0)break}this.signal(),this.alignable.splice(O,0,L,W)},find:function(L){for(var W=0;W-1){var Y=this.alignable[Q+1];Y==Fe?this.alignable.splice(Q,2):this.alignable[Q+1]=Y&~Fe}le>-1&&O&&this.set(L+O,Fe)}};function ne(L,W){return(L.line-W.line||L.ch-W.ch)<0?L:W}function be(L,W){return(L.line-W.line||L.ch-W.ch)>0?L:W}function _e(L,W){return L.line==W.line&&L.ch==W.ch}function xe(L,W,O){for(var j=L.length-1;j>=0;j--){var F=L[j],Q=(O?F.origTo:F.editTo)-1;if(QW)return Q}}function Z(L,W){var O=null,j=L.state.diffViews,F=L.getCursor().line;if(j)for(var Q=0;QO:ye"u"&&(this.Diff_Timeout<=0?u=Number.MAX_VALUE:u=new Date().getTime()+this.Diff_Timeout*1e3);var f=u;if(o==null||s==null)throw new Error("Null input. (diff_main)");if(o==s)return o?[new e.Diff(i,o)]:[];typeof l>"u"&&(l=!0);var d=l,m=this.diff_commonPrefix(o,s),v=o.substring(0,m);o=o.substring(m),s=s.substring(m),m=this.diff_commonSuffix(o,s);var y=o.substring(o.length-m);o=o.substring(0,o.length-m),s=s.substring(0,s.length-m);var _=this.diff_compute_(o,s,d,f);return v&&_.unshift(new e.Diff(i,v)),y&&_.push(new e.Diff(i,y)),this.diff_cleanupMerge(_),_},e.prototype.diff_compute_=function(o,s,l,u){var f;if(!o)return[new e.Diff(r,s)];if(!s)return[new e.Diff(n,o)];var d=o.length>s.length?o:s,m=o.length>s.length?s:o,v=d.indexOf(m);if(v!=-1)return f=[new e.Diff(r,d.substring(0,v)),new e.Diff(i,m),new e.Diff(r,d.substring(v+m.length))],o.length>s.length&&(f[0][0]=f[2][0]=n),f;if(m.length==1)return[new e.Diff(n,o),new e.Diff(r,s)];var y=this.diff_halfMatch_(o,s);if(y){var _=y[0],C=y[1],x=y[2],k=y[3],A=y[4],N=this.diff_main(_,x,l,u),E=this.diff_main(C,k,l,u);return N.concat([new e.Diff(i,A)],E)}return l&&o.length>100&&s.length>100?this.diff_lineMode_(o,s,u):this.diff_bisect_(o,s,u)},e.prototype.diff_lineMode_=function(o,s,l){var u=this.diff_linesToChars_(o,s);o=u.chars1,s=u.chars2;var f=u.lineArray,d=this.diff_main(o,s,!1,l);this.diff_charsToLines_(d,f),this.diff_cleanupSemantic(d),d.push(new e.Diff(i,""));for(var m=0,v=0,y=0,_="",C="";m=1&&y>=1){d.splice(m-v-y,v+y),m=m-v-y;for(var x=this.diff_main(_,C,!1,l),k=x.length-1;k>=0;k--)d.splice(m,0,x[k]);m=m+x.length}y=0,v=0,_="",C="";break}m++}return d.pop(),d},e.prototype.diff_bisect_=function(o,s,l){for(var u=o.length,f=s.length,d=Math.ceil((u+f)/2),m=d,v=2*d,y=new Array(v),_=new Array(v),C=0;Cl);I++){for(var q=-I+A;q<=I-N;q+=2){var P=m+q,z;q==-I||q!=I&&y[P-1]u)N+=2;else if(w>f)A+=2;else if(k){var R=m+x-q;if(R>=0&&R=U)return this.diff_bisectSplit_(o,s,z,w,l)}}}for(var K=-I+E;K<=I-H;K+=2){var R=m+K,U;K==-I||K!=I&&_[R-1]<_[R+1]?U=_[R+1]:U=_[R-1]+1;for(var oe=U-K;Uu)H+=2;else if(oe>f)E+=2;else if(!k){var P=m+x-K;if(P>=0&&P=U)return this.diff_bisectSplit_(o,s,z,w,l)}}}}return[new e.Diff(n,o),new e.Diff(r,s)]},e.prototype.diff_bisectSplit_=function(o,s,l,u,f){var d=o.substring(0,l),m=s.substring(0,u),v=o.substring(l),y=s.substring(u),_=this.diff_main(d,m,!1,f),C=this.diff_main(v,y,!1,f);return _.concat(C)},e.prototype.diff_linesToChars_=function(o,s){var l=[],u={};l[0]="";function f(y){for(var _="",C=0,x=-1,k=l.length;xu?o=o.substring(l-u):ls.length?o:s,u=o.length>s.length?s:o;if(l.length<4||u.length*2=N.length?[z,w,R,U,P]:null}var m=d(l,u,Math.ceil(l.length/4)),v=d(l,u,Math.ceil(l.length/2)),y;if(!m&&!v)return null;v?m?y=m[4].length>v[4].length?m:v:y=v:y=m;var _,C,x,k;o.length>s.length?(_=y[0],C=y[1],x=y[2],k=y[3]):(x=y[0],k=y[1],_=y[2],C=y[3]);var A=y[4];return[_,C,x,k,A]},e.prototype.diff_cleanupSemantic=function(o){for(var s=!1,l=[],u=0,f=null,d=0,m=0,v=0,y=0,_=0;d0?l[u-1]:-1,m=0,v=0,y=0,_=0,f=null,s=!0)),d++;for(s&&this.diff_cleanupMerge(o),this.diff_cleanupSemanticLossless(o),d=1;d=A?(k>=C.length/2||k>=x.length/2)&&(o.splice(d,0,new e.Diff(i,x.substring(0,k))),o[d-1][1]=C.substring(0,C.length-k),o[d+1][1]=x.substring(k),d++):(A>=C.length/2||A>=x.length/2)&&(o.splice(d,0,new e.Diff(i,C.substring(0,A))),o[d-1][0]=r,o[d-1][1]=x.substring(0,x.length-A),o[d+1][0]=n,o[d+1][1]=C.substring(A),d++),d++}d++}},e.prototype.diff_cleanupSemanticLossless=function(o){function s(A,N){if(!A||!N)return 6;var E=A.charAt(A.length-1),H=N.charAt(0),I=E.match(e.nonAlphaNumericRegex_),q=H.match(e.nonAlphaNumericRegex_),P=I&&E.match(e.whitespaceRegex_),z=q&&H.match(e.whitespaceRegex_),w=P&&E.match(e.linebreakRegex_),R=z&&H.match(e.linebreakRegex_),U=w&&A.match(e.blanklineEndRegex_),K=R&&N.match(e.blanklineStartRegex_);return U||K?5:w||R?4:I&&!P&&z?3:P||z?2:I||q?1:0}for(var l=1;l=x&&(x=k,y=u,_=f,C=d)}o[l-1][1]!=y&&(y?o[l-1][1]=y:(o.splice(l-1,1),l--),o[l][1]=_,C?o[l+1][1]=C:(o.splice(l+1,1),l--))}l++}},e.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,e.whitespaceRegex_=/\s/,e.linebreakRegex_=/[\r\n]/,e.blanklineEndRegex_=/\n\r?\n$/,e.blanklineStartRegex_=/^\r?\n\r?\n/,e.prototype.diff_cleanupEfficiency=function(o){for(var s=!1,l=[],u=0,f=null,d=0,m=!1,v=!1,y=!1,_=!1;d0?l[u-1]:-1,y=_=!1),s=!0)),d++;s&&this.diff_cleanupMerge(o)},e.prototype.diff_cleanupMerge=function(o){o.push(new e.Diff(i,""));for(var s=0,l=0,u=0,f="",d="",m;s1?(l!==0&&u!==0&&(m=this.diff_commonPrefix(d,f),m!==0&&(s-l-u>0&&o[s-l-u-1][0]==i?o[s-l-u-1][1]+=d.substring(0,m):(o.splice(0,0,new e.Diff(i,d.substring(0,m))),s++),d=d.substring(m),f=f.substring(m)),m=this.diff_commonSuffix(d,f),m!==0&&(o[s][1]=d.substring(d.length-m)+o[s][1],d=d.substring(0,d.length-m),f=f.substring(0,f.length-m))),s-=l+u,o.splice(s,l+u),f.length&&(o.splice(s,0,new e.Diff(n,f)),s++),d.length&&(o.splice(s,0,new e.Diff(r,d)),s++),s++):s!==0&&o[s-1][0]==i?(o[s-1][1]+=o[s][1],o.splice(s,1)):s++,u=0,l=0,f="",d="";break}o[o.length-1][1]===""&&o.pop();var v=!1;for(s=1;ss));m++)f=l,d=u;return o.length!=m&&o[m][0]===n?d:d+(s-f)},e.prototype.diff_prettyHtml=function(o){for(var s=[],l=/&/g,u=//g,d=/\n/g,m=0;m");switch(v){case r:s[m]=''+_+"";break;case n:s[m]=''+_+"";break;case i:s[m]=""+_+"";break}}return s.join("")},e.prototype.diff_text1=function(o){for(var s=[],l=0;lthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var u=this.match_alphabet_(s),f=this;function d(z,w){var R=z/s.length,U=Math.abs(l-w);return f.Match_Distance?R+U/f.Match_Distance:U?1:R}var m=this.Match_Threshold,v=o.indexOf(s,l);v!=-1&&(m=Math.min(d(0,v),m),v=o.lastIndexOf(s,l+s.length),v!=-1&&(m=Math.min(d(0,v),m)));var y=1<=N;I--){var q=u[o.charAt(I-1)];if(A===0?H[I]=(H[I+1]<<1|1)&q:H[I]=(H[I+1]<<1|1)&q|((k[I+1]|k[I])<<1|1)|k[I+1],H[I]&y){var P=d(A,I-1);if(P<=m)if(m=P,v=I-1,v>l)N=Math.max(1,2*l-v);else break}}if(d(A+1,l)>m)break;k=H}return v},e.prototype.match_alphabet_=function(o){for(var s={},l=0;l"u")u=o,f=this.diff_main(u,s,!0),f.length>2&&(this.diff_cleanupSemantic(f),this.diff_cleanupEfficiency(f));else if(o&&typeof o=="object"&&typeof s>"u"&&typeof l>"u")f=o,u=this.diff_text1(f);else if(typeof o=="string"&&s&&typeof s=="object"&&typeof l>"u")u=o,f=s;else if(typeof o=="string"&&typeof s=="string"&&l&&typeof l=="object")u=o,f=l;else throw new Error("Unknown call format to patch_make.");if(f.length===0)return[];for(var d=[],m=new e.patch_obj,v=0,y=0,_=0,C=u,x=u,k=0;k=2*this.Patch_Margin&&v&&(this.patch_addContext_(m,C),d.push(m),m=new e.patch_obj,v=0,C=x,y=_);break}A!==r&&(y+=N.length),A!==n&&(_+=N.length)}return v&&(this.patch_addContext_(m,C),d.push(m)),d},e.prototype.patch_deepCopy=function(o){for(var s=[],l=0;lthis.Match_MaxBits?(y=this.match_main(s,v.substring(0,this.Match_MaxBits),m),y!=-1&&(_=this.match_main(s,v.substring(v.length-this.Match_MaxBits),m+v.length-this.Match_MaxBits),(_==-1||y>=_)&&(y=-1))):y=this.match_main(s,v,m),y==-1)f[d]=!1,u-=o[d].length2-o[d].length1;else{f[d]=!0,u=y-m;var C;if(_==-1?C=s.substring(y,y+v.length):C=s.substring(y,_+this.Match_MaxBits),v==C)s=s.substring(0,y)+this.diff_text2(o[d].diffs)+s.substring(y+v.length);else{var x=this.diff_main(v,C,!1);if(v.length>this.Match_MaxBits&&this.diff_levenshtein(x)/v.length>this.Patch_DeleteThreshold)f[d]=!1;else{this.diff_cleanupSemanticLossless(x);for(var k=0,A,N=0;Nd[0][1].length){var m=s-d[0][1].length;d[0][1]=l.substring(d[0][1].length)+d[0][1],f.start1-=m,f.start2-=m,f.length1+=m,f.length2+=m}if(f=o[o.length-1],d=f.diffs,d.length==0||d[d.length-1][0]!=i)d.push(new e.Diff(i,l)),f.length1+=s,f.length2+=s;else if(s>d[d.length-1][1].length){var m=s-d[d.length-1][1].length;d[d.length-1][1]+=l.substring(0,m),f.length1+=m,f.length2+=m}return l},e.prototype.patch_splitMax=function(o){for(var s=this.Match_MaxBits,l=0;l2*s?(v.length1+=C.length,f+=C.length,y=!1,v.diffs.push(new e.Diff(_,C)),u.diffs.shift()):(C=C.substring(0,s-v.length1-this.Patch_Margin),v.length1+=C.length,f+=C.length,_===i?(v.length2+=C.length,d+=C.length):y=!1,v.diffs.push(new e.Diff(_,C)),C==u.diffs[0][1]?u.diffs.shift():u.diffs[0][1]=u.diffs[0][1].substring(C.length))}m=this.diff_text2(v.diffs),m=m.substring(m.length-this.Patch_Margin);var x=this.diff_text1(u.diffs).substring(0,this.Patch_Margin);x!==""&&(v.length1+=x.length,v.length2+=x.length,v.diffs.length!==0&&v.diffs[v.diffs.length-1][0]===i?v.diffs[v.diffs.length-1][1]+=x:v.diffs.push(new e.Diff(i,x))),y||o.splice(++l,0,v)}}},e.prototype.patch_toText=function(o){for(var s=[],l=0;l2&&H.token&&typeof H.token!="string"){for(var P=2;P-1)return n.Pass;var k=_.indent.length-1,A=v[_.state];e:for(;;){for(var N=0;N({})},cminstance:{type:Object,default:()=>null},placeholder:{type:String,default:""}},emits:{ready:t=>t,"update:cminstance":t=>t},setup(t,{emit:e}){const n=Ot(),r=Ot(null),i=()=>{r.value=fa(jd.fromTextArea(n.value,t.options)),e("update:cminstance",r.value);const o=En(()=>t.cminstance,s=>{var l;s&&((l=t.cminstance)==null||l.setValue(t.value||t.content)),e("ready",fr(r)),o==null||o()},{deep:!0})};return ts(()=>{i()}),{textarea:n,initialize:i}}}),jw=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},Qoe=["name","placeholder"];function ese(t,e,n,r,i,o){return ge(),Se("textarea",{ref:"textarea",name:t.$props.name,placeholder:t.$props.placeholder},null,8,Qoe)}const OE=jw(Zoe,[["render",ese]]);window.diff_match_patch=Joe;window.DIFF_DELETE=-1;window.DIFF_INSERT=1;window.DIFF_EQUAL=0;const tse=Vn({name:"MergeMode",props:{options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})}},emits:["update:cminstance","ready"],setup(t,{emit:e}){const n=Ot(),r=Ot(),i=()=>{n.value=fa(jd.MergeView(r.value,t.options)),e("update:cminstance",n.value),e("ready",n)};return ts(()=>{i()}),{mergeView:r,initialize:i}}}),nse={ref:"mergeView"};function rse(t,e,n,r,i,o){return ge(),Se("div",nse,null,512)}const ise=jw(tse,[["render",rse]]);function ose(t){const e=/#link#(.+)#link#/g,n=[];let r;for(r=e.exec(t);r;){const i=document.createElement("a"),o=JSON.parse(r[1]),s=Object.entries(o);for(const[l,u]of s)i.setAttribute(l,u);i.className="editor_custom_link",i.innerHTML="logDownload",n.push({start:r.index,end:r.index+r[0].length,node:i}),r=e.exec(t)}return n}function sse(t){const e=[];function n(){const r=/#log<(\w*)>log#((.|\r\n|\n)*?)#log<(\w*)>log#/g;let i;for(i=r.exec(t);i;){const o=i[0].replace(/\r\n/g,` -`).split(` -`),s=i[2].replace(/\r\n/g,` -`).split(` -`),l=document.createElement("span"),u=i[1];l.className=`c-editor--log__${u}`;let f=0;for(let d=0;d[ \t])(.+)/,token:["tag","","error.strong","error.strong"],sol:!0},{regex:/(\[.*?\])([ \t]*)()(.+)(.?)/,token:["tag","","bracket","bracket","hr"],sol:!0},{regex:/(\[.*?\])([ \t]*)()(.+)(.?)/,token:["tag","","comment","comment","hr"],sol:!0}];jd.defineSimpleMode("fclog",{start:[...hp,{regex:/.*/,token:"hr"}],error:[...hp,{regex:/.*/,token:"error.strong"}],info:[...hp,{regex:/.*/,token:"bracket"}],warning:[...hp,{regex:/.*\[/,token:"comment"}]});jd.defineSimpleMode("log",{start:[{regex:/^[=]+[^=]*[=]+/,token:"strong"},{regex:/([^\w])([A-Z][\w]*)/,token:["","string"]},{regex:/(^[A-Z][\w]*)/,token:"string"}]});const ase=Vn({name:"CodemirrorFclog",props:{value:{type:String,default:""},name:{type:String,default:`cm-textarea-${+new Date}`},options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})},placeholder:{type:String,default:""}},emits:["update:cminstance","ready"],setup(t,{emit:e}){const n=Ot(),r=Ot(null),i=(s=t.cminstance)=>{s.getAllMarks().forEach(f=>f.clear());const l=s.getValue(),u=[].concat(ose(l)).concat(sse(l));for(let f=0;f{var s;r.value=fa(jd.fromTextArea(n.value,t.options)),e("update:cminstance",fr(r)),(s=r.value)==null||s.on("change",i)};return En(()=>t.cminstance,s=>{var l;s&&(i(t.cminstance),(l=t.cminstance)==null||l.setValue(t.value),e("ready",r))},{deep:!0,immediate:!0}),ts(()=>{o()}),{initialize:o,textarea:n}}}),lse=["name","placeholder"];function use(t,e,n,r,i,o){return ge(),Se("textarea",{ref:"textarea",name:t.$props.name,placeholder:t.$props.placeholder},null,8,lse)}const cse=jw(ase,[["render",use]]),PN={"update:value":()=>!0,change:(t,e)=>({value:t,cm:e}),input:()=>!0,ready:t=>t},fse=["changes","scroll","beforeChange","cursorActivity","keyHandled","inputRead","electricInput","beforeSelectionChange","viewportChange","swapDoc","gutterClick","gutterContextMenu","focus","blur","refresh","optionChange","scrollCursorIntoView","update"],dse=()=>{const t={};return fse.forEach(e=>{t[e]=(...n)=>n}),t},hse={...PN,...dse()},cy={mode:"text",theme:"default",lineNumbers:!0,smartIndent:!0,indentUnit:2};function pse(t){Promise.resolve().then(()=>{const e=t.getScrollInfo();t.scrollTo(e.left,e.height)})}const mse=({props:t,cminstance:e,emit:n,internalInstance:r,content:i})=>{const o=er(()=>{var l;return t.merge?(l=fr(e))==null?void 0:l.editor():fr(e)}),s=()=>{const l=[];return Object.keys(r==null?void 0:r.vnode.props).forEach(u=>{if(u.startsWith("on")){const f=u.replace(u[2],u[2].toLowerCase()).slice(2);!PN[f]&&l.push(f)}}),l};return{listenerEvents:()=>{o.value.on("change",u=>{const f=u.getValue();f===i.value&&f!==""||(i.value=f,n("update:value",i.value||""),n("input",i.value||" "),Promise.resolve().then(()=>{n("change",i.value,u)}),t.keepCursorInEnd&&pse(u))});const l={};s().filter(u=>!l[u]&&(l[u]=!0)).forEach(u=>{o.value.on(u,(...f)=>{n(u,...f)})})}}};function gse({props:t,cminstance:e,presetRef:n}){const r=Ot(null),i=Ot(null),o=er(()=>{var m;return t.merge?(m=fr(e))==null?void 0:m.editor():fr(e)}),s=()=>{Ri(()=>{var m;(m=o.value)==null||m.refresh()})},l=(m=t.width,v=t.height)=>{var y;r.value=String(m).replace("px",""),i.value=String(v).replace("px","");const _=i.value;(y=o.value)==null||y.setSize(r.value,_)},u=()=>{var m;const v=(m=o.value)==null?void 0:m.getWrapperElement();v==null||v.remove()},f=()=>{var m,v,y;const _=(m=o.value)==null?void 0:m.getDoc().getHistory();(v=n.value)==null||v.initialize(),u(),(y=o.value)==null||y.getDoc().setHistory(_)},d=()=>{const m=document.querySelector(".CodeMirror-gutters");return(m==null?void 0:m.style.left.replace("px",""))!=="0"};return{reload:f,refresh:s,resize:l,destroy:u,containerHeight:i,reviseStyle:()=>{if(s(),!d())return;const m=setInterval(()=>{d()?s():clearInterval(m)},60),v=setTimeout(()=>{clearInterval(m),clearTimeout(v)},400)}}}const vse=Vn({__name:"index",props:{value:{type:String,default:""},options:{type:Object,default:()=>cy},globalOptions:{type:Object,default:()=>cy},placeholder:{type:String,default:""},border:{type:Boolean,default:!1},width:{type:[String,Number],default:null},height:{type:[String,Number],default:null},originalStyle:{type:Boolean,default:!1},keepCursorInEnd:{type:Boolean,default:!1},merge:{type:Boolean,default:!1},name:{type:String,default:""},marker:{type:Function,default:()=>null},unseenLines:{type:Array,default:()=>[]}},emits:hse,setup(t,{expose:e,emit:n}){var r,i;const o=t;typeof Object.assign!="function"&&Object.defineProperty(Object,"assign",{value(P){if(P==null)throw new TypeError("Cannot convert undefined or null to object");const z=Object(P);for(let w=1;w{var P;return o.merge?(P=fr(s))==null?void 0:P.editor():fr(s)}),{refresh:_,resize:C,destroy:x,containerHeight:k,reviseStyle:A}=gse({props:o,cminstance:s,presetRef:v}),{listenerEvents:N}=mse({props:o,cminstance:s,emit:n,internalInstance:d,content:l}),E=()=>{o.unseenLines!==void 0&&o.marker!==void 0&&o.unseenLines.forEach(P=>{var z,w;const R=(z=s.value)==null?void 0:z.lineInfo(P);(w=s.value)==null||w.setGutterMarker(P,"breakpoints",R!=null&&R.gutterMarkers?null:o.marker())})},H=P=>{var z,w;const R=(z=s.value)==null?void 0:z.getValue();P!==R&&((w=s.value)==null||w.setValue(P),l.value=P,A()),E()},I=()=>{N(),E(),C(o.width,o.height),n("ready",s.value),En([()=>o.width,()=>o.height],([P,z])=>{C(P,z)},{deep:!0})},q=()=>{if(o.options.mode==="fclog"||o.options.mode==="log"){u.value=cse;return}if(o.merge){u.value=ise;return}u.value=OE};return En(()=>o.options,P=>{var z;for(const w in o.options)(z=y.value)==null||z.setOption(w,fr(P[w]))},{deep:!0}),En(()=>o.value,P=>{H(P)}),En(()=>o.merge,q,{immediate:!0}),Ml(()=>{x()}),e({cminstance:s,resize:C,refresh:_,destroy:x}),(P,z)=>(ge(),Se("div",{class:gt(["codemirror-container",{merge:P.$props.merge,bordered:P.$props.border||P.$props.merge&&!o.originalStyle,"width-auto":!P.$props.width||P.$props.width=="100%","height-auto":!P.$props.height||P.$props.height=="100%","original-style":o.originalStyle}]),style:oi({height:fr(k)+"px"})},[(ge(),Et(Qs(fr(u)),wi({ref_key:"presetRef",ref:v,cminstance:s.value,"onUpdate:cminstance":z[0]||(z[0]=w=>s.value=w),style:{height:"100%"}},{...P.$props,...P.$attrs,options:f.value,name:fr(m),content:l.value},{onReady:I}),null,16,["cminstance"]))],6))}});function yse(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(!t||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}yse(`.codemirror-container { -======== -}`;function fL(){var t=iL,e=oL,n=tt.cssPrefix,r=tt.replacementClass,i=Ste;if(n!==t||r!==e){var o=new RegExp("\\.".concat(t,"\\-"),"g"),s=new RegExp("\\--".concat(t,"\\-"),"g"),l=new RegExp("\\.".concat(e),"g");i=i.replace(o,".".concat(n,"-")).replace(s,"--".concat(n,"-")).replace(l,".".concat(r))}return i}var lE=!1;function s0(){tt.autoAddCss&&!lE&&(bte(fL()),lE=!0)}var Cte={mixout:function(){return{dom:{css:fL,insertCss:s0}}},hooks:function(){return{beforeDOMElementCreation:function(){s0()},beforeI2svg:function(){s0()}}}},Zo=sa||{};Zo[Xo]||(Zo[Xo]={});Zo[Xo].styles||(Zo[Xo].styles={});Zo[Xo].hooks||(Zo[Xo].hooks={});Zo[Xo].shims||(Zo[Xo].shims=[]);var Bi=Zo[Xo],dL=[],Tte=function t(){rn.removeEventListener("DOMContentLoaded",t),Qm=1,dL.map(function(e){return e()})},Qm=!1;ls&&(Qm=(rn.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(rn.readyState),Qm||rn.addEventListener("DOMContentLoaded",Tte));function Ete(t){ls&&(Qm?setTimeout(t,0):dL.push(t))}function jd(t){var e=t.tag,n=t.attributes,r=n===void 0?{}:n,i=t.children,o=i===void 0?[]:i;return typeof t=="string"?cL(t):"<".concat(e," ").concat(wte(r),">").concat(o.map(jd).join(""),"")}function uE(t,e,n){if(t&&t[e]&&t[e][n])return{prefix:e,iconName:n,icon:t[e][n]}}var Ate=function(e,n){return function(r,i,o,s){return e.call(n,r,i,o,s)}},a0=function(e,n,r,i){var o=Object.keys(e),s=o.length,l=i!==void 0?Ate(n,i):n,u,f,d;for(r===void 0?(u=1,d=e[o[0]]):(u=0,d=r);u=55296&&i<=56319&&n=55296&&r<=56319&&n>e+1&&(i=t.charCodeAt(e+1),i>=56320&&i<=57343)?(r-55296)*1024+i-56320+65536:r}function cE(t){return Object.keys(t).reduce(function(e,n){var r=t[n],i=!!r.icon;return i?e[r.iconName]=r.icon:e[n]=r,e},{})}function l1(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.skipHooks,i=r===void 0?!1:r,o=cE(e);typeof Bi.hooks.addPack=="function"&&!i?Bi.hooks.addPack(t,cE(e)):Bi.styles[t]=Ue(Ue({},Bi.styles[t]||{}),o),t==="fas"&&l1("fa",e)}var fp,dp,hp,vu=Bi.styles,Nte=Bi.shims,Lte=(fp={},Fn(fp,nn,Object.values(vd[nn])),Fn(fp,mn,Object.values(vd[mn])),fp),Rw=null,hL={},pL={},mL={},gL={},vL={},Ite=(dp={},Fn(dp,nn,Object.keys(md[nn])),Fn(dp,mn,Object.keys(md[mn])),dp);function Pte(t){return~pte.indexOf(t)}function Dte(t,e){var n=e.split("-"),r=n[0],i=n.slice(1).join("-");return r===t&&i!==""&&!Pte(i)?i:null}var yL=function(){var e=function(o){return a0(vu,function(s,l,u){return s[u]=a0(l,o,{}),s},{})};hL=e(function(i,o,s){if(o[3]&&(i[o[3]]=s),o[2]){var l=o[2].filter(function(u){return typeof u=="number"});l.forEach(function(u){i[u.toString(16)]=s})}return i}),pL=e(function(i,o,s){if(i[s]=s,o[2]){var l=o[2].filter(function(u){return typeof u=="string"});l.forEach(function(u){i[u]=s})}return i}),vL=e(function(i,o,s){var l=o[2];return i[s]=s,l.forEach(function(u){i[u]=s}),i});var n="far"in vu||tt.autoFetchSvg,r=a0(Nte,function(i,o){var s=o[0],l=o[1],u=o[2];return l==="far"&&!n&&(l="fas"),typeof s=="string"&&(i.names[s]={prefix:l,iconName:u}),typeof s=="number"&&(i.unicodes[s.toString(16)]={prefix:l,iconName:u}),i},{names:{},unicodes:{}});mL=r.names,gL=r.unicodes,Rw=sv(tt.styleDefault,{family:tt.familyDefault})};yte(function(t){Rw=sv(t.styleDefault,{family:tt.familyDefault})});yL();function zw(t,e){return(hL[t]||{})[e]}function Rte(t,e){return(pL[t]||{})[e]}function Ga(t,e){return(vL[t]||{})[e]}function bL(t){return mL[t]||{prefix:null,iconName:null}}function zte(t){var e=gL[t],n=zw("fas",t);return e||(n?{prefix:"fas",iconName:n}:null)||{prefix:null,iconName:null}}function aa(){return Rw}var Bw=function(){return{prefix:null,iconName:null,rest:[]}};function sv(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.family,r=n===void 0?nn:n,i=md[r][t],o=gd[r][t]||gd[r][i],s=t in Bi.styles?t:null;return o||s||null}var fE=(hp={},Fn(hp,nn,Object.keys(vd[nn])),Fn(hp,mn,Object.keys(vd[mn])),hp);function av(t){var e,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.skipLookups,i=r===void 0?!1:r,o=(e={},Fn(e,nn,"".concat(tt.cssPrefix,"-").concat(nn)),Fn(e,mn,"".concat(tt.cssPrefix,"-").concat(mn)),e),s=null,l=nn;(t.includes(o[nn])||t.some(function(f){return fE[nn].includes(f)}))&&(l=nn),(t.includes(o[mn])||t.some(function(f){return fE[mn].includes(f)}))&&(l=mn);var u=t.reduce(function(f,d){var m=Dte(tt.cssPrefix,d);if(vu[d]?(d=Lte[l].includes(d)?lte[l][d]:d,s=d,f.prefix=d):Ite[l].indexOf(d)>-1?(s=d,f.prefix=sv(d,{family:l})):m?f.iconName=m:d!==tt.replacementClass&&d!==o[nn]&&d!==o[mn]&&f.rest.push(d),!i&&f.prefix&&f.iconName){var v=s==="fa"?bL(f.iconName):{},y=Ga(f.prefix,f.iconName);v.prefix&&(s=null),f.iconName=v.iconName||y||f.iconName,f.prefix=v.prefix||f.prefix,f.prefix==="far"&&!vu.far&&vu.fas&&!tt.autoFetchSvg&&(f.prefix="fas")}return f},Bw());return(t.includes("fa-brands")||t.includes("fab"))&&(u.prefix="fab"),(t.includes("fa-duotone")||t.includes("fad"))&&(u.prefix="fad"),!u.prefix&&l===mn&&(vu.fass||tt.autoFetchSvg)&&(u.prefix="fass",u.iconName=Ga(u.prefix,u.iconName)||u.iconName),(u.prefix==="fa"||s==="fa")&&(u.prefix=aa()||"fas"),u}var Bte=function(){function t(){Jee(this,t),this.definitions={}}return Xee(t,[{key:"add",value:function(){for(var n=this,r=arguments.length,i=new Array(r),o=0;o0&&d.forEach(function(m){typeof m=="string"&&(n[l][m]=f)}),n[l][u]=f}),n}}]),t}(),dE=[],yu={},Iu={},$te=Object.keys(Iu);function Hte(t,e){var n=e.mixoutsTo;return dE=t,yu={},Object.keys(Iu).forEach(function(r){$te.indexOf(r)===-1&&delete Iu[r]}),dE.forEach(function(r){var i=r.mixout?r.mixout():{};if(Object.keys(i).forEach(function(s){typeof i[s]=="function"&&(n[s]=i[s]),Zm(i[s])==="object"&&Object.keys(i[s]).forEach(function(l){n[s]||(n[s]={}),n[s][l]=i[s][l]})}),r.hooks){var o=r.hooks();Object.keys(o).forEach(function(s){yu[s]||(yu[s]=[]),yu[s].push(o[s])})}r.provides&&r.provides(Iu)}),n}function u1(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i1?e-1:0),r=1;r0&&arguments[0]!==void 0?arguments[0]:{};return ls?(Sl("beforeI2svg",e),Qo("pseudoElements2svg",e),Qo("i2svg",e)):Promise.reject("Operation requires a DOM of some kind.")},watch:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.autoReplaceSvgRoot;tt.autoReplaceSvg===!1&&(tt.autoReplaceSvg=!0),tt.observeMutations=!0,Ete(function(){Wte({autoReplaceSvgRoot:n}),Sl("watch",e)})}},jte={icon:function(e){if(e===null)return null;if(Zm(e)==="object"&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:Ga(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&e.length===2){var n=e[1].indexOf("fa-")===0?e[1].slice(3):e[1],r=sv(e[0]);return{prefix:r,iconName:Ga(r,n)||n}}if(typeof e=="string"&&(e.indexOf("".concat(tt.cssPrefix,"-"))>-1||e.match(ute))){var i=av(e.split(" "),{skipLookups:!0});return{prefix:i.prefix||aa(),iconName:Ga(i.prefix,i.iconName)||i.iconName}}if(typeof e=="string"){var o=aa();return{prefix:o,iconName:Ga(o,e)||e}}}},ui={noAuto:Fte,config:tt,dom:Vte,parse:jte,library:_L,findIconDefinition:c1,toHtml:jd},Wte=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.autoReplaceSvgRoot,r=n===void 0?rn:n;(Object.keys(Bi.styles).length>0||tt.autoFetchSvg)&&ls&&tt.autoReplaceSvg&&ui.dom.i2svg({node:r})};function lv(t,e){return Object.defineProperty(t,"abstract",{get:e}),Object.defineProperty(t,"html",{get:function(){return t.abstract.map(function(r){return jd(r)})}}),Object.defineProperty(t,"node",{get:function(){if(ls){var r=rn.createElement("div");return r.innerHTML=t.html,r.children}}}),t}function Ute(t){var e=t.children,n=t.main,r=t.mask,i=t.attributes,o=t.styles,s=t.transform;if(Dw(s)&&n.found&&!r.found){var l=n.width,u=n.height,f={x:l/u/2,y:.5};i.style=ov(Ue(Ue({},o),{},{"transform-origin":"".concat(f.x+s.x/16,"em ").concat(f.y+s.y/16,"em")}))}return[{tag:"svg",attributes:i,children:e}]}function qte(t){var e=t.prefix,n=t.iconName,r=t.children,i=t.attributes,o=t.symbol,s=o===!0?"".concat(e,"-").concat(tt.cssPrefix,"-").concat(n):o;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:Ue(Ue({},i),{},{id:s}),children:r}]}]}function $w(t){var e=t.icons,n=e.main,r=e.mask,i=t.prefix,o=t.iconName,s=t.transform,l=t.symbol,u=t.title,f=t.maskId,d=t.titleId,m=t.extra,v=t.watchable,y=v===void 0?!1:v,_=r.found?r:n,C=_.width,x=_.height,k=i==="fak",A=[tt.replacementClass,o?"".concat(tt.cssPrefix,"-").concat(o):""].filter(function(z){return m.classes.indexOf(z)===-1}).filter(function(z){return z!==""||!!z}).concat(m.classes).join(" "),L={children:[],attributes:Ue(Ue({},m.attributes),{},{"data-prefix":i,"data-icon":o,class:A,role:m.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(C," ").concat(x)})},E=k&&!~m.classes.indexOf("fa-fw")?{width:"".concat(C/x*16*.0625,"em")}:{};y&&(L.attributes[xl]=""),u&&(L.children.push({tag:"title",attributes:{id:L.attributes["aria-labelledby"]||"title-".concat(d||bd())},children:[u]}),delete L.attributes.title);var H=Ue(Ue({},L),{},{prefix:i,iconName:o,main:n,mask:r,maskId:f,transform:s,symbol:l,styles:Ue(Ue({},E),m.styles)}),I=r.found&&n.found?Qo("generateAbstractMask",H)||{children:[],attributes:{}}:Qo("generateAbstractIcon",H)||{children:[],attributes:{}},q=I.children,P=I.attributes;return H.children=q,H.attributes=P,l?qte(H):Ute(H)}function hE(t){var e=t.content,n=t.width,r=t.height,i=t.transform,o=t.title,s=t.extra,l=t.watchable,u=l===void 0?!1:l,f=Ue(Ue(Ue({},s.attributes),o?{title:o}:{}),{},{class:s.classes.join(" ")});u&&(f[xl]="");var d=Ue({},s.styles);Dw(i)&&(d.transform=xte({transform:i,startCentered:!0,width:n,height:r}),d["-webkit-transform"]=d.transform);var m=ov(d);m.length>0&&(f.style=m);var v=[];return v.push({tag:"span",attributes:f,children:[e]}),o&&v.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),v}function Kte(t){var e=t.content,n=t.title,r=t.extra,i=Ue(Ue(Ue({},r.attributes),n?{title:n}:{}),{},{class:r.classes.join(" ")}),o=ov(r.styles);o.length>0&&(i.style=o);var s=[];return s.push({tag:"span",attributes:i,children:[e]}),n&&s.push({tag:"span",attributes:{class:"sr-only"},children:[n]}),s}var l0=Bi.styles;function f1(t){var e=t[0],n=t[1],r=t.slice(4),i=Ow(r,1),o=i[0],s=null;return Array.isArray(o)?s={tag:"g",attributes:{class:"".concat(tt.cssPrefix,"-").concat(Ka.GROUP)},children:[{tag:"path",attributes:{class:"".concat(tt.cssPrefix,"-").concat(Ka.SECONDARY),fill:"currentColor",d:o[0]}},{tag:"path",attributes:{class:"".concat(tt.cssPrefix,"-").concat(Ka.PRIMARY),fill:"currentColor",d:o[1]}}]}:s={tag:"path",attributes:{fill:"currentColor",d:o}},{found:!0,width:e,height:n,icon:s}}var Gte={found:!1,width:512,height:512};function Yte(t,e){!sL&&!tt.showMissingIcons&&t&&console.error('Icon with name "'.concat(t,'" and prefix "').concat(e,'" is missing.'))}function d1(t,e){var n=e;return e==="fa"&&tt.styleDefault!==null&&(e=aa()),new Promise(function(r,i){if(Qo("missingIconAbstract"),n==="fa"){var o=bL(t)||{};t=o.iconName||t,e=o.prefix||e}if(t&&e&&l0[e]&&l0[e][t]){var s=l0[e][t];return r(f1(s))}Yte(t,e),r(Ue(Ue({},Gte),{},{icon:tt.showMissingIcons&&t?Qo("missingIconAbstract")||{}:{}}))})}var pE=function(){},h1=tt.measurePerformance&&op&&op.mark&&op.measure?op:{mark:pE,measure:pE},of='FA "6.4.0"',Jte=function(e){return h1.mark("".concat(of," ").concat(e," begins")),function(){return wL(e)}},wL=function(e){h1.mark("".concat(of," ").concat(e," ends")),h1.measure("".concat(of," ").concat(e),"".concat(of," ").concat(e," begins"),"".concat(of," ").concat(e," ends"))},Hw={begin:Jte,end:wL},Rp=function(){};function mE(t){var e=t.getAttribute?t.getAttribute(xl):null;return typeof e=="string"}function Xte(t){var e=t.getAttribute?t.getAttribute(Nw):null,n=t.getAttribute?t.getAttribute(Lw):null;return e&&n}function Zte(t){return t&&t.classList&&t.classList.contains&&t.classList.contains(tt.replacementClass)}function Qte(){if(tt.autoReplaceSvg===!0)return zp.replace;var t=zp[tt.autoReplaceSvg];return t||zp.replace}function ene(t){return rn.createElementNS("http://www.w3.org/2000/svg",t)}function tne(t){return rn.createElement(t)}function kL(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.ceFn,r=n===void 0?t.tag==="svg"?ene:tne:n;if(typeof t=="string")return rn.createTextNode(t);var i=r(t.tag);Object.keys(t.attributes||[]).forEach(function(s){i.setAttribute(s,t.attributes[s])});var o=t.children||[];return o.forEach(function(s){i.appendChild(kL(s,{ceFn:r}))}),i}function nne(t){var e=" ".concat(t.outerHTML," ");return e="".concat(e,"Font Awesome fontawesome.com "),e}var zp={replace:function(e){var n=e[0];if(n.parentNode)if(e[1].forEach(function(i){n.parentNode.insertBefore(kL(i),n)}),n.getAttribute(xl)===null&&tt.keepOriginalSource){var r=rn.createComment(nne(n));n.parentNode.replaceChild(r,n)}else n.remove()},nest:function(e){var n=e[0],r=e[1];if(~Pw(n).indexOf(tt.replacementClass))return zp.replace(e);var i=new RegExp("".concat(tt.cssPrefix,"-.*"));if(delete r[0].attributes.id,r[0].attributes.class){var o=r[0].attributes.class.split(" ").reduce(function(l,u){return u===tt.replacementClass||u.match(i)?l.toSvg.push(u):l.toNode.push(u),l},{toNode:[],toSvg:[]});r[0].attributes.class=o.toSvg.join(" "),o.toNode.length===0?n.removeAttribute("class"):n.setAttribute("class",o.toNode.join(" "))}var s=r.map(function(l){return jd(l)}).join(` -`);n.setAttribute(xl,""),n.innerHTML=s}};function gE(t){t()}function xL(t,e){var n=typeof e=="function"?e:Rp;if(t.length===0)n();else{var r=gE;tt.mutateApproach===ste&&(r=sa.requestAnimationFrame||gE),r(function(){var i=Qte(),o=Hw.begin("mutate");t.map(i),o(),n()})}}var Fw=!1;function SL(){Fw=!0}function p1(){Fw=!1}var eg=null;function vE(t){if(sE&&tt.observeMutations){var e=t.treeCallback,n=e===void 0?Rp:e,r=t.nodeCallback,i=r===void 0?Rp:r,o=t.pseudoElementsCallback,s=o===void 0?Rp:o,l=t.observeMutationsRoot,u=l===void 0?rn:l;eg=new sE(function(f){if(!Fw){var d=aa();dc(f).forEach(function(m){if(m.type==="childList"&&m.addedNodes.length>0&&!mE(m.addedNodes[0])&&(tt.searchPseudoElements&&s(m.target),n(m.target)),m.type==="attributes"&&m.target.parentNode&&tt.searchPseudoElements&&s(m.target.parentNode),m.type==="attributes"&&mE(m.target)&&~hte.indexOf(m.attributeName))if(m.attributeName==="class"&&Xte(m.target)){var v=av(Pw(m.target)),y=v.prefix,_=v.iconName;m.target.setAttribute(Nw,y||d),_&&m.target.setAttribute(Lw,_)}else Zte(m.target)&&i(m.target)})}}),ls&&eg.observe(u,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function rne(){eg&&eg.disconnect()}function ine(t){var e=t.getAttribute("style"),n=[];return e&&(n=e.split(";").reduce(function(r,i){var o=i.split(":"),s=o[0],l=o.slice(1);return s&&l.length>0&&(r[s]=l.join(":").trim()),r},{})),n}function one(t){var e=t.getAttribute("data-prefix"),n=t.getAttribute("data-icon"),r=t.innerText!==void 0?t.innerText.trim():"",i=av(Pw(t));return i.prefix||(i.prefix=aa()),e&&n&&(i.prefix=e,i.iconName=n),i.iconName&&i.prefix||(i.prefix&&r.length>0&&(i.iconName=Rte(i.prefix,t.innerText)||zw(i.prefix,a1(t.innerText))),!i.iconName&&tt.autoFetchSvg&&t.firstChild&&t.firstChild.nodeType===Node.TEXT_NODE&&(i.iconName=t.firstChild.data)),i}function sne(t){var e=dc(t.attributes).reduce(function(i,o){return i.name!=="class"&&i.name!=="style"&&(i[o.name]=o.value),i},{}),n=t.getAttribute("title"),r=t.getAttribute("data-fa-title-id");return tt.autoA11y&&(n?e["aria-labelledby"]="".concat(tt.replacementClass,"-title-").concat(r||bd()):(e["aria-hidden"]="true",e.focusable="false")),e}function ane(){return{iconName:null,title:null,titleId:null,prefix:null,transform:po,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function yE(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0},n=one(t),r=n.iconName,i=n.prefix,o=n.rest,s=sne(t),l=u1("parseNodeAttributes",{},t),u=e.styleParser?ine(t):[];return Ue({iconName:r,title:t.getAttribute("title"),titleId:t.getAttribute("data-fa-title-id"),prefix:i,transform:po,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:o,styles:u,attributes:s}},l)}var lne=Bi.styles;function CL(t){var e=tt.autoReplaceSvg==="nest"?yE(t,{styleParser:!1}):yE(t);return~e.extra.classes.indexOf(aL)?Qo("generateLayersText",t,e):Qo("generateSvgReplacementMutation",t,e)}var la=new Set;Iw.map(function(t){la.add("fa-".concat(t))});Object.keys(md[nn]).map(la.add.bind(la));Object.keys(md[mn]).map(la.add.bind(la));la=Fd(la);function bE(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!ls)return Promise.resolve();var n=rn.documentElement.classList,r=function(m){return n.add("".concat(aE,"-").concat(m))},i=function(m){return n.remove("".concat(aE,"-").concat(m))},o=tt.autoFetchSvg?la:Iw.map(function(d){return"fa-".concat(d)}).concat(Object.keys(lne));o.includes("fa")||o.push("fa");var s=[".".concat(aL,":not([").concat(xl,"])")].concat(o.map(function(d){return".".concat(d,":not([").concat(xl,"])")})).join(", ");if(s.length===0)return Promise.resolve();var l=[];try{l=dc(t.querySelectorAll(s))}catch{}if(l.length>0)r("pending"),i("complete");else return Promise.resolve();var u=Hw.begin("onTree"),f=l.reduce(function(d,m){try{var v=CL(m);v&&d.push(v)}catch(y){sL||y.name==="MissingIcon"&&console.error(y)}return d},[]);return new Promise(function(d,m){Promise.all(f).then(function(v){xL(v,function(){r("active"),r("complete"),i("pending"),typeof e=="function"&&e(),u(),d()})}).catch(function(v){u(),m(v)})})}function une(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;CL(t).then(function(n){n&&xL([n],e)})}function cne(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=(e||{}).icon?e:c1(e||{}),i=n.mask;return i&&(i=(i||{}).icon?i:c1(i||{})),t(r,Ue(Ue({},n),{},{mask:i}))}}var fne=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.transform,i=r===void 0?po:r,o=n.symbol,s=o===void 0?!1:o,l=n.mask,u=l===void 0?null:l,f=n.maskId,d=f===void 0?null:f,m=n.title,v=m===void 0?null:m,y=n.titleId,_=y===void 0?null:y,C=n.classes,x=C===void 0?[]:C,k=n.attributes,A=k===void 0?{}:k,L=n.styles,E=L===void 0?{}:L;if(e){var H=e.prefix,I=e.iconName,q=e.icon;return lv(Ue({type:"icon"},e),function(){return Sl("beforeDOMElementCreation",{iconDefinition:e,params:n}),tt.autoA11y&&(v?A["aria-labelledby"]="".concat(tt.replacementClass,"-title-").concat(_||bd()):(A["aria-hidden"]="true",A.focusable="false")),$w({icons:{main:f1(q),mask:u?f1(u.icon):{found:!1,width:null,height:null,icon:{}}},prefix:H,iconName:I,transform:Ue(Ue({},po),i),symbol:s,title:v,maskId:d,titleId:_,extra:{attributes:A,styles:E,classes:x}})})}},dne={mixout:function(){return{icon:cne(fne)}},hooks:function(){return{mutationObserverCallbacks:function(n){return n.treeCallback=bE,n.nodeCallback=une,n}}},provides:function(e){e.i2svg=function(n){var r=n.node,i=r===void 0?rn:r,o=n.callback,s=o===void 0?function(){}:o;return bE(i,s)},e.generateSvgReplacementMutation=function(n,r){var i=r.iconName,o=r.title,s=r.titleId,l=r.prefix,u=r.transform,f=r.symbol,d=r.mask,m=r.maskId,v=r.extra;return new Promise(function(y,_){Promise.all([d1(i,l),d.iconName?d1(d.iconName,d.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(function(C){var x=Ow(C,2),k=x[0],A=x[1];y([n,$w({icons:{main:k,mask:A},prefix:l,iconName:i,transform:u,symbol:f,maskId:m,title:o,titleId:s,extra:v,watchable:!0})])}).catch(_)})},e.generateAbstractIcon=function(n){var r=n.children,i=n.attributes,o=n.main,s=n.transform,l=n.styles,u=ov(l);u.length>0&&(i.style=u);var f;return Dw(s)&&(f=Qo("generateAbstractTransformGrouping",{main:o,transform:s,containerWidth:o.width,iconWidth:o.width})),r.push(f||o.icon),{children:r,attributes:i}}}},hne={mixout:function(){return{layer:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.classes,o=i===void 0?[]:i;return lv({type:"layer"},function(){Sl("beforeDOMElementCreation",{assembler:n,params:r});var s=[];return n(function(l){Array.isArray(l)?l.map(function(u){s=s.concat(u.abstract)}):s=s.concat(l.abstract)}),[{tag:"span",attributes:{class:["".concat(tt.cssPrefix,"-layers")].concat(Fd(o)).join(" ")},children:s}]})}}}},pne={mixout:function(){return{counter:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.title,o=i===void 0?null:i,s=r.classes,l=s===void 0?[]:s,u=r.attributes,f=u===void 0?{}:u,d=r.styles,m=d===void 0?{}:d;return lv({type:"counter",content:n},function(){return Sl("beforeDOMElementCreation",{content:n,params:r}),Kte({content:n.toString(),title:o,extra:{attributes:f,styles:m,classes:["".concat(tt.cssPrefix,"-layers-counter")].concat(Fd(l))}})})}}}},mne={mixout:function(){return{text:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.transform,o=i===void 0?po:i,s=r.title,l=s===void 0?null:s,u=r.classes,f=u===void 0?[]:u,d=r.attributes,m=d===void 0?{}:d,v=r.styles,y=v===void 0?{}:v;return lv({type:"text",content:n},function(){return Sl("beforeDOMElementCreation",{content:n,params:r}),hE({content:n,transform:Ue(Ue({},po),o),title:l,extra:{attributes:m,styles:y,classes:["".concat(tt.cssPrefix,"-layers-text")].concat(Fd(f))}})})}}},provides:function(e){e.generateLayersText=function(n,r){var i=r.title,o=r.transform,s=r.extra,l=null,u=null;if(rL){var f=parseInt(getComputedStyle(n).fontSize,10),d=n.getBoundingClientRect();l=d.width/f,u=d.height/f}return tt.autoA11y&&!i&&(s.attributes["aria-hidden"]="true"),Promise.resolve([n,hE({content:n.innerHTML,width:l,height:u,transform:o,title:i,extra:s,watchable:!0})])}}},gne=new RegExp('"',"ug"),_E=[1105920,1112319];function vne(t){var e=t.replace(gne,""),n=Mte(e,0),r=n>=_E[0]&&n<=_E[1],i=e.length===2?e[0]===e[1]:!1;return{value:a1(i?e[0]:e),isSecondary:r||i}}function wE(t,e){var n="".concat(ote).concat(e.replace(":","-"));return new Promise(function(r,i){if(t.getAttribute(n)!==null)return r();var o=dc(t.children),s=o.filter(function(q){return q.getAttribute(s1)===e})[0],l=sa.getComputedStyle(t,e),u=l.getPropertyValue("font-family").match(cte),f=l.getPropertyValue("font-weight"),d=l.getPropertyValue("content");if(s&&!u)return t.removeChild(s),r();if(u&&d!=="none"&&d!==""){var m=l.getPropertyValue("content"),v=~["Sharp"].indexOf(u[2])?mn:nn,y=~["Solid","Regular","Light","Thin","Duotone","Brands","Kit"].indexOf(u[2])?gd[v][u[2].toLowerCase()]:fte[v][f],_=vne(m),C=_.value,x=_.isSecondary,k=u[0].startsWith("FontAwesome"),A=zw(y,C),L=A;if(k){var E=zte(C);E.iconName&&E.prefix&&(A=E.iconName,y=E.prefix)}if(A&&!x&&(!s||s.getAttribute(Nw)!==y||s.getAttribute(Lw)!==L)){t.setAttribute(n,L),s&&t.removeChild(s);var H=ane(),I=H.extra;I.attributes[s1]=e,d1(A,y).then(function(q){var P=$w(Ue(Ue({},H),{},{icons:{main:q,mask:Bw()},prefix:y,iconName:L,extra:I,watchable:!0})),z=rn.createElement("svg");e==="::before"?t.insertBefore(z,t.firstChild):t.appendChild(z),z.outerHTML=P.map(function(w){return jd(w)}).join(` -`),t.removeAttribute(n),r()}).catch(i)}else r()}else r()})}function yne(t){return Promise.all([wE(t,"::before"),wE(t,"::after")])}function bne(t){return t.parentNode!==document.head&&!~ate.indexOf(t.tagName.toUpperCase())&&!t.getAttribute(s1)&&(!t.parentNode||t.parentNode.tagName!=="svg")}function kE(t){if(ls)return new Promise(function(e,n){var r=dc(t.querySelectorAll("*")).filter(bne).map(yne),i=Hw.begin("searchPseudoElements");SL(),Promise.all(r).then(function(){i(),p1(),e()}).catch(function(){i(),p1(),n()})})}var _ne={hooks:function(){return{mutationObserverCallbacks:function(n){return n.pseudoElementsCallback=kE,n}}},provides:function(e){e.pseudoElements2svg=function(n){var r=n.node,i=r===void 0?rn:r;tt.searchPseudoElements&&kE(i)}}},xE=!1,wne={mixout:function(){return{dom:{unwatch:function(){SL(),xE=!0}}}},hooks:function(){return{bootstrap:function(){vE(u1("mutationObserverCallbacks",{}))},noAuto:function(){rne()},watch:function(n){var r=n.observeMutationsRoot;xE?p1():vE(u1("mutationObserverCallbacks",{observeMutationsRoot:r}))}}}},SE=function(e){var n={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return e.toLowerCase().split(" ").reduce(function(r,i){var o=i.toLowerCase().split("-"),s=o[0],l=o.slice(1).join("-");if(s&&l==="h")return r.flipX=!0,r;if(s&&l==="v")return r.flipY=!0,r;if(l=parseFloat(l),isNaN(l))return r;switch(s){case"grow":r.size=r.size+l;break;case"shrink":r.size=r.size-l;break;case"left":r.x=r.x-l;break;case"right":r.x=r.x+l;break;case"up":r.y=r.y-l;break;case"down":r.y=r.y+l;break;case"rotate":r.rotate=r.rotate+l;break}return r},n)},kne={mixout:function(){return{parse:{transform:function(n){return SE(n)}}}},hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-transform");return i&&(n.transform=SE(i)),n}}},provides:function(e){e.generateAbstractTransformGrouping=function(n){var r=n.main,i=n.transform,o=n.containerWidth,s=n.iconWidth,l={transform:"translate(".concat(o/2," 256)")},u="translate(".concat(i.x*32,", ").concat(i.y*32,") "),f="scale(".concat(i.size/16*(i.flipX?-1:1),", ").concat(i.size/16*(i.flipY?-1:1),") "),d="rotate(".concat(i.rotate," 0 0)"),m={transform:"".concat(u," ").concat(f," ").concat(d)},v={transform:"translate(".concat(s/2*-1," -256)")},y={outer:l,inner:m,path:v};return{tag:"g",attributes:Ue({},y.outer),children:[{tag:"g",attributes:Ue({},y.inner),children:[{tag:r.icon.tag,children:r.icon.children,attributes:Ue(Ue({},r.icon.attributes),y.path)}]}]}}}},u0={x:0,y:0,width:"100%",height:"100%"};function CE(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t.attributes&&(t.attributes.fill||e)&&(t.attributes.fill="black"),t}function xne(t){return t.tag==="g"?t.children:[t]}var Sne={hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-mask"),o=i?av(i.split(" ").map(function(s){return s.trim()})):Bw();return o.prefix||(o.prefix=aa()),n.mask=o,n.maskId=r.getAttribute("data-fa-mask-id"),n}}},provides:function(e){e.generateAbstractMask=function(n){var r=n.children,i=n.attributes,o=n.main,s=n.mask,l=n.maskId,u=n.transform,f=o.width,d=o.icon,m=s.width,v=s.icon,y=kte({transform:u,containerWidth:m,iconWidth:f}),_={tag:"rect",attributes:Ue(Ue({},u0),{},{fill:"white"})},C=d.children?{children:d.children.map(CE)}:{},x={tag:"g",attributes:Ue({},y.inner),children:[CE(Ue({tag:d.tag,attributes:Ue(Ue({},d.attributes),y.path)},C))]},k={tag:"g",attributes:Ue({},y.outer),children:[x]},A="mask-".concat(l||bd()),L="clip-".concat(l||bd()),E={tag:"mask",attributes:Ue(Ue({},u0),{},{id:A,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[_,k]},H={tag:"defs",children:[{tag:"clipPath",attributes:{id:L},children:xne(v)},E]};return r.push(H,{tag:"rect",attributes:Ue({fill:"currentColor","clip-path":"url(#".concat(L,")"),mask:"url(#".concat(A,")")},u0)}),{children:r,attributes:i}}}},Cne={provides:function(e){var n=!1;sa.matchMedia&&(n=sa.matchMedia("(prefers-reduced-motion: reduce)").matches),e.missingIconAbstract=function(){var r=[],i={fill:"currentColor"},o={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};r.push({tag:"path",attributes:Ue(Ue({},i),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});var s=Ue(Ue({},o),{},{attributeName:"opacity"}),l={tag:"circle",attributes:Ue(Ue({},i),{},{cx:"256",cy:"364",r:"28"}),children:[]};return n||l.children.push({tag:"animate",attributes:Ue(Ue({},o),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:Ue(Ue({},s),{},{values:"1;0;1;1;0;1;"})}),r.push(l),r.push({tag:"path",attributes:Ue(Ue({},i),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:n?[]:[{tag:"animate",attributes:Ue(Ue({},s),{},{values:"1;0;0;0;0;1;"})}]}),n||r.push({tag:"path",attributes:Ue(Ue({},i),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:Ue(Ue({},s),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:r}}}},Tne={hooks:function(){return{parseNodeAttributes:function(n,r){var i=r.getAttribute("data-fa-symbol"),o=i===null?!1:i===""?!0:i;return n.symbol=o,n}}}},Ene=[Cte,dne,hne,pne,mne,_ne,wne,kne,Sne,Cne,Tne];Hte(Ene,{mixoutsTo:ui});ui.noAuto;ui.config;var Ane=ui.library;ui.dom;var m1=ui.parse;ui.findIconDefinition;ui.toHtml;var One=ui.icon;ui.layer;ui.text;ui.counter;function TE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ho(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function Nne(t,e){if(t==null)return{};var n=Mne(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}var Lne=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},TL={exports:{}};(function(t){(function(e){var n=function(k,A,L){if(!f(A)||m(A)||v(A)||y(A)||u(A))return A;var E,H=0,I=0;if(d(A))for(E=[],I=A.length;H1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof t=="string")return t;var r=(t.children||[]).map(function(u){return EL(u)}),i=Object.keys(t.attributes||{}).reduce(function(u,f){var d=t.attributes[f];switch(f){case"class":u.class=Rne(d);break;case"style":u.style=Dne(d);break;default:u.attrs[f]=d}return u},{attrs:{},class:{},style:{}});n.class;var o=n.style,s=o===void 0?{}:o,l=Nne(n,Pne);return mr(t.tag,Ho(Ho(Ho({},e),{},{class:i.class,style:Ho(Ho({},i.style),s)},i.attrs),l),r)}var AL=!1;try{AL=!0}catch{}function zne(){if(!AL&&console&&typeof console.error=="function"){var t;(t=console).error.apply(t,arguments)}}function c0(t,e){return Array.isArray(e)&&e.length>0||!Array.isArray(e)&&e?Dr({},t,e):{}}function Bne(t){var e,n=(e={"fa-spin":t.spin,"fa-pulse":t.pulse,"fa-fw":t.fixedWidth,"fa-border":t.border,"fa-li":t.listItem,"fa-inverse":t.inverse,"fa-flip":t.flip===!0,"fa-flip-horizontal":t.flip==="horizontal"||t.flip==="both","fa-flip-vertical":t.flip==="vertical"||t.flip==="both"},Dr(e,"fa-".concat(t.size),t.size!==null),Dr(e,"fa-rotate-".concat(t.rotation),t.rotation!==null),Dr(e,"fa-pull-".concat(t.pull),t.pull!==null),Dr(e,"fa-swap-opacity",t.swapOpacity),Dr(e,"fa-bounce",t.bounce),Dr(e,"fa-shake",t.shake),Dr(e,"fa-beat",t.beat),Dr(e,"fa-fade",t.fade),Dr(e,"fa-beat-fade",t.beatFade),Dr(e,"fa-flash",t.flash),Dr(e,"fa-spin-pulse",t.spinPulse),Dr(e,"fa-spin-reverse",t.spinReverse),e);return Object.keys(n).map(function(r){return n[r]?r:null}).filter(function(r){return r})}function EE(t){if(t&&tg(t)==="object"&&t.prefix&&t.iconName&&t.icon)return t;if(m1.icon)return m1.icon(t);if(t===null)return null;if(tg(t)==="object"&&t.prefix&&t.iconName)return t;if(Array.isArray(t)&&t.length===2)return{prefix:t[0],iconName:t[1]};if(typeof t=="string")return{prefix:"fas",iconName:t}}var $ne=Vn({name:"FontAwesomeIcon",props:{border:{type:Boolean,default:!1},fixedWidth:{type:Boolean,default:!1},flip:{type:[Boolean,String],default:!1,validator:function(e){return[!0,!1,"horizontal","vertical","both"].indexOf(e)>-1}},icon:{type:[Object,Array,String],required:!0},mask:{type:[Object,Array,String],default:null},listItem:{type:Boolean,default:!1},pull:{type:String,default:null,validator:function(e){return["right","left"].indexOf(e)>-1}},pulse:{type:Boolean,default:!1},rotation:{type:[String,Number],default:null,validator:function(e){return[90,180,270].indexOf(Number.parseInt(e,10))>-1}},swapOpacity:{type:Boolean,default:!1},size:{type:String,default:null,validator:function(e){return["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"].indexOf(e)>-1}},spin:{type:Boolean,default:!1},transform:{type:[String,Object],default:null},symbol:{type:[Boolean,String],default:!1},title:{type:String,default:null},inverse:{type:Boolean,default:!1},bounce:{type:Boolean,default:!1},shake:{type:Boolean,default:!1},beat:{type:Boolean,default:!1},fade:{type:Boolean,default:!1},beatFade:{type:Boolean,default:!1},flash:{type:Boolean,default:!1},spinPulse:{type:Boolean,default:!1},spinReverse:{type:Boolean,default:!1}},setup:function(e,n){var r=n.attrs,i=er(function(){return EE(e.icon)}),o=er(function(){return c0("classes",Bne(e))}),s=er(function(){return c0("transform",typeof e.transform=="string"?m1.transform(e.transform):e.transform)}),l=er(function(){return c0("mask",EE(e.mask))}),u=er(function(){return One(i.value,Ho(Ho(Ho(Ho({},o.value),s.value),l.value),{},{symbol:e.symbol,title:e.title}))});En(u,function(d){if(!d)return zne("Could not find one or more icon(s)",i.value,l.value)},{immediate:!0});var f=er(function(){return u.value?EL(u.value.abstract[0],{},r):null});return function(){return f.value}}}),Hne={prefix:"fas",iconName:"align-justify",icon:[448,512,[],"f039","M448 64c0-17.7-14.3-32-32-32H32C14.3 32 0 46.3 0 64S14.3 96 32 96H416c17.7 0 32-14.3 32-32zm0 256c0-17.7-14.3-32-32-32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32zM0 192c0 17.7 14.3 32 32 32H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H32c-17.7 0-32 14.3-32 32zM448 448c0-17.7-14.3-32-32-32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32z"]},Fne={prefix:"fas",iconName:"highlighter",icon:[576,512,[],"f591","M315 315l158.4-215L444.1 70.6 229 229 315 315zm-187 5l0 0V248.3c0-15.3 7.2-29.6 19.5-38.6L420.6 8.4C428 2.9 437 0 446.2 0c11.4 0 22.4 4.5 30.5 12.6l54.8 54.8c8.1 8.1 12.6 19 12.6 30.5c0 9.2-2.9 18.2-8.4 25.6L334.4 396.5c-9 12.3-23.4 19.5-38.6 19.5H224l-25.4 25.4c-12.5 12.5-32.8 12.5-45.3 0l-50.7-50.7c-12.5-12.5-12.5-32.8 0-45.3L128 320zM7 466.3l63-63 70.6 70.6-31 31c-4.5 4.5-10.6 7-17 7H24c-13.3 0-24-10.7-24-24v-4.7c0-6.4 2.5-12.5 7-17z"]},Vne={prefix:"fas",iconName:"image",icon:[512,512,[],"f03e","M0 96C0 60.7 28.7 32 64 32H448c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zM323.8 202.5c-4.5-6.6-11.9-10.5-19.8-10.5s-15.4 3.9-19.8 10.5l-87 127.6L170.7 297c-4.6-5.7-11.5-9-18.7-9s-14.2 3.3-18.7 9l-64 80c-5.8 7.2-6.9 17.1-2.9 25.4s12.4 13.6 21.6 13.6h96 32H424c8.9 0 17.1-4.9 21.2-12.8s3.6-17.4-1.4-24.7l-120-176zM112 192a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"]},jne={prefix:"fas",iconName:"align-left",icon:[448,512,[],"f036","M288 64c0 17.7-14.3 32-32 32H32C14.3 96 0 81.7 0 64S14.3 32 32 32H256c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H256c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"]},Wne={prefix:"fas",iconName:"align-center",icon:[448,512,[],"f037","M352 64c0-17.7-14.3-32-32-32H128c-17.7 0-32 14.3-32 32s14.3 32 32 32H320c17.7 0 32-14.3 32-32zm96 128c0-17.7-14.3-32-32-32H32c-17.7 0-32 14.3-32 32s14.3 32 32 32H416c17.7 0 32-14.3 32-32zM0 448c0 17.7 14.3 32 32 32H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H32c-17.7 0-32 14.3-32 32zM352 320c0-17.7-14.3-32-32-32H128c-17.7 0-32 14.3-32 32s14.3 32 32 32H320c17.7 0 32-14.3 32-32z"]},Une={prefix:"fas",iconName:"paragraph",icon:[448,512,[182],"f1dd","M192 32h64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H384l0 352c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-352H288V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V352H192c-88.4 0-160-71.6-160-160s71.6-160 160-160z"]},qne={prefix:"fas",iconName:"align-right",icon:[448,512,[],"f038","M448 64c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32zm0 256c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32zM0 192c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 448c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"]};Ane.add(Une,Fne,jne,qne,Wne,Hne,Vne);const Kne={name:"SvgIcon",components:{FontAwesomeIcon:$ne},props:{content:{type:Object,default:()=>{}}},data(){return{defaultSvgs:{bold:'',underline:'',italic:'',strikethrough:'',link:'',unlink:'',"file-code":'',"page-break":'',"remove-format":'',"quote-right":'',"list-ul":'',"list-ol":'',h1:'',h2:'',h3:'',h4:'',h5:'',h6:'',"horizontal-rule":'',code:'',"brackets-curly":'',undo:'',redo:'',subscript:'',superscript:'',table:'',"rectangle-code":'',"photo-film":'',text:''}}},computed:{getSvg(){return this.content.svg&&this.content.svg.startsWith("0&&this.selectedIndex--},moveSelectionDown(){this.selectedIndex=0&&Math.floor(this.selectedIndex/Math.ceil(this.items.length/3))>0){const e=this.selectedIndex-Math.ceil(this.items.length/3);this.selectedIndex=e}},moveSelectionRight(){if(this.selectedIndex>=0&&Math.floor(this.selectedIndex/Math.ceil(this.items.length/3))<2){const e=this.selectedIndex+Math.ceil(this.items.length/3);e=0,n={Mod:e?"⌘":"Ctrl",Alt:e?"⌥":"Alt",Shift:e?"⇧":"Shift",Ctrl:e?"⌃":"Ctrl"};return t.split("-").map(r=>n[r]||r)}}},Xne={key:0,class:"vui-command-items",style:{"max-height":"216px"}},Zne={class:"vui-command-items-wrap"},Qne=["onClick"],ere={class:"vui-command-item-label"},tre={class:"vui-command-info",style:{"min-height":"32px"}},nre={class:"vui-command-info-left"},rre={class:"vui-command-info-shortcut"},ire={key:0,class:"vui-command-info-shortcut-label"},ore={key:1,class:"vui-command-items-empty"};function sre(t,e,n,r,i,o){const s=ut("svg-icon");return n.items.length?(ge(),Se("div",Xne,[re("div",Zne,[(ge(!0),Se(kt,null,Zt(o.columns,(l,u)=>(ge(),Se("div",{key:u,class:"vui-command-column"},[(ge(!0),Se(kt,null,Zt(l,(f,d)=>(ge(),Se("button",{key:d,class:vt(["vui-command-item",{"is-selected":i.selectedIndex===o.getItemIndex(d,u)}]),onClick:m=>o.selectItem(o.getItemIndex(d,u))},[Qe(s,{content:f,class:"vui-command-item-icon"},null,8,["content"]),re("span",ere,Le(f.title),1)],10,Qne))),128))]))),128))]),re("div",tre,[re("div",nre,[re("div",rre,[o.shortcutInfo.label?(ge(),Se("div",ire,Le(o.shortcutInfo.label),1)):gt("",!0),(ge(!0),Se(kt,null,Zt(o.shortcutInfo.icons,(l,u)=>(ge(),Se("div",{key:u,class:"vui-command-info-shortcut-img"},Le(l),1))),128))])])])])):(ge(),Se("div",ore,Le(t.t("vizy","No items found.")),1))}const are=Bt(Jne,[["render",sre]]),lre={items:t=>{const{vizyField:e}=t.editor,n=e.settings,r=Craft.Vizy.Config.getCommands();let i=[],o=["h1","h2","h3","unordered-list","ordered-list","media-embed","link","image","code-block","blockquote","hr"];n.vizyConfig.commands&&(o=n.vizyConfig.commands),o.forEach(l=>{const u=r.find(f=>f.name===l);u&&i.push(u)});let s=["paragraph","code-block","blockquote","h1","h2","h3","h4","h5","h6"];return n.vizyConfig.formatting&&n.vizyConfig.formatting.length&&(s=n.vizyConfig.formatting),s=[...s,...e.buttons],i.forEach((l,u)=>{s.includes(l.name)||i.splice(u,1)}),e.richTextEnabled||(i=[]),n.blockGroups.forEach(l=>{l.blockTypes.forEach(u=>{i.push({name:u.handle,svg:u.icon.svg,title:u.name,command:({editor:f,range:d})=>{const m=Xm("vizy-block-"),v={type:u.id},{fieldsHtml:y,footHtml:_}=u;f.vizyField.setCachedFieldHtml(m,y),f.vizyField.setCachedFieldJs(m,_),f.chain().focus().deleteRange(d).setVizyBlock({id:m,values:v}).run(),setTimeout(()=>{f.vizyField.$events.emit("vizy-blocks:addedBlock")},50)}})})}),i.filter(l=>l.title.toLowerCase().startsWith(t.query.toLowerCase()))},render:()=>{let t,e;return{onStart:n=>{t=new GN(are,{props:n,editor:n.editor}),n.clientRect&&(e=Kr("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"top-start",theme:"light-border vui-command-dropdown",maxWidth:"600px",duration:200}))},onUpdate(n){t.updateProps(n),n.clientRect&&e[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(n){var r;return n.event.key==="Escape"?(e[0].hide(),!0):(r=t.ref)==null?void 0:r.onKeyDown(n)},onExit(){e[0].destroy(),t.destroy()}}}},ure=t=>{const e=[],n={},r=[];return Object.entries(t.settings.vizyConfig).forEach(([i,o])=>{(i==="buttons"||i==="formatting")&&o.forEach(s=>{vr(s)&&(Array.isArray(n[s.type])||(n[s.type]=[]),Object.keys(s.attrs).forEach(l=>{n[s.type].includes(l)||n[s.type].push(l)}),s.editorStyle&&e.push(s))})}),e.forEach(i=>{const o=Gj(`${i.type} ${i.title}`);if(!document.querySelector(`style#${o}`)){const s=document.createElement("style");s.id=o,s.innerHTML=`.vui-editor ${i.editorStyle}`,document.head.appendChild(s)}}),Object.entries(n).forEach(([i,o])=>{const s={};o.forEach(l=>{s[l]={default:null}}),r.push(ir.create({name:`${i}CustomAttributes`,addGlobalAttributes(){return[{types:[i],attributes:s}]}}))}),r},cre={name:"MenuBarItem",components:{SvgIcon:hc},props:{field:{type:Object,default:null},editor:{type:Object,default:null},icon:{type:String,default:null},svg:{type:String,default:null},name:{type:String,default:null},title:{type:String,default:null},action:{type:Function,default:()=>{}},isActive:{type:Function,default:()=>{}},options:{type:Array,default:()=>[]}},data(){return{tippy:null}},computed:{active(){return this.isActive&&this.isActive(this.editor)}},mounted(){this.$nextTick(()=>{if(this.hasDropdown){const t=this.$el.querySelector(`.vui-toolbar-dropdown-${this.name}`),e=this.$el;t&&e&&(t.style.display="block",this.tippy=Kr(e,{content:t,trigger:"click",allowHTML:!0,arrow:!1,interactive:!0,placement:"bottom-start",theme:"light-border toolbar-dropdown",duration:200,zIndex:1e3,hideOnClick:!0,offset:[0,1],onShown(n){n.popper.querySelector("button").focus()}}))}}),this._keyListener=function(t){t.key==="Escape"&&(t.preventDefault(),this.closeDropdown())},document.addEventListener("keydown",this._keyListener.bind(this))},beforeUnmount(){document.removeEventListener("keydown",this._keyListener)},methods:{hasDropdown(){return!!(this.options&&this.options.length)},optionActive(t){return t.isActive&&t.isActive(this.editor)},runAction(t){this.tippy&&this.tippy.hide(),t&&t(this.editor)},onMouseDown(t){t.preventDefault()},closeDropdown(){this.tippy&&this.tippy.hide()}}},fre={class:"vui-toolbar-dropdown-wrap"},dre=["onClick"];function hre(t,e,n,r,i,o){const s=ut("svg-icon"),l=sc("tooltip");return Ut((ge(),Se("button",{class:vt(["btn vui-toolbar-btn",{active:o.active}]),onClick:e[0]||(e[0]=lt(u=>o.runAction(n.action),["prevent"])),onMousedown:e[1]||(e[1]=(...u)=>o.onMouseDown&&o.onMouseDown(...u))},[Qe(s,{content:{icon:n.icon,svg:n.svg}},null,8,["content"]),o.hasDropdown()?(ge(),Se("div",{key:0,class:vt(["vui-toolbar-dropdown-container","vui-toolbar-dropdown-"+n.name]),style:{display:"none"}},[re("div",fre,[(ge(!0),Se(kt,null,Zt(n.options,(u,f)=>(ge(),Se("button",{key:f,class:vt(["vui-toolbar-dropdown",["vui-toolbar-dropdown-item-"+u.name,{active:o.optionActive(u)}]]),onClick:lt(d=>o.runAction(u.action),["prevent"])},Le(u.title),11,dre))),128))])],2)):gt("",!0)],34)),[[l,{content:n.title,theme:"vui-tooltip"}]])}const pre=Bt(cre,[["render",hre]]),OL=(t,e)=>{if(!t||!e)return;const n=t.parent.childAfter(t.parentOffset);if(!n.node)return;const r=n.node.marks.find(u=>u.type===e);if(!r)return;let i=t.index(),o=t.start()+n.offset,s=i+1,l=o+n.node.nodeSize;for(;i>0&&r.isInSet(t.parent.child(i-1).marks);)i-=1,o-=t.parent.child(i).nodeSize;for(;s{this.$nextTick().then(()=>{const t=this.$el.querySelector('input[type="text"]');t&&t.focus()})},50)}}},gre={class:"vui-modal-header"},vre={class:"vui-modal-body"},yre={class:"vui-modal-footer footer"},bre=re("div",{class:"spinner hidden"},null,-1),_re={class:"buttons right"},wre=["onClick"],kre=["onClick"];function xre(t,e,n,r,i,o){const s=ut("vue-final-modal");return ge(),Ct(s,wi({class:"vui-modal-wrap"},t.$attrs,{classes:"vui-modal-container","content-class":"vui-modal-content","overlay-class":"vui-modal-overlay",attach:"body","lock-scroll":!1,"esc-to-close":!0,"click-to-close":!0,"focus-trap":!0,onOpened:o.opened,onClickOutside:e[1]||(e[1]=l=>t.$emit("cancel")),onCancel:e[2]||(e[2]=l=>t.$emit("cancel"))}),{default:Vt(({params:l,close:u})=>[re("div",gre,[pn(t.$slots,"title"),re("div",{class:"vui-modal-close",onClick:e[0]||(e[0]=lt(f=>t.$emit("update:modelValue",!1),["prevent"]))})]),re("div",vre,[pn(t.$slots,"default",{params:l})]),re("div",yre,[bre,re("div",_re,[re("div",{role:"button",class:"btn",tabindex:"0",onClick:lt(f=>t.$emit("cancel",u),["prevent"])},Le(t.t("vizy",n.cancelButton)),9,wre),re("div",{role:"button",class:"btn submit",onClick:lt(f=>t.$emit("confirm",u),["prevent"])},Le(t.t("vizy",n.confirmButton)),9,kre)])])]),_:3},16,["onOpened"])}const uv=Bt(mre,[["render",xre]]),Sre={name:"LinkMenuModal",components:{MenuBarModal:uv},props:{field:{type:Object,default:null},editor:{type:Object,default:null},show:{type:Boolean,default:!1},modelValue:{type:Object,default:()=>globalThis.proxyValue}},emits:["update:modelValue","close"],data(){return{targetId:`target-${Craft.randomString(10)}`,proxyShow:!1,proxyValue:{url:null,text:null,target:null,class:null,title:null},errors:[],advancedPane:!1}},computed:{elementSiteId(){return this.field.settings.elementSiteId},newWindow:{get(){return this.modelValue.target==="_blank"},set(t){this.modelValue.target=t?"_blank":""}}},watch:{show(t){this.proxyShow=t},proxyShow(t){t===!1&&this.$emit("close")},proxyValue(t){this.$emit("update:modelValue",t)}},methods:{cancelModal(){this.proxyShow=!1},toggleAdvanced(){this.advancedPane=!this.advancedPane},confirmModal(){if(this.errors=[],!this.modelValue.url){this.errors.push("url");return}const t={href:this.modelValue.url,target:this.modelValue.target?"_blank":"",class:this.modelValue.class,title:this.modelValue.title},{selection:e}=this.editor.state.tr,n=e.$cursor?e.$cursor.pos:e.from;this.editor.chain().focus().command(({commands:r,tr:i,state:o,dispatch:s})=>{let l=OL(o.doc.resolve(i.selection.anchor),o.schema.marks.link);if(l||(l={from:i.selection.from,to:i.selection.to}),this.modelValue.text){const u=this.modelValue.text.toString();i.insertText(u,l.from,l.to);const f=i.doc.resolve(l.from),d=i.doc.resolve(l.from+u.length);i.setSelection(new st(f,d))}}).setLink(t).command(({commands:r,tr:i,state:o,dispatch:s})=>{n&&i.setSelection(st.create(i.doc,n))}).run(),this.proxyShow=!1}}},Cre={class:"heading"},Tre={id:"url-label",class:"required",for:"url"},Ere={key:0,class:"errors"},Are={id:"text-field",class:"field"},Ore={class:"heading"},Mre={id:"text-label",for:"text"},Nre={class:"input ltr"},Lre={id:"target-field",class:"checkboxfield field"},Ire={class:"input ltr"},Pre=["id"],Dre=["for"],Rre={id:"title-field",class:"field"},zre={class:"heading"},Bre={id:"title-label",for:"title"},$re={class:"input ltr"},Hre={id:"classes-field",class:"field"},Fre={class:"heading"},Vre={id:"classes-label",for:"classes"},jre={class:"input ltr"};function Wre(t,e,n,r,i,o){const s=ut("menu-bar-modal");return ge(),Ct(s,{modelValue:i.proxyShow,"onUpdate:modelValue":e[6]||(e[6]=l=>i.proxyShow=l),"confirm-button":t.$attrs["confirm-button"],onConfirm:o.confirmModal,onCancel:o.cancelModal},{title:Vt(()=>[Ui(Le(t.t("vizy",t.$attrs["modal-title"])),1)]),default:Vt(()=>[re("div",{id:"url-field",class:vt(["field",{"has-errors":i.errors.includes("url")}])},[re("div",Cre,[re("label",Tre,Le(t.t("vizy","URL")),1)]),re("div",{class:vt(["input ltr",{errors:i.errors.includes("url")}])},[Ut(re("input",{id:"url","onUpdate:modelValue":e[0]||(e[0]=l=>n.modelValue.url=l),type:"text",class:"text fullwidth",autofocus:"",autocomplete:"off",required:""},null,512),[[Mn,n.modelValue.url]])],2),i.errors.includes("url")?(ge(),Se("ul",Ere,[re("li",null,Le(t.t("vizy","URL cannot be blank.")),1)])):gt("",!0)],2),re("div",Are,[re("div",Ore,[re("label",Mre,Le(t.t("vizy","Text")),1)]),re("div",Nre,[Ut(re("input",{id:"text","onUpdate:modelValue":e[1]||(e[1]=l=>n.modelValue.text=l),type:"text",class:"text fullwidth",autofocus:"",autocomplete:"off"},null,512),[[Mn,n.modelValue.text]])])]),re("div",Lre,[re("div",Ire,[Ut(re("input",{id:i.targetId,"onUpdate:modelValue":e[2]||(e[2]=l=>o.newWindow=l),type:"checkbox",class:"checkbox"},null,8,Pre),[[xd,o.newWindow]]),re("label",{for:i.targetId},Le(t.t("vizy","Open link in new tab")),9,Dre)])]),re("a",{class:vt(["fieldtoggle",{expanded:i.advancedPane}]),"data-target":"advanced",onClick:e[3]||(e[3]=lt((...l)=>o.toggleAdvanced&&o.toggleAdvanced(...l),["prevent"]))},Le(t.t("app","Advanced")),3),re("div",{class:vt({hidden:!i.advancedPane})},[re("div",Rre,[re("div",zre,[re("label",Bre,Le(t.t("vizy","Title")),1)]),re("div",$re,[Ut(re("input",{id:"title","onUpdate:modelValue":e[4]||(e[4]=l=>n.modelValue.title=l),type:"text",class:"text fullwidth",autofocus:"",autocomplete:"off"},null,512),[[Mn,n.modelValue.title]])])]),re("div",Hre,[re("div",Fre,[re("label",Vre,Le(t.t("vizy","Classes")),1)]),re("div",jre,[Ut(re("input",{id:"classes","onUpdate:modelValue":e[5]||(e[5]=l=>n.modelValue.class=l),type:"text",class:"text fullwidth",autofocus:"",autocomplete:"off"},null,512),[[Mn,n.modelValue.class]])])])],2)]),_:1},8,["modelValue","confirm-button","onConfirm","onCancel"])}const ML=Bt(Sre,[["render",Wre]]),Ure={name:"LinkMenuBubble",components:{LinkMenuModal:ML},props:{field:{type:Object,default:null},editor:{type:Object,default:null}},data(){return{tippy:null,showEditModal:!1,model:{url:null,text:null,target:null,class:null,title:null}}},watch:{editor:{immediate:!0,handler(t){t&&this.$nextTick(()=>{t.on("vui:link-clicked",this.renderBubble)})}}},methods:{renderBubble(){const{doc:t,selection:e,schema:n}=this.editor.view.state,r=OL(t.resolve(e.anchor),n.marks.link);if(r){const i=this.editor.view.docView.domFromPos(r.from).node;if(i){this.$el.style.display="block";const o=this.editor.getAttributes("link");this.model.text=i.textContent,this.model.url=o.href,this.model.target=o.target,this.model.class=o.class,this.model.title=o.title,this.tippy=Kr(i.parentNode,{content:this.$el,showOnCreate:!0,trigger:"manual",allowHTML:!0,arrow:!0,interactive:!0,placement:"top",theme:"vui-menu-bubble",hideOnClick:!0,duration:200,zIndex:1e3,appendTo:()=>document.body})}}},destroyBubble(){this.tippy&&(this.tippy.destroy(),this.tippy=null)},truncate(t,e){return t&&t.length>e?`${t.substr(0,e-1)}…`:t},edit(){this.showEditModal=!0,this.destroyBubble(),this.editor.chain().blur().run()},closeModal(){this.showEditModal=!1},unlink(){this.editor.chain().focus().unsetLink().run(),this.destroyBubble()}}},qre={class:"vui-link-menu-bubble",style:{display:"none"}},Kre=["href","innerHTML"];function Gre(t,e,n,r,i,o){const s=ut("link-menu-modal");return ge(),Se("div",qre,[re("a",{href:i.model.url,target:"_blank",innerHTML:o.truncate(i.model.url,30)},null,8,Kre),re("a",{href:"#",onClick:e[0]||(e[0]=lt((...l)=>o.edit&&o.edit(...l),["prevent"]))},Le(t.t("vizy","Edit")),1),re("a",{href:"#",onClick:e[1]||(e[1]=lt((...l)=>o.unlink&&o.unlink(...l),["prevent"]))},Le(t.t("vizy","Unlink")),1),Qe(s,{modelValue:i.model,"onUpdate:modelValue":e[2]||(e[2]=l=>i.model=l),show:i.showEditModal,editor:n.editor,field:n.field,"confirm-button":"Update","modal-title":"Edit Link",onClose:o.closeModal},null,8,["modelValue","show","editor","field","onClose"])])}const Yre=Bt(Ure,[["render",Gre]]),Jre={name:"MenuBarItem",components:{SvgIcon:hc,LinkMenuModal:ML,LinkMenuBubble:Yre},props:{field:{type:Object,default:null},editor:{type:Object,default:null},icon:{type:String,default:null},svg:{type:String,default:null},title:{type:String,default:null},isActive:{type:Function,default:()=>{}}},data(){return{tippy:null,showEditModal:!1,model:{}}},computed:{active(){return this.isActive&&this.isActive(this.editor)},linkOptions(){return this.field.settings.linkOptions}},created(){this.resetModel(),this.editor.on("vui:link-modal-open",()=>{this.openNewModal()})},mounted(){this.$nextTick(()=>{const t=this.$el.querySelector(".vui-toolbar-dropdown-link"),e=this.$el;t&&e&&(t.style.display="block",this.tippy=Kr(e,{content:t,trigger:"click",allowHTML:!0,arrow:!1,interactive:!0,placement:"bottom-start",theme:"light-border toolbar-dropdown",duration:200,zIndex:1e3,hideOnClick:!0,offset:[0,1],onShown(n){n.popper.querySelector("button").focus()}}))}),this._keyListener=function(t){t.key==="Escape"&&(t.preventDefault(),this.closeDropdown()),this.editor.vizyField.isFocused()&&t.key==="k"&&(t.ctrlKey||t.metaKey)&&(t.preventDefault(),this.openNewModal())},document.addEventListener("keydown",this._keyListener.bind(this))},beforeUnmount(){document.removeEventListener("keydown",this._keyListener)},methods:{resetModel(){this.model={url:null,text:null,target:null,class:null,title:null}},openNewModal(){this.tippy.hide(),this.resetModel();const t=this.getSelectedText();t&&(this.model.text=t),this.showEditModal=!0},openEditModal(){this.tippy.hide();const{from:t,to:e}=this.editor.view.state.selection,n=this.editor.view.docView.domFromPos(t).node,r=this.editor.getAttributes("link");this.model.text=n.textContent,this.model.url=r.href,this.model.target=r.target,this.model.class=r.class,this.model.title=r.title,this.showEditModal=!0},closeModal(){this.showEditModal=!1},openElementModal(t){this.tippy.hide(),this.resetModel(),Craft.createElementSelectorModal(t.elementType,{storageKey:`VizyInput.LinkTo.${t.elementType}`,sources:t.sources,criteria:t.criteria,defaultSiteId:this.elementSiteId,autoFocusSearchBox:!1,onSelect:$.proxy(e=>{if(e.length){const[n]=e;this.model.url=`${n.url}#${t.refHandle}:${n.id}@${n.siteId}`,this.model.text=this.getSelectedText()||n.label,this.tippy.hide(),this.showEditModal=!0}},this),closeOtherModals:!1})},getSelectedText(){const{from:t,to:e}=this.editor.state.selection,n=this.editor.state.doc.textBetween(t,e," ");return n||!1},unlinkAction(){this.tippy&&this.tippy.hide(),this.editor.chain().focus().unsetLink().run()},onMouseDown(t){t.preventDefault()},closeDropdown(){this.tippy&&this.tippy.hide()}}},Xre={class:"vui-toolbar-dropdown-container vui-toolbar-dropdown-link",style:{display:"none"}},Zre={key:0},Qre=["onClick"],eie={key:1};function tie(t,e,n,r,i,o){const s=ut("svg-icon"),l=ut("link-menu-bubble"),u=ut("link-menu-modal"),f=sc("tooltip");return ge(),Se("div",null,[Ut((ge(),Se("button",{class:vt(["btn vui-toolbar-btn",{active:o.active}]),onClick:lt(()=>{},["prevent"]),onMousedown:e[0]||(e[0]=(...d)=>o.onMouseDown&&o.onMouseDown(...d))},[Qe(s,{content:{icon:n.icon,svg:n.svg}},null,8,["content"])],34)),[[f,{content:n.title,theme:"vui-tooltip"}]]),re("div",Xre,[o.active?(ge(),Se("div",eie,[re("button",{class:"vui-toolbar-dropdown vui-toolbar-dropdown-item-link",onClick:e[2]||(e[2]=lt((...d)=>o.openEditModal&&o.openEditModal(...d),["prevent"]))},Le(t.t("vizy","Edit Link")),1)])):(ge(),Se("div",Zre,[(ge(!0),Se(kt,null,Zt(o.linkOptions,(d,m)=>(ge(),Se("button",{key:m,class:vt(["vui-toolbar-dropdown","vui-toolbar-dropdown-item-link-"+d.refHandle]),onClick:lt(v=>o.openElementModal(d),["prevent"])},Le(d.optionTitle),11,Qre))),128)),re("button",{class:"vui-toolbar-dropdown vui-toolbar-dropdown-item-link",onClick:e[1]||(e[1]=lt((...d)=>o.openNewModal&&o.openNewModal(...d),["prevent"]))},Le(t.t("vizy","Insert Link")),1)])),re("button",{class:"vui-toolbar-dropdown vui-toolbar-dropdown-item-unlink",onClick:e[3]||(e[3]=lt((...d)=>o.unlinkAction&&o.unlinkAction(...d),["prevent"]))},Le(t.t("vizy","Unlink")),1)]),Qe(l,{editor:n.editor,field:n.field},null,8,["editor","field"]),Qe(u,{modelValue:i.model,"onUpdate:modelValue":e[4]||(e[4]=d=>i.model=d),show:i.showEditModal,editor:n.editor,field:n.field,"confirm-button":"Insert","modal-title":"Insert Link",onClose:o.closeModal},null,8,["modelValue","show","editor","field","onClose"])])}const nie=Bt(Jre,[["render",tie]]),rie={name:"ImageMenuModal",components:{MenuBarModal:uv},props:{field:{type:Object,default:null},editor:{type:Object,default:null},show:{type:Boolean,default:!1},modelValue:{type:Object,default:()=>globalThis.proxyValue}},emits:["update:modelValue","close"],data(){return{targetId:`target-${Craft.randomString(10)}`,proxyShow:!1,proxyValue:{id:null,src:null,alt:null,title:null,url:null,target:null,transform:null},errors:[]}},computed:{elementSiteId(){return this.field.settings.elementSiteId},transforms(){return this.field.settings.transforms}},watch:{show(t){this.proxyShow=t},proxyShow(t){t===!1&&this.$emit("close")},proxyValue(t){this.$emit("update:modelValue",t)}},methods:{_buildAssetUrl:(t,e,n)=>`${e}#asset:${t}:${n?`transform:${n}`:"url"}`,_removeTransformFromUrl:t=>t.replace(/(.*)(_[a-z0-9+].*\/)(.*)/,"$1$3"),_getTransformUrl(t,e,n){const r={assetId:t,handle:e};Craft.sendActionRequest("POST","assets/generate-transform",{data:r}).then(i=>{n(i.data.url)}).catch(({response:i})=>{alert("There was an error generating the transform URL.")})},cancelModal(){this.proxyShow=!1},confirmModal(){this.errors=[];const t=this._removeTransformFromUrl(this.modelValue.src.split("#")[0]);this.modelValue.target=this.modelValue.target?"_blank":"",this.modelValue.transform?this._getTransformUrl(this.modelValue.id,this.modelValue.transform,e=>{this.modelValue.src=this._buildAssetUrl(this.modelValue.id,e,this.modelValue.transform),this.editor.chain().focus().setImage(this.modelValue).run()}):(this.modelValue.src=t,this.editor.chain().focus().setImage(this.modelValue).run()),this.proxyShow=!1}}},iie={class:"vui-modal-body-wrap"},oie={class:"vizy-modal-image-preview"},sie=["src"],aie={class:"vizy-modal-image-fields"},lie={id:"alt-field",class:"field"},uie={class:"heading"},cie={id:"alt-label",for:"alt"},fie={class:"input ltr"},die={id:"title-field",class:"field"},hie={class:"heading"},pie={id:"title-label",for:"title"},mie={class:"input ltr"},gie={id:"url-field",class:"field"},vie={class:"heading"},yie={id:"url-label",for:"url"},bie={class:"input ltr"},_ie={id:"target-field",class:"checkboxfield field"},wie={class:"input ltr"},kie=["id"],xie=["for"],Sie={id:"transform-field",class:"field first"},Cie={class:"heading"},Tie={id:"transform-label",for:"transform"},Eie={class:"input ltr"},Aie={class:"select"},Oie={value:""},Mie=["value"];function Nie(t,e,n,r,i,o){const s=ut("menu-bar-modal");return ge(),Ct(s,{modelValue:i.proxyShow,"onUpdate:modelValue":e[5]||(e[5]=l=>i.proxyShow=l),class:"vui-modal-image-edit","confirm-button":t.$attrs["confirm-button"],onConfirm:o.confirmModal,onCancel:o.cancelModal},{title:Vt(()=>[Ui(Le(t.t("vizy",t.$attrs["modal-title"])),1)]),default:Vt(()=>[re("div",iie,[re("div",oie,[re("img",{src:n.modelValue.src},null,8,sie)]),re("div",aie,[re("div",lie,[re("div",uie,[re("label",cie,Le(t.t("vizy","Alt Text")),1)]),re("div",fie,[Ut(re("input",{id:"alt","onUpdate:modelValue":e[0]||(e[0]=l=>n.modelValue.alt=l),type:"text",class:"text fullwidth",autofocus:"",autocomplete:"off"},null,512),[[Mn,n.modelValue.alt]])])]),re("div",die,[re("div",hie,[re("label",pie,Le(t.t("vizy","Title")),1)]),re("div",mie,[Ut(re("input",{id:"title","onUpdate:modelValue":e[1]||(e[1]=l=>n.modelValue.title=l),type:"text",class:"text fullwidth",autofocus:"",autocomplete:"off"},null,512),[[Mn,n.modelValue.title]])])]),re("div",gie,[re("div",vie,[re("label",yie,Le(t.t("vizy","URL")),1)]),re("div",bie,[Ut(re("input",{id:"url","onUpdate:modelValue":e[2]||(e[2]=l=>n.modelValue.url=l),type:"text",class:"text fullwidth",autofocus:"",autocomplete:"off"},null,512),[[Mn,n.modelValue.url]])])]),re("div",_ie,[re("div",wie,[Ut(re("input",{id:i.targetId,"onUpdate:modelValue":e[3]||(e[3]=l=>n.modelValue.target=l),type:"checkbox",class:"checkbox"},null,8,kie),[[xd,n.modelValue.target]]),re("label",{for:i.targetId},Le(t.t("vizy","Open link in new tab")),9,xie)])]),re("div",Sie,[re("div",Cie,[re("label",Tie,Le(t.t("vizy","Transform")),1)]),re("div",Eie,[re("div",Aie,[Ut(re("select",{id:"transform","onUpdate:modelValue":e[4]||(e[4]=l=>n.modelValue.transform=l)},[re("option",Oie,Le(t.t("vizy","No Transform")),1),(ge(!0),Se(kt,null,Zt(o.transforms,(l,u)=>(ge(),Se("option",{key:u,value:l.handle},Le(l.name),9,Mie))),128))],512),[[Z1,n.modelValue.transform]])])])])])])]),_:1},8,["modelValue","confirm-button","onConfirm","onCancel"])}const NL=Bt(rie,[["render",Nie]]),Lie=(t,e=!0)=>{if(!t)throw new Error('Invalid "node" parameter');const n=[];return t.descendants((r,i)=>{if(n.push({node:r,pos:i}),!e)return!1}),n},Iie=(t,e,n)=>{if(t){if(!e)throw new Error('Invalid "predicate" parameter')}else throw new Error('Invalid "node" parameter');return Lie(t,n).filter(r=>e(r.node))},Pie=(t,e,n)=>Iie(t,r=>r.type===e,n),Vw={name:"followCursor",defaultValue:!1,fn(t){const{reference:e}=t;return{onMount(){const n=t.props.mouseEvent,r=n.target?e.contains(n.target):!0,{clientX:i,clientY:o}=n,s=e.getBoundingClientRect(),l=i-s.left,u=o-s.top;(r||!t.props.interactive)&&t.setProps({getReferenceClientRect(){const f=e.getBoundingClientRect(),d=f.left+l,m=f.top+u;return{width:0,height:0,top:m,right:d,bottom:m,left:d}}})}}}},Die={name:"ImageMenuBubble",components:{ImageMenuModal:NL},props:{field:{type:Object,default:null},editor:{type:Object,default:null}},data(){return{tippy:null,showEditModal:!1,model:{id:null,src:null,alt:null,title:null,url:null,target:null,transform:null}}},watch:{editor:{immediate:!0,handler(t){t&&this.$nextTick(()=>{t.on("vui:image-clicked",this.renderBubble)})}}},methods:{renderBubble(t){const{view:e}=this.editor,n=this.editor.getAttributes("image");P_(n)&&(this.model=n,this.$el.style.display="block",this.destroyBubble(),this.tippy=Kr(e.dom,{content:this.$el,trigger:"manual",showOnCreate:!0,allowHTML:!0,arrow:!0,interactive:!0,placement:"top",followCursor:"initial",plugins:[Vw],theme:"vui-menu-bubble",duration:200,mouseEvent:t,zIndex:1e3,appendTo:()=>document.body}))},destroyBubble(){this.tippy&&(this.tippy.destroy(),this.tippy=null)},edit(){this.showEditModal=!0,this.editor.chain().blur().run()},closeModal(){this.showEditModal=!1},imageEditor(){if(this.model.id){const t={allowSavingAsNew:!1,onSave:this.reloadImage.bind(this),allowDegreeFractions:Craft.isImagick};new Craft.AssetImageEditor(this.model.id,t),this.destroyBubble()}},reloadImage(){Pie(this.editor.state.doc,this.editor.schema.nodes.image).forEach(e=>{if(!e.node.attrs.src)return;const n=e.node.attrs.src.match(/(.*)#asset:(\d+)(:transform:(.*))?/i);if(n&&n[2]==this.model.id)if(n[4]){const r={assetId:n[2],handle:n[4]};Craft.sendActionRequest("POST","assets/generate-transform",{data:r}).then(i=>{const o={src:`${i.data.url}?${new Date().getTime()}#asset:${n[2]}:transform:${n[4]}`};this.editor.view.dispatch(this.editor.state.tr.setNodeMarkup(e.pos,null,{...e.node.attrs,...o}))}).catch(({response:i})=>{alert("There was an error generating the transform URL.")})}else{const r={src:`${n[1]}?${new Date().getTime()}#asset:${n[2]}`};this.editor.view.dispatch(this.editor.state.tr.setNodeMarkup(e.pos,null,{...e.node.attrs,...r}))}})},unlink(){this.editor.chain().focus().deleteSelection().run(),this.destroyBubble()}}},Rie={class:"vui-image-menu-bubble",style:{display:"none"}};function zie(t,e,n,r,i,o){const s=ut("image-menu-modal");return ge(),Se("div",Rie,[re("a",{href:"#",onClick:e[0]||(e[0]=lt((...l)=>o.imageEditor&&o.imageEditor(...l),["prevent"]))},Le(t.t("vizy","Image Editor")),1),re("a",{href:"#",onClick:e[1]||(e[1]=lt((...l)=>o.edit&&o.edit(...l),["prevent"]))},Le(t.t("vizy","Edit")),1),re("a",{href:"#",onClick:e[2]||(e[2]=lt((...l)=>o.unlink&&o.unlink(...l),["prevent"]))},Le(t.t("vizy","Delete")),1),Qe(s,{modelValue:i.model,"onUpdate:modelValue":e[3]||(e[3]=l=>i.model=l),show:i.showEditModal,editor:n.editor,field:n.field,"confirm-button":"Update","modal-title":"Edit Image",onClose:o.closeModal},null,8,["modelValue","show","editor","field","onClose"])])}const Bie=Bt(Die,[["render",zie]]),$ie={name:"ImageMenuBarItem",components:{SvgIcon:hc,ImageMenuBubble:Bie,ImageMenuModal:NL},props:{field:{type:Object,default:null},editor:{type:Object,default:null},icon:{type:String,default:null},svg:{type:String,default:null},name:{type:String,default:null},title:{type:String,default:null},action:{type:Function,default:()=>{}},isActive:{type:Function,default:()=>{}}},data(){return{showEditModal:!1,model:{}}},computed:{active(){return this.isActive&&this.isActive(this.editor)},volumes(){return this.field.settings.volumes},transforms(){return this.field.settings.transforms},elementSiteId(){return this.field.settings.elementSiteId},defaultTransform(){return this.field.settings.defaultTransform},allowAllUploaders(){return this.field.settings.allowAllUploaders},defaultSource(){return this.field.settings.defaultSource}},created(){this.resetModel(),this.editor.on("vui:image-modal-open",()=>{this.runAction()})},mounted(){this._keyListener=function(t){t.key==="Escape"&&(t.preventDefault(),this.closeDropdown())},document.addEventListener("keydown",this._keyListener.bind(this))},beforeUnmount(){document.removeEventListener("keydown",this._keyListener)},methods:{_buildAssetUrl:(t,e,n)=>`${e}#asset:${t}:${n?`transform:${n}`:"url"}`,_isTransformUrl:t=>/(.*)(_[a-z0-9+].*\/)(.*)/.test(t),_getTransformUrl(t,e,n){const r={assetId:t,handle:e};Craft.sendActionRequest("POST","assets/generate-transform",{data:r}).then(i=>{n(i.data.url)}).catch(({response:i})=>{alert("There was an error generating the transform URL.")})},runAction(){const t={siteId:this.elementSiteId,kind:"image"};this.allowAllUploaders&&(t.uploaderId=null),this.assetSelectionModal=Craft.createElementSelectorModal("craft\\elements\\Asset",{storageKey:"VizyInput.ChooseImage",multiSelect:!0,sources:this.volumes,defaultSource:this.defaultSource??null,criteria:t,onSelect:function(e,n){if(e.length){const r={};e.length>1;const i=function(o,s){const l=o.pop(),u=this._isTransformUrl(l.url);u||!this.defaultTransform?(r[`asset${l.id}`]={id:l.id,src:this._buildAssetUrl(l.id,l.url,u?n:this.defaultTransform),alt:l.label,title:l.label,transform:u?n:this.defaultTransform},o.length?i(o,s):s()):this._getTransformUrl(l.id,this.defaultTransform,f=>{r[`asset${l.id}`]={id:l.id,src:this._buildAssetUrl(l.id,f,this.defaultTransform),alt:l.label,title:l.label,transform:this.defaultTransform},o.length?i(o,s):s()})}.bind(this);i(e,()=>{Object.keys(r).forEach(o=>{this.model={...this.model,...r[o]},this.showEditModal=!0})})}}.bind(this),transforms:this.transforms,closeOtherModals:!1})},resetModel(){this.model={id:null,src:null,alt:null,title:null,url:null,target:null,transform:this.defaultTransform}},closeModal(){this.showEditModal=!1},onMouseDown(t){t.preventDefault()},closeDropdown(){this.tippy&&this.tippy.hide()}}};function Hie(t,e,n,r,i,o){const s=ut("svg-icon"),l=ut("image-menu-bubble"),u=ut("image-menu-modal"),f=sc("tooltip");return ge(),Se("div",null,[Ut((ge(),Se("button",{class:vt(["btn vui-toolbar-btn",{active:o.active}]),onClick:e[0]||(e[0]=lt((...d)=>o.runAction&&o.runAction(...d),["prevent"])),onMousedown:e[1]||(e[1]=(...d)=>o.onMouseDown&&o.onMouseDown(...d))},[Qe(s,{content:{icon:n.icon,svg:n.svg}},null,8,["content"])],34)),[[f,{content:n.title,theme:"vui-tooltip"}]]),Qe(l,{editor:n.editor,field:n.field},null,8,["editor","field"]),Qe(u,{modelValue:i.model,"onUpdate:modelValue":e[2]||(e[2]=d=>i.model=d),show:i.showEditModal,editor:n.editor,field:n.field,"confirm-button":"Insert","modal-title":"Insert Image",onClose:o.closeModal},null,8,["modelValue","show","editor","field","onClose"])])}const Fie=Bt($ie,[["render",Hie]]),Vie={name:"IframeEmbedMenuModal",components:{MenuBarModal:uv},props:{field:{type:Object,default:null},editor:{type:Object,default:null},show:{type:Boolean,default:!1},modelValue:{type:Object,default:()=>globalThis.proxyValue}},emits:["update:modelValue","close"],data(){return{targetId:`target-${Craft.randomString(10)}`,proxyShow:!1,proxyValue:{url:null},errors:[]}},watch:{show(t){this.proxyShow=t},proxyShow(t){t===!1&&this.$emit("close")},proxyValue(t){this.$emit("update:modelValue",t)}},methods:{cancelModal(){this.proxyShow=!1},confirmModal(){if(this.errors=[],!this.modelValue.url){this.errors.push("url");return}this.editor.chain().focus().setIframe(this.modelValue).run(),this.proxyShow=!1}}},jie={class:"heading"},Wie={id:"url-label",class:"required",for:"url"},Uie={key:0,class:"errors"};function qie(t,e,n,r,i,o){const s=ut("menu-bar-modal");return ge(),Ct(s,{modelValue:i.proxyShow,"onUpdate:modelValue":e[1]||(e[1]=l=>i.proxyShow=l),class:"vui-modal-iframe-edit","confirm-button":t.$attrs["confirm-button"],onConfirm:o.confirmModal,onCancel:o.cancelModal},{title:Vt(()=>[Ui(Le(t.t("vizy",t.$attrs["modal-title"])),1)]),default:Vt(()=>[re("div",{id:"url-field",class:vt(["field",{"has-errors":i.errors.includes("url")}])},[re("div",jie,[re("label",Wie,Le(t.t("vizy","URL")),1)]),re("div",{class:vt(["input ltr",{errors:i.errors.includes("url")}])},[Ut(re("input",{id:"url","onUpdate:modelValue":e[0]||(e[0]=l=>n.modelValue.url=l),type:"text",class:"text fullwidth",autofocus:"",autocomplete:"off",required:""},null,512),[[Mn,n.modelValue.url]])],2),i.errors.includes("url")?(ge(),Se("ul",Uie,[re("li",null,Le(t.t("vizy","URL cannot be blank.")),1)])):gt("",!0)],2)]),_:1},8,["modelValue","confirm-button","onConfirm","onCancel"])}const LL=Bt(Vie,[["render",qie]]),Kie={name:"IframeMenuBubble",components:{IframeMenuModal:LL},props:{field:{type:Object,default:null},editor:{type:Object,default:null}},data(){return{tippy:null,showEditModal:!1,model:{url:null}}},watch:{editor:{immediate:!0,handler(t){t&&this.$nextTick(()=>{t.on("vui:iframe-clicked",this.renderBubble)})}}},methods:{renderBubble(t){const{view:e}=this.editor,n=this.editor.getAttributes("iframe");P_(n)&&(this.model=n,this.$el.style.display="block",this.destroyBubble(),this.tippy=Kr(e.dom,{content:this.$el,trigger:"manual",showOnCreate:!0,allowHTML:!0,arrow:!0,interactive:!0,placement:"top",followCursor:"initial",plugins:[Vw],theme:"vui-menu-bubble",mouseEvent:t,duration:200,zIndex:1e3,appendTo:()=>document.body}))},destroyBubble(){this.tippy&&(this.tippy.destroy(),this.tippy=null)},edit(){this.showEditModal=!0,this.editor.chain().blur().run()},closeModal(){this.showEditModal=!1},unlink(){this.editor.chain().focus().deleteSelection().run(),this.destroyBubble()}}},Gie={class:"vui-iframe-menu-bubble",style:{display:"none"}};function Yie(t,e,n,r,i,o){const s=ut("iframe-menu-modal");return ge(),Se("div",Gie,[re("a",{href:"#",onClick:e[0]||(e[0]=lt((...l)=>o.edit&&o.edit(...l),["prevent"]))},Le(t.t("vizy","Edit")),1),re("a",{href:"#",onClick:e[1]||(e[1]=lt((...l)=>o.unlink&&o.unlink(...l),["prevent"]))},Le(t.t("vizy","Delete")),1),Qe(s,{modelValue:i.model,"onUpdate:modelValue":e[2]||(e[2]=l=>i.model=l),show:i.showEditModal,editor:n.editor,field:n.field,"confirm-button":"Update","modal-title":"Edit iFrame",onClose:o.closeModal},null,8,["modelValue","show","editor","field","onClose"])])}const Jie=Bt(Kie,[["render",Yie]]),Xie={name:"IframeMenuBarItem",components:{SvgIcon:hc,IframeMenuBubble:Jie,IframeMenuModal:LL},props:{field:{type:Object,default:null},editor:{type:Object,default:null},icon:{type:String,default:null},svg:{type:String,default:null},name:{type:String,default:null},title:{type:String,default:null},action:{type:Function,default:()=>{}},isActive:{type:Function,default:()=>{}}},data(){return{showEditModal:!1,model:{}}},computed:{active(){return this.isActive&&this.isActive(this.editor)}},created(){this.resetModel()},mounted(){this._keyListener=function(t){t.key==="Escape"&&(t.preventDefault(),this.closeDropdown())},document.addEventListener("keydown",this._keyListener.bind(this))},beforeUnmount(){document.removeEventListener("keydown",this._keyListener)},methods:{runAction(){this.showEditModal=!0},resetModel(){this.model={url:null,data:null}},closeModal(){this.showEditModal=!1},onMouseDown(t){t.preventDefault()},closeDropdown(){this.tippy&&this.tippy.hide()}}};function Zie(t,e,n,r,i,o){const s=ut("svg-icon"),l=ut("iframe-menu-bubble"),u=ut("iframe-menu-modal"),f=sc("tooltip");return ge(),Se("div",null,[Ut((ge(),Se("button",{class:vt(["btn vui-toolbar-btn",{active:o.active}]),onClick:e[0]||(e[0]=lt((...d)=>o.runAction&&o.runAction(...d),["prevent"])),onMousedown:e[1]||(e[1]=(...d)=>o.onMouseDown&&o.onMouseDown(...d))},[Qe(s,{content:{icon:n.icon,svg:n.svg}},null,8,["content"])],34)),[[f,{content:n.title,theme:"vui-tooltip"}]]),Qe(l,{editor:n.editor,field:n.field},null,8,["editor","field"]),Qe(u,{modelValue:i.model,"onUpdate:modelValue":e[2]||(e[2]=d=>i.model=d),show:i.showEditModal,editor:n.editor,field:n.field,"confirm-button":"Insert","modal-title":"Insert iFrame",onClose:o.closeModal},null,8,["modelValue","show","editor","field","onClose"])])}const Qie=Bt(Xie,[["render",Zie]]),eoe={name:"MediaEmbedMenuModal",components:{MenuBarModal:uv},props:{field:{type:Object,default:null},editor:{type:Object,default:null},show:{type:Boolean,default:!1},modelValue:{type:Object,default:()=>globalThis.proxyValue}},emits:["update:modelValue","close"],data(){return{targetId:`target-${Craft.randomString(10)}`,proxyShow:!1,proxyValue:{url:null,data:null},errors:[]}},watch:{show(t){this.proxyShow=t},proxyShow(t){t===!1&&this.$emit("close")},proxyValue(t){this.$emit("update:modelValue",t)}},methods:{cancelModal(){this.proxyShow=!1},confirmModal(){if(this.errors=[],!this.modelValue.url){this.errors.push("url");return}this.editor.chain().focus().setEmbed(this.modelValue).run(),this.proxyShow=!1}}},toe={class:"heading"},noe={id:"url-label",class:"required",for:"url"},roe={key:0,class:"errors"};function ioe(t,e,n,r,i,o){const s=ut("menu-bar-modal");return ge(),Ct(s,{modelValue:i.proxyShow,"onUpdate:modelValue":e[1]||(e[1]=l=>i.proxyShow=l),class:"vui-modal-media-embed-edit","confirm-button":t.$attrs["confirm-button"],onConfirm:o.confirmModal,onCancel:o.cancelModal},{title:Vt(()=>[Ui(Le(t.t("vizy",t.$attrs["modal-title"])),1)]),default:Vt(()=>[re("div",{id:"url-field",class:vt(["field",{"has-errors":i.errors.includes("url")}])},[re("div",toe,[re("label",noe,Le(t.t("vizy","URL")),1)]),re("div",{class:vt(["input ltr",{errors:i.errors.includes("url")}])},[Ut(re("input",{id:"url","onUpdate:modelValue":e[0]||(e[0]=l=>n.modelValue.url=l),type:"text",class:"text fullwidth",autofocus:"",autocomplete:"off",required:""},null,512),[[Mn,n.modelValue.url]])],2),i.errors.includes("url")?(ge(),Se("ul",roe,[re("li",null,Le(t.t("vizy","URL cannot be blank.")),1)])):gt("",!0)],2)]),_:1},8,["modelValue","confirm-button","onConfirm","onCancel"])}const IL=Bt(eoe,[["render",ioe]]),ooe={name:"MediaEmbedMenuBubble",components:{MediaEmbedMenuModal:IL},props:{field:{type:Object,default:null},editor:{type:Object,default:null}},data(){return{tippy:null,showEditModal:!1,model:{url:null,data:null}}},watch:{editor:{immediate:!0,handler(t){t&&this.$nextTick(()=>{t.on("vui:media-embed-clicked",this.renderBubble)})}}},methods:{renderBubble(t){const{view:e}=this.editor,n=this.editor.getAttributes("mediaEmbed");P_(n)&&(this.model=n,this.$el.style.display="block",this.destroyBubble(),this.tippy=Kr(e.dom,{content:this.$el,trigger:"manual",showOnCreate:!0,allowHTML:!0,arrow:!0,interactive:!0,placement:"top",followCursor:"initial",plugins:[Vw],theme:"vui-menu-bubble",mouseEvent:t,duration:200,zIndex:1e3,appendTo:()=>document.body}))},destroyBubble(){this.tippy&&(this.tippy.destroy(),this.tippy=null)},edit(){this.showEditModal=!0,this.editor.chain().blur().run()},closeModal(){this.showEditModal=!1},unlink(){this.editor.chain().focus().deleteSelection().run(),this.destroyBubble()}}},soe={class:"vui-media-embed-menu-bubble",style:{display:"none"}};function aoe(t,e,n,r,i,o){const s=ut("media-embed-menu-modal");return ge(),Se("div",soe,[re("a",{href:"#",onClick:e[0]||(e[0]=lt((...l)=>o.edit&&o.edit(...l),["prevent"]))},Le(t.t("vizy","Edit")),1),re("a",{href:"#",onClick:e[1]||(e[1]=lt((...l)=>o.unlink&&o.unlink(...l),["prevent"]))},Le(t.t("vizy","Delete")),1),Qe(s,{modelValue:i.model,"onUpdate:modelValue":e[2]||(e[2]=l=>i.model=l),show:i.showEditModal,editor:n.editor,field:n.field,"confirm-button":"Update","modal-title":"Edit Media Embed",onClose:o.closeModal},null,8,["modelValue","show","editor","field","onClose"])])}const loe=Bt(ooe,[["render",aoe]]),uoe={name:"MediaEmbedMenuBarItem",components:{SvgIcon:hc,MediaEmbedMenuBubble:loe,MediaEmbedMenuModal:IL},props:{field:{type:Object,default:null},editor:{type:Object,default:null},icon:{type:String,default:null},svg:{type:String,default:null},name:{type:String,default:null},title:{type:String,default:null},action:{type:Function,default:()=>{}},isActive:{type:Function,default:()=>{}}},data(){return{showEditModal:!1,model:{}}},computed:{active(){return this.isActive&&this.isActive(this.editor)}},created(){this.resetModel(),this.editor.on("vui:media-embed-modal-open",()=>{this.runAction()})},mounted(){this._keyListener=function(t){t.key==="Escape"&&(t.preventDefault(),this.closeDropdown())},document.addEventListener("keydown",this._keyListener.bind(this))},beforeUnmount(){document.removeEventListener("keydown",this._keyListener)},methods:{runAction(){this.showEditModal=!0},resetModel(){this.model={url:null,data:null}},closeModal(){this.showEditModal=!1},onMouseDown(t){t.preventDefault()},closeDropdown(){this.tippy&&this.tippy.hide()}}};function coe(t,e,n,r,i,o){const s=ut("svg-icon"),l=ut("media-embed-menu-bubble"),u=ut("media-embed-menu-modal"),f=sc("tooltip");return ge(),Se("div",null,[Ut((ge(),Se("button",{class:vt(["btn vui-toolbar-btn",{active:o.active}]),onClick:e[0]||(e[0]=lt((...d)=>o.runAction&&o.runAction(...d),["prevent"])),onMousedown:e[1]||(e[1]=(...d)=>o.onMouseDown&&o.onMouseDown(...d))},[Qe(s,{content:{icon:n.icon,svg:n.svg}},null,8,["content"])],34)),[[f,{content:n.title,theme:"vui-tooltip"}]]),Qe(l,{editor:n.editor,field:n.field},null,8,["editor","field"]),Qe(u,{modelValue:i.model,"onUpdate:modelValue":e[2]||(e[2]=d=>i.model=d),show:i.showEditModal,editor:n.editor,field:n.field,"confirm-button":"Insert","modal-title":"Insert Media Embed",onClose:o.closeModal},null,8,["modelValue","show","editor","field","onClose"])])}const foe=Bt(uoe,[["render",coe]]),doe={components:{MenuBarItem:pre,LinkMenuBarItem:nie,ImageMenuBarItem:Fie,IframeMenuBarItem:Qie,MediaEmbedMenuBarItem:foe},props:{field:{type:Object,default:null},editor:{type:Object,default:null},buttons:{type:Array,default:()=>[]}},computed:{availableButtons(){const t=[];return this.buttons.forEach(e=>{vr(e)&&t.push(this.dynamicButton(e));const n=this.allButtons.find(r=>r.name===e);n&&(n.name==="formatting"&&(n.options=this.getEnabledOptions(n.options,this.getFormattingOptions())),n.name==="table"&&(n.options=this.getEnabledOptions(n.options,this.getTableOptions())),t.push(n))}),t}},created(){this.allButtons=Craft.Vizy.Config.getButtons()},methods:{getFormattingOptions(){let t=["paragraph","code-block","blockquote","h1","h2","h3","h4","h5","h6"];return this.field.settings.vizyConfig.formatting&&this.field.settings.vizyConfig.formatting.length&&(t=this.field.settings.vizyConfig.formatting),t},getTableOptions(){let t=["insert-table","delete-table","add-col-before","add-col-after","delete-col","add-row-before","add-row-after","delete-row","merge-cells","split-cells","toggle-header-column","toggle-header-row","toggle-header-cell"];return this.field.settings.vizyConfig.table&&this.field.settings.vizyConfig.table.length&&(t=this.field.settings.vizyConfig.table),t},getEnabledOptions(t,e){const n=[];return e.forEach(r=>{vr(r)&&n.push(this.dynamicButton(r));const i=t.find(o=>o.name===r);i&&n.push(i)}),n},dynamicButton(t){return{name:t.type,svg:t.svg,title:t.title,action:e=>{const n=e.state.schema.nodes[t.type],r=e.state.schema.marks[t.type];if(n)return e.chain().focus().toggleNode(t.type,"paragraph",t.attrs).run();if(r)return e.chain().focus().toggleMark(t.type,t.attrs).run()},isActive:e=>e.isActive(t.type,t.attrs)}}}},hoe={class:"vui-editor-toolbar"};function poe(t,e,n,r,i,o){return ge(),Se("div",hoe,[(ge(!0),Se(kt,null,Zt(o.availableButtons,(s,l)=>(ge(),Ct(Qs(s.component||"MenuBarItem"),wi({key:l},s,{editor:n.editor,field:n.field}),null,16,["editor","field"]))),128))])}const moe=Bt(doe,[["render",poe]]);class goe{constructor({options:e,editorView:n}){this.options={element:null,onUpdate:()=>!1,...e},this.preventHide=!1,this.editorView=n,this.isActive=!1,this.top=0,this.behaviour=this.options.editor.vizyField.settings.blockTypeBehaviour,this.behaviour==="click"&&(this.options.element.addEventListener("mousedown",this.mousedownHandler.bind(this),{capture:!0}),this.options.editor.on("focus",this.focusHandler.bind(this)),this.options.editor.on("blur",this.blurHandler.bind(this)),this.options.editor.on("resize",this.resizeHandler.bind(this))),this.behaviour==="hover"&&(this.options.editor.view.dom.addEventListener("mousemove",this.mouseenterHandler.bind(this)),this.options.editor.view.dom.addEventListener("mouseleave",this.mouseleaveHandler.bind(this)))}mouseenterHandler(e){const{view:n}=this.options.editor,r=n.posAtCoords({left:e.clientX,top:e.clientY});if(r.pos&&r.inside>-1){const i=r.pos,o=n.state.doc.resolve(i).parent;lw(o)?setTimeout(()=>{const s=this.options.element.offsetParent;if(s){const l=s.getBoundingClientRect(),f=n.coordsAtPos(i).top-l.top;this.isActive=!0,this.top=f,this.options.editor.vizyField.currentNodeHoverPosition=i,this.sendUpdate()}},10):this.hide()}}mouseleaveHandler(e){e.relatedTarget&&e.relatedTarget.classList.contains("vui-editor-insert-btn")||this.hide()}mousedownHandler(){this.preventHide=!0}focusHandler(){this.update(this.options.editor.view)}blurHandler(e){if(this.preventHide){this.preventHide=!1;return}this.hide(e)}resizeHandler(){this.isActive&&this.update(this.options.editor.view)}isNodeEmpty(e){return!e.toJSON().content}update(e,n){const{state:r,composing:i}=e,{doc:o,selection:s}=r,l=n&&n.doc.eq(o)&&n.selection.eq(s);if(i||l)return;const{$anchor:u,anchor:f,empty:d}=s,m=this.options.element.offsetParent,v=u.depth===1,y=u.parent.type===r.doc.type.contentMatch.defaultType,_=this.isNodeEmpty(s.$anchor.parent);if(!d||!m||!(v&&y&&_)){this.hide();return}setTimeout(()=>{const x=m.getBoundingClientRect(),A=e.coordsAtPos(f).top-x.top;this.isActive=!0,this.top=A,this.sendUpdate()},10)}sendUpdate(){this.options.onUpdate({isActive:this.isActive,top:this.top})}hide(e){e&&e.relatedTarget&&this.options.element.parentNode&&this.options.element.parentNode.contains(e.relatedTarget)||(this.isActive=!1,this.sendUpdate())}destroy(){this.behaviour==="click"&&(this.options.element.removeEventListener("mousedown",this.mousedownHandler),this.options.editor.off("focus",this.focusHandler),this.options.editor.off("blur",this.blurHandler),this.options.editor.off("resize",this.resizeHandler)),this.behaviour==="hover"&&(this.options.editor.view.dom.removeEventListener("mousemove",this.mouseenterHandler),this.options.editor.view.dom.removeEventListener("mouseleave",this.mouseleaveHandler))}}function voe(t){return new on({key:new xn("floatingMenu"),view(e){return new goe({editorView:e,options:t})}})}const yoe={props:{editor:{type:Object,default:null}},emits:["show","hide"],data(){return{menu:{isActive:!1,left:0,bottom:0}}},computed:{variables(){return{focused:this.editor.view.focused,focus:this.editor.focus,commands:this.editor.commands,isActive:this.editor.isActive,getMarkAttrs:this.editor.getAttributes.bind(this.editor),getNodeAttrs:this.editor.getAttributes.bind(this.editor),menu:this.menu}}},watch:{editor:{immediate:!0,handler(t){t&&this.$nextTick(()=>{t.registerPlugin(voe({editor:t,element:this.$el,onUpdate:e=>{e.isActive&&this.menu.isActive===!1?this.$emit("show",e):!e.isActive&&this.menu.isActive===!0&&this.$emit("hide",e),this.menu=e}}))})}}},beforeUnmount(){},render(){return this.editor?mr("div",null,this.$slots.default({focused:this.editor.view.focused,focus:this.editor.focus,commands:this.editor.commands,isActive:this.editor.isActive,getMarkAttrs:this.editor.getAttributes.bind(this.editor),getNodeAttrs:this.editor.getAttributes.bind(this.editor),menu:this.menu})):null}},boe={name:"BlockPicker",components:{FloatingMenu:yoe},props:{field:{type:Object,default:null},editor:{type:Object,default:null},blockGroups:{type:Array,default:()=>[]}},data(){return{tippy:null,search:"",selectedIndex:0}},computed:{filteredBlockGroups(){const{blockGroups:t}=this;let e=0;return t.forEach(n=>{Array.isArray(n.blockTypes)&&n.blockTypes.forEach(r=>{r.countIndex=e,e++})}),t.reduce((n,r)=>{let i=[];return Array.isArray(r.blockTypes)&&(i=r.blockTypes.filter(o=>o.name.toLowerCase().includes(this.search.toLowerCase()))),i.length?n.concat({...r,blockTypes:i}):n},[])},totalBlockCount(){let t=0;return this.blockGroups.forEach(e=>{Array.isArray(e.blockTypes)&&(t+=e.blockTypes.length)}),t}},mounted(){this.$nextTick(()=>{const t=this.$el.querySelector("#vizy-blocks-template");t&&(t.style.display="block",this.tippy=Kr(this.$el.querySelector(".vui-editor-insert-btn"),{content:t,trigger:"click",allowHTML:!0,arrow:!0,interactive:!0,placement:"right",theme:"vui-block-picker light-border",maxWidth:"300px",duration:200,zIndex:100,appendTo:()=>document.body,hideOnClick:!0}))})},methods:{moveSelectionLeft(){this.selectedIndex>0&&this.selectedIndex--},moveSelectionRight(){const t=Object.values(this.filteredBlockGroups).map(e=>e.blockTypes).flat();this.selectedIndex{this.$events.emit("vizy-blocks:addedBlock")},50),this.tippy.hide()},blockTypeDisabled(t){var l,u;let e=0;const n={};this.blockGroups.forEach(f=>{f.blockTypes.forEach(d=>{n[d.id]=0})}),(u=(l=this.editor.state.doc)==null?void 0:l.content)==null||u.content.forEach(f=>{const d=Qn(f,"type.name"),m=Qn(f,"type.attrs.enabled"),v=Qn(f,"attrs.values.type");d==="vizyBlock"&&m&&(e+=1,n[v]+=1)});const{maxBlocks:r,maxBlockTypeBlocks:i}=this.editor.vizyField.settings;if(r&&e>=r)return!0;const o=Qn(i,t.id);return Qn(n,t.id)>=o},onClick(){const{blockTypeBehaviour:t}=this.editor.vizyField.settings;if(t==="hover"){const{view:e}=this.editor,n=st.create(e.state.doc,this.editor.vizyField.currentNodeHoverPosition),r=e.state.tr.setSelection(n);e.dispatch(r)}},closePane(){this.tippy&&this.tippy.hide()}}},_oe=re("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512"},[re("path",{fill:"currentColor",d:"M368 224H224V80c0-8.84-7.16-16-16-16h-32c-8.84 0-16 7.16-16 16v144H16c-8.84 0-16 7.16-16 16v32c0 8.84 7.16 16 16 16h144v144c0 8.84 7.16 16 16 16h32c8.84 0 16-7.16 16-16V288h144c8.84 0 16-7.16 16-16v-32c0-8.84-7.16-16-16-16z"})],-1),woe=[_oe],koe={id:"vizy-blocks-template",style:{display:"none"}},xoe={key:0},Soe={key:1},Coe=re("hr",null,null,-1),Toe={class:"vui-block-items-header"},Eoe={class:"vui-block-items"},Aoe=["onClick"],Ooe=["innerHTML"],Moe={class:"vui-block-item-heading"},Noe={key:2,class:"vui-block-items-none"},Loe=re("hr",null,null,-1),Ioe={key:3,class:"vui-block-items-empty"};function Poe(t,e,n,r,i,o){const s=ut("floating-menu");return Ut((ge(),Ct(s,{ref:"menu",editor:n.editor},{default:Vt(({menu:l})=>[re("div",{class:vt(["vui-editor-insert",{"is-active":l.isActive}]),style:oi(`top: ${l.top}px`),onKeydown:[e[2]||(e[2]=Tu(lt((...u)=>o.moveSelectionLeft&&o.moveSelectionLeft(...u),["prevent"]),["left"])),e[3]||(e[3]=Tu(lt((...u)=>o.moveSelectionRight&&o.moveSelectionRight(...u),["prevent"]),["right"])),e[4]||(e[4]=Tu(lt((...u)=>o.closePane&&o.closePane(...u),["prevent"]),["escape"]))]},[re("button",{type:"button","aria-label":"Add block","aria-haspopup":"true","aria-expanded":"false",class:"vui-editor-insert-btn",onClick:e[0]||(e[0]=(...u)=>o.onClick&&o.onClick(...u))},woe),re("div",koe,[o.totalBlockCount?(ge(),Se("div",xoe,[Ut(re("input",{"onUpdate:modelValue":e[1]||(e[1]=u=>i.search=u),type:"text",class:"text fullwidth",placeholder:"Search for blocks"},null,512),[[Mn,i.search]])])):gt("",!0),o.filteredBlockGroups.length?(ge(),Se("div",Soe,[(ge(!0),Se(kt,null,Zt(o.filteredBlockGroups,(u,f)=>(ge(),Se("div",{key:f,class:"vui-block-group"},[Coe,re("div",Toe,Le(u.name),1),re("div",Eoe,[(ge(!0),Se(kt,null,Zt(u.blockTypes,(d,m)=>(ge(),Se("div",{key:m,class:vt(["vui-block-item",{disabled:o.blockTypeDisabled(d),"is-selected":i.selectedIndex===d.countIndex}]),onClick:v=>o.addBlock(d)},[re("div",{innerHTML:d.icon.svg},null,8,Ooe),re("span",Moe,Le(d.name),1)],10,Aoe))),128))])]))),128))])):i.search?(ge(),Se("div",Noe,[Loe,Ui(" "+Le(t.t("vizy","No blocks found for “{search}”.",{search:i.search})),1)])):(ge(),Se("div",Ioe,Le(t.t("vizy","No blocks available.")),1))])],38)]),_:1},8,["editor"])),[[Bu,n.blockGroups.length]])}const Doe=Bt(boe,[["render",Poe]]);var Roe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zoe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ng={},Boe={get exports(){return ng},set exports(t){ng=t}},AE;function Mr(){return AE||(AE=1,function(t,e){(function(n,r){t.exports=r()})(Roe,function(){var n=navigator.userAgent,r=navigator.platform,i=/gecko\/\d/i.test(n),o=/MSIE \d/.test(n),s=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(n),l=/Edge\/(\d+)/.exec(n),u=o||s||l,f=u&&(o?document.documentMode||6:+(l||s)[1]),d=!l&&/WebKit\//.test(n),m=d&&/Qt\/\d+\.\d+/.test(n),v=!l&&/Chrome\/(\d+)/.exec(n),y=v&&+v[1],_=/Opera\//.test(n),C=/Apple Computer/.test(navigator.vendor),x=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(n),k=/PhantomJS/.test(n),A=C&&(/Mobile\/\w+/.test(n)||navigator.maxTouchPoints>2),L=/Android/.test(n),E=A||L||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(n),H=A||/Mac/.test(r),I=/\bCrOS\b/.test(n),q=/win/i.test(r),P=_&&n.match(/Version\/(\d*\.\d*)/);P&&(P=Number(P[1])),P&&P>=15&&(_=!1,d=!0);var z=H&&(m||_&&(P==null||P<12.11)),w=i||u&&f>=9;function R(a){return new RegExp("(^|\\s)"+a+"(?:$|\\s)\\s*")}var U=function(a,c){var p=a.className,h=R(c).exec(p);if(h){var g=p.slice(h.index+h[0].length);a.className=p.slice(0,h.index)+(g?h[1]+g:"")}};function K(a){for(var c=a.childNodes.length;c>0;--c)a.removeChild(a.firstChild);return a}function oe(a,c){return K(a).appendChild(c)}function D(a,c,p,h){var g=document.createElement(a);if(p&&(g.className=p),h&&(g.style.cssText=h),typeof c=="string")g.appendChild(document.createTextNode(c));else if(c)for(var b=0;b=c)return S+(c-b);S+=T-b,S+=p-S%p,b=T+1}}var Ee=function(){this.id=null,this.f=null,this.time=0,this.handler=Xe(this.onTimeout,this)};Ee.prototype.onTimeout=function(a){a.id=0,a.time<=+new Date?a.f():setTimeout(a.handler,a.time-+new Date)},Ee.prototype.set=function(a,c){this.f=c;var p=+new Date+a;(!this.id||p=c)return h+Math.min(S,c-g);if(g+=b-h,g+=p-g%p,h=b+1,g>=c)return h}}var _e=[""];function xe(a){for(;_e.length<=a;)_e.push(G(_e)+" ");return _e[a]}function G(a){return a[a.length-1]}function Z(a,c){for(var p=[],h=0;h"€"&&(a.toUpperCase()!=a.toLowerCase()||j.test(a))}function Q(a,c){return c?c.source.indexOf("\\w")>-1&&F(a)?!0:c.test(a):F(a)}function le(a){for(var c in a)if(a.hasOwnProperty(c)&&a[c])return!1;return!0}var pe=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ye(a){return a.charCodeAt(0)>=768&&pe.test(a)}function Y(a,c,p){for(;(p<0?c>0:cp?-1:1;;){if(c==p)return c;var g=(c+p)/2,b=h<0?Math.ceil(g):Math.floor(g);if(b==c)return a(b)?c:p;a(b)?p=b:c=b+h}}function de(a,c,p,h){if(!a)return h(c,p,"ltr",0);for(var g=!1,b=0;bc||c==p&&S.to==c)&&(h(Math.max(S.from,c),Math.min(S.to,p),S.level==1?"rtl":"ltr",b),g=!0)}g||h(c,p,"ltr")}var Te=null;function je(a,c,p){var h;Te=null;for(var g=0;gc)return g;b.to==c&&(b.from!=b.to&&p=="before"?h=g:Te=g),b.from==c&&(b.from!=b.to&&p!="before"?h=g:Te=g)}return h??Te}var he=function(){var a="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",c="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function p(B){return B<=247?a.charAt(B):1424<=B&&B<=1524?"R":1536<=B&&B<=1785?c.charAt(B-1536):1774<=B&&B<=2220?"r":8192<=B&&B<=8203?"w":B==8204?"b":"L"}var h=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,g=/[stwN]/,b=/[LRr]/,S=/[Lb1n]/,T=/[1n]/;function M(B,J,ee){this.level=B,this.from=J,this.to=ee}return function(B,J){var ee=J=="ltr"?"L":"R";if(B.length==0||J=="ltr"&&!h.test(B))return!1;for(var fe=B.length,ue=[],ke=0;ke-1&&(h[c]=g.slice(0,b).concat(g.slice(b+1)))}}}function ot(a,c){var p=Je(a,c);if(p.length)for(var h=Array.prototype.slice.call(arguments,2),g=0;g0}function Xt(a){a.prototype.on=function(c,p){me(this,c,p)},a.prototype.off=function(c,p){ct(this,c,p)}}function Gt(a){a.preventDefault?a.preventDefault():a.returnValue=!1}function Kn(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0}function Gr(a){return a.defaultPrevented!=null?a.defaultPrevented:a.returnValue==!1}function Yr(a){Gt(a),Kn(a)}function Sn(a){return a.target||a.srcElement}function pc(a){var c=a.which;return c==null&&(a.button&1?c=1:a.button&2?c=3:a.button&4&&(c=2)),H&&a.ctrlKey&&c==1&&(c=3),c}var dv=function(){if(u&&f<9)return!1;var a=D("div");return"draggable"in a||"dragDrop"in a}(),ci;function hv(a){if(ci==null){var c=D("span","​");oe(a,D("span",[c,document.createTextNode("x")])),a.firstChild.offsetHeight!=0&&(ci=c.offsetWidth<=1&&c.offsetHeight>2&&!(u&&f<8))}var p=ci?D("span","​"):D("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return p.setAttribute("cm-text",""),p}var Pl;function Ud(a){if(Pl!=null)return Pl;var c=oe(a,document.createTextNode("AخA")),p=ce(c,0,1).getBoundingClientRect(),h=ce(c,1,2).getBoundingClientRect();return K(a),!p||p.left==p.right?!1:Pl=h.right-p.right<3}var mc=` - -b`.split(/\n/).length!=3?function(a){for(var c=0,p=[],h=a.length;c<=h;){var g=a.indexOf(` -`,c);g==-1&&(g=a.length);var b=a.slice(c,a.charAt(g-1)=="\r"?g-1:g),S=b.indexOf("\r");S!=-1?(p.push(b.slice(0,S)),c+=S+1):(p.push(b),c=g+1)}return p}:function(a){return a.split(/\r\n?|\n/)},us=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch{return!1}}:function(a){var c;try{c=a.ownerDocument.selection.createRange()}catch{}return!c||c.parentElement()!=a?!1:c.compareEndPoints("StartToEnd",c)!=0},Yi=function(){var a=D("div");return"oncopy"in a?!0:(a.setAttribute("oncopy","return;"),typeof a.oncopy=="function")}(),Ji=null;function qd(a){if(Ji!=null)return Ji;var c=oe(a,D("span","x")),p=c.getBoundingClientRect(),h=ce(c,0,1).getBoundingClientRect();return Ji=Math.abs(p.left-h.left)>1}var Ci={},cs={};function Kd(a,c){arguments.length>2&&(c.dependencies=Array.prototype.slice.call(arguments,2)),Ci[a]=c}function Dl(a,c){cs[a]=c}function Nr(a){if(typeof a=="string"&&cs.hasOwnProperty(a))a=cs[a];else if(a&&typeof a.name=="string"&&cs.hasOwnProperty(a.name)){var c=cs[a.name];typeof c=="string"&&(c={name:c}),a=O(c,a),a.name=c.name}else{if(typeof a=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(a))return Nr("application/xml");if(typeof a=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(a))return Nr("application/json")}return typeof a=="string"?{name:a}:a||{name:"null"}}function xo(a,c){c=Nr(c);var p=Ci[c.name];if(!p)return xo(a,"text/plain");var h=p(a,c);if(fs.hasOwnProperty(c.name)){var g=fs[c.name];for(var b in g)g.hasOwnProperty(b)&&(h.hasOwnProperty(b)&&(h["_"+b]=h[b]),h[b]=g[b])}if(h.name=c.name,c.helperType&&(h.helperType=c.helperType),c.modeProps)for(var S in c.modeProps)h[S]=c.modeProps[S];return h}var fs={};function Gd(a,c){var p=fs.hasOwnProperty(a)?fs[a]:fs[a]={};Ie(c,p)}function So(a,c){if(c===!0)return c;if(a.copyState)return a.copyState(c);var p={};for(var h in c){var g=c[h];g instanceof Array&&(g=g.concat([])),p[h]=g}return p}function ds(a,c){for(var p;a.innerMode&&(p=a.innerMode(c),!(!p||p.mode==a));)c=p.state,a=p.mode;return p||{mode:a,state:c}}function gc(a,c,p){return a.startState?a.startState(c,p):!0}var ln=function(a,c,p){this.pos=this.start=0,this.string=a,this.tabSize=c||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=p};ln.prototype.eol=function(){return this.pos>=this.string.length},ln.prototype.sol=function(){return this.pos==this.lineStart},ln.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ln.prototype.next=function(){if(this.posc},ln.prototype.eatSpace=function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},ln.prototype.skipToEnd=function(){this.pos=this.string.length},ln.prototype.skipTo=function(a){var c=this.string.indexOf(a,this.pos);if(c>-1)return this.pos=c,!0},ln.prototype.backUp=function(a){this.pos-=a},ln.prototype.column=function(){return this.lastColumnPos0?null:(b&&c!==!1&&(this.pos+=b[0].length),b)}},ln.prototype.current=function(){return this.string.slice(this.start,this.pos)},ln.prototype.hideFirstChars=function(a,c){this.lineStart+=a;try{return c()}finally{this.lineStart-=a}},ln.prototype.lookAhead=function(a){var c=this.lineOracle;return c&&c.lookAhead(a)},ln.prototype.baseToken=function(){var a=this.lineOracle;return a&&a.baseToken(this.pos)};function Ge(a,c){if(c-=a.first,c<0||c>=a.size)throw new Error("There is no line "+(c+a.first)+" in the document.");for(var p=a;!p.lines;)for(var h=0;;++h){var g=p.children[h],b=g.chunkSize();if(c=a.first&&cp?se(p,Ge(a,p).text.length):jL(c,Ge(a,c.line).text.length)}function jL(a,c){var p=a.ch;return p==null||p>c?se(a.line,c):p<0?se(a.line,0):a}function Jw(a,c){for(var p=[],h=0;hthis.maxLookAhead&&(this.maxLookAhead=a),c},Zi.prototype.baseToken=function(a){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=a;)this.baseTokenPos+=2;var c=this.baseTokens[this.baseTokenPos+1];return{type:c&&c.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-a}},Zi.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Zi.fromSaved=function(a,c,p){return c instanceof Yd?new Zi(a,So(a.mode,c.state),p,c.lookAhead):new Zi(a,So(a.mode,c),p)},Zi.prototype.save=function(a){var c=a!==!1?So(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Yd(c,this.maxLookAhead):c};function Xw(a,c,p,h){var g=[a.state.modeGen],b={};rk(a,c.text,a.doc.mode,p,function(B,J){return g.push(B,J)},b,h);for(var S=p.state,T=function(B){p.baseTokens=g;var J=a.state.overlays[B],ee=1,fe=0;p.state=!0,rk(a,c.text,J.mode,p,function(ue,ke){for(var Ce=ee;feue&&g.splice(ee,1,ue,g[ee+1],Me),ee+=2,fe=Math.min(ue,Me)}if(ke)if(J.opaque)g.splice(Ce,ee-Ce,ue,"overlay "+ke),ee=Ce+2;else for(;Cea.options.maxHighlightLength&&So(a.doc.mode,h.state),b=Xw(a,c,h);g&&(h.state=g),c.stateAfter=h.save(!g),c.styles=b.styles,b.classes?c.styleClasses=b.classes:c.styleClasses&&(c.styleClasses=null),p===a.doc.highlightFrontier&&(a.doc.modeFrontier=Math.max(a.doc.modeFrontier,++a.doc.highlightFrontier))}return c.styles}function vc(a,c,p){var h=a.doc,g=a.display;if(!h.mode.startState)return new Zi(h,!0,c);var b=WL(a,c,p),S=b>h.first&&Ge(h,b-1).stateAfter,T=S?Zi.fromSaved(h,S,b):new Zi(h,gc(h.mode),b);return h.iter(b,c,function(M){pv(a,M.text,T);var B=T.line;M.stateAfter=B==c-1||B%5==0||B>=g.viewFrom&&Bc.start)return b}throw new Error("Mode "+a.name+" failed to advance stream.")}var ek=function(a,c,p){this.start=a.start,this.end=a.pos,this.string=a.current(),this.type=c||null,this.state=p};function tk(a,c,p,h){var g=a.doc,b=g.mode,S;c=dt(g,c);var T=Ge(g,c.line),M=vc(a,c.line,p),B=new ln(T.text,a.options.tabSize,M),J;for(h&&(J=[]);(h||B.posa.options.maxHighlightLength?(T=!1,S&&pv(a,c,h,J.pos),J.pos=c.length,ee=null):ee=nk(mv(p,J,h.state,fe),b),fe){var ue=fe[0].name;ue&&(ee="m-"+(ee?ue+" "+ee:ue))}if(!T||B!=ee){for(;MS;--T){if(T<=b.first)return b.first;var M=Ge(b,T-1),B=M.stateAfter;if(B&&(!p||T+(B instanceof Yd?B.lookAhead:0)<=b.modeFrontier))return T;var J=Be(M.text,null,a.options.tabSize);(g==null||h>J)&&(g=T-1,h=J)}return g}function UL(a,c){if(a.modeFrontier=Math.min(a.modeFrontier,c),!(a.highlightFrontierp;h--){var g=Ge(a,h).stateAfter;if(g&&(!(g instanceof Yd)||h+g.lookAhead=c:b.to>c);(h||(h=[])).push(new Jd(S,b.from,M?null:b.to))}}return h}function XL(a,c,p){var h;if(a)for(var g=0;g=c:b.to>c);if(T||b.from==c&&S.type=="bookmark"&&(!p||b.marker.insertLeft)){var M=b.from==null||(S.inclusiveLeft?b.from<=c:b.from0&&T)for(var Ve=0;Ve0)){var J=[M,1],ee=we(B.from,T.from),fe=we(B.to,T.to);(ee<0||!S.inclusiveLeft&&!ee)&&J.push({from:B.from,to:T.from}),(fe>0||!S.inclusiveRight&&!fe)&&J.push({from:T.to,to:B.to}),g.splice.apply(g,J),M+=J.length-3}}return g}function sk(a){var c=a.markedSpans;if(c){for(var p=0;pc)&&(!h||vv(h,b.marker)<0)&&(h=b.marker)}return h}function ck(a,c,p,h,g){var b=Ge(a,c),S=To&&b.markedSpans;if(S)for(var T=0;T=0&&ee<=0||J<=0&&ee>=0)&&(J<=0&&(M.marker.inclusiveRight&&g.inclusiveLeft?we(B.to,p)>=0:we(B.to,p)>0)||J>=0&&(M.marker.inclusiveRight&&g.inclusiveLeft?we(B.from,h)<=0:we(B.from,h)<0)))return!0}}}function Ti(a){for(var c;c=uk(a);)a=c.find(-1,!0).line;return a}function eI(a){for(var c;c=Qd(a);)a=c.find(1,!0).line;return a}function tI(a){for(var c,p;c=Qd(a);)a=c.find(1,!0).line,(p||(p=[])).push(a);return p}function yv(a,c){var p=Ge(a,c),h=Ti(p);return p==h?c:$t(h)}function fk(a,c){if(c>a.lastLine())return c;var p=Ge(a,c),h;if(!hs(a,p))return c;for(;h=Qd(p);)p=h.find(1,!0).line;return $t(p)+1}function hs(a,c){var p=To&&c.markedSpans;if(p){for(var h=void 0,g=0;gc.maxLineLength&&(c.maxLineLength=g,c.maxLine=h)})}var zl=function(a,c,p){this.text=a,ak(this,c),this.height=p?p(this):1};zl.prototype.lineNo=function(){return $t(this)},Xt(zl);function nI(a,c,p,h){a.text=c,a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null),a.order!=null&&(a.order=null),sk(a),ak(a,p);var g=h?h(a):1;g!=a.height&&fi(a,g)}function rI(a){a.parent=null,sk(a)}var iI={},oI={};function dk(a,c){if(!a||/^\s*$/.test(a))return null;var p=c.addModeClass?oI:iI;return p[a]||(p[a]=a.replace(/\S+/g,"cm-$&"))}function hk(a,c){var p=ae("span",null,null,d?"padding-right: .1px":null),h={pre:ae("pre",[p],"CodeMirror-line"),content:p,col:0,pos:0,cm:a,trailingSpace:!1,splitSpaces:a.getOption("lineWrapping")};c.measure={};for(var g=0;g<=(c.rest?c.rest.length:0);g++){var b=g?c.rest[g-1]:c.line,S=void 0;h.pos=0,h.addToken=aI,Ud(a.display.measure)&&(S=Ae(b,a.doc.direction))&&(h.addToken=uI(h.addToken,S)),h.map=[];var T=c!=a.display.externalMeasured&&$t(b);cI(b,h,Zw(a,b,T)),b.styleClasses&&(b.styleClasses.bgClass&&(h.bgClass=yt(b.styleClasses.bgClass,h.bgClass||"")),b.styleClasses.textClass&&(h.textClass=yt(b.styleClasses.textClass,h.textClass||""))),h.map.length==0&&h.map.push(0,0,h.content.appendChild(hv(a.display.measure))),g==0?(c.measure.map=h.map,c.measure.cache={}):((c.measure.maps||(c.measure.maps=[])).push(h.map),(c.measure.caches||(c.measure.caches=[])).push({}))}if(d){var M=h.content.lastChild;(/\bcm-tab\b/.test(M.className)||M.querySelector&&M.querySelector(".cm-tab"))&&(h.content.className="cm-tab-wrap-hack")}return ot(a,"renderLine",a,c.line,h.pre),h.pre.className&&(h.textClass=yt(h.pre.className,h.textClass||"")),h}function sI(a){var c=D("span","•","cm-invalidchar");return c.title="\\u"+a.charCodeAt(0).toString(16),c.setAttribute("aria-label",c.title),c}function aI(a,c,p,h,g,b,S){if(c){var T=a.splitSpaces?lI(c,a.trailingSpace):c,M=a.cm.state.specialChars,B=!1,J;if(!M.test(c))a.col+=c.length,J=document.createTextNode(T),a.map.push(a.pos,a.pos+c.length,J),u&&f<9&&(B=!0),a.pos+=c.length;else{J=document.createDocumentFragment();for(var ee=0;;){M.lastIndex=ee;var fe=M.exec(c),ue=fe?fe.index-ee:c.length-ee;if(ue){var ke=document.createTextNode(T.slice(ee,ee+ue));u&&f<9?J.appendChild(D("span",[ke])):J.appendChild(ke),a.map.push(a.pos,a.pos+ue,ke),a.col+=ue,a.pos+=ue}if(!fe)break;ee+=ue+1;var Ce=void 0;if(fe[0]==" "){var Me=a.cm.options.tabSize,De=Me-a.col%Me;Ce=J.appendChild(D("span",xe(De),"cm-tab")),Ce.setAttribute("role","presentation"),Ce.setAttribute("cm-text"," "),a.col+=De}else fe[0]=="\r"||fe[0]==` -`?(Ce=J.appendChild(D("span",fe[0]=="\r"?"␍":"␤","cm-invalidchar")),Ce.setAttribute("cm-text",fe[0]),a.col+=1):(Ce=a.cm.options.specialCharPlaceholder(fe[0]),Ce.setAttribute("cm-text",fe[0]),u&&f<9?J.appendChild(D("span",[Ce])):J.appendChild(Ce),a.col+=1);a.map.push(a.pos,a.pos+1,Ce),a.pos++}}if(a.trailingSpace=T.charCodeAt(c.length-1)==32,p||h||g||B||b||S){var $e=p||"";h&&($e+=h),g&&($e+=g);var Re=D("span",[J],$e,b);if(S)for(var Ve in S)S.hasOwnProperty(Ve)&&Ve!="style"&&Ve!="class"&&Re.setAttribute(Ve,S[Ve]);return a.content.appendChild(Re)}a.content.appendChild(J)}}function lI(a,c){if(a.length>1&&!/ /.test(a))return a;for(var p=c,h="",g=0;gB&&ee.from<=B));fe++);if(ee.to>=J)return a(p,h,g,b,S,T,M);a(p,h.slice(0,ee.to-B),g,b,null,T,M),b=null,h=h.slice(ee.to-B),B=ee.to}}}function pk(a,c,p,h){var g=!h&&p.widgetNode;g&&a.map.push(a.pos,a.pos+c,g),!h&&a.cm.display.input.needsContentAttribute&&(g||(g=a.content.appendChild(document.createElement("span"))),g.setAttribute("cm-marker",p.id)),g&&(a.cm.display.input.setUneditable(g),a.content.appendChild(g)),a.pos+=c,a.trailingSpace=!1}function cI(a,c,p){var h=a.markedSpans,g=a.text,b=0;if(!h){for(var S=1;SM||St.collapsed&&et.to==M&&et.from==M)){if(et.to!=null&&et.to!=M&&ue>et.to&&(ue=et.to,Ce=""),St.className&&(ke+=" "+St.className),St.css&&(fe=(fe?fe+";":"")+St.css),St.startStyle&&et.from==M&&(Me+=" "+St.startStyle),St.endStyle&&et.to==ue&&(Ve||(Ve=[])).push(St.endStyle,et.to),St.title&&(($e||($e={})).title=St.title),St.attributes)for(var Yt in St.attributes)($e||($e={}))[Yt]=St.attributes[Yt];St.collapsed&&(!De||vv(De.marker,St)<0)&&(De=et)}else et.from>M&&ue>et.from&&(ue=et.from)}if(Ve)for(var Pn=0;Pn=T)break;for(var Ir=Math.min(T,ue);;){if(J){var kr=M+J.length;if(!De){var wn=kr>Ir?J.slice(0,Ir-M):J;c.addToken(c,wn,ee?ee+ke:ke,Me,M+wn.length==ue?Ce:"",fe,$e)}if(kr>=Ir){J=J.slice(Ir-M),M=Ir;break}M=kr,Me=""}J=g.slice(b,b=p[B++]),ee=dk(p[B++],c.cm.options)}}}function mk(a,c,p){this.line=c,this.rest=tI(c),this.size=this.rest?$t(G(this.rest))-p+1:1,this.node=this.text=null,this.hidden=hs(a,c)}function th(a,c,p){for(var h=[],g,b=c;b2&&b.push((M.bottom+B.top)/2-p.top)}}b.push(p.bottom-p.top)}}function kk(a,c,p){if(a.line==c)return{map:a.measure.map,cache:a.measure.cache};if(a.rest){for(var h=0;hp)return{map:a.measure.maps[g],cache:a.measure.caches[g],before:!0}}}function wI(a,c){c=Ti(c);var p=$t(c),h=a.display.externalMeasured=new mk(a.doc,c,p);h.lineN=p;var g=h.built=hk(a,h);return h.text=g.pre,oe(a.display.lineMeasure,g.pre),h}function xk(a,c,p,h){return eo(a,$l(a,c),p,h)}function Sv(a,c){if(c>=a.display.viewFrom&&c=p.lineN&&cc)&&(b=M-T,g=b-1,c>=M&&(S="right")),g!=null){if(h=a[B+2],T==M&&p==(h.insertLeft?"left":"right")&&(S=p),p=="left"&&g==0)for(;B&&a[B-2]==a[B-3]&&a[B-1].insertLeft;)h=a[(B-=3)+2],S="left";if(p=="right"&&g==M-T)for(;B=0&&(p=a[g]).left==p.right;g--);return p}function xI(a,c,p,h){var g=Ck(c.map,p,h),b=g.node,S=g.start,T=g.end,M=g.collapse,B;if(b.nodeType==3){for(var J=0;J<4;J++){for(;S&&ye(c.line.text.charAt(g.coverStart+S));)--S;for(;g.coverStart+T0&&(M=h="right");var ee;a.options.lineWrapping&&(ee=b.getClientRects()).length>1?B=ee[h=="right"?ee.length-1:0]:B=b.getBoundingClientRect()}if(u&&f<9&&!S&&(!B||!B.left&&!B.right)){var fe=b.parentNode.getClientRects()[0];fe?B={left:fe.left,right:fe.left+Fl(a.display),top:fe.top,bottom:fe.bottom}:B=Sk}for(var ue=B.top-c.rect.top,ke=B.bottom-c.rect.top,Ce=(ue+ke)/2,Me=c.view.measure.heights,De=0;De=h.text.length?(M=h.text.length,B="before"):M<=0&&(M=0,B="after"),!T)return S(B=="before"?M-1:M,B=="before");function J(ke,Ce,Me){var De=T[Ce],$e=De.level==1;return S(Me?ke-1:ke,$e!=Me)}var ee=je(T,M,B),fe=Te,ue=J(M,ee,B=="before");return fe!=null&&(ue.other=J(M,fe,B!="before")),ue}function Nk(a,c){var p=0;c=dt(a.doc,c),a.options.lineWrapping||(p=Fl(a.display)*c.ch);var h=Ge(a.doc,c.line),g=Eo(h)+nh(a.display);return{left:p,right:p,top:g,bottom:g+h.height}}function Tv(a,c,p,h,g){var b=se(a,c,p);return b.xRel=g,h&&(b.outside=h),b}function Ev(a,c,p){var h=a.doc;if(p+=a.display.viewOffset,p<0)return Tv(h.first,0,null,-1,-1);var g=Xi(h,p),b=h.first+h.size-1;if(g>b)return Tv(h.first+h.size-1,Ge(h,b).text.length,null,1,1);c<0&&(c=0);for(var S=Ge(h,g);;){var T=CI(a,S,g,c,p),M=QL(S,T.ch+(T.xRel>0||T.outside>0?1:0));if(!M)return T;var B=M.find(1);if(B.line==g)return B;S=Ge(h,g=B.line)}}function Lk(a,c,p,h){h-=Cv(c);var g=c.text.length,b=X(function(S){return eo(a,p,S-1).bottom<=h},g,0);return g=X(function(S){return eo(a,p,S).top>h},b,g),{begin:b,end:g}}function Ik(a,c,p,h){p||(p=$l(a,c));var g=rh(a,c,eo(a,p,h),"line").top;return Lk(a,c,p,g)}function Av(a,c,p,h){return a.bottom<=p?!1:a.top>p?!0:(h?a.left:a.right)>c}function CI(a,c,p,h,g){g-=Eo(c);var b=$l(a,c),S=Cv(c),T=0,M=c.text.length,B=!0,J=Ae(c,a.doc.direction);if(J){var ee=(a.options.lineWrapping?EI:TI)(a,c,p,b,J,h,g);B=ee.level!=1,T=B?ee.from:ee.to-1,M=B?ee.to:ee.from-1}var fe=null,ue=null,ke=X(function(nt){var et=eo(a,b,nt);return et.top+=S,et.bottom+=S,Av(et,h,g,!1)?(et.top<=g&&et.left<=h&&(fe=nt,ue=et),!0):!1},T,M),Ce,Me,De=!1;if(ue){var $e=h-ue.left=Ve.bottom?1:0}return ke=Y(c.text,ke,1),Tv(p,ke,Me,De,h-Ce)}function TI(a,c,p,h,g,b,S){var T=X(function(ee){var fe=g[ee],ue=fe.level!=1;return Av(Ei(a,se(p,ue?fe.to:fe.from,ue?"before":"after"),"line",c,h),b,S,!0)},0,g.length-1),M=g[T];if(T>0){var B=M.level!=1,J=Ei(a,se(p,B?M.from:M.to,B?"after":"before"),"line",c,h);Av(J,b,S,!0)&&J.top>S&&(M=g[T-1])}return M}function EI(a,c,p,h,g,b,S){var T=Lk(a,c,h,S),M=T.begin,B=T.end;/\s/.test(c.text.charAt(B-1))&&B--;for(var J=null,ee=null,fe=0;fe=B||ue.to<=M)){var ke=ue.level!=1,Ce=eo(a,h,ke?Math.min(B,ue.to)-1:Math.max(M,ue.from)).right,Me=CeMe)&&(J=ue,ee=Me)}}return J||(J=g[g.length-1]),J.fromB&&(J={from:J.from,to:B,level:J.level}),J}var ya;function Hl(a){if(a.cachedTextHeight!=null)return a.cachedTextHeight;if(ya==null){ya=D("pre",null,"CodeMirror-line-like");for(var c=0;c<49;++c)ya.appendChild(document.createTextNode("x")),ya.appendChild(D("br"));ya.appendChild(document.createTextNode("x"))}oe(a.measure,ya);var p=ya.offsetHeight/50;return p>3&&(a.cachedTextHeight=p),K(a.measure),p||1}function Fl(a){if(a.cachedCharWidth!=null)return a.cachedCharWidth;var c=D("span","xxxxxxxxxx"),p=D("pre",[c],"CodeMirror-line-like");oe(a.measure,p);var h=c.getBoundingClientRect(),g=(h.right-h.left)/10;return g>2&&(a.cachedCharWidth=g),g||10}function Ov(a){for(var c=a.display,p={},h={},g=c.gutters.clientLeft,b=c.gutters.firstChild,S=0;b;b=b.nextSibling,++S){var T=a.display.gutterSpecs[S].className;p[T]=b.offsetLeft+b.clientLeft+g,h[T]=b.clientWidth}return{fixedPos:Mv(c),gutterTotalWidth:c.gutters.offsetWidth,gutterLeft:p,gutterWidth:h,wrapperWidth:c.wrapper.clientWidth}}function Mv(a){return a.scroller.getBoundingClientRect().left-a.sizer.getBoundingClientRect().left}function Pk(a){var c=Hl(a.display),p=a.options.lineWrapping,h=p&&Math.max(5,a.display.scroller.clientWidth/Fl(a.display)-3);return function(g){if(hs(a.doc,g))return 0;var b=0;if(g.widgets)for(var S=0;S0&&(B=Ge(a.doc,M.line).text).length==M.ch){var J=Be(B,B.length,a.options.tabSize)-B.length;M=se(M.line,Math.max(0,Math.round((b-wk(a.display).left)/Fl(a.display))-J))}return M}function _a(a,c){if(c>=a.display.viewTo||(c-=a.display.viewFrom,c<0))return null;for(var p=a.display.view,h=0;hc)&&(g.updateLineNumbers=c),a.curOp.viewChanged=!0,c>=g.viewTo)To&&yv(a.doc,c)g.viewFrom?ms(a):(g.viewFrom+=h,g.viewTo+=h);else if(c<=g.viewFrom&&p>=g.viewTo)ms(a);else if(c<=g.viewFrom){var b=oh(a,p,p+h,1);b?(g.view=g.view.slice(b.index),g.viewFrom=b.lineN,g.viewTo+=h):ms(a)}else if(p>=g.viewTo){var S=oh(a,c,c,-1);S?(g.view=g.view.slice(0,S.index),g.viewTo=S.lineN):ms(a)}else{var T=oh(a,c,c,-1),M=oh(a,p,p+h,1);T&&M?(g.view=g.view.slice(0,T.index).concat(th(a,T.lineN,M.lineN)).concat(g.view.slice(M.index)),g.viewTo+=h):ms(a)}var B=g.externalMeasured;B&&(p=g.lineN&&c=h.viewTo)){var b=h.view[_a(a,c)];if(b.node!=null){var S=b.changes||(b.changes=[]);Ze(S,p)==-1&&S.push(p)}}}function ms(a){a.display.viewFrom=a.display.viewTo=a.doc.first,a.display.view=[],a.display.viewOffset=0}function oh(a,c,p,h){var g=_a(a,c),b,S=a.display.view;if(!To||p==a.doc.first+a.doc.size)return{index:g,lineN:p};for(var T=a.display.viewFrom,M=0;M0){if(g==S.length-1)return null;b=T+S[g].size-c,g++}else b=T-c;c+=b,p+=b}for(;yv(a.doc,p)!=p;){if(g==(h<0?0:S.length-1))return null;p+=h*S[g-(h<0?1:0)].size,g+=h}return{index:g,lineN:p}}function AI(a,c,p){var h=a.display,g=h.view;g.length==0||c>=h.viewTo||p<=h.viewFrom?(h.view=th(a,c,p),h.viewFrom=c):(h.viewFrom>c?h.view=th(a,c,h.viewFrom).concat(h.view):h.viewFromp&&(h.view=h.view.slice(0,_a(a,p)))),h.viewTo=p}function Dk(a){for(var c=a.display.view,p=0,h=0;h=a.display.viewTo||M.to().line0?S:a.defaultCharWidth())+"px"}if(h.other){var T=p.appendChild(D("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));T.style.display="",T.style.left=h.other.left+"px",T.style.top=h.other.top+"px",T.style.height=(h.other.bottom-h.other.top)*.85+"px"}}function sh(a,c){return a.top-c.top||a.left-c.left}function OI(a,c,p){var h=a.display,g=a.doc,b=document.createDocumentFragment(),S=wk(a.display),T=S.left,M=Math.max(h.sizerWidth,va(a)-h.sizer.offsetLeft)-S.right,B=g.direction=="ltr";function J(Re,Ve,nt,et){Ve<0&&(Ve=0),Ve=Math.round(Ve),et=Math.round(et),b.appendChild(D("div",null,"CodeMirror-selected","position: absolute; left: "+Re+`px; - top: `+Ve+"px; width: "+(nt??M-Re)+`px; - height: `+(et-Ve)+"px"))}function ee(Re,Ve,nt){var et=Ge(g,Re),St=et.text.length,Yt,Pn;function sn(wn,xr){return ih(a,se(Re,wn),"div",et,xr)}function Ir(wn,xr,jn){var Tn=Ik(a,et,null,wn),kn=xr=="ltr"==(jn=="after")?"left":"right",un=jn=="after"?Tn.begin:Tn.end-(/\s/.test(et.text.charAt(Tn.end-1))?2:1);return sn(un,kn)[kn]}var kr=Ae(et,g.direction);return de(kr,Ve||0,nt??St,function(wn,xr,jn,Tn){var kn=jn=="ltr",un=sn(wn,kn?"left":"right"),Sr=sn(xr-1,kn?"right":"left"),eu=Ve==null&&wn==0,ws=nt==null&&xr==St,Yn=Tn==0,to=!kr||Tn==kr.length-1;if(Sr.top-un.top<=3){var Dn=(B?eu:ws)&&Yn,oy=(B?ws:eu)&&to,No=Dn?T:(kn?un:Sr).left,Ca=oy?M:(kn?Sr:un).right;J(No,un.top,Ca-No,un.bottom)}else{var Ta,ar,tu,sy;kn?(Ta=B&&eu&&Yn?T:un.left,ar=B?M:Ir(wn,jn,"before"),tu=B?T:Ir(xr,jn,"after"),sy=B&&ws&&to?M:Sr.right):(Ta=B?Ir(wn,jn,"before"):T,ar=!B&&eu&&Yn?M:un.right,tu=!B&&ws&&to?T:Sr.left,sy=B?Ir(xr,jn,"after"):M),J(Ta,un.top,ar-Ta,un.bottom),un.bottom0?c.blinker=setInterval(function(){a.hasFocus()||Vl(a),c.cursorDiv.style.visibility=(p=!p)?"":"hidden"},a.options.cursorBlinkRate):a.options.cursorBlinkRate<0&&(c.cursorDiv.style.visibility="hidden")}}function zk(a){a.hasFocus()||(a.display.input.focus(),a.state.focused||Dv(a))}function Pv(a){a.state.delayingBlurEvent=!0,setTimeout(function(){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1,a.state.focused&&Vl(a))},100)}function Dv(a,c){a.state.delayingBlurEvent&&!a.state.draggingText&&(a.state.delayingBlurEvent=!1),a.options.readOnly!="nocursor"&&(a.state.focused||(ot(a,"focus",a,c),a.state.focused=!0,qe(a.display.wrapper,"CodeMirror-focused"),!a.curOp&&a.display.selForContextMenu!=a.doc.sel&&(a.display.input.reset(),d&&setTimeout(function(){return a.display.input.reset(!0)},20)),a.display.input.receivedFocus()),Iv(a))}function Vl(a,c){a.state.delayingBlurEvent||(a.state.focused&&(ot(a,"blur",a,c),a.state.focused=!1,U(a.display.wrapper,"CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.display.shift=!1)},150))}function ah(a){for(var c=a.display,p=c.lineDiv.offsetTop,h=Math.max(0,c.scroller.getBoundingClientRect().top),g=c.lineDiv.getBoundingClientRect().top,b=0,S=0;S.005||ue<-.005)&&(ga.display.sizerWidth){var Ce=Math.ceil(J/Fl(a.display));Ce>a.display.maxLineLength&&(a.display.maxLineLength=Ce,a.display.maxLine=T.line,a.display.maxLineChanged=!0)}}}Math.abs(b)>2&&(c.scroller.scrollTop+=b)}function Bk(a){if(a.widgets)for(var c=0;c=S&&(b=Xi(c,Eo(Ge(c,M))-a.wrapper.clientHeight),S=M)}return{from:b,to:Math.max(S,b+1)}}function MI(a,c){if(!Tt(a,"scrollCursorIntoView")){var p=a.display,h=p.sizer.getBoundingClientRect(),g=null,b=p.wrapper.ownerDocument;if(c.top+h.top<0?g=!0:c.bottom+h.top>(b.defaultView.innerHeight||b.documentElement.clientHeight)&&(g=!1),g!=null&&!k){var S=D("div","​",null,`position: absolute; - top: `+(c.top-p.viewOffset-nh(a.display))+`px; - height: `+(c.bottom-c.top+Qi(a)+p.barHeight)+`px; - left: `+c.left+"px; width: "+Math.max(2,c.right-c.left)+"px;");a.display.lineSpace.appendChild(S),S.scrollIntoView(g),a.display.lineSpace.removeChild(S)}}}function NI(a,c,p,h){h==null&&(h=0);var g;!a.options.lineWrapping&&c==p&&(p=c.sticky=="before"?se(c.line,c.ch+1,"before"):c,c=c.ch?se(c.line,c.sticky=="before"?c.ch-1:c.ch,"after"):c);for(var b=0;b<5;b++){var S=!1,T=Ei(a,c),M=!p||p==c?T:Ei(a,p);g={left:Math.min(T.left,M.left),top:Math.min(T.top,M.top)-h,right:Math.max(T.left,M.left),bottom:Math.max(T.bottom,M.bottom)+h};var B=Rv(a,g),J=a.doc.scrollTop,ee=a.doc.scrollLeft;if(B.scrollTop!=null&&(Cc(a,B.scrollTop),Math.abs(a.doc.scrollTop-J)>1&&(S=!0)),B.scrollLeft!=null&&(wa(a,B.scrollLeft),Math.abs(a.doc.scrollLeft-ee)>1&&(S=!0)),!S)break}return g}function LI(a,c){var p=Rv(a,c);p.scrollTop!=null&&Cc(a,p.scrollTop),p.scrollLeft!=null&&wa(a,p.scrollLeft)}function Rv(a,c){var p=a.display,h=Hl(a.display);c.top<0&&(c.top=0);var g=a.curOp&&a.curOp.scrollTop!=null?a.curOp.scrollTop:p.scroller.scrollTop,b=xv(a),S={};c.bottom-c.top>b&&(c.bottom=c.top+b);var T=a.doc.height+kv(p),M=c.topT-h;if(c.topg+b){var J=Math.min(c.top,(B?T:c.bottom)-b);J!=g&&(S.scrollTop=J)}var ee=a.options.fixedGutter?0:p.gutters.offsetWidth,fe=a.curOp&&a.curOp.scrollLeft!=null?a.curOp.scrollLeft:p.scroller.scrollLeft-ee,ue=va(a)-p.gutters.offsetWidth,ke=c.right-c.left>ue;return ke&&(c.right=c.left+ue),c.left<10?S.scrollLeft=0:c.leftue+fe-3&&(S.scrollLeft=c.right+(ke?0:10)-ue),S}function zv(a,c){c!=null&&(uh(a),a.curOp.scrollTop=(a.curOp.scrollTop==null?a.doc.scrollTop:a.curOp.scrollTop)+c)}function jl(a){uh(a);var c=a.getCursor();a.curOp.scrollToPos={from:c,to:c,margin:a.options.cursorScrollMargin}}function Sc(a,c,p){(c!=null||p!=null)&&uh(a),c!=null&&(a.curOp.scrollLeft=c),p!=null&&(a.curOp.scrollTop=p)}function II(a,c){uh(a),a.curOp.scrollToPos=c}function uh(a){var c=a.curOp.scrollToPos;if(c){a.curOp.scrollToPos=null;var p=Nk(a,c.from),h=Nk(a,c.to);$k(a,p,h,c.margin)}}function $k(a,c,p,h){var g=Rv(a,{left:Math.min(c.left,p.left),top:Math.min(c.top,p.top)-h,right:Math.max(c.right,p.right),bottom:Math.max(c.bottom,p.bottom)+h});Sc(a,g.scrollLeft,g.scrollTop)}function Cc(a,c){Math.abs(a.doc.scrollTop-c)<2||(i||$v(a,{top:c}),Hk(a,c,!0),i&&$v(a),Ac(a,100))}function Hk(a,c,p){c=Math.max(0,Math.min(a.display.scroller.scrollHeight-a.display.scroller.clientHeight,c)),!(a.display.scroller.scrollTop==c&&!p)&&(a.doc.scrollTop=c,a.display.scrollbars.setScrollTop(c),a.display.scroller.scrollTop!=c&&(a.display.scroller.scrollTop=c))}function wa(a,c,p,h){c=Math.max(0,Math.min(c,a.display.scroller.scrollWidth-a.display.scroller.clientWidth)),!((p?c==a.doc.scrollLeft:Math.abs(a.doc.scrollLeft-c)<2)&&!h)&&(a.doc.scrollLeft=c,Uk(a),a.display.scroller.scrollLeft!=c&&(a.display.scroller.scrollLeft=c),a.display.scrollbars.setScrollLeft(c))}function Tc(a){var c=a.display,p=c.gutters.offsetWidth,h=Math.round(a.doc.height+kv(a.display));return{clientHeight:c.scroller.clientHeight,viewHeight:c.wrapper.clientHeight,scrollWidth:c.scroller.scrollWidth,clientWidth:c.scroller.clientWidth,viewWidth:c.wrapper.clientWidth,barLeft:a.options.fixedGutter?p:0,docHeight:h,scrollHeight:h+Qi(a)+c.barHeight,nativeBarWidth:c.nativeBarWidth,gutterWidth:p}}var ka=function(a,c,p){this.cm=p;var h=this.vert=D("div",[D("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),g=this.horiz=D("div",[D("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");h.tabIndex=g.tabIndex=-1,a(h),a(g),me(h,"scroll",function(){h.clientHeight&&c(h.scrollTop,"vertical")}),me(g,"scroll",function(){g.clientWidth&&c(g.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,u&&f<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ka.prototype.update=function(a){var c=a.scrollWidth>a.clientWidth+1,p=a.scrollHeight>a.clientHeight+1,h=a.nativeBarWidth;if(p){this.vert.style.display="block",this.vert.style.bottom=c?h+"px":"0";var g=a.viewHeight-(c?h:0);this.vert.firstChild.style.height=Math.max(0,a.scrollHeight-a.clientHeight+g)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(c){this.horiz.style.display="block",this.horiz.style.right=p?h+"px":"0",this.horiz.style.left=a.barLeft+"px";var b=a.viewWidth-a.barLeft-(p?h:0);this.horiz.firstChild.style.width=Math.max(0,a.scrollWidth-a.clientWidth+b)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&a.clientHeight>0&&(h==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:p?h:0,bottom:c?h:0}},ka.prototype.setScrollLeft=function(a){this.horiz.scrollLeft!=a&&(this.horiz.scrollLeft=a),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ka.prototype.setScrollTop=function(a){this.vert.scrollTop!=a&&(this.vert.scrollTop=a),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ka.prototype.zeroWidthHack=function(){var a=H&&!x?"12px":"18px";this.horiz.style.height=this.vert.style.width=a,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Ee,this.disableVert=new Ee},ka.prototype.enableZeroWidthBar=function(a,c,p){a.style.visibility="";function h(){var g=a.getBoundingClientRect(),b=p=="vert"?document.elementFromPoint(g.right-1,(g.top+g.bottom)/2):document.elementFromPoint((g.right+g.left)/2,g.bottom-1);b!=a?a.style.visibility="hidden":c.set(1e3,h)}c.set(1e3,h)},ka.prototype.clear=function(){var a=this.horiz.parentNode;a.removeChild(this.horiz),a.removeChild(this.vert)};var Ec=function(){};Ec.prototype.update=function(){return{bottom:0,right:0}},Ec.prototype.setScrollLeft=function(){},Ec.prototype.setScrollTop=function(){},Ec.prototype.clear=function(){};function Wl(a,c){c||(c=Tc(a));var p=a.display.barWidth,h=a.display.barHeight;Fk(a,c);for(var g=0;g<4&&p!=a.display.barWidth||h!=a.display.barHeight;g++)p!=a.display.barWidth&&a.options.lineWrapping&&ah(a),Fk(a,Tc(a)),p=a.display.barWidth,h=a.display.barHeight}function Fk(a,c){var p=a.display,h=p.scrollbars.update(c);p.sizer.style.paddingRight=(p.barWidth=h.right)+"px",p.sizer.style.paddingBottom=(p.barHeight=h.bottom)+"px",p.heightForcer.style.borderBottom=h.bottom+"px solid transparent",h.right&&h.bottom?(p.scrollbarFiller.style.display="block",p.scrollbarFiller.style.height=h.bottom+"px",p.scrollbarFiller.style.width=h.right+"px"):p.scrollbarFiller.style.display="",h.bottom&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(p.gutterFiller.style.display="block",p.gutterFiller.style.height=h.bottom+"px",p.gutterFiller.style.width=c.gutterWidth+"px"):p.gutterFiller.style.display=""}var Vk={native:ka,null:Ec};function jk(a){a.display.scrollbars&&(a.display.scrollbars.clear(),a.display.scrollbars.addClass&&U(a.display.wrapper,a.display.scrollbars.addClass)),a.display.scrollbars=new Vk[a.options.scrollbarStyle](function(c){a.display.wrapper.insertBefore(c,a.display.scrollbarFiller),me(c,"mousedown",function(){a.state.focused&&setTimeout(function(){return a.display.input.focus()},0)}),c.setAttribute("cm-not-content","true")},function(c,p){p=="horizontal"?wa(a,c):Cc(a,c)},a),a.display.scrollbars.addClass&&qe(a.display.wrapper,a.display.scrollbars.addClass)}var PI=0;function xa(a){a.curOp={cm:a,viewChanged:!1,startHeight:a.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++PI,markArrays:null},fI(a.curOp)}function Sa(a){var c=a.curOp;c&&hI(c,function(p){for(var h=0;h=p.viewTo)||p.maxLineChanged&&c.options.lineWrapping,a.update=a.mustUpdate&&new ch(c,a.mustUpdate&&{top:a.scrollTop,ensure:a.scrollToPos},a.forceUpdate)}function zI(a){a.updatedDisplay=a.mustUpdate&&Bv(a.cm,a.update)}function BI(a){var c=a.cm,p=c.display;a.updatedDisplay&&ah(c),a.barMeasure=Tc(c),p.maxLineChanged&&!c.options.lineWrapping&&(a.adjustWidthTo=xk(c,p.maxLine,p.maxLine.text.length).left+3,c.display.sizerWidth=a.adjustWidthTo,a.barMeasure.scrollWidth=Math.max(p.scroller.clientWidth,p.sizer.offsetLeft+a.adjustWidthTo+Qi(c)+c.display.barWidth),a.maxScrollLeft=Math.max(0,p.sizer.offsetLeft+a.adjustWidthTo-va(c))),(a.updatedDisplay||a.selectionChanged)&&(a.preparedSelection=p.input.prepareSelection())}function $I(a){var c=a.cm;a.adjustWidthTo!=null&&(c.display.sizer.style.minWidth=a.adjustWidthTo+"px",a.maxScrollLeft=a.display.viewTo)){var p=+new Date+a.options.workTime,h=vc(a,c.highlightFrontier),g=[];c.iter(h.line,Math.min(c.first+c.size,a.display.viewTo+500),function(b){if(h.line>=a.display.viewFrom){var S=b.styles,T=b.text.length>a.options.maxHighlightLength?So(c.mode,h.state):null,M=Xw(a,b,h,!0);T&&(h.state=T),b.styles=M.styles;var B=b.styleClasses,J=M.classes;J?b.styleClasses=J:B&&(b.styleClasses=null);for(var ee=!S||S.length!=b.styles.length||B!=J&&(!B||!J||B.bgClass!=J.bgClass||B.textClass!=J.textClass),fe=0;!ee&&fep)return Ac(a,a.options.workDelay),!0}),c.highlightFrontier=h.line,c.modeFrontier=Math.max(c.modeFrontier,h.line),g.length&&Lr(a,function(){for(var b=0;b=p.viewFrom&&c.visible.to<=p.viewTo&&(p.updateLineNumbers==null||p.updateLineNumbers>=p.viewTo)&&p.renderedView==p.view&&Dk(a)==0)return!1;qk(a)&&(ms(a),c.dims=Ov(a));var g=h.first+h.size,b=Math.max(c.visible.from-a.options.viewportMargin,h.first),S=Math.min(g,c.visible.to+a.options.viewportMargin);p.viewFromS&&p.viewTo-S<20&&(S=Math.min(g,p.viewTo)),To&&(b=yv(a.doc,b),S=fk(a.doc,S));var T=b!=p.viewFrom||S!=p.viewTo||p.lastWrapHeight!=c.wrapperHeight||p.lastWrapWidth!=c.wrapperWidth;AI(a,b,S),p.viewOffset=Eo(Ge(a.doc,p.viewFrom)),a.display.mover.style.top=p.viewOffset+"px";var M=Dk(a);if(!T&&M==0&&!c.force&&p.renderedView==p.view&&(p.updateLineNumbers==null||p.updateLineNumbers>=p.viewTo))return!1;var B=jI(a);return M>4&&(p.lineDiv.style.display="none"),UI(a,p.updateLineNumbers,c.dims),M>4&&(p.lineDiv.style.display=""),p.renderedView=p.view,WI(B),K(p.cursorDiv),K(p.selectionDiv),p.gutters.style.height=p.sizer.style.minHeight=0,T&&(p.lastWrapHeight=c.wrapperHeight,p.lastWrapWidth=c.wrapperWidth,Ac(a,400)),p.updateLineNumbers=null,!0}function Wk(a,c){for(var p=c.viewport,h=!0;;h=!1){if(!h||!a.options.lineWrapping||c.oldDisplayWidth==va(a)){if(p&&p.top!=null&&(p={top:Math.min(a.doc.height+kv(a.display)-xv(a),p.top)}),c.visible=lh(a.display,a.doc,p),c.visible.from>=a.display.viewFrom&&c.visible.to<=a.display.viewTo)break}else h&&(c.visible=lh(a.display,a.doc,p));if(!Bv(a,c))break;ah(a);var g=Tc(a);xc(a),Wl(a,g),Fv(a,g),c.force=!1}c.signal(a,"update",a),(a.display.viewFrom!=a.display.reportedViewFrom||a.display.viewTo!=a.display.reportedViewTo)&&(c.signal(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo),a.display.reportedViewFrom=a.display.viewFrom,a.display.reportedViewTo=a.display.viewTo)}function $v(a,c){var p=new ch(a,c);if(Bv(a,p)){ah(a),Wk(a,p);var h=Tc(a);xc(a),Wl(a,h),Fv(a,h),p.finish()}}function UI(a,c,p){var h=a.display,g=a.options.lineNumbers,b=h.lineDiv,S=b.firstChild;function T(ke){var Ce=ke.nextSibling;return d&&H&&a.display.currentWheelTarget==ke?ke.style.display="none":ke.parentNode.removeChild(ke),Ce}for(var M=h.view,B=h.viewFrom,J=0;J-1&&(ue=!1),gk(a,ee,B,p)),ue&&(K(ee.lineNumber),ee.lineNumber.appendChild(document.createTextNode(ne(a.options,B)))),S=ee.node.nextSibling}B+=ee.size}for(;S;)S=T(S)}function Hv(a){var c=a.gutters.offsetWidth;a.sizer.style.marginLeft=c+"px",Nn(a,"gutterChanged",a)}function Fv(a,c){a.display.sizer.style.minHeight=c.docHeight+"px",a.display.heightForcer.style.top=c.docHeight+"px",a.display.gutters.style.height=c.docHeight+a.display.barHeight+Qi(a)+"px"}function Uk(a){var c=a.display,p=c.view;if(!(!c.alignWidgets&&(!c.gutters.firstChild||!a.options.fixedGutter))){for(var h=Mv(c)-c.scroller.scrollLeft+a.doc.scrollLeft,g=c.gutters.offsetWidth,b=h+"px",S=0;S=105&&(g.wrapper.style.clipPath="inset(0px)"),g.wrapper.setAttribute("translate","no"),u&&f<8&&(g.gutters.style.zIndex=-1,g.scroller.style.paddingRight=0),!d&&!(i&&E)&&(g.scroller.draggable=!0),a&&(a.appendChild?a.appendChild(g.wrapper):a(g.wrapper)),g.viewFrom=g.viewTo=c.first,g.reportedViewFrom=g.reportedViewTo=c.first,g.view=[],g.renderedView=null,g.externalMeasured=null,g.viewOffset=0,g.lastWrapHeight=g.lastWrapWidth=0,g.updateLineNumbers=null,g.nativeBarWidth=g.barHeight=g.barWidth=0,g.scrollbarsClipped=!1,g.lineNumWidth=g.lineNumInnerWidth=g.lineNumChars=null,g.alignWidgets=!1,g.cachedCharWidth=g.cachedTextHeight=g.cachedPaddingH=null,g.maxLine=null,g.maxLineLength=0,g.maxLineChanged=!1,g.wheelDX=g.wheelDY=g.wheelStartX=g.wheelStartY=null,g.shift=!1,g.selForContextMenu=null,g.activeTouch=null,g.gutterSpecs=Vv(h.gutters,h.lineNumbers),Kk(g),p.init(g)}var fh=0,Oo=null;u?Oo=-.53:i?Oo=15:v?Oo=-.7:C&&(Oo=-1/3);function Gk(a){var c=a.wheelDeltaX,p=a.wheelDeltaY;return c==null&&a.detail&&a.axis==a.HORIZONTAL_AXIS&&(c=a.detail),p==null&&a.detail&&a.axis==a.VERTICAL_AXIS?p=a.detail:p==null&&(p=a.wheelDelta),{x:c,y:p}}function KI(a){var c=Gk(a);return c.x*=Oo,c.y*=Oo,c}function Yk(a,c){v&&y==102&&(a.display.chromeScrollHack==null?a.display.sizer.style.pointerEvents="none":clearTimeout(a.display.chromeScrollHack),a.display.chromeScrollHack=setTimeout(function(){a.display.chromeScrollHack=null,a.display.sizer.style.pointerEvents=""},100));var p=Gk(c),h=p.x,g=p.y,b=Oo;c.deltaMode===0&&(h=c.deltaX,g=c.deltaY,b=1);var S=a.display,T=S.scroller,M=T.scrollWidth>T.clientWidth,B=T.scrollHeight>T.clientHeight;if(h&&M||g&&B){if(g&&H&&d){e:for(var J=c.target,ee=S.view;J!=T;J=J.parentNode)for(var fe=0;fe=0&&we(a,h.to())<=0)return p}return-1};var Ht=function(a,c){this.anchor=a,this.head=c};Ht.prototype.from=function(){return Cn(this.anchor,this.head)},Ht.prototype.to=function(){return It(this.anchor,this.head)},Ht.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ai(a,c,p){var h=a&&a.options.selectionsMayTouch,g=c[p];c.sort(function(fe,ue){return we(fe.from(),ue.from())}),p=Ze(c,g);for(var b=1;b0:M>=0){var B=Cn(T.from(),S.from()),J=It(T.to(),S.to()),ee=T.empty()?S.from()==S.head:T.from()==T.head;b<=p&&--p,c.splice(--b,2,new Ht(ee?J:B,ee?B:J))}}return new Xr(c,p)}function gs(a,c){return new Xr([new Ht(a,c||a)],0)}function vs(a){return a.text?se(a.from.line+a.text.length-1,G(a.text).length+(a.text.length==1?a.from.ch:0)):a.to}function Jk(a,c){if(we(a,c.from)<0)return a;if(we(a,c.to)<=0)return vs(c);var p=a.line+c.text.length-(c.to.line-c.from.line)-1,h=a.ch;return a.line==c.to.line&&(h+=vs(c).ch-c.to.ch),se(p,h)}function jv(a,c){for(var p=[],h=0;h1&&a.remove(T.line+1,ke-1),a.insert(T.line+1,De)}Nn(a,"change",a,c)}function ys(a,c,p){function h(g,b,S){if(g.linked)for(var T=0;T1&&!a.done[a.done.length-2].ranges)return a.done.pop(),G(a.done)}function nx(a,c,p,h){var g=a.history;g.undone.length=0;var b=+new Date,S,T;if((g.lastOp==h||g.lastOrigin==c.origin&&c.origin&&(c.origin.charAt(0)=="+"&&g.lastModTime>b-(a.cm?a.cm.options.historyEventDelay:500)||c.origin.charAt(0)=="*"))&&(S=JI(g,g.lastOp==h)))T=G(S.changes),we(c.from,c.to)==0&&we(c.from,T.to)==0?T.to=vs(c):S.changes.push(qv(a,c));else{var M=G(g.done);for((!M||!M.ranges)&&hh(a.sel,g.done),S={changes:[qv(a,c)],generation:g.generation},g.done.push(S);g.done.length>g.undoDepth;)g.done.shift(),g.done[0].ranges||g.done.shift()}g.done.push(p),g.generation=++g.maxGeneration,g.lastModTime=g.lastSelTime=b,g.lastOp=g.lastSelOp=h,g.lastOrigin=g.lastSelOrigin=c.origin,T||ot(a,"historyAdded")}function XI(a,c,p,h){var g=c.charAt(0);return g=="*"||g=="+"&&p.ranges.length==h.ranges.length&&p.somethingSelected()==h.somethingSelected()&&new Date-a.history.lastSelTime<=(a.cm?a.cm.options.historyEventDelay:500)}function ZI(a,c,p,h){var g=a.history,b=h&&h.origin;p==g.lastSelOp||b&&g.lastSelOrigin==b&&(g.lastModTime==g.lastSelTime&&g.lastOrigin==b||XI(a,b,G(g.done),c))?g.done[g.done.length-1]=c:hh(c,g.done),g.lastSelTime=+new Date,g.lastSelOrigin=b,g.lastSelOp=p,h&&h.clearRedo!==!1&&tx(g.undone)}function hh(a,c){var p=G(c);p&&p.ranges&&p.equals(a)||c.push(a)}function rx(a,c,p,h){var g=c["spans_"+a.id],b=0;a.iter(Math.max(a.first,p),Math.min(a.first+a.size,h),function(S){S.markedSpans&&((g||(g=c["spans_"+a.id]={}))[b]=S.markedSpans),++b})}function QI(a){if(!a)return null;for(var c,p=0;p-1&&(G(T)[ee]=B[ee],delete B[ee])}}return h}function Kv(a,c,p,h){if(h){var g=a.anchor;if(p){var b=we(c,g)<0;b!=we(p,g)<0?(g=c,c=p):b!=we(c,p)<0&&(c=p)}return new Ht(g,c)}else return new Ht(p||c,c)}function ph(a,c,p,h,g){g==null&&(g=a.cm&&(a.cm.display.shift||a.extend)),Gn(a,new Xr([Kv(a.sel.primary(),c,p,g)],0),h)}function ox(a,c,p){for(var h=[],g=a.cm&&(a.cm.display.shift||a.extend),b=0;b=c.ch:T.to>c.ch))){if(g&&(ot(M,"beforeCursorEnter"),M.explicitlyCleared))if(b.markedSpans){--S;continue}else break;if(!M.atomic)continue;if(p){var ee=M.find(h<0?1:-1),fe=void 0;if((h<0?J:B)&&(ee=fx(a,ee,-h,ee&&ee.line==c.line?b:null)),ee&&ee.line==c.line&&(fe=we(ee,p))&&(h<0?fe<0:fe>0))return ql(a,ee,c,h,g)}var ue=M.find(h<0?-1:1);return(h<0?B:J)&&(ue=fx(a,ue,h,ue.line==c.line?b:null)),ue?ql(a,ue,c,h,g):null}}return c}function gh(a,c,p,h,g){var b=h||1,S=ql(a,c,p,b,g)||!g&&ql(a,c,p,b,!0)||ql(a,c,p,-b,g)||!g&&ql(a,c,p,-b,!0);return S||(a.cantEdit=!0,se(a.first,0))}function fx(a,c,p,h){return p<0&&c.ch==0?c.line>a.first?dt(a,se(c.line-1)):null:p>0&&c.ch==(h||Ge(a,c.line)).text.length?c.line=0;--g)px(a,{from:h[g].from,to:h[g].to,text:g?[""]:c.text,origin:c.origin});else px(a,c)}}function px(a,c){if(!(c.text.length==1&&c.text[0]==""&&we(c.from,c.to)==0)){var p=jv(a,c);nx(a,c,p,a.cm?a.cm.curOp.id:NaN),Nc(a,c,p,gv(a,c));var h=[];ys(a,function(g,b){!b&&Ze(h,g.history)==-1&&(yx(g.history,c),h.push(g.history)),Nc(g,c,null,gv(g,c))})}}function vh(a,c,p){var h=a.cm&&a.cm.state.suppressEdits;if(!(h&&!p)){for(var g=a.history,b,S=a.sel,T=c=="undo"?g.done:g.undone,M=c=="undo"?g.undone:g.done,B=0;B=0;--ue){var ke=fe(ue);if(ke)return ke.v}}}}function mx(a,c){if(c!=0&&(a.first+=c,a.sel=new Xr(Z(a.sel.ranges,function(g){return new Ht(se(g.anchor.line+c,g.anchor.ch),se(g.head.line+c,g.head.ch))}),a.sel.primIndex),a.cm)){_r(a.cm,a.first,a.first-c,c);for(var p=a.cm.display,h=p.viewFrom;ha.lastLine())){if(c.from.lineb&&(c={from:c.from,to:se(b,Ge(a,b).text.length),text:[c.text[0]],origin:c.origin}),c.removed=Co(a,c.from,c.to),p||(p=jv(a,c)),a.cm?nP(a.cm,c,h):Uv(a,c,h),mh(a,p,at),a.cantEdit&&gh(a,se(a.firstLine(),0))&&(a.cantEdit=!1)}}function nP(a,c,p){var h=a.doc,g=a.display,b=c.from,S=c.to,T=!1,M=b.line;a.options.lineWrapping||(M=$t(Ti(Ge(h,b.line))),h.iter(M,S.line+1,function(ue){if(ue==g.maxLine)return T=!0,!0})),h.sel.contains(c.from,c.to)>-1&&br(a),Uv(h,c,p,Pk(a)),a.options.lineWrapping||(h.iter(M,b.line+c.text.length,function(ue){var ke=eh(ue);ke>g.maxLineLength&&(g.maxLine=ue,g.maxLineLength=ke,g.maxLineChanged=!0,T=!1)}),T&&(a.curOp.updateMaxLine=!0)),UL(h,b.line),Ac(a,400);var B=c.text.length-(S.line-b.line)-1;c.full?_r(a):b.line==S.line&&c.text.length==1&&!Zk(a.doc,c)?ps(a,b.line,"text"):_r(a,b.line,S.line+1,B);var J=Kt(a,"changes"),ee=Kt(a,"change");if(ee||J){var fe={from:b,to:S,text:c.text,removed:c.removed,origin:c.origin};ee&&Nn(a,"change",a,fe),J&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(fe)}a.display.selForContextMenu=null}function Gl(a,c,p,h,g){var b;h||(h=p),we(h,p)<0&&(b=[h,p],p=b[0],h=b[1]),typeof c=="string"&&(c=a.splitLines(c)),Kl(a,{from:p,to:h,text:c,origin:g})}function gx(a,c,p,h){p1||!(this.children[0]instanceof Ic))){var T=[];this.collapse(T),this.children=[new Ic(T)],this.children[0].parent=this}},collapse:function(a){for(var c=0;c50){for(var S=g.lines.length%25+25,T=S;T10);a.parent.maybeSpill()}},iterN:function(a,c,p){for(var h=0;ha.display.maxLineLength&&(a.display.maxLine=B,a.display.maxLineLength=J,a.display.maxLineChanged=!0)}h!=null&&a&&this.collapsed&&_r(a,h,g+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&ux(a.doc)),a&&Nn(a,"markerCleared",a,this,h,g),c&&Sa(a),this.parent&&this.parent.clear()}},bs.prototype.find=function(a,c){a==null&&this.type=="bookmark"&&(a=1);for(var p,h,g=0;g0||S==0&&b.clearWhenEmpty!==!1)return b;if(b.replacedWith&&(b.collapsed=!0,b.widgetNode=ae("span",[b.replacedWith],"CodeMirror-widget"),h.handleMouseEvents||b.widgetNode.setAttribute("cm-ignore-events","true"),h.insertLeft&&(b.widgetNode.insertLeft=!0)),b.collapsed){if(ck(a,c.line,c,p,b)||c.line!=p.line&&ck(a,p.line,c,p,b))throw new Error("Inserting collapsed marker partially overlapping an existing one");KL()}b.addToHistory&&nx(a,{from:c,to:p,origin:"markText"},a.sel,NaN);var T=c.line,M=a.cm,B;if(a.iter(T,p.line+1,function(ee){M&&b.collapsed&&!M.options.lineWrapping&&Ti(ee)==M.display.maxLine&&(B=!0),b.collapsed&&T!=c.line&&fi(ee,0),YL(ee,new Jd(b,T==c.line?c.ch:null,T==p.line?p.ch:null),a.cm&&a.cm.curOp),++T}),b.collapsed&&a.iter(c.line,p.line+1,function(ee){hs(a,ee)&&fi(ee,0)}),b.clearOnEnter&&me(b,"beforeCursorEnter",function(){return b.clear()}),b.readOnly&&(qL(),(a.history.done.length||a.history.undone.length)&&a.clearHistory()),b.collapsed&&(b.id=++_x,b.atomic=!0),M){if(B&&(M.curOp.updateMaxLine=!0),b.collapsed)_r(M,c.line,p.line+1);else if(b.className||b.startStyle||b.endStyle||b.css||b.attributes||b.title)for(var J=c.line;J<=p.line;J++)ps(M,J,"text");b.atomic&&ux(M.doc),Nn(M,"markerAdded",M,b)}return b}var Rc=function(a,c){this.markers=a,this.primary=c;for(var p=0;p=0;M--)Kl(this,h[M]);T?ax(this,T):this.cm&&jl(this.cm)}),undo:In(function(){vh(this,"undo")}),redo:In(function(){vh(this,"redo")}),undoSelection:In(function(){vh(this,"undo",!0)}),redoSelection:In(function(){vh(this,"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,c=0,p=0,h=0;h=a.ch)&&c.push(g.marker.parent||g.marker)}return c},findMarks:function(a,c,p){a=dt(this,a),c=dt(this,c);var h=[],g=a.line;return this.iter(a.line,c.line+1,function(b){var S=b.markedSpans;if(S)for(var T=0;T=M.to||M.from==null&&g!=a.line||M.from!=null&&g==c.line&&M.from>=c.ch)&&(!p||p(M.marker))&&h.push(M.marker.parent||M.marker)}++g}),h},getAllMarks:function(){var a=[];return this.iter(function(c){var p=c.markedSpans;if(p)for(var h=0;ha)return c=a,!0;a-=b,++p}),dt(this,se(p,c))},indexFromPos:function(a){a=dt(this,a);var c=a.ch;if(a.linec&&(c=a.from),a.to!=null&&a.to-1){c.state.draggingText(a),setTimeout(function(){return c.display.input.focus()},20);return}try{var J=a.dataTransfer.getData("Text");if(J){var ee;if(c.state.draggingText&&!c.state.draggingText.copy&&(ee=c.listSelections()),mh(c.doc,gs(p,p)),ee)for(var fe=0;fe=0;T--)Gl(a.doc,"",h[T].from,h[T].to,"+delete");jl(a)})}function Yv(a,c,p){var h=Y(a.text,c+p,p);return h<0||h>a.text.length?null:h}function Jv(a,c,p){var h=Yv(a,c.ch,p);return h==null?null:new se(c.line,h,p<0?"after":"before")}function Xv(a,c,p,h,g){if(a){c.doc.direction=="rtl"&&(g=-g);var b=Ae(p,c.doc.direction);if(b){var S=g<0?G(b):b[0],T=g<0==(S.level==1),M=T?"after":"before",B;if(S.level>0||c.doc.direction=="rtl"){var J=$l(c,p);B=g<0?p.text.length-1:0;var ee=eo(c,J,B).top;B=X(function(fe){return eo(c,J,fe).top==ee},g<0==(S.level==1)?S.from:S.to-1,B),M=="before"&&(B=Yv(p,B,1))}else B=g<0?S.to:S.from;return new se(h,B,M)}}return new se(h,g<0?p.text.length:0,g<0?"before":"after")}function gP(a,c,p,h){var g=Ae(c,a.doc.direction);if(!g)return Jv(c,p,h);p.ch>=c.text.length?(p.ch=c.text.length,p.sticky="before"):p.ch<=0&&(p.ch=0,p.sticky="after");var b=je(g,p.ch,p.sticky),S=g[b];if(a.doc.direction=="ltr"&&S.level%2==0&&(h>0?S.to>p.ch:S.from=S.from&&fe>=J.begin)){var ue=ee?"before":"after";return new se(p.line,fe,ue)}}var ke=function(De,$e,Re){for(var Ve=function(Yt,Pn){return Pn?new se(p.line,T(Yt,1),"before"):new se(p.line,Yt,"after")};De>=0&&De0==(nt.level!=1),St=et?Re.begin:T(Re.end,-1);if(nt.from<=St&&St0?J.end:T(J.begin,-1);return Me!=null&&!(h>0&&Me==c.text.length)&&(Ce=ke(h>0?0:g.length-1,h,B(Me)),Ce)?Ce:null}var $c={selectAll:dx,singleSelection:function(a){return a.setSelection(a.getCursor("anchor"),a.getCursor("head"),at)},killLine:function(a){return Xl(a,function(c){if(c.empty()){var p=Ge(a.doc,c.head.line).text.length;return c.head.ch==p&&c.head.line0)g=new se(g.line,g.ch+1),a.replaceRange(b.charAt(g.ch-1)+b.charAt(g.ch-2),se(g.line,g.ch-2),g,"+transpose");else if(g.line>a.doc.first){var S=Ge(a.doc,g.line-1).text;S&&(g=new se(g.line,1),a.replaceRange(b.charAt(0)+a.doc.lineSeparator()+S.charAt(S.length-1),se(g.line-1,S.length-1),g,"+transpose"))}}p.push(new Ht(g,g))}a.setSelections(p)})},newlineAndIndent:function(a){return Lr(a,function(){for(var c=a.listSelections(),p=c.length-1;p>=0;p--)a.replaceRange(a.doc.lineSeparator(),c[p].anchor,c[p].head,"+input");c=a.listSelections();for(var h=0;ha&&we(c,this.pos)==0&&p==this.button};var Fc,Vc;function xP(a,c){var p=+new Date;return Vc&&Vc.compare(p,a,c)?(Fc=Vc=null,"triple"):Fc&&Fc.compare(p,a,c)?(Vc=new Qv(p,a,c),Fc=null,"double"):(Fc=new Qv(p,a,c),Vc=null,"single")}function Rx(a){var c=this,p=c.display;if(!(Tt(c,a)||p.activeTouch&&p.input.supportsTouch())){if(p.input.ensurePolled(),p.shift=a.shiftKey,Ao(p,a)){d||(p.scroller.draggable=!1,setTimeout(function(){return p.scroller.draggable=!0},100));return}if(!ey(c,a)){var h=ba(c,a),g=pc(a),b=h?xP(h,g):"single";bt(c).focus(),g==1&&c.state.selectingText&&c.state.selectingText(a),!(h&&SP(c,g,h,b,a))&&(g==1?h?TP(c,h,b,a):Sn(a)==p.scroller&&Gt(a):g==2?(h&&ph(c.doc,h),setTimeout(function(){return p.input.focus()},20)):g==3&&(w?c.display.input.onContextMenu(a):Pv(c)))}}}function SP(a,c,p,h,g){var b="Click";return h=="double"?b="Double"+b:h=="triple"&&(b="Triple"+b),b=(c==1?"Left":c==2?"Middle":"Right")+b,Hc(a,Ex(b,g),g,function(S){if(typeof S=="string"&&(S=$c[S]),!S)return!1;var T=!1;try{a.isReadOnly()&&(a.state.suppressEdits=!0),T=S(a,p)!=Fe}finally{a.state.suppressEdits=!1}return T})}function CP(a,c,p){var h=a.getOption("configureMouse"),g=h?h(a,c,p):{};if(g.unit==null){var b=I?p.shiftKey&&p.metaKey:p.altKey;g.unit=b?"rectangle":c=="single"?"char":c=="double"?"word":"line"}return(g.extend==null||a.doc.extend)&&(g.extend=a.doc.extend||p.shiftKey),g.addNew==null&&(g.addNew=H?p.metaKey:p.ctrlKey),g.moveOnDrag==null&&(g.moveOnDrag=!(H?p.altKey:p.ctrlKey)),g}function TP(a,c,p,h){u?setTimeout(Xe(zk,a),0):a.curOp.focus=ze(_t(a));var g=CP(a,p,h),b=a.doc.sel,S;a.options.dragDrop&&dv&&!a.isReadOnly()&&p=="single"&&(S=b.contains(c))>-1&&(we((S=b.ranges[S]).from(),c)<0||c.xRel>0)&&(we(S.to(),c)>0||c.xRel<0)?EP(a,h,c,g):AP(a,h,c,g)}function EP(a,c,p,h){var g=a.display,b=!1,S=Ln(a,function(B){d&&(g.scroller.draggable=!1),a.state.draggingText=!1,a.state.delayingBlurEvent&&(a.hasFocus()?a.state.delayingBlurEvent=!1:Pv(a)),ct(g.wrapper.ownerDocument,"mouseup",S),ct(g.wrapper.ownerDocument,"mousemove",T),ct(g.scroller,"dragstart",M),ct(g.scroller,"drop",S),b||(Gt(B),h.addNew||ph(a.doc,p,null,null,h.extend),d&&!C||u&&f==9?setTimeout(function(){g.wrapper.ownerDocument.body.focus({preventScroll:!0}),g.input.focus()},20):g.input.focus())}),T=function(B){b=b||Math.abs(c.clientX-B.clientX)+Math.abs(c.clientY-B.clientY)>=10},M=function(){return b=!0};d&&(g.scroller.draggable=!0),a.state.draggingText=S,S.copy=!h.moveOnDrag,me(g.wrapper.ownerDocument,"mouseup",S),me(g.wrapper.ownerDocument,"mousemove",T),me(g.scroller,"dragstart",M),me(g.scroller,"drop",S),a.state.delayingBlurEvent=!0,setTimeout(function(){return g.input.focus()},20),g.scroller.dragDrop&&g.scroller.dragDrop()}function zx(a,c,p){if(p=="char")return new Ht(c,c);if(p=="word")return a.findWordAt(c);if(p=="line")return new Ht(se(c.line,0),dt(a.doc,se(c.line+1,0)));var h=p(a,c);return new Ht(h.from,h.to)}function AP(a,c,p,h){u&&Pv(a);var g=a.display,b=a.doc;Gt(c);var S,T,M=b.sel,B=M.ranges;if(h.addNew&&!h.extend?(T=b.sel.contains(p),T>-1?S=B[T]:S=new Ht(p,p)):(S=b.sel.primary(),T=b.sel.primIndex),h.unit=="rectangle")h.addNew||(S=new Ht(p,p)),p=ba(a,c,!0,!0),T=-1;else{var J=zx(a,p,h.unit);h.extend?S=Kv(S,J.anchor,J.head,h.extend):S=J}h.addNew?T==-1?(T=B.length,Gn(b,Ai(a,B.concat([S]),T),{scroll:!1,origin:"*mouse"})):B.length>1&&B[T].empty()&&h.unit=="char"&&!h.extend?(Gn(b,Ai(a,B.slice(0,T).concat(B.slice(T+1)),0),{scroll:!1,origin:"*mouse"}),M=b.sel):Gv(b,T,S,ie):(T=0,Gn(b,new Xr([S],0),ie),M=b.sel);var ee=p;function fe(Re){if(we(ee,Re)!=0)if(ee=Re,h.unit=="rectangle"){for(var Ve=[],nt=a.options.tabSize,et=Be(Ge(b,p.line).text,p.ch,nt),St=Be(Ge(b,Re.line).text,Re.ch,nt),Yt=Math.min(et,St),Pn=Math.max(et,St),sn=Math.min(p.line,Re.line),Ir=Math.min(a.lastLine(),Math.max(p.line,Re.line));sn<=Ir;sn++){var kr=Ge(b,sn).text,wn=be(kr,Yt,nt);Yt==Pn?Ve.push(new Ht(se(sn,wn),se(sn,wn))):kr.length>wn&&Ve.push(new Ht(se(sn,wn),se(sn,be(kr,Pn,nt))))}Ve.length||Ve.push(new Ht(p,p)),Gn(b,Ai(a,M.ranges.slice(0,T).concat(Ve),T),{origin:"*mouse",scroll:!1}),a.scrollIntoView(Re)}else{var xr=S,jn=zx(a,Re,h.unit),Tn=xr.anchor,kn;we(jn.anchor,Tn)>0?(kn=jn.head,Tn=Cn(xr.from(),jn.anchor)):(kn=jn.anchor,Tn=It(xr.to(),jn.head));var un=M.ranges.slice(0);un[T]=OP(a,new Ht(dt(b,Tn),kn)),Gn(b,Ai(a,un,T),ie)}}var ue=g.wrapper.getBoundingClientRect(),ke=0;function Ce(Re){var Ve=++ke,nt=ba(a,Re,!0,h.unit=="rectangle");if(nt)if(we(nt,ee)!=0){a.curOp.focus=ze(_t(a)),fe(nt);var et=lh(g,b);(nt.line>=et.to||nt.lineue.bottom?20:0;St&&setTimeout(Ln(a,function(){ke==Ve&&(g.scroller.scrollTop+=St,Ce(Re))}),50)}}function Me(Re){a.state.selectingText=!1,ke=1/0,Re&&(Gt(Re),g.input.focus()),ct(g.wrapper.ownerDocument,"mousemove",De),ct(g.wrapper.ownerDocument,"mouseup",$e),b.history.lastSelOrigin=null}var De=Ln(a,function(Re){Re.buttons===0||!pc(Re)?Me(Re):Ce(Re)}),$e=Ln(a,Me);a.state.selectingText=$e,me(g.wrapper.ownerDocument,"mousemove",De),me(g.wrapper.ownerDocument,"mouseup",$e)}function OP(a,c){var p=c.anchor,h=c.head,g=Ge(a.doc,p.line);if(we(p,h)==0&&p.sticky==h.sticky)return c;var b=Ae(g);if(!b)return c;var S=je(b,p.ch,p.sticky),T=b[S];if(T.from!=p.ch&&T.to!=p.ch)return c;var M=S+(T.from==p.ch==(T.level!=1)?0:1);if(M==0||M==b.length)return c;var B;if(h.line!=p.line)B=(h.line-p.line)*(a.doc.direction=="ltr"?1:-1)>0;else{var J=je(b,h.ch,h.sticky),ee=J-S||(h.ch-p.ch)*(T.level==1?-1:1);J==M-1||J==M?B=ee<0:B=ee>0}var fe=b[M+(B?-1:0)],ue=B==(fe.level==1),ke=ue?fe.from:fe.to,Ce=ue?"after":"before";return p.ch==ke&&p.sticky==Ce?c:new Ht(new se(p.line,ke,Ce),h)}function Bx(a,c,p,h){var g,b;if(c.touches)g=c.touches[0].clientX,b=c.touches[0].clientY;else try{g=c.clientX,b=c.clientY}catch{return!1}if(g>=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;h&&Gt(c);var S=a.display,T=S.lineDiv.getBoundingClientRect();if(b>T.bottom||!Kt(a,p))return Gr(c);b-=T.top-S.viewOffset;for(var M=0;M=g){var J=Xi(a.doc,b),ee=a.display.gutterSpecs[M];return ot(a,p,a,J,ee.className,c),Gr(c)}}}function ey(a,c){return Bx(a,c,"gutterClick",!0)}function $x(a,c){Ao(a.display,c)||MP(a,c)||Tt(a,c,"contextmenu")||w||a.display.input.onContextMenu(c)}function MP(a,c){return Kt(a,"gutterContextMenu")?Bx(a,c,"gutterContextMenu",!1):!1}function Hx(a){a.display.wrapper.className=a.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+a.options.theme.replace(/(^|\s)\s*/g," cm-s-"),kc(a)}var Zl={toString:function(){return"CodeMirror.Init"}},Fx={},wh={};function NP(a){var c=a.optionHandlers;function p(h,g,b,S){a.defaults[h]=g,b&&(c[h]=S?function(T,M,B){B!=Zl&&b(T,M,B)}:b)}a.defineOption=p,a.Init=Zl,p("value","",function(h,g){return h.setValue(g)},!0),p("mode",null,function(h,g){h.doc.modeOption=g,Wv(h)},!0),p("indentUnit",2,Wv,!0),p("indentWithTabs",!1),p("smartIndent",!0),p("tabSize",4,function(h){Mc(h),kc(h),_r(h)},!0),p("lineSeparator",null,function(h,g){if(h.doc.lineSep=g,!!g){var b=[],S=h.doc.first;h.doc.iter(function(M){for(var B=0;;){var J=M.text.indexOf(g,B);if(J==-1)break;B=J+g.length,b.push(se(S,J))}S++});for(var T=b.length-1;T>=0;T--)Gl(h.doc,g,b[T],se(b[T].line,b[T].ch+g.length))}}),p("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(h,g,b){h.state.specialChars=new RegExp(g.source+(g.test(" ")?"":"| "),"g"),b!=Zl&&h.refresh()}),p("specialCharPlaceholder",sI,function(h){return h.refresh()},!0),p("electricChars",!0),p("inputStyle",E?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),p("spellcheck",!1,function(h,g){return h.getInputField().spellcheck=g},!0),p("autocorrect",!1,function(h,g){return h.getInputField().autocorrect=g},!0),p("autocapitalize",!1,function(h,g){return h.getInputField().autocapitalize=g},!0),p("rtlMoveVisually",!q),p("wholeLineUpdateBefore",!0),p("theme","default",function(h){Hx(h),Oc(h)},!0),p("keyMap","default",function(h,g,b){var S=bh(g),T=b!=Zl&&bh(b);T&&T.detach&&T.detach(h,S),S.attach&&S.attach(h,T||null)}),p("extraKeys",null),p("configureMouse",null),p("lineWrapping",!1,IP,!0),p("gutters",[],function(h,g){h.display.gutterSpecs=Vv(g,h.options.lineNumbers),Oc(h)},!0),p("fixedGutter",!0,function(h,g){h.display.gutters.style.left=g?Mv(h.display)+"px":"0",h.refresh()},!0),p("coverGutterNextToScrollbar",!1,function(h){return Wl(h)},!0),p("scrollbarStyle","native",function(h){jk(h),Wl(h),h.display.scrollbars.setScrollTop(h.doc.scrollTop),h.display.scrollbars.setScrollLeft(h.doc.scrollLeft)},!0),p("lineNumbers",!1,function(h,g){h.display.gutterSpecs=Vv(h.options.gutters,g),Oc(h)},!0),p("firstLineNumber",1,Oc,!0),p("lineNumberFormatter",function(h){return h},Oc,!0),p("showCursorWhenSelecting",!1,xc,!0),p("resetSelectionOnContextMenu",!0),p("lineWiseCopyCut",!0),p("pasteLinesPerSelection",!0),p("selectionsMayTouch",!1),p("readOnly",!1,function(h,g){g=="nocursor"&&(Vl(h),h.display.input.blur()),h.display.input.readOnlyChanged(g)}),p("screenReaderLabel",null,function(h,g){g=g===""?null:g,h.display.input.screenReaderLabelChanged(g)}),p("disableInput",!1,function(h,g){g||h.display.input.reset()},!0),p("dragDrop",!0,LP),p("allowDropFileTypes",null),p("cursorBlinkRate",530),p("cursorScrollMargin",0),p("cursorHeight",1,xc,!0),p("singleCursorHeightPerLine",!0,xc,!0),p("workTime",100),p("workDelay",100),p("flattenSpans",!0,Mc,!0),p("addModeClass",!1,Mc,!0),p("pollInterval",100),p("undoDepth",200,function(h,g){return h.doc.history.undoDepth=g}),p("historyEventDelay",1250),p("viewportMargin",10,function(h){return h.refresh()},!0),p("maxHighlightLength",1e4,Mc,!0),p("moveInputWithCursor",!0,function(h,g){g||h.display.input.resetPosition()}),p("tabindex",null,function(h,g){return h.display.input.getField().tabIndex=g||""}),p("autofocus",null),p("direction","ltr",function(h,g){return h.doc.setDirection(g)},!0),p("phrases",null)}function LP(a,c,p){var h=p&&p!=Zl;if(!c!=!h){var g=a.display.dragFunctions,b=c?me:ct;b(a.display.scroller,"dragstart",g.start),b(a.display.scroller,"dragenter",g.enter),b(a.display.scroller,"dragover",g.over),b(a.display.scroller,"dragleave",g.leave),b(a.display.scroller,"drop",g.drop)}}function IP(a){a.options.lineWrapping?(qe(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth="",a.display.sizerWidth=null):(U(a.display.wrapper,"CodeMirror-wrap"),_v(a)),Nv(a),_r(a),kc(a),setTimeout(function(){return Wl(a)},100)}function Qt(a,c){var p=this;if(!(this instanceof Qt))return new Qt(a,c);this.options=c=c?Ie(c):{},Ie(Fx,c,!1);var h=c.value;typeof h=="string"?h=new wr(h,c.mode,null,c.lineSeparator,c.direction):c.mode&&(h.modeOption=c.mode),this.doc=h;var g=new Qt.inputStyles[c.inputStyle](this),b=this.display=new qI(a,h,g,c);b.wrapper.CodeMirror=this,Hx(this),c.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),jk(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Ee,keySeq:null,specialChars:null},c.autofocus&&!E&&b.input.focus(),u&&f<11&&setTimeout(function(){return p.display.input.reset(!0)},20),PP(this),fP(),xa(this),this.curOp.forceUpdate=!0,Qk(this,h),c.autofocus&&!E||this.hasFocus()?setTimeout(function(){p.hasFocus()&&!p.state.focused&&Dv(p)},20):Vl(this);for(var S in wh)wh.hasOwnProperty(S)&&wh[S](this,c[S],Zl);qk(this),c.finishInit&&c.finishInit(this);for(var T=0;T20*20}me(c.scroller,"touchstart",function(M){if(!Tt(a,M)&&!b(M)&&!ey(a,M)){c.input.ensurePolled(),clearTimeout(p);var B=+new Date;c.activeTouch={start:B,moved:!1,prev:B-h.end<=300?h:null},M.touches.length==1&&(c.activeTouch.left=M.touches[0].pageX,c.activeTouch.top=M.touches[0].pageY)}}),me(c.scroller,"touchmove",function(){c.activeTouch&&(c.activeTouch.moved=!0)}),me(c.scroller,"touchend",function(M){var B=c.activeTouch;if(B&&!Ao(c,M)&&B.left!=null&&!B.moved&&new Date-B.start<300){var J=a.coordsChar(c.activeTouch,"page"),ee;!B.prev||S(B,B.prev)?ee=new Ht(J,J):!B.prev.prev||S(B,B.prev.prev)?ee=a.findWordAt(J):ee=new Ht(se(J.line,0),dt(a.doc,se(J.line+1,0))),a.setSelection(ee.anchor,ee.head),a.focus(),Gt(M)}g()}),me(c.scroller,"touchcancel",g),me(c.scroller,"scroll",function(){c.scroller.clientHeight&&(Cc(a,c.scroller.scrollTop),wa(a,c.scroller.scrollLeft,!0),ot(a,"scroll",a))}),me(c.scroller,"mousewheel",function(M){return Yk(a,M)}),me(c.scroller,"DOMMouseScroll",function(M){return Yk(a,M)}),me(c.wrapper,"scroll",function(){return c.wrapper.scrollTop=c.wrapper.scrollLeft=0}),c.dragFunctions={enter:function(M){Tt(a,M)||Yr(M)},over:function(M){Tt(a,M)||(cP(a,M),Yr(M))},start:function(M){return uP(a,M)},drop:Ln(a,lP),leave:function(M){Tt(a,M)||xx(a)}};var T=c.input.getField();me(T,"keyup",function(M){return Px.call(a,M)}),me(T,"keydown",Ln(a,Ix)),me(T,"keypress",Ln(a,Dx)),me(T,"focus",function(M){return Dv(a,M)}),me(T,"blur",function(M){return Vl(a,M)})}var ty=[];Qt.defineInitHook=function(a){return ty.push(a)};function jc(a,c,p,h){var g=a.doc,b;p==null&&(p="add"),p=="smart"&&(g.mode.indent?b=vc(a,c).state:p="prev");var S=a.options.tabSize,T=Ge(g,c),M=Be(T.text,null,S);T.stateAfter&&(T.stateAfter=null);var B=T.text.match(/^\s*/)[0],J;if(!h&&!/\S/.test(T.text))J=0,p="not";else if(p=="smart"&&(J=g.mode.indent(b,T.text.slice(B.length),T.text),J==Fe||J>150)){if(!h)return;p="prev"}p=="prev"?c>g.first?J=Be(Ge(g,c-1).text,null,S):J=0:p=="add"?J=M+a.options.indentUnit:p=="subtract"?J=M-a.options.indentUnit:typeof p=="number"&&(J=M+p),J=Math.max(0,J);var ee="",fe=0;if(a.options.indentWithTabs)for(var ue=Math.floor(J/S);ue;--ue)fe+=S,ee+=" ";if(feS,M=mc(c),B=null;if(T&&h.ranges.length>1)if(Oi&&Oi.text.join(` -`)==c){if(h.ranges.length%Oi.text.length==0){B=[];for(var J=0;J=0;fe--){var ue=h.ranges[fe],ke=ue.from(),Ce=ue.to();ue.empty()&&(p&&p>0?ke=se(ke.line,ke.ch-p):a.state.overwrite&&!T?Ce=se(Ce.line,Math.min(Ge(b,Ce.line).text.length,Ce.ch+G(M).length)):T&&Oi&&Oi.lineWise&&Oi.text.join(` -`)==M.join(` -`)&&(ke=Ce=se(ke.line,0)));var Me={from:ke,to:Ce,text:B?B[fe%B.length]:M,origin:g||(T?"paste":a.state.cutIncoming>S?"cut":"+input")};Kl(a.doc,Me),Nn(a,"inputRead",a,Me)}c&&!T&&jx(a,c),jl(a),a.curOp.updateInput<2&&(a.curOp.updateInput=ee),a.curOp.typing=!0,a.state.pasteIncoming=a.state.cutIncoming=-1}function Vx(a,c){var p=a.clipboardData&&a.clipboardData.getData("Text");if(p)return a.preventDefault(),!c.isReadOnly()&&!c.options.disableInput&&c.hasFocus()&&Lr(c,function(){return ny(c,p,0,null,"paste")}),!0}function jx(a,c){if(!(!a.options.electricChars||!a.options.smartIndent))for(var p=a.doc.sel,h=p.ranges.length-1;h>=0;h--){var g=p.ranges[h];if(!(g.head.ch>100||h&&p.ranges[h-1].head.line==g.head.line)){var b=a.getModeAt(g.head),S=!1;if(b.electricChars){for(var T=0;T-1){S=jc(a,g.head.line,"smart");break}}else b.electricInput&&b.electricInput.test(Ge(a.doc,g.head.line).text.slice(0,g.head.ch))&&(S=jc(a,g.head.line,"smart"));S&&Nn(a,"electricInput",a,g.head.line)}}}function Wx(a){for(var c=[],p=[],h=0;hb&&(jc(this,T.head.line,h,!0),b=T.head.line,S==this.doc.sel.primIndex&&jl(this));else{var M=T.from(),B=T.to(),J=Math.max(b,M.line);b=Math.min(this.lastLine(),B.line-(B.ch?0:1))+1;for(var ee=J;ee0&&Gv(this.doc,S,new Ht(M,fe[S].to()),at)}}}),getTokenAt:function(h,g){return tk(this,h,g)},getLineTokens:function(h,g){return tk(this,se(h),g,!0)},getTokenTypeAt:function(h){h=dt(this.doc,h);var g=Zw(this,Ge(this.doc,h.line)),b=0,S=(g.length-1)/2,T=h.ch,M;if(T==0)M=g[2];else for(;;){var B=b+S>>1;if((B?g[B*2-1]:0)>=T)S=B;else if(g[B*2+1]M&&(h=M,S=!0),T=Ge(this.doc,h)}else T=h;return rh(this,T,{top:0,left:0},g||"page",b||S).top+(S?this.doc.height-Eo(T):0)},defaultTextHeight:function(){return Hl(this.display)},defaultCharWidth:function(){return Fl(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(h,g,b,S,T){var M=this.display;h=Ei(this,dt(this.doc,h));var B=h.bottom,J=h.left;if(g.style.position="absolute",g.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(g),M.sizer.appendChild(g),S=="over")B=h.top;else if(S=="above"||S=="near"){var ee=Math.max(M.wrapper.clientHeight,this.doc.height),fe=Math.max(M.sizer.clientWidth,M.lineSpace.clientWidth);(S=="above"||h.bottom+g.offsetHeight>ee)&&h.top>g.offsetHeight?B=h.top-g.offsetHeight:h.bottom+g.offsetHeight<=ee&&(B=h.bottom),J+g.offsetWidth>fe&&(J=fe-g.offsetWidth)}g.style.top=B+"px",g.style.left=g.style.right="",T=="right"?(J=M.sizer.clientWidth-g.offsetWidth,g.style.right="0px"):(T=="left"?J=0:T=="middle"&&(J=(M.sizer.clientWidth-g.offsetWidth)/2),g.style.left=J+"px"),b&&LI(this,{left:J,top:B,right:J+g.offsetWidth,bottom:B+g.offsetHeight})},triggerOnKeyDown:sr(Ix),triggerOnKeyPress:sr(Dx),triggerOnKeyUp:Px,triggerOnMouseDown:sr(Rx),execCommand:function(h){if($c.hasOwnProperty(h))return $c[h].call(null,this)},triggerElectric:sr(function(h){jx(this,h)}),findPosH:function(h,g,b,S){var T=1;g<0&&(T=-1,g=-g);for(var M=dt(this.doc,h),B=0;B0&&J(b.charAt(S-1));)--S;for(;T.5||this.options.lineWrapping)&&Nv(this),ot(this,"refresh",this)}),swapDoc:sr(function(h){var g=this.doc;return g.cm=null,this.state.selectingText&&this.state.selectingText(),Qk(this,h),kc(this),this.display.input.reset(),Sc(this,h.scrollLeft,h.scrollTop),this.curOp.forceScroll=!0,Nn(this,"swapDoc",this,g),g}),phrase:function(h){var g=this.options.phrases;return g&&Object.prototype.hasOwnProperty.call(g,h)?g[h]:h},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Xt(a),a.registerHelper=function(h,g,b){p.hasOwnProperty(h)||(p[h]=a[h]={_global:[]}),p[h][g]=b},a.registerGlobalHelper=function(h,g,b,S){a.registerHelper(h,g,S),p[h]._global.push({pred:b,val:S})}}function iy(a,c,p,h,g){var b=c,S=p,T=Ge(a,c.line),M=g&&a.direction=="rtl"?-p:p;function B(){var $e=c.line+M;return $e=a.first+a.size?!1:(c=new se($e,c.ch,c.sticky),T=Ge(a,$e))}function J($e){var Re;if(h=="codepoint"){var Ve=T.text.charCodeAt(c.ch+(p>0?0:-1));if(isNaN(Ve))Re=null;else{var nt=p>0?Ve>=55296&&Ve<56320:Ve>=56320&&Ve<57343;Re=new se(c.line,Math.max(0,Math.min(T.text.length,c.ch+p*(nt?2:1))),-p)}}else g?Re=gP(a.cm,T,c,p):Re=Jv(T,c,p);if(Re==null)if(!$e&&B())c=Xv(g,a.cm,T,c.line,M);else return!1;else c=Re;return!0}if(h=="char"||h=="codepoint")J();else if(h=="column")J(!0);else if(h=="word"||h=="group")for(var ee=null,fe=h=="group",ue=a.cm&&a.cm.getHelper(c,"wordChars"),ke=!0;!(p<0&&!J(!ke));ke=!1){var Ce=T.text.charAt(c.ch)||` -`,Me=Q(Ce,ue)?"w":fe&&Ce==` -`?"n":!fe||/\s/.test(Ce)?null:"p";if(fe&&!ke&&!Me&&(Me="s"),ee&&ee!=Me){p<0&&(p=1,J(),c.sticky="after");break}if(Me&&(ee=Me),p>0&&!J(!ke))break}var De=gh(a,c,b,S,!0);return ft(b,De)&&(De.hitSide=!0),De}function qx(a,c,p,h){var g=a.doc,b=c.left,S;if(h=="page"){var T=Math.min(a.display.wrapper.clientHeight,bt(a).innerHeight||g(a).documentElement.clientHeight),M=Math.max(T-.5*Hl(a.display),3);S=(p>0?c.bottom:c.top)+p*M}else h=="line"&&(S=p>0?c.bottom+3:c.top-3);for(var B;B=Ev(a,b,S),!!B.outside;){if(p<0?S<=0:S>=g.height){B.hitSide=!0;break}S+=p*5}return B}var Wt=function(a){this.cm=a,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ee,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Wt.prototype.init=function(a){var c=this,p=this,h=p.cm,g=p.div=a.lineDiv;g.contentEditable=!0,ry(g,h.options.spellcheck,h.options.autocorrect,h.options.autocapitalize);function b(T){for(var M=T.target;M;M=M.parentNode){if(M==g)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(M.className))break}return!1}me(g,"paste",function(T){!b(T)||Tt(h,T)||Vx(T,h)||f<=11&&setTimeout(Ln(h,function(){return c.updateFromDOM()}),20)}),me(g,"compositionstart",function(T){c.composing={data:T.data,done:!1}}),me(g,"compositionupdate",function(T){c.composing||(c.composing={data:T.data,done:!1})}),me(g,"compositionend",function(T){c.composing&&(T.data!=c.composing.data&&c.readFromDOMSoon(),c.composing.done=!0)}),me(g,"touchstart",function(){return p.forceCompositionEnd()}),me(g,"input",function(){c.composing||c.readFromDOMSoon()});function S(T){if(!(!b(T)||Tt(h,T))){if(h.somethingSelected())kh({lineWise:!1,text:h.getSelections()}),T.type=="cut"&&h.replaceSelection("",null,"cut");else if(h.options.lineWiseCopyCut){var M=Wx(h);kh({lineWise:!0,text:M.text}),T.type=="cut"&&h.operation(function(){h.setSelections(M.ranges,0,at),h.replaceSelection("",null,"cut")})}else return;if(T.clipboardData){T.clipboardData.clearData();var B=Oi.text.join(` -`);if(T.clipboardData.setData("Text",B),T.clipboardData.getData("Text")==B){T.preventDefault();return}}var J=Ux(),ee=J.firstChild;ry(ee),h.display.lineSpace.insertBefore(J,h.display.lineSpace.firstChild),ee.value=Oi.text.join(` -`);var fe=ze(g.ownerDocument);mt(ee),setTimeout(function(){h.display.lineSpace.removeChild(J),fe.focus(),fe==g&&p.showPrimarySelection()},50)}}me(g,"copy",S),me(g,"cut",S)},Wt.prototype.screenReaderLabelChanged=function(a){a?this.div.setAttribute("aria-label",a):this.div.removeAttribute("aria-label")},Wt.prototype.prepareSelection=function(){var a=Rk(this.cm,!1);return a.focus=ze(this.div.ownerDocument)==this.div,a},Wt.prototype.showSelection=function(a,c){!a||!this.cm.display.view.length||((a.focus||c)&&this.showPrimarySelection(),this.showMultipleSelections(a))},Wt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Wt.prototype.showPrimarySelection=function(){var a=this.getSelection(),c=this.cm,p=c.doc.sel.primary(),h=p.from(),g=p.to();if(c.display.viewTo==c.display.viewFrom||h.line>=c.display.viewTo||g.line=c.display.viewFrom&&Kx(c,h)||{node:T[0].measure.map[2],offset:0},B=g.linea.firstLine()&&(h=se(h.line-1,Ge(a.doc,h.line-1).length)),g.ch==Ge(a.doc,g.line).text.length&&g.linec.viewTo-1)return!1;var b,S,T;h.line==c.viewFrom||(b=_a(a,h.line))==0?(S=$t(c.view[0].line),T=c.view[0].node):(S=$t(c.view[b].line),T=c.view[b-1].node.nextSibling);var M=_a(a,g.line),B,J;if(M==c.view.length-1?(B=c.viewTo-1,J=c.lineDiv.lastChild):(B=$t(c.view[M+1].line)-1,J=c.view[M+1].node.previousSibling),!T)return!1;for(var ee=a.doc.splitLines(zP(a,T,J,S,B)),fe=Co(a.doc,se(S,0),se(B,Ge(a.doc,B).text.length));ee.length>1&&fe.length>1;)if(G(ee)==G(fe))ee.pop(),fe.pop(),B--;else if(ee[0]==fe[0])ee.shift(),fe.shift(),S++;else break;for(var ue=0,ke=0,Ce=ee[0],Me=fe[0],De=Math.min(Ce.length,Me.length);ueh.ch&&$e.charCodeAt($e.length-ke-1)==Re.charCodeAt(Re.length-ke-1);)ue--,ke++;ee[ee.length-1]=$e.slice(0,$e.length-ke).replace(/^\u200b+/,""),ee[0]=ee[0].slice(ue).replace(/\u200b+$/,"");var nt=se(S,ue),et=se(B,fe.length?G(fe).length-ke:0);if(ee.length>1||ee[0]||we(nt,et))return Gl(a.doc,ee,nt,et,"+input"),!0},Wt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Wt.prototype.reset=function(){this.forceCompositionEnd()},Wt.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Wt.prototype.readFromDOMSoon=function(){var a=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(a.readDOMTimeout=null,a.composing)if(a.composing.done)a.composing=null;else return;a.updateFromDOM()},80))},Wt.prototype.updateFromDOM=function(){var a=this;(this.cm.isReadOnly()||!this.pollContent())&&Lr(this.cm,function(){return _r(a.cm)})},Wt.prototype.setUneditable=function(a){a.contentEditable="false"},Wt.prototype.onKeyPress=function(a){a.charCode==0||this.composing||(a.preventDefault(),this.cm.isReadOnly()||Ln(this.cm,ny)(this.cm,String.fromCharCode(a.charCode==null?a.keyCode:a.charCode),0))},Wt.prototype.readOnlyChanged=function(a){this.div.contentEditable=String(a!="nocursor")},Wt.prototype.onContextMenu=function(){},Wt.prototype.resetPosition=function(){},Wt.prototype.needsContentAttribute=!0;function Kx(a,c){var p=Sv(a,c.line);if(!p||p.hidden)return null;var h=Ge(a.doc,c.line),g=kk(p,h,c.line),b=Ae(h,a.doc.direction),S="left";if(b){var T=je(b,c.ch);S=T%2?"right":"left"}var M=Ck(g.map,c.ch,S);return M.offset=M.collapse=="right"?M.end:M.start,M}function RP(a){for(var c=a;c;c=c.parentNode)if(/CodeMirror-gutter-wrapper/.test(c.className))return!0;return!1}function Ql(a,c){return c&&(a.bad=!0),a}function zP(a,c,p,h,g){var b="",S=!1,T=a.doc.lineSeparator(),M=!1;function B(ue){return function(ke){return ke.id==ue}}function J(){S&&(b+=T,M&&(b+=T),S=M=!1)}function ee(ue){ue&&(J(),b+=ue)}function fe(ue){if(ue.nodeType==1){var ke=ue.getAttribute("cm-text");if(ke){ee(ke);return}var Ce=ue.getAttribute("cm-marker"),Me;if(Ce){var De=a.findMarks(se(h,0),se(g+1,0),B(+Ce));De.length&&(Me=De[0].find(0))&&ee(Co(a.doc,Me.from,Me.to).join(T));return}if(ue.getAttribute("contenteditable")=="false")return;var $e=/^(pre|div|p|li|table|br)$/i.test(ue.nodeName);if(!/^br$/i.test(ue.nodeName)&&ue.textContent.length==0)return;$e&&J();for(var Re=0;Re=9&&c.hasSelection&&(c.hasSelection=null),p.poll()}),me(g,"paste",function(S){Tt(h,S)||Vx(S,h)||(h.state.pasteIncoming=+new Date,p.fastPoll())});function b(S){if(!Tt(h,S)){if(h.somethingSelected())kh({lineWise:!1,text:h.getSelections()});else if(h.options.lineWiseCopyCut){var T=Wx(h);kh({lineWise:!0,text:T.text}),S.type=="cut"?h.setSelections(T.ranges,null,at):(p.prevInput="",g.value=T.text.join(` -`),mt(g))}else return;S.type=="cut"&&(h.state.cutIncoming=+new Date)}}me(g,"cut",b),me(g,"copy",b),me(a.scroller,"paste",function(S){if(!(Ao(a,S)||Tt(h,S))){if(!g.dispatchEvent){h.state.pasteIncoming=+new Date,p.focus();return}var T=new Event("paste");T.clipboardData=S.clipboardData,g.dispatchEvent(T)}}),me(a.lineSpace,"selectstart",function(S){Ao(a,S)||Gt(S)}),me(g,"compositionstart",function(){var S=h.getCursor("from");p.composing&&p.composing.range.clear(),p.composing={start:S,range:h.markText(S,h.getCursor("to"),{className:"CodeMirror-composing"})}}),me(g,"compositionend",function(){p.composing&&(p.poll(),p.composing.range.clear(),p.composing=null)})},dn.prototype.createField=function(a){this.wrapper=Ux(),this.textarea=this.wrapper.firstChild;var c=this.cm.options;ry(this.textarea,c.spellcheck,c.autocorrect,c.autocapitalize)},dn.prototype.screenReaderLabelChanged=function(a){a?this.textarea.setAttribute("aria-label",a):this.textarea.removeAttribute("aria-label")},dn.prototype.prepareSelection=function(){var a=this.cm,c=a.display,p=a.doc,h=Rk(a);if(a.options.moveInputWithCursor){var g=Ei(a,p.sel.primary().head,"div"),b=c.wrapper.getBoundingClientRect(),S=c.lineDiv.getBoundingClientRect();h.teTop=Math.max(0,Math.min(c.wrapper.clientHeight-10,g.top+S.top-b.top)),h.teLeft=Math.max(0,Math.min(c.wrapper.clientWidth-10,g.left+S.left-b.left))}return h},dn.prototype.showSelection=function(a){var c=this.cm,p=c.display;oe(p.cursorDiv,a.cursors),oe(p.selectionDiv,a.selection),a.teTop!=null&&(this.wrapper.style.top=a.teTop+"px",this.wrapper.style.left=a.teLeft+"px")},dn.prototype.reset=function(a){if(!(this.contextMenuPending||this.composing&&a)){var c=this.cm;if(this.resetting=!0,c.somethingSelected()){this.prevInput="";var p=c.getSelection();this.textarea.value=p,c.state.focused&&mt(this.textarea),u&&f>=9&&(this.hasSelection=p)}else a||(this.prevInput=this.textarea.value="",u&&f>=9&&(this.hasSelection=null));this.resetting=!1}},dn.prototype.getField=function(){return this.textarea},dn.prototype.supportsTouch=function(){return!1},dn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!E||ze(this.textarea.ownerDocument)!=this.textarea))try{this.textarea.focus()}catch{}},dn.prototype.blur=function(){this.textarea.blur()},dn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},dn.prototype.receivedFocus=function(){this.slowPoll()},dn.prototype.slowPoll=function(){var a=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){a.poll(),a.cm.state.focused&&a.slowPoll()})},dn.prototype.fastPoll=function(){var a=!1,c=this;c.pollingFast=!0;function p(){var h=c.poll();!h&&!a?(a=!0,c.polling.set(60,p)):(c.pollingFast=!1,c.slowPoll())}c.polling.set(20,p)},dn.prototype.poll=function(){var a=this,c=this.cm,p=this.textarea,h=this.prevInput;if(this.contextMenuPending||this.resetting||!c.state.focused||us(p)&&!h&&!this.composing||c.isReadOnly()||c.options.disableInput||c.state.keySeq)return!1;var g=p.value;if(g==h&&!c.somethingSelected())return!1;if(u&&f>=9&&this.hasSelection===g||H&&/[\uf700-\uf7ff]/.test(g))return c.display.input.reset(),!1;if(c.doc.sel==c.display.selForContextMenu){var b=g.charCodeAt(0);if(b==8203&&!h&&(h="​"),b==8666)return this.reset(),this.cm.execCommand("undo")}for(var S=0,T=Math.min(h.length,g.length);S1e3||g.indexOf(` -`)>-1?p.value=a.prevInput="":a.prevInput=g,a.composing&&(a.composing.range.clear(),a.composing.range=c.markText(a.composing.start,c.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},dn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},dn.prototype.onKeyPress=function(){u&&f>=9&&(this.hasSelection=null),this.fastPoll()},dn.prototype.onContextMenu=function(a){var c=this,p=c.cm,h=p.display,g=c.textarea;c.contextMenuPending&&c.contextMenuPending();var b=ba(p,a),S=h.scroller.scrollTop;if(!b||_)return;var T=p.options.resetSelectionOnContextMenu;T&&p.doc.sel.contains(b)==-1&&Ln(p,Gn)(p.doc,gs(b),at);var M=g.style.cssText,B=c.wrapper.style.cssText,J=c.wrapper.offsetParent.getBoundingClientRect();c.wrapper.style.cssText="position: static",g.style.cssText=`position: absolute; width: 30px; height: 30px; - top: `+(a.clientY-J.top-5)+"px; left: "+(a.clientX-J.left-5)+`px; - z-index: 1000; background: `+(u?"rgba(255, 255, 255, .05)":"transparent")+`; - outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ee;d&&(ee=g.ownerDocument.defaultView.scrollY),h.input.focus(),d&&g.ownerDocument.defaultView.scrollTo(null,ee),h.input.reset(),p.somethingSelected()||(g.value=c.prevInput=" "),c.contextMenuPending=ue,h.selForContextMenu=p.doc.sel,clearTimeout(h.detectingSelectAll);function fe(){if(g.selectionStart!=null){var Ce=p.somethingSelected(),Me="​"+(Ce?g.value:"");g.value="⇚",g.value=Me,c.prevInput=Ce?"":"​",g.selectionStart=1,g.selectionEnd=Me.length,h.selForContextMenu=p.doc.sel}}function ue(){if(c.contextMenuPending==ue&&(c.contextMenuPending=!1,c.wrapper.style.cssText=B,g.style.cssText=M,u&&f<9&&h.scrollbars.setScrollTop(h.scroller.scrollTop=S),g.selectionStart!=null)){(!u||u&&f<9)&&fe();var Ce=0,Me=function(){h.selForContextMenu==p.doc.sel&&g.selectionStart==0&&g.selectionEnd>0&&c.prevInput=="​"?Ln(p,dx)(p):Ce++<10?h.detectingSelectAll=setTimeout(Me,500):(h.selForContextMenu=null,h.input.reset())};h.detectingSelectAll=setTimeout(Me,200)}}if(u&&f>=9&&fe(),w){Yr(a);var ke=function(){ct(window,"mouseup",ke),setTimeout(ue,20)};me(window,"mouseup",ke)}else setTimeout(ue,50)},dn.prototype.readOnlyChanged=function(a){a||this.reset(),this.textarea.disabled=a=="nocursor",this.textarea.readOnly=!!a},dn.prototype.setUneditable=function(){},dn.prototype.needsContentAttribute=!1;function $P(a,c){if(c=c?Ie(c):{},c.value=a.value,!c.tabindex&&a.tabIndex&&(c.tabindex=a.tabIndex),!c.placeholder&&a.placeholder&&(c.placeholder=a.placeholder),c.autofocus==null){var p=ze(a.ownerDocument);c.autofocus=p==a||a.getAttribute("autofocus")!=null&&p==document.body}function h(){a.value=T.getValue()}var g;if(a.form&&(me(a.form,"submit",h),!c.leaveSubmitMethodAlone)){var b=a.form;g=b.submit;try{var S=b.submit=function(){h(),b.submit=g,b.submit(),b.submit=S}}catch{}}c.finishInit=function(M){M.save=h,M.getTextArea=function(){return a},M.toTextArea=function(){M.toTextArea=isNaN,h(),a.parentNode.removeChild(M.getWrapperElement()),a.style.display="",a.form&&(ct(a.form,"submit",h),!c.leaveSubmitMethodAlone&&typeof a.form.submit=="function"&&(a.form.submit=g))}},a.style.display="none";var T=Qt(function(M){return a.parentNode.insertBefore(M,a.nextSibling)},c);return T}function HP(a){a.off=ct,a.on=me,a.wheelEventPixels=KI,a.Doc=wr,a.splitLines=mc,a.countColumn=Be,a.findColumn=be,a.isWordChar=F,a.Pass=Fe,a.signal=ot,a.Line=zl,a.changeEnd=vs,a.scrollbarModel=Vk,a.Pos=se,a.cmpPos=we,a.modes=Ci,a.mimeModes=cs,a.resolveMode=Nr,a.getMode=xo,a.modeExtensions=fs,a.extendMode=Gd,a.copyState=So,a.startState=gc,a.innerMode=ds,a.commands=$c,a.keyMap=Mo,a.keyName=Ax,a.isModifierKey=Tx,a.lookupKey=Jl,a.normalizeKeyMap=mP,a.StringStream=ln,a.SharedTextMarker=Rc,a.TextMarker=bs,a.LineWidget=Dc,a.e_preventDefault=Gt,a.e_stopPropagation=Kn,a.e_stop=Yr,a.addClass=qe,a.contains=ve,a.rmClass=U,a.keyNames=_s}NP(Qt),DP(Qt);var FP="iter insert remove copy getEditor constructor".split(" ");for(var Sh in wr.prototype)wr.prototype.hasOwnProperty(Sh)&&Ze(FP,Sh)<0&&(Qt.prototype[Sh]=function(a){return function(){return a.apply(this.doc,arguments)}}(wr.prototype[Sh]));return Xt(wr),Qt.inputStyles={textarea:dn,contenteditable:Wt},Qt.defineMode=function(a){!Qt.defaults.mode&&a!="null"&&(Qt.defaults.mode=a),Kd.apply(this,arguments)},Qt.defineMIME=Dl,Qt.defineMode("null",function(){return{token:function(a){return a.skipToEnd()}}}),Qt.defineMIME("text/plain","null"),Qt.defineExtension=function(a,c){Qt.prototype[a]=c},Qt.defineDocExtension=function(a,c){wr.prototype[a]=c},Qt.fromTextArea=$P,HP(Qt),Qt.version="5.65.12",Qt})}(Boe)),ng}var $oe=Mr();const PL=zoe($oe);(function(t,e){(function(n){n(Mr())})(function(n){var r=n.Pos,i="http://www.w3.org/2000/svg";function o(N,W){this.mv=N,this.type=W,this.classes=W=="left"?{chunk:"CodeMirror-merge-l-chunk",start:"CodeMirror-merge-l-chunk-start",end:"CodeMirror-merge-l-chunk-end",insert:"CodeMirror-merge-l-inserted",del:"CodeMirror-merge-l-deleted",connect:"CodeMirror-merge-l-connect"}:{chunk:"CodeMirror-merge-r-chunk",start:"CodeMirror-merge-r-chunk-start",end:"CodeMirror-merge-r-chunk-end",insert:"CodeMirror-merge-r-inserted",del:"CodeMirror-merge-r-deleted",connect:"CodeMirror-merge-r-connect"}}o.prototype={constructor:o,init:function(N,W,O){this.edit=this.mv.edit,(this.edit.state.diffViews||(this.edit.state.diffViews=[])).push(this),this.orig=n(N,Ee({value:W,readOnly:!this.mv.options.allowEditingOriginals},Ee(O))),this.mv.options.connect=="align"&&(this.edit.state.trackAlignable||(this.edit.state.trackAlignable=new ie(this.edit)),this.orig.state.trackAlignable=new ie(this.orig)),this.lockButton.title=this.edit.phrase("Toggle locked scrolling"),this.lockButton.setAttribute("aria-label",this.lockButton.title),this.orig.state.diffViews=[this];var j=O.chunkClassLocation||"background";Object.prototype.toString.call(j)!="[object Array]"&&(j=[j]),this.classes.classLocation=j,this.diff=ae(oe(W),oe(O.value),this.mv.options.ignoreWhitespace),this.chunks=ce(this.diff),this.diffOutOfDate=this.dealigned=!1,this.needsScrollSync=null,this.showDifferences=O.showDifferences!==!1},registerEvents:function(N){this.forceUpdate=u(this),v(this,!0,!1),f(this,N)},setShowDifferences:function(N){N=N!==!1,N!=this.showDifferences&&(this.showDifferences=N,this.forceUpdate("full"))}};function s(N){N.diffOutOfDate&&(N.diff=ae(N.orig.getValue(),N.edit.getValue(),N.mv.options.ignoreWhitespace),N.chunks=ce(N.diff),N.diffOutOfDate=!1,n.signal(N.edit,"updateDiff",N.diff))}var l=!1;function u(N){var W={from:0,to:0,marked:[]},O={from:0,to:0,marked:[]},j,F=!1;function Q(X){l=!0,F=!1,X=="full"&&(N.svg&&Ie(N.svg),N.copyButtons&&Ie(N.copyButtons),_(N.edit,W.marked,N.classes),_(N.orig,O.marked,N.classes),W.from=W.to=O.from=O.to=0),s(N),N.showDifferences&&(C(N.edit,N.diff,W,DIFF_INSERT,N.classes),C(N.orig,N.diff,O,DIFF_DELETE,N.classes)),N.mv.options.connect=="align"&&q(N),A(N),N.needsScrollSync!=null&&d(N,N.needsScrollSync),l=!1}function le(X){l||(N.dealigned=!0,pe(X))}function pe(X){l||F||(clearTimeout(j),X===!0&&(F=!0),j=setTimeout(Q,X===!0?20:250))}function ye(X,de){N.diffOutOfDate||(N.diffOutOfDate=!0,W.from=W.to=O.from=O.to=0),le(de.text.length-1!=de.to.line-de.from.line)}function Y(){N.diffOutOfDate=!0,N.dealigned=!0,Q("full")}return N.edit.on("change",ye),N.orig.on("change",ye),N.edit.on("swapDoc",Y),N.orig.on("swapDoc",Y),N.mv.options.connect=="align"&&(n.on(N.edit.state.trackAlignable,"realign",le),n.on(N.orig.state.trackAlignable,"realign",le)),N.edit.on("viewportChange",function(){pe(!1)}),N.orig.on("viewportChange",function(){pe(!1)}),Q(),Q}function f(N,W){N.edit.on("scroll",function(){d(N,!0)&&A(N)}),N.orig.on("scroll",function(){d(N,!1)&&A(N),W&&d(W,!0)&&A(W)})}function d(N,W){if(N.diffOutOfDate)return N.lockScroll&&N.needsScrollSync==null&&(N.needsScrollSync=W),!1;if(N.needsScrollSync=null,!N.lockScroll)return!0;var O,j,F=+new Date;if(W?(O=N.edit,j=N.orig):(O=N.orig,j=N.edit),O.state.scrollSetBy==N&&(O.state.scrollSetAt||0)+250>F)return!1;var Q=O.getScrollInfo();if(N.mv.options.connect=="align")je=Q.top;else{var le=.5*Q.clientHeight,pe=Q.top+le,ye=O.lineAtHeight(pe,"local"),Y=qe(N.chunks,ye,W),X=m(O,W?Y.edit:Y.orig),de=m(j,W?Y.orig:Y.edit),Te=(pe-X.top)/(X.bot-X.top),je=de.top-le+Te*(de.bot-de.top),he,Ae;if(je>Q.top&&(Ae=Q.top/le)<1)je=je*Ae+Q.top*(1-Ae);else if((he=Q.height-Q.clientHeight-Q.top)he&&(Ae=he/le)<1&&(je=je*Ae+(Ne.height-Ne.clientHeight-he)*(1-Ae))}}return j.scrollTo(Q.left,je),j.state.scrollSetAt=F,j.state.scrollSetBy=N,!0}function m(N,W){var O=W.after;return O==null&&(O=N.lastLine()+1),{top:N.heightAtLine(W.before||0,"local"),bot:N.heightAtLine(O,"local")}}function v(N,W,O){N.lockScroll=W,W&&O!=!1&&d(N,DIFF_INSERT)&&A(N),(W?n.addClass:n.rmClass)(N.lockButton,"CodeMirror-merge-scrolllock-enabled")}function y(N,W,O){for(var j=O.classLocation,F=0;F20||O.from-Q.to>20?(_(N,O.marked,F),k(N,W,j,O.marked,Q.from,Q.to,F),O.from=Q.from,O.to=Q.to):(Q.fromO.to&&(k(N,W,j,O.marked,O.to,Q.to,F),O.to=Q.to))})}function x(N,W,O,j,F,Q){for(var le=O.classLocation,pe=N.getLineHandle(W),ye=0;yeJe&&(je&&(de(Te,Je),je=!1),Te=ct)}else if(je=!0,Ne==O){var ot=Ze(pe,me,!0),Tt=be(ye,pe),br=te(Y,ot);_e(Tt,br)||j.push(N.markText(Tt,br,{className:X})),pe=ot}}je&&de(Te,pe.line+1)}function A(N){if(N.showDifferences){if(N.svg){Ie(N.svg);var W=N.gap.offsetWidth;Be(N.svg,"width",W,"height",N.gap.offsetHeight)}N.copyButtons&&Ie(N.copyButtons);for(var O=N.edit.getViewport(),j=N.orig.getViewport(),F=N.mv.wrap.getBoundingClientRect().top,Q=F-N.edit.getScrollerElement().getBoundingClientRect().top+N.edit.getScrollInfo().top,le=F-N.orig.getScrollerElement().getBoundingClientRect().top+N.orig.getScrollInfo().top,pe=0;pe=O.from&&ye.origFrom<=j.to&&ye.origTo>=j.from&&w(N,ye,le,Q,W)}}}function L(N,W){for(var O=0,j=0,F=0;FN&&Q.editFrom<=N)return null;if(Q.editFrom>N)break;O=Q.editTo,j=Q.origTo}return j+(N-O)}function E(N,W,O){for(var j=N.state.trackAlignable,F=N.firstLine(),Q=0,le=[],pe=0;;pe++){for(var ye=W[pe],Y=ye?O?ye.origFrom:ye.editFrom:1e9;Qde){Q++,F--;continue e}if(Te.editTo>X){if(Te.editFrom<=X)continue e;break}pe+=Te.origTo-Te.origFrom-(Te.editTo-Te.editFrom),le++}if(X==de-pe)ye[j]=de,Q++;else if(X1&&j.push(z(N[le],O[le],ye))}}function z(N,W,O){var j=!0;W>N.lastLine()&&(W--,j=!1);var F=document.createElement("div");return F.className="CodeMirror-merge-spacer",F.style.height=O+"px",F.style.minWidth="1px",N.addLineWidget(W,F,{height:O,above:j,mergeSpacer:!0,handleMouseEvents:!0})}function w(N,W,O,j,F){var Q=N.type=="left",le=N.orig.heightAtLine(W.origFrom,"local",!0)-O;if(N.svg){var pe=le,ye=N.edit.heightAtLine(W.editFrom,"local",!0)-j;if(Q){var Y=pe;pe=ye,ye=Y}var X=N.orig.heightAtLine(W.origTo,"local",!0)-O,de=N.edit.heightAtLine(W.editTo,"local",!0)-j;if(Q){var Y=X;X=de,de=Y}var Te=" C "+F/2+" "+ye+" "+F/2+" "+pe+" "+(F+2)+" "+pe,je=" C "+F/2+" "+X+" "+F/2+" "+de+" -1 "+de;Be(N.svg.appendChild(document.createElementNS(i,"path")),"d","M -1 "+ye+Te+" L "+(F+2)+" "+X+je+" z","class",N.classes.connect)}if(N.copyButtons){var he=N.copyButtons.appendChild(Xe("div",N.type=="left"?"⇝":"⇜","CodeMirror-merge-copy")),Ae=N.mv.options.allowEditingOriginals;if(he.title=N.edit.phrase(Ae?"Push to left":"Revert chunk"),he.chunk=W,he.style.top=(W.origTo>W.origFrom?le:N.edit.heightAtLine(W.editFrom,"local")-j)+"px",he.setAttribute("role","button"),he.setAttribute("tabindex","0"),he.setAttribute("aria-label",he.title),Ae){var Ne=N.edit.heightAtLine(W.editFrom,"local")-j,me=N.copyButtons.appendChild(Xe("div",N.type=="right"?"⇝":"⇜","CodeMirror-merge-copy-reverse"));me.title="Push to right",me.chunk={editFrom:W.origFrom,editTo:W.origTo,origFrom:W.editFrom,origTo:W.editTo},me.style.top=Ne+"px",N.type=="right"?me.style.left="2px":me.style.right="2px",me.setAttribute("role","button"),me.setAttribute("tabindex","0"),me.setAttribute("aria-label",me.title)}}}function R(N,W,O,j){if(!N.diffOutOfDate){var F=j.origTo>O.lastLine()?r(j.origFrom-1):r(j.origFrom,0),Q=r(j.origTo,0),le=j.editTo>W.lastLine()?r(j.editFrom-1):r(j.editFrom,0),pe=r(j.editTo,0),ye=N.mv.options.revertChunk;ye?ye(N.mv,O,F,Q,W,le,pe):W.replaceRange(O.getRange(F,Q),le,pe)}}var U=n.MergeView=function(N,W){if(!(this instanceof U))return new U(N,W);this.options=W;var O=W.origLeft,j=W.origRight==null?W.orig:W.origRight,F=O!=null,Q=j!=null,le=1+(F?1:0)+(Q?1:0),pe=[],ye=this.left=null,Y=this.right=null,X=this;if(F){ye=this.left=new o(this,"left");var de=Xe("div",null,"CodeMirror-merge-pane CodeMirror-merge-left");pe.push(de),pe.push(K(ye))}var Te=Xe("div",null,"CodeMirror-merge-pane CodeMirror-merge-editor");if(pe.push(Te),Q){Y=this.right=new o(this,"right"),pe.push(K(Y));var je=Xe("div",null,"CodeMirror-merge-pane CodeMirror-merge-right");pe.push(je)}(Q?je:Te).className+=" CodeMirror-merge-pane-rightmost",pe.push(Xe("div",null,null,"height: 0; clear: both;"));var he=this.wrap=N.appendChild(Xe("div",pe,"CodeMirror-merge CodeMirror-merge-"+le+"pane"));this.edit=n(Te,Ee(W)),ye&&ye.init(de,O,W),Y&&Y.init(je,j,W),W.collapseIdentical&&this.editor().operation(function(){bt(X,W.collapseIdentical)}),W.connect=="align"&&(this.aligners=[],q(this.left||this.right,!0)),ye&&ye.registerEvents(Y),Y&&Y.registerEvents(ye);var Ae=function(){ye&&A(ye),Y&&A(Y)};n.on(window,"resize",Ae);var Ne=setInterval(function(){for(var me=he.parentNode;me&&me!=document.body;me=me.parentNode);me||(clearInterval(Ne),n.off(window,"resize",Ae))},5e3)};function K(N){var W=N.lockButton=Xe("div",null,"CodeMirror-merge-scrolllock");W.setAttribute("role","button"),W.setAttribute("tabindex","0");var O=Xe("div",[W],"CodeMirror-merge-scrolllock-wrap");n.on(W,"click",function(){v(N,!N.lockScroll)}),n.on(W,"keyup",function(le){(le.key==="Enter"||le.code==="Space")&&v(N,!N.lockScroll)});var j=[O];if(N.mv.options.revertButtons!==!1){N.copyButtons=Xe("div",null,"CodeMirror-merge-copybuttons-"+N.type);var F=function(le){var pe=le.target||le.srcElement;if(pe.chunk){if(pe.className=="CodeMirror-merge-copy-reverse"){R(N,N.orig,N.edit,pe.chunk);return}R(N,N.edit,N.orig,pe.chunk)}};n.on(N.copyButtons,"click",F),n.on(N.copyButtons,"keyup",function(le){(le.key==="Enter"||le.code==="Space")&&F(le)}),j.unshift(N.copyButtons)}if(N.mv.options.connect!="align"){var Q=document.createElementNS&&document.createElementNS(i,"svg");Q&&!Q.createSVGRect&&(Q=null),N.svg=Q,Q&&j.push(Q)}return N.gap=Xe("div",j,"CodeMirror-merge-gap")}U.prototype={constructor:U,editor:function(){return this.edit},rightOriginal:function(){return this.right&&this.right.orig},leftOriginal:function(){return this.left&&this.left.orig},setShowDifferences:function(N){this.right&&this.right.setShowDifferences(N),this.left&&this.left.setShowDifferences(N)},rightChunks:function(){if(this.right)return s(this.right),this.right.chunks},leftChunks:function(){if(this.left)return s(this.left),this.left.chunks}};function oe(N){return typeof N=="string"?N:N.getValue()}var D;function ae(N,W,O){D||(D=new diff_match_patch);for(var j=D.diff_main(N,W),F=0;FX&&(le&&W.push({origFrom:j,origTo:de,editFrom:O,editTo:X}),O=je,j=he)}else Ze(ye==DIFF_INSERT?F:Q,pe[1])}return(O<=F.line||j<=Q.line)&&W.push({origFrom:j,origTo:Q.line+1,editFrom:O,editTo:F.line+1}),W}function ve(N,W){if(W==N.length-1)return!0;var O=N[W+1][1];return O.length==1&&W1||W==N.length-3)&&O.charCodeAt(0)==10)}function ze(N,W){if(W==0)return!0;var O=N[W-1][1];return O.charCodeAt(O.length-1)!=10?!1:W==1?!0:(O=N[W-2][1],O.charCodeAt(O.length-1)==10)}function qe(N,W,O){for(var j,F,Q,le,pe=0;peW?(F=ye.editFrom,le=ye.origFrom):X>W&&(F=ye.editTo,le=ye.origTo)),X<=W?(j=ye.editTo,Q=ye.origTo):Y<=W&&(j=ye.editFrom,Q=ye.origFrom)}return{edit:{before:j,after:F},orig:{before:Q,after:le}}}function yt(N,W,O){N.addLineClass(W,"wrap","CodeMirror-merge-collapsed-line");var j=document.createElement("span");j.className="CodeMirror-merge-collapsed-widget",j.title=N.phrase("Identical text collapsed. Click to expand.");var F=N.markText(r(W,0),r(O-1),{inclusiveLeft:!0,inclusiveRight:!0,replacedWith:j,clearOnEnter:!0});function Q(){F.clear(),N.removeLineClass(W,"wrap","CodeMirror-merge-collapsed-line")}return F.explicitlyCleared&&Q(),n.on(j,"click",Q),F.on("clear",Q),n.on(j,"click",Q),{mark:F,clear:Q}}function mt(N,W){var O=[];function j(){for(var pe=0;pe=0&&peW){var X=[{line:ye,cm:j}];N.left&&X.push({line:L(ye,N.left.chunks),cm:N.left.orig}),N.right&&X.push({line:L(ye,N.right.chunks),cm:N.right.orig});var de=mt(Y,X);N.options.onCollapse&&N.options.onCollapse(N,ye,Y,de)}}}function Xe(N,W,O,j){var F=document.createElement(N);if(O&&(F.className=O),j&&(F.style.cssText=j),typeof W=="string")F.appendChild(document.createTextNode(W));else if(W)for(var Q=0;Q0;--W)N.removeChild(N.firstChild)}function Be(N){for(var W=1;W0)break}this.signal(),this.alignable.splice(O,0,N,W)},find:function(N){for(var W=0;W-1){var Y=this.alignable[Q+1];Y==Fe?this.alignable.splice(Q,2):this.alignable[Q+1]=Y&~Fe}le>-1&&O&&this.set(N+O,Fe)}};function te(N,W){return(N.line-W.line||N.ch-W.ch)<0?N:W}function be(N,W){return(N.line-W.line||N.ch-W.ch)>0?N:W}function _e(N,W){return N.line==W.line&&N.ch==W.ch}function xe(N,W,O){for(var j=N.length-1;j>=0;j--){var F=N[j],Q=(O?F.origTo:F.editTo)-1;if(QW)return Q}}function Z(N,W){var O=null,j=N.state.diffViews,F=N.getCursor().line;if(j)for(var Q=0;QO:ye"u"&&(this.Diff_Timeout<=0?u=Number.MAX_VALUE:u=new Date().getTime()+this.Diff_Timeout*1e3);var f=u;if(o==null||s==null)throw new Error("Null input. (diff_main)");if(o==s)return o?[new e.Diff(i,o)]:[];typeof l>"u"&&(l=!0);var d=l,m=this.diff_commonPrefix(o,s),v=o.substring(0,m);o=o.substring(m),s=s.substring(m),m=this.diff_commonSuffix(o,s);var y=o.substring(o.length-m);o=o.substring(0,o.length-m),s=s.substring(0,s.length-m);var _=this.diff_compute_(o,s,d,f);return v&&_.unshift(new e.Diff(i,v)),y&&_.push(new e.Diff(i,y)),this.diff_cleanupMerge(_),_},e.prototype.diff_compute_=function(o,s,l,u){var f;if(!o)return[new e.Diff(r,s)];if(!s)return[new e.Diff(n,o)];var d=o.length>s.length?o:s,m=o.length>s.length?s:o,v=d.indexOf(m);if(v!=-1)return f=[new e.Diff(r,d.substring(0,v)),new e.Diff(i,m),new e.Diff(r,d.substring(v+m.length))],o.length>s.length&&(f[0][0]=f[2][0]=n),f;if(m.length==1)return[new e.Diff(n,o),new e.Diff(r,s)];var y=this.diff_halfMatch_(o,s);if(y){var _=y[0],C=y[1],x=y[2],k=y[3],A=y[4],L=this.diff_main(_,x,l,u),E=this.diff_main(C,k,l,u);return L.concat([new e.Diff(i,A)],E)}return l&&o.length>100&&s.length>100?this.diff_lineMode_(o,s,u):this.diff_bisect_(o,s,u)},e.prototype.diff_lineMode_=function(o,s,l){var u=this.diff_linesToChars_(o,s);o=u.chars1,s=u.chars2;var f=u.lineArray,d=this.diff_main(o,s,!1,l);this.diff_charsToLines_(d,f),this.diff_cleanupSemantic(d),d.push(new e.Diff(i,""));for(var m=0,v=0,y=0,_="",C="";m=1&&y>=1){d.splice(m-v-y,v+y),m=m-v-y;for(var x=this.diff_main(_,C,!1,l),k=x.length-1;k>=0;k--)d.splice(m,0,x[k]);m=m+x.length}y=0,v=0,_="",C="";break}m++}return d.pop(),d},e.prototype.diff_bisect_=function(o,s,l){for(var u=o.length,f=s.length,d=Math.ceil((u+f)/2),m=d,v=2*d,y=new Array(v),_=new Array(v),C=0;Cl);I++){for(var q=-I+A;q<=I-L;q+=2){var P=m+q,z;q==-I||q!=I&&y[P-1]u)L+=2;else if(w>f)A+=2;else if(k){var R=m+x-q;if(R>=0&&R=U)return this.diff_bisectSplit_(o,s,z,w,l)}}}for(var K=-I+E;K<=I-H;K+=2){var R=m+K,U;K==-I||K!=I&&_[R-1]<_[R+1]?U=_[R+1]:U=_[R-1]+1;for(var oe=U-K;Uu)H+=2;else if(oe>f)E+=2;else if(!k){var P=m+x-K;if(P>=0&&P=U)return this.diff_bisectSplit_(o,s,z,w,l)}}}}return[new e.Diff(n,o),new e.Diff(r,s)]},e.prototype.diff_bisectSplit_=function(o,s,l,u,f){var d=o.substring(0,l),m=s.substring(0,u),v=o.substring(l),y=s.substring(u),_=this.diff_main(d,m,!1,f),C=this.diff_main(v,y,!1,f);return _.concat(C)},e.prototype.diff_linesToChars_=function(o,s){var l=[],u={};l[0]="";function f(y){for(var _="",C=0,x=-1,k=l.length;xu?o=o.substring(l-u):ls.length?o:s,u=o.length>s.length?s:o;if(l.length<4||u.length*2=L.length?[z,w,R,U,P]:null}var m=d(l,u,Math.ceil(l.length/4)),v=d(l,u,Math.ceil(l.length/2)),y;if(!m&&!v)return null;v?m?y=m[4].length>v[4].length?m:v:y=v:y=m;var _,C,x,k;o.length>s.length?(_=y[0],C=y[1],x=y[2],k=y[3]):(x=y[0],k=y[1],_=y[2],C=y[3]);var A=y[4];return[_,C,x,k,A]},e.prototype.diff_cleanupSemantic=function(o){for(var s=!1,l=[],u=0,f=null,d=0,m=0,v=0,y=0,_=0;d0?l[u-1]:-1,m=0,v=0,y=0,_=0,f=null,s=!0)),d++;for(s&&this.diff_cleanupMerge(o),this.diff_cleanupSemanticLossless(o),d=1;d=A?(k>=C.length/2||k>=x.length/2)&&(o.splice(d,0,new e.Diff(i,x.substring(0,k))),o[d-1][1]=C.substring(0,C.length-k),o[d+1][1]=x.substring(k),d++):(A>=C.length/2||A>=x.length/2)&&(o.splice(d,0,new e.Diff(i,C.substring(0,A))),o[d-1][0]=r,o[d-1][1]=x.substring(0,x.length-A),o[d+1][0]=n,o[d+1][1]=C.substring(A),d++),d++}d++}},e.prototype.diff_cleanupSemanticLossless=function(o){function s(A,L){if(!A||!L)return 6;var E=A.charAt(A.length-1),H=L.charAt(0),I=E.match(e.nonAlphaNumericRegex_),q=H.match(e.nonAlphaNumericRegex_),P=I&&E.match(e.whitespaceRegex_),z=q&&H.match(e.whitespaceRegex_),w=P&&E.match(e.linebreakRegex_),R=z&&H.match(e.linebreakRegex_),U=w&&A.match(e.blanklineEndRegex_),K=R&&L.match(e.blanklineStartRegex_);return U||K?5:w||R?4:I&&!P&&z?3:P||z?2:I||q?1:0}for(var l=1;l=x&&(x=k,y=u,_=f,C=d)}o[l-1][1]!=y&&(y?o[l-1][1]=y:(o.splice(l-1,1),l--),o[l][1]=_,C?o[l+1][1]=C:(o.splice(l+1,1),l--))}l++}},e.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,e.whitespaceRegex_=/\s/,e.linebreakRegex_=/[\r\n]/,e.blanklineEndRegex_=/\n\r?\n$/,e.blanklineStartRegex_=/^\r?\n\r?\n/,e.prototype.diff_cleanupEfficiency=function(o){for(var s=!1,l=[],u=0,f=null,d=0,m=!1,v=!1,y=!1,_=!1;d0?l[u-1]:-1,y=_=!1),s=!0)),d++;s&&this.diff_cleanupMerge(o)},e.prototype.diff_cleanupMerge=function(o){o.push(new e.Diff(i,""));for(var s=0,l=0,u=0,f="",d="",m;s1?(l!==0&&u!==0&&(m=this.diff_commonPrefix(d,f),m!==0&&(s-l-u>0&&o[s-l-u-1][0]==i?o[s-l-u-1][1]+=d.substring(0,m):(o.splice(0,0,new e.Diff(i,d.substring(0,m))),s++),d=d.substring(m),f=f.substring(m)),m=this.diff_commonSuffix(d,f),m!==0&&(o[s][1]=d.substring(d.length-m)+o[s][1],d=d.substring(0,d.length-m),f=f.substring(0,f.length-m))),s-=l+u,o.splice(s,l+u),f.length&&(o.splice(s,0,new e.Diff(n,f)),s++),d.length&&(o.splice(s,0,new e.Diff(r,d)),s++),s++):s!==0&&o[s-1][0]==i?(o[s-1][1]+=o[s][1],o.splice(s,1)):s++,u=0,l=0,f="",d="";break}o[o.length-1][1]===""&&o.pop();var v=!1;for(s=1;ss));m++)f=l,d=u;return o.length!=m&&o[m][0]===n?d:d+(s-f)},e.prototype.diff_prettyHtml=function(o){for(var s=[],l=/&/g,u=//g,d=/\n/g,m=0;m");switch(v){case r:s[m]=''+_+"";break;case n:s[m]=''+_+"";break;case i:s[m]=""+_+"";break}}return s.join("")},e.prototype.diff_text1=function(o){for(var s=[],l=0;lthis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var u=this.match_alphabet_(s),f=this;function d(z,w){var R=z/s.length,U=Math.abs(l-w);return f.Match_Distance?R+U/f.Match_Distance:U?1:R}var m=this.Match_Threshold,v=o.indexOf(s,l);v!=-1&&(m=Math.min(d(0,v),m),v=o.lastIndexOf(s,l+s.length),v!=-1&&(m=Math.min(d(0,v),m)));var y=1<=L;I--){var q=u[o.charAt(I-1)];if(A===0?H[I]=(H[I+1]<<1|1)&q:H[I]=(H[I+1]<<1|1)&q|((k[I+1]|k[I])<<1|1)|k[I+1],H[I]&y){var P=d(A,I-1);if(P<=m)if(m=P,v=I-1,v>l)L=Math.max(1,2*l-v);else break}}if(d(A+1,l)>m)break;k=H}return v},e.prototype.match_alphabet_=function(o){for(var s={},l=0;l"u")u=o,f=this.diff_main(u,s,!0),f.length>2&&(this.diff_cleanupSemantic(f),this.diff_cleanupEfficiency(f));else if(o&&typeof o=="object"&&typeof s>"u"&&typeof l>"u")f=o,u=this.diff_text1(f);else if(typeof o=="string"&&s&&typeof s=="object"&&typeof l>"u")u=o,f=s;else if(typeof o=="string"&&typeof s=="string"&&l&&typeof l=="object")u=o,f=l;else throw new Error("Unknown call format to patch_make.");if(f.length===0)return[];for(var d=[],m=new e.patch_obj,v=0,y=0,_=0,C=u,x=u,k=0;k=2*this.Patch_Margin&&v&&(this.patch_addContext_(m,C),d.push(m),m=new e.patch_obj,v=0,C=x,y=_);break}A!==r&&(y+=L.length),A!==n&&(_+=L.length)}return v&&(this.patch_addContext_(m,C),d.push(m)),d},e.prototype.patch_deepCopy=function(o){for(var s=[],l=0;lthis.Match_MaxBits?(y=this.match_main(s,v.substring(0,this.Match_MaxBits),m),y!=-1&&(_=this.match_main(s,v.substring(v.length-this.Match_MaxBits),m+v.length-this.Match_MaxBits),(_==-1||y>=_)&&(y=-1))):y=this.match_main(s,v,m),y==-1)f[d]=!1,u-=o[d].length2-o[d].length1;else{f[d]=!0,u=y-m;var C;if(_==-1?C=s.substring(y,y+v.length):C=s.substring(y,_+this.Match_MaxBits),v==C)s=s.substring(0,y)+this.diff_text2(o[d].diffs)+s.substring(y+v.length);else{var x=this.diff_main(v,C,!1);if(v.length>this.Match_MaxBits&&this.diff_levenshtein(x)/v.length>this.Patch_DeleteThreshold)f[d]=!1;else{this.diff_cleanupSemanticLossless(x);for(var k=0,A,L=0;Ld[0][1].length){var m=s-d[0][1].length;d[0][1]=l.substring(d[0][1].length)+d[0][1],f.start1-=m,f.start2-=m,f.length1+=m,f.length2+=m}if(f=o[o.length-1],d=f.diffs,d.length==0||d[d.length-1][0]!=i)d.push(new e.Diff(i,l)),f.length1+=s,f.length2+=s;else if(s>d[d.length-1][1].length){var m=s-d[d.length-1][1].length;d[d.length-1][1]+=l.substring(0,m),f.length1+=m,f.length2+=m}return l},e.prototype.patch_splitMax=function(o){for(var s=this.Match_MaxBits,l=0;l2*s?(v.length1+=C.length,f+=C.length,y=!1,v.diffs.push(new e.Diff(_,C)),u.diffs.shift()):(C=C.substring(0,s-v.length1-this.Patch_Margin),v.length1+=C.length,f+=C.length,_===i?(v.length2+=C.length,d+=C.length):y=!1,v.diffs.push(new e.Diff(_,C)),C==u.diffs[0][1]?u.diffs.shift():u.diffs[0][1]=u.diffs[0][1].substring(C.length))}m=this.diff_text2(v.diffs),m=m.substring(m.length-this.Patch_Margin);var x=this.diff_text1(u.diffs).substring(0,this.Patch_Margin);x!==""&&(v.length1+=x.length,v.length2+=x.length,v.diffs.length!==0&&v.diffs[v.diffs.length-1][0]===i?v.diffs[v.diffs.length-1][1]+=x:v.diffs.push(new e.Diff(i,x))),y||o.splice(++l,0,v)}}},e.prototype.patch_toText=function(o){for(var s=[],l=0;l2&&H.token&&typeof H.token!="string"){for(var P=2;P-1)return n.Pass;var k=_.indent.length-1,A=v[_.state];e:for(;;){for(var L=0;L({})},cminstance:{type:Object,default:()=>null},placeholder:{type:String,default:""}},emits:{ready:t=>t,"update:cminstance":t=>t},setup(t,{emit:e}){const n=Ot(),r=Ot(null),i=()=>{r.value=fa(Wd.fromTextArea(n.value,t.options)),e("update:cminstance",r.value);const o=En(()=>t.cminstance,s=>{var l;s&&((l=t.cminstance)==null||l.setValue(t.value||t.content)),e("ready",fr(r)),o==null||o()},{deep:!0})};return ts(()=>{i()}),{textarea:n,initialize:i}}}),jw=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},Woe=["name","placeholder"];function Uoe(t,e,n,r,i,o){return ge(),Se("textarea",{ref:"textarea",name:t.$props.name,placeholder:t.$props.placeholder},null,8,Woe)}const OE=jw(joe,[["render",Uoe]]);window.diff_match_patch=Foe;window.DIFF_DELETE=-1;window.DIFF_INSERT=1;window.DIFF_EQUAL=0;const qoe=Vn({name:"MergeMode",props:{options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})}},emits:["update:cminstance","ready"],setup(t,{emit:e}){const n=Ot(),r=Ot(),i=()=>{n.value=fa(Wd.MergeView(r.value,t.options)),e("update:cminstance",n.value),e("ready",n)};return ts(()=>{i()}),{mergeView:r,initialize:i}}}),Koe={ref:"mergeView"};function Goe(t,e,n,r,i,o){return ge(),Se("div",Koe,null,512)}const Yoe=jw(qoe,[["render",Goe]]);function Joe(t){const e=/#link#(.+)#link#/g,n=[];let r;for(r=e.exec(t);r;){const i=document.createElement("a"),o=JSON.parse(r[1]),s=Object.entries(o);for(const[l,u]of s)i.setAttribute(l,u);i.className="editor_custom_link",i.innerHTML="logDownload",n.push({start:r.index,end:r.index+r[0].length,node:i}),r=e.exec(t)}return n}function Xoe(t){const e=[];function n(){const r=/#log<(\w*)>log#((.|\r\n|\n)*?)#log<(\w*)>log#/g;let i;for(i=r.exec(t);i;){const o=i[0].replace(/\r\n/g,` -`).split(` -`),s=i[2].replace(/\r\n/g,` -`).split(` -`),l=document.createElement("span"),u=i[1];l.className=`c-editor--log__${u}`;let f=0;for(let d=0;d[ \t])(.+)/,token:["tag","","error.strong","error.strong"],sol:!0},{regex:/(\[.*?\])([ \t]*)()(.+)(.?)/,token:["tag","","bracket","bracket","hr"],sol:!0},{regex:/(\[.*?\])([ \t]*)()(.+)(.?)/,token:["tag","","comment","comment","hr"],sol:!0}];Wd.defineSimpleMode("fclog",{start:[...pp,{regex:/.*/,token:"hr"}],error:[...pp,{regex:/.*/,token:"error.strong"}],info:[...pp,{regex:/.*/,token:"bracket"}],warning:[...pp,{regex:/.*\[/,token:"comment"}]});Wd.defineSimpleMode("log",{start:[{regex:/^[=]+[^=]*[=]+/,token:"strong"},{regex:/([^\w])([A-Z][\w]*)/,token:["","string"]},{regex:/(^[A-Z][\w]*)/,token:"string"}]});const Zoe=Vn({name:"CodemirrorFclog",props:{value:{type:String,default:""},name:{type:String,default:`cm-textarea-${+new Date}`},options:{type:Object,default:()=>({})},cminstance:{type:Object,default:()=>({})},placeholder:{type:String,default:""}},emits:["update:cminstance","ready"],setup(t,{emit:e}){const n=Ot(),r=Ot(null),i=(s=t.cminstance)=>{s.getAllMarks().forEach(f=>f.clear());const l=s.getValue(),u=[].concat(Joe(l)).concat(Xoe(l));for(let f=0;f{var s;r.value=fa(Wd.fromTextArea(n.value,t.options)),e("update:cminstance",fr(r)),(s=r.value)==null||s.on("change",i)};return En(()=>t.cminstance,s=>{var l;s&&(i(t.cminstance),(l=t.cminstance)==null||l.setValue(t.value),e("ready",r))},{deep:!0,immediate:!0}),ts(()=>{o()}),{initialize:o,textarea:n}}}),Qoe=["name","placeholder"];function ese(t,e,n,r,i,o){return ge(),Se("textarea",{ref:"textarea",name:t.$props.name,placeholder:t.$props.placeholder},null,8,Qoe)}const tse=jw(Zoe,[["render",ese]]),DL={"update:value":()=>!0,change:(t,e)=>({value:t,cm:e}),input:()=>!0,ready:t=>t},nse=["changes","scroll","beforeChange","cursorActivity","keyHandled","inputRead","electricInput","beforeSelectionChange","viewportChange","swapDoc","gutterClick","gutterContextMenu","focus","blur","refresh","optionChange","scrollCursorIntoView","update"],rse=()=>{const t={};return nse.forEach(e=>{t[e]=(...n)=>n}),t},ise={...DL,...rse()},f0={mode:"text",theme:"default",lineNumbers:!0,smartIndent:!0,indentUnit:2};function ose(t){Promise.resolve().then(()=>{const e=t.getScrollInfo();t.scrollTo(e.left,e.height)})}const sse=({props:t,cminstance:e,emit:n,internalInstance:r,content:i})=>{const o=er(()=>{var l;return t.merge?(l=fr(e))==null?void 0:l.editor():fr(e)}),s=()=>{const l=[];return Object.keys(r==null?void 0:r.vnode.props).forEach(u=>{if(u.startsWith("on")){const f=u.replace(u[2],u[2].toLowerCase()).slice(2);!DL[f]&&l.push(f)}}),l};return{listenerEvents:()=>{o.value.on("change",u=>{const f=u.getValue();f===i.value&&f!==""||(i.value=f,n("update:value",i.value||""),n("input",i.value||" "),Promise.resolve().then(()=>{n("change",i.value,u)}),t.keepCursorInEnd&&ose(u))});const l={};s().filter(u=>!l[u]&&(l[u]=!0)).forEach(u=>{o.value.on(u,(...f)=>{n(u,...f)})})}}};function ase({props:t,cminstance:e,presetRef:n}){const r=Ot(null),i=Ot(null),o=er(()=>{var m;return t.merge?(m=fr(e))==null?void 0:m.editor():fr(e)}),s=()=>{Ri(()=>{var m;(m=o.value)==null||m.refresh()})},l=(m=t.width,v=t.height)=>{var y;r.value=String(m).replace("px",""),i.value=String(v).replace("px","");const _=i.value;(y=o.value)==null||y.setSize(r.value,_)},u=()=>{var m;const v=(m=o.value)==null?void 0:m.getWrapperElement();v==null||v.remove()},f=()=>{var m,v,y;const _=(m=o.value)==null?void 0:m.getDoc().getHistory();(v=n.value)==null||v.initialize(),u(),(y=o.value)==null||y.getDoc().setHistory(_)},d=()=>{const m=document.querySelector(".CodeMirror-gutters");return(m==null?void 0:m.style.left.replace("px",""))!=="0"};return{reload:f,refresh:s,resize:l,destroy:u,containerHeight:i,reviseStyle:()=>{if(s(),!d())return;const m=setInterval(()=>{d()?s():clearInterval(m)},60),v=setTimeout(()=>{clearInterval(m),clearTimeout(v)},400)}}}const lse=Vn({__name:"index",props:{value:{type:String,default:""},options:{type:Object,default:()=>f0},globalOptions:{type:Object,default:()=>f0},placeholder:{type:String,default:""},border:{type:Boolean,default:!1},width:{type:[String,Number],default:null},height:{type:[String,Number],default:null},originalStyle:{type:Boolean,default:!1},keepCursorInEnd:{type:Boolean,default:!1},merge:{type:Boolean,default:!1},name:{type:String,default:""},marker:{type:Function,default:()=>null},unseenLines:{type:Array,default:()=>[]}},emits:ise,setup(t,{expose:e,emit:n}){var r,i;const o=t;typeof Object.assign!="function"&&Object.defineProperty(Object,"assign",{value(P){if(P==null)throw new TypeError("Cannot convert undefined or null to object");const z=Object(P);for(let w=1;w{var P;return o.merge?(P=fr(s))==null?void 0:P.editor():fr(s)}),{refresh:_,resize:C,destroy:x,containerHeight:k,reviseStyle:A}=ase({props:o,cminstance:s,presetRef:v}),{listenerEvents:L}=sse({props:o,cminstance:s,emit:n,internalInstance:d,content:l}),E=()=>{o.unseenLines!==void 0&&o.marker!==void 0&&o.unseenLines.forEach(P=>{var z,w;const R=(z=s.value)==null?void 0:z.lineInfo(P);(w=s.value)==null||w.setGutterMarker(P,"breakpoints",R!=null&&R.gutterMarkers?null:o.marker())})},H=P=>{var z,w;const R=(z=s.value)==null?void 0:z.getValue();P!==R&&((w=s.value)==null||w.setValue(P),l.value=P,A()),E()},I=()=>{L(),E(),C(o.width,o.height),n("ready",s.value),En([()=>o.width,()=>o.height],([P,z])=>{C(P,z)},{deep:!0})},q=()=>{if(o.options.mode==="fclog"||o.options.mode==="log"){u.value=tse;return}if(o.merge){u.value=Yoe;return}u.value=OE};return En(()=>o.options,P=>{var z;for(const w in o.options)(z=y.value)==null||z.setOption(w,fr(P[w]))},{deep:!0}),En(()=>o.value,P=>{H(P)}),En(()=>o.merge,q,{immediate:!0}),Ml(()=>{x()}),e({cminstance:s,resize:C,refresh:_,destroy:x}),(P,z)=>(ge(),Se("div",{class:vt(["codemirror-container",{merge:P.$props.merge,bordered:P.$props.border||P.$props.merge&&!o.originalStyle,"width-auto":!P.$props.width||P.$props.width=="100%","height-auto":!P.$props.height||P.$props.height=="100%","original-style":o.originalStyle}]),style:oi({height:fr(k)+"px"})},[(ge(),Ct(Qs(fr(u)),wi({ref_key:"presetRef",ref:v,cminstance:s.value,"onUpdate:cminstance":z[0]||(z[0]=w=>s.value=w),style:{height:"100%"}},{...P.$props,...P.$attrs,options:f.value,name:fr(m),content:l.value},{onReady:I}),null,16,["cminstance"]))],6))}});function use(t,e){e===void 0&&(e={});var n=e.insertAt;if(!(!t||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}use(`.codemirror-container { ->>>>>>>> origin/craft-4:src/web/assets/field/dist/assets/vizy-91fcee7d.js - position: relative; - display: inline-block; - height: 100%; - width: fit-content; - font-size: 12px; - overflow: hidden; -} -.codemirror-container.bordered { - border-radius: 4px; - border: 1px solid #dddddd; -} -.codemirror-container.width-auto { - width: 100%; -} -.codemirror-container.height-auto { - height: 100%; -} -.codemirror-container.height-auto .CodeMirror, -.codemirror-container.height-auto .cm-s-default { - height: 100% !important; -} -.codemirror-container .editor_custom_link { - cursor: pointer; - color: #1474f1; - text-decoration: underline; -} -.codemirror-container .editor_custom_link:hover { - color: #04b4fa; -} -.codemirror-container:not(.original-style) .CodeMirror-lines .CodeMirror-placeholder.CodeMirror-line-like { - color: #666; -} -.codemirror-container:not(.original-style) .CodeMirror, -.codemirror-container:not(.original-style) .CodeMirror-merge-pane { - height: 100%; - font-family: consolas !important; -} -.codemirror-container:not(.original-style) .CodeMirror-merge, -.codemirror-container:not(.original-style) .CodeMirror-merge-right .CodeMirror { - height: 100%; - border: none !important; -} -.codemirror-container:not(.original-style) .c-editor--log__error { - color: #bb0606; - font-weight: bold; -} -.codemirror-container:not(.original-style) .c-editor--log__info { - color: #333333; - font-weight: bold; -} -.codemirror-container:not(.original-style) .c-editor--log__warning { - color: #ee9900; -} -.codemirror-container:not(.original-style) .c-editor--log__success { - color: #669600; -} -.codemirror-container:not(.original-style) .cm-header, -.codemirror-container:not(.original-style) .cm-strong { - font-weight: bold; -} -<<<<<<<< HEAD:src/web/assets/field/dist/assets/vizy-1d31d33d.js -`);var v1={},bse={get exports(){return v1},set exports(t){v1=t}},Jc={},Pf={},_se={get exports(){return Pf},set exports(t){Pf=t}},fy={},dy={},ME;function Ww(){if(ME)return dy;ME=1;function t(r){this.__parent=r,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}t.prototype.clone_empty=function(){var r=new t(this.__parent);return r.set_indent(this.__indent_count,this.__alignment_count),r},t.prototype.item=function(r){return r<0?this.__items[this.__items.length+r]:this.__items[r]},t.prototype.has_match=function(r){for(var i=this.__items.length-1;i>=0;i--)if(this.__items[i].match(r))return!0;return!1},t.prototype.set_indent=function(r,i){this.is_empty()&&(this.__indent_count=r||0,this.__alignment_count=i||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},t.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},t.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},t.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var r=this.__parent.current_line;return r.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),r.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),r.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,r.__items[0]===" "&&(r.__items.splice(0,1),r.__character_count-=1),!0}return!1},t.prototype.is_empty=function(){return this.__items.length===0},t.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},t.prototype.push=function(r){this.__items.push(r);var i=r.lastIndexOf(` -`);i!==-1?this.__character_count=r.length-i:this.__character_count+=r.length},t.prototype.pop=function(){var r=null;return this.is_empty()||(r=this.__items.pop(),this.__character_count-=r.length),r},t.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},t.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},t.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},t.prototype.toString=function(){var r="";return this.is_empty()?this.__parent.indent_empty_lines&&(r=this.__parent.get_indent_string(this.__indent_count)):(r=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),r+=this.__items.join("")),r};function e(r,i){this.__cache=[""],this.__indent_size=r.indent_size,this.__indent_string=r.indent_char,r.indent_with_tabs||(this.__indent_string=new Array(r.indent_size+1).join(r.indent_char)),i=i||"",r.indent_level>0&&(i=new Array(r.indent_level+1).join(this.__indent_string)),this.__base_string=i,this.__base_string_length=i.length}e.prototype.get_indent_size=function(r,i){var o=this.__base_string_length;return i=i||0,r<0&&(o=0),o+=r*this.__indent_size,o+=i,o},e.prototype.get_indent_string=function(r,i){var o=this.__base_string;return i=i||0,r<0&&(r=0,o=""),i+=r*this.__indent_size,this.__ensure_cache(i),o+=this.__cache[i],o},e.prototype.__ensure_cache=function(r){for(;r>=this.__cache.length;)this.__add_column()},e.prototype.__add_column=function(){var r=this.__cache.length,i=0,o="";this.__indent_size&&r>=this.__indent_size&&(i=Math.floor(r/this.__indent_size),r-=i*this.__indent_size,o=new Array(i+1).join(this.__indent_string)),r&&(o+=new Array(r+1).join(" ")),this.__cache.push(o)};function n(r,i){this.__indent_cache=new e(r,i),this.raw=!1,this._end_with_newline=r.end_with_newline,this.indent_size=r.indent_size,this.wrap_line_length=r.wrap_line_length,this.indent_empty_lines=r.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new t(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}return n.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},n.prototype.get_line_number=function(){return this.__lines.length},n.prototype.get_indent_string=function(r,i){return this.__indent_cache.get_indent_string(r,i)},n.prototype.get_indent_size=function(r,i){return this.__indent_cache.get_indent_size(r,i)},n.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},n.prototype.add_new_line=function(r){return this.is_empty()||!r&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},n.prototype.get_code=function(r){this.trim(!0);var i=this.current_line.pop();i&&(i[i.length-1]===` -`&&(i=i.replace(/\n+$/g,"")),this.current_line.push(i)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(` -`);return r!==` -`&&(o=o.replace(/[\n]/g,r)),o},n.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},n.prototype.set_indent=function(r,i){return r=r||0,i=i||0,this.next_line.set_indent(r,i),this.__lines.length>1?(this.current_line.set_indent(r,i),!0):(this.current_line.set_indent(),!1)},n.prototype.add_raw_token=function(r){for(var i=0;i1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},n.prototype.just_added_newline=function(){return this.current_line.is_empty()},n.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},n.prototype.ensure_empty_line_above=function(r,i){for(var o=this.__lines.length-2;o>=0;){var s=this.__lines[o];if(s.is_empty())break;if(s.item(0).indexOf(r)!==0&&s.item(-1)!==i){this.__lines.splice(o+1,0,new t(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},dy.Output=n,dy}var hy={},LE;function DN(){if(LE)return hy;LE=1;function t(e,n,r,i){this.type=e,this.text=n,this.comments_before=null,this.newlines=r||0,this.whitespace_before=i||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}return hy.Token=t,hy}var py={},NE;function RN(){return NE||(NE=1,function(t){var e="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",n="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",r="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",i="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",o="(?:\\\\u[0-9a-fA-F]{4}|["+e+r+"])",s="(?:\\\\u[0-9a-fA-F]{4}|["+n+r+i+"])*";t.identifier=new RegExp(o+s,"g"),t.identifierStart=new RegExp(o),t.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+n+r+i+"])+"),t.newline=/[\n\r\u2028\u2029]/,t.lineBreak=new RegExp(`\r -|`+t.newline.source),t.allLineBreaks=new RegExp(t.lineBreak.source,"g")}(py)),py}var my={},Xc={},IE;function Uw(){if(IE)return Xc;IE=1;function t(r,i){this.raw_options=e(r,i),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}t.prototype._get_array=function(r,i){var o=this.raw_options[r],s=i||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(s=o.concat()):typeof o=="string"&&(s=o.split(/[^a-zA-Z0-9_\/\-]+/)),s},t.prototype._get_boolean=function(r,i){var o=this.raw_options[r],s=o===void 0?!!i:!!o;return s},t.prototype._get_characters=function(r,i){var o=this.raw_options[r],s=i||"";return typeof o=="string"&&(s=o.replace(/\\r/,"\r").replace(/\\n/,` -======== -`);var v1={},cse={get exports(){return v1},set exports(t){v1=t}},Jc={},Pf={},fse={get exports(){return Pf},set exports(t){Pf=t}},d0={},h0={},ME;function Ww(){if(ME)return h0;ME=1;function t(r){this.__parent=r,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}t.prototype.clone_empty=function(){var r=new t(this.__parent);return r.set_indent(this.__indent_count,this.__alignment_count),r},t.prototype.item=function(r){return r<0?this.__items[this.__items.length+r]:this.__items[r]},t.prototype.has_match=function(r){for(var i=this.__items.length-1;i>=0;i--)if(this.__items[i].match(r))return!0;return!1},t.prototype.set_indent=function(r,i){this.is_empty()&&(this.__indent_count=r||0,this.__alignment_count=i||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},t.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},t.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},t.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var r=this.__parent.current_line;return r.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),r.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),r.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,r.__items[0]===" "&&(r.__items.splice(0,1),r.__character_count-=1),!0}return!1},t.prototype.is_empty=function(){return this.__items.length===0},t.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},t.prototype.push=function(r){this.__items.push(r);var i=r.lastIndexOf(` -`);i!==-1?this.__character_count=r.length-i:this.__character_count+=r.length},t.prototype.pop=function(){var r=null;return this.is_empty()||(r=this.__items.pop(),this.__character_count-=r.length),r},t.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},t.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},t.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},t.prototype.toString=function(){var r="";return this.is_empty()?this.__parent.indent_empty_lines&&(r=this.__parent.get_indent_string(this.__indent_count)):(r=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),r+=this.__items.join("")),r};function e(r,i){this.__cache=[""],this.__indent_size=r.indent_size,this.__indent_string=r.indent_char,r.indent_with_tabs||(this.__indent_string=new Array(r.indent_size+1).join(r.indent_char)),i=i||"",r.indent_level>0&&(i=new Array(r.indent_level+1).join(this.__indent_string)),this.__base_string=i,this.__base_string_length=i.length}e.prototype.get_indent_size=function(r,i){var o=this.__base_string_length;return i=i||0,r<0&&(o=0),o+=r*this.__indent_size,o+=i,o},e.prototype.get_indent_string=function(r,i){var o=this.__base_string;return i=i||0,r<0&&(r=0,o=""),i+=r*this.__indent_size,this.__ensure_cache(i),o+=this.__cache[i],o},e.prototype.__ensure_cache=function(r){for(;r>=this.__cache.length;)this.__add_column()},e.prototype.__add_column=function(){var r=this.__cache.length,i=0,o="";this.__indent_size&&r>=this.__indent_size&&(i=Math.floor(r/this.__indent_size),r-=i*this.__indent_size,o=new Array(i+1).join(this.__indent_string)),r&&(o+=new Array(r+1).join(" ")),this.__cache.push(o)};function n(r,i){this.__indent_cache=new e(r,i),this.raw=!1,this._end_with_newline=r.end_with_newline,this.indent_size=r.indent_size,this.wrap_line_length=r.wrap_line_length,this.indent_empty_lines=r.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new t(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}return n.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},n.prototype.get_line_number=function(){return this.__lines.length},n.prototype.get_indent_string=function(r,i){return this.__indent_cache.get_indent_string(r,i)},n.prototype.get_indent_size=function(r,i){return this.__indent_cache.get_indent_size(r,i)},n.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},n.prototype.add_new_line=function(r){return this.is_empty()||!r&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},n.prototype.get_code=function(r){this.trim(!0);var i=this.current_line.pop();i&&(i[i.length-1]===` -`&&(i=i.replace(/\n+$/g,"")),this.current_line.push(i)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(` -`);return r!==` -`&&(o=o.replace(/[\n]/g,r)),o},n.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},n.prototype.set_indent=function(r,i){return r=r||0,i=i||0,this.next_line.set_indent(r,i),this.__lines.length>1?(this.current_line.set_indent(r,i),!0):(this.current_line.set_indent(),!1)},n.prototype.add_raw_token=function(r){for(var i=0;i1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},n.prototype.just_added_newline=function(){return this.current_line.is_empty()},n.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},n.prototype.ensure_empty_line_above=function(r,i){for(var o=this.__lines.length-2;o>=0;){var s=this.__lines[o];if(s.is_empty())break;if(s.item(0).indexOf(r)!==0&&s.item(-1)!==i){this.__lines.splice(o+1,0,new t(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},h0.Output=n,h0}var p0={},NE;function RL(){if(NE)return p0;NE=1;function t(e,n,r,i){this.type=e,this.text=n,this.comments_before=null,this.newlines=r||0,this.whitespace_before=i||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}return p0.Token=t,p0}var m0={},LE;function zL(){return LE||(LE=1,function(t){var e="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",n="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",r="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",i="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",o="(?:\\\\u[0-9a-fA-F]{4}|["+e+r+"])",s="(?:\\\\u[0-9a-fA-F]{4}|["+n+r+i+"])*";t.identifier=new RegExp(o+s,"g"),t.identifierStart=new RegExp(o),t.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+n+r+i+"])+"),t.newline=/[\n\r\u2028\u2029]/,t.lineBreak=new RegExp(`\r -|`+t.newline.source),t.allLineBreaks=new RegExp(t.lineBreak.source,"g")}(m0)),m0}var g0={},Xc={},IE;function Uw(){if(IE)return Xc;IE=1;function t(r,i){this.raw_options=e(r,i),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}t.prototype._get_array=function(r,i){var o=this.raw_options[r],s=i||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(s=o.concat()):typeof o=="string"&&(s=o.split(/[^a-zA-Z0-9_\/\-]+/)),s},t.prototype._get_boolean=function(r,i){var o=this.raw_options[r],s=o===void 0?!!i:!!o;return s},t.prototype._get_characters=function(r,i){var o=this.raw_options[r],s=i||"";return typeof o=="string"&&(s=o.replace(/\\r/,"\r").replace(/\\n/,` ->>>>>>>> origin/craft-4:src/web/assets/field/dist/assets/vizy-91fcee7d.js -`).replace(/\\t/," ")),s},t.prototype._get_number=function(r,i){var o=this.raw_options[r];i=parseInt(i,10),isNaN(i)&&(i=0);var s=parseInt(o,10);return isNaN(s)&&(s=i),s},t.prototype._get_selection=function(r,i,o){var s=this._get_selection_list(r,i,o);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+r+`' can only be one of the following values: -`+i+` -You passed in: '`+this.raw_options[r]+"'");return s[0]},t.prototype._get_selection_list=function(r,i,o){if(!i||i.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[i[0]],!this._is_valid_selection(o,i))throw new Error("Invalid Default Value!");var s=this._get_array(r,o);if(!this._is_valid_selection(s,i))throw new Error("Invalid Option Value: The option '"+r+`' can contain only the following values: -`+i+` -<<<<<<<< HEAD:src/web/assets/field/dist/assets/vizy-1d31d33d.js -You passed in: '`+this.raw_options[r]+"'");return s},t.prototype._is_valid_selection=function(r,i){return r.length&&i.length&&!r.some(function(o){return i.indexOf(o)===-1})};function e(r,i){var o={};r=n(r);var s;for(s in r)s!==i&&(o[s]=r[s]);if(i&&r[i])for(s in r[i])o[s]=r[i][s];return o}function n(r){var i={},o;for(o in r){var s=o.replace(/-/g,"_");i[s]=r[o]}return i}return Xc.Options=t,Xc.normalizeOpts=n,Xc.mergeOpts=e,Xc}var PE;function zN(){if(PE)return my;PE=1;var t=Uw().Options,e=["before-newline","after-newline","preserve-newline"];function n(r){t.call(this,r,"js");var i=this.raw_options.brace_style||null;i==="expand-strict"?this.raw_options.brace_style="expand":i==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var o=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var s=0;s0&&(this.__position-=1)},e.prototype.hasNext=function(){return this.__position=0&&n=0&&r=n.length&&this.__input.substring(r-n.length,r).toLowerCase()===n},gy.InputScanner=e,gy}var pp={},vy={},RE;function wse(){if(RE)return vy;RE=1;function t(e){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=e}return t.prototype.restart=function(){this.__position=0},t.prototype.isEmpty=function(){return this.__tokens_length===0},t.prototype.hasNext=function(){return this.__position=0&&e/),erb:o.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:o.starting_with(/{%/).until_after(/%}/),django_value:o.starting_with(/{{/).until_after(/}}/),django_comment:o.starting_with(/{#/).until_after(/#}/),smarty:o.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:o.starting_with(/{\*/).until_after(/\*}/),smarty_literal:o.starting_with(/{literal}/).until_after(/{\/literal}/)}}return n.prototype=new t,n.prototype._create=function(){return new n(this._input,this)},n.prototype._update=function(){this.__set_templated_pattern()},n.prototype.disable=function(r){var i=this._create();return i._disabled[r]=!0,i._update(),i},n.prototype.read_options=function(r){var i=this._create();for(var o in e)i._disabled[o]=r.templating.indexOf(o)===-1;return i._update(),i},n.prototype.exclude=function(r){var i=this._create();return i._excluded[r]=!0,i._update(),i},n.prototype.read=function(){var r="";this._match_pattern?r=this._input.read(this._starting_pattern):r=this._input.read(this._starting_pattern,this.__template_pattern);for(var i=this._read_template();i;)this._match_pattern?i+=this._input.read(this._match_pattern):i+=this._input.readUntil(this.__template_pattern),r+=i,i=this._read_template();return this._until_after&&(r+=this._input.readUntilAfter(this._until_pattern)),r},n.prototype.__set_templated_pattern=function(){var r=[];this._disabled.php||r.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||r.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||r.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(r.push(this.__patterns.django._starting_pattern.source),r.push(this.__patterns.django_value._starting_pattern.source),r.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||r.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&r.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+r.join("|")+")")},n.prototype._read_template=function(){var r="",i=this._input.peek();if(i==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(r=r||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(r=r||this.__patterns.erb.read())}else i==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(r=r||this.__patterns.handlebars_comment.read(),r=r||this.__patterns.handlebars_unescaped.read(),r=r||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(r=r||this.__patterns.django_value.read()),this._excluded.django||(r=r||this.__patterns.django_comment.read(),r=r||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(r=r||this.__patterns.smarty_comment.read(),r=r||this.__patterns.smarty_literal.read(),r=r||this.__patterns.smarty.read()));return r},wy.TemplatablePattern=n,wy}var VE;function mp(){if(VE)return ou;VE=1;var t=qw().InputScanner,e=ng().Tokenizer,n=ng().TOKEN,r=Kw().Directives,i=RN(),o=uv().Pattern,s=BN().TemplatablePattern;function l(I,q){return q.indexOf(I)!==-1}var u={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:n.START,RAW:n.RAW,EOF:n.EOF},f=new r(/\/\*/,/\*\//),d=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,m=/[0-9]/,v=/[^\d\.]/,y=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),_=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";_=_.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),_="\\?\\.(?!\\d) "+_,_=_.replace(/ /g,"|");var C=new RegExp(_),x="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),k=x.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),A=new RegExp("^(?:"+k.join("|")+")$"),N,E=function(I,q){e.call(this,I,q),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var P=new o(this._input),z=new s(this._input).read_options(this._options);this.__patterns={template:z,identifier:z.starting_with(i.identifier).matching(i.identifierMatch),number:P.matching(d),punct:P.matching(C),comment:P.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:P.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:P.matching(//),include:P.starting_with(/#include/).until_after(i.lineBreak),shebang:P.starting_with(/#!/).until_after(i.lineBreak),xml:P.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:z.until(/['\\\n\r\u2028\u2029]/),double_quote:z.until(/["\\\n\r\u2028\u2029]/),template_text:z.until(/[`\\$]/),template_expression:z.until(/[`}\\]/)}};E.prototype=new e,E.prototype._is_comment=function(I){return I.type===u.COMMENT||I.type===u.BLOCK_COMMENT||I.type===u.UNKNOWN},E.prototype._is_opening=function(I){return I.type===u.START_BLOCK||I.type===u.START_EXPR},E.prototype._is_closing=function(I,q){return(I.type===u.END_BLOCK||I.type===u.END_EXPR)&&q&&(I.text==="]"&&q.text==="["||I.text===")"&&q.text==="("||I.text==="}"&&q.text==="{")},E.prototype._reset=function(){N=!1},E.prototype._get_next_token=function(I,q){var P=null;this._readWhitespace();var z=this._input.peek();return z===null?this._create_token(u.EOF,""):(P=P||this._read_non_javascript(z),P=P||this._read_string(z),P=P||this._read_word(I),P=P||this._read_singles(z),P=P||this._read_comment(z),P=P||this._read_regexp(z,I),P=P||this._read_xml(z,I),P=P||this._read_punctuation(),P=P||this._create_token(u.UNKNOWN,this._input.next()),P)},E.prototype._read_word=function(I){var q;if(q=this.__patterns.identifier.read(),q!=="")return q=q.replace(i.allLineBreaks,` -======== -You passed in: '`+this.raw_options[r]+"'");return s},t.prototype._is_valid_selection=function(r,i){return r.length&&i.length&&!r.some(function(o){return i.indexOf(o)===-1})};function e(r,i){var o={};r=n(r);var s;for(s in r)s!==i&&(o[s]=r[s]);if(i&&r[i])for(s in r[i])o[s]=r[i][s];return o}function n(r){var i={},o;for(o in r){var s=o.replace(/-/g,"_");i[s]=r[o]}return i}return Xc.Options=t,Xc.normalizeOpts=n,Xc.mergeOpts=e,Xc}var PE;function BL(){if(PE)return g0;PE=1;var t=Uw().Options,e=["before-newline","after-newline","preserve-newline"];function n(r){t.call(this,r,"js");var i=this.raw_options.brace_style||null;i==="expand-strict"?this.raw_options.brace_style="expand":i==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var o=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var s=0;s0&&(this.__position-=1)},e.prototype.hasNext=function(){return this.__position=0&&n=0&&r=n.length&&this.__input.substring(r-n.length,r).toLowerCase()===n},v0.InputScanner=e,v0}var mp={},y0={},RE;function dse(){if(RE)return y0;RE=1;function t(e){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=e}return t.prototype.restart=function(){this.__position=0},t.prototype.isEmpty=function(){return this.__tokens_length===0},t.prototype.hasNext=function(){return this.__position=0&&e/),erb:o.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:o.starting_with(/{%/).until_after(/%}/),django_value:o.starting_with(/{{/).until_after(/}}/),django_comment:o.starting_with(/{#/).until_after(/#}/),smarty:o.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:o.starting_with(/{\*/).until_after(/\*}/),smarty_literal:o.starting_with(/{literal}/).until_after(/{\/literal}/)}}return n.prototype=new t,n.prototype._create=function(){return new n(this._input,this)},n.prototype._update=function(){this.__set_templated_pattern()},n.prototype.disable=function(r){var i=this._create();return i._disabled[r]=!0,i._update(),i},n.prototype.read_options=function(r){var i=this._create();for(var o in e)i._disabled[o]=r.templating.indexOf(o)===-1;return i._update(),i},n.prototype.exclude=function(r){var i=this._create();return i._excluded[r]=!0,i._update(),i},n.prototype.read=function(){var r="";this._match_pattern?r=this._input.read(this._starting_pattern):r=this._input.read(this._starting_pattern,this.__template_pattern);for(var i=this._read_template();i;)this._match_pattern?i+=this._input.read(this._match_pattern):i+=this._input.readUntil(this.__template_pattern),r+=i,i=this._read_template();return this._until_after&&(r+=this._input.readUntilAfter(this._until_pattern)),r},n.prototype.__set_templated_pattern=function(){var r=[];this._disabled.php||r.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||r.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||r.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(r.push(this.__patterns.django._starting_pattern.source),r.push(this.__patterns.django_value._starting_pattern.source),r.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||r.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&r.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+r.join("|")+")")},n.prototype._read_template=function(){var r="",i=this._input.peek();if(i==="<"){var o=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&o==="?"&&(r=r||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&o==="%"&&(r=r||this.__patterns.erb.read())}else i==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(r=r||this.__patterns.handlebars_comment.read(),r=r||this.__patterns.handlebars_unescaped.read(),r=r||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(r=r||this.__patterns.django_value.read()),this._excluded.django||(r=r||this.__patterns.django_comment.read(),r=r||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(r=r||this.__patterns.smarty_comment.read(),r=r||this.__patterns.smarty_literal.read(),r=r||this.__patterns.smarty.read()));return r},k0.TemplatablePattern=n,k0}var VE;function gp(){if(VE)return ou;VE=1;var t=qw().InputScanner,e=rg().Tokenizer,n=rg().TOKEN,r=Kw().Directives,i=zL(),o=cv().Pattern,s=$L().TemplatablePattern;function l(I,q){return q.indexOf(I)!==-1}var u={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:n.START,RAW:n.RAW,EOF:n.EOF},f=new r(/\/\*/,/\*\//),d=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,m=/[0-9]/,v=/[^\d\.]/,y=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),_=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";_=_.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),_="\\?\\.(?!\\d) "+_,_=_.replace(/ /g,"|");var C=new RegExp(_),x="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),k=x.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),A=new RegExp("^(?:"+k.join("|")+")$"),L,E=function(I,q){e.call(this,I,q),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var P=new o(this._input),z=new s(this._input).read_options(this._options);this.__patterns={template:z,identifier:z.starting_with(i.identifier).matching(i.identifierMatch),number:P.matching(d),punct:P.matching(C),comment:P.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:P.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:P.matching(//),include:P.starting_with(/#include/).until_after(i.lineBreak),shebang:P.starting_with(/#!/).until_after(i.lineBreak),xml:P.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:z.until(/['\\\n\r\u2028\u2029]/),double_quote:z.until(/["\\\n\r\u2028\u2029]/),template_text:z.until(/[`\\$]/),template_expression:z.until(/[`}\\]/)}};E.prototype=new e,E.prototype._is_comment=function(I){return I.type===u.COMMENT||I.type===u.BLOCK_COMMENT||I.type===u.UNKNOWN},E.prototype._is_opening=function(I){return I.type===u.START_BLOCK||I.type===u.START_EXPR},E.prototype._is_closing=function(I,q){return(I.type===u.END_BLOCK||I.type===u.END_EXPR)&&q&&(I.text==="]"&&q.text==="["||I.text===")"&&q.text==="("||I.text==="}"&&q.text==="{")},E.prototype._reset=function(){L=!1},E.prototype._get_next_token=function(I,q){var P=null;this._readWhitespace();var z=this._input.peek();return z===null?this._create_token(u.EOF,""):(P=P||this._read_non_javascript(z),P=P||this._read_string(z),P=P||this._read_word(I),P=P||this._read_singles(z),P=P||this._read_comment(z),P=P||this._read_regexp(z,I),P=P||this._read_xml(z,I),P=P||this._read_punctuation(),P=P||this._create_token(u.UNKNOWN,this._input.next()),P)},E.prototype._read_word=function(I){var q;if(q=this.__patterns.identifier.read(),q!=="")return q=q.replace(i.allLineBreaks,` ->>>>>>>> origin/craft-4:src/web/assets/field/dist/assets/vizy-91fcee7d.js -`),!(I.type===u.DOT||I.type===u.RESERVED&&(I.text==="set"||I.text==="get"))&&A.test(q)?(q==="in"||q==="of")&&(I.type===u.WORD||I.type===u.STRING)?this._create_token(u.OPERATOR,q):this._create_token(u.RESERVED,q):this._create_token(u.WORD,q);if(q=this.__patterns.number.read(),q!=="")return this._create_token(u.WORD,q)},E.prototype._read_singles=function(I){var q=null;return I==="("||I==="["?q=this._create_token(u.START_EXPR,I):I===")"||I==="]"?q=this._create_token(u.END_EXPR,I):I==="{"?q=this._create_token(u.START_BLOCK,I):I==="}"?q=this._create_token(u.END_BLOCK,I):I===";"?q=this._create_token(u.SEMICOLON,I):I==="."&&v.test(this._input.peek(1))?q=this._create_token(u.DOT,I):I===","&&(q=this._create_token(u.COMMA,I)),q&&this._input.next(),q},E.prototype._read_punctuation=function(){var I=this.__patterns.punct.read();if(I!=="")return I==="="?this._create_token(u.EQUALS,I):I==="?."?this._create_token(u.DOT,I):this._create_token(u.OPERATOR,I)},E.prototype._read_non_javascript=function(I){var q="";if(I==="#"){if(this._is_first_token()&&(q=this.__patterns.shebang.read(),q))return this._create_token(u.UNKNOWN,q.trim()+` -`);if(q=this.__patterns.include.read(),q)return this._create_token(u.UNKNOWN,q.trim()+` -`);I=this._input.next();var P="#";if(this._input.hasNext()&&this._input.testChar(m)){do I=this._input.next(),P+=I;while(this._input.hasNext()&&I!=="#"&&I!=="=");return I==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(P+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(P+="{}",this._input.next(),this._input.next())),this._create_token(u.WORD,P)}this._input.back()}else if(I==="<"&&this._is_first_token()){if(q=this.__patterns.html_comment_start.read(),q){for(;this._input.hasNext()&&!this._input.testChar(i.newline);)q+=this._input.next();return N=!0,this._create_token(u.COMMENT,q)}}else if(N&&I==="-"&&(q=this.__patterns.html_comment_end.read(),q))return N=!1,this._create_token(u.COMMENT,q);return null},E.prototype._read_comment=function(I){var q=null;if(I==="/"){var P="";if(this._input.peek(1)==="*"){P=this.__patterns.block_comment.read();var z=f.get_directives(P);z&&z.ignore==="start"&&(P+=f.readIgnored(this._input)),P=P.replace(i.allLineBreaks,` -`),q=this._create_token(u.BLOCK_COMMENT,P),q.directives=z}else this._input.peek(1)==="/"&&(P=this.__patterns.comment.read(),q=this._create_token(u.COMMENT,P))}return q},E.prototype._read_string=function(I){if(I==="`"||I==="'"||I==='"'){var q=this._input.next();return this.has_char_escapes=!1,I==="`"?q+=this._read_string_recursive("`",!0,"${"):q+=this._read_string_recursive(I),this.has_char_escapes&&this._options.unescape_strings&&(q=H(q)),this._input.peek()===I&&(q+=this._input.next()),q=q.replace(i.allLineBreaks,` -`),this._create_token(u.STRING,q)}return null},E.prototype._allow_regexp_or_xml=function(I){return I.type===u.RESERVED&&l(I.text,["return","case","throw","else","do","typeof","yield"])||I.type===u.END_EXPR&&I.text===")"&&I.opened.previous.type===u.RESERVED&&l(I.opened.previous.text,["if","while","for"])||l(I.type,[u.COMMENT,u.START_EXPR,u.START_BLOCK,u.START,u.END_BLOCK,u.OPERATOR,u.EQUALS,u.EOF,u.SEMICOLON,u.COMMA])},E.prototype._read_regexp=function(I,q){if(I==="/"&&this._allow_regexp_or_xml(q)){for(var P=this._input.next(),z=!1,w=!1;this._input.hasNext()&&(z||w||this._input.peek()!==I)&&!this._input.testChar(i.newline);)P+=this._input.peek(),z?z=!1:(z=this._input.peek()==="\\",this._input.peek()==="["?w=!0:this._input.peek()==="]"&&(w=!1)),this._input.next();return this._input.peek()===I&&(P+=this._input.next(),P+=this._input.read(i.identifier)),this._create_token(u.STRING,P)}return null},E.prototype._read_xml=function(I,q){if(this._options.e4x&&I==="<"&&this._allow_regexp_or_xml(q)){var P="",z=this.__patterns.xml.read_match();if(z){for(var w=z[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),R=w.indexOf("{")===0,U=0;z;){var K=!!z[1],oe=z[2],D=!!z[z.length-1]||oe.slice(0,8)==="![CDATA[";if(!D&&(oe===w||R&&oe.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(K?--U:++U),P+=z[0],U<=0)break;z=this.__patterns.xml.read_match()}return z||(P+=this._input.match(/[\s\S]*/g)[0]),P=P.replace(i.allLineBreaks,` -`),this._create_token(u.STRING,P)}}return null};function H(I){for(var q="",P=0,z=new t(I),w=null;z.hasNext();)if(w=z.match(/([\s]|[^\\]|\\\\)+/g),w&&(q+=w[0]),z.peek()==="\\"){if(z.next(),z.peek()==="x")w=z.match(/x([0-9A-Fa-f]{2})/g);else if(z.peek()==="u")w=z.match(/u([0-9A-Fa-f]{4})/g);else{q+="\\",z.hasNext()&&(q+=z.next());continue}if(!w||(P=parseInt(w[1],16),P>126&&P<=255&&w[0].indexOf("x")===0))return I;if(P>=0&&P<32){q+="\\"+w[0];continue}else P===34||P===39||P===92?q+="\\"+String.fromCharCode(P):q+=String.fromCharCode(P)}return q}return E.prototype._read_string_recursive=function(I,q,P){var z,w;I==="'"?w=this.__patterns.single_quote:I==='"'?w=this.__patterns.double_quote:I==="`"?w=this.__patterns.template_text:I==="}"&&(w=this.__patterns.template_expression);for(var R=w.read(),U="";this._input.hasNext();){if(U=this._input.next(),U===I||!q&&i.newline.test(U)){this._input.back();break}else U==="\\"&&this._input.hasNext()?(z=this._input.peek(),z==="x"||z==="u"?this.has_char_escapes=!0:z==="\r"&&this._input.peek(1)===` -<<<<<<<< HEAD:src/web/assets/field/dist/assets/vizy-1d31d33d.js -`&&this._input.next(),U+=this._input.next()):P&&(P==="${"&&U==="$"&&this._input.peek()==="{"&&(U+=this._input.next()),P===U&&(I==="`"?U+=this._read_string_recursive("}",q,"`"):U+=this._read_string_recursive("`",q,"${"),this._input.hasNext()&&(U+=this._input.next())));U+=w.read(),R+=U}return R},ou.Tokenizer=E,ou.TOKEN=u,ou.positionable_operators=y.slice(),ou.line_starters=x.slice(),ou}var jE;function xse(){if(jE)return fy;jE=1;var t=Ww().Output,e=DN().Token,n=RN(),r=zN().Options,i=mp().Tokenizer,o=mp().line_starters,s=mp().positionable_operators,l=mp().TOKEN;function u(w,R){return R.indexOf(w)!==-1}function f(w){return w.replace(/^\s+/g,"")}function d(w){for(var R={},U=0;UU&&(U=w.line_indent_level));var K={mode:R,parent:w,last_token:w?w.last_token:new e(l.START_BLOCK,""),last_word:w?w.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:U,alignment:0,line_indent_level:w?w.line_indent_level:U,start_line_index:this._output.get_line_number(),ternary_depth:0};return K},P.prototype._reset=function(w){var R=w.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new t(this._options,R),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(k.BlockStatement);var U=new i(w,this._options);return this._tokens=U.tokenize(),w},P.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var w,R=this._reset(this._source_text),U=this._options.eol;this._options.eol==="auto"&&(U=` -`,R&&n.lineBreak.test(R||"")&&(U=R.match(n.lineBreak)[0]));for(var K=this._tokens.next();K;)this.handle_token(K),this._last_last_text=this._flags.last_token.text,this._flags.last_token=K,K=this._tokens.next();return w=this._output.get_code(U),w},P.prototype.handle_token=function(w,R){w.type===l.START_EXPR?this.handle_start_expr(w):w.type===l.END_EXPR?this.handle_end_expr(w):w.type===l.START_BLOCK?this.handle_start_block(w):w.type===l.END_BLOCK?this.handle_end_block(w):w.type===l.WORD?this.handle_word(w):w.type===l.RESERVED?this.handle_word(w):w.type===l.SEMICOLON?this.handle_semicolon(w):w.type===l.STRING?this.handle_string(w):w.type===l.EQUALS?this.handle_equals(w):w.type===l.OPERATOR?this.handle_operator(w):w.type===l.COMMA?this.handle_comma(w):w.type===l.BLOCK_COMMENT?this.handle_block_comment(w,R):w.type===l.COMMENT?this.handle_comment(w,R):w.type===l.DOT?this.handle_dot(w):w.type===l.EOF?this.handle_eof(w):w.type===l.UNKNOWN?this.handle_unknown(w,R):this.handle_unknown(w,R)},P.prototype.handle_whitespace_and_comments=function(w,R){var U=w.newlines,K=this._options.keep_array_indentation&&E(this._flags.mode);if(w.comments_before)for(var oe=w.comments_before.next();oe;)this.handle_whitespace_and_comments(oe,R),this.handle_token(oe,R),oe=w.comments_before.next();if(K)for(var D=0;D0,R);else if(this._options.max_preserve_newlines&&U>this._options.max_preserve_newlines&&(U=this._options.max_preserve_newlines),this._options.preserve_newlines&&U>1){this.print_newline(!1,R);for(var ae=1;ae0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},P.prototype.set_mode=function(w){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,w),this._flags=this.create_flags(this._previous_flags,w),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},P.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===k.Statement&&A(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},P.prototype.start_of_object_property=function(){return this._flags.parent.mode===k.ObjectLiteral&&this._flags.mode===k.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||v(this._flags.last_token,["get","set"]))},P.prototype.start_of_statement=function(w){var R=!1;return R=R||v(this._flags.last_token,["var","let","const"])&&w.type===l.WORD,R=R||m(this._flags.last_token,"do"),R=R||!(this._flags.parent.mode===k.ObjectLiteral&&this._flags.mode===k.Statement)&&v(this._flags.last_token,z)&&!w.newlines,R=R||m(this._flags.last_token,"else")&&!(m(w,"if")&&!w.comments_before),R=R||this._flags.last_token.type===l.END_EXPR&&(this._previous_flags.mode===k.ForInitializer||this._previous_flags.mode===k.Conditional),R=R||this._flags.last_token.type===l.WORD&&this._flags.mode===k.BlockStatement&&!this._flags.in_case&&!(w.text==="--"||w.text==="++")&&this._last_last_text!=="function"&&w.type!==l.WORD&&w.type!==l.RESERVED,R=R||this._flags.mode===k.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||v(this._flags.last_token,["get","set"])),R?(this.set_mode(k.Statement),this.indent(),this.handle_whitespace_and_comments(w,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(w,v(w,["do","for","if","while"])),!0):!1},P.prototype.handle_start_expr=function(w){this.start_of_statement(w)||this.handle_whitespace_and_comments(w);var R=k.Expression;if(w.text==="["){if(this._flags.last_token.type===l.WORD||this._flags.last_token.text===")"){v(this._flags.last_token,o)&&(this._output.space_before_token=!0),this.print_token(w),this.set_mode(R),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}R=k.ArrayLiteral,E(this._flags.mode)&&(this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline()),u(this._flags.last_token.type,[l.START_EXPR,l.END_EXPR,l.WORD,l.OPERATOR,l.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===l.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,R=k.ForInitializer):u(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,R=k.Conditional):u(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&w.whitespace_before===""?this._output.space_before_token=!1:(u(this._flags.last_token.text,o)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(w);else if(this._flags.last_token.type===l.WORD){this._output.space_before_token=!1;var U=this._tokens.peek(-3);if(this._options.space_after_named_function&&U){var K=this._tokens.peek(-4);v(U,["async","function"])||U.text==="*"&&v(K,["async","function"])?this._output.space_before_token=!0:this._flags.mode===k.ObjectLiteral?(U.text==="{"||U.text===","||U.text==="*"&&(K.text==="{"||K.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(w);(this._flags.last_token.type===l.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(u(this._last_last_text,["function","yield"])||this._flags.mode===k.ObjectLiteral&&u(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===l.START_BLOCK?this.print_newline():(this._flags.last_token.type===l.END_EXPR||this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===l.COMMA)&&this.allow_wrap_or_preserved_newline(w,w.newlines),this.print_token(w),this.set_mode(R),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},P.prototype.handle_end_expr=function(w){for(;this._flags.mode===k.Statement;)this.restore_mode();this.handle_whitespace_and_comments(w),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(w,w.text==="]"&&E(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===l.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(w),this.restore_mode(),A(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===k.Conditional&&(this._previous_flags.mode=k.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},P.prototype.handle_start_block=function(w){this.handle_whitespace_and_comments(w);var R=this._tokens.peek(),U=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===l.END_EXPR?(this.set_mode(k.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(k.BlockStatement):U&&(u(U.text,[":",","])&&u(R.type,[l.STRING,l.WORD,l.RESERVED])||u(R.text,["get","set","..."])&&u(U.type,[l.WORD,l.RESERVED]))?u(this._last_last_text,["class","interface"])&&!u(U.text,[":",","])?this.set_mode(k.BlockStatement):this.set_mode(k.ObjectLiteral):this._flags.last_token.type===l.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(k.BlockStatement):u(this._flags.last_token.type,[l.EQUALS,l.START_EXPR,l.COMMA,l.OPERATOR])||v(this._flags.last_token,["return","throw","import","default"])?this.set_mode(k.ObjectLiteral):this.set_mode(k.BlockStatement),this._flags.last_token&&v(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var K=!R.comments_before&&R.text==="}",oe=K&&this._flags.last_word==="function"&&this._flags.last_token.type===l.END_EXPR;if(this._options.brace_preserve_inline){var D=0,ae=null;this._flags.inline_frame=!0;do if(D+=1,ae=this._tokens.peek(D-1),ae.newlines){this._flags.inline_frame=!1;break}while(ae.type!==l.EOF&&!(ae.type===l.END_BLOCK&&ae.opened===w))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&w.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==l.OPERATOR&&(oe||this._flags.last_token.type===l.EQUALS||v(this._flags.last_token,y)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(E(this._previous_flags.mode)&&(this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.COMMA)&&((this._flags.last_token.type===l.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(w),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==l.OPERATOR&&this._flags.last_token.type!==l.START_EXPR&&(this._flags.last_token.type===l.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(w),this.indent(),!K&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},P.prototype.handle_end_block=function(w){for(this.handle_whitespace_and_comments(w);this._flags.mode===k.Statement;)this.restore_mode();var R=this._flags.last_token.type===l.START_BLOCK;this._flags.inline_frame&&!R?this._output.space_before_token=!0:this._options.brace_style==="expand"?R||this.print_newline():R||(E(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(w)},P.prototype.handle_word=function(w){if(w.type===l.RESERVED){if(u(w.text,["set","get"])&&this._flags.mode!==k.ObjectLiteral)w.type=l.WORD;else if(w.text==="import"&&u(this._tokens.peek().text,["(","."]))w.type=l.WORD;else if(u(w.text,["as","from"])&&!this._flags.import_block)w.type=l.WORD;else if(this._flags.mode===k.ObjectLiteral){var R=this._tokens.peek();R.text===":"&&(w.type=l.WORD)}}if(this.start_of_statement(w)?v(this._flags.last_token,["var","let","const"])&&w.type===l.WORD&&(this._flags.declaration_statement=!0):w.newlines&&!H(this._flags.mode)&&(this._flags.last_token.type!==l.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==l.EQUALS&&(this._options.preserve_newlines||!v(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(w),this.print_newline()):this.handle_whitespace_and_comments(w),this._flags.do_block&&!this._flags.do_while)if(m(w,"while")){this._output.space_before_token=!0,this.print_token(w),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&m(w,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===k.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&v(w,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(w),this._flags.in_case=!0;return}if((this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(w)),m(w,"function")){(u(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(u(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===l.OPERATOR))&&!this._output.just_added_blankline()&&!w.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD?v(this._flags.last_token,["get","set","new","export"])||v(this._flags.last_token,z)?this._output.space_before_token=!0:m(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===l.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(H(this._flags.mode)||E(this._flags.mode))||this.print_newline(),this.print_token(w),this._flags.last_word=w.text;return}var U="NONE";if(this._flags.last_token.type===l.END_BLOCK?this._previous_flags.inline_frame?U="SPACE":v(w,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&w.newlines?U="NEWLINE":(U="SPACE",this._output.space_before_token=!0):U="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&this._flags.mode===k.BlockStatement?U="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&H(this._flags.mode)?U="SPACE":this._flags.last_token.type===l.STRING?U="NEWLINE":this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||this._flags.last_token.text==="*"&&(u(this._last_last_text,["function","yield"])||this._flags.mode===k.ObjectLiteral&&u(this._last_last_text,["{",","]))?U="SPACE":this._flags.last_token.type===l.START_BLOCK?this._flags.inline_frame?U="SPACE":U="NEWLINE":this._flags.last_token.type===l.END_EXPR&&(this._output.space_before_token=!0,U="NEWLINE"),v(w,o)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?U="SPACE":U="NEWLINE"),v(w,["else","catch","finally"]))if((!(this._flags.last_token.type===l.END_BLOCK&&this._previous_flags.mode===k.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&w.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var K=this._output.current_line;K.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else U==="NEWLINE"?v(this._flags.last_token,y)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&v(w,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==l.END_EXPR?(this._flags.last_token.type!==l.START_EXPR||!v(w,["var","let","const"]))&&this._flags.last_token.text!==":"&&(m(w,"if")&&m(w.previous,"else")?this._output.space_before_token=!0:this.print_newline()):v(w,o)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&E(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():U==="SPACE"&&(this._output.space_before_token=!0);w.previous&&(w.previous.type===l.WORD||w.previous.type===l.RESERVED)&&(this._output.space_before_token=!0),this.print_token(w),this._flags.last_word=w.text,w.type===l.RESERVED&&(w.text==="do"?this._flags.do_block=!0:w.text==="if"?this._flags.if_block=!0:w.text==="import"?this._flags.import_block=!0:this._flags.import_block&&m(w,"from")&&(this._flags.import_block=!1))},P.prototype.handle_semicolon=function(w){this.start_of_statement(w)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(w);for(var R=this._tokens.peek();this._flags.mode===k.Statement&&!(this._flags.if_block&&m(R,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(w)},P.prototype.handle_string=function(w){w.text.startsWith("`")&&w.newlines===0&&w.whitespace_before===""&&(w.previous.text===")"||this._flags.last_token.type===l.WORD)||(this.start_of_statement(w)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(w),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(w):w.text.startsWith("`")&&this._flags.last_token.type===l.END_EXPR&&(w.previous.text==="]"||w.previous.text===")")&&w.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(w)},P.prototype.handle_equals=function(w){this.start_of_statement(w)||this.handle_whitespace_and_comments(w),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(w),this._output.space_before_token=!0},P.prototype.handle_comma=function(w){this.handle_whitespace_and_comments(w,!0),this.print_token(w),this._output.space_before_token=!0,this._flags.declaration_statement?(H(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(w)):this._flags.mode===k.ObjectLiteral||this._flags.mode===k.Statement&&this._flags.parent.mode===k.ObjectLiteral?(this._flags.mode===k.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(w)},P.prototype.handle_operator=function(w){var R=w.text==="*"&&(v(this._flags.last_token,["function","yield"])||u(this._flags.last_token.type,[l.START_BLOCK,l.COMMA,l.END_BLOCK,l.SEMICOLON])),U=u(w.text,["-","+"])&&(u(this._flags.last_token.type,[l.START_BLOCK,l.START_EXPR,l.EQUALS,l.OPERATOR])||u(this._flags.last_token.text,o)||this._flags.last_token.text===",");if(!this.start_of_statement(w)){var K=!R;this.handle_whitespace_and_comments(w,K)}if(w.text==="*"&&this._flags.last_token.type===l.DOT){this.print_token(w);return}if(w.text==="::"){this.print_token(w);return}if(this._flags.last_token.type===l.OPERATOR&&u(this._options.operator_position,x)&&this.allow_wrap_or_preserved_newline(w),w.text===":"&&this._flags.in_case){this.print_token(w),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==l.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var oe=!0,D=!0,ae=!1;if(w.text===":"?this._flags.ternary_depth===0?oe=!1:(this._flags.ternary_depth-=1,ae=!0):w.text==="?"&&(this._flags.ternary_depth+=1),!U&&!R&&this._options.preserve_newlines&&u(w.text,s)){var ce=w.text===":",ve=ce&&ae,ze=ce&&!ae;switch(this._options.operator_position){case C.before_newline:this._output.space_before_token=!ze,this.print_token(w),(!ce||ve)&&this.allow_wrap_or_preserved_newline(w),this._output.space_before_token=!0;return;case C.after_newline:this._output.space_before_token=!0,!ce||ve?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(w):this._output.space_before_token=!1,this.print_token(w),this._output.space_before_token=!0;return;case C.preserve_newline:ze||this.allow_wrap_or_preserved_newline(w),oe=!(this._output.just_added_newline()||ze),this._output.space_before_token=oe,this.print_token(w),this._output.space_before_token=!0;return}}if(R){this.allow_wrap_or_preserved_newline(w),oe=!1;var qe=this._tokens.peek();D=qe&&u(qe.type,[l.WORD,l.RESERVED])}else if(w.text==="...")this.allow_wrap_or_preserved_newline(w),oe=this._flags.last_token.type===l.START_BLOCK,D=!1;else if(u(w.text,["--","++","!","~"])||U){if((this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR)&&this.allow_wrap_or_preserved_newline(w),oe=!1,D=!1,w.newlines&&(w.text==="--"||w.text==="++"||w.text==="~")){var vt=v(this._flags.last_token,y)&&w.newlines;vt&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(vt,!0)}this._flags.last_token.text===";"&&H(this._flags.mode)&&(oe=!0),this._flags.last_token.type===l.RESERVED?oe=!0:this._flags.last_token.type===l.END_EXPR?oe=!(this._flags.last_token.text==="]"&&(w.text==="--"||w.text==="++")):this._flags.last_token.type===l.OPERATOR&&(oe=u(w.text,["--","-","++","+"])&&u(this._flags.last_token.text,["--","-","++","+"]),u(w.text,["+","-"])&&u(this._flags.last_token.text,["--","++"])&&(D=!0)),(this._flags.mode===k.BlockStatement&&!this._flags.inline_frame||this._flags.mode===k.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||oe,this.print_token(w),this._output.space_before_token=D},P.prototype.handle_block_comment=function(w,R){if(this._output.raw){this._output.add_raw_token(w),w.directives&&w.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(w.directives){this.print_newline(!1,R),this.print_token(w),w.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!n.newline.test(w.text)&&!w.newlines){this._output.space_before_token=!0,this.print_token(w),this._output.space_before_token=!0;return}else this.print_block_commment(w,R)},P.prototype.print_block_commment=function(w,R){var U=N(w.text),K,oe=!1,D=!1,ae=w.whitespace_before,ce=ae.length;if(this.print_newline(!1,R),this.print_token_line_indentation(w),this._output.add_token(U[0]),this.print_newline(!1,R),U.length>1){for(U=U.slice(1),oe=I(U,"*"),D=q(U,ae),oe&&(this._flags.alignment=1),K=0;K0&&this._indentLevel--},m.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var v=this._source_text,y=this._options.eol;y==="auto"&&(y=` -`,v&&o.test(v||"")&&(y=v.match(o)[0])),v=v.replace(s,` -`);var _=v.match(/^[\t ]*/)[0];this._output=new e(this._options,_),this._input=new n(v),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var C=0,x=!1,k=!1,A=!1,N=!1,E=!1,H=!1,I=this._ch,q=!1,P,z,w;P=this._input.read(u),z=P!=="",w=I,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),I=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var R=this._input.read(f),U=i.get_directives(R);U&&U.ignore==="start"&&(R+=i.readIgnored(this._input)),this.print_string(R),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(d)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(z),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var K=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);K.match(/[ :]$/)&&(K=this.eatString(": ").replace(/\s$/,""),this.print_string(K),this._output.space_before_token=!0),K=K.replace(/\s$/,""),K==="extend"?N=!0:K==="import"&&(E=!0),K in this.NESTED_AT_RULE?(this._nestedLevel+=1,K in this.CONDITIONAL_GROUP_RULE&&(A=!0)):!x&&C===0&&K.indexOf(":")!==-1&&(k=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(z),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")k&&(k=!1,this.outdent()),A?(A=!1,x=this._indentLevel>=this._nestedLevel):x=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&x&&this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(w==="("?this._output.space_before_token=!1:w!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),w==="{"&&this._output.trim(!0),E=!1,N=!1,k&&(this.outdent(),k=!1),this.print_string(this._ch),x=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&this._input.peek()!=="}"&&this._output.add_new_line(!0),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var oe=0;oe"||this._ch==="+"||this._ch==="~")&&!k&&C===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&l.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(z),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),l.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var ce=w==='"'||w==="'";this.preserveSingleSpace(ce||z),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===` -`&&q&&this._output.add_new_line()}var ve=this._output.get_code(y);return ve},ky.Beautifier=m,ky}var KE;function Ese(){if(KE)return Df;KE=1;var t=Tse().Beautifier,e=$N().Options;function n(r,i){var o=new t(r,i);return o.beautify()}return Cse.exports=n,Df.defaultOptions=function(){return new e},Df}var Rf={},Ase={get exports(){return Rf},set exports(t){Rf=t}},Sy={},Cy={},GE;function HN(){if(GE)return Cy;GE=1;var t=Uw().Options;function e(n){t.call(this,n,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}return e.prototype=new t,Cy.Options=e,Cy}var gp={},YE;function JE(){if(YE)return gp;YE=1;var t=ng().Tokenizer,e=ng().TOKEN,n=Kw().Directives,r=BN().TemplatablePattern,i=uv().Pattern,o={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:e.START,RAW:e.RAW,EOF:e.EOF},s=new n(/<\!--/,/-->/),l=function(u,f){t.call(this,u,f),this._current_tag_name="";var d=new r(this._input).read_options(this._options),m=new i(this._input);if(this.__patterns={word:d.until(/[\n\r\t <]/),single_quote:d.until_after(/'/),double_quote:d.until_after(/"/),attribute:d.until(/[\n\r\t =>]|\/>/),element_name:d.until(/[\n\r\t >\/]/),handlebars_comment:m.starting_with(/{{!--/).until_after(/--}}/),handlebars:m.starting_with(/{{/).until_after(/}}/),handlebars_open:m.until(/[\n\r\t }]/),handlebars_raw_close:m.until(/}}/),comment:m.starting_with(//),cdata:m.starting_with(//),conditional_comment:m.starting_with(//),processing:m.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var v=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=m.matching(v).until_after(v)}};return l.prototype=new t,l.prototype._is_comment=function(u){return!1},l.prototype._is_opening=function(u){return u.type===o.TAG_OPEN},l.prototype._is_closing=function(u,f){return u.type===o.TAG_CLOSE&&f&&((u.text===">"||u.text==="/>")&&f.text[0]==="<"||u.text==="}}"&&f.text[0]==="{"&&f.text[1]==="{")},l.prototype._reset=function(){this._current_tag_name=""},l.prototype._get_next_token=function(u,f){var d=null;this._readWhitespace();var m=this._input.peek();return m===null?this._create_token(o.EOF,""):(d=d||this._read_open_handlebars(m,f),d=d||this._read_attribute(m,u,f),d=d||this._read_close(m,f),d=d||this._read_raw_content(m,u,f),d=d||this._read_content_word(m),d=d||this._read_comment_or_cdata(m),d=d||this._read_processing(m),d=d||this._read_open(m,f),d=d||this._create_token(o.UNKNOWN,this._input.next()),d)},l.prototype._read_comment_or_cdata=function(u){var f=null,d=null,m=null;if(u==="<"){var v=this._input.peek(1);v==="!"&&(d=this.__patterns.comment.read(),d?(m=s.get_directives(d),m&&m.ignore==="start"&&(d+=s.readIgnored(this._input))):d=this.__patterns.cdata.read()),d&&(f=this._create_token(o.COMMENT,d),f.directives=m)}return f},l.prototype._read_processing=function(u){var f=null,d=null,m=null;if(u==="<"){var v=this._input.peek(1);(v==="!"||v==="?")&&(d=this.__patterns.conditional_comment.read(),d=d||this.__patterns.processing.read()),d&&(f=this._create_token(o.COMMENT,d),f.directives=m)}return f},l.prototype._read_open=function(u,f){var d=null,m=null;return f||u==="<"&&(d=this._input.next(),this._input.peek()==="/"&&(d+=this._input.next()),d+=this.__patterns.element_name.read(),m=this._create_token(o.TAG_OPEN,d)),m},l.prototype._read_open_handlebars=function(u,f){var d=null,m=null;return f||this._options.indent_handlebars&&u==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(d=this.__patterns.handlebars_comment.read(),d=d||this.__patterns.handlebars.read(),m=this._create_token(o.COMMENT,d)):(d=this.__patterns.handlebars_open.read(),m=this._create_token(o.TAG_OPEN,d))),m},l.prototype._read_close=function(u,f){var d=null,m=null;return f&&(f.text[0]==="<"&&(u===">"||u==="/"&&this._input.peek(1)===">")?(d=this._input.next(),u==="/"&&(d+=this._input.next()),m=this._create_token(o.TAG_CLOSE,d)):f.text[0]==="{"&&u==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),m=this._create_token(o.TAG_CLOSE,"}}"))),m},l.prototype._read_attribute=function(u,f,d){var m=null,v="";if(d&&d.text[0]==="<")if(u==="=")m=this._create_token(o.EQUALS,this._input.next());else if(u==='"'||u==="'"){var y=this._input.next();u==='"'?y+=this.__patterns.double_quote.read():y+=this.__patterns.single_quote.read(),m=this._create_token(o.VALUE,y)}else v=this.__patterns.attribute.read(),v&&(f.type===o.EQUALS?m=this._create_token(o.VALUE,v):m=this._create_token(o.ATTRIBUTE,v));return m},l.prototype._is_content_unformatted=function(u){return this._options.void_elements.indexOf(u)===-1&&(this._options.content_unformatted.indexOf(u)!==-1||this._options.unformatted.indexOf(u)!==-1)},l.prototype._read_raw_content=function(u,f,d){var m="";if(d&&d.text[0]==="{")m=this.__patterns.handlebars_raw_close.read();else if(f.type===o.TAG_CLOSE&&f.opened.text[0]==="<"&&f.text[0]!=="/"){var v=f.opened.text.substr(1).toLowerCase();if(v==="script"||v==="style"){var y=this._read_comment_or_cdata(u);if(y)return y.type=o.TEXT,y;m=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(v)&&(m=this._input.readUntil(new RegExp("","ig")))}return m?this._create_token(o.TEXT,m):null},l.prototype._read_content_word=function(u){var f="";if(this._options.unformatted_content_delimiter&&u===this._options.unformatted_content_delimiter[0]&&(f=this.__patterns.unformatted_content_delimiter.read()),f||(f=this.__patterns.word.read()),f)return this._create_token(o.TEXT,f)},gp.Tokenizer=l,gp.TOKEN=o,gp}var XE;function Ose(){if(XE)return Sy;XE=1;var t=HN().Options,e=Ww().Output,n=JE().Tokenizer,r=JE().TOKEN,i=/\r\n|[\r\n]/,o=/\r\n|[\r\n]/g,s=function(x,k){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=x.max_preserve_newlines,this.preserve_newlines=x.preserve_newlines,this._output=new e(x,k)};s.prototype.current_line_has_match=function(x){return this._output.current_line.has_match(x)},s.prototype.set_space_before_token=function(x,k){this._output.space_before_token=x,this._output.non_breaking_space=k},s.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},s.prototype.add_raw_token=function(x){this._output.add_raw_token(x)},s.prototype.print_preserved_newlines=function(x){var k=0;x.type!==r.TEXT&&x.previous.type!==r.TEXT&&(k=x.newlines?1:0),this.preserve_newlines&&(k=x.newlines0);return k!==0},s.prototype.traverse_whitespace=function(x){return x.whitespace_before||x.newlines?(this.print_preserved_newlines(x)||(this._output.space_before_token=!0),!0):!1},s.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},s.prototype.print_newline=function(x){this._output.add_new_line(x)},s.prototype.print_token=function(x){x.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(x.text))},s.prototype.indent=function(){this.indent_level++},s.prototype.get_full_indent=function(x){return x=this.indent_level+(x||0),x<1?"":this._output.get_indent_string(x)};var l=function(x){for(var k=null,A=x.next;A.type!==r.EOF&&x.closed!==A;){if(A.type===r.ATTRIBUTE&&A.text==="type"){A.next&&A.next.type===r.EQUALS&&A.next.next&&A.next.next.type===r.VALUE&&(k=A.next.next.text);break}A=A.next}return k},u=function(x,k){var A=null,N=null;return k.closed?(x==="script"?A="text/javascript":x==="style"&&(A="text/css"),A=l(k)||A,A.search("text/css")>-1?N="css":A.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?N="javascript":A.search(/(text|application|dojo)\/(x-)?(html)/)>-1?N="html":A.search(/test\/null/)>-1&&(N="null"),N):null};function f(x,k){return k.indexOf(x)!==-1}function d(x,k,A){this.parent=x||null,this.tag=k?k.tag_name:"",this.indent_level=A||0,this.parser_token=k||null}function m(x){this._printer=x,this._current_frame=null}m.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},m.prototype.record_tag=function(x){var k=new d(this._current_frame,x,this._printer.indent_level);this._current_frame=k},m.prototype._try_pop_frame=function(x){var k=null;return x&&(k=x.parser_token,this._printer.indent_level=x.indent_level,this._current_frame=x.parent),k},m.prototype._get_frame=function(x,k){for(var A=this._current_frame;A&&x.indexOf(A.tag)===-1;){if(k&&k.indexOf(A.tag)!==-1){A=null;break}A=A.parent}return A},m.prototype.try_pop=function(x,k){var A=this._get_frame([x],k);return this._try_pop_frame(A)},m.prototype.indent_to_tag=function(x){var k=this._get_frame(x);k&&(this._printer.indent_level=k.indent_level)};function v(x,k,A,N){this._source_text=x||"",k=k||{},this._js_beautify=A,this._css_beautify=N,this._tag_stack=null;var E=new t(k,"html");this._options=E,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,5)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,8)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}v.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var x=this._source_text,k=this._options.eol;this._options.eol==="auto"&&(k=` -======== -`&&this._input.next(),U+=this._input.next()):P&&(P==="${"&&U==="$"&&this._input.peek()==="{"&&(U+=this._input.next()),P===U&&(I==="`"?U+=this._read_string_recursive("}",q,"`"):U+=this._read_string_recursive("`",q,"${"),this._input.hasNext()&&(U+=this._input.next())));U+=w.read(),R+=U}return R},ou.Tokenizer=E,ou.TOKEN=u,ou.positionable_operators=y.slice(),ou.line_starters=x.slice(),ou}var jE;function pse(){if(jE)return d0;jE=1;var t=Ww().Output,e=RL().Token,n=zL(),r=BL().Options,i=gp().Tokenizer,o=gp().line_starters,s=gp().positionable_operators,l=gp().TOKEN;function u(w,R){return R.indexOf(w)!==-1}function f(w){return w.replace(/^\s+/g,"")}function d(w){for(var R={},U=0;UU&&(U=w.line_indent_level));var K={mode:R,parent:w,last_token:w?w.last_token:new e(l.START_BLOCK,""),last_word:w?w.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:U,alignment:0,line_indent_level:w?w.line_indent_level:U,start_line_index:this._output.get_line_number(),ternary_depth:0};return K},P.prototype._reset=function(w){var R=w.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new t(this._options,R),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(k.BlockStatement);var U=new i(w,this._options);return this._tokens=U.tokenize(),w},P.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var w,R=this._reset(this._source_text),U=this._options.eol;this._options.eol==="auto"&&(U=` -`,R&&n.lineBreak.test(R||"")&&(U=R.match(n.lineBreak)[0]));for(var K=this._tokens.next();K;)this.handle_token(K),this._last_last_text=this._flags.last_token.text,this._flags.last_token=K,K=this._tokens.next();return w=this._output.get_code(U),w},P.prototype.handle_token=function(w,R){w.type===l.START_EXPR?this.handle_start_expr(w):w.type===l.END_EXPR?this.handle_end_expr(w):w.type===l.START_BLOCK?this.handle_start_block(w):w.type===l.END_BLOCK?this.handle_end_block(w):w.type===l.WORD?this.handle_word(w):w.type===l.RESERVED?this.handle_word(w):w.type===l.SEMICOLON?this.handle_semicolon(w):w.type===l.STRING?this.handle_string(w):w.type===l.EQUALS?this.handle_equals(w):w.type===l.OPERATOR?this.handle_operator(w):w.type===l.COMMA?this.handle_comma(w):w.type===l.BLOCK_COMMENT?this.handle_block_comment(w,R):w.type===l.COMMENT?this.handle_comment(w,R):w.type===l.DOT?this.handle_dot(w):w.type===l.EOF?this.handle_eof(w):w.type===l.UNKNOWN?this.handle_unknown(w,R):this.handle_unknown(w,R)},P.prototype.handle_whitespace_and_comments=function(w,R){var U=w.newlines,K=this._options.keep_array_indentation&&E(this._flags.mode);if(w.comments_before)for(var oe=w.comments_before.next();oe;)this.handle_whitespace_and_comments(oe,R),this.handle_token(oe,R),oe=w.comments_before.next();if(K)for(var D=0;D0,R);else if(this._options.max_preserve_newlines&&U>this._options.max_preserve_newlines&&(U=this._options.max_preserve_newlines),this._options.preserve_newlines&&U>1){this.print_newline(!1,R);for(var ae=1;ae0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},P.prototype.set_mode=function(w){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,w),this._flags=this.create_flags(this._previous_flags,w),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},P.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===k.Statement&&A(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},P.prototype.start_of_object_property=function(){return this._flags.parent.mode===k.ObjectLiteral&&this._flags.mode===k.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||v(this._flags.last_token,["get","set"]))},P.prototype.start_of_statement=function(w){var R=!1;return R=R||v(this._flags.last_token,["var","let","const"])&&w.type===l.WORD,R=R||m(this._flags.last_token,"do"),R=R||!(this._flags.parent.mode===k.ObjectLiteral&&this._flags.mode===k.Statement)&&v(this._flags.last_token,z)&&!w.newlines,R=R||m(this._flags.last_token,"else")&&!(m(w,"if")&&!w.comments_before),R=R||this._flags.last_token.type===l.END_EXPR&&(this._previous_flags.mode===k.ForInitializer||this._previous_flags.mode===k.Conditional),R=R||this._flags.last_token.type===l.WORD&&this._flags.mode===k.BlockStatement&&!this._flags.in_case&&!(w.text==="--"||w.text==="++")&&this._last_last_text!=="function"&&w.type!==l.WORD&&w.type!==l.RESERVED,R=R||this._flags.mode===k.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||v(this._flags.last_token,["get","set"])),R?(this.set_mode(k.Statement),this.indent(),this.handle_whitespace_and_comments(w,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(w,v(w,["do","for","if","while"])),!0):!1},P.prototype.handle_start_expr=function(w){this.start_of_statement(w)||this.handle_whitespace_and_comments(w);var R=k.Expression;if(w.text==="["){if(this._flags.last_token.type===l.WORD||this._flags.last_token.text===")"){v(this._flags.last_token,o)&&(this._output.space_before_token=!0),this.print_token(w),this.set_mode(R),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}R=k.ArrayLiteral,E(this._flags.mode)&&(this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline()),u(this._flags.last_token.type,[l.START_EXPR,l.END_EXPR,l.WORD,l.OPERATOR,l.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===l.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,R=k.ForInitializer):u(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,R=k.Conditional):u(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&w.whitespace_before===""?this._output.space_before_token=!1:(u(this._flags.last_token.text,o)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(w);else if(this._flags.last_token.type===l.WORD){this._output.space_before_token=!1;var U=this._tokens.peek(-3);if(this._options.space_after_named_function&&U){var K=this._tokens.peek(-4);v(U,["async","function"])||U.text==="*"&&v(K,["async","function"])?this._output.space_before_token=!0:this._flags.mode===k.ObjectLiteral?(U.text==="{"||U.text===","||U.text==="*"&&(K.text==="{"||K.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(w);(this._flags.last_token.type===l.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(u(this._last_last_text,["function","yield"])||this._flags.mode===k.ObjectLiteral&&u(this._last_last_text,["{",","])))&&(this._output.space_before_token=this._options.space_after_anon_function)}this._flags.last_token.text===";"||this._flags.last_token.type===l.START_BLOCK?this.print_newline():(this._flags.last_token.type===l.END_EXPR||this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===l.COMMA)&&this.allow_wrap_or_preserved_newline(w,w.newlines),this.print_token(w),this.set_mode(R),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},P.prototype.handle_end_expr=function(w){for(;this._flags.mode===k.Statement;)this.restore_mode();this.handle_whitespace_and_comments(w),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(w,w.text==="]"&&E(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===l.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(w),this.restore_mode(),A(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===k.Conditional&&(this._previous_flags.mode=k.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},P.prototype.handle_start_block=function(w){this.handle_whitespace_and_comments(w);var R=this._tokens.peek(),U=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===l.END_EXPR?(this.set_mode(k.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(k.BlockStatement):U&&(u(U.text,[":",","])&&u(R.type,[l.STRING,l.WORD,l.RESERVED])||u(R.text,["get","set","..."])&&u(U.type,[l.WORD,l.RESERVED]))?u(this._last_last_text,["class","interface"])&&!u(U.text,[":",","])?this.set_mode(k.BlockStatement):this.set_mode(k.ObjectLiteral):this._flags.last_token.type===l.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(k.BlockStatement):u(this._flags.last_token.type,[l.EQUALS,l.START_EXPR,l.COMMA,l.OPERATOR])||v(this._flags.last_token,["return","throw","import","default"])?this.set_mode(k.ObjectLiteral):this.set_mode(k.BlockStatement),this._flags.last_token&&v(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var K=!R.comments_before&&R.text==="}",oe=K&&this._flags.last_word==="function"&&this._flags.last_token.type===l.END_EXPR;if(this._options.brace_preserve_inline){var D=0,ae=null;this._flags.inline_frame=!0;do if(D+=1,ae=this._tokens.peek(D-1),ae.newlines){this._flags.inline_frame=!1;break}while(ae.type!==l.EOF&&!(ae.type===l.END_BLOCK&&ae.opened===w))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&w.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==l.OPERATOR&&(oe||this._flags.last_token.type===l.EQUALS||v(this._flags.last_token,y)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(E(this._previous_flags.mode)&&(this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.COMMA)&&((this._flags.last_token.type===l.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(w),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==l.OPERATOR&&this._flags.last_token.type!==l.START_EXPR&&(this._flags.last_token.type===l.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(w),this.indent(),!K&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},P.prototype.handle_end_block=function(w){for(this.handle_whitespace_and_comments(w);this._flags.mode===k.Statement;)this.restore_mode();var R=this._flags.last_token.type===l.START_BLOCK;this._flags.inline_frame&&!R?this._output.space_before_token=!0:this._options.brace_style==="expand"?R||this.print_newline():R||(E(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(w)},P.prototype.handle_word=function(w){if(w.type===l.RESERVED){if(u(w.text,["set","get"])&&this._flags.mode!==k.ObjectLiteral)w.type=l.WORD;else if(w.text==="import"&&u(this._tokens.peek().text,["(","."]))w.type=l.WORD;else if(u(w.text,["as","from"])&&!this._flags.import_block)w.type=l.WORD;else if(this._flags.mode===k.ObjectLiteral){var R=this._tokens.peek();R.text===":"&&(w.type=l.WORD)}}if(this.start_of_statement(w)?v(this._flags.last_token,["var","let","const"])&&w.type===l.WORD&&(this._flags.declaration_statement=!0):w.newlines&&!H(this._flags.mode)&&(this._flags.last_token.type!==l.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==l.EQUALS&&(this._options.preserve_newlines||!v(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(w),this.print_newline()):this.handle_whitespace_and_comments(w),this._flags.do_block&&!this._flags.do_while)if(m(w,"while")){this._output.space_before_token=!0,this.print_token(w),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&m(w,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===k.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&v(w,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(w),this._flags.in_case=!0;return}if((this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(w)),m(w,"function")){(u(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(u(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===l.OPERATOR))&&!this._output.just_added_blankline()&&!w.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD?v(this._flags.last_token,["get","set","new","export"])||v(this._flags.last_token,z)?this._output.space_before_token=!0:m(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===l.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(H(this._flags.mode)||E(this._flags.mode))||this.print_newline(),this.print_token(w),this._flags.last_word=w.text;return}var U="NONE";if(this._flags.last_token.type===l.END_BLOCK?this._previous_flags.inline_frame?U="SPACE":v(w,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&w.newlines?U="NEWLINE":(U="SPACE",this._output.space_before_token=!0):U="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&this._flags.mode===k.BlockStatement?U="NEWLINE":this._flags.last_token.type===l.SEMICOLON&&H(this._flags.mode)?U="SPACE":this._flags.last_token.type===l.STRING?U="NEWLINE":this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||this._flags.last_token.text==="*"&&(u(this._last_last_text,["function","yield"])||this._flags.mode===k.ObjectLiteral&&u(this._last_last_text,["{",","]))?U="SPACE":this._flags.last_token.type===l.START_BLOCK?this._flags.inline_frame?U="SPACE":U="NEWLINE":this._flags.last_token.type===l.END_EXPR&&(this._output.space_before_token=!0,U="NEWLINE"),v(w,o)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?U="SPACE":U="NEWLINE"),v(w,["else","catch","finally"]))if((!(this._flags.last_token.type===l.END_BLOCK&&this._previous_flags.mode===k.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&w.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var K=this._output.current_line;K.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else U==="NEWLINE"?v(this._flags.last_token,y)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&v(w,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==l.END_EXPR?(this._flags.last_token.type!==l.START_EXPR||!v(w,["var","let","const"]))&&this._flags.last_token.text!==":"&&(m(w,"if")&&m(w.previous,"else")?this._output.space_before_token=!0:this.print_newline()):v(w,o)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&E(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():U==="SPACE"&&(this._output.space_before_token=!0);w.previous&&(w.previous.type===l.WORD||w.previous.type===l.RESERVED)&&(this._output.space_before_token=!0),this.print_token(w),this._flags.last_word=w.text,w.type===l.RESERVED&&(w.text==="do"?this._flags.do_block=!0:w.text==="if"?this._flags.if_block=!0:w.text==="import"?this._flags.import_block=!0:this._flags.import_block&&m(w,"from")&&(this._flags.import_block=!1))},P.prototype.handle_semicolon=function(w){this.start_of_statement(w)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(w);for(var R=this._tokens.peek();this._flags.mode===k.Statement&&!(this._flags.if_block&&m(R,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(w)},P.prototype.handle_string=function(w){w.text.startsWith("`")&&w.newlines===0&&w.whitespace_before===""&&(w.previous.text===")"||this._flags.last_token.type===l.WORD)||(this.start_of_statement(w)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(w),this._flags.last_token.type===l.RESERVED||this._flags.last_token.type===l.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR||this._flags.last_token.type===l.EQUALS||this._flags.last_token.type===l.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(w):w.text.startsWith("`")&&this._flags.last_token.type===l.END_EXPR&&(w.previous.text==="]"||w.previous.text===")")&&w.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(w)},P.prototype.handle_equals=function(w){this.start_of_statement(w)||this.handle_whitespace_and_comments(w),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(w),this._output.space_before_token=!0},P.prototype.handle_comma=function(w){this.handle_whitespace_and_comments(w,!0),this.print_token(w),this._output.space_before_token=!0,this._flags.declaration_statement?(H(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(w)):this._flags.mode===k.ObjectLiteral||this._flags.mode===k.Statement&&this._flags.parent.mode===k.ObjectLiteral?(this._flags.mode===k.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(w)},P.prototype.handle_operator=function(w){var R=w.text==="*"&&(v(this._flags.last_token,["function","yield"])||u(this._flags.last_token.type,[l.START_BLOCK,l.COMMA,l.END_BLOCK,l.SEMICOLON])),U=u(w.text,["-","+"])&&(u(this._flags.last_token.type,[l.START_BLOCK,l.START_EXPR,l.EQUALS,l.OPERATOR])||u(this._flags.last_token.text,o)||this._flags.last_token.text===",");if(!this.start_of_statement(w)){var K=!R;this.handle_whitespace_and_comments(w,K)}if(w.text==="*"&&this._flags.last_token.type===l.DOT){this.print_token(w);return}if(w.text==="::"){this.print_token(w);return}if(this._flags.last_token.type===l.OPERATOR&&u(this._options.operator_position,x)&&this.allow_wrap_or_preserved_newline(w),w.text===":"&&this._flags.in_case){this.print_token(w),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==l.START_BLOCK?(this.indent(),this.print_newline(),this._flags.case_block=!1):(this._flags.case_block=!0,this._output.space_before_token=!0);return}var oe=!0,D=!0,ae=!1;if(w.text===":"?this._flags.ternary_depth===0?oe=!1:(this._flags.ternary_depth-=1,ae=!0):w.text==="?"&&(this._flags.ternary_depth+=1),!U&&!R&&this._options.preserve_newlines&&u(w.text,s)){var ce=w.text===":",ve=ce&&ae,ze=ce&&!ae;switch(this._options.operator_position){case C.before_newline:this._output.space_before_token=!ze,this.print_token(w),(!ce||ve)&&this.allow_wrap_or_preserved_newline(w),this._output.space_before_token=!0;return;case C.after_newline:this._output.space_before_token=!0,!ce||ve?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(w):this._output.space_before_token=!1,this.print_token(w),this._output.space_before_token=!0;return;case C.preserve_newline:ze||this.allow_wrap_or_preserved_newline(w),oe=!(this._output.just_added_newline()||ze),this._output.space_before_token=oe,this.print_token(w),this._output.space_before_token=!0;return}}if(R){this.allow_wrap_or_preserved_newline(w),oe=!1;var qe=this._tokens.peek();D=qe&&u(qe.type,[l.WORD,l.RESERVED])}else if(w.text==="...")this.allow_wrap_or_preserved_newline(w),oe=this._flags.last_token.type===l.START_BLOCK,D=!1;else if(u(w.text,["--","++","!","~"])||U){if((this._flags.last_token.type===l.COMMA||this._flags.last_token.type===l.START_EXPR)&&this.allow_wrap_or_preserved_newline(w),oe=!1,D=!1,w.newlines&&(w.text==="--"||w.text==="++"||w.text==="~")){var yt=v(this._flags.last_token,y)&&w.newlines;yt&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(yt,!0)}this._flags.last_token.text===";"&&H(this._flags.mode)&&(oe=!0),this._flags.last_token.type===l.RESERVED?oe=!0:this._flags.last_token.type===l.END_EXPR?oe=!(this._flags.last_token.text==="]"&&(w.text==="--"||w.text==="++")):this._flags.last_token.type===l.OPERATOR&&(oe=u(w.text,["--","-","++","+"])&&u(this._flags.last_token.text,["--","-","++","+"]),u(w.text,["+","-"])&&u(this._flags.last_token.text,["--","++"])&&(D=!0)),(this._flags.mode===k.BlockStatement&&!this._flags.inline_frame||this._flags.mode===k.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||oe,this.print_token(w),this._output.space_before_token=D},P.prototype.handle_block_comment=function(w,R){if(this._output.raw){this._output.add_raw_token(w),w.directives&&w.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(w.directives){this.print_newline(!1,R),this.print_token(w),w.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!n.newline.test(w.text)&&!w.newlines){this._output.space_before_token=!0,this.print_token(w),this._output.space_before_token=!0;return}else this.print_block_commment(w,R)},P.prototype.print_block_commment=function(w,R){var U=L(w.text),K,oe=!1,D=!1,ae=w.whitespace_before,ce=ae.length;if(this.print_newline(!1,R),this.print_token_line_indentation(w),this._output.add_token(U[0]),this.print_newline(!1,R),U.length>1){for(U=U.slice(1),oe=I(U,"*"),D=q(U,ae),oe&&(this._flags.alignment=1),K=0;K0&&this._indentLevel--},m.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var v=this._source_text,y=this._options.eol;y==="auto"&&(y=` -`,v&&o.test(v||"")&&(y=v.match(o)[0])),v=v.replace(s,` -`);var _=v.match(/^[\t ]*/)[0];this._output=new e(this._options,_),this._input=new n(v),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var C=0,x=!1,k=!1,A=!1,L=!1,E=!1,H=!1,I=this._ch,q=!1,P,z,w;P=this._input.read(u),z=P!=="",w=I,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),I=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var R=this._input.read(f),U=i.get_directives(R);U&&U.ignore==="start"&&(R+=i.readIgnored(this._input)),this.print_string(R),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(d)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(z),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var K=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);K.match(/[ :]$/)&&(K=this.eatString(": ").replace(/\s$/,""),this.print_string(K),this._output.space_before_token=!0),K=K.replace(/\s$/,""),K==="extend"?L=!0:K==="import"&&(E=!0),K in this.NESTED_AT_RULE?(this._nestedLevel+=1,K in this.CONDITIONAL_GROUP_RULE&&(A=!0)):!x&&C===0&&K.indexOf(":")!==-1&&(k=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(z),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")k&&(k=!1,this.outdent()),A?(A=!1,x=this._indentLevel>=this._nestedLevel):x=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&x&&this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(w==="("?this._output.space_before_token=!1:w!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),w==="{"&&this._output.trim(!0),E=!1,L=!1,k&&(this.outdent(),k=!1),this.print_string(this._ch),x=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&this._input.peek()!=="}"&&this._output.add_new_line(!0),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var oe=0;oe"||this._ch==="+"||this._ch==="~")&&!k&&C===0)this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&l.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(z),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),l.test(this._ch)&&(this._ch="");else if(this._ch==="!"&&!this._input.lookBack("\\"))this._output.space_before_token=!0,this.print_string(this._ch);else{var ce=w==='"'||w==="'";this.preserveSingleSpace(ce||z),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===` -`&&q&&this._output.add_new_line()}var ve=this._output.get_code(y);return ve},x0.Beautifier=m,x0}var KE;function yse(){if(KE)return Df;KE=1;var t=vse().Beautifier,e=HL().Options;function n(r,i){var o=new t(r,i);return o.beautify()}return gse.exports=n,Df.defaultOptions=function(){return new e},Df}var Rf={},bse={get exports(){return Rf},set exports(t){Rf=t}},C0={},T0={},GE;function FL(){if(GE)return T0;GE=1;var t=Uw().Options;function e(n){t.call(this,n,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}return e.prototype=new t,T0.Options=e,T0}var vp={},YE;function JE(){if(YE)return vp;YE=1;var t=rg().Tokenizer,e=rg().TOKEN,n=Kw().Directives,r=$L().TemplatablePattern,i=cv().Pattern,o={TAG_OPEN:"TK_TAG_OPEN",TAG_CLOSE:"TK_TAG_CLOSE",ATTRIBUTE:"TK_ATTRIBUTE",EQUALS:"TK_EQUALS",VALUE:"TK_VALUE",COMMENT:"TK_COMMENT",TEXT:"TK_TEXT",UNKNOWN:"TK_UNKNOWN",START:e.START,RAW:e.RAW,EOF:e.EOF},s=new n(/<\!--/,/-->/),l=function(u,f){t.call(this,u,f),this._current_tag_name="";var d=new r(this._input).read_options(this._options),m=new i(this._input);if(this.__patterns={word:d.until(/[\n\r\t <]/),single_quote:d.until_after(/'/),double_quote:d.until_after(/"/),attribute:d.until(/[\n\r\t =>]|\/>/),element_name:d.until(/[\n\r\t >\/]/),handlebars_comment:m.starting_with(/{{!--/).until_after(/--}}/),handlebars:m.starting_with(/{{/).until_after(/}}/),handlebars_open:m.until(/[\n\r\t }]/),handlebars_raw_close:m.until(/}}/),comment:m.starting_with(//),cdata:m.starting_with(//),conditional_comment:m.starting_with(//),processing:m.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var v=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=m.matching(v).until_after(v)}};return l.prototype=new t,l.prototype._is_comment=function(u){return!1},l.prototype._is_opening=function(u){return u.type===o.TAG_OPEN},l.prototype._is_closing=function(u,f){return u.type===o.TAG_CLOSE&&f&&((u.text===">"||u.text==="/>")&&f.text[0]==="<"||u.text==="}}"&&f.text[0]==="{"&&f.text[1]==="{")},l.prototype._reset=function(){this._current_tag_name=""},l.prototype._get_next_token=function(u,f){var d=null;this._readWhitespace();var m=this._input.peek();return m===null?this._create_token(o.EOF,""):(d=d||this._read_open_handlebars(m,f),d=d||this._read_attribute(m,u,f),d=d||this._read_close(m,f),d=d||this._read_raw_content(m,u,f),d=d||this._read_content_word(m),d=d||this._read_comment_or_cdata(m),d=d||this._read_processing(m),d=d||this._read_open(m,f),d=d||this._create_token(o.UNKNOWN,this._input.next()),d)},l.prototype._read_comment_or_cdata=function(u){var f=null,d=null,m=null;if(u==="<"){var v=this._input.peek(1);v==="!"&&(d=this.__patterns.comment.read(),d?(m=s.get_directives(d),m&&m.ignore==="start"&&(d+=s.readIgnored(this._input))):d=this.__patterns.cdata.read()),d&&(f=this._create_token(o.COMMENT,d),f.directives=m)}return f},l.prototype._read_processing=function(u){var f=null,d=null,m=null;if(u==="<"){var v=this._input.peek(1);(v==="!"||v==="?")&&(d=this.__patterns.conditional_comment.read(),d=d||this.__patterns.processing.read()),d&&(f=this._create_token(o.COMMENT,d),f.directives=m)}return f},l.prototype._read_open=function(u,f){var d=null,m=null;return f||u==="<"&&(d=this._input.next(),this._input.peek()==="/"&&(d+=this._input.next()),d+=this.__patterns.element_name.read(),m=this._create_token(o.TAG_OPEN,d)),m},l.prototype._read_open_handlebars=function(u,f){var d=null,m=null;return f||this._options.indent_handlebars&&u==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(d=this.__patterns.handlebars_comment.read(),d=d||this.__patterns.handlebars.read(),m=this._create_token(o.COMMENT,d)):(d=this.__patterns.handlebars_open.read(),m=this._create_token(o.TAG_OPEN,d))),m},l.prototype._read_close=function(u,f){var d=null,m=null;return f&&(f.text[0]==="<"&&(u===">"||u==="/"&&this._input.peek(1)===">")?(d=this._input.next(),u==="/"&&(d+=this._input.next()),m=this._create_token(o.TAG_CLOSE,d)):f.text[0]==="{"&&u==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),m=this._create_token(o.TAG_CLOSE,"}}"))),m},l.prototype._read_attribute=function(u,f,d){var m=null,v="";if(d&&d.text[0]==="<")if(u==="=")m=this._create_token(o.EQUALS,this._input.next());else if(u==='"'||u==="'"){var y=this._input.next();u==='"'?y+=this.__patterns.double_quote.read():y+=this.__patterns.single_quote.read(),m=this._create_token(o.VALUE,y)}else v=this.__patterns.attribute.read(),v&&(f.type===o.EQUALS?m=this._create_token(o.VALUE,v):m=this._create_token(o.ATTRIBUTE,v));return m},l.prototype._is_content_unformatted=function(u){return this._options.void_elements.indexOf(u)===-1&&(this._options.content_unformatted.indexOf(u)!==-1||this._options.unformatted.indexOf(u)!==-1)},l.prototype._read_raw_content=function(u,f,d){var m="";if(d&&d.text[0]==="{")m=this.__patterns.handlebars_raw_close.read();else if(f.type===o.TAG_CLOSE&&f.opened.text[0]==="<"&&f.text[0]!=="/"){var v=f.opened.text.substr(1).toLowerCase();if(v==="script"||v==="style"){var y=this._read_comment_or_cdata(u);if(y)return y.type=o.TEXT,y;m=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(v)&&(m=this._input.readUntil(new RegExp("","ig")))}return m?this._create_token(o.TEXT,m):null},l.prototype._read_content_word=function(u){var f="";if(this._options.unformatted_content_delimiter&&u===this._options.unformatted_content_delimiter[0]&&(f=this.__patterns.unformatted_content_delimiter.read()),f||(f=this.__patterns.word.read()),f)return this._create_token(o.TEXT,f)},vp.Tokenizer=l,vp.TOKEN=o,vp}var XE;function _se(){if(XE)return C0;XE=1;var t=FL().Options,e=Ww().Output,n=JE().Tokenizer,r=JE().TOKEN,i=/\r\n|[\r\n]/,o=/\r\n|[\r\n]/g,s=function(x,k){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=x.max_preserve_newlines,this.preserve_newlines=x.preserve_newlines,this._output=new e(x,k)};s.prototype.current_line_has_match=function(x){return this._output.current_line.has_match(x)},s.prototype.set_space_before_token=function(x,k){this._output.space_before_token=x,this._output.non_breaking_space=k},s.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},s.prototype.add_raw_token=function(x){this._output.add_raw_token(x)},s.prototype.print_preserved_newlines=function(x){var k=0;x.type!==r.TEXT&&x.previous.type!==r.TEXT&&(k=x.newlines?1:0),this.preserve_newlines&&(k=x.newlines0);return k!==0},s.prototype.traverse_whitespace=function(x){return x.whitespace_before||x.newlines?(this.print_preserved_newlines(x)||(this._output.space_before_token=!0),!0):!1},s.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},s.prototype.print_newline=function(x){this._output.add_new_line(x)},s.prototype.print_token=function(x){x.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(x.text))},s.prototype.indent=function(){this.indent_level++},s.prototype.get_full_indent=function(x){return x=this.indent_level+(x||0),x<1?"":this._output.get_indent_string(x)};var l=function(x){for(var k=null,A=x.next;A.type!==r.EOF&&x.closed!==A;){if(A.type===r.ATTRIBUTE&&A.text==="type"){A.next&&A.next.type===r.EQUALS&&A.next.next&&A.next.next.type===r.VALUE&&(k=A.next.next.text);break}A=A.next}return k},u=function(x,k){var A=null,L=null;return k.closed?(x==="script"?A="text/javascript":x==="style"&&(A="text/css"),A=l(k)||A,A.search("text/css")>-1?L="css":A.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?L="javascript":A.search(/(text|application|dojo)\/(x-)?(html)/)>-1?L="html":A.search(/test\/null/)>-1&&(L="null"),L):null};function f(x,k){return k.indexOf(x)!==-1}function d(x,k,A){this.parent=x||null,this.tag=k?k.tag_name:"",this.indent_level=A||0,this.parser_token=k||null}function m(x){this._printer=x,this._current_frame=null}m.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},m.prototype.record_tag=function(x){var k=new d(this._current_frame,x,this._printer.indent_level);this._current_frame=k},m.prototype._try_pop_frame=function(x){var k=null;return x&&(k=x.parser_token,this._printer.indent_level=x.indent_level,this._current_frame=x.parent),k},m.prototype._get_frame=function(x,k){for(var A=this._current_frame;A&&x.indexOf(A.tag)===-1;){if(k&&k.indexOf(A.tag)!==-1){A=null;break}A=A.parent}return A},m.prototype.try_pop=function(x,k){var A=this._get_frame([x],k);return this._try_pop_frame(A)},m.prototype.indent_to_tag=function(x){var k=this._get_frame(x);k&&(this._printer.indent_level=k.indent_level)};function v(x,k,A,L){this._source_text=x||"",k=k||{},this._js_beautify=A,this._css_beautify=L,this._tag_stack=null;var E=new t(k,"html");this._options=E,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,5)==="force",this._is_wrap_attributes_force_expand_multiline=this._options.wrap_attributes==="force-expand-multiline",this._is_wrap_attributes_force_aligned=this._options.wrap_attributes==="force-aligned",this._is_wrap_attributes_aligned_multiple=this._options.wrap_attributes==="aligned-multiple",this._is_wrap_attributes_preserve=this._options.wrap_attributes.substr(0,8)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}v.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var x=this._source_text,k=this._options.eol;this._options.eol==="auto"&&(k=` ->>>>>>>> origin/craft-4:src/web/assets/field/dist/assets/vizy-91fcee7d.js -`,x&&i.test(x)&&(k=x.match(i)[0])),x=x.replace(o,` -`);var A=x.match(/^[\t ]*/)[0],N={text:"",type:""},E=new y,H=new s(this._options,A),I=new n(x,this._options).tokenize();this._tag_stack=new m(H);for(var q=null,P=I.next();P.type!==r.EOF;)P.type===r.TAG_OPEN||P.type===r.COMMENT?(q=this._handle_tag_open(H,P,E,N),E=q):P.type===r.ATTRIBUTE||P.type===r.EQUALS||P.type===r.VALUE||P.type===r.TEXT&&!E.tag_complete?q=this._handle_inside_tag(H,P,E,I):P.type===r.TAG_CLOSE?q=this._handle_tag_close(H,P,E):P.type===r.TEXT?q=this._handle_text(H,P,E):H.add_raw_token(P),N=q,P=I.next();var z=H._output.get_code(k);return z},v.prototype._handle_tag_close=function(x,k,A){var N={text:k.text,type:k.type};return x.alignment_size=0,A.tag_complete=!0,x.set_space_before_token(k.newlines||k.whitespace_before!=="",!0),A.is_unformatted?x.add_raw_token(k):(A.tag_start_char==="<"&&(x.set_space_before_token(k.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&A.has_wrapped_attrs&&x.print_newline(!1)),x.print_token(k)),A.indent_content&&!(A.is_unformatted||A.is_content_unformatted)&&(x.indent(),A.indent_content=!1),!A.is_inline_element&&!(A.is_unformatted||A.is_content_unformatted)&&x.set_wrap_point(),N},v.prototype._handle_inside_tag=function(x,k,A,N){var E=A.has_wrapped_attrs,H={text:k.text,type:k.type};if(x.set_space_before_token(k.newlines||k.whitespace_before!=="",!0),A.is_unformatted)x.add_raw_token(k);else if(A.tag_start_char==="{"&&k.type===r.TEXT)x.print_preserved_newlines(k)?(k.newlines=0,x.add_raw_token(k)):x.print_token(k);else{if(k.type===r.ATTRIBUTE?(x.set_space_before_token(!0),A.attr_count+=1):(k.type===r.EQUALS||k.type===r.VALUE&&k.previous.type===r.EQUALS)&&x.set_space_before_token(!1),k.type===r.ATTRIBUTE&&A.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(x.traverse_whitespace(k),E=E||k.newlines!==0),this._is_wrap_attributes_force)){var I=A.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&A.attr_count===1){var q=!0,P=0,z;do{if(z=N.peek(P),z.type===r.ATTRIBUTE){q=!1;break}P+=1}while(P<4&&z.type!==r.EOF&&z.type!==r.TAG_CLOSE);I=!q}I&&(x.print_newline(!1),E=!0)}x.print_token(k),E=E||x.previous_token_wrapped(),A.has_wrapped_attrs=E}return H},v.prototype._handle_text=function(x,k,A){var N={text:k.text,type:"TK_CONTENT"};return A.custom_beautifier_name?this._print_custom_beatifier_text(x,k,A):A.is_unformatted||A.is_content_unformatted?x.add_raw_token(k):(x.traverse_whitespace(k),x.print_token(k)),N},v.prototype._print_custom_beatifier_text=function(x,k,A){var N=this;if(k.text!==""){var E=k.text,H,I=1,q="",P="";A.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?H=this._js_beautify:A.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?H=this._css_beautify:A.custom_beautifier_name==="html"&&(H=function(oe,D){var ae=new v(oe,D,N._js_beautify,N._css_beautify);return ae.beautify()}),this._options.indent_scripts==="keep"?I=0:this._options.indent_scripts==="separate"&&(I=-x.indent_level);var z=x.get_full_indent(I);if(E=E.replace(/\n[ \t]*$/,""),A.custom_beautifier_name!=="html"&&E[0]==="<"&&E.match(/^(|]]>)$/.exec(E);if(!w){x.add_raw_token(k);return}q=z+w[1]+` -`,E=w[4],w[5]&&(P=z+w[5]),E=E.replace(/\n[ \t]*$/,""),(w[2]||w[3].indexOf(` -`)!==-1)&&(w=w[3].match(/[ \t]+$/),w&&(k.whitespace_before=w[0]))}if(E)if(H){var R=function(){this.eol=` -`};R.prototype=this._options.raw_options;var U=new R;E=H(z+E,U)}else{var K=k.whitespace_before;K&&(E=E.replace(new RegExp(` -(`+K+")?","g"),` -`)),E=z+E.replace(/\n/g,` -`+z)}q&&(E?E=q+E+` -<<<<<<<< HEAD:src/web/assets/field/dist/assets/vizy-1d31d33d.js -`+P:E=q+P),x.print_newline(!1),E&&(k.text=E,k.whitespace_before="",k.newlines=0,x.add_raw_token(k),x.print_newline(!0))}},v.prototype._handle_tag_open=function(x,k,A,N){var E=this._get_tag_open_token(k);return(A.is_unformatted||A.is_content_unformatted)&&!A.is_empty_element&&k.type===r.TAG_OPEN&&k.text.indexOf("]*)/),this.tag_check=A?A[1]:""):(A=k.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=A?A[1]:"",(k.text.startsWith("{{#>")||k.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&k.next!==null?this.tag_check=k.next.text.split(" ")[0]:this.tag_check=k.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),k.type===r.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||k.closed&&k.closed.text==="/>";var N=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(N=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(N)))}};v.prototype._get_tag_open_token=function(x){var k=new y(this._tag_stack.get_parser_token(),x);return k.alignment_size=this._options.wrap_attributes_indent_size,k.is_end_tag=k.is_end_tag||f(k.tag_check,this._options.void_elements),k.is_empty_element=k.tag_complete||k.is_start_tag&&k.is_end_tag,k.is_unformatted=!k.tag_complete&&f(k.tag_check,this._options.unformatted),k.is_content_unformatted=!k.is_empty_element&&f(k.tag_check,this._options.content_unformatted),k.is_inline_element=f(k.tag_name,this._options.inline)||k.tag_name.includes("-")||k.tag_start_char==="{",k},v.prototype._set_tag_position=function(x,k,A,N,E){if(A.is_empty_element||(A.is_end_tag?A.start_tag_token=this._tag_stack.try_pop(A.tag_name):(this._do_optional_end_element(A)&&(A.is_inline_element||x.print_newline(!1)),this._tag_stack.record_tag(A),(A.tag_name==="script"||A.tag_name==="style")&&!(A.is_unformatted||A.is_content_unformatted)&&(A.custom_beautifier_name=u(A.tag_check,k)))),f(A.tag_check,this._options.extra_liners)&&(x.print_newline(!1),x._output.just_added_blankline()||x.print_newline(!0)),A.is_empty_element){if(A.tag_start_char==="{"&&A.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),A.indent_content=!0;var H=x.current_line_has_match(/{{#if/);H||x.print_newline(!1)}A.tag_name==="!--"&&E.type===r.TAG_CLOSE&&N.is_end_tag&&A.text.indexOf(` -`)===-1||(A.is_inline_element||A.is_unformatted||x.print_newline(!1),this._calcluate_parent_multiline(x,A))}else if(A.is_end_tag){var I=!1;I=A.start_tag_token&&A.start_tag_token.multiline_content,I=I||!A.is_inline_element&&!(N.is_inline_element||N.is_unformatted)&&!(E.type===r.TAG_CLOSE&&A.start_tag_token===N)&&E.type!=="TK_CONTENT",(A.is_content_unformatted||A.is_unformatted)&&(I=!1),I&&x.print_newline(!1)}else A.indent_content=!A.custom_beautifier_name,A.tag_start_char==="<"&&(A.tag_name==="html"?A.indent_content=this._options.indent_inner_html:A.tag_name==="head"?A.indent_content=this._options.indent_head_inner_html:A.tag_name==="body"&&(A.indent_content=this._options.indent_body_inner_html)),!(A.is_inline_element||A.is_unformatted)&&(E.type!=="TK_CONTENT"||A.is_content_unformatted)&&x.print_newline(!1),this._calcluate_parent_multiline(x,A)},v.prototype._calcluate_parent_multiline=function(x,k){k.parent&&x._output.just_added_newline()&&!((k.is_inline_element||k.is_unformatted)&&k.parent.is_inline_element)&&(k.parent.multiline_content=!0)};var _=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],C=["a","audio","del","ins","map","noscript","video"];return v.prototype._do_optional_end_element=function(x){var k=null;if(!(x.is_empty_element||!x.is_start_tag||!x.parent)){if(x.tag_name==="body")k=k||this._tag_stack.try_pop("head");else if(x.tag_name==="li")k=k||this._tag_stack.try_pop("li",["ol","ul"]);else if(x.tag_name==="dd"||x.tag_name==="dt")k=k||this._tag_stack.try_pop("dt",["dl"]),k=k||this._tag_stack.try_pop("dd",["dl"]);else if(x.parent.tag_name==="p"&&_.indexOf(x.tag_name)!==-1){var A=x.parent.parent;(!A||C.indexOf(A.tag_name)===-1)&&(k=k||this._tag_stack.try_pop("p"))}else x.tag_name==="rp"||x.tag_name==="rt"?(k=k||this._tag_stack.try_pop("rt",["ruby","rtc"]),k=k||this._tag_stack.try_pop("rp",["ruby","rtc"])):x.tag_name==="optgroup"?k=k||this._tag_stack.try_pop("optgroup",["select"]):x.tag_name==="option"?k=k||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):x.tag_name==="colgroup"?k=k||this._tag_stack.try_pop("caption",["table"]):x.tag_name==="thead"?(k=k||this._tag_stack.try_pop("caption",["table"]),k=k||this._tag_stack.try_pop("colgroup",["table"])):x.tag_name==="tbody"||x.tag_name==="tfoot"?(k=k||this._tag_stack.try_pop("caption",["table"]),k=k||this._tag_stack.try_pop("colgroup",["table"]),k=k||this._tag_stack.try_pop("thead",["table"]),k=k||this._tag_stack.try_pop("tbody",["table"])):x.tag_name==="tr"?(k=k||this._tag_stack.try_pop("caption",["table"]),k=k||this._tag_stack.try_pop("colgroup",["table"]),k=k||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(x.tag_name==="th"||x.tag_name==="td")&&(k=k||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),k=k||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return x.parent=this._tag_stack.get_parser_token(),k}},Sy.Beautifier=v,Sy}var ZE;function Mse(){if(ZE)return Rf;ZE=1;var t=Ose().Beautifier,e=HN().Options;function n(r,i,o,s){var l=new t(r,i,o,s);return l.beautify()}return Ase.exports=n,Rf.defaultOptions=function(){return new e},Rf}var QE;function Lse(){if(QE)return Jc;QE=1;var t=Sse(),e=Ese(),n=Mse();function r(i,o,s,l){return s=s||t,l=l||e,n(i,o,s,l)}return r.defaultOptions=n.defaultOptions,Jc.js=t,Jc.css=e,Jc.html=r,Jc}(function(t){function e(n,r,i){var o=function(s,l){return n.js_beautify(s,l)};return o.js=n.js_beautify,o.css=r.css_beautify,o.html=i.html_beautify,o.js_beautify=n.js_beautify,o.css_beautify=r.css_beautify,o.html_beautify=i.html_beautify,o}(function(n){var r=Lse();r.js_beautify=r.js,r.css_beautify=r.css,r.html_beautify=r.html,n.exports=e(r,r,r)})(t)})(bse);const Nse=v1;var eA={},tA;function Ise(){return tA||(tA=1,function(t,e){(function(n){n(Or())})(function(n){n.overlayMode=function(r,i,o){return{startState:function(){return{base:n.startState(r),overlay:n.startState(i),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(s){return{base:n.copyState(r,s.base),overlay:n.copyState(i,s.overlay),basePos:s.basePos,baseCur:null,overlayPos:s.overlayPos,overlayCur:null}},token:function(s,l){return(s!=l.streamSeen||Math.min(l.basePos,l.overlayPos)")):null:D.match("--")?ce(x("comment","-->")):D.match("DOCTYPE",!0,!0)?(D.eatWhile(/[\w\._\-]/),ce(k(1))):null:D.eat("?")?(D.eatWhile(/[\w\._\-]/),ae.tokenize=x("meta","?>"),"meta"):(m=D.eat("/")?"closeTag":"openTag",ae.tokenize=_,"tag bracket");if(ve=="&"){var ze;return D.eat("#")?D.eat("x")?ze=D.eatWhile(/[a-fA-F\d]/)&&D.eat(";"):ze=D.eatWhile(/[\d]/)&&D.eat(";"):ze=D.eatWhile(/[\w\.\-:]/)&&D.eat(";"),ze?"atom":"error"}else return D.eatWhile(/[^&<]/),null}y.isInText=!0;function _(D,ae){var ce=D.next();if(ce==">"||ce=="/"&&D.eat(">"))return ae.tokenize=y,m=ce==">"?"endTag":"selfcloseTag","tag bracket";if(ce=="=")return m="equals",null;if(ce=="<"){ae.tokenize=y,ae.state=I,ae.tagName=ae.tagStart=null;var ve=ae.tokenize(D,ae);return ve?ve+" tag error":"tag error"}else return/[\'\"]/.test(ce)?(ae.tokenize=C(ce),ae.stringStartCol=D.column(),ae.tokenize(D,ae)):(D.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function C(D){var ae=function(ce,ve){for(;!ce.eol();)if(ce.next()==D){ve.tokenize=_;break}return"string"};return ae.isInAttribute=!0,ae}function x(D,ae){return function(ce,ve){for(;!ce.eol();){if(ce.match(ae)){ve.tokenize=y;break}ce.next()}return D}}function k(D){return function(ae,ce){for(var ve;(ve=ae.next())!=null;){if(ve=="<")return ce.tokenize=k(D+1),ce.tokenize(ae,ce);if(ve==">")if(D==1){ce.tokenize=y;break}else return ce.tokenize=k(D-1),ce.tokenize(ae,ce)}return"meta"}}function A(D){return D&&D.toLowerCase()}function N(D,ae,ce){this.prev=D.context,this.tagName=ae||"",this.indent=D.indented,this.startOfLine=ce,(u.doNotIndent.hasOwnProperty(ae)||D.context&&D.context.noIndent)&&(this.noIndent=!0)}function E(D){D.context&&(D.context=D.context.prev)}function H(D,ae){for(var ce;;){if(!D.context||(ce=D.context.tagName,!u.contextGrabbers.hasOwnProperty(A(ce))||!u.contextGrabbers[A(ce)].hasOwnProperty(A(ae))))return;E(D)}}function I(D,ae,ce){return D=="openTag"?(ce.tagStart=ae.column(),q):D=="closeTag"?P:I}function q(D,ae,ce){return D=="word"?(ce.tagName=ae.current(),v="tag",R):u.allowMissingTagName&&D=="endTag"?(v="tag bracket",R(D,ae,ce)):(v="error",q)}function P(D,ae,ce){if(D=="word"){var ve=ae.current();return ce.context&&ce.context.tagName!=ve&&u.implicitlyClosed.hasOwnProperty(A(ce.context.tagName))&&E(ce),ce.context&&ce.context.tagName==ve||u.matchClosing===!1?(v="tag",z):(v="tag error",w)}else return u.allowMissingTagName&&D=="endTag"?(v="tag bracket",z(D,ae,ce)):(v="error",w)}function z(D,ae,ce){return D!="endTag"?(v="error",z):(E(ce),I)}function w(D,ae,ce){return v="error",z(D,ae,ce)}function R(D,ae,ce){if(D=="word")return v="attribute",U;if(D=="endTag"||D=="selfcloseTag"){var ve=ce.tagName,ze=ce.tagStart;return ce.tagName=ce.tagStart=null,D=="selfcloseTag"||u.autoSelfClosers.hasOwnProperty(A(ve))?H(ce,ve):(H(ce,ve),ce.context=new N(ce,ve,ze==ce.indented)),I}return v="error",R}function U(D,ae,ce){return D=="equals"?K:(u.allowMissing||(v="error"),R(D,ae,ce))}function K(D,ae,ce){return D=="string"?oe:D=="word"&&u.allowUnquoted?(v="string",R):(v="error",R(D,ae,ce))}function oe(D,ae,ce){return D=="string"?oe:R(D,ae,ce)}return{startState:function(D){var ae={tokenize:y,state:I,indented:D||0,tagName:null,tagStart:null,context:null};return D!=null&&(ae.baseIndent=D),ae},token:function(D,ae){if(!ae.tagName&&D.sol()&&(ae.indented=D.indentation()),D.eatSpace())return null;m=null;var ce=ae.tokenize(D,ae);return(ce||m)&&ce!="comment"&&(v=null,ae.state=ae.state(m||ce,D,ae),v&&(ce=v=="error"?ce+" error":v)),ce},indent:function(D,ae,ce){var ve=D.context;if(D.tokenize.isInAttribute)return D.tagStart==D.indented?D.stringStartCol+1:D.indented+l;if(ve&&ve.noIndent)return n.Pass;if(D.tokenize!=_&&D.tokenize!=y)return ce?ce.match(/^(\s*)/)[0].length:0;if(D.tagName)return u.multilineTagIndentPastTag!==!1?D.tagStart+D.tagName.length+2:D.tagStart+l*(u.multilineTagIndentFactor||1);if(u.alignCDATA&&/$/,blockCommentStart:"",configuration:u.htmlMode?"html":"xml",helperType:u.htmlMode?"html":"xml",skipAttribute:function(D){D.state==K&&(D.state=R)},xmlCurrentTag:function(D){return D.tagName?{name:D.tagName,close:D.type=="closeTag"}:null},xmlCurrentContext:function(D){for(var ae=[],ce=D.context;ce;ce=ce.prev)ae.push(ce.tagName);return ae.reverse()}}}),n.defineMIME("text/xml","xml"),n.defineMIME("application/xml","xml"),n.mimeModes.hasOwnProperty("text/html")||n.defineMIME("text/html",{name:"xml",htmlMode:!0})})}()),nA}var iA={},oA;function Gw(){return oA||(oA=1,function(t,e){(function(n){n(Or())})(function(n){n.defineMode("javascript",function(r,i){var o=r.indentUnit,s=i.statementIndent,l=i.jsonld,u=i.json||l,f=i.trackScope!==!1,d=i.typescript,m=i.wordCharacters||/[\w$\xa1-\uffff]/,v=function(){function V(Cn){return{type:Cn,style:"keyword"}}var re=V("keyword a"),se=V("keyword b"),we=V("keyword c"),ft=V("keyword d"),At=V("operator"),It={type:"atom",style:"atom"};return{if:V("if"),while:re,with:re,else:se,do:se,try:se,finally:se,return:ft,break:ft,continue:ft,new:V("new"),delete:we,void:we,throw:we,debugger:V("debugger"),var:V("var"),const:V("var"),let:V("var"),function:V("function"),catch:V("catch"),for:V("for"),switch:V("switch"),case:V("case"),default:V("default"),in:At,typeof:At,instanceof:At,true:It,false:It,null:It,undefined:It,NaN:It,Infinity:It,this:V("this"),class:V("class"),super:V("atom"),yield:we,export:V("export"),import:V("import"),extends:we,await:we}}(),y=/[+\-*&%=<>!?|~^@]/,_=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function C(V){for(var re=!1,se,we=!1;(se=V.next())!=null;){if(!re){if(se=="/"&&!we)return;se=="["?we=!0:we&&se=="]"&&(we=!1)}re=!re&&se=="\\"}}var x,k;function A(V,re,se){return x=V,k=se,re}function N(V,re){var se=V.next();if(se=='"'||se=="'")return re.tokenize=E(se),re.tokenize(V,re);if(se=="."&&V.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return A("number","number");if(se=="."&&V.match(".."))return A("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(se))return A(se);if(se=="="&&V.eat(">"))return A("=>","operator");if(se=="0"&&V.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return A("number","number");if(/\d/.test(se))return V.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),A("number","number");if(se=="/")return V.eat("*")?(re.tokenize=H,H(V,re)):V.eat("/")?(V.skipToEnd(),A("comment","comment")):Xi(V,re,1)?(C(V),V.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),A("regexp","string-2")):(V.eat("="),A("operator","operator",V.current()));if(se=="`")return re.tokenize=I,I(V,re);if(se=="#"&&V.peek()=="!")return V.skipToEnd(),A("meta","meta");if(se=="#"&&V.eatWhile(m))return A("variable","property");if(se=="<"&&V.match("!--")||se=="-"&&V.match("->")&&!/\S/.test(V.string.slice(0,V.start)))return V.skipToEnd(),A("comment","comment");if(y.test(se))return(se!=">"||!re.lexical||re.lexical.type!=">")&&(V.eat("=")?(se=="!"||se=="=")&&V.eat("="):/[<>*+\-|&?]/.test(se)&&(V.eat(se),se==">"&&V.eat(se))),se=="?"&&V.eat(".")?A("."):A("operator","operator",V.current());if(m.test(se)){V.eatWhile(m);var we=V.current();if(re.lastType!="."){if(v.propertyIsEnumerable(we)){var ft=v[we];return A(ft.type,ft.style,we)}if(we=="async"&&V.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return A("async","keyword",we)}return A("variable","variable",we)}}function E(V){return function(re,se){var we=!1,ft;if(l&&re.peek()=="@"&&re.match(_))return se.tokenize=N,A("jsonld-keyword","meta");for(;(ft=re.next())!=null&&!(ft==V&&!we);)we=!we&&ft=="\\";return we||(se.tokenize=N),A("string","string")}}function H(V,re){for(var se=!1,we;we=V.next();){if(we=="/"&&se){re.tokenize=N;break}se=we=="*"}return A("comment","comment")}function I(V,re){for(var se=!1,we;(we=V.next())!=null;){if(!se&&(we=="`"||we=="$"&&V.eat("{"))){re.tokenize=N;break}se=!se&&we=="\\"}return A("quasi","string-2",V.current())}var q="([{}])";function P(V,re){re.fatArrowAt&&(re.fatArrowAt=null);var se=V.string.indexOf("=>",V.start);if(!(se<0)){if(d){var we=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(V.string.slice(V.start,se));we&&(se=we.index)}for(var ft=0,At=!1,It=se-1;It>=0;--It){var Cn=V.string.charAt(It),Jr=q.indexOf(Cn);if(Jr>=0&&Jr<3){if(!ft){++It;break}if(--ft==0){Cn=="("&&(At=!0);break}}else if(Jr>=3&&Jr<6)++ft;else if(m.test(Cn))At=!0;else if(/["'\/`]/.test(Cn))for(;;--It){if(It==0)return;var dt=V.string.charAt(It-1);if(dt==Cn&&V.string.charAt(It-2)!="\\"){It--;break}}else if(At&&!ft){++It;break}}At&&!ft&&(re.fatArrowAt=It)}}var z={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function w(V,re,se,we,ft,At){this.indented=V,this.column=re,this.type=se,this.prev=ft,this.info=At,we!=null&&(this.align=we)}function R(V,re){if(!f)return!1;for(var se=V.localVars;se;se=se.next)if(se.name==re)return!0;for(var we=V.context;we;we=we.prev)for(var se=we.vars;se;se=se.next)if(se.name==re)return!0}function U(V,re,se,we,ft){var At=V.cc;for(K.state=V,K.stream=ft,K.marked=null,K.cc=At,K.style=re,V.lexical.hasOwnProperty("align")||(V.lexical.align=!0);;){var It=At.length?At.pop():u?Fe:Ze;if(It(se,we)){for(;At.length&&At[At.length-1].lex;)At.pop()();return K.marked?K.marked:se=="variable"&&R(V,we)?"variable-2":re}}}var K={state:null,column:null,marked:null,cc:null};function oe(){for(var V=arguments.length-1;V>=0;V--)K.cc.push(arguments[V])}function D(){return oe.apply(null,arguments),!0}function ae(V,re){for(var se=re;se;se=se.next)if(se.name==V)return!0;return!1}function ce(V){var re=K.state;if(K.marked="def",!!f){if(re.context){if(re.lexical.info=="var"&&re.context&&re.context.block){var se=ve(V,re.context);if(se!=null){re.context=se;return}}else if(!ae(V,re.localVars)){re.localVars=new vt(V,re.localVars);return}}i.globalVars&&!ae(V,re.globalVars)&&(re.globalVars=new vt(V,re.globalVars))}}function ve(V,re){if(re)if(re.block){var se=ve(V,re.prev);return se?se==re.prev?re:new qe(se,re.vars,!0):null}else return ae(V,re.vars)?re:new qe(re.prev,new vt(V,re.vars),!1);else return null}function ze(V){return V=="public"||V=="private"||V=="protected"||V=="abstract"||V=="readonly"}function qe(V,re,se){this.prev=V,this.vars=re,this.block=se}function vt(V,re){this.name=V,this.next=re}var mt=new vt("this",new vt("arguments",null));function bt(){K.state.context=new qe(K.state.context,K.state.localVars,!1),K.state.localVars=mt}function yt(){K.state.context=new qe(K.state.context,K.state.localVars,!0),K.state.localVars=null}bt.lex=yt.lex=!0;function Xe(){K.state.localVars=K.state.context.vars,K.state.context=K.state.context.prev}Xe.lex=!0;function Ie(V,re){var se=function(){var we=K.state,ft=we.indented;if(we.lexical.type=="stat")ft=we.lexical.indented;else for(var At=we.lexical;At&&At.type==")"&&At.align;At=At.prev)ft=At.indented;we.lexical=new w(ft,K.stream.column(),V,null,we.lexical,re)};return se.lex=!0,se}function Be(){var V=K.state;V.lexical.prev&&(V.lexical.type==")"&&(V.indented=V.lexical.indented),V.lexical=V.lexical.prev)}Be.lex=!0;function Ee(V){function re(se){return se==V?D():V==";"||se=="}"||se==")"||se=="]"?oe():D(re)}return re}function Ze(V,re){return V=="var"?D(Ie("vardef",re),Yr,Ee(";"),Be):V=="keyword a"?D(Ie("form"),ie,Ze,Be):V=="keyword b"?D(Ie("form"),Ze,Be):V=="keyword d"?K.stream.match(/^\s*$/,!1)?D():D(Ie("stat"),be,Ee(";"),Be):V=="debugger"?D(Ee(";")):V=="{"?D(Ie("}"),yt,Te,Be,Xe):V==";"?D():V=="if"?(K.state.lexical.info=="else"&&K.state.cc[K.state.cc.length-1]==Be&&K.state.cc.pop()(),D(Ie("form"),ie,Ze,Be,Pl)):V=="function"?D(Yi):V=="for"?D(Ie("form"),yt,Wd,Ze,Xe,Be):V=="class"||d&&re=="interface"?(K.marked="keyword",D(Ie("form",V=="class"?V:re),qd,Be)):V=="variable"?d&&re=="declare"?(K.marked="keyword",D(Ze)):d&&(re=="module"||re=="enum"||re=="type")&&K.stream.match(/^\s*\w/,!1)?(K.marked="keyword",re=="enum"?D(Rl):re=="type"?D(Ud,Ee("operator"),me,Ee(";")):D(Ie("form"),Sn,Ee("{"),Ie("}"),Te,Be,Be)):d&&re=="namespace"?(K.marked="keyword",D(Ie("form"),Fe,Ze,Be)):d&&re=="abstract"?(K.marked="keyword",D(Ze)):D(Ie("stat"),Q):V=="switch"?D(Ie("form"),ie,Ee("{"),Ie("}","switch"),yt,Te,Be,Be,Xe):V=="case"?D(Fe,Ee(":")):V=="default"?D(Ee(":")):V=="catch"?D(Ie("form"),bt,Ke,Ze,Be,Xe):V=="export"?D(Ie("stat"),fs,Be):V=="import"?D(Ie("stat"),So,Be):V=="async"?D(Ze):re=="@"?D(Fe,Ze):oe(Ie("stat"),Fe,Ee(";"),Be)}function Ke(V){if(V=="(")return D(Ci,Ee(")"))}function Fe(V,re){return ne(V,re,!1)}function at(V,re){return ne(V,re,!0)}function ie(V){return V!="("?oe():D(Ie(")"),be,Ee(")"),Be)}function ne(V,re,se){if(K.state.fatArrowAt==K.stream.start){var we=se?W:L;if(V=="(")return D(bt,Ie(")"),X(Ci,")"),Be,Ee("=>"),we,Xe);if(V=="variable")return oe(bt,Sn,Ee("=>"),we,Xe)}var ft=se?xe:_e;return z.hasOwnProperty(V)?D(ft):V=="function"?D(Yi,ft):V=="class"||d&&re=="interface"?(K.marked="keyword",D(Ie("form"),cs,Be)):V=="keyword c"||V=="async"?D(se?at:Fe):V=="("?D(Ie(")"),be,Ee(")"),Be,ft):V=="operator"||V=="spread"?D(se?at:Fe):V=="["?D(Ie("]"),Co,Be,ft):V=="{"?de(pe,"}",null,ft):V=="quasi"?oe(G,ft):V=="new"?D(O(se)):D()}function be(V){return V.match(/[;\}\)\],]/)?oe():oe(Fe)}function _e(V,re){return V==","?D(be):xe(V,re,!1)}function xe(V,re,se){var we=se==!1?_e:xe,ft=se==!1?Fe:at;if(V=="=>")return D(bt,se?W:L,Xe);if(V=="operator")return/\+\+|--/.test(re)||d&&re=="!"?D(we):d&&re=="<"&&K.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?D(Ie(">"),X(me,">"),Be,we):re=="?"?D(Fe,Ee(":"),ft):D(ft);if(V=="quasi")return oe(G,we);if(V!=";"){if(V=="(")return de(at,")","call",we);if(V==".")return D(le,we);if(V=="[")return D(Ie("]"),be,Ee("]"),Be,we);if(d&&re=="as")return K.marked="keyword",D(me,we);if(V=="regexp")return K.state.lastType=K.marked="operator",K.stream.backUp(K.stream.pos-K.stream.start-1),D(ft)}}function G(V,re){return V!="quasi"?oe():re.slice(re.length-2)!="${"?D(G):D(be,Z)}function Z(V){if(V=="}")return K.marked="string-2",K.state.tokenize=I,D(G)}function L(V){return P(K.stream,K.state),oe(V=="{"?Ze:Fe)}function W(V){return P(K.stream,K.state),oe(V=="{"?Ze:at)}function O(V){return function(re){return re=="."?D(V?F:j):re=="variable"&&d?D(Gt,V?xe:_e):oe(V?at:Fe)}}function j(V,re){if(re=="target")return K.marked="keyword",D(_e)}function F(V,re){if(re=="target")return K.marked="keyword",D(xe)}function Q(V){return V==":"?D(Be,Ze):oe(_e,Ee(";"),Be)}function le(V){if(V=="variable")return K.marked="property",D()}function pe(V,re){if(V=="async")return K.marked="property",D(pe);if(V=="variable"||K.style=="keyword"){if(K.marked="property",re=="get"||re=="set")return D(ye);var se;return d&&K.state.fatArrowAt==K.stream.start&&(se=K.stream.match(/^\s*:\s*/,!1))&&(K.state.fatArrowAt=K.stream.pos+se[0].length),D(Y)}else{if(V=="number"||V=="string")return K.marked=l?"property":K.style+" property",D(Y);if(V=="jsonld-keyword")return D(Y);if(d&&ze(re))return K.marked="keyword",D(pe);if(V=="[")return D(Fe,je,Ee("]"),Y);if(V=="spread")return D(at,Y);if(re=="*")return K.marked="keyword",D(pe);if(V==":")return oe(Y)}}function ye(V){return V!="variable"?oe(Y):(K.marked="property",D(Yi))}function Y(V){if(V==":")return D(at);if(V=="(")return oe(Yi)}function X(V,re,se){function we(ft,At){if(se?se.indexOf(ft)>-1:ft==","){var It=K.state.lexical;return It.info=="call"&&(It.pos=(It.pos||0)+1),D(function(Cn,Jr){return Cn==re||Jr==re?oe():oe(V)},we)}return ft==re||At==re?D():se&&se.indexOf(";")>-1?oe(V):D(Ee(re))}return function(ft,At){return ft==re||At==re?D():oe(V,we)}}function de(V,re,se){for(var we=3;we"),me);if(V=="quasi")return oe(Ct,Xt)}function Je(V){if(V=="=>")return D(me)}function ct(V){return V.match(/[\}\)\]]/)?D():V==","||V==";"?D(ct):oe(ot,ct)}function ot(V,re){if(V=="variable"||K.style=="keyword")return K.marked="property",D(ot);if(re=="?"||V=="number"||V=="string")return D(ot);if(V==":")return D(me);if(V=="[")return D(Ee("variable"),he,Ee("]"),ot);if(V=="(")return oe(Ji,ot);if(!V.match(/[;\}\)\],]/))return D()}function Ct(V,re){return V!="quasi"?oe():re.slice(re.length-2)!="${"?D(Ct):D(me,yr)}function yr(V){if(V=="}")return K.marked="string-2",K.state.tokenize=I,D(Ct)}function Kt(V,re){return V=="variable"&&K.stream.match(/^\s*[?:]/,!1)||re=="?"?D(Kt):V==":"?D(me):V=="spread"?D(Kt):oe(me)}function Xt(V,re){if(re=="<")return D(Ie(">"),X(me,">"),Be,Xt);if(re=="|"||V=="."||re=="&")return D(me);if(V=="[")return D(me,Ee("]"),Xt);if(re=="extends"||re=="implements")return K.marked="keyword",D(me);if(re=="?")return D(me,Ee(":"),me)}function Gt(V,re){if(re=="<")return D(Ie(">"),X(me,">"),Be,Xt)}function Kn(){return oe(me,Gr)}function Gr(V,re){if(re=="=")return D(me)}function Yr(V,re){return re=="enum"?(K.marked="keyword",D(Rl)):oe(Sn,je,ci,dv)}function Sn(V,re){if(d&&ze(re))return K.marked="keyword",D(Sn);if(V=="variable")return ce(re),D();if(V=="spread")return D(Sn);if(V=="[")return de(fv,"]");if(V=="{")return de(pc,"}")}function pc(V,re){return V=="variable"&&!K.stream.match(/^\s*:/,!1)?(ce(re),D(ci)):(V=="variable"&&(K.marked="property"),V=="spread"?D(Sn):V=="}"?oe():V=="["?D(Fe,Ee("]"),Ee(":"),pc):D(Ee(":"),Sn,ci))}function fv(){return oe(Sn,ci)}function ci(V,re){if(re=="=")return D(at)}function dv(V){if(V==",")return D(Yr)}function Pl(V,re){if(V=="keyword b"&&re=="else")return D(Ie("form","else"),Ze,Be)}function Wd(V,re){if(re=="await")return D(Wd);if(V=="(")return D(Ie(")"),mc,Be)}function mc(V){return V=="var"?D(Yr,us):V=="variable"?D(us):oe(us)}function us(V,re){return V==")"?D():V==";"?D(us):re=="in"||re=="of"?(K.marked="keyword",D(Fe,us)):oe(Fe,us)}function Yi(V,re){if(re=="*")return K.marked="keyword",D(Yi);if(V=="variable")return ce(re),D(Yi);if(V=="(")return D(bt,Ie(")"),X(Ci,")"),Be,Ae,Ze,Xe);if(d&&re=="<")return D(Ie(">"),X(Kn,">"),Be,Yi)}function Ji(V,re){if(re=="*")return K.marked="keyword",D(Ji);if(V=="variable")return ce(re),D(Ji);if(V=="(")return D(bt,Ie(")"),X(Ci,")"),Be,Ae,Xe);if(d&&re=="<")return D(Ie(">"),X(Kn,">"),Be,Ji)}function Ud(V,re){if(V=="keyword"||V=="variable")return K.marked="type",D(Ud);if(re=="<")return D(Ie(">"),X(Kn,">"),Be)}function Ci(V,re){return re=="@"&&D(Fe,Ci),V=="spread"?D(Ci):d&&ze(re)?(K.marked="keyword",D(Ci)):d&&V=="this"?D(je,ci):oe(Sn,je,ci)}function cs(V,re){return V=="variable"?qd(V,re):Dl(V,re)}function qd(V,re){if(V=="variable")return ce(re),D(Dl)}function Dl(V,re){if(re=="<")return D(Ie(">"),X(Kn,">"),Be,Dl);if(re=="extends"||re=="implements"||d&&V==",")return re=="implements"&&(K.marked="keyword"),D(d?me:Fe,Dl);if(V=="{")return D(Ie("}"),Mr,Be)}function Mr(V,re){if(V=="async"||V=="variable"&&(re=="static"||re=="get"||re=="set"||d&&ze(re))&&K.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return K.marked="keyword",D(Mr);if(V=="variable"||K.style=="keyword")return K.marked="property",D(xo,Mr);if(V=="number"||V=="string")return D(xo,Mr);if(V=="[")return D(Fe,je,Ee("]"),xo,Mr);if(re=="*")return K.marked="keyword",D(Mr);if(d&&V=="(")return oe(Ji,Mr);if(V==";"||V==",")return D(Mr);if(V=="}")return D();if(re=="@")return D(Fe,Mr)}function xo(V,re){if(re=="!"||re=="?")return D(xo);if(V==":")return D(me,ci);if(re=="=")return D(at);var se=K.state.lexical.prev,we=se&&se.info=="interface";return oe(we?Ji:Yi)}function fs(V,re){return re=="*"?(K.marked="keyword",D(Ge,Ee(";"))):re=="default"?(K.marked="keyword",D(Fe,Ee(";"))):V=="{"?D(X(Kd,"}"),Ge,Ee(";")):oe(Ze)}function Kd(V,re){if(re=="as")return K.marked="keyword",D(Ee("variable"));if(V=="variable")return oe(at,Kd)}function So(V){return V=="string"?D():V=="("?oe(Fe):V=="."?oe(_e):oe(ds,gc,Ge)}function ds(V,re){return V=="{"?de(ds,"}"):(V=="variable"&&ce(re),re=="*"&&(K.marked="keyword"),D(ln))}function gc(V){if(V==",")return D(ds,gc)}function ln(V,re){if(re=="as")return K.marked="keyword",D(ds)}function Ge(V,re){if(re=="from")return K.marked="keyword",D(Fe)}function Co(V){return V=="]"?D():oe(X(at,"]"))}function Rl(){return oe(Ie("form"),Sn,Ee("{"),Ie("}"),X(fi,"}"),Be,Be)}function fi(){return oe(Sn,ci)}function $t(V,re){return V.lastType=="operator"||V.lastType==","||y.test(re.charAt(0))||/[,.]/.test(re.charAt(0))}function Xi(V,re,se){return re.tokenize==N&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(re.lastType)||re.lastType=="quasi"&&/\{\s*$/.test(V.string.slice(0,V.pos-(se||0)))}return{startState:function(V){var re={tokenize:N,lastType:"sof",cc:[],lexical:new w((V||0)-o,0,"block",!1),localVars:i.localVars,context:i.localVars&&new qe(null,null,!1),indented:V||0};return i.globalVars&&typeof i.globalVars=="object"&&(re.globalVars=i.globalVars),re},token:function(V,re){if(V.sol()&&(re.lexical.hasOwnProperty("align")||(re.lexical.align=!1),re.indented=V.indentation(),P(V,re)),re.tokenize!=H&&V.eatSpace())return null;var se=re.tokenize(V,re);return x=="comment"?se:(re.lastType=x=="operator"&&(k=="++"||k=="--")?"incdec":x,U(re,se,x,k,V))},indent:function(V,re){if(V.tokenize==H||V.tokenize==I)return n.Pass;if(V.tokenize!=N)return 0;var se=re&&re.charAt(0),we=V.lexical,ft;if(!/^\s*else\b/.test(re))for(var At=V.cc.length-1;At>=0;--At){var It=V.cc[At];if(It==Be)we=we.prev;else if(It!=Pl&&It!=Xe)break}for(;(we.type=="stat"||we.type=="form")&&(se=="}"||(ft=V.cc[V.cc.length-1])&&(ft==_e||ft==xe)&&!/^[,\.=+\-*:?[\(]/.test(re));)we=we.prev;s&&we.type==")"&&we.prev.type=="stat"&&(we=we.prev);var Cn=we.type,Jr=se==Cn;return Cn=="vardef"?we.indented+(V.lastType=="operator"||V.lastType==","?we.info.length+1:0):Cn=="form"&&se=="{"?we.indented:Cn=="form"?we.indented+o:Cn=="stat"?we.indented+($t(V,re)?s||o:0):we.info=="switch"&&!Jr&&i.doubleIndentSwitch!=!1?we.indented+(/^(?:case|default)\b/.test(re)?o:2*o):we.align?we.column+(Jr?0:1):we.indented+(Jr?0:o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:u?null:"/*",blockCommentEnd:u?null:"*/",blockCommentContinue:u?null:" * ",lineComment:u?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:u?"json":"javascript",jsonldMode:l,jsonMode:u,expressionAllowed:Xi,skipExpression:function(V){U(V,"atom","atom","true",new n.StringStream("",2,null))}}}),n.registerHelper("wordChars","javascript",/[\w$]/),n.defineMIME("text/javascript","javascript"),n.defineMIME("text/ecmascript","javascript"),n.defineMIME("application/javascript","javascript"),n.defineMIME("application/x-javascript","javascript"),n.defineMIME("application/ecmascript","javascript"),n.defineMIME("application/json",{name:"javascript",json:!0}),n.defineMIME("application/x-json",{name:"javascript",json:!0}),n.defineMIME("application/manifest+json",{name:"javascript",json:!0}),n.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),n.defineMIME("text/typescript",{name:"javascript",typescript:!0}),n.defineMIME("application/typescript",{name:"javascript",typescript:!0})})}()),iA}var sA={},aA;function Pse(){return aA||(aA=1,function(t,e){(function(n){n(Or())})(function(n){n.defineMode("coffeescript",function(r,i){var o="error";function s(w){return new RegExp("^(("+w.join(")|(")+"))\\b")}var l=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/,u=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,f=/^[_A-Za-z$][_A-Za-z$0-9]*/,d=/^@[_A-Za-z$][_A-Za-z$0-9]*/,m=s(["and","or","not","is","isnt","in","instanceof","typeof"]),v=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],y=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","@","throw","when","until","extends"],_=s(v.concat(y));v=s(v);var C=/^('{3}|\"{3}|['\"])/,x=/^(\/{3}|\/)/,k=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],A=s(k);function N(w,R){if(w.sol()){R.scope.align===null&&(R.scope.align=!1);var U=R.scope.offset;if(w.eatSpace()){var K=w.indentation();return K>U&&R.scope.type=="coffee"?"indent":K0&&q(w,R)}if(w.eatSpace())return null;var oe=w.peek();if(w.match("####"))return w.skipToEnd(),"comment";if(w.match("###"))return R.tokenize=H,R.tokenize(w,R);if(oe==="#")return w.skipToEnd(),"comment";if(w.match(/^-?[0-9\.]/,!1)){var D=!1;if(w.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(D=!0),w.match(/^-?\d+\.\d*/)&&(D=!0),w.match(/^-?\.\d+/)&&(D=!0),D)return w.peek()=="."&&w.backUp(1),"number";var ae=!1;if(w.match(/^-?0x[0-9a-f]+/i)&&(ae=!0),w.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(ae=!0),w.match(/^-?0(?![\dx])/i)&&(ae=!0),ae)return"number"}if(w.match(C))return R.tokenize=E(w.current(),!1,"string"),R.tokenize(w,R);if(w.match(x)){if(w.current()!="/"||w.match(/^.*\//,!1))return R.tokenize=E(w.current(),!0,"string-2"),R.tokenize(w,R);w.backUp(1)}return w.match(l)||w.match(m)?"operator":w.match(u)?"punctuation":w.match(A)?"atom":w.match(d)||R.prop&&w.match(f)?"property":w.match(_)?"keyword":w.match(f)?"variable":(w.next(),o)}function E(w,R,U){return function(K,oe){for(;!K.eol();)if(K.eatWhile(/[^'"\/\\]/),K.eat("\\")){if(K.next(),R&&K.eol())return U}else{if(K.match(w))return oe.tokenize=N,U;K.eat(/['"\/]/)}return R&&(i.singleLineStringErrors?U=o:oe.tokenize=N),U}}function H(w,R){for(;!w.eol();){if(w.eatWhile(/[^#]/),w.match("###")){R.tokenize=N;break}w.eatWhile("#")}return"comment"}function I(w,R,U){U=U||"coffee";for(var K=0,oe=!1,D=null,ae=R.scope;ae;ae=ae.prev)if(ae.type==="coffee"||ae.type=="}"){K=ae.offset+r.indentUnit;break}U!=="coffee"?(oe=null,D=w.column()+w.current().length):R.scope.align&&(R.scope.align=!1),R.scope={offset:K,type:U,prev:R.scope,align:oe,alignOffset:D}}function q(w,R){if(R.scope.prev)if(R.scope.type==="coffee"){for(var U=w.indentation(),K=!1,oe=R.scope;oe;oe=oe.prev)if(U===oe.offset){K=!0;break}if(!K)return!0;for(;R.scope.prev&&R.scope.offset!==U;)R.scope=R.scope.prev;return!1}else return R.scope=R.scope.prev,!1}function P(w,R){var U=R.tokenize(w,R),K=w.current();K==="return"&&(R.dedent=!0),((K==="->"||K==="=>")&&w.eol()||U==="indent")&&I(w,R);var oe="[({".indexOf(K);if(oe!==-1&&I(w,R,"])}".slice(oe,oe+1)),v.exec(K)&&I(w,R),K=="then"&&q(w,R),U==="dedent"&&q(w,R))return o;if(oe="])}".indexOf(K),oe!==-1){for(;R.scope.type=="coffee"&&R.scope.prev;)R.scope=R.scope.prev;R.scope.type==K&&(R.scope=R.scope.prev)}return R.dedent&&w.eol()&&(R.scope.type=="coffee"&&R.scope.prev&&(R.scope=R.scope.prev),R.dedent=!1),U}var z={startState:function(w){return{tokenize:N,scope:{offset:w||0,type:"coffee",prev:null,align:!1},prop:!1,dedent:0}},token:function(w,R){var U=R.scope.align===null&&R.scope;U&&w.sol()&&(U.align=!1);var K=P(w,R);return K&&K!="comment"&&(U&&(U.align=!0),R.prop=K=="punctuation"&&w.current()=="."),K},indent:function(w,R){if(w.tokenize!=N)return 0;var U=w.scope,K=R&&"])}".indexOf(R.charAt(0))>-1;if(K)for(;U.type=="coffee"&&U.prev;)U=U.prev;var oe=K&&U.type===R.charAt(0);return U.align?U.alignOffset-(oe?1:0):(oe?U.prev:U).offset},lineComment:"#",fold:"indent"};return z}),n.defineMIME("application/vnd.coffeescript","coffeescript"),n.defineMIME("text/x-coffeescript","coffeescript"),n.defineMIME("text/coffeescript","coffeescript")})}()),sA}var lA={},uA;function cv(){return uA||(uA=1,function(t,e){(function(n){n(Or())})(function(n){n.defineMode("css",function(w,R){var U=R.inline;R.propertyKeywords||(R=n.resolveMode("text/css"));var K=w.indentUnit,oe=R.tokenHooks,D=R.documentTypes||{},ae=R.mediaTypes||{},ce=R.mediaFeatures||{},ve=R.mediaValueKeywords||{},ze=R.propertyKeywords||{},qe=R.nonStandardPropertyKeywords||{},vt=R.fontProperties||{},mt=R.counterDescriptors||{},bt=R.colorKeywords||{},yt=R.valueKeywords||{},Xe=R.allowNested,Ie=R.lineComment,Be=R.supportsAtComponent===!0,Ee=w.highlightNonStandardPropertyKeywords!==!1,Ze,Ke;function Fe(O,j){return Ze=j,O}function at(O,j){var F=O.next();if(oe[F]){var Q=oe[F](O,j);if(Q!==!1)return Q}if(F=="@")return O.eatWhile(/[\w\\\-]/),Fe("def",O.current());if(F=="="||(F=="~"||F=="|")&&O.eat("="))return Fe(null,"compare");if(F=='"'||F=="'")return j.tokenize=ie(F),j.tokenize(O,j);if(F=="#")return O.eatWhile(/[\w\\\-]/),Fe("atom","hash");if(F=="!")return O.match(/^\s*\w*/),Fe("keyword","important");if(/\d/.test(F)||F=="."&&O.eat(/\d/))return O.eatWhile(/[\w.%]/),Fe("number","unit");if(F==="-"){if(/[\d.]/.test(O.peek()))return O.eatWhile(/[\w.%]/),Fe("number","unit");if(O.match(/^-[\w\\\-]*/))return O.eatWhile(/[\w\\\-]/),O.match(/^\s*:/,!1)?Fe("variable-2","variable-definition"):Fe("variable-2","variable");if(O.match(/^\w+-/))return Fe("meta","meta")}else return/[,+>*\/]/.test(F)?Fe(null,"select-op"):F=="."&&O.match(/^-?[_a-z][_a-z0-9-]*/i)?Fe("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(F)?Fe(null,F):O.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(O.current())&&(j.tokenize=ne),Fe("variable callee","variable")):/[\w\\\-]/.test(F)?(O.eatWhile(/[\w\\\-]/),Fe("property","word")):Fe(null,null)}function ie(O){return function(j,F){for(var Q=!1,le;(le=j.next())!=null;){if(le==O&&!Q){O==")"&&j.backUp(1);break}Q=!Q&&le=="\\"}return(le==O||!Q&&O!=")")&&(F.tokenize=null),Fe("string","string")}}function ne(O,j){return O.next(),O.match(/^\s*[\"\')]/,!1)?j.tokenize=null:j.tokenize=ie(")"),Fe(null,"(")}function be(O,j,F){this.type=O,this.indent=j,this.prev=F}function _e(O,j,F,Q){return O.context=new be(F,j.indentation()+(Q===!1?0:K),O.context),F}function xe(O){return O.context.prev&&(O.context=O.context.prev),O.context.type}function G(O,j,F){return W[F.context.type](O,j,F)}function Z(O,j,F,Q){for(var le=Q||1;le>0;le--)F.context=F.context.prev;return G(O,j,F)}function L(O){var j=O.current().toLowerCase();yt.hasOwnProperty(j)?Ke="atom":bt.hasOwnProperty(j)?Ke="keyword":Ke="variable"}var W={};return W.top=function(O,j,F){if(O=="{")return _e(F,j,"block");if(O=="}"&&F.context.prev)return xe(F);if(Be&&/@component/i.test(O))return _e(F,j,"atComponentBlock");if(/^@(-moz-)?document$/i.test(O))return _e(F,j,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(O))return _e(F,j,"atBlock");if(/^@(font-face|counter-style)/i.test(O))return F.stateArg=O,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(O))return"keyframes";if(O&&O.charAt(0)=="@")return _e(F,j,"at");if(O=="hash")Ke="builtin";else if(O=="word")Ke="tag";else{if(O=="variable-definition")return"maybeprop";if(O=="interpolation")return _e(F,j,"interpolation");if(O==":")return"pseudo";if(Xe&&O=="(")return _e(F,j,"parens")}return F.context.type},W.block=function(O,j,F){if(O=="word"){var Q=j.current().toLowerCase();return ze.hasOwnProperty(Q)?(Ke="property","maybeprop"):qe.hasOwnProperty(Q)?(Ke=Ee?"string-2":"property","maybeprop"):Xe?(Ke=j.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(Ke+=" error","maybeprop")}else return O=="meta"?"block":!Xe&&(O=="hash"||O=="qualifier")?(Ke="error","block"):W.top(O,j,F)},W.maybeprop=function(O,j,F){return O==":"?_e(F,j,"prop"):G(O,j,F)},W.prop=function(O,j,F){if(O==";")return xe(F);if(O=="{"&&Xe)return _e(F,j,"propBlock");if(O=="}"||O=="{")return Z(O,j,F);if(O=="(")return _e(F,j,"parens");if(O=="hash"&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(j.current()))Ke+=" error";else if(O=="word")L(j);else if(O=="interpolation")return _e(F,j,"interpolation");return"prop"},W.propBlock=function(O,j,F){return O=="}"?xe(F):O=="word"?(Ke="property","maybeprop"):F.context.type},W.parens=function(O,j,F){return O=="{"||O=="}"?Z(O,j,F):O==")"?xe(F):O=="("?_e(F,j,"parens"):O=="interpolation"?_e(F,j,"interpolation"):(O=="word"&&L(j),"parens")},W.pseudo=function(O,j,F){return O=="meta"?"pseudo":O=="word"?(Ke="variable-3",F.context.type):G(O,j,F)},W.documentTypes=function(O,j,F){return O=="word"&&D.hasOwnProperty(j.current())?(Ke="tag",F.context.type):W.atBlock(O,j,F)},W.atBlock=function(O,j,F){if(O=="(")return _e(F,j,"atBlock_parens");if(O=="}"||O==";")return Z(O,j,F);if(O=="{")return xe(F)&&_e(F,j,Xe?"block":"top");if(O=="interpolation")return _e(F,j,"interpolation");if(O=="word"){var Q=j.current().toLowerCase();Q=="only"||Q=="not"||Q=="and"||Q=="or"?Ke="keyword":ae.hasOwnProperty(Q)?Ke="attribute":ce.hasOwnProperty(Q)?Ke="property":ve.hasOwnProperty(Q)?Ke="keyword":ze.hasOwnProperty(Q)?Ke="property":qe.hasOwnProperty(Q)?Ke=Ee?"string-2":"property":yt.hasOwnProperty(Q)?Ke="atom":bt.hasOwnProperty(Q)?Ke="keyword":Ke="error"}return F.context.type},W.atComponentBlock=function(O,j,F){return O=="}"?Z(O,j,F):O=="{"?xe(F)&&_e(F,j,Xe?"block":"top",!1):(O=="word"&&(Ke="error"),F.context.type)},W.atBlock_parens=function(O,j,F){return O==")"?xe(F):O=="{"||O=="}"?Z(O,j,F,2):W.atBlock(O,j,F)},W.restricted_atBlock_before=function(O,j,F){return O=="{"?_e(F,j,"restricted_atBlock"):O=="word"&&F.stateArg=="@counter-style"?(Ke="variable","restricted_atBlock_before"):G(O,j,F)},W.restricted_atBlock=function(O,j,F){return O=="}"?(F.stateArg=null,xe(F)):O=="word"?(F.stateArg=="@font-face"&&!vt.hasOwnProperty(j.current().toLowerCase())||F.stateArg=="@counter-style"&&!mt.hasOwnProperty(j.current().toLowerCase())?Ke="error":Ke="property","maybeprop"):"restricted_atBlock"},W.keyframes=function(O,j,F){return O=="word"?(Ke="variable","keyframes"):O=="{"?_e(F,j,"top"):G(O,j,F)},W.at=function(O,j,F){return O==";"?xe(F):O=="{"||O=="}"?Z(O,j,F):(O=="word"?Ke="tag":O=="hash"&&(Ke="builtin"),"at")},W.interpolation=function(O,j,F){return O=="}"?xe(F):O=="{"||O==";"?Z(O,j,F):(O=="word"?Ke="variable":O!="variable"&&O!="("&&O!=")"&&(Ke="error"),"interpolation")},{startState:function(O){return{tokenize:null,state:U?"block":"top",stateArg:null,context:new be(U?"block":"top",O||0,null)}},token:function(O,j){if(!j.tokenize&&O.eatSpace())return null;var F=(j.tokenize||at)(O,j);return F&&typeof F=="object"&&(Ze=F[1],F=F[0]),Ke=F,Ze!="comment"&&(j.state=W[j.state](Ze,O,j)),Ke},indent:function(O,j){var F=O.context,Q=j&&j.charAt(0),le=F.indent;return F.type=="prop"&&(Q=="}"||Q==")")&&(F=F.prev),F.prev&&(Q=="}"&&(F.type=="block"||F.type=="top"||F.type=="interpolation"||F.type=="restricted_atBlock")?(F=F.prev,le=F.indent):(Q==")"&&(F.type=="parens"||F.type=="atBlock_parens")||Q=="{"&&(F.type=="at"||F.type=="atBlock"))&&(le=Math.max(0,F.indent-K))),le},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:Ie,fold:"brace"}});function r(w){for(var R={},U=0;U","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"],y=f(v),_=/^::?[a-zA-Z_][\w\-]*/,C;function x(z){return!z.peek()||z.match(/\s+$/,!1)}function k(z,w){var R=z.peek();return R===")"?(z.next(),w.tokenizer=q,"operator"):R==="("?(z.next(),z.eatSpace(),"operator"):R==="'"||R==='"'?(w.tokenizer=N(z.next()),"string"):(w.tokenizer=N(")",!1),"string")}function A(z,w){return function(R,U){return R.sol()&&R.indentation()<=z?(U.tokenizer=q,q(R,U)):(w&&R.skipTo("*/")?(R.next(),R.next(),U.tokenizer=q):R.skipToEnd(),"comment")}}function N(z,w){w==null&&(w=!0);function R(U,K){var oe=U.next(),D=U.peek(),ae=U.string.charAt(U.pos-2),ce=oe!=="\\"&&D===z||oe===z&&ae!=="\\";return ce?(oe!==z&&w&&U.next(),x(U)&&(K.cursorHalf=0),K.tokenizer=q,"string"):oe==="#"&&D==="{"?(K.tokenizer=E(R),U.next(),"operator"):"string"}return R}function E(z){return function(w,R){return w.peek()==="}"?(w.next(),R.tokenizer=z,"operator"):q(w,R)}}function H(z){if(z.indentCount==0){z.indentCount++;var w=z.scopes[0].offset,R=w+r.indentUnit;z.scopes.unshift({offset:R})}}function I(z){z.scopes.length!=1&&z.scopes.shift()}function q(z,w){var R=z.peek();if(z.match("/*"))return w.tokenizer=A(z.indentation(),!0),w.tokenizer(z,w);if(z.match("//"))return w.tokenizer=A(z.indentation(),!1),w.tokenizer(z,w);if(z.match("#{"))return w.tokenizer=E(q),"operator";if(R==='"'||R==="'")return z.next(),w.tokenizer=N(R),"string";if(w.cursorHalf){if(R==="#"&&(z.next(),z.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/))||z.match(/^-?[0-9\.]+/))return x(z)&&(w.cursorHalf=0),"number";if(z.match(/^(px|em|in)\b/))return x(z)&&(w.cursorHalf=0),"unit";if(z.match(m))return x(z)&&(w.cursorHalf=0),"keyword";if(z.match(/^url/)&&z.peek()==="(")return w.tokenizer=k,x(z)&&(w.cursorHalf=0),"atom";if(R==="$")return z.next(),z.eatWhile(/[\w-]/),x(z)&&(w.cursorHalf=0),"variable-2";if(R==="!")return z.next(),w.cursorHalf=0,z.match(/^[\w]+/)?"keyword":"operator";if(z.match(y))return x(z)&&(w.cursorHalf=0),"operator";if(z.eatWhile(/[\w-]/))return x(z)&&(w.cursorHalf=0),C=z.current().toLowerCase(),l.hasOwnProperty(C)?"atom":s.hasOwnProperty(C)?"keyword":o.hasOwnProperty(C)?(w.prevProp=z.current().toLowerCase(),"property"):"tag";if(x(z))return w.cursorHalf=0,null}else{if(R==="-"&&z.match(/^-\w+-/))return"meta";if(R==="."){if(z.next(),z.match(/^[\w-]+/))return H(w),"qualifier";if(z.peek()==="#")return H(w),"tag"}if(R==="#"){if(z.next(),z.match(/^[\w-]+/))return H(w),"builtin";if(z.peek()==="#")return H(w),"tag"}if(R==="$")return z.next(),z.eatWhile(/[\w-]/),"variable-2";if(z.match(/^-?[0-9\.]+/))return"number";if(z.match(/^(px|em|in)\b/))return"unit";if(z.match(m))return"keyword";if(z.match(/^url/)&&z.peek()==="(")return w.tokenizer=k,"atom";if(R==="="&&z.match(/^=[\w-]+/))return H(w),"meta";if(R==="+"&&z.match(/^\+[\w-]+/))return"variable-3";if(R==="@"&&z.match("@extend")&&(z.match(/\s*[\w]/)||I(w)),z.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return H(w),"def";if(R==="@")return z.next(),z.eatWhile(/[\w-]/),"def";if(z.eatWhile(/[\w-]/))if(z.match(/ *: *[\w-\+\$#!\("']/,!1)){C=z.current().toLowerCase();var U=w.prevProp+"-"+C;return o.hasOwnProperty(U)?"property":o.hasOwnProperty(C)?(w.prevProp=C,"property"):u.hasOwnProperty(C)?"property":"tag"}else return z.match(/ *:/,!1)?(H(w),w.cursorHalf=1,w.prevProp=z.current().toLowerCase(),"property"):(z.match(/ *,/,!1)||H(w),"tag");if(R===":")return z.match(_)?"variable-3":(z.next(),w.cursorHalf=1,"operator")}return z.match(y)?"operator":(z.next(),null)}function P(z,w){z.sol()&&(w.indentCount=0);var R=w.tokenizer(z,w),U=z.current();if((U==="@return"||U==="}")&&I(w),R!==null){for(var K=z.pos-U.length,oe=K+r.indentUnit*w.indentCount,D=[],ae=0;ae]=?|\?:|\~)/,ze=k(v),qe=A(y),vt=new RegExp(/^\-(moz|ms|o|webkit)-/i),mt=A(_),bt="",yt={},Xe,Ie,Be,Ee;I.length|~|\/)?\s*[\w-]*([a-z0-9-]|\*|\/\*)(\(|,)?)/),X.context.line.firstWord=bt?bt[0].replace(/^\s*/,""):"",X.context.line.indent=Y.indentation(),Xe=Y.peek(),Y.match("//"))return Y.skipToEnd(),["comment","comment"];if(Y.match("/*"))return X.tokenize=Ke,Ke(Y,X);if(Xe=='"'||Xe=="'")return Y.next(),X.tokenize=Fe(Xe),X.tokenize(Y,X);if(Xe=="@")return Y.next(),Y.eatWhile(/[\w\\-]/),["def",Y.current()];if(Xe=="#"){if(Y.next(),Y.match(/^[0-9a-f]{3}([0-9a-f]([0-9a-f]{2}){0,2})?\b(?!-)/i))return["atom","atom"];if(Y.match(/^[a-z][\w-]*/i))return["builtin","hash"]}return Y.match(vt)?["meta","vendor-prefixes"]:Y.match(/^-?[0-9]?\.?[0-9]/)?(Y.eatWhile(/[a-z%]/i),["number","unit"]):Xe=="!"?(Y.next(),[Y.match(/^(important|optional)/i)?"keyword":"operator","important"]):Xe=="."&&Y.match(/^\.[a-z][\w-]*/i)?["qualifier","qualifier"]:Y.match(oe)?(Y.peek()=="("&&(X.tokenize=at),["property","word"]):Y.match(/^[a-z][\w-]*\(/i)?(Y.backUp(1),["keyword","mixin"]):Y.match(/^(\+|-)[a-z][\w-]*\(/i)?(Y.backUp(1),["keyword","block-mixin"]):Y.string.match(/^\s*&/)&&Y.match(/^[-_]+[a-z][\w-]*/)?["qualifier","qualifier"]:Y.match(/^(\/|&)(-|_|:|\.|#|[a-z])/)?(Y.backUp(1),["variable-3","reference"]):Y.match(/^&{1}\s*$/)?["variable-3","reference"]:Y.match(ze)?["operator","operator"]:Y.match(/^\$?[-_]*[a-z0-9]+[\w-]*/i)?Y.match(/^(\.|\[)[\w-\'\"\]]+/i,!1)&&!G(Y.current())?(Y.match("."),["variable-2","variable-name"]):["variable-2","word"]:Y.match(ve)?["operator",Y.current()]:/[:;,{}\[\]\(\)]/.test(Xe)?(Y.next(),[null,Xe]):(Y.next(),[null,null])}function Ke(Y,X){for(var de=!1,Te;(Te=Y.next())!=null;){if(de&&Te=="/"){X.tokenize=null;break}de=Te=="*"}return["comment","comment"]}function Fe(Y){return function(X,de){for(var Te=!1,je;(je=X.next())!=null;){if(je==Y&&!Te){Y==")"&&X.backUp(1);break}Te=!Te&&je=="\\"}return(je==Y||!Te&&Y!=")")&&(de.tokenize=null),["string","string"]}}function at(Y,X){return Y.next(),Y.match(/\s*[\"\')]/,!1)?X.tokenize=null:X.tokenize=Fe(")"),[null,"("]}function ie(Y,X,de,Te){this.type=Y,this.indent=X,this.prev=de,this.line=Te||{firstWord:"",indent:0}}function ne(Y,X,de,Te){return Te=Te>=0?Te:H,Y.context=new ie(de,X.indentation()+Te,Y.context),de}function be(Y,X){var de=Y.context.indent-H;return X=X||!1,Y.context=Y.context.prev,X&&(Y.context.indent=de),Y.context.type}function _e(Y,X,de){return yt[de.context.type](Y,X,de)}function xe(Y,X,de,Te){for(var je=Te||1;je>0;je--)de.context=de.context.prev;return _e(Y,X,de)}function G(Y){return Y.toLowerCase()in q}function Z(Y){return Y=Y.toLowerCase(),Y in z||Y in ce}function L(Y){return Y.toLowerCase()in qe}function W(Y){return Y.toLowerCase().match(vt)}function O(Y){var X=Y.toLowerCase(),de="variable-2";return G(Y)?de="tag":L(Y)?de="block-keyword":Z(Y)?de="property":X in R||X in mt?de="atom":X=="return"||X in U?de="keyword":Y.match(/^[A-Z]/)&&(de="string"),de}function j(Y,X){return pe(X)&&(Y=="{"||Y=="]"||Y=="hash"||Y=="qualifier")||Y=="block-mixin"}function F(Y,X){return Y=="{"&&X.match(/^\s*\$?[\w-]+/i,!1)}function Q(Y,X){return Y==":"&&X.match(/^[a-z-]+/,!1)}function le(Y){return Y.sol()||Y.string.match(new RegExp("^\\s*"+N(Y.current())))}function pe(Y){return Y.eol()||Y.match(/^\s*$/,!1)}function ye(Y){var X=/^\s*[-_]*[a-z0-9]+[\w-]*/i,de=typeof Y=="string"?Y.match(X):Y.string.match(X);return de?de[0].replace(/^\s*/,""):""}return yt.block=function(Y,X,de){if(Y=="comment"&&le(X)||Y==","&&pe(X)||Y=="mixin")return ne(de,X,"block",0);if(F(Y,X))return ne(de,X,"interpolation");if(pe(X)&&Y=="]"&&!/^\s*(\.|#|:|\[|\*|&)/.test(X.string)&&!G(ye(X)))return ne(de,X,"block",0);if(j(Y,X))return ne(de,X,"block");if(Y=="}"&&pe(X))return ne(de,X,"block",0);if(Y=="variable-name")return X.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/)||L(ye(X))?ne(de,X,"variableName"):ne(de,X,"variableName",0);if(Y=="=")return!pe(X)&&!L(ye(X))?ne(de,X,"block",0):ne(de,X,"block");if(Y=="*"&&(pe(X)||X.match(/\s*(,|\.|#|\[|:|{)/,!1)))return Ee="tag",ne(de,X,"block");if(Q(Y,X))return ne(de,X,"pseudo");if(/@(font-face|media|supports|(-moz-)?document)/.test(Y))return ne(de,X,pe(X)?"block":"atBlock");if(/@(-(moz|ms|o|webkit)-)?keyframes$/.test(Y))return ne(de,X,"keyframes");if(/@extends?/.test(Y))return ne(de,X,"extend",0);if(Y&&Y.charAt(0)=="@")return X.indentation()>0&&Z(X.current().slice(1))?(Ee="variable-2","block"):/(@import|@require|@charset)/.test(Y)?ne(de,X,"block",0):ne(de,X,"block");if(Y=="reference"&&pe(X))return ne(de,X,"block");if(Y=="(")return ne(de,X,"parens");if(Y=="vendor-prefixes")return ne(de,X,"vendorPrefixes");if(Y=="word"){var Te=X.current();if(Ee=O(Te),Ee=="property")return le(X)?ne(de,X,"block",0):(Ee="atom","block");if(Ee=="tag"){if(/embed|menu|pre|progress|sub|table/.test(Te)&&Z(ye(X))||X.string.match(new RegExp("\\[\\s*"+Te+"|"+Te+"\\s*\\]")))return Ee="atom","block";if(P.test(Te)&&(le(X)&&X.string.match(/=/)||!le(X)&&!X.string.match(/^(\s*\.|#|\&|\[|\/|>|\*)/)&&!G(ye(X))))return Ee="variable-2",L(ye(X))?"block":ne(de,X,"block",0);if(pe(X))return ne(de,X,"block")}if(Ee=="block-keyword")return Ee="keyword",X.current(/(if|unless)/)&&!le(X)?"block":ne(de,X,"block");if(Te=="return")return ne(de,X,"block",0);if(Ee=="variable-2"&&X.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/))return ne(de,X,"block")}return de.context.type},yt.parens=function(Y,X,de){if(Y=="(")return ne(de,X,"parens");if(Y==")")return de.context.prev.type=="parens"?be(de):X.string.match(/^[a-z][\w-]*\(/i)&&pe(X)||L(ye(X))||/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(ye(X))||!X.string.match(/^-?[a-z][\w-\.\[\]\'\"]*\s*=/)&&G(ye(X))?ne(de,X,"block"):X.string.match(/^[\$-]?[a-z][\w-\.\[\]\'\"]*\s*=/)||X.string.match(/^\s*(\(|\)|[0-9])/)||X.string.match(/^\s+[a-z][\w-]*\(/i)||X.string.match(/^\s+[\$-]?[a-z]/i)?ne(de,X,"block",0):pe(X)?ne(de,X,"block"):ne(de,X,"block",0);if(Y&&Y.charAt(0)=="@"&&Z(X.current().slice(1))&&(Ee="variable-2"),Y=="word"){var Te=X.current();Ee=O(Te),Ee=="tag"&&P.test(Te)&&(Ee="variable-2"),(Ee=="property"||Te=="to")&&(Ee="atom")}return Y=="variable-name"?ne(de,X,"variableName"):Q(Y,X)?ne(de,X,"pseudo"):de.context.type},yt.vendorPrefixes=function(Y,X,de){return Y=="word"?(Ee="property",ne(de,X,"block",0)):be(de)},yt.pseudo=function(Y,X,de){return Z(ye(X.string))?xe(Y,X,de):(X.match(/^[a-z-]+/),Ee="variable-3",pe(X)?ne(de,X,"block"):be(de))},yt.atBlock=function(Y,X,de){if(Y=="(")return ne(de,X,"atBlock_parens");if(j(Y,X))return ne(de,X,"block");if(F(Y,X))return ne(de,X,"interpolation");if(Y=="word"){var Te=X.current().toLowerCase();if(/^(only|not|and|or)$/.test(Te)?Ee="keyword":K.hasOwnProperty(Te)?Ee="tag":ae.hasOwnProperty(Te)?Ee="attribute":D.hasOwnProperty(Te)?Ee="property":w.hasOwnProperty(Te)?Ee="string-2":Ee=O(X.current()),Ee=="tag"&&pe(X))return ne(de,X,"block")}return Y=="operator"&&/^(not|and|or)$/.test(X.current())&&(Ee="keyword"),de.context.type},yt.atBlock_parens=function(Y,X,de){if(Y=="{"||Y=="}")return de.context.type;if(Y==")")return pe(X)?ne(de,X,"block"):ne(de,X,"atBlock");if(Y=="word"){var Te=X.current().toLowerCase();return Ee=O(Te),/^(max|min)/.test(Te)&&(Ee="property"),Ee=="tag"&&(P.test(Te)?Ee="variable-2":Ee="atom"),de.context.type}return yt.atBlock(Y,X,de)},yt.keyframes=function(Y,X,de){return X.indentation()=="0"&&(Y=="}"&&le(X)||Y=="]"||Y=="hash"||Y=="qualifier"||G(X.current()))?xe(Y,X,de):Y=="{"?ne(de,X,"keyframes"):Y=="}"?le(X)?be(de,!0):ne(de,X,"keyframes"):Y=="unit"&&/^[0-9]+\%$/.test(X.current())?ne(de,X,"keyframes"):Y=="word"&&(Ee=O(X.current()),Ee=="block-keyword")?(Ee="keyword",ne(de,X,"keyframes")):/@(font-face|media|supports|(-moz-)?document)/.test(Y)?ne(de,X,pe(X)?"block":"atBlock"):Y=="mixin"?ne(de,X,"block",0):de.context.type},yt.interpolation=function(Y,X,de){return Y=="{"&&be(de)&&ne(de,X,"block"),Y=="}"?X.string.match(/^\s*(\.|#|:|\[|\*|&|>|~|\+|\/)/i)||X.string.match(/^\s*[a-z]/i)&&G(ye(X))?ne(de,X,"block"):!X.string.match(/^(\{|\s*\&)/)||X.match(/\s*[\w-]/,!1)?ne(de,X,"block",0):ne(de,X,"block"):Y=="variable-name"?ne(de,X,"variableName",0):(Y=="word"&&(Ee=O(X.current()),Ee=="tag"&&(Ee="atom")),de.context.type)},yt.extend=function(Y,X,de){return Y=="["||Y=="="?"extend":Y=="]"?be(de):Y=="word"?(Ee=O(X.current()),"extend"):be(de)},yt.variableName=function(Y,X,de){return Y=="string"||Y=="["||Y=="]"||X.current().match(/^(\.|\$)/)?(X.current().match(/^\.[\w-]+/i)&&(Ee="variable-2"),"variableName"):xe(Y,X,de)},{startState:function(Y){return{tokenize:null,state:"block",context:new ie("block",Y||0,null)}},token:function(Y,X){return!X.tokenize&&Y.eatSpace()?null:(Ie=(X.tokenize||Ze)(Y,X),Ie&&typeof Ie=="object"&&(Be=Ie[1],Ie=Ie[0]),Ee=Ie,X.state=yt[X.state](Be,Y,X),Ee)},indent:function(Y,X,de){var Te=Y.context,je=X&&X.charAt(0),he=Te.indent,Ae=ye(X),Le=de.match(/^\s*/)[0].replace(/\t/g,I).length,me=Y.context.prev?Y.context.prev.line.firstWord:"",Je=Y.context.prev?Y.context.prev.line.indent:Le;return Te.prev&&(je=="}"&&(Te.type=="block"||Te.type=="atBlock"||Te.type=="keyframes")||je==")"&&(Te.type=="parens"||Te.type=="atBlock_parens")||je=="{"&&Te.type=="at")?he=Te.indent-H:/(\})/.test(je)||(/@|\$|\d/.test(je)||/^\{/.test(X)||/^\s*\/(\/|\*)/.test(X)||/^\s*\/\*/.test(me)||/^\s*[\w-\.\[\]\'\"]+\s*(\?|:|\+)?=/i.test(X)||/^(\+|-)?[a-z][\w-]*\(/i.test(X)||/^return/.test(X)||L(Ae)?he=Le:/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(je)||G(Ae)?/\,\s*$/.test(me)?he=Je:/^\s+/.test(de)&&(/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(me)||G(me))?he=Le<=Je?Je:Je+H:he=Le:!/,\s*$/.test(de)&&(W(Ae)||Z(Ae))&&(L(me)?he=Le<=Je?Je:Je+H:/^\{/.test(me)?he=Le<=Je?Le:Je+H:W(me)||Z(me)?he=Le>=Je?Je:Le:/^(\.|#|:|\[|\*|&|@|\+|\-|>|~|\/)/.test(me)||/=\s*$/.test(me)||G(me)||/^\$[\w-\.\[\]\'\"]/.test(me)?he=Je+H:he=Le)),he},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"indent"}});var r=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","bgsound","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","nobr","noframes","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","var","video"],i=["domain","regexp","url-prefix","url"],o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],s=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","dynamic-range","video-dynamic-range"],l=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode","font-smoothing","osx-font-smoothing"],u=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],f=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],d=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],m=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","high","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","standard","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small","bicubic","optimizespeed","grayscale","row","row-reverse","wrap","wrap-reverse","column-reverse","flex-start","flex-end","space-between","space-around","unset"],v=["in","and","or","not","is not","is a","is","isnt","defined","if unless"],y=["for","if","else","unless","from","to"],_=["null","true","false","href","title","type","not-allowed","readonly","disabled"],C=["@font-face","@keyframes","@media","@viewport","@page","@host","@supports","@block","@css"],x=r.concat(i,o,s,l,u,d,m,f,v,y,_,C);function k(E){return E=E.sort(function(H,I){return I>H}),new RegExp("^(("+E.join(")|(")+"))\\b")}function A(E){for(var H={},I=0;I-1?m.backUp(_.length-C):_.match(/<\/?$/)&&(m.backUp(_.length),m.match(v,!1)||m.match(_)),y}var o={};function s(m){var v=o[m];return v||(o[m]=new RegExp("\\s+"+m+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function l(m,v){var y=m.match(s(v));return y?/^\s*(.*?)\s*$/.exec(y[2])[1]:""}function u(m,v){return new RegExp((v?"^":"")+"","i")}function f(m,v){for(var y in m)for(var _=v[y]||(v[y]=[]),C=m[y],x=C.length-1;x>=0;x--)_.unshift(C[x])}function d(m,v){for(var y=0;y=0;k--)_.script.unshift(["type",x[k].matches,x[k].mode]);function A(N,E){var H=y.token(N,E.htmlState),I=/\btag\b/.test(H),q;if(I&&!/[<>\s\/]/.test(N.current())&&(q=E.htmlState.tagName&&E.htmlState.tagName.toLowerCase())&&_.hasOwnProperty(q))E.inTag=q+" ";else if(E.inTag&&I&&/>$/.test(N.current())){var P=/^([\S]+) (.*)/.exec(E.inTag);E.inTag=null;var z=N.current()==">"&&d(_[P[1]],P[2]),w=n.getMode(m,z),R=u(P[1],!0),U=u(P[1],!1);E.token=function(K,oe){return K.match(R,!1)?(oe.token=A,oe.localState=oe.localMode=null,null):i(K,U,oe.localMode.token(K,oe.localState))},E.localMode=w,E.localState=n.startState(w,y.indent(E.htmlState,"",""))}else E.inTag&&(E.inTag+=N.current(),N.eol()&&(E.inTag+=" "));return H}return{startState:function(){var N=n.startState(y);return{token:A,inTag:null,localMode:null,localState:null,htmlState:N}},copyState:function(N){var E;return N.localState&&(E=n.copyState(N.localMode,N.localState)),{token:N.token,inTag:N.inTag,localMode:N.localMode,localState:E,htmlState:n.copyState(y,N.htmlState)}},token:function(N,E){return E.token(N,E)},indent:function(N,E,H){return!N.localMode||/^\s*<\//.test(E)?y.indent(N.htmlState,E,H):N.localMode.indent?N.localMode.indent(N.localState,E,H):n.Pass},innerMode:function(N){return{state:N.localState||N.htmlState,mode:N.localMode||y}}}},"xml","javascript","css"),n.defineMIME("text/html","htmlmixed")})}()),mA}var vA;function Bse(){return vA||(vA=1,function(t,e){(function(n){n(Or(),Gw(),cv(),zse())})(function(n){n.defineMode("pug",function(r){var i="keyword",o="meta",s="builtin",l="qualifier",u={"{":"}","(":")","[":"]"},f=n.getMode(r,"javascript");function d(){this.javaScriptLine=!1,this.javaScriptLineExcludesColon=!1,this.javaScriptArguments=!1,this.javaScriptArgumentsDepth=0,this.isInterpolating=!1,this.interpolationNesting=0,this.jsState=n.startState(f),this.restOfLine="",this.isIncludeFiltered=!1,this.isEach=!1,this.lastTag="",this.scriptType="",this.isAttrs=!1,this.attrsNest=[],this.inAttributeName=!0,this.attributeIsType=!1,this.attrValue="",this.indentOf=1/0,this.indentToken="",this.innerMode=null,this.innerState=null,this.innerModeForLine=!1}d.prototype.copy=function(){var G=new d;return G.javaScriptLine=this.javaScriptLine,G.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon,G.javaScriptArguments=this.javaScriptArguments,G.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth,G.isInterpolating=this.isInterpolating,G.interpolationNesting=this.interpolationNesting,G.jsState=n.copyState(f,this.jsState),G.innerMode=this.innerMode,this.innerMode&&this.innerState&&(G.innerState=n.copyState(this.innerMode,this.innerState)),G.restOfLine=this.restOfLine,G.isIncludeFiltered=this.isIncludeFiltered,G.isEach=this.isEach,G.lastTag=this.lastTag,G.scriptType=this.scriptType,G.isAttrs=this.isAttrs,G.attrsNest=this.attrsNest.slice(),G.inAttributeName=this.inAttributeName,G.attributeIsType=this.attributeIsType,G.attrValue=this.attrValue,G.indentOf=this.indentOf,G.indentToken=this.indentToken,G.innerModeForLine=this.innerModeForLine,G};function m(G,Z){if(G.sol()&&(Z.javaScriptLine=!1,Z.javaScriptLineExcludesColon=!1),Z.javaScriptLine){if(Z.javaScriptLineExcludesColon&&G.peek()===":"){Z.javaScriptLine=!1,Z.javaScriptLineExcludesColon=!1;return}var L=f.token(G,Z.jsState);return G.eol()&&(Z.javaScriptLine=!1),L||!0}}function v(G,Z){if(Z.javaScriptArguments){if(Z.javaScriptArgumentsDepth===0&&G.peek()!=="("){Z.javaScriptArguments=!1;return}if(G.peek()==="("?Z.javaScriptArgumentsDepth++:G.peek()===")"&&Z.javaScriptArgumentsDepth--,Z.javaScriptArgumentsDepth===0){Z.javaScriptArguments=!1;return}var L=f.token(G,Z.jsState);return L||!0}}function y(G){if(G.match(/^yield\b/))return"keyword"}function _(G){if(G.match(/^(?:doctype) *([^\n]+)?/))return o}function C(G,Z){if(G.match("#{"))return Z.isInterpolating=!0,Z.interpolationNesting=0,"punctuation"}function x(G,Z){if(Z.isInterpolating){if(G.peek()==="}"){if(Z.interpolationNesting--,Z.interpolationNesting<0)return G.next(),Z.isInterpolating=!1,"punctuation"}else G.peek()==="{"&&Z.interpolationNesting++;return f.token(G,Z.jsState)||!0}}function k(G,Z){if(G.match(/^case\b/))return Z.javaScriptLine=!0,i}function A(G,Z){if(G.match(/^when\b/))return Z.javaScriptLine=!0,Z.javaScriptLineExcludesColon=!0,i}function N(G){if(G.match(/^default\b/))return i}function E(G,Z){if(G.match(/^extends?\b/))return Z.restOfLine="string",i}function H(G,Z){if(G.match(/^append\b/))return Z.restOfLine="variable",i}function I(G,Z){if(G.match(/^prepend\b/))return Z.restOfLine="variable",i}function q(G,Z){if(G.match(/^block\b *(?:(prepend|append)\b)?/))return Z.restOfLine="variable",i}function P(G,Z){if(G.match(/^include\b/))return Z.restOfLine="string",i}function z(G,Z){if(G.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&G.match("include"))return Z.isIncludeFiltered=!0,i}function w(G,Z){if(Z.isIncludeFiltered){var L=ze(G,Z);return Z.isIncludeFiltered=!1,Z.restOfLine="string",L}}function R(G,Z){if(G.match(/^mixin\b/))return Z.javaScriptLine=!0,i}function U(G,Z){if(G.match(/^\+([-\w]+)/))return G.match(/^\( *[-\w]+ *=/,!1)||(Z.javaScriptArguments=!0,Z.javaScriptArgumentsDepth=0),"variable";if(G.match("+#{",!1))return G.next(),Z.mixinCallAfter=!0,C(G,Z)}function K(G,Z){if(Z.mixinCallAfter)return Z.mixinCallAfter=!1,G.match(/^\( *[-\w]+ *=/,!1)||(Z.javaScriptArguments=!0,Z.javaScriptArgumentsDepth=0),!0}function oe(G,Z){if(G.match(/^(if|unless|else if|else)\b/))return Z.javaScriptLine=!0,i}function D(G,Z){if(G.match(/^(- *)?(each|for)\b/))return Z.isEach=!0,i}function ae(G,Z){if(Z.isEach){if(G.match(/^ in\b/))return Z.javaScriptLine=!0,Z.isEach=!1,i;if(G.sol()||G.eol())Z.isEach=!1;else if(G.next()){for(;!G.match(/^ in\b/,!1)&&G.next(););return"variable"}}}function ce(G,Z){if(G.match(/^while\b/))return Z.javaScriptLine=!0,i}function ve(G,Z){var L;if(L=G.match(/^(\w(?:[-:\w]*\w)?)\/?/))return Z.lastTag=L[1].toLowerCase(),Z.lastTag==="script"&&(Z.scriptType="application/javascript"),"tag"}function ze(G,Z){if(G.match(/^:([\w\-]+)/)){var L;return r&&r.innerModes&&(L=r.innerModes(G.current().substring(1))),L||(L=G.current().substring(1)),typeof L=="string"&&(L=n.getMode(r,L)),at(G,Z,L),"atom"}}function qe(G,Z){if(G.match(/^(!?=|-)/))return Z.javaScriptLine=!0,"punctuation"}function vt(G){if(G.match(/^#([\w-]+)/))return s}function mt(G){if(G.match(/^\.([\w-]+)/))return l}function bt(G,Z){if(G.peek()=="(")return G.next(),Z.isAttrs=!0,Z.attrsNest=[],Z.inAttributeName=!0,Z.attrValue="",Z.attributeIsType=!1,"punctuation"}function yt(G,Z){if(Z.isAttrs){if(u[G.peek()]&&Z.attrsNest.push(u[G.peek()]),Z.attrsNest[Z.attrsNest.length-1]===G.peek())Z.attrsNest.pop();else if(G.eat(")"))return Z.isAttrs=!1,"punctuation";if(Z.inAttributeName&&G.match(/^[^=,\)!]+/))return(G.peek()==="="||G.peek()==="!")&&(Z.inAttributeName=!1,Z.jsState=n.startState(f),Z.lastTag==="script"&&G.current().trim().toLowerCase()==="type"?Z.attributeIsType=!0:Z.attributeIsType=!1),"attribute";var L=f.token(G,Z.jsState);if(Z.attributeIsType&&L==="string"&&(Z.scriptType=G.current().toString()),Z.attrsNest.length===0&&(L==="string"||L==="variable"||L==="keyword"))try{return Function("","var x "+Z.attrValue.replace(/,\s*$/,"").replace(/^!/,"")),Z.inAttributeName=!0,Z.attrValue="",G.backUp(G.current().length),yt(G,Z)}catch{}return Z.attrValue+=G.current(),L||!0}}function Xe(G,Z){if(G.match(/^&attributes\b/))return Z.javaScriptArguments=!0,Z.javaScriptArgumentsDepth=0,"keyword"}function Ie(G){if(G.sol()&&G.eatSpace())return"indent"}function Be(G,Z){if(G.match(/^ *\/\/(-)?([^\n]*)/))return Z.indentOf=G.indentation(),Z.indentToken="comment","comment"}function Ee(G){if(G.match(/^: */))return"colon"}function Ze(G,Z){if(G.match(/^(?:\| ?| )([^\n]+)/))return"string";if(G.match(/^(<[^\n]*)/,!1))return at(G,Z,"htmlmixed"),Z.innerModeForLine=!0,ie(G,Z,!0)}function Ke(G,Z){if(G.eat(".")){var L=null;return Z.lastTag==="script"&&Z.scriptType.toLowerCase().indexOf("javascript")!=-1?L=Z.scriptType.toLowerCase().replace(/"|'/g,""):Z.lastTag==="style"&&(L="css"),at(G,Z,L),"dot"}}function Fe(G){return G.next(),null}function at(G,Z,L){L=n.mimeModes[L]||L,L=r.innerModes&&r.innerModes(L)||L,L=n.mimeModes[L]||L,L=n.getMode(r,L),Z.indentOf=G.indentation(),L&&L.name!=="null"?Z.innerMode=L:Z.indentToken="string"}function ie(G,Z,L){if(G.indentation()>Z.indentOf||Z.innerModeForLine&&!G.sol()||L)return Z.innerMode?(Z.innerState||(Z.innerState=Z.innerMode.startState?n.startState(Z.innerMode,G.indentation()):{}),G.hideFirstChars(Z.indentOf+2,function(){return Z.innerMode.token(G,Z.innerState)||!0})):(G.skipToEnd(),Z.indentToken);G.sol()&&(Z.indentOf=1/0,Z.indentToken=null,Z.innerMode=null,Z.innerState=null)}function ne(G,Z){if(G.sol()&&(Z.restOfLine=""),Z.restOfLine){G.skipToEnd();var L=Z.restOfLine;return Z.restOfLine="",L}}function be(){return new d}function _e(G){return G.copy()}function xe(G,Z){var L=ie(G,Z)||ne(G,Z)||x(G,Z)||w(G,Z)||ae(G,Z)||yt(G,Z)||m(G,Z)||v(G,Z)||K(G,Z)||y(G)||_(G)||C(G,Z)||k(G,Z)||A(G,Z)||N(G)||E(G,Z)||H(G,Z)||I(G,Z)||q(G,Z)||P(G,Z)||z(G,Z)||R(G,Z)||U(G,Z)||oe(G,Z)||D(G,Z)||ce(G,Z)||ve(G,Z)||ze(G,Z)||qe(G,Z)||vt(G)||mt(G)||bt(G,Z)||Xe(G,Z)||Ie(G)||Ze(G,Z)||Be(G,Z)||Ee(G)||Ke(G,Z)||Fe(G);return L===!0?null:L}return{startState:be,copyState:_e,token:xe}},"javascript","css","htmlmixed"),n.defineMIME("text/x-pug","pug"),n.defineMIME("text/x-jade","pug")})}()),pA}var yA={},bA={},_A;function $se(){return _A||(_A=1,function(t,e){(function(n){n(Or())})(function(n){n.multiplexingMode=function(r){var i=Array.prototype.slice.call(arguments,1);function o(s,l,u,f){if(typeof l=="string"){var d=s.indexOf(l,u);return f&&d>-1?d+l.length:d}var m=l.exec(u?s.slice(u):s);return m?m.index+u+(f?m[0].length:0):-1}return{startState:function(){return{outer:n.startState(r),innerActive:null,inner:null,startingInner:!1}},copyState:function(s){return{outer:n.copyState(r,s.outer),innerActive:s.innerActive,inner:s.innerActive&&n.copyState(s.innerActive.mode,s.inner),startingInner:s.startingInner}},token:function(s,l){if(l.innerActive){var x=l.innerActive,f=s.string;if(!x.close&&s.sol())return l.innerActive=l.inner=null,this.token(s,l);var v=x.close&&!l.startingInner?o(f,x.close,s.pos,x.parseDelimiters):-1;if(v==s.pos&&!x.parseDelimiters)return s.match(x.close),l.innerActive=l.inner=null,x.delimStyle&&x.delimStyle+" "+x.delimStyle+"-close";v>-1&&(s.string=f.slice(0,v));var k=x.mode.token(s,l.inner);return v>-1?s.string=f:s.pos>s.start&&(l.startingInner=!1),v==s.pos&&x.parseDelimiters&&(l.innerActive=l.inner=null),x.innerStyle&&(k?k=k+" "+x.innerStyle:k=x.innerStyle),k}else{for(var u=1/0,f=s.string,d=0;d|[#\/]([A-Za-z_]\w*)/,token:"keyword"},{regex:/(?:else|this)\b/,token:"keyword"},{regex:/\d+/i,token:"number"},{regex:/=|~|@|true|false/,token:"atom"},{regex:/(?:\.\.\/)*(?:[A-Za-z_][\w\.]*)+/,token:"variable-2"}],dash_comment:[{regex:/--\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}],comment:[{regex:/\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}],meta:{blockCommentStart:"{{--",blockCommentEnd:"--}}"}}),n.defineMode("handlebars",function(r,i){var o=n.getMode(r,"handlebars-tags");return!i||!i.base?o:n.multiplexingMode(n.getMode(r,i.base),{open:"{{",close:/\}\}\}?/,mode:o,parseDelimiters:!0})}),n.defineMIME("text/x-handlebars-template","handlebars")})}()),yA}(function(t,e){(function(n){n(Or(),Ise(),FN(),Gw(),Pse(),cv(),Dse(),Rse(),Bse(),Hse())})(function(n){var r={script:[["lang",/coffee(script)?/,"coffeescript"],["type",/^(?:text|application)\/(?:x-)?coffee(?:script)?$/,"coffeescript"],["lang",/^babel$/,"javascript"],["type",/^text\/babel$/,"javascript"],["type",/^text\/ecmascript-\d+$/,"javascript"]],style:[["lang",/^stylus$/i,"stylus"],["lang",/^sass$/i,"sass"],["lang",/^less$/i,"text/x-less"],["lang",/^scss$/i,"text/x-scss"],["type",/^(text\/)?(x-)?styl(us)?$/i,"stylus"],["type",/^text\/sass/i,"sass"],["type",/^(text\/)?(x-)?scss$/i,"text/x-scss"],["type",/^(text\/)?(x-)?less$/i,"text/x-less"]],template:[["lang",/^vue-template$/i,"vue"],["lang",/^pug$/i,"pug"],["lang",/^handlebars$/i,"handlebars"],["type",/^(text\/)?(x-)?pug$/i,"pug"],["type",/^text\/x-handlebars-template$/i,"handlebars"],[null,null,"vue-template"]]};n.defineMode("vue-template",function(i,o){var s={token:function(l){if(l.match(/^\{\{.*?\}\}/))return"meta mustache";for(;l.next()&&!l.match("{{",!1););return null}};return n.overlayMode(n.getMode(i,o.backdrop||"text/html"),s)}),n.defineMode("vue",function(i){return n.getMode(i,{name:"htmlmixed",tags:r})},"htmlmixed","xml","javascript","coffeescript","css","sass","stylus","pug","handlebars"),n.defineMIME("script/x-vue","vue"),n.defineMIME("text/x-vue","vue")})})();const Fse={name:"CodeEditor",components:{Codemirror:vse},props:{field:{type:Object,default:null},editor:{type:Object,default:null},visible:{type:Boolean,default:!1},modelValue:{type:String,default:""}},emits:["update:modelValue"],data(){return{proxyValue:"",options:{theme:"material",mode:"htmlmixed",htmlMode:!0,lineNumbers:!0,lineWrapping:!0,indentUnit:4}}},watch:{visible(t){t&&(this.proxyValue=Nse.html(this.modelValue,{indent_size:4})),this.resizeHandler()},proxyValue(t){this.$emit("update:modelValue",t)}},created(){this.editor.on("resize",this.resizeHandler.bind(this))},methods:{resizeHandler(){this.visible&&this.$nextTick(()=>{const{width:t,height:e}=this.editor.view.dom.getBoundingClientRect();this.$el.style.width=`${t}px`,this.$el.style.height=`${e}px`})}}};function Vse(t,e,n,r,i,o){const s=ut("Codemirror");return n.visible?(ge(),Et(s,{key:0,value:i.proxyValue,"onUpdate:value":e[0]||(e[0]=l=>i.proxyValue=l),class:"vui-code-editor",options:i.options},null,8,["value","options"])):_t("",!0)}const jse=Bt(Fse,[["render",Vse]]),Wse={name:"VizyInput",components:{EditorContent:AQ,MenuBar:Soe,BlockPicker:Woe,CodeEditor:jse},props:{name:{type:String,required:!0,default:""},settings:{type:Object,default:()=>{}},value:{type:[String,Array],required:!0,default:""}},data(){return{isLivePreview:!1,mounted:!1,buttons:["bold","italic"],showCodeEditor:!1,codeEditorHtml:"",editor:null,json:null,html:null,parentToolbarOffset:0,cachedFieldHtml:{},cachedFieldJs:{},renderedJsCache:{},selectedBlockType:null,currentNodeHoverPosition:null,listenForChanges:!1}},computed:{jsonContent(){return this.contentToValue(this.json)},toolbarFixed(){return this.settings.vizyConfig.toolbarFixed},isRoot(){return this.settings.isRoot},supportedBlockTypes(){const t=[];return this.settings.blockGroups.forEach(e=>{e.blockTypes.forEach(n=>{t.push(n.id)})}),t},blocksEnabled(){return this.settings.editorMode!=="richText"},richTextEnabled(){return this.settings.editorMode!=="blocks"}},watch:{codeEditorHtml(t){this.editor.chain().setContent(t,!0).run()}},mounted(){this.editor=new EQ({extensions:this.getExtensions(),content:this.valueToContent(this.clone(this.value)),autofocus:!1,onUpdate:()=>{this.json=this.editor.getJSON().content,this.html=this.editor.getHTML()},editorProps:{transformPastedHTML:t=>{if(this.settings.pasteAsPlainText){const e=document.createElement("div");return e.innerHTML=t,e.textContent||e.innerText||""}return t},handleDrop:(t,e,n,r)=>!this.selectedBlockType,handleKeyDown:(t,e)=>{if(!this.richTextEnabled)return!["/","Backspace","Delete","Enter","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key)},handlePaste:(t,e)=>{if(!this.richTextEnabled)return!0}}}),this.editor.vizyField=this,this.json=this.editor.getJSON().content,this.html=this.editor.getHTML(),this.json.forEach(t=>{if(t.type==="vizyBlock"){const{id:e}=t.attrs,n=gb(this.settings.blocks,{id:e});n&&(this.setCachedFieldHtml(e,n.fieldsHtml),this.setCachedFieldJs(e,n.footHtml))}}),this.$nextTick(()=>{if(this.mounted=!0,this.toolbarFixed){window.addEventListener("scroll",this.updateFixedToolbar),window.addEventListener("resize",this.updateFixedToolbar);const t=document.querySelector(".slideout[data-element-editor].so-visible .so-body");t&&(t.addEventListener("scroll",this.updateFixedToolbarEditor),t.addEventListener("resize",this.updateFixedToolbarEditor)),Garnish.on(Craft.Preview,"open",this.openLivePreviewCallback),Garnish.on(Craft.LivePreview,"enter",this.openLivePreviewCallback),Garnish.on(Craft.Preview,"close",this.closeLivePreviewCallback),Garnish.on(Craft.LivePreview,"exit",this.closeLivePreviewCallback)}this.editor.on("vui:code-editor-toggle",this.setCodeEditor)}),this.getParentInputs(this.$el).forEach(t=>{t.$refs.toolbar&&(this.parentToolbarOffset+=t.$refs.toolbar.$el.offsetHeight)}),this.refreshUnloadData()},created(){this.settings.vizyConfig.buttons&&(this.buttons=this.settings.vizyConfig.buttons)},beforeUnmount(){this.editor.destroy()},methods:{getExtensions(){let t=[WY,sX.configure({color:"#3778eb",width:3}),pX,UY,rX,lee,XY,rte.configure({suggestion:vre})];const e=Craft.Vizy.Config.getExtensions(),n=[Qee];return this.richTextEnabled&&(t=t.concat(e)),this.blocksEnabled&&(t=t.concat(n)),t=t.concat(yre(this)),t},setCodeEditor(){this.showCodeEditor?this.editor.chain().setContent(this.codeEditorHtml,!0).run():this.codeEditorHtml=this.editor.getHTML(),this.showCodeEditor=!this.showCodeEditor},valueToContent(t){if(!t)return null;if(!Array.isArray(t))try{t=JSON.parse(t)}catch(e){console.log(e)}return t=this.decodeHtml(t),t.length?{type:"doc",content:t}:null},decodeHtml(t){Array.isArray(t)&&(t=JSON.stringify(t));const e=document.createElement("textarea");return e.innerHTML=t,JSON.parse(e.value)},contentToValue(t){return t&&Array.isArray(t)&&t.length===1&&t[0].type==="paragraph"&&!t[0].content?null:JSON.stringify(t)},getParsedBlockHtml(t,e){return typeof t=="string"?t.replace(new RegExp(`__VIZY_BLOCK_${this.settings.placeholderKey}__`,"g"),e):""},getCachedFieldHtml(t){let e=this.cachedFieldHtml[t];return typeof e=="string"&&(e=e.replace(/&#(\d+);/g,(n,r)=>String.fromCharCode(r))),this.getParsedBlockHtml(e,t)},setCachedFieldHtml(t,e){this.cachedFieldHtml[t]=e},getCachedFieldJs(t){let e=this.cachedFieldJs[t];typeof e=="string"&&(e=e.replace(/&#(\d+);/g,(r,i)=>String.fromCharCode(i)));let n=this.getParsedBlockHtml(e,t);return this.renderedJsCache[t]&&(n=n.replace(/(superTableInput.addRow.*?;)/g,"null")),this.renderedJsCache[t]=n,n},setCachedFieldJs(t,e){this.cachedFieldJs[t]=e},getBlockSettings(t){return gb(this.settings.blocks,{id:t})||{}},openLivePreviewCallback(){this.isLivePreview=!0;const t=document.querySelector(".lp-editor-container .lp-editor");t&&(t.addEventListener("scroll",this.updateFixedToolbar),t.addEventListener("resize",this.updateFixedToolbar))},closeLivePreviewCallback(){this.isLivePreview=!1},updateFixedToolbar(t){let e=document.querySelector("body.fixed-header #header")?document.querySelector("body.fixed-header #header").offsetHeight:0;this.isLivePreview&&(e=document.querySelector(".lp-editor-container header.flex")?document.querySelector(".lp-editor-container header.flex").offsetHeight-parseFloat(window.getComputedStyle(document.querySelector(".lp-editor-container .lp-editor"),null).getPropertyValue("padding-top")):0),e=e+this.parentToolbarOffset,this.$refs.toolbar&&(this.$refs.toolbar.$el.style.position="sticky",this.$refs.toolbar.$el.style.top=`${this.$el.scrollTop+e}px`)},updateFixedToolbarEditor(t){let e=-24;e=e+this.parentToolbarOffset,this.$refs.toolbar&&(this.$refs.toolbar.$el.style.position="sticky",this.$refs.toolbar.$el.style.top=`${this.$el.scrollTop+e}px`)},getParentInputs(){const t=[];let e=this;for(;e;)e.$options.name==="VizyInput"&&t.push(e),e=e.$parent;return t},refreshUnloadData(){setTimeout(()=>{if(Qn(this.editor,"storage.vizyBlock.isNew"))return;const t=$("form#main-form");if(t.length){const e=t.data("elementEditor");if(e){const n=e.serializeForm(!0);e.lastSerializedValue=n,t.data("initialSerializedValue",n)}}},500)},isFocused(){return this.editor.isFocused&&!this.editor.isActive("vizyBlock")}}},Use={key:1,class:"input text",style:{"margin-top":"20px"}},qse=["name","value"];function Kse(t,e,n,r,i,o){const s=ut("menu-bar"),l=ut("code-editor"),u=ut("editor-content"),f=ut("block-picker");return ge(),Se("div",{onClick:e[1]||(e[1]=d=>i.listenForChanges=!0)},[i.editor?(ge(),Se("div",{key:0,class:gt(["vui-rich-text",{"has-focus":o.isFocused()}]),style:oi({"--rows":n.settings.initialRows})},[i.buttons.length&&o.richTextEnabled?(ge(),Et(s,{key:0,ref:"toolbar",buttons:i.buttons,editor:i.editor,field:this},null,8,["buttons","editor"])):_t("",!0),o.richTextEnabled?(ge(),Et(l,{key:1,modelValue:i.codeEditorHtml,"onUpdate:modelValue":e[0]||(e[0]=d=>i.codeEditorHtml=d),visible:i.showCodeEditor,editor:i.editor,field:this},null,8,["modelValue","visible","editor"])):_t("",!0),Qe(u,{class:gt([{"code-view":i.showCodeEditor},"vui-editor"]),editor:i.editor},null,8,["class","editor"]),o.blocksEnabled?(ge(),Et(f,{key:2,editor:i.editor,field:this,"block-groups":n.settings.blockGroups},null,8,["editor","block-groups"])):_t("",!0)],6)):_t("",!0),t.$isDebug?(ge(),Se("div",Use,Ne(o.jsonContent),1)):_t("",!0),ee("input",{type:"hidden",name:n.name,value:o.jsonContent},null,8,qse)])}const kA=Bt(Wse,[["render",Kse]]),y1={data:void 0},Yw=t=>t.reduce((e,n)=>(e[n]=n)&&e,{}),Fo=Yw(["drag","dragend","dragenter","dragleave","dragstart","dragover","drop"]),Gse=Yw(["copy","move","link","none"]),Yse=Yw(["none","copy","copyLink","copyMove","link","linkMove","move","all","uninitialized"]),Jse={props:{draggable:{type:Boolean,default:!0},transferData:{},dropEffect:{validator:t=>t in Gse},effectAllowed:{validator:t=>t in Yse},image:String,imageXOffset:{type:Number,default:0},imageYOffset:{type:Number,default:0},hideImageHtml:{type:Boolean,default:!0},tag:{type:String,default:"div"}},data(){return{dragging:!1}},computed:{events:()=>Fo,scopedData(){return this.dragging&&this.transferData},hideImageStyle:()=>({position:"fixed",top:"-1000px"})},methods:{emitEvent(t,e){const n=e.dataTransfer;if([Fo.dragenter,Fo.dragover].includes(t)&&this.dropEffect&&(n.dropEffect=this.dropEffect),t===Fo.dragstart){if(this.effectAllowed&&(n.effectAllowed=this.effectAllowed),this.image||this.$slots.image||this.$refs.image){let r;this.image?(r=new Image,r.src=this.image):this.$refs.image?r=this.$refs.image:this.$slots.image&&(r=this.$slots.image[0].elm),n.setDragImage&&n.setDragImage(r,this.imageXOffset,this.imageYOffset)}this.transferData!==void 0&&(y1.data=this.transferData,e.dataTransfer.setData("text","")),this.dragging=!0}this.$emit(t,this.transferData,e),t===Fo.dragend&&(y1.data=void 0,this.dragging=!1)}}};function Xse(t,e,n,r,i,o){return ge(),Et(Qs(n.tag),{draggable:n.draggable,onDrag:e[0]||(e[0]=s=>o.emitEvent(o.events.drag,s)),onDragstart:e[1]||(e[1]=s=>o.emitEvent(o.events.dragstart,s)),onDragenter:e[2]||(e[2]=s=>o.emitEvent(o.events.dragenter,s)),onDragleave:e[3]||(e[3]=s=>o.emitEvent(o.events.dragleave,s)),onDragend:e[4]||(e[4]=s=>o.emitEvent(o.events.dragend,s))},{default:Vt(()=>[pn(t.$slots,"default",{transferData:o.scopedData}),n.hideImageHtml?(ge(),Se("div",{key:0,ref:"image",style:oi(o.hideImageStyle)},[pn(t.$slots,"image",{transferData:o.scopedData})],4)):pn(t.$slots,"image",{key:1,transferData:o.scopedData})]),_:3},40,["draggable"])}const Zse=Bt(Jse,[["render",Xse]]),Zc=new Set,Qse={data(){return{transferData:void 0,isDraggingOver:!1}},props:{tag:{type:String,default:"div"}},computed:{events:()=>Fo,scopedData(){return this.isDraggingOver&&this.transferData}},methods:{emitEvent(t,e){this.transferData=y1.data,this.$emit(t,this.transferData,e),t===Fo.dragenter&&(Zc.size||e.target===this.$el)&&Zc.add(e.target),t===Fo.dragleave&&Zc.delete(e.target),t===Fo.drop&&Zc.clear(),this.isDraggingOver=!!Zc.size}}};function eae(t,e,n,r,i,o){return ge(),Et(Qs(n.tag),{onDragenter:e[0]||(e[0]=s=>o.emitEvent(o.events.dragenter,s)),onDragleave:e[1]||(e[1]=s=>o.emitEvent(o.events.dragleave,s)),onDragover:e[2]||(e[2]=lt(s=>o.emitEvent(o.events.dragover,s),["prevent"])),onDrop:e[3]||(e[3]=lt(s=>o.emitEvent(o.events.drop,s),["prevent"]))},{default:Vt(()=>[pn(t.$slots,"default",{transferData:o.scopedData})]),_:3},32)}const tae=Bt(Qse,[["render",eae]]),nae={name:"VizyIconPicker",props:{inputClasses:{type:Object,default:()=>{}},modelValue:{type:Object,default:()=>{}}},emits:["update:modelValue"],data(){return{tippy:null,id:`icon-picker-${Craft.randomString(10)}`,icons:[],search:"",selected:null,isFetching:!1,tippyVisible:!1}},computed:{iconsFiltered(){return Mi(this.icons)?[]:this.icons.reduce((t,e)=>{const n=e.icons.filter(r=>r.label.toLowerCase().includes(this.search.toLowerCase()));return n.length?t.concat({...e,icons:n}):t},[])}},watch:{selected(t){this.$emit("update:modelValue",t)}},created(){this.modelValue&&(this.selected=this.modelValue)},mounted(){const t=this,e=this.$el.querySelector(".js-vui-tippy-template");e.style.display="block",this.tippy=Kr(`#${this.id}`,{content:e,trigger:"focus",allowHTML:!0,arrow:!0,interactive:!0,placement:"bottom-start",theme:"light-border icon-picker",maxWidth:"none",duration:200,zIndex:10,hideOnClick:!1,onCreate(n){t.isFetching=!1,n.popper.style.width="100%"},onShow(n){t.tippyVisible=!0,!(t.isFetching||t.icons.length)&&(t.isFetching=!0,fetch(Craft.getActionUrl("vizy/icons")).then(r=>r.json()).then(r=>{t.icons=r}).catch(r=>{n.setContent(`Request failed. ${r}`)}).finally(()=>{t.isFetching=!1}))},onHide(n){t.isFetching=!1,t.tippyVisible=!1},onHidden(n){t.search=""}})},methods:{select(t){this.selected=t,this.tippy[0].hide()},deleteIcon(){this.selected=null}}},rae={key:0,class:"vui-icon-input-item"},iae=["innerHTML"],oae={class:"vui-icon-input-label"},sae=["id"],aae=ee("svg",{"aria-hidden":"true",focusable:"false","data-prefix":"fal","data-icon":"times",class:"svg-inline--fa fa-times fa-w-10",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512"},[ee("path",{fill:"currentColor",d:"M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z"})],-1),lae=[aae],uae={class:"vui-icons-pane js-vui-tippy-template",style:{display:"none"}},cae={key:0,class:"vui-no-icons"},fae=ee("span",{class:"vui-loading"},null,-1),dae=[fae],hae={key:1,class:"vui-icons-groups"},pae={class:"vui-icons-group-name"},mae={class:"vui-icons"},gae=["title","onClick"],vae=["innerHTML"],yae={class:"vui-icon-label"},bae={key:2,class:"vui-no-icons"};function _ae(t,e,n,r,i,o){return ge(),Se("div",null,[ee("div",{class:gt(["vui-icon-input",{"tippy-visible":i.tippyVisible}])},[i.selected&&!i.tippyVisible?(ge(),Se("div",rae,[ee("div",{class:"vui-icon-input-svg",innerHTML:i.selected.svg},null,8,iae),ee("span",oae,Ne(i.selected.label),1)])):_t("",!0),Ut(ee("input",{id:i.id,"onUpdate:modelValue":e[0]||(e[0]=s=>i.search=s),type:"text",autocomplete:"off",autocorrect:"off",autocapitalize:"off",class:gt(n.inputClasses)},null,10,sae),[[Mn,i.search]]),i.selected?(ge(),Se("button",{key:1,type:"button",class:"vui-icon-input-delete",onClick:e[1]||(e[1]=lt((...s)=>o.deleteIcon&&o.deleteIcon(...s),["prevent"]))},lae)):_t("",!0)],2),ee("div",uae,[i.isFetching?(ge(),Se("div",cae,dae)):Object.keys(o.iconsFiltered).length?(ge(),Se("div",hae,[(ge(!0),Se(kt,null,Zt(o.iconsFiltered,(s,l)=>(ge(),Se("div",{key:l,class:"vui-icons-group"},[ee("span",pae,Ne(s.name),1),ee("div",mae,[(ge(!0),Se(kt,null,Zt(s.icons,(u,f)=>(ge(),Se("div",{key:f,class:"vui-icon-wrap",title:`${u.label} (${s.name})`,onClick:lt(d=>o.select(u),["prevent"])},[ee("div",{class:"vui-icon-svg",innerHTML:u.svg},null,8,vae),ee("span",yae,Ne(u.label),1)],8,gae))),128))])]))),128))])):(ge(),Se("div",bae,Ne(t.t("vizy","No icons match your query.")),1))])])}const wae=Bt(nae,[["render",_ae]]),kae={name:"FieldLayoutDesigner",props:{layoutUid:{type:String,default:null},fieldId:{type:[String,Number],default:null},blockTypeId:{type:[String,Number],default:null},modelValue:{type:[Object,Array,String],default:()=>{}}},emits:["update:modelValue"],data(){return{error:!1,errorMessage:"",loading:!1,mounted:!1,proxyValue:{}}},watch:{proxyValue(t){this.$emit("update:modelValue",t)}},created(){this.proxyValue=this.modelValue},mounted(){this.loading=!0;const t=[];this.fieldId&&t.push(this.fieldId);const n=/fields\/edit\/(\d*)$/g.exec(window.location.href);n&&n[1]&&t.push(n[1]);const r={fieldIds:t,layoutUid:this.layoutUid,blockTypeId:this.blockTypeId,layout:this.proxyValue};Craft.sendActionRequest("POST","vizy/field/layout-designer",{data:r}).then(i=>{if(i.data.html)this.$el.innerHTML=i.data.html,Craft.appendBodyHtml(i.data.footHtml),this.watchForChanges(),this.mounted=!0;else throw new Error(i.data)}).catch(i=>{this.error=!0,this.errorMessage=i,this.loading=!1})},methods:{watchForChanges(){const t=this.$el.querySelector('input[name="fieldLayout"]');new MutationObserver((n,r)=>{for(const i of n)i.type==="attributes"&&i.attributeName==="value"&&(this.proxyValue=i.target.value)}).observe(t,{attributes:!0,attributeFilter:["value"]})}}},xae={ref:"fld-container",class:"vui-block-editor-layout"},Sae={class:"vui-workspace"},Cae={key:0,class:"vui-loading-pane"},Tae=ee("div",{class:"vui-loading fui-loading-lg"},null,-1),Eae=[Tae],Aae={key:1,class:"vui-error-pane error"},Oae={class:"vui-error-content"},Mae=ee("span",{"data-icon":"alert"},null,-1),Lae=["innerHTML"];function Nae(t,e,n,r,i,o){return ge(),Se("div",xae,[ee("div",Sae,[i.loading?(ge(),Se("div",Cae,Eae)):_t("",!0),i.error?(ge(),Se("div",Aae,[ee("div",Oae,[Mae,ee("span",{class:"error",innerHTML:i.errorMessage},null,8,Lae)])])):_t("",!0)])],512)}const Iae=Bt(kae,[["render",Nae]]),Pae=Vn({name:"default-section",props:{section:{type:Object,required:!0},currentIndex:{type:[Number,String],required:!1,default:1/0},renderSuggestion:{type:Function,required:!1},normalizeItemFunction:{type:Function,required:!0},componentAttrPrefix:{type:String,required:!0},componentAttrIdAutosuggest:{type:String,required:!0}},data:function(){return{_currentIndex:this.currentIndex}},computed:{list:function(){let{limit:t,data:e}=this.section;return e.lengthi.type!==kt&&i.children.length===0)||[];return Hr("ul",{role:"listbox",class:this.section.ulClass,"aria-labelledby":this.section.label&&`${this.componentAttrIdAutosuggest}-${this.section.label}`},[r[0]&&r[0]||this.section.label&&Hr("li",{class:n,id:`${this.componentAttrIdAutosuggest}-${this.section.label}`},[this.section.label])||"",this.list.map((i,o)=>{const s=this.normalizeItemFunction(this.section.name,this.section.type,this.section.label,this.section.liClass,i),l=this.getItemIndex(o),u=this._currentIndex===l||parseInt(this.currentIndex)===l;return Hr("li",{role:"option","data-suggestion-index":l,"data-section-name":s.name,id:`${t}__results-item--${l}`,...s.liAttributes,key:l,class:{[`${t}__results-item--highlighted`]:u,[`${t}__results-item`]:!0,...s.liClass},onMouseenter:this.onMouseEnter,onMouseleave:this.onMouseLeave},[this.renderSuggestion?this.renderSuggestion(s):this.$slots.default&&this.$slots.default({_key:o,suggestion:s})])}),e.afterSectionDefault&&e.afterSectionDefault({section:this.section,className:`${t}__results-after ${t}__results-after--${this.section.name}`}),e.afterSectionNamed&&e.afterSectionNamed({section:this.section,className:`${t}__results_after ${t}__results-after--${this.section.name}`})])}});function Dae(t,e){return!!t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}function Rae(t,e){Dae(t,e)||(t.className+=" "+e)}function zae(t,e){t.classList&&t.classList.remove(e)}const xA=-1,SA={name:"default",type:"default-section"},Bae={name:"Autosuggest",components:{DefaultSection:Pae},inheritAttrs:!1,props:{modelValue:{type:String,default:null},inputProps:{type:Object,required:!0},limit:{type:Number,required:!1,default:1/0},suggestions:{type:Array,required:!0},renderSuggestion:{type:Function,required:!1,default:null},getSuggestionValue:{type:Function,required:!1,default:t=>{const e=t.item;return typeof e=="object"&&e.hasOwnProperty("name")?e.name:e}},shouldRenderSuggestions:{type:Function,required:!1,default:(t,e)=>t>0&&!e},sectionConfigs:{type:Object,required:!1,default:()=>({default:{onSelected:null}})},onSelected:{type:Function,required:!1,default:null},componentAttrIdAutosuggest:{type:String,required:!1,default:"autosuggest"},componentAttrClassAutosuggestResultsContainer:{type:String,required:!1,default:null},componentAttrClassAutosuggestResults:{type:String,required:!1,default:null},componentAttrPrefix:{type:String,required:!1,default:"autosuggest"},class:null,style:null},data(){return{internalValue:null,searchInputOriginal:null,currentIndex:null,currentItem:null,loading:!1,didSelectFromOptions:!1,defaultInputProps:{type:"text",autocomplete:"off"},clientXMouseDownInitial:null}},computed:{internal_inputProps(){return{...this.defaultInputProps,...this.inputProps,...this.listeners}},listeners(){return{onInput:t=>{},onClick:()=>{this.loading=!1,this.$attrs.click&&this.$attrs.click(this.currentItem),this.$nextTick(()=>{this.ensureItemVisible(this.currentItem,this.currentIndex)})},onSelected:()=>{this.currentItem&&this.sectionConfigs[this.currentItem.name]&&this.sectionConfigs[this.currentItem.name].onSelected?this.sectionConfigs[this.currentItem.name].onSelected(this.currentItem,this.searchInputOriginal):this.sectionConfigs.default.onSelected?this.sectionConfigs.default.onSelected(null,this.searchInputOriginal):this.onSelected&&this.$emit("selected",this.currentItem,this.currentIndex),this.setChangeItem(null)}}},isOpen(){return this.shouldRenderSuggestions(this.totalResults,this.loading)},computedSections(){let t=0;return this.suggestions.map(e=>{if(!e.data)return;const n=e.name?e.name:SA.name;let r,i,o,s,l=null;this.sectionConfigs[n]&&(r=this.sectionConfigs[n].limit,o=this.sectionConfigs[n].type,i=this.sectionConfigs[n].label,s=this.sectionConfigs[n].ulClass,l=this.sectionConfigs[n].liClass),o=o||SA.type,r=r||this.limit,r=r||1/0,r=e.data.length{if(!e)return t;const{limit:n,data:r}=e;return t+(r.length>=n?n:r.length)},0)},_componentAttrClassAutosuggestResultsContainer(){return this.componentAttrClassAutosuggestResultsContainer||`${this.componentAttrPrefix}__results-container`},_componentAttrClassAutosuggestResults(){return this.componentAttrClassAutosuggestResults||`${this.componentAttrPrefix}__results`}},watch:{modelValue:{handler(t){this.internalValue=t},immediate:!0},isOpen:{handler(t,e){t!==e&&this.$emit(t?"opened":"closed")},immediate:!0}},created(){this.loading=!0},mounted(){document.addEventListener("mouseup",this.onDocumentMouseUp),document.addEventListener("mousedown",this.onDocumentMouseDown)},beforeUnmount(){document.removeEventListener("mouseup",this.onDocumentMouseUp),document.removeEventListener("mousedown",this.onDocumentMouseDown)},methods:{afterSlot(t){return`after-section-${t.name||t.label}`},beforeSlot(t){return`before-section-${t.name||t.label}`},inputHandler(t){const e=t.target.value;this.$emit("update:modelValue",e),this.internalValue=e,this.didSelectFromOptions||(this.searchInputOriginal=e,this.currentIndex=null)},getSectionRef(t){return"computed_section_"+t},getItemByIndex(t){let e=!1;if(t===null)return e;for(var n=0;n=this.computedSections[n].start_index&&t<=this.computedSections[n].end_index){let r=t-this.computedSections[n].start_index;this.computedSections[n].name;let i=this.computedSections[n].data[r];if(i){e=this.normalizeItem(this.computedSections[n].name,this.computedSections[n].type,i.name,"",i);break}}return e},handleKeyStroke(t){const{keyCode:e}=t;if([16,9,17,18,91,93].indexOf(e)>-1)return;const r=!this.isOpen;if(this.loading=!1,this.didSelectFromOptions=!1,this.isOpen)switch(e){case 40:case 38:if(t.preventDefault(),e===38&&this.currentIndex===null)break;const i=e===40?1:-1,o=Math.max((parseInt(this.currentIndex)||0)+(r?0:i),xA);this.setCurrentIndex(o,this.totalResults),this.didSelectFromOptions=!0,this.totalResults>0&&this.currentIndex>=0?(this.setChangeItem(this.getItemByIndex(this.currentIndex)),this.didSelectFromOptions=!0):this.currentIndex===xA&&(this.setChangeItem(null),this.internalValue=this.searchInputOriginal,t.preventDefault()),this.$nextTick(()=>{this.ensureItemVisible(this.currentItem,this.currentIndex)});break;case 13:t.preventDefault(),this.totalResults>0&&this.currentIndex>=0&&(this.setChangeItem(this.getItemByIndex(this.currentIndex),!0),this.didSelectFromOptions=!0),this.loading=!0,this.listeners.onSelected(this.didSelectFromOptions);break;case 27:this.loading=!0,this.currentIndex=null,this.internalValue=this.searchInputOriginal,this.$emit("input",this.searchInputOriginal),t.preventDefault();break}},setChangeItem(t,e=!1){if(this.currentIndex===null||!t)this.currentItem=null,this.$emit("item-changed",null,null);else if(t){this.currentItem=t,this.$emit("item-changed",t,this.currentIndex);const n=this.getSuggestionValue(t);this.internalValue=n,e&&(this.searchInputOriginal=n),this.ensureItemVisible(t,this.currentIndex)}},normalizeItem(t,e,n,r,i){return{name:t,type:e,label:n,liClass:i.liClass||r,item:i}},ensureItemVisible(t,e,n){const r=this.$el.querySelector(n||`.${this._componentAttrClassAutosuggestResults}`);if(!r)return;const i=r.querySelector(`#${this.componentAttrPrefix}__results-item--${e}`);if(!i)return;const o=r.clientHeight,s=r.scrollTop,l=i.clientHeight,u=i.offsetTop;l+u>=s+o?r.scrollTop=l+u-o:u0&&(r.scrollTop=u)},updateCurrentIndex(t){this.setCurrentIndex(t,-1,!0)},clickedOnScrollbar(t,e){const n=this.$el.querySelector(`.${this._componentAttrClassAutosuggestResults}`),r=n&&n.clientWidth<=e+17&&e+17<=n.clientWidth+34;return t.target.tagName==="DIV"&&n&&r||!1},onDocumentMouseDown(t){var e=t.target.getBoundingClientRect?t.target.getBoundingClientRect():0;this.clientXMouseDownInitial=t.clientX-e.left},onDocumentMouseUp(t){if(!this.$el.contains(t.target)){this.loading=!0,this.currentIndex=null;return}t.target.tagName==="INPUT"||this.clickedOnScrollbar(t,this.clientXMouseDownInitial)||(this.loading=!0,this.didSelectFromOptions=!0,this.setChangeItem(this.getItemByIndex(this.currentIndex),!0),this.listeners.onSelected(!0))},setCurrentIndex(t,e=-1,n=!1){let r=t;if(!n){const s=this.currentIndex===null,l=t>=e;(s||l)&&(r=0)}this.currentIndex=r;const i=this.$el.querySelector(`#${this.componentAttrPrefix}__results-item--${this.currentIndex}`),o=`${this.componentAttrPrefix}__results-item--highlighted`;this.$el.querySelector(`.${o}`)&&zae(this.$el.querySelector(`.${o}`),o),i&&Rae(i,o)}}},$ae=["id"],Hae=["aria-expanded","aria-owns"],Fae=["type","value","autocomplete","aria-activedescendant","aria-controls"],Vae=["id"],jae=["aria-labelledby"];function Wae(t,e,n,r,i,o){return ge(),Se("div",{id:n.componentAttrIdAutosuggest,class:gt(t.$props.class),style:oi(t.$props.style)},[pn(t.$slots,"before-input"),ee("div",{role:"combobox","aria-expanded":o.isOpen?"true":"false","aria-haspopup":"listbox","aria-owns":`${n.componentAttrIdAutosuggest}-${n.componentAttrPrefix}__results`},[ee("input",wi({type:o.internal_inputProps.type,value:i.internalValue,autocomplete:o.internal_inputProps.autocomplete,class:[o.isOpen?`${n.componentAttrPrefix}__input--open`:"",o.internal_inputProps.class]},o.internal_inputProps,{"aria-autocomplete":"list","aria-activedescendant":o.isOpen&&i.currentIndex!==null?`${n.componentAttrPrefix}__results-item--${i.currentIndex}`:"","aria-controls":`${n.componentAttrIdAutosuggest}-${n.componentAttrPrefix}__results`,onInput:e[0]||(e[0]=(...s)=>o.inputHandler&&o.inputHandler(...s)),onKeydown:e[1]||(e[1]=(...s)=>o.handleKeyStroke&&o.handleKeyStroke(...s))}),null,16,Fae)],8,Hae),pn(t.$slots,"after-input"),ee("div",{id:`${n.componentAttrIdAutosuggest}-${n.componentAttrPrefix}__results`,class:gt(o._componentAttrClassAutosuggestResultsContainer)},[o.isOpen?(ge(),Se("div",{key:0,class:gt(o._componentAttrClassAutosuggestResults),"aria-labelledby":n.componentAttrIdAutosuggest},[pn(t.$slots,"before-suggestions"),(ge(!0),Se(kt,null,Zt(o.computedSections,(s,l)=>(ge(),Et(Qs(s.type),{ref_for:!0,ref:o.getSectionRef(`${s.name}${l}`),key:o.getSectionRef(`${s.name}${l}`),"current-index":i.currentIndex,"normalize-item-function":o.normalizeItem,"render-suggestion":n.renderSuggestion,section:s,"component-attr-prefix":n.componentAttrPrefix,"component-attr-id-autosuggest":n.componentAttrIdAutosuggest,onUpdateCurrentIndex:o.updateCurrentIndex},{[o.beforeSlot(s)]:Vt(({section:u,className:f})=>[pn(t.$slots,o.beforeSlot(s),{section:u,className:f})]),default:Vt(({suggestion:u,_key:f})=>[pn(t.$slots,"default",{suggestion:u,index:f},()=>[Ui(Ne(u.item),1)])]),[o.afterSlot(s)]:Vt(({section:u})=>[pn(t.$slots,`after-section-${s.name||s.label}`,{section:u})]),"after-section":Vt(({section:u})=>[pn(t.$slots,"after-section",{section:u})]),_:2},1064,["current-index","normalize-item-function","render-suggestion","section","component-attr-prefix","component-attr-id-autosuggest","onUpdateCurrentIndex"]))),128)),pn(t.$slots,"after-suggestions")],10,jae)):_t("",!0),pn(t.$slots,"after-suggestions-container")],10,Vae)],14,$ae)}const Uae=Bt(Bae,[["render",Wae]]),qae={name:"AutoSuggest",components:{VueAutosuggest:Uae},props:{id:{type:String,default:""},suggestions:{type:[Object,Array],default:()=>[]},modelValue:{type:String,default:""}},emits:["update:modelValue"],data(){return{query:"",selected:"",filteredOptions:[],inputProps:{class:"text fullwidth",initialValue:this.modelValue,style:"",id:this.id,name:this.id,maxlength:"",autofocus:!1,disabled:!1,title:"",placeholder:""},limit:5}},methods:{onInputChange(t){this.query=(t||"").toLowerCase(),this.updateFilteredOptions(),t||this.$emit("update:modelValue","")},updateFilteredOptions(){if(this.query===""){this.filteredOptions=this.suggestions;return}const t=[];let e,n,r,i;for(e=0;e{const l=this.scoreItem(o,this.query),u=this.scoreItem(s,this.query);return l===u?0:li.inputProps.initialValue=l),o.onInputChange],suggestions:i.filteredOptions,"get-suggestion-value":o.getSuggestionValue,"input-props":i.inputProps,limit:i.limit,"component-attr-id-autosuggest":n.id,onSelected:o.onSelected,onFocus:o.updateFilteredOptions,onBlur:o.onBlur},{default:Vt(({suggestion:l})=>[Ui(Ne(l.item.name||l.item)+" ",1),l.item.hint?(ge(),Se("span",Kae,"– "+Ne(l.item.hint),1)):_t("",!0)]),_:1},8,["modelValue","suggestions","get-suggestion-value","input-props","limit","component-attr-id-autosuggest","onSelected","onFocus","onBlur","onUpdate:modelValue"])}const Yae=Bt(qae,[["render",Gae]]),Jae={name:"HandleInput",props:{id:{type:String,default:""},sourceValue:{type:String,default:""},collection:{type:Array,default:()=>[]},modelValue:{type:String,default:""}},emits:["update:modelValue"],data(){return{savedValue:"",proxyValue:""}},watch:{sourceValue(t){this.savedValue===""&&this.generateHandle()},proxyValue(t){this.$emit("update:modelValue",t)}},created(){this.savedValue=this.modelValue,this.proxyValue=this.modelValue},methods:{generateHandle(t){let e=ite(this.sourceValue);this.collection.length&&(e=XL(this.collection,e,0)),this.proxyValue=e}}};function Xae(t,e,n,r,i,o){return Ut((ge(),Se("input",{id:"id","onUpdate:modelValue":e[0]||(e[0]=s=>i.proxyValue=s),type:"text",class:"text fullwidth code",autocomplete:"off",autocorrect:"off",autocapitalize:"off"},null,512)),[[Mn,i.proxyValue]])}const Zae=Bt(Jae,[["render",Xae]]),Qae=function(){return window.safari!==void 0},ele={name:"VizySettings",components:{VizyIconPicker:wae,LightswitchField:JL,FieldLayoutDesigner:Iae,AutoSuggest:Yae,HandleInput:Zae,Drag:Zse,Drop:tae},props:{fieldName:{type:String,required:!0},errors:{type:[Object,Array],default:()=>{}}},data(){return{selectedBlockType:null,isSafari:Qae(),emptySvg:'',fieldData:[],settings:{}}},computed:{handleCollection(){const t=[];return Array.isArray(this.fieldData)&&this.fieldData.forEach(e=>{e.blockTypes.forEach(n=>{n!==this.selectedBlockType&&t.push(n.handle)})}),t}},created(){this.fieldData=this.$root.fieldData,this.settings=this.$root.settings},mounted(){},methods:{updateSelectedBlockType(t,e=!1){this.selectedBlockType=null,this.$nextTick(()=>{this.selectedBlockType=t,this.$nextTick(()=>{this.$refs["name-field"].value||this.$refs["name-field"].focus()})})},selectBlockType(t){this.selectedBlockType===t?this.selectedBlockType=null:this.updateSelectedBlockType(t)},getErrors(t,e=""){let n=[];const r=`${t.id}:${e}`;return this.errors&&(n=Object.keys(this.errors).filter(i=>i.includes(r)).map(i=>this.errors[i][0])),n},hasErrors(t,e=""){return this.getErrors(t,e).length},addBlockType(t){t.blockTypes||(t.blockTypes=[]),t.blockTypes.push({id:Jm("type-"),enabled:!0}),this.updateSelectedBlockType(t.blockTypes[t.blockTypes.length-1],!0)},addGroup(){const t=prompt(Craft.t("vizy","Give your group a name."));t&&this.fieldData.push({id:Jm("group-"),name:t,blockTypes:[]})},deleteBlockType(){const t=Craft.t("vizy","Are you sure you want to delete “{name}”? This will permanently delete all content created with this block type.",{name:this.selectedBlockType.name});if(confirm(t))for(let e=0;this.fieldData.length;e++){const n=this.fieldData[e].blockTypes.indexOf(this.selectedBlockType);if(n!==-1){this.fieldData[e].blockTypes.splice(n,1),this.selectedBlockType=null;break}}},deleteGroup(t){const e=Craft.t("vizy","Are you sure you want to delete “{name}”? This will permanently delete all content created with any of these block types.",{name:t.name});if(confirm(e)){const n=this.fieldData.indexOf(t);n!==-1&&(this.fieldData.splice(n,1),this.selectedBlockType=null)}},moveGroupUp(t){const e=this.fieldData.indexOf(t),n=e-1,[r]=this.fieldData.splice(e,1);this.fieldData.splice(n,0,r)},moveGroupDown(t){const e=this.fieldData.indexOf(t),n=e+1,[r]=this.fieldData.splice(e,1);this.fieldData.splice(n,0,r)},dragEnter(t,e){e&&e.target.parentNode.classList.add("is-active")},dragLeave(t,e){e&&e.target.parentNode.classList.remove("is-active")},dragDrop(t,e){if(!e)return;e.target.parentNode.classList.remove("is-active");const n=parseInt(t.groupIndex),r=parseInt(t.blockTypeIndex),i=parseInt(e.target.getAttribute("data-group"));let o=parseInt(e.target.getAttribute("data-block"));if(n===i&&r===o||n===i&&r===o-1)return;n===i&&r(ge(),Se("div",{key:_,class:"vui-block-group"},[_>0?(ge(),Se("hr",ole)):_t("",!0),ee("div",sle,[ee("span",{class:"vui-block-items-header-text",contenteditable:"true",onBlur:C=>y.name=C.target.innerText,innerHTML:y.name},null,40,ale),ee("div",lle,[_>0?(ge(),Se("button",{key:0,class:"vui-block-items-header-move",onClick:lt(C=>o.moveGroupUp(y),["prevent"])},fle,8,ule)):_t("",!0),_o.moveGroupDown(y),["prevent"])},ple,8,dle)):_t("",!0),ee("button",{class:"vui-block-items-header-delete",onClick:lt(C=>o.deleteGroup(y),["prevent"])},Ne(t.t("site","Delete")),9,mle)])]),ee("div",gle,[(ge(!0),Se(kt,null,Zt(y.blockTypes,(C,x)=>(ge(),Se("div",{key:x,class:gt(["vui-block-item",{active:i.selectedBlockType===C,"has-error":o.hasErrors(C)}]),onClick:lt(k=>o.selectBlockType(C),["prevent"])},[ee("div",yle,[Qe(s,{"data-group":_,"data-block":x,class:"dropzone-vertical",onDrop:o.dragDrop,onDragenter:o.dragEnter,onDragleave:o.dragLeave},null,8,["data-group","data-block","onDrop","onDragenter","onDragleave"]),ble]),Qe(l,{"transfer-data":{groupIndex:_,blockTypeIndex:x}},W1({default:Vt(()=>[ee("div",{innerHTML:C.icon?C.icon.svg:i.emptySvg},null,8,_le),ee("span",wle,Ne(C.name),1),ee("span",{class:gt(["vui-block-item-status",{on:C.enabled}])},null,2)]),_:2},[i.isSafari?void 0:{name:"image",fn:Vt(()=>[ee("div",kle,[ee("div",{innerHTML:C.icon?C.icon.svg:i.emptySvg},null,8,xle),ee("span",Sle,Ne(C.name),1),ee("span",{class:gt(["vui-block-item-status",{on:C.enabled}])},null,2)])]),key:"0"}]),1032,["transfer-data"]),x==y.blockTypes.length-1?(ge(),Se("div",Cle,[Qe(s,{"data-group":_,"data-block":x+1,class:"dropzone-vertical",onDrop:o.dragDrop,onDragenter:o.dragEnter,onDragleave:o.dragLeave},null,8,["data-group","data-block","onDrop","onDragenter","onDragleave"]),Tle])):_t("",!0)],10,vle))),128)),ee("div",{class:"vui-block-item vui-block-new-item",onClick:lt(C=>o.addBlockType(y),["prevent"])},[!y.blockTypes||!y.blockTypes.length?(ge(),Se("div",Ale,[ee("div",Ole,[Qe(s,{"data-group":_,"data-block":0,class:"dropzone-vertical",onDrop:o.dragDrop,onDragenter:o.dragEnter,onDragleave:o.dragLeave},null,8,["data-group","onDrop","onDragenter","onDragleave"]),Mle])])):_t("",!0),Lle,ee("span",Nle,Ne(t.t("vizy","Add Block")),1)],8,Ele)])]))),128)),i.fieldData.length?(ge(),Se("hr",Ile)):_t("",!0),ee("div",{class:"vui-block-item vui-block-new-item vui-block-new-group",onClick:e[0]||(e[0]=lt((...y)=>o.addGroup&&o.addGroup(...y),["prevent"]))},[Ple,ee("span",Dle,Ne(t.t("vizy","Add Group")),1)])])]),i.selectedBlockType?(ge(),Se("div",Rle,[ee("div",zle,[ee("div",Ble,Ne(i.selectedBlockType.name),1),ee("div",$le,[ee("button",{class:"vui-block-titlebar-delete",onClick:e[1]||(e[1]=lt((...y)=>o.deleteBlockType&&o.deleteBlockType(...y),["prevent"]))},Ne(t.t("vizy","Delete")),1),Qe(u,{modelValue:i.selectedBlockType.enabled,"onUpdate:modelValue":e[2]||(e[2]=y=>i.selectedBlockType.enabled=y),small:!0},null,8,["modelValue"])])]),o.getErrors(i.selectedBlockType,"general")?(ge(),Se("ul",Hle,[(ge(!0),Se(kt,null,Zt(o.getErrors(i.selectedBlockType,"general"),(y,_)=>(ge(),Se("li",{key:_},Ne(y),1))),128))])):_t("",!0),ee("div",Fle,[ee("div",Vle,[ee("label",jle,Ne(t.t("vizy","Name")),1)]),ee("div",Wle,[ee("p",null,Ne(t.t("vizy","What this block type will be called in the control panel.")),1)]),ee("div",Ule,[Ut(ee("input",{id:"name",ref:"name-field","onUpdate:modelValue":e[3]||(e[3]=y=>i.selectedBlockType.name=y),type:"text",class:gt(["text fullwidth",{error:o.hasErrors(i.selectedBlockType,"name")}]),autocomplete:"off",autocorrect:"off",autocapitalize:"off"},null,2),[[Mn,i.selectedBlockType.name]])]),o.getErrors(i.selectedBlockType,"name")?(ge(),Se("ul",qle,[(ge(!0),Se(kt,null,Zt(o.getErrors(i.selectedBlockType,"name"),(y,_)=>(ge(),Se("li",{key:_},Ne(y),1))),128))])):_t("",!0)]),ee("div",Kle,[ee("div",Gle,[ee("label",Yle,Ne(t.t("vizy","Handle")),1)]),ee("div",Jle,[ee("p",null,Ne(t.t("vizy","How you’ll refer to this block type in the templates.")),1)]),ee("div",Xle,[Qe(f,{id:"handle",ref:"handle-field",modelValue:i.selectedBlockType.handle,"onUpdate:modelValue":e[4]||(e[4]=y=>i.selectedBlockType.handle=y),"source-value":i.selectedBlockType.name,collection:o.handleCollection,class:gt({error:o.hasErrors(i.selectedBlockType,"handle")})},null,8,["modelValue","source-value","collection","class"])]),o.getErrors(i.selectedBlockType,"handle")?(ge(),Se("ul",Zle,[(ge(!0),Se(kt,null,Zt(o.getErrors(i.selectedBlockType,"handle"),(y,_)=>(ge(),Se("li",{key:_},Ne(y),1))),128))])):_t("",!0)]),ee("div",Qle,[ee("div",eue,[ee("label",tue,Ne(t.t("vizy","Icon")),1)]),ee("div",nue,[ee("p",null,Ne(t.t("vizy","Select an appropriate icon for the block type. Start typing to search via keywords.")),1)]),ee("div",rue,[Qe(d,{modelValue:i.selectedBlockType.icon,"onUpdate:modelValue":e[5]||(e[5]=y=>i.selectedBlockType.icon=y),"input-classes":{error:o.hasErrors(i.selectedBlockType,"icon")}},null,8,["modelValue","input-classes"])]),o.getErrors(i.selectedBlockType,"icon")?(ge(),Se("ul",iue,[(ge(!0),Se(kt,null,Zt(o.getErrors(i.selectedBlockType,"icon"),(y,_)=>(ge(),Se("li",{key:_},Ne(y),1))),128))])):_t("",!0)]),ee("div",oue,[ee("div",sue,[ee("label",aue,Ne(t.t("vizy","Layout")),1)]),ee("div",lue,[ee("p",null,Ne(t.t("vizy","Define the field layout for this block type. Empty tabs are not allowed, and you must provide at least one element.")),1)]),ee("div",uue,[Qe(m,{modelValue:i.selectedBlockType.layout,"onUpdate:modelValue":e[6]||(e[6]=y=>i.selectedBlockType.layout=y),"layout-uid":i.selectedBlockType.layoutUid,"field-id":i.settings.fieldId,"block-type-id":i.selectedBlockType.id},null,8,["modelValue","layout-uid","field-id","block-type-id"])])]),ee("div",cue,[ee("div",fue,[ee("label",due,Ne(t.t("vizy","Template")),1)]),ee("div",hue,[ee("p",null,Ne(t.t("vizy","Provide the path for a template partial for rendering this block type.")),1)]),ee("div",pue,[Qe(v,{id:"template",modelValue:i.selectedBlockType.template,"onUpdate:modelValue":e[7]||(e[7]=y=>i.selectedBlockType.template=y),suggestions:i.settings.suggestions},null,8,["modelValue","suggestions"])]),o.getErrors(i.selectedBlockType,"template")?(ge(),Se("ul",mue,[(ge(!0),Se(kt,null,Zt(o.getErrors(i.selectedBlockType,"template"),(y,_)=>(ge(),Se("li",{key:_},Ne(y),1))),128))])):_t("",!0)]),ee("div",gue,[ee("div",vue,[ee("label",yue,Ne(t.t("vizy","Min Blocks")),1)]),ee("div",bue,[ee("p",null,Ne(t.t("vizy","The minimum number of blocks of this type the field is allowed to have.")),1)]),ee("div",_ue,[Ut(ee("input",{id:"minBlocks",ref:"minBlocks-field","onUpdate:modelValue":e[8]||(e[8]=y=>i.selectedBlockType.minBlocks=y),type:"text",class:gt(["text",{error:o.hasErrors(i.selectedBlockType,"minBlocks")}]),autocomplete:"off",autocorrect:"off",autocapitalize:"off",size:"2"},null,2),[[Mn,i.selectedBlockType.minBlocks]])]),o.getErrors(i.selectedBlockType,"minBlocks")?(ge(),Se("ul",wue,[(ge(!0),Se(kt,null,Zt(o.getErrors(i.selectedBlockType,"minBlocks"),(y,_)=>(ge(),Se("li",{key:_},Ne(y),1))),128))])):_t("",!0)]),ee("div",kue,[ee("div",xue,[ee("label",Sue,Ne(t.t("vizy","Max Blocks")),1)]),ee("div",Cue,[ee("p",null,Ne(t.t("vizy","The maximum number of blocks of this type the field is allowed to have.")),1)]),ee("div",Tue,[Ut(ee("input",{id:"maxBlocks",ref:"maxBlocks-field","onUpdate:modelValue":e[9]||(e[9]=y=>i.selectedBlockType.maxBlocks=y),type:"text",class:gt(["text",{error:o.hasErrors(i.selectedBlockType,"maxBlocks")}]),autocomplete:"off",autocorrect:"off",autocapitalize:"off",size:"2"},null,2),[[Mn,i.selectedBlockType.maxBlocks]])]),o.getErrors(i.selectedBlockType,"maxBlocks")?(ge(),Se("ul",Eue,[(ge(!0),Se(kt,null,Zt(o.getErrors(i.selectedBlockType,"maxBlocks"),(y,_)=>(ge(),Se("li",{key:_},Ne(y),1))),128))])):_t("",!0)])])):(ge(),Se("div",Aue,[i.fieldData.length?(ge(),Se("p",Oue,Ne(t.t("vizy","Select a block to edit.")),1)):(ge(),Se("p",Mue,Ne(t.t("vizy","Add a new group to begin.")),1)),Lue]))])}const Iue=Bt(ele,[["render",Nue]]);typeof Craft.Vizy>"u"&&(Craft.Vizy={});Craft.Vizy.Config=new aee;document.dispatchEvent(new CustomEvent("onVizyConfigReady",{bubbles:!0}));Craft.Vizy.Input=Garnish.Base.extend({init(t){const e=`#${t}-field .input`,n=A6({components:{VizyInput:kA}});n.component("VizyInput",kA),!document.querySelector(e).__vueInit&&n.mount(e)}});Craft.Vizy.Settings=Garnish.Base.extend({init(t,e,n){this.inputNamePrefix=t,this.inputIdPrefix=Craft.formatInputId(this.inputNamePrefix),A6({components:{VizySettings:Iue},data(){return{fieldData:e,settings:n}}}).mount(`.${this.inputIdPrefix}-vizy-configurator`)}});$(document).ready(()=>{Craft.VizyReady=!0,document.dispatchEvent(new CustomEvent("vizy-loaded"))})});export default Pue(); -//# sourceMappingURL=vizy-1d31d33d.js.map -======== -`+P:E=q+P),x.print_newline(!1),E&&(k.text=E,k.whitespace_before="",k.newlines=0,x.add_raw_token(k),x.print_newline(!0))}},v.prototype._handle_tag_open=function(x,k,A,L){var E=this._get_tag_open_token(k);return(A.is_unformatted||A.is_content_unformatted)&&!A.is_empty_element&&k.type===r.TAG_OPEN&&k.text.indexOf("]*)/),this.tag_check=A?A[1]:""):(A=k.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=A?A[1]:"",(k.text.startsWith("{{#>")||k.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&k.next!==null?this.tag_check=k.next.text.split(" ")[0]:this.tag_check=k.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),k.type===r.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||k.closed&&k.closed.text==="/>";var L=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(L=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(L)))}};v.prototype._get_tag_open_token=function(x){var k=new y(this._tag_stack.get_parser_token(),x);return k.alignment_size=this._options.wrap_attributes_indent_size,k.is_end_tag=k.is_end_tag||f(k.tag_check,this._options.void_elements),k.is_empty_element=k.tag_complete||k.is_start_tag&&k.is_end_tag,k.is_unformatted=!k.tag_complete&&f(k.tag_check,this._options.unformatted),k.is_content_unformatted=!k.is_empty_element&&f(k.tag_check,this._options.content_unformatted),k.is_inline_element=f(k.tag_name,this._options.inline)||k.tag_name.includes("-")||k.tag_start_char==="{",k},v.prototype._set_tag_position=function(x,k,A,L,E){if(A.is_empty_element||(A.is_end_tag?A.start_tag_token=this._tag_stack.try_pop(A.tag_name):(this._do_optional_end_element(A)&&(A.is_inline_element||x.print_newline(!1)),this._tag_stack.record_tag(A),(A.tag_name==="script"||A.tag_name==="style")&&!(A.is_unformatted||A.is_content_unformatted)&&(A.custom_beautifier_name=u(A.tag_check,k)))),f(A.tag_check,this._options.extra_liners)&&(x.print_newline(!1),x._output.just_added_blankline()||x.print_newline(!0)),A.is_empty_element){if(A.tag_start_char==="{"&&A.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),A.indent_content=!0;var H=x.current_line_has_match(/{{#if/);H||x.print_newline(!1)}A.tag_name==="!--"&&E.type===r.TAG_CLOSE&&L.is_end_tag&&A.text.indexOf(` -`)===-1||(A.is_inline_element||A.is_unformatted||x.print_newline(!1),this._calcluate_parent_multiline(x,A))}else if(A.is_end_tag){var I=!1;I=A.start_tag_token&&A.start_tag_token.multiline_content,I=I||!A.is_inline_element&&!(L.is_inline_element||L.is_unformatted)&&!(E.type===r.TAG_CLOSE&&A.start_tag_token===L)&&E.type!=="TK_CONTENT",(A.is_content_unformatted||A.is_unformatted)&&(I=!1),I&&x.print_newline(!1)}else A.indent_content=!A.custom_beautifier_name,A.tag_start_char==="<"&&(A.tag_name==="html"?A.indent_content=this._options.indent_inner_html:A.tag_name==="head"?A.indent_content=this._options.indent_head_inner_html:A.tag_name==="body"&&(A.indent_content=this._options.indent_body_inner_html)),!(A.is_inline_element||A.is_unformatted)&&(E.type!=="TK_CONTENT"||A.is_content_unformatted)&&x.print_newline(!1),this._calcluate_parent_multiline(x,A)},v.prototype._calcluate_parent_multiline=function(x,k){k.parent&&x._output.just_added_newline()&&!((k.is_inline_element||k.is_unformatted)&&k.parent.is_inline_element)&&(k.parent.multiline_content=!0)};var _=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],C=["a","audio","del","ins","map","noscript","video"];return v.prototype._do_optional_end_element=function(x){var k=null;if(!(x.is_empty_element||!x.is_start_tag||!x.parent)){if(x.tag_name==="body")k=k||this._tag_stack.try_pop("head");else if(x.tag_name==="li")k=k||this._tag_stack.try_pop("li",["ol","ul"]);else if(x.tag_name==="dd"||x.tag_name==="dt")k=k||this._tag_stack.try_pop("dt",["dl"]),k=k||this._tag_stack.try_pop("dd",["dl"]);else if(x.parent.tag_name==="p"&&_.indexOf(x.tag_name)!==-1){var A=x.parent.parent;(!A||C.indexOf(A.tag_name)===-1)&&(k=k||this._tag_stack.try_pop("p"))}else x.tag_name==="rp"||x.tag_name==="rt"?(k=k||this._tag_stack.try_pop("rt",["ruby","rtc"]),k=k||this._tag_stack.try_pop("rp",["ruby","rtc"])):x.tag_name==="optgroup"?k=k||this._tag_stack.try_pop("optgroup",["select"]):x.tag_name==="option"?k=k||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):x.tag_name==="colgroup"?k=k||this._tag_stack.try_pop("caption",["table"]):x.tag_name==="thead"?(k=k||this._tag_stack.try_pop("caption",["table"]),k=k||this._tag_stack.try_pop("colgroup",["table"])):x.tag_name==="tbody"||x.tag_name==="tfoot"?(k=k||this._tag_stack.try_pop("caption",["table"]),k=k||this._tag_stack.try_pop("colgroup",["table"]),k=k||this._tag_stack.try_pop("thead",["table"]),k=k||this._tag_stack.try_pop("tbody",["table"])):x.tag_name==="tr"?(k=k||this._tag_stack.try_pop("caption",["table"]),k=k||this._tag_stack.try_pop("colgroup",["table"]),k=k||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(x.tag_name==="th"||x.tag_name==="td")&&(k=k||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),k=k||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return x.parent=this._tag_stack.get_parser_token(),k}},C0.Beautifier=v,C0}var ZE;function wse(){if(ZE)return Rf;ZE=1;var t=_se().Beautifier,e=FL().Options;function n(r,i,o,s){var l=new t(r,i,o,s);return l.beautify()}return bse.exports=n,Rf.defaultOptions=function(){return new e},Rf}var QE;function kse(){if(QE)return Jc;QE=1;var t=mse(),e=yse(),n=wse();function r(i,o,s,l){return s=s||t,l=l||e,n(i,o,s,l)}return r.defaultOptions=n.defaultOptions,Jc.js=t,Jc.css=e,Jc.html=r,Jc}(function(t){function e(n,r,i){var o=function(s,l){return n.js_beautify(s,l)};return o.js=n.js_beautify,o.css=r.css_beautify,o.html=i.html_beautify,o.js_beautify=n.js_beautify,o.css_beautify=r.css_beautify,o.html_beautify=i.html_beautify,o}(function(n){var r=kse();r.js_beautify=r.js,r.css_beautify=r.css,r.html_beautify=r.html,n.exports=e(r,r,r)})(t)})(cse);const xse=v1;var eA={},tA;function Sse(){return tA||(tA=1,function(t,e){(function(n){n(Mr())})(function(n){n.overlayMode=function(r,i,o){return{startState:function(){return{base:n.startState(r),overlay:n.startState(i),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(s){return{base:n.copyState(r,s.base),overlay:n.copyState(i,s.overlay),basePos:s.basePos,baseCur:null,overlayPos:s.overlayPos,overlayCur:null}},token:function(s,l){return(s!=l.streamSeen||Math.min(l.basePos,l.overlayPos)")):null:D.match("--")?ce(x("comment","-->")):D.match("DOCTYPE",!0,!0)?(D.eatWhile(/[\w\._\-]/),ce(k(1))):null:D.eat("?")?(D.eatWhile(/[\w\._\-]/),ae.tokenize=x("meta","?>"),"meta"):(m=D.eat("/")?"closeTag":"openTag",ae.tokenize=_,"tag bracket");if(ve=="&"){var ze;return D.eat("#")?D.eat("x")?ze=D.eatWhile(/[a-fA-F\d]/)&&D.eat(";"):ze=D.eatWhile(/[\d]/)&&D.eat(";"):ze=D.eatWhile(/[\w\.\-:]/)&&D.eat(";"),ze?"atom":"error"}else return D.eatWhile(/[^&<]/),null}y.isInText=!0;function _(D,ae){var ce=D.next();if(ce==">"||ce=="/"&&D.eat(">"))return ae.tokenize=y,m=ce==">"?"endTag":"selfcloseTag","tag bracket";if(ce=="=")return m="equals",null;if(ce=="<"){ae.tokenize=y,ae.state=I,ae.tagName=ae.tagStart=null;var ve=ae.tokenize(D,ae);return ve?ve+" tag error":"tag error"}else return/[\'\"]/.test(ce)?(ae.tokenize=C(ce),ae.stringStartCol=D.column(),ae.tokenize(D,ae)):(D.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function C(D){var ae=function(ce,ve){for(;!ce.eol();)if(ce.next()==D){ve.tokenize=_;break}return"string"};return ae.isInAttribute=!0,ae}function x(D,ae){return function(ce,ve){for(;!ce.eol();){if(ce.match(ae)){ve.tokenize=y;break}ce.next()}return D}}function k(D){return function(ae,ce){for(var ve;(ve=ae.next())!=null;){if(ve=="<")return ce.tokenize=k(D+1),ce.tokenize(ae,ce);if(ve==">")if(D==1){ce.tokenize=y;break}else return ce.tokenize=k(D-1),ce.tokenize(ae,ce)}return"meta"}}function A(D){return D&&D.toLowerCase()}function L(D,ae,ce){this.prev=D.context,this.tagName=ae||"",this.indent=D.indented,this.startOfLine=ce,(u.doNotIndent.hasOwnProperty(ae)||D.context&&D.context.noIndent)&&(this.noIndent=!0)}function E(D){D.context&&(D.context=D.context.prev)}function H(D,ae){for(var ce;;){if(!D.context||(ce=D.context.tagName,!u.contextGrabbers.hasOwnProperty(A(ce))||!u.contextGrabbers[A(ce)].hasOwnProperty(A(ae))))return;E(D)}}function I(D,ae,ce){return D=="openTag"?(ce.tagStart=ae.column(),q):D=="closeTag"?P:I}function q(D,ae,ce){return D=="word"?(ce.tagName=ae.current(),v="tag",R):u.allowMissingTagName&&D=="endTag"?(v="tag bracket",R(D,ae,ce)):(v="error",q)}function P(D,ae,ce){if(D=="word"){var ve=ae.current();return ce.context&&ce.context.tagName!=ve&&u.implicitlyClosed.hasOwnProperty(A(ce.context.tagName))&&E(ce),ce.context&&ce.context.tagName==ve||u.matchClosing===!1?(v="tag",z):(v="tag error",w)}else return u.allowMissingTagName&&D=="endTag"?(v="tag bracket",z(D,ae,ce)):(v="error",w)}function z(D,ae,ce){return D!="endTag"?(v="error",z):(E(ce),I)}function w(D,ae,ce){return v="error",z(D,ae,ce)}function R(D,ae,ce){if(D=="word")return v="attribute",U;if(D=="endTag"||D=="selfcloseTag"){var ve=ce.tagName,ze=ce.tagStart;return ce.tagName=ce.tagStart=null,D=="selfcloseTag"||u.autoSelfClosers.hasOwnProperty(A(ve))?H(ce,ve):(H(ce,ve),ce.context=new L(ce,ve,ze==ce.indented)),I}return v="error",R}function U(D,ae,ce){return D=="equals"?K:(u.allowMissing||(v="error"),R(D,ae,ce))}function K(D,ae,ce){return D=="string"?oe:D=="word"&&u.allowUnquoted?(v="string",R):(v="error",R(D,ae,ce))}function oe(D,ae,ce){return D=="string"?oe:R(D,ae,ce)}return{startState:function(D){var ae={tokenize:y,state:I,indented:D||0,tagName:null,tagStart:null,context:null};return D!=null&&(ae.baseIndent=D),ae},token:function(D,ae){if(!ae.tagName&&D.sol()&&(ae.indented=D.indentation()),D.eatSpace())return null;m=null;var ce=ae.tokenize(D,ae);return(ce||m)&&ce!="comment"&&(v=null,ae.state=ae.state(m||ce,D,ae),v&&(ce=v=="error"?ce+" error":v)),ce},indent:function(D,ae,ce){var ve=D.context;if(D.tokenize.isInAttribute)return D.tagStart==D.indented?D.stringStartCol+1:D.indented+l;if(ve&&ve.noIndent)return n.Pass;if(D.tokenize!=_&&D.tokenize!=y)return ce?ce.match(/^(\s*)/)[0].length:0;if(D.tagName)return u.multilineTagIndentPastTag!==!1?D.tagStart+D.tagName.length+2:D.tagStart+l*(u.multilineTagIndentFactor||1);if(u.alignCDATA&&/$/,blockCommentStart:"",configuration:u.htmlMode?"html":"xml",helperType:u.htmlMode?"html":"xml",skipAttribute:function(D){D.state==K&&(D.state=R)},xmlCurrentTag:function(D){return D.tagName?{name:D.tagName,close:D.type=="closeTag"}:null},xmlCurrentContext:function(D){for(var ae=[],ce=D.context;ce;ce=ce.prev)ae.push(ce.tagName);return ae.reverse()}}}),n.defineMIME("text/xml","xml"),n.defineMIME("application/xml","xml"),n.mimeModes.hasOwnProperty("text/html")||n.defineMIME("text/html",{name:"xml",htmlMode:!0})})}()),nA}var iA={},oA;function Gw(){return oA||(oA=1,function(t,e){(function(n){n(Mr())})(function(n){n.defineMode("javascript",function(r,i){var o=r.indentUnit,s=i.statementIndent,l=i.jsonld,u=i.json||l,f=i.trackScope!==!1,d=i.typescript,m=i.wordCharacters||/[\w$\xa1-\uffff]/,v=function(){function V(Cn){return{type:Cn,style:"keyword"}}var ne=V("keyword a"),se=V("keyword b"),we=V("keyword c"),ft=V("keyword d"),At=V("operator"),It={type:"atom",style:"atom"};return{if:V("if"),while:ne,with:ne,else:se,do:se,try:se,finally:se,return:ft,break:ft,continue:ft,new:V("new"),delete:we,void:we,throw:we,debugger:V("debugger"),var:V("var"),const:V("var"),let:V("var"),function:V("function"),catch:V("catch"),for:V("for"),switch:V("switch"),case:V("case"),default:V("default"),in:At,typeof:At,instanceof:At,true:It,false:It,null:It,undefined:It,NaN:It,Infinity:It,this:V("this"),class:V("class"),super:V("atom"),yield:we,export:V("export"),import:V("import"),extends:we,await:we}}(),y=/[+\-*&%=<>!?|~^@]/,_=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function C(V){for(var ne=!1,se,we=!1;(se=V.next())!=null;){if(!ne){if(se=="/"&&!we)return;se=="["?we=!0:we&&se=="]"&&(we=!1)}ne=!ne&&se=="\\"}}var x,k;function A(V,ne,se){return x=V,k=se,ne}function L(V,ne){var se=V.next();if(se=='"'||se=="'")return ne.tokenize=E(se),ne.tokenize(V,ne);if(se=="."&&V.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return A("number","number");if(se=="."&&V.match(".."))return A("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(se))return A(se);if(se=="="&&V.eat(">"))return A("=>","operator");if(se=="0"&&V.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return A("number","number");if(/\d/.test(se))return V.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),A("number","number");if(se=="/")return V.eat("*")?(ne.tokenize=H,H(V,ne)):V.eat("/")?(V.skipToEnd(),A("comment","comment")):Xi(V,ne,1)?(C(V),V.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),A("regexp","string-2")):(V.eat("="),A("operator","operator",V.current()));if(se=="`")return ne.tokenize=I,I(V,ne);if(se=="#"&&V.peek()=="!")return V.skipToEnd(),A("meta","meta");if(se=="#"&&V.eatWhile(m))return A("variable","property");if(se=="<"&&V.match("!--")||se=="-"&&V.match("->")&&!/\S/.test(V.string.slice(0,V.start)))return V.skipToEnd(),A("comment","comment");if(y.test(se))return(se!=">"||!ne.lexical||ne.lexical.type!=">")&&(V.eat("=")?(se=="!"||se=="=")&&V.eat("="):/[<>*+\-|&?]/.test(se)&&(V.eat(se),se==">"&&V.eat(se))),se=="?"&&V.eat(".")?A("."):A("operator","operator",V.current());if(m.test(se)){V.eatWhile(m);var we=V.current();if(ne.lastType!="."){if(v.propertyIsEnumerable(we)){var ft=v[we];return A(ft.type,ft.style,we)}if(we=="async"&&V.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return A("async","keyword",we)}return A("variable","variable",we)}}function E(V){return function(ne,se){var we=!1,ft;if(l&&ne.peek()=="@"&&ne.match(_))return se.tokenize=L,A("jsonld-keyword","meta");for(;(ft=ne.next())!=null&&!(ft==V&&!we);)we=!we&&ft=="\\";return we||(se.tokenize=L),A("string","string")}}function H(V,ne){for(var se=!1,we;we=V.next();){if(we=="/"&&se){ne.tokenize=L;break}se=we=="*"}return A("comment","comment")}function I(V,ne){for(var se=!1,we;(we=V.next())!=null;){if(!se&&(we=="`"||we=="$"&&V.eat("{"))){ne.tokenize=L;break}se=!se&&we=="\\"}return A("quasi","string-2",V.current())}var q="([{}])";function P(V,ne){ne.fatArrowAt&&(ne.fatArrowAt=null);var se=V.string.indexOf("=>",V.start);if(!(se<0)){if(d){var we=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(V.string.slice(V.start,se));we&&(se=we.index)}for(var ft=0,At=!1,It=se-1;It>=0;--It){var Cn=V.string.charAt(It),Jr=q.indexOf(Cn);if(Jr>=0&&Jr<3){if(!ft){++It;break}if(--ft==0){Cn=="("&&(At=!0);break}}else if(Jr>=3&&Jr<6)++ft;else if(m.test(Cn))At=!0;else if(/["'\/`]/.test(Cn))for(;;--It){if(It==0)return;var dt=V.string.charAt(It-1);if(dt==Cn&&V.string.charAt(It-2)!="\\"){It--;break}}else if(At&&!ft){++It;break}}At&&!ft&&(ne.fatArrowAt=It)}}var z={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function w(V,ne,se,we,ft,At){this.indented=V,this.column=ne,this.type=se,this.prev=ft,this.info=At,we!=null&&(this.align=we)}function R(V,ne){if(!f)return!1;for(var se=V.localVars;se;se=se.next)if(se.name==ne)return!0;for(var we=V.context;we;we=we.prev)for(var se=we.vars;se;se=se.next)if(se.name==ne)return!0}function U(V,ne,se,we,ft){var At=V.cc;for(K.state=V,K.stream=ft,K.marked=null,K.cc=At,K.style=ne,V.lexical.hasOwnProperty("align")||(V.lexical.align=!0);;){var It=At.length?At.pop():u?Fe:Ze;if(It(se,we)){for(;At.length&&At[At.length-1].lex;)At.pop()();return K.marked?K.marked:se=="variable"&&R(V,we)?"variable-2":ne}}}var K={state:null,column:null,marked:null,cc:null};function oe(){for(var V=arguments.length-1;V>=0;V--)K.cc.push(arguments[V])}function D(){return oe.apply(null,arguments),!0}function ae(V,ne){for(var se=ne;se;se=se.next)if(se.name==V)return!0;return!1}function ce(V){var ne=K.state;if(K.marked="def",!!f){if(ne.context){if(ne.lexical.info=="var"&&ne.context&&ne.context.block){var se=ve(V,ne.context);if(se!=null){ne.context=se;return}}else if(!ae(V,ne.localVars)){ne.localVars=new yt(V,ne.localVars);return}}i.globalVars&&!ae(V,ne.globalVars)&&(ne.globalVars=new yt(V,ne.globalVars))}}function ve(V,ne){if(ne)if(ne.block){var se=ve(V,ne.prev);return se?se==ne.prev?ne:new qe(se,ne.vars,!0):null}else return ae(V,ne.vars)?ne:new qe(ne.prev,new yt(V,ne.vars),!1);else return null}function ze(V){return V=="public"||V=="private"||V=="protected"||V=="abstract"||V=="readonly"}function qe(V,ne,se){this.prev=V,this.vars=ne,this.block=se}function yt(V,ne){this.name=V,this.next=ne}var mt=new yt("this",new yt("arguments",null));function _t(){K.state.context=new qe(K.state.context,K.state.localVars,!1),K.state.localVars=mt}function bt(){K.state.context=new qe(K.state.context,K.state.localVars,!0),K.state.localVars=null}_t.lex=bt.lex=!0;function Xe(){K.state.localVars=K.state.context.vars,K.state.context=K.state.context.prev}Xe.lex=!0;function Ie(V,ne){var se=function(){var we=K.state,ft=we.indented;if(we.lexical.type=="stat")ft=we.lexical.indented;else for(var At=we.lexical;At&&At.type==")"&&At.align;At=At.prev)ft=At.indented;we.lexical=new w(ft,K.stream.column(),V,null,we.lexical,ne)};return se.lex=!0,se}function Be(){var V=K.state;V.lexical.prev&&(V.lexical.type==")"&&(V.indented=V.lexical.indented),V.lexical=V.lexical.prev)}Be.lex=!0;function Ee(V){function ne(se){return se==V?D():V==";"||se=="}"||se==")"||se=="]"?oe():D(ne)}return ne}function Ze(V,ne){return V=="var"?D(Ie("vardef",ne),Yr,Ee(";"),Be):V=="keyword a"?D(Ie("form"),ie,Ze,Be):V=="keyword b"?D(Ie("form"),Ze,Be):V=="keyword d"?K.stream.match(/^\s*$/,!1)?D():D(Ie("stat"),be,Ee(";"),Be):V=="debugger"?D(Ee(";")):V=="{"?D(Ie("}"),bt,Te,Be,Xe):V==";"?D():V=="if"?(K.state.lexical.info=="else"&&K.state.cc[K.state.cc.length-1]==Be&&K.state.cc.pop()(),D(Ie("form"),ie,Ze,Be,Pl)):V=="function"?D(Yi):V=="for"?D(Ie("form"),bt,Ud,Ze,Xe,Be):V=="class"||d&&ne=="interface"?(K.marked="keyword",D(Ie("form",V=="class"?V:ne),Kd,Be)):V=="variable"?d&&ne=="declare"?(K.marked="keyword",D(Ze)):d&&(ne=="module"||ne=="enum"||ne=="type")&&K.stream.match(/^\s*\w/,!1)?(K.marked="keyword",ne=="enum"?D(Rl):ne=="type"?D(qd,Ee("operator"),me,Ee(";")):D(Ie("form"),Sn,Ee("{"),Ie("}"),Te,Be,Be)):d&&ne=="namespace"?(K.marked="keyword",D(Ie("form"),Fe,Ze,Be)):d&&ne=="abstract"?(K.marked="keyword",D(Ze)):D(Ie("stat"),Q):V=="switch"?D(Ie("form"),ie,Ee("{"),Ie("}","switch"),bt,Te,Be,Be,Xe):V=="case"?D(Fe,Ee(":")):V=="default"?D(Ee(":")):V=="catch"?D(Ie("form"),_t,Ke,Ze,Be,Xe):V=="export"?D(Ie("stat"),fs,Be):V=="import"?D(Ie("stat"),So,Be):V=="async"?D(Ze):ne=="@"?D(Fe,Ze):oe(Ie("stat"),Fe,Ee(";"),Be)}function Ke(V){if(V=="(")return D(Ci,Ee(")"))}function Fe(V,ne){return te(V,ne,!1)}function at(V,ne){return te(V,ne,!0)}function ie(V){return V!="("?oe():D(Ie(")"),be,Ee(")"),Be)}function te(V,ne,se){if(K.state.fatArrowAt==K.stream.start){var we=se?W:N;if(V=="(")return D(_t,Ie(")"),X(Ci,")"),Be,Ee("=>"),we,Xe);if(V=="variable")return oe(_t,Sn,Ee("=>"),we,Xe)}var ft=se?xe:_e;return z.hasOwnProperty(V)?D(ft):V=="function"?D(Yi,ft):V=="class"||d&&ne=="interface"?(K.marked="keyword",D(Ie("form"),cs,Be)):V=="keyword c"||V=="async"?D(se?at:Fe):V=="("?D(Ie(")"),be,Ee(")"),Be,ft):V=="operator"||V=="spread"?D(se?at:Fe):V=="["?D(Ie("]"),Co,Be,ft):V=="{"?de(pe,"}",null,ft):V=="quasi"?oe(G,ft):V=="new"?D(O(se)):D()}function be(V){return V.match(/[;\}\)\],]/)?oe():oe(Fe)}function _e(V,ne){return V==","?D(be):xe(V,ne,!1)}function xe(V,ne,se){var we=se==!1?_e:xe,ft=se==!1?Fe:at;if(V=="=>")return D(_t,se?W:N,Xe);if(V=="operator")return/\+\+|--/.test(ne)||d&&ne=="!"?D(we):d&&ne=="<"&&K.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?D(Ie(">"),X(me,">"),Be,we):ne=="?"?D(Fe,Ee(":"),ft):D(ft);if(V=="quasi")return oe(G,we);if(V!=";"){if(V=="(")return de(at,")","call",we);if(V==".")return D(le,we);if(V=="[")return D(Ie("]"),be,Ee("]"),Be,we);if(d&&ne=="as")return K.marked="keyword",D(me,we);if(V=="regexp")return K.state.lastType=K.marked="operator",K.stream.backUp(K.stream.pos-K.stream.start-1),D(ft)}}function G(V,ne){return V!="quasi"?oe():ne.slice(ne.length-2)!="${"?D(G):D(be,Z)}function Z(V){if(V=="}")return K.marked="string-2",K.state.tokenize=I,D(G)}function N(V){return P(K.stream,K.state),oe(V=="{"?Ze:Fe)}function W(V){return P(K.stream,K.state),oe(V=="{"?Ze:at)}function O(V){return function(ne){return ne=="."?D(V?F:j):ne=="variable"&&d?D(Gt,V?xe:_e):oe(V?at:Fe)}}function j(V,ne){if(ne=="target")return K.marked="keyword",D(_e)}function F(V,ne){if(ne=="target")return K.marked="keyword",D(xe)}function Q(V){return V==":"?D(Be,Ze):oe(_e,Ee(";"),Be)}function le(V){if(V=="variable")return K.marked="property",D()}function pe(V,ne){if(V=="async")return K.marked="property",D(pe);if(V=="variable"||K.style=="keyword"){if(K.marked="property",ne=="get"||ne=="set")return D(ye);var se;return d&&K.state.fatArrowAt==K.stream.start&&(se=K.stream.match(/^\s*:\s*/,!1))&&(K.state.fatArrowAt=K.stream.pos+se[0].length),D(Y)}else{if(V=="number"||V=="string")return K.marked=l?"property":K.style+" property",D(Y);if(V=="jsonld-keyword")return D(Y);if(d&&ze(ne))return K.marked="keyword",D(pe);if(V=="[")return D(Fe,je,Ee("]"),Y);if(V=="spread")return D(at,Y);if(ne=="*")return K.marked="keyword",D(pe);if(V==":")return oe(Y)}}function ye(V){return V!="variable"?oe(Y):(K.marked="property",D(Yi))}function Y(V){if(V==":")return D(at);if(V=="(")return oe(Yi)}function X(V,ne,se){function we(ft,At){if(se?se.indexOf(ft)>-1:ft==","){var It=K.state.lexical;return It.info=="call"&&(It.pos=(It.pos||0)+1),D(function(Cn,Jr){return Cn==ne||Jr==ne?oe():oe(V)},we)}return ft==ne||At==ne?D():se&&se.indexOf(";")>-1?oe(V):D(Ee(ne))}return function(ft,At){return ft==ne||At==ne?D():oe(V,we)}}function de(V,ne,se){for(var we=3;we"),me);if(V=="quasi")return oe(Tt,Xt)}function Je(V){if(V=="=>")return D(me)}function ct(V){return V.match(/[\}\)\]]/)?D():V==","||V==";"?D(ct):oe(ot,ct)}function ot(V,ne){if(V=="variable"||K.style=="keyword")return K.marked="property",D(ot);if(ne=="?"||V=="number"||V=="string")return D(ot);if(V==":")return D(me);if(V=="[")return D(Ee("variable"),he,Ee("]"),ot);if(V=="(")return oe(Ji,ot);if(!V.match(/[;\}\)\],]/))return D()}function Tt(V,ne){return V!="quasi"?oe():ne.slice(ne.length-2)!="${"?D(Tt):D(me,br)}function br(V){if(V=="}")return K.marked="string-2",K.state.tokenize=I,D(Tt)}function Kt(V,ne){return V=="variable"&&K.stream.match(/^\s*[?:]/,!1)||ne=="?"?D(Kt):V==":"?D(me):V=="spread"?D(Kt):oe(me)}function Xt(V,ne){if(ne=="<")return D(Ie(">"),X(me,">"),Be,Xt);if(ne=="|"||V=="."||ne=="&")return D(me);if(V=="[")return D(me,Ee("]"),Xt);if(ne=="extends"||ne=="implements")return K.marked="keyword",D(me);if(ne=="?")return D(me,Ee(":"),me)}function Gt(V,ne){if(ne=="<")return D(Ie(">"),X(me,">"),Be,Xt)}function Kn(){return oe(me,Gr)}function Gr(V,ne){if(ne=="=")return D(me)}function Yr(V,ne){return ne=="enum"?(K.marked="keyword",D(Rl)):oe(Sn,je,ci,hv)}function Sn(V,ne){if(d&&ze(ne))return K.marked="keyword",D(Sn);if(V=="variable")return ce(ne),D();if(V=="spread")return D(Sn);if(V=="[")return de(dv,"]");if(V=="{")return de(pc,"}")}function pc(V,ne){return V=="variable"&&!K.stream.match(/^\s*:/,!1)?(ce(ne),D(ci)):(V=="variable"&&(K.marked="property"),V=="spread"?D(Sn):V=="}"?oe():V=="["?D(Fe,Ee("]"),Ee(":"),pc):D(Ee(":"),Sn,ci))}function dv(){return oe(Sn,ci)}function ci(V,ne){if(ne=="=")return D(at)}function hv(V){if(V==",")return D(Yr)}function Pl(V,ne){if(V=="keyword b"&&ne=="else")return D(Ie("form","else"),Ze,Be)}function Ud(V,ne){if(ne=="await")return D(Ud);if(V=="(")return D(Ie(")"),mc,Be)}function mc(V){return V=="var"?D(Yr,us):V=="variable"?D(us):oe(us)}function us(V,ne){return V==")"?D():V==";"?D(us):ne=="in"||ne=="of"?(K.marked="keyword",D(Fe,us)):oe(Fe,us)}function Yi(V,ne){if(ne=="*")return K.marked="keyword",D(Yi);if(V=="variable")return ce(ne),D(Yi);if(V=="(")return D(_t,Ie(")"),X(Ci,")"),Be,Ae,Ze,Xe);if(d&&ne=="<")return D(Ie(">"),X(Kn,">"),Be,Yi)}function Ji(V,ne){if(ne=="*")return K.marked="keyword",D(Ji);if(V=="variable")return ce(ne),D(Ji);if(V=="(")return D(_t,Ie(")"),X(Ci,")"),Be,Ae,Xe);if(d&&ne=="<")return D(Ie(">"),X(Kn,">"),Be,Ji)}function qd(V,ne){if(V=="keyword"||V=="variable")return K.marked="type",D(qd);if(ne=="<")return D(Ie(">"),X(Kn,">"),Be)}function Ci(V,ne){return ne=="@"&&D(Fe,Ci),V=="spread"?D(Ci):d&&ze(ne)?(K.marked="keyword",D(Ci)):d&&V=="this"?D(je,ci):oe(Sn,je,ci)}function cs(V,ne){return V=="variable"?Kd(V,ne):Dl(V,ne)}function Kd(V,ne){if(V=="variable")return ce(ne),D(Dl)}function Dl(V,ne){if(ne=="<")return D(Ie(">"),X(Kn,">"),Be,Dl);if(ne=="extends"||ne=="implements"||d&&V==",")return ne=="implements"&&(K.marked="keyword"),D(d?me:Fe,Dl);if(V=="{")return D(Ie("}"),Nr,Be)}function Nr(V,ne){if(V=="async"||V=="variable"&&(ne=="static"||ne=="get"||ne=="set"||d&&ze(ne))&&K.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return K.marked="keyword",D(Nr);if(V=="variable"||K.style=="keyword")return K.marked="property",D(xo,Nr);if(V=="number"||V=="string")return D(xo,Nr);if(V=="[")return D(Fe,je,Ee("]"),xo,Nr);if(ne=="*")return K.marked="keyword",D(Nr);if(d&&V=="(")return oe(Ji,Nr);if(V==";"||V==",")return D(Nr);if(V=="}")return D();if(ne=="@")return D(Fe,Nr)}function xo(V,ne){if(ne=="!"||ne=="?")return D(xo);if(V==":")return D(me,ci);if(ne=="=")return D(at);var se=K.state.lexical.prev,we=se&&se.info=="interface";return oe(we?Ji:Yi)}function fs(V,ne){return ne=="*"?(K.marked="keyword",D(Ge,Ee(";"))):ne=="default"?(K.marked="keyword",D(Fe,Ee(";"))):V=="{"?D(X(Gd,"}"),Ge,Ee(";")):oe(Ze)}function Gd(V,ne){if(ne=="as")return K.marked="keyword",D(Ee("variable"));if(V=="variable")return oe(at,Gd)}function So(V){return V=="string"?D():V=="("?oe(Fe):V=="."?oe(_e):oe(ds,gc,Ge)}function ds(V,ne){return V=="{"?de(ds,"}"):(V=="variable"&&ce(ne),ne=="*"&&(K.marked="keyword"),D(ln))}function gc(V){if(V==",")return D(ds,gc)}function ln(V,ne){if(ne=="as")return K.marked="keyword",D(ds)}function Ge(V,ne){if(ne=="from")return K.marked="keyword",D(Fe)}function Co(V){return V=="]"?D():oe(X(at,"]"))}function Rl(){return oe(Ie("form"),Sn,Ee("{"),Ie("}"),X(fi,"}"),Be,Be)}function fi(){return oe(Sn,ci)}function $t(V,ne){return V.lastType=="operator"||V.lastType==","||y.test(ne.charAt(0))||/[,.]/.test(ne.charAt(0))}function Xi(V,ne,se){return ne.tokenize==L&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(ne.lastType)||ne.lastType=="quasi"&&/\{\s*$/.test(V.string.slice(0,V.pos-(se||0)))}return{startState:function(V){var ne={tokenize:L,lastType:"sof",cc:[],lexical:new w((V||0)-o,0,"block",!1),localVars:i.localVars,context:i.localVars&&new qe(null,null,!1),indented:V||0};return i.globalVars&&typeof i.globalVars=="object"&&(ne.globalVars=i.globalVars),ne},token:function(V,ne){if(V.sol()&&(ne.lexical.hasOwnProperty("align")||(ne.lexical.align=!1),ne.indented=V.indentation(),P(V,ne)),ne.tokenize!=H&&V.eatSpace())return null;var se=ne.tokenize(V,ne);return x=="comment"?se:(ne.lastType=x=="operator"&&(k=="++"||k=="--")?"incdec":x,U(ne,se,x,k,V))},indent:function(V,ne){if(V.tokenize==H||V.tokenize==I)return n.Pass;if(V.tokenize!=L)return 0;var se=ne&&ne.charAt(0),we=V.lexical,ft;if(!/^\s*else\b/.test(ne))for(var At=V.cc.length-1;At>=0;--At){var It=V.cc[At];if(It==Be)we=we.prev;else if(It!=Pl&&It!=Xe)break}for(;(we.type=="stat"||we.type=="form")&&(se=="}"||(ft=V.cc[V.cc.length-1])&&(ft==_e||ft==xe)&&!/^[,\.=+\-*:?[\(]/.test(ne));)we=we.prev;s&&we.type==")"&&we.prev.type=="stat"&&(we=we.prev);var Cn=we.type,Jr=se==Cn;return Cn=="vardef"?we.indented+(V.lastType=="operator"||V.lastType==","?we.info.length+1:0):Cn=="form"&&se=="{"?we.indented:Cn=="form"?we.indented+o:Cn=="stat"?we.indented+($t(V,ne)?s||o:0):we.info=="switch"&&!Jr&&i.doubleIndentSwitch!=!1?we.indented+(/^(?:case|default)\b/.test(ne)?o:2*o):we.align?we.column+(Jr?0:1):we.indented+(Jr?0:o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:u?null:"/*",blockCommentEnd:u?null:"*/",blockCommentContinue:u?null:" * ",lineComment:u?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:u?"json":"javascript",jsonldMode:l,jsonMode:u,expressionAllowed:Xi,skipExpression:function(V){U(V,"atom","atom","true",new n.StringStream("",2,null))}}}),n.registerHelper("wordChars","javascript",/[\w$]/),n.defineMIME("text/javascript","javascript"),n.defineMIME("text/ecmascript","javascript"),n.defineMIME("application/javascript","javascript"),n.defineMIME("application/x-javascript","javascript"),n.defineMIME("application/ecmascript","javascript"),n.defineMIME("application/json",{name:"javascript",json:!0}),n.defineMIME("application/x-json",{name:"javascript",json:!0}),n.defineMIME("application/manifest+json",{name:"javascript",json:!0}),n.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),n.defineMIME("text/typescript",{name:"javascript",typescript:!0}),n.defineMIME("application/typescript",{name:"javascript",typescript:!0})})}()),iA}var sA={},aA;function Cse(){return aA||(aA=1,function(t,e){(function(n){n(Mr())})(function(n){n.defineMode("coffeescript",function(r,i){var o="error";function s(w){return new RegExp("^(("+w.join(")|(")+"))\\b")}var l=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/,u=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,f=/^[_A-Za-z$][_A-Za-z$0-9]*/,d=/^@[_A-Za-z$][_A-Za-z$0-9]*/,m=s(["and","or","not","is","isnt","in","instanceof","typeof"]),v=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],y=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","@","throw","when","until","extends"],_=s(v.concat(y));v=s(v);var C=/^('{3}|\"{3}|['\"])/,x=/^(\/{3}|\/)/,k=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],A=s(k);function L(w,R){if(w.sol()){R.scope.align===null&&(R.scope.align=!1);var U=R.scope.offset;if(w.eatSpace()){var K=w.indentation();return K>U&&R.scope.type=="coffee"?"indent":K0&&q(w,R)}if(w.eatSpace())return null;var oe=w.peek();if(w.match("####"))return w.skipToEnd(),"comment";if(w.match("###"))return R.tokenize=H,R.tokenize(w,R);if(oe==="#")return w.skipToEnd(),"comment";if(w.match(/^-?[0-9\.]/,!1)){var D=!1;if(w.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(D=!0),w.match(/^-?\d+\.\d*/)&&(D=!0),w.match(/^-?\.\d+/)&&(D=!0),D)return w.peek()=="."&&w.backUp(1),"number";var ae=!1;if(w.match(/^-?0x[0-9a-f]+/i)&&(ae=!0),w.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(ae=!0),w.match(/^-?0(?![\dx])/i)&&(ae=!0),ae)return"number"}if(w.match(C))return R.tokenize=E(w.current(),!1,"string"),R.tokenize(w,R);if(w.match(x)){if(w.current()!="/"||w.match(/^.*\//,!1))return R.tokenize=E(w.current(),!0,"string-2"),R.tokenize(w,R);w.backUp(1)}return w.match(l)||w.match(m)?"operator":w.match(u)?"punctuation":w.match(A)?"atom":w.match(d)||R.prop&&w.match(f)?"property":w.match(_)?"keyword":w.match(f)?"variable":(w.next(),o)}function E(w,R,U){return function(K,oe){for(;!K.eol();)if(K.eatWhile(/[^'"\/\\]/),K.eat("\\")){if(K.next(),R&&K.eol())return U}else{if(K.match(w))return oe.tokenize=L,U;K.eat(/['"\/]/)}return R&&(i.singleLineStringErrors?U=o:oe.tokenize=L),U}}function H(w,R){for(;!w.eol();){if(w.eatWhile(/[^#]/),w.match("###")){R.tokenize=L;break}w.eatWhile("#")}return"comment"}function I(w,R,U){U=U||"coffee";for(var K=0,oe=!1,D=null,ae=R.scope;ae;ae=ae.prev)if(ae.type==="coffee"||ae.type=="}"){K=ae.offset+r.indentUnit;break}U!=="coffee"?(oe=null,D=w.column()+w.current().length):R.scope.align&&(R.scope.align=!1),R.scope={offset:K,type:U,prev:R.scope,align:oe,alignOffset:D}}function q(w,R){if(R.scope.prev)if(R.scope.type==="coffee"){for(var U=w.indentation(),K=!1,oe=R.scope;oe;oe=oe.prev)if(U===oe.offset){K=!0;break}if(!K)return!0;for(;R.scope.prev&&R.scope.offset!==U;)R.scope=R.scope.prev;return!1}else return R.scope=R.scope.prev,!1}function P(w,R){var U=R.tokenize(w,R),K=w.current();K==="return"&&(R.dedent=!0),((K==="->"||K==="=>")&&w.eol()||U==="indent")&&I(w,R);var oe="[({".indexOf(K);if(oe!==-1&&I(w,R,"])}".slice(oe,oe+1)),v.exec(K)&&I(w,R),K=="then"&&q(w,R),U==="dedent"&&q(w,R))return o;if(oe="])}".indexOf(K),oe!==-1){for(;R.scope.type=="coffee"&&R.scope.prev;)R.scope=R.scope.prev;R.scope.type==K&&(R.scope=R.scope.prev)}return R.dedent&&w.eol()&&(R.scope.type=="coffee"&&R.scope.prev&&(R.scope=R.scope.prev),R.dedent=!1),U}var z={startState:function(w){return{tokenize:L,scope:{offset:w||0,type:"coffee",prev:null,align:!1},prop:!1,dedent:0}},token:function(w,R){var U=R.scope.align===null&&R.scope;U&&w.sol()&&(U.align=!1);var K=P(w,R);return K&&K!="comment"&&(U&&(U.align=!0),R.prop=K=="punctuation"&&w.current()=="."),K},indent:function(w,R){if(w.tokenize!=L)return 0;var U=w.scope,K=R&&"])}".indexOf(R.charAt(0))>-1;if(K)for(;U.type=="coffee"&&U.prev;)U=U.prev;var oe=K&&U.type===R.charAt(0);return U.align?U.alignOffset-(oe?1:0):(oe?U.prev:U).offset},lineComment:"#",fold:"indent"};return z}),n.defineMIME("application/vnd.coffeescript","coffeescript"),n.defineMIME("text/x-coffeescript","coffeescript"),n.defineMIME("text/coffeescript","coffeescript")})}()),sA}var lA={},uA;function fv(){return uA||(uA=1,function(t,e){(function(n){n(Mr())})(function(n){n.defineMode("css",function(w,R){var U=R.inline;R.propertyKeywords||(R=n.resolveMode("text/css"));var K=w.indentUnit,oe=R.tokenHooks,D=R.documentTypes||{},ae=R.mediaTypes||{},ce=R.mediaFeatures||{},ve=R.mediaValueKeywords||{},ze=R.propertyKeywords||{},qe=R.nonStandardPropertyKeywords||{},yt=R.fontProperties||{},mt=R.counterDescriptors||{},_t=R.colorKeywords||{},bt=R.valueKeywords||{},Xe=R.allowNested,Ie=R.lineComment,Be=R.supportsAtComponent===!0,Ee=w.highlightNonStandardPropertyKeywords!==!1,Ze,Ke;function Fe(O,j){return Ze=j,O}function at(O,j){var F=O.next();if(oe[F]){var Q=oe[F](O,j);if(Q!==!1)return Q}if(F=="@")return O.eatWhile(/[\w\\\-]/),Fe("def",O.current());if(F=="="||(F=="~"||F=="|")&&O.eat("="))return Fe(null,"compare");if(F=='"'||F=="'")return j.tokenize=ie(F),j.tokenize(O,j);if(F=="#")return O.eatWhile(/[\w\\\-]/),Fe("atom","hash");if(F=="!")return O.match(/^\s*\w*/),Fe("keyword","important");if(/\d/.test(F)||F=="."&&O.eat(/\d/))return O.eatWhile(/[\w.%]/),Fe("number","unit");if(F==="-"){if(/[\d.]/.test(O.peek()))return O.eatWhile(/[\w.%]/),Fe("number","unit");if(O.match(/^-[\w\\\-]*/))return O.eatWhile(/[\w\\\-]/),O.match(/^\s*:/,!1)?Fe("variable-2","variable-definition"):Fe("variable-2","variable");if(O.match(/^\w+-/))return Fe("meta","meta")}else return/[,+>*\/]/.test(F)?Fe(null,"select-op"):F=="."&&O.match(/^-?[_a-z][_a-z0-9-]*/i)?Fe("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(F)?Fe(null,F):O.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(O.current())&&(j.tokenize=te),Fe("variable callee","variable")):/[\w\\\-]/.test(F)?(O.eatWhile(/[\w\\\-]/),Fe("property","word")):Fe(null,null)}function ie(O){return function(j,F){for(var Q=!1,le;(le=j.next())!=null;){if(le==O&&!Q){O==")"&&j.backUp(1);break}Q=!Q&&le=="\\"}return(le==O||!Q&&O!=")")&&(F.tokenize=null),Fe("string","string")}}function te(O,j){return O.next(),O.match(/^\s*[\"\')]/,!1)?j.tokenize=null:j.tokenize=ie(")"),Fe(null,"(")}function be(O,j,F){this.type=O,this.indent=j,this.prev=F}function _e(O,j,F,Q){return O.context=new be(F,j.indentation()+(Q===!1?0:K),O.context),F}function xe(O){return O.context.prev&&(O.context=O.context.prev),O.context.type}function G(O,j,F){return W[F.context.type](O,j,F)}function Z(O,j,F,Q){for(var le=Q||1;le>0;le--)F.context=F.context.prev;return G(O,j,F)}function N(O){var j=O.current().toLowerCase();bt.hasOwnProperty(j)?Ke="atom":_t.hasOwnProperty(j)?Ke="keyword":Ke="variable"}var W={};return W.top=function(O,j,F){if(O=="{")return _e(F,j,"block");if(O=="}"&&F.context.prev)return xe(F);if(Be&&/@component/i.test(O))return _e(F,j,"atComponentBlock");if(/^@(-moz-)?document$/i.test(O))return _e(F,j,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(O))return _e(F,j,"atBlock");if(/^@(font-face|counter-style)/i.test(O))return F.stateArg=O,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(O))return"keyframes";if(O&&O.charAt(0)=="@")return _e(F,j,"at");if(O=="hash")Ke="builtin";else if(O=="word")Ke="tag";else{if(O=="variable-definition")return"maybeprop";if(O=="interpolation")return _e(F,j,"interpolation");if(O==":")return"pseudo";if(Xe&&O=="(")return _e(F,j,"parens")}return F.context.type},W.block=function(O,j,F){if(O=="word"){var Q=j.current().toLowerCase();return ze.hasOwnProperty(Q)?(Ke="property","maybeprop"):qe.hasOwnProperty(Q)?(Ke=Ee?"string-2":"property","maybeprop"):Xe?(Ke=j.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(Ke+=" error","maybeprop")}else return O=="meta"?"block":!Xe&&(O=="hash"||O=="qualifier")?(Ke="error","block"):W.top(O,j,F)},W.maybeprop=function(O,j,F){return O==":"?_e(F,j,"prop"):G(O,j,F)},W.prop=function(O,j,F){if(O==";")return xe(F);if(O=="{"&&Xe)return _e(F,j,"propBlock");if(O=="}"||O=="{")return Z(O,j,F);if(O=="(")return _e(F,j,"parens");if(O=="hash"&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(j.current()))Ke+=" error";else if(O=="word")N(j);else if(O=="interpolation")return _e(F,j,"interpolation");return"prop"},W.propBlock=function(O,j,F){return O=="}"?xe(F):O=="word"?(Ke="property","maybeprop"):F.context.type},W.parens=function(O,j,F){return O=="{"||O=="}"?Z(O,j,F):O==")"?xe(F):O=="("?_e(F,j,"parens"):O=="interpolation"?_e(F,j,"interpolation"):(O=="word"&&N(j),"parens")},W.pseudo=function(O,j,F){return O=="meta"?"pseudo":O=="word"?(Ke="variable-3",F.context.type):G(O,j,F)},W.documentTypes=function(O,j,F){return O=="word"&&D.hasOwnProperty(j.current())?(Ke="tag",F.context.type):W.atBlock(O,j,F)},W.atBlock=function(O,j,F){if(O=="(")return _e(F,j,"atBlock_parens");if(O=="}"||O==";")return Z(O,j,F);if(O=="{")return xe(F)&&_e(F,j,Xe?"block":"top");if(O=="interpolation")return _e(F,j,"interpolation");if(O=="word"){var Q=j.current().toLowerCase();Q=="only"||Q=="not"||Q=="and"||Q=="or"?Ke="keyword":ae.hasOwnProperty(Q)?Ke="attribute":ce.hasOwnProperty(Q)?Ke="property":ve.hasOwnProperty(Q)?Ke="keyword":ze.hasOwnProperty(Q)?Ke="property":qe.hasOwnProperty(Q)?Ke=Ee?"string-2":"property":bt.hasOwnProperty(Q)?Ke="atom":_t.hasOwnProperty(Q)?Ke="keyword":Ke="error"}return F.context.type},W.atComponentBlock=function(O,j,F){return O=="}"?Z(O,j,F):O=="{"?xe(F)&&_e(F,j,Xe?"block":"top",!1):(O=="word"&&(Ke="error"),F.context.type)},W.atBlock_parens=function(O,j,F){return O==")"?xe(F):O=="{"||O=="}"?Z(O,j,F,2):W.atBlock(O,j,F)},W.restricted_atBlock_before=function(O,j,F){return O=="{"?_e(F,j,"restricted_atBlock"):O=="word"&&F.stateArg=="@counter-style"?(Ke="variable","restricted_atBlock_before"):G(O,j,F)},W.restricted_atBlock=function(O,j,F){return O=="}"?(F.stateArg=null,xe(F)):O=="word"?(F.stateArg=="@font-face"&&!yt.hasOwnProperty(j.current().toLowerCase())||F.stateArg=="@counter-style"&&!mt.hasOwnProperty(j.current().toLowerCase())?Ke="error":Ke="property","maybeprop"):"restricted_atBlock"},W.keyframes=function(O,j,F){return O=="word"?(Ke="variable","keyframes"):O=="{"?_e(F,j,"top"):G(O,j,F)},W.at=function(O,j,F){return O==";"?xe(F):O=="{"||O=="}"?Z(O,j,F):(O=="word"?Ke="tag":O=="hash"&&(Ke="builtin"),"at")},W.interpolation=function(O,j,F){return O=="}"?xe(F):O=="{"||O==";"?Z(O,j,F):(O=="word"?Ke="variable":O!="variable"&&O!="("&&O!=")"&&(Ke="error"),"interpolation")},{startState:function(O){return{tokenize:null,state:U?"block":"top",stateArg:null,context:new be(U?"block":"top",O||0,null)}},token:function(O,j){if(!j.tokenize&&O.eatSpace())return null;var F=(j.tokenize||at)(O,j);return F&&typeof F=="object"&&(Ze=F[1],F=F[0]),Ke=F,Ze!="comment"&&(j.state=W[j.state](Ze,O,j)),Ke},indent:function(O,j){var F=O.context,Q=j&&j.charAt(0),le=F.indent;return F.type=="prop"&&(Q=="}"||Q==")")&&(F=F.prev),F.prev&&(Q=="}"&&(F.type=="block"||F.type=="top"||F.type=="interpolation"||F.type=="restricted_atBlock")?(F=F.prev,le=F.indent):(Q==")"&&(F.type=="parens"||F.type=="atBlock_parens")||Q=="{"&&(F.type=="at"||F.type=="atBlock"))&&(le=Math.max(0,F.indent-K))),le},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:Ie,fold:"brace"}});function r(w){for(var R={},U=0;U","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"],y=f(v),_=/^::?[a-zA-Z_][\w\-]*/,C;function x(z){return!z.peek()||z.match(/\s+$/,!1)}function k(z,w){var R=z.peek();return R===")"?(z.next(),w.tokenizer=q,"operator"):R==="("?(z.next(),z.eatSpace(),"operator"):R==="'"||R==='"'?(w.tokenizer=L(z.next()),"string"):(w.tokenizer=L(")",!1),"string")}function A(z,w){return function(R,U){return R.sol()&&R.indentation()<=z?(U.tokenizer=q,q(R,U)):(w&&R.skipTo("*/")?(R.next(),R.next(),U.tokenizer=q):R.skipToEnd(),"comment")}}function L(z,w){w==null&&(w=!0);function R(U,K){var oe=U.next(),D=U.peek(),ae=U.string.charAt(U.pos-2),ce=oe!=="\\"&&D===z||oe===z&&ae!=="\\";return ce?(oe!==z&&w&&U.next(),x(U)&&(K.cursorHalf=0),K.tokenizer=q,"string"):oe==="#"&&D==="{"?(K.tokenizer=E(R),U.next(),"operator"):"string"}return R}function E(z){return function(w,R){return w.peek()==="}"?(w.next(),R.tokenizer=z,"operator"):q(w,R)}}function H(z){if(z.indentCount==0){z.indentCount++;var w=z.scopes[0].offset,R=w+r.indentUnit;z.scopes.unshift({offset:R})}}function I(z){z.scopes.length!=1&&z.scopes.shift()}function q(z,w){var R=z.peek();if(z.match("/*"))return w.tokenizer=A(z.indentation(),!0),w.tokenizer(z,w);if(z.match("//"))return w.tokenizer=A(z.indentation(),!1),w.tokenizer(z,w);if(z.match("#{"))return w.tokenizer=E(q),"operator";if(R==='"'||R==="'")return z.next(),w.tokenizer=L(R),"string";if(w.cursorHalf){if(R==="#"&&(z.next(),z.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/))||z.match(/^-?[0-9\.]+/))return x(z)&&(w.cursorHalf=0),"number";if(z.match(/^(px|em|in)\b/))return x(z)&&(w.cursorHalf=0),"unit";if(z.match(m))return x(z)&&(w.cursorHalf=0),"keyword";if(z.match(/^url/)&&z.peek()==="(")return w.tokenizer=k,x(z)&&(w.cursorHalf=0),"atom";if(R==="$")return z.next(),z.eatWhile(/[\w-]/),x(z)&&(w.cursorHalf=0),"variable-2";if(R==="!")return z.next(),w.cursorHalf=0,z.match(/^[\w]+/)?"keyword":"operator";if(z.match(y))return x(z)&&(w.cursorHalf=0),"operator";if(z.eatWhile(/[\w-]/))return x(z)&&(w.cursorHalf=0),C=z.current().toLowerCase(),l.hasOwnProperty(C)?"atom":s.hasOwnProperty(C)?"keyword":o.hasOwnProperty(C)?(w.prevProp=z.current().toLowerCase(),"property"):"tag";if(x(z))return w.cursorHalf=0,null}else{if(R==="-"&&z.match(/^-\w+-/))return"meta";if(R==="."){if(z.next(),z.match(/^[\w-]+/))return H(w),"qualifier";if(z.peek()==="#")return H(w),"tag"}if(R==="#"){if(z.next(),z.match(/^[\w-]+/))return H(w),"builtin";if(z.peek()==="#")return H(w),"tag"}if(R==="$")return z.next(),z.eatWhile(/[\w-]/),"variable-2";if(z.match(/^-?[0-9\.]+/))return"number";if(z.match(/^(px|em|in)\b/))return"unit";if(z.match(m))return"keyword";if(z.match(/^url/)&&z.peek()==="(")return w.tokenizer=k,"atom";if(R==="="&&z.match(/^=[\w-]+/))return H(w),"meta";if(R==="+"&&z.match(/^\+[\w-]+/))return"variable-3";if(R==="@"&&z.match("@extend")&&(z.match(/\s*[\w]/)||I(w)),z.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return H(w),"def";if(R==="@")return z.next(),z.eatWhile(/[\w-]/),"def";if(z.eatWhile(/[\w-]/))if(z.match(/ *: *[\w-\+\$#!\("']/,!1)){C=z.current().toLowerCase();var U=w.prevProp+"-"+C;return o.hasOwnProperty(U)?"property":o.hasOwnProperty(C)?(w.prevProp=C,"property"):u.hasOwnProperty(C)?"property":"tag"}else return z.match(/ *:/,!1)?(H(w),w.cursorHalf=1,w.prevProp=z.current().toLowerCase(),"property"):(z.match(/ *,/,!1)||H(w),"tag");if(R===":")return z.match(_)?"variable-3":(z.next(),w.cursorHalf=1,"operator")}return z.match(y)?"operator":(z.next(),null)}function P(z,w){z.sol()&&(w.indentCount=0);var R=w.tokenizer(z,w),U=z.current();if((U==="@return"||U==="}")&&I(w),R!==null){for(var K=z.pos-U.length,oe=K+r.indentUnit*w.indentCount,D=[],ae=0;ae]=?|\?:|\~)/,ze=k(v),qe=A(y),yt=new RegExp(/^\-(moz|ms|o|webkit)-/i),mt=A(_),_t="",bt={},Xe,Ie,Be,Ee;I.length|~|\/)?\s*[\w-]*([a-z0-9-]|\*|\/\*)(\(|,)?)/),X.context.line.firstWord=_t?_t[0].replace(/^\s*/,""):"",X.context.line.indent=Y.indentation(),Xe=Y.peek(),Y.match("//"))return Y.skipToEnd(),["comment","comment"];if(Y.match("/*"))return X.tokenize=Ke,Ke(Y,X);if(Xe=='"'||Xe=="'")return Y.next(),X.tokenize=Fe(Xe),X.tokenize(Y,X);if(Xe=="@")return Y.next(),Y.eatWhile(/[\w\\-]/),["def",Y.current()];if(Xe=="#"){if(Y.next(),Y.match(/^[0-9a-f]{3}([0-9a-f]([0-9a-f]{2}){0,2})?\b(?!-)/i))return["atom","atom"];if(Y.match(/^[a-z][\w-]*/i))return["builtin","hash"]}return Y.match(yt)?["meta","vendor-prefixes"]:Y.match(/^-?[0-9]?\.?[0-9]/)?(Y.eatWhile(/[a-z%]/i),["number","unit"]):Xe=="!"?(Y.next(),[Y.match(/^(important|optional)/i)?"keyword":"operator","important"]):Xe=="."&&Y.match(/^\.[a-z][\w-]*/i)?["qualifier","qualifier"]:Y.match(oe)?(Y.peek()=="("&&(X.tokenize=at),["property","word"]):Y.match(/^[a-z][\w-]*\(/i)?(Y.backUp(1),["keyword","mixin"]):Y.match(/^(\+|-)[a-z][\w-]*\(/i)?(Y.backUp(1),["keyword","block-mixin"]):Y.string.match(/^\s*&/)&&Y.match(/^[-_]+[a-z][\w-]*/)?["qualifier","qualifier"]:Y.match(/^(\/|&)(-|_|:|\.|#|[a-z])/)?(Y.backUp(1),["variable-3","reference"]):Y.match(/^&{1}\s*$/)?["variable-3","reference"]:Y.match(ze)?["operator","operator"]:Y.match(/^\$?[-_]*[a-z0-9]+[\w-]*/i)?Y.match(/^(\.|\[)[\w-\'\"\]]+/i,!1)&&!G(Y.current())?(Y.match("."),["variable-2","variable-name"]):["variable-2","word"]:Y.match(ve)?["operator",Y.current()]:/[:;,{}\[\]\(\)]/.test(Xe)?(Y.next(),[null,Xe]):(Y.next(),[null,null])}function Ke(Y,X){for(var de=!1,Te;(Te=Y.next())!=null;){if(de&&Te=="/"){X.tokenize=null;break}de=Te=="*"}return["comment","comment"]}function Fe(Y){return function(X,de){for(var Te=!1,je;(je=X.next())!=null;){if(je==Y&&!Te){Y==")"&&X.backUp(1);break}Te=!Te&&je=="\\"}return(je==Y||!Te&&Y!=")")&&(de.tokenize=null),["string","string"]}}function at(Y,X){return Y.next(),Y.match(/\s*[\"\')]/,!1)?X.tokenize=null:X.tokenize=Fe(")"),[null,"("]}function ie(Y,X,de,Te){this.type=Y,this.indent=X,this.prev=de,this.line=Te||{firstWord:"",indent:0}}function te(Y,X,de,Te){return Te=Te>=0?Te:H,Y.context=new ie(de,X.indentation()+Te,Y.context),de}function be(Y,X){var de=Y.context.indent-H;return X=X||!1,Y.context=Y.context.prev,X&&(Y.context.indent=de),Y.context.type}function _e(Y,X,de){return bt[de.context.type](Y,X,de)}function xe(Y,X,de,Te){for(var je=Te||1;je>0;je--)de.context=de.context.prev;return _e(Y,X,de)}function G(Y){return Y.toLowerCase()in q}function Z(Y){return Y=Y.toLowerCase(),Y in z||Y in ce}function N(Y){return Y.toLowerCase()in qe}function W(Y){return Y.toLowerCase().match(yt)}function O(Y){var X=Y.toLowerCase(),de="variable-2";return G(Y)?de="tag":N(Y)?de="block-keyword":Z(Y)?de="property":X in R||X in mt?de="atom":X=="return"||X in U?de="keyword":Y.match(/^[A-Z]/)&&(de="string"),de}function j(Y,X){return pe(X)&&(Y=="{"||Y=="]"||Y=="hash"||Y=="qualifier")||Y=="block-mixin"}function F(Y,X){return Y=="{"&&X.match(/^\s*\$?[\w-]+/i,!1)}function Q(Y,X){return Y==":"&&X.match(/^[a-z-]+/,!1)}function le(Y){return Y.sol()||Y.string.match(new RegExp("^\\s*"+L(Y.current())))}function pe(Y){return Y.eol()||Y.match(/^\s*$/,!1)}function ye(Y){var X=/^\s*[-_]*[a-z0-9]+[\w-]*/i,de=typeof Y=="string"?Y.match(X):Y.string.match(X);return de?de[0].replace(/^\s*/,""):""}return bt.block=function(Y,X,de){if(Y=="comment"&&le(X)||Y==","&&pe(X)||Y=="mixin")return te(de,X,"block",0);if(F(Y,X))return te(de,X,"interpolation");if(pe(X)&&Y=="]"&&!/^\s*(\.|#|:|\[|\*|&)/.test(X.string)&&!G(ye(X)))return te(de,X,"block",0);if(j(Y,X))return te(de,X,"block");if(Y=="}"&&pe(X))return te(de,X,"block",0);if(Y=="variable-name")return X.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/)||N(ye(X))?te(de,X,"variableName"):te(de,X,"variableName",0);if(Y=="=")return!pe(X)&&!N(ye(X))?te(de,X,"block",0):te(de,X,"block");if(Y=="*"&&(pe(X)||X.match(/\s*(,|\.|#|\[|:|{)/,!1)))return Ee="tag",te(de,X,"block");if(Q(Y,X))return te(de,X,"pseudo");if(/@(font-face|media|supports|(-moz-)?document)/.test(Y))return te(de,X,pe(X)?"block":"atBlock");if(/@(-(moz|ms|o|webkit)-)?keyframes$/.test(Y))return te(de,X,"keyframes");if(/@extends?/.test(Y))return te(de,X,"extend",0);if(Y&&Y.charAt(0)=="@")return X.indentation()>0&&Z(X.current().slice(1))?(Ee="variable-2","block"):/(@import|@require|@charset)/.test(Y)?te(de,X,"block",0):te(de,X,"block");if(Y=="reference"&&pe(X))return te(de,X,"block");if(Y=="(")return te(de,X,"parens");if(Y=="vendor-prefixes")return te(de,X,"vendorPrefixes");if(Y=="word"){var Te=X.current();if(Ee=O(Te),Ee=="property")return le(X)?te(de,X,"block",0):(Ee="atom","block");if(Ee=="tag"){if(/embed|menu|pre|progress|sub|table/.test(Te)&&Z(ye(X))||X.string.match(new RegExp("\\[\\s*"+Te+"|"+Te+"\\s*\\]")))return Ee="atom","block";if(P.test(Te)&&(le(X)&&X.string.match(/=/)||!le(X)&&!X.string.match(/^(\s*\.|#|\&|\[|\/|>|\*)/)&&!G(ye(X))))return Ee="variable-2",N(ye(X))?"block":te(de,X,"block",0);if(pe(X))return te(de,X,"block")}if(Ee=="block-keyword")return Ee="keyword",X.current(/(if|unless)/)&&!le(X)?"block":te(de,X,"block");if(Te=="return")return te(de,X,"block",0);if(Ee=="variable-2"&&X.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/))return te(de,X,"block")}return de.context.type},bt.parens=function(Y,X,de){if(Y=="(")return te(de,X,"parens");if(Y==")")return de.context.prev.type=="parens"?be(de):X.string.match(/^[a-z][\w-]*\(/i)&&pe(X)||N(ye(X))||/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(ye(X))||!X.string.match(/^-?[a-z][\w-\.\[\]\'\"]*\s*=/)&&G(ye(X))?te(de,X,"block"):X.string.match(/^[\$-]?[a-z][\w-\.\[\]\'\"]*\s*=/)||X.string.match(/^\s*(\(|\)|[0-9])/)||X.string.match(/^\s+[a-z][\w-]*\(/i)||X.string.match(/^\s+[\$-]?[a-z]/i)?te(de,X,"block",0):pe(X)?te(de,X,"block"):te(de,X,"block",0);if(Y&&Y.charAt(0)=="@"&&Z(X.current().slice(1))&&(Ee="variable-2"),Y=="word"){var Te=X.current();Ee=O(Te),Ee=="tag"&&P.test(Te)&&(Ee="variable-2"),(Ee=="property"||Te=="to")&&(Ee="atom")}return Y=="variable-name"?te(de,X,"variableName"):Q(Y,X)?te(de,X,"pseudo"):de.context.type},bt.vendorPrefixes=function(Y,X,de){return Y=="word"?(Ee="property",te(de,X,"block",0)):be(de)},bt.pseudo=function(Y,X,de){return Z(ye(X.string))?xe(Y,X,de):(X.match(/^[a-z-]+/),Ee="variable-3",pe(X)?te(de,X,"block"):be(de))},bt.atBlock=function(Y,X,de){if(Y=="(")return te(de,X,"atBlock_parens");if(j(Y,X))return te(de,X,"block");if(F(Y,X))return te(de,X,"interpolation");if(Y=="word"){var Te=X.current().toLowerCase();if(/^(only|not|and|or)$/.test(Te)?Ee="keyword":K.hasOwnProperty(Te)?Ee="tag":ae.hasOwnProperty(Te)?Ee="attribute":D.hasOwnProperty(Te)?Ee="property":w.hasOwnProperty(Te)?Ee="string-2":Ee=O(X.current()),Ee=="tag"&&pe(X))return te(de,X,"block")}return Y=="operator"&&/^(not|and|or)$/.test(X.current())&&(Ee="keyword"),de.context.type},bt.atBlock_parens=function(Y,X,de){if(Y=="{"||Y=="}")return de.context.type;if(Y==")")return pe(X)?te(de,X,"block"):te(de,X,"atBlock");if(Y=="word"){var Te=X.current().toLowerCase();return Ee=O(Te),/^(max|min)/.test(Te)&&(Ee="property"),Ee=="tag"&&(P.test(Te)?Ee="variable-2":Ee="atom"),de.context.type}return bt.atBlock(Y,X,de)},bt.keyframes=function(Y,X,de){return X.indentation()=="0"&&(Y=="}"&&le(X)||Y=="]"||Y=="hash"||Y=="qualifier"||G(X.current()))?xe(Y,X,de):Y=="{"?te(de,X,"keyframes"):Y=="}"?le(X)?be(de,!0):te(de,X,"keyframes"):Y=="unit"&&/^[0-9]+\%$/.test(X.current())?te(de,X,"keyframes"):Y=="word"&&(Ee=O(X.current()),Ee=="block-keyword")?(Ee="keyword",te(de,X,"keyframes")):/@(font-face|media|supports|(-moz-)?document)/.test(Y)?te(de,X,pe(X)?"block":"atBlock"):Y=="mixin"?te(de,X,"block",0):de.context.type},bt.interpolation=function(Y,X,de){return Y=="{"&&be(de)&&te(de,X,"block"),Y=="}"?X.string.match(/^\s*(\.|#|:|\[|\*|&|>|~|\+|\/)/i)||X.string.match(/^\s*[a-z]/i)&&G(ye(X))?te(de,X,"block"):!X.string.match(/^(\{|\s*\&)/)||X.match(/\s*[\w-]/,!1)?te(de,X,"block",0):te(de,X,"block"):Y=="variable-name"?te(de,X,"variableName",0):(Y=="word"&&(Ee=O(X.current()),Ee=="tag"&&(Ee="atom")),de.context.type)},bt.extend=function(Y,X,de){return Y=="["||Y=="="?"extend":Y=="]"?be(de):Y=="word"?(Ee=O(X.current()),"extend"):be(de)},bt.variableName=function(Y,X,de){return Y=="string"||Y=="["||Y=="]"||X.current().match(/^(\.|\$)/)?(X.current().match(/^\.[\w-]+/i)&&(Ee="variable-2"),"variableName"):xe(Y,X,de)},{startState:function(Y){return{tokenize:null,state:"block",context:new ie("block",Y||0,null)}},token:function(Y,X){return!X.tokenize&&Y.eatSpace()?null:(Ie=(X.tokenize||Ze)(Y,X),Ie&&typeof Ie=="object"&&(Be=Ie[1],Ie=Ie[0]),Ee=Ie,X.state=bt[X.state](Be,Y,X),Ee)},indent:function(Y,X,de){var Te=Y.context,je=X&&X.charAt(0),he=Te.indent,Ae=ye(X),Ne=de.match(/^\s*/)[0].replace(/\t/g,I).length,me=Y.context.prev?Y.context.prev.line.firstWord:"",Je=Y.context.prev?Y.context.prev.line.indent:Ne;return Te.prev&&(je=="}"&&(Te.type=="block"||Te.type=="atBlock"||Te.type=="keyframes")||je==")"&&(Te.type=="parens"||Te.type=="atBlock_parens")||je=="{"&&Te.type=="at")?he=Te.indent-H:/(\})/.test(je)||(/@|\$|\d/.test(je)||/^\{/.test(X)||/^\s*\/(\/|\*)/.test(X)||/^\s*\/\*/.test(me)||/^\s*[\w-\.\[\]\'\"]+\s*(\?|:|\+)?=/i.test(X)||/^(\+|-)?[a-z][\w-]*\(/i.test(X)||/^return/.test(X)||N(Ae)?he=Ne:/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(je)||G(Ae)?/\,\s*$/.test(me)?he=Je:/^\s+/.test(de)&&(/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(me)||G(me))?he=Ne<=Je?Je:Je+H:he=Ne:!/,\s*$/.test(de)&&(W(Ae)||Z(Ae))&&(N(me)?he=Ne<=Je?Je:Je+H:/^\{/.test(me)?he=Ne<=Je?Ne:Je+H:W(me)||Z(me)?he=Ne>=Je?Je:Ne:/^(\.|#|:|\[|\*|&|@|\+|\-|>|~|\/)/.test(me)||/=\s*$/.test(me)||G(me)||/^\$[\w-\.\[\]\'\"]/.test(me)?he=Je+H:he=Ne)),he},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"indent"}});var r=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","bgsound","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","nobr","noframes","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","var","video"],i=["domain","regexp","url-prefix","url"],o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],s=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","dynamic-range","video-dynamic-range"],l=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode","font-smoothing","osx-font-smoothing"],u=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],f=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],d=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],m=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","conic-gradient","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","high","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","standard","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small","bicubic","optimizespeed","grayscale","row","row-reverse","wrap","wrap-reverse","column-reverse","flex-start","flex-end","space-between","space-around","unset"],v=["in","and","or","not","is not","is a","is","isnt","defined","if unless"],y=["for","if","else","unless","from","to"],_=["null","true","false","href","title","type","not-allowed","readonly","disabled"],C=["@font-face","@keyframes","@media","@viewport","@page","@host","@supports","@block","@css"],x=r.concat(i,o,s,l,u,d,m,f,v,y,_,C);function k(E){return E=E.sort(function(H,I){return I>H}),new RegExp("^(("+E.join(")|(")+"))\\b")}function A(E){for(var H={},I=0;I-1?m.backUp(_.length-C):_.match(/<\/?$/)&&(m.backUp(_.length),m.match(v,!1)||m.match(_)),y}var o={};function s(m){var v=o[m];return v||(o[m]=new RegExp("\\s+"+m+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function l(m,v){var y=m.match(s(v));return y?/^\s*(.*?)\s*$/.exec(y[2])[1]:""}function u(m,v){return new RegExp((v?"^":"")+"","i")}function f(m,v){for(var y in m)for(var _=v[y]||(v[y]=[]),C=m[y],x=C.length-1;x>=0;x--)_.unshift(C[x])}function d(m,v){for(var y=0;y=0;k--)_.script.unshift(["type",x[k].matches,x[k].mode]);function A(L,E){var H=y.token(L,E.htmlState),I=/\btag\b/.test(H),q;if(I&&!/[<>\s\/]/.test(L.current())&&(q=E.htmlState.tagName&&E.htmlState.tagName.toLowerCase())&&_.hasOwnProperty(q))E.inTag=q+" ";else if(E.inTag&&I&&/>$/.test(L.current())){var P=/^([\S]+) (.*)/.exec(E.inTag);E.inTag=null;var z=L.current()==">"&&d(_[P[1]],P[2]),w=n.getMode(m,z),R=u(P[1],!0),U=u(P[1],!1);E.token=function(K,oe){return K.match(R,!1)?(oe.token=A,oe.localState=oe.localMode=null,null):i(K,U,oe.localMode.token(K,oe.localState))},E.localMode=w,E.localState=n.startState(w,y.indent(E.htmlState,"",""))}else E.inTag&&(E.inTag+=L.current(),L.eol()&&(E.inTag+=" "));return H}return{startState:function(){var L=n.startState(y);return{token:A,inTag:null,localMode:null,localState:null,htmlState:L}},copyState:function(L){var E;return L.localState&&(E=n.copyState(L.localMode,L.localState)),{token:L.token,inTag:L.inTag,localMode:L.localMode,localState:E,htmlState:n.copyState(y,L.htmlState)}},token:function(L,E){return E.token(L,E)},indent:function(L,E,H){return!L.localMode||/^\s*<\//.test(E)?y.indent(L.htmlState,E,H):L.localMode.indent?L.localMode.indent(L.localState,E,H):n.Pass},innerMode:function(L){return{state:L.localState||L.htmlState,mode:L.localMode||y}}}},"xml","javascript","css"),n.defineMIME("text/html","htmlmixed")})}()),mA}var vA;function Ose(){return vA||(vA=1,function(t,e){(function(n){n(Mr(),Gw(),fv(),Ase())})(function(n){n.defineMode("pug",function(r){var i="keyword",o="meta",s="builtin",l="qualifier",u={"{":"}","(":")","[":"]"},f=n.getMode(r,"javascript");function d(){this.javaScriptLine=!1,this.javaScriptLineExcludesColon=!1,this.javaScriptArguments=!1,this.javaScriptArgumentsDepth=0,this.isInterpolating=!1,this.interpolationNesting=0,this.jsState=n.startState(f),this.restOfLine="",this.isIncludeFiltered=!1,this.isEach=!1,this.lastTag="",this.scriptType="",this.isAttrs=!1,this.attrsNest=[],this.inAttributeName=!0,this.attributeIsType=!1,this.attrValue="",this.indentOf=1/0,this.indentToken="",this.innerMode=null,this.innerState=null,this.innerModeForLine=!1}d.prototype.copy=function(){var G=new d;return G.javaScriptLine=this.javaScriptLine,G.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon,G.javaScriptArguments=this.javaScriptArguments,G.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth,G.isInterpolating=this.isInterpolating,G.interpolationNesting=this.interpolationNesting,G.jsState=n.copyState(f,this.jsState),G.innerMode=this.innerMode,this.innerMode&&this.innerState&&(G.innerState=n.copyState(this.innerMode,this.innerState)),G.restOfLine=this.restOfLine,G.isIncludeFiltered=this.isIncludeFiltered,G.isEach=this.isEach,G.lastTag=this.lastTag,G.scriptType=this.scriptType,G.isAttrs=this.isAttrs,G.attrsNest=this.attrsNest.slice(),G.inAttributeName=this.inAttributeName,G.attributeIsType=this.attributeIsType,G.attrValue=this.attrValue,G.indentOf=this.indentOf,G.indentToken=this.indentToken,G.innerModeForLine=this.innerModeForLine,G};function m(G,Z){if(G.sol()&&(Z.javaScriptLine=!1,Z.javaScriptLineExcludesColon=!1),Z.javaScriptLine){if(Z.javaScriptLineExcludesColon&&G.peek()===":"){Z.javaScriptLine=!1,Z.javaScriptLineExcludesColon=!1;return}var N=f.token(G,Z.jsState);return G.eol()&&(Z.javaScriptLine=!1),N||!0}}function v(G,Z){if(Z.javaScriptArguments){if(Z.javaScriptArgumentsDepth===0&&G.peek()!=="("){Z.javaScriptArguments=!1;return}if(G.peek()==="("?Z.javaScriptArgumentsDepth++:G.peek()===")"&&Z.javaScriptArgumentsDepth--,Z.javaScriptArgumentsDepth===0){Z.javaScriptArguments=!1;return}var N=f.token(G,Z.jsState);return N||!0}}function y(G){if(G.match(/^yield\b/))return"keyword"}function _(G){if(G.match(/^(?:doctype) *([^\n]+)?/))return o}function C(G,Z){if(G.match("#{"))return Z.isInterpolating=!0,Z.interpolationNesting=0,"punctuation"}function x(G,Z){if(Z.isInterpolating){if(G.peek()==="}"){if(Z.interpolationNesting--,Z.interpolationNesting<0)return G.next(),Z.isInterpolating=!1,"punctuation"}else G.peek()==="{"&&Z.interpolationNesting++;return f.token(G,Z.jsState)||!0}}function k(G,Z){if(G.match(/^case\b/))return Z.javaScriptLine=!0,i}function A(G,Z){if(G.match(/^when\b/))return Z.javaScriptLine=!0,Z.javaScriptLineExcludesColon=!0,i}function L(G){if(G.match(/^default\b/))return i}function E(G,Z){if(G.match(/^extends?\b/))return Z.restOfLine="string",i}function H(G,Z){if(G.match(/^append\b/))return Z.restOfLine="variable",i}function I(G,Z){if(G.match(/^prepend\b/))return Z.restOfLine="variable",i}function q(G,Z){if(G.match(/^block\b *(?:(prepend|append)\b)?/))return Z.restOfLine="variable",i}function P(G,Z){if(G.match(/^include\b/))return Z.restOfLine="string",i}function z(G,Z){if(G.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&G.match("include"))return Z.isIncludeFiltered=!0,i}function w(G,Z){if(Z.isIncludeFiltered){var N=ze(G,Z);return Z.isIncludeFiltered=!1,Z.restOfLine="string",N}}function R(G,Z){if(G.match(/^mixin\b/))return Z.javaScriptLine=!0,i}function U(G,Z){if(G.match(/^\+([-\w]+)/))return G.match(/^\( *[-\w]+ *=/,!1)||(Z.javaScriptArguments=!0,Z.javaScriptArgumentsDepth=0),"variable";if(G.match("+#{",!1))return G.next(),Z.mixinCallAfter=!0,C(G,Z)}function K(G,Z){if(Z.mixinCallAfter)return Z.mixinCallAfter=!1,G.match(/^\( *[-\w]+ *=/,!1)||(Z.javaScriptArguments=!0,Z.javaScriptArgumentsDepth=0),!0}function oe(G,Z){if(G.match(/^(if|unless|else if|else)\b/))return Z.javaScriptLine=!0,i}function D(G,Z){if(G.match(/^(- *)?(each|for)\b/))return Z.isEach=!0,i}function ae(G,Z){if(Z.isEach){if(G.match(/^ in\b/))return Z.javaScriptLine=!0,Z.isEach=!1,i;if(G.sol()||G.eol())Z.isEach=!1;else if(G.next()){for(;!G.match(/^ in\b/,!1)&&G.next(););return"variable"}}}function ce(G,Z){if(G.match(/^while\b/))return Z.javaScriptLine=!0,i}function ve(G,Z){var N;if(N=G.match(/^(\w(?:[-:\w]*\w)?)\/?/))return Z.lastTag=N[1].toLowerCase(),Z.lastTag==="script"&&(Z.scriptType="application/javascript"),"tag"}function ze(G,Z){if(G.match(/^:([\w\-]+)/)){var N;return r&&r.innerModes&&(N=r.innerModes(G.current().substring(1))),N||(N=G.current().substring(1)),typeof N=="string"&&(N=n.getMode(r,N)),at(G,Z,N),"atom"}}function qe(G,Z){if(G.match(/^(!?=|-)/))return Z.javaScriptLine=!0,"punctuation"}function yt(G){if(G.match(/^#([\w-]+)/))return s}function mt(G){if(G.match(/^\.([\w-]+)/))return l}function _t(G,Z){if(G.peek()=="(")return G.next(),Z.isAttrs=!0,Z.attrsNest=[],Z.inAttributeName=!0,Z.attrValue="",Z.attributeIsType=!1,"punctuation"}function bt(G,Z){if(Z.isAttrs){if(u[G.peek()]&&Z.attrsNest.push(u[G.peek()]),Z.attrsNest[Z.attrsNest.length-1]===G.peek())Z.attrsNest.pop();else if(G.eat(")"))return Z.isAttrs=!1,"punctuation";if(Z.inAttributeName&&G.match(/^[^=,\)!]+/))return(G.peek()==="="||G.peek()==="!")&&(Z.inAttributeName=!1,Z.jsState=n.startState(f),Z.lastTag==="script"&&G.current().trim().toLowerCase()==="type"?Z.attributeIsType=!0:Z.attributeIsType=!1),"attribute";var N=f.token(G,Z.jsState);if(Z.attributeIsType&&N==="string"&&(Z.scriptType=G.current().toString()),Z.attrsNest.length===0&&(N==="string"||N==="variable"||N==="keyword"))try{return Function("","var x "+Z.attrValue.replace(/,\s*$/,"").replace(/^!/,"")),Z.inAttributeName=!0,Z.attrValue="",G.backUp(G.current().length),bt(G,Z)}catch{}return Z.attrValue+=G.current(),N||!0}}function Xe(G,Z){if(G.match(/^&attributes\b/))return Z.javaScriptArguments=!0,Z.javaScriptArgumentsDepth=0,"keyword"}function Ie(G){if(G.sol()&&G.eatSpace())return"indent"}function Be(G,Z){if(G.match(/^ *\/\/(-)?([^\n]*)/))return Z.indentOf=G.indentation(),Z.indentToken="comment","comment"}function Ee(G){if(G.match(/^: */))return"colon"}function Ze(G,Z){if(G.match(/^(?:\| ?| )([^\n]+)/))return"string";if(G.match(/^(<[^\n]*)/,!1))return at(G,Z,"htmlmixed"),Z.innerModeForLine=!0,ie(G,Z,!0)}function Ke(G,Z){if(G.eat(".")){var N=null;return Z.lastTag==="script"&&Z.scriptType.toLowerCase().indexOf("javascript")!=-1?N=Z.scriptType.toLowerCase().replace(/"|'/g,""):Z.lastTag==="style"&&(N="css"),at(G,Z,N),"dot"}}function Fe(G){return G.next(),null}function at(G,Z,N){N=n.mimeModes[N]||N,N=r.innerModes&&r.innerModes(N)||N,N=n.mimeModes[N]||N,N=n.getMode(r,N),Z.indentOf=G.indentation(),N&&N.name!=="null"?Z.innerMode=N:Z.indentToken="string"}function ie(G,Z,N){if(G.indentation()>Z.indentOf||Z.innerModeForLine&&!G.sol()||N)return Z.innerMode?(Z.innerState||(Z.innerState=Z.innerMode.startState?n.startState(Z.innerMode,G.indentation()):{}),G.hideFirstChars(Z.indentOf+2,function(){return Z.innerMode.token(G,Z.innerState)||!0})):(G.skipToEnd(),Z.indentToken);G.sol()&&(Z.indentOf=1/0,Z.indentToken=null,Z.innerMode=null,Z.innerState=null)}function te(G,Z){if(G.sol()&&(Z.restOfLine=""),Z.restOfLine){G.skipToEnd();var N=Z.restOfLine;return Z.restOfLine="",N}}function be(){return new d}function _e(G){return G.copy()}function xe(G,Z){var N=ie(G,Z)||te(G,Z)||x(G,Z)||w(G,Z)||ae(G,Z)||bt(G,Z)||m(G,Z)||v(G,Z)||K(G,Z)||y(G)||_(G)||C(G,Z)||k(G,Z)||A(G,Z)||L(G)||E(G,Z)||H(G,Z)||I(G,Z)||q(G,Z)||P(G,Z)||z(G,Z)||R(G,Z)||U(G,Z)||oe(G,Z)||D(G,Z)||ce(G,Z)||ve(G,Z)||ze(G,Z)||qe(G,Z)||yt(G)||mt(G)||_t(G,Z)||Xe(G,Z)||Ie(G)||Ze(G,Z)||Be(G,Z)||Ee(G)||Ke(G,Z)||Fe(G);return N===!0?null:N}return{startState:be,copyState:_e,token:xe}},"javascript","css","htmlmixed"),n.defineMIME("text/x-pug","pug"),n.defineMIME("text/x-jade","pug")})}()),pA}var yA={},bA={},_A;function Mse(){return _A||(_A=1,function(t,e){(function(n){n(Mr())})(function(n){n.multiplexingMode=function(r){var i=Array.prototype.slice.call(arguments,1);function o(s,l,u,f){if(typeof l=="string"){var d=s.indexOf(l,u);return f&&d>-1?d+l.length:d}var m=l.exec(u?s.slice(u):s);return m?m.index+u+(f?m[0].length:0):-1}return{startState:function(){return{outer:n.startState(r),innerActive:null,inner:null,startingInner:!1}},copyState:function(s){return{outer:n.copyState(r,s.outer),innerActive:s.innerActive,inner:s.innerActive&&n.copyState(s.innerActive.mode,s.inner),startingInner:s.startingInner}},token:function(s,l){if(l.innerActive){var x=l.innerActive,f=s.string;if(!x.close&&s.sol())return l.innerActive=l.inner=null,this.token(s,l);var v=x.close&&!l.startingInner?o(f,x.close,s.pos,x.parseDelimiters):-1;if(v==s.pos&&!x.parseDelimiters)return s.match(x.close),l.innerActive=l.inner=null,x.delimStyle&&x.delimStyle+" "+x.delimStyle+"-close";v>-1&&(s.string=f.slice(0,v));var k=x.mode.token(s,l.inner);return v>-1?s.string=f:s.pos>s.start&&(l.startingInner=!1),v==s.pos&&x.parseDelimiters&&(l.innerActive=l.inner=null),x.innerStyle&&(k?k=k+" "+x.innerStyle:k=x.innerStyle),k}else{for(var u=1/0,f=s.string,d=0;d|[#\/]([A-Za-z_]\w*)/,token:"keyword"},{regex:/(?:else|this)\b/,token:"keyword"},{regex:/\d+/i,token:"number"},{regex:/=|~|@|true|false/,token:"atom"},{regex:/(?:\.\.\/)*(?:[A-Za-z_][\w\.]*)+/,token:"variable-2"}],dash_comment:[{regex:/--\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}],comment:[{regex:/\}\}/,pop:!0,token:"comment"},{regex:/./,token:"comment"}],meta:{blockCommentStart:"{{--",blockCommentEnd:"--}}"}}),n.defineMode("handlebars",function(r,i){var o=n.getMode(r,"handlebars-tags");return!i||!i.base?o:n.multiplexingMode(n.getMode(r,i.base),{open:"{{",close:/\}\}\}?/,mode:o,parseDelimiters:!0})}),n.defineMIME("text/x-handlebars-template","handlebars")})}()),yA}(function(t,e){(function(n){n(Mr(),Sse(),VL(),Gw(),Cse(),fv(),Tse(),Ese(),Ose(),Nse())})(function(n){var r={script:[["lang",/coffee(script)?/,"coffeescript"],["type",/^(?:text|application)\/(?:x-)?coffee(?:script)?$/,"coffeescript"],["lang",/^babel$/,"javascript"],["type",/^text\/babel$/,"javascript"],["type",/^text\/ecmascript-\d+$/,"javascript"]],style:[["lang",/^stylus$/i,"stylus"],["lang",/^sass$/i,"sass"],["lang",/^less$/i,"text/x-less"],["lang",/^scss$/i,"text/x-scss"],["type",/^(text\/)?(x-)?styl(us)?$/i,"stylus"],["type",/^text\/sass/i,"sass"],["type",/^(text\/)?(x-)?scss$/i,"text/x-scss"],["type",/^(text\/)?(x-)?less$/i,"text/x-less"]],template:[["lang",/^vue-template$/i,"vue"],["lang",/^pug$/i,"pug"],["lang",/^handlebars$/i,"handlebars"],["type",/^(text\/)?(x-)?pug$/i,"pug"],["type",/^text\/x-handlebars-template$/i,"handlebars"],[null,null,"vue-template"]]};n.defineMode("vue-template",function(i,o){var s={token:function(l){if(l.match(/^\{\{.*?\}\}/))return"meta mustache";for(;l.next()&&!l.match("{{",!1););return null}};return n.overlayMode(n.getMode(i,o.backdrop||"text/html"),s)}),n.defineMode("vue",function(i){return n.getMode(i,{name:"htmlmixed",tags:r})},"htmlmixed","xml","javascript","coffeescript","css","sass","stylus","pug","handlebars"),n.defineMIME("script/x-vue","vue"),n.defineMIME("text/x-vue","vue")})})();const Lse={name:"CodeEditor",components:{Codemirror:lse},props:{field:{type:Object,default:null},editor:{type:Object,default:null},visible:{type:Boolean,default:!1},modelValue:{type:String,default:""}},emits:["update:modelValue"],data(){return{proxyValue:"",options:{theme:"material",mode:"htmlmixed",htmlMode:!0,lineNumbers:!0,lineWrapping:!0,indentUnit:4}}},watch:{visible(t){t&&(this.proxyValue=xse.html(this.modelValue,{indent_size:4})),this.resizeHandler()},proxyValue(t){this.$emit("update:modelValue",t)}},created(){this.editor.on("resize",this.resizeHandler.bind(this))},methods:{resizeHandler(){this.visible&&this.$nextTick(()=>{const{width:t,height:e}=this.editor.view.dom.getBoundingClientRect();this.$el.style.width=`${t}px`,this.$el.style.height=`${e}px`})}}};function Ise(t,e,n,r,i,o){const s=ut("Codemirror");return n.visible?(ge(),Ct(s,{key:0,value:i.proxyValue,"onUpdate:value":e[0]||(e[0]=l=>i.proxyValue=l),class:"vui-code-editor",options:i.options},null,8,["value","options"])):gt("",!0)}const Pse=Bt(Lse,[["render",Ise]]),Dse={name:"VizyUserTemplate",props:{template:{type:String,default:""},vizyField:{type:Object,default:()=>{}}},render(){try{return mr(Zf(`
${this.template}
`),{editor:this.vizyField.editor,vizyField:this.vizyField})}catch(t){console.error(t),console.log("Vue template compile error: %o",{template:this.template});const e=this.t("vizy","Unable to parse custom template.");return mr(Zf(`

${e}

`))}}},Rse={name:"VizyInput",components:{EditorContent:AQ,MenuBar:moe,BlockPicker:Doe,CodeEditor:Pse,VizyUserTemplate:Dse},props:{name:{type:String,required:!0,default:""},settings:{type:Object,default:()=>{}},value:{type:[String,Array],required:!0,default:""}},data(){return{isLivePreview:!1,mounted:!1,buttons:["bold","italic"],showCodeEditor:!1,codeEditorHtml:"",editor:null,json:null,html:null,parentToolbarOffset:0,cachedFieldHtml:{},cachedFieldJs:{},renderedJsCache:{},selectedBlockType:null,currentNodeHoverPosition:null}},computed:{jsonContent(){return this.contentToValue(this.json)},toolbarFixed(){return this.settings.vizyConfig.toolbarFixed},isRoot(){return this.settings.isRoot},supportedBlockTypes(){const t=[];return this.settings.blockGroups.forEach(e=>{e.blockTypes.forEach(n=>{t.push(n.id)})}),t},blocksEnabled(){return this.settings.editorMode!=="richText"},richTextEnabled(){return this.settings.editorMode!=="blocks"}},watch:{codeEditorHtml(t){this.editor.chain().setContent(t,!0).run()}},mounted(){this.editor=new EQ({extensions:this.getExtensions(),content:this.valueToContent(this.clone(this.value)),autofocus:!1,onUpdate:()=>{this.json=this.editor.getJSON().content,this.html=this.editor.getHTML()},editorProps:{transformPastedHTML:t=>{if(this.settings.pasteAsPlainText){const e=document.createElement("div");return e.innerHTML=t,e.textContent||e.innerText||""}return t},handleDrop:(t,e,n,r)=>!this.selectedBlockType,handleKeyDown:(t,e)=>{if(!this.richTextEnabled)return!["/","Backspace","Delete","Enter","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key)},handlePaste:(t,e)=>{if(!this.richTextEnabled)return!0}}}),this.editor.vizyField=this,this.json=this.editor.getJSON().content,this.html=this.editor.getHTML(),this.json.forEach(t=>{if(t.type==="vizyBlock"){const{id:e}=t.attrs,n=gb(this.settings.blocks,{id:e});n&&(this.setCachedFieldHtml(e,n.fieldsHtml),this.setCachedFieldJs(e,n.footHtml))}}),this.$nextTick(()=>{if(this.mounted=!0,this.toolbarFixed){window.addEventListener("scroll",this.updateFixedToolbar),window.addEventListener("resize",this.updateFixedToolbar);const t=document.querySelector(".slideout[data-element-editor].so-visible .so-body");t&&(t.addEventListener("scroll",this.updateFixedToolbarEditor),t.addEventListener("resize",this.updateFixedToolbarEditor)),Garnish.on(Craft.Preview,"open",this.openLivePreviewCallback),Garnish.on(Craft.LivePreview,"enter",this.openLivePreviewCallback),Garnish.on(Craft.Preview,"close",this.closeLivePreviewCallback),Garnish.on(Craft.LivePreview,"exit",this.closeLivePreviewCallback)}this.editor.on("vui:code-editor-toggle",this.setCodeEditor)}),this.getParentInputs(this.$el).forEach(t=>{t.$refs.toolbar&&(this.parentToolbarOffset+=t.$refs.toolbar.$el.offsetHeight)}),this.refreshUnloadData()},created(){this.settings.vizyConfig.buttons&&(this.buttons=this.settings.vizyConfig.buttons)},beforeUnmount(){this.editor.destroy()},methods:{getExtensions(){let t=[WY,sX.configure({color:"#3778eb",width:3}),pX,UY,rX,lee,XY,Gee.configure({suggestion:lre})];const e=Craft.Vizy.Config.getExtensions(),n=[Wee];return this.richTextEnabled&&(t=t.concat(e)),this.blocksEnabled&&(t=t.concat(n)),t=t.concat(ure(this)),t},setCodeEditor(){this.showCodeEditor?this.editor.chain().setContent(this.codeEditorHtml,!0).run():this.codeEditorHtml=this.editor.getHTML(),this.showCodeEditor=!this.showCodeEditor},valueToContent(t){if(!t)return null;if(!Array.isArray(t))try{t=JSON.parse(t)}catch(e){console.log(e)}return t=this.decodeHtml(t),t.length?{type:"doc",content:t}:null},decodeHtml(t){Array.isArray(t)&&(t=JSON.stringify(t));const e=document.createElement("textarea");return e.innerHTML=t,JSON.parse(e.value)},getUserTemplates(t){const e=Craft.Vizy.Config.getTemplates();return Array.isArray(e)?e.map(n=>n.position===t?n.template:"").join(""):!1},contentToValue(t){return t&&Array.isArray(t)&&t.length===1&&t[0].type==="paragraph"&&!t[0].content?null:JSON.stringify(t)},getParsedBlockHtml(t,e){return typeof t=="string"?t.replace(new RegExp(`__VIZY_BLOCK_${this.settings.placeholderKey}__`,"g"),e):""},getCachedFieldHtml(t){let e=this.cachedFieldHtml[t];return typeof e=="string"&&(e=e.replace(/&#(\d+);/g,(n,r)=>String.fromCharCode(r))),this.getParsedBlockHtml(e,t)},setCachedFieldHtml(t,e){this.cachedFieldHtml[t]=e},getCachedFieldJs(t){let e=this.cachedFieldJs[t];typeof e=="string"&&(e=e.replace(/&#(\d+);/g,(r,i)=>String.fromCharCode(i)));let n=this.getParsedBlockHtml(e,t);return this.renderedJsCache[t]&&(n=n.replace(/(superTableInput.addRow.*?;)/g,"null")),this.renderedJsCache[t]=n,n},setCachedFieldJs(t,e){this.cachedFieldJs[t]=e},getBlockSettings(t){return gb(this.settings.blocks,{id:t})||{}},openLivePreviewCallback(){this.isLivePreview=!0;const t=document.querySelector(".lp-editor-container .lp-editor");t&&(t.addEventListener("scroll",this.updateFixedToolbar),t.addEventListener("resize",this.updateFixedToolbar))},closeLivePreviewCallback(){this.isLivePreview=!1},updateFixedToolbar(t){let e=document.querySelector("body.fixed-header #header")?document.querySelector("body.fixed-header #header").offsetHeight:0;this.isLivePreview&&(e=document.querySelector(".lp-editor-container header.flex")?document.querySelector(".lp-editor-container header.flex").offsetHeight-parseFloat(window.getComputedStyle(document.querySelector(".lp-editor-container .lp-editor"),null).getPropertyValue("padding-top")):0),e=e+this.parentToolbarOffset,this.$refs.toolbar&&(this.$refs.toolbar.$el.style.position="sticky",this.$refs.toolbar.$el.style.top=`${this.$el.scrollTop+e}px`)},updateFixedToolbarEditor(t){let e=-24;e=e+this.parentToolbarOffset,this.$refs.toolbar&&(this.$refs.toolbar.$el.style.position="sticky",this.$refs.toolbar.$el.style.top=`${this.$el.scrollTop+e}px`)},getParentInputs(){const t=[];let e=this;for(;e;)e.$options.name==="VizyInput"&&t.push(e),e=e.$parent;return t},refreshUnloadData(){setTimeout(()=>{if(Qn(this.editor,"storage.vizyBlock.isNew"))return;const t=$("form#main-form");if(t.length){const e=t.data("elementEditor");if(e){const n=e.serializeForm(!0);e.lastSerializedValue=n,t.data("initialSerializedValue",n)}}},500)},isFocused(){return this.editor.isFocused&&!this.editor.isActive("vizyBlock")}}},zse={key:1,class:"input text",style:{"margin-top":"20px"}},Bse=["name","value"];function $se(t,e,n,r,i,o){const s=ut("vizy-user-template"),l=ut("menu-bar"),u=ut("code-editor"),f=ut("editor-content"),d=ut("block-picker");return ge(),Se("div",null,[i.editor?(ge(),Se("div",{key:0,class:vt(["vui-rich-text",{"has-focus":o.isFocused()}]),style:oi({"--rows":n.settings.initialRows})},[o.getUserTemplates("beforeMenuBar")?(ge(),Ct(s,{key:0,template:o.getUserTemplates("beforeMenuBar"),"vizy-field":this},null,8,["template"])):gt("",!0),i.buttons.length&&o.richTextEnabled?(ge(),Ct(l,{key:1,ref:"toolbar",buttons:i.buttons,editor:i.editor,field:this},null,8,["buttons","editor"])):gt("",!0),o.getUserTemplates("beforeEditor")?(ge(),Ct(s,{key:2,template:o.getUserTemplates("beforeEditor"),"vizy-field":this},null,8,["template"])):gt("",!0),o.richTextEnabled?(ge(),Ct(u,{key:3,modelValue:i.codeEditorHtml,"onUpdate:modelValue":e[0]||(e[0]=m=>i.codeEditorHtml=m),visible:i.showCodeEditor,editor:i.editor,field:this},null,8,["modelValue","visible","editor"])):gt("",!0),Qe(f,{class:vt([{"code-view":i.showCodeEditor},"vui-editor"]),editor:i.editor},null,8,["class","editor"]),o.blocksEnabled?(ge(),Ct(d,{key:4,editor:i.editor,field:this,"block-groups":n.settings.blockGroups},null,8,["editor","block-groups"])):gt("",!0),o.getUserTemplates("afterEditor")?(ge(),Ct(s,{key:5,template:o.getUserTemplates("afterEditor"),"vizy-field":this},null,8,["template"])):gt("",!0)],6)):gt("",!0),t.$isDebug?(ge(),Se("div",zse,Le(o.jsonContent),1)):gt("",!0),re("input",{type:"hidden",name:n.name,value:o.jsonContent},null,8,Bse)])}const kA=Bt(Rse,[["render",$se]]),y1={data:void 0},Yw=t=>t.reduce((e,n)=>(e[n]=n)&&e,{}),Fo=Yw(["drag","dragend","dragenter","dragleave","dragstart","dragover","drop"]),Hse=Yw(["copy","move","link","none"]),Fse=Yw(["none","copy","copyLink","copyMove","link","linkMove","move","all","uninitialized"]),Vse={props:{draggable:{type:Boolean,default:!0},transferData:{},dropEffect:{validator:t=>t in Hse},effectAllowed:{validator:t=>t in Fse},image:String,imageXOffset:{type:Number,default:0},imageYOffset:{type:Number,default:0},hideImageHtml:{type:Boolean,default:!0},tag:{type:String,default:"div"}},data(){return{dragging:!1}},computed:{events:()=>Fo,scopedData(){return this.dragging&&this.transferData},hideImageStyle:()=>({position:"fixed",top:"-1000px"})},methods:{emitEvent(t,e){const n=e.dataTransfer;if([Fo.dragenter,Fo.dragover].includes(t)&&this.dropEffect&&(n.dropEffect=this.dropEffect),t===Fo.dragstart){if(this.effectAllowed&&(n.effectAllowed=this.effectAllowed),this.image||this.$slots.image||this.$refs.image){let r;this.image?(r=new Image,r.src=this.image):this.$refs.image?r=this.$refs.image:this.$slots.image&&(r=this.$slots.image[0].elm),n.setDragImage&&n.setDragImage(r,this.imageXOffset,this.imageYOffset)}this.transferData!==void 0&&(y1.data=this.transferData,e.dataTransfer.setData("text","")),this.dragging=!0}this.$emit(t,this.transferData,e),t===Fo.dragend&&(y1.data=void 0,this.dragging=!1)}}};function jse(t,e,n,r,i,o){return ge(),Ct(Qs(n.tag),{draggable:n.draggable,onDrag:e[0]||(e[0]=s=>o.emitEvent(o.events.drag,s)),onDragstart:e[1]||(e[1]=s=>o.emitEvent(o.events.dragstart,s)),onDragenter:e[2]||(e[2]=s=>o.emitEvent(o.events.dragenter,s)),onDragleave:e[3]||(e[3]=s=>o.emitEvent(o.events.dragleave,s)),onDragend:e[4]||(e[4]=s=>o.emitEvent(o.events.dragend,s))},{default:Vt(()=>[pn(t.$slots,"default",{transferData:o.scopedData}),n.hideImageHtml?(ge(),Se("div",{key:0,ref:"image",style:oi(o.hideImageStyle)},[pn(t.$slots,"image",{transferData:o.scopedData})],4)):pn(t.$slots,"image",{key:1,transferData:o.scopedData})]),_:3},40,["draggable"])}const Wse=Bt(Vse,[["render",jse]]),Zc=new Set,Use={data(){return{transferData:void 0,isDraggingOver:!1}},props:{tag:{type:String,default:"div"}},computed:{events:()=>Fo,scopedData(){return this.isDraggingOver&&this.transferData}},methods:{emitEvent(t,e){this.transferData=y1.data,this.$emit(t,this.transferData,e),t===Fo.dragenter&&(Zc.size||e.target===this.$el)&&Zc.add(e.target),t===Fo.dragleave&&Zc.delete(e.target),t===Fo.drop&&Zc.clear(),this.isDraggingOver=!!Zc.size}}};function qse(t,e,n,r,i,o){return ge(),Ct(Qs(n.tag),{onDragenter:e[0]||(e[0]=s=>o.emitEvent(o.events.dragenter,s)),onDragleave:e[1]||(e[1]=s=>o.emitEvent(o.events.dragleave,s)),onDragover:e[2]||(e[2]=lt(s=>o.emitEvent(o.events.dragover,s),["prevent"])),onDrop:e[3]||(e[3]=lt(s=>o.emitEvent(o.events.drop,s),["prevent"]))},{default:Vt(()=>[pn(t.$slots,"default",{transferData:o.scopedData})]),_:3},32)}const Kse=Bt(Use,[["render",qse]]),Gse={name:"VizyIconPicker",props:{inputClasses:{type:Object,default:()=>{}},modelValue:{type:Object,default:()=>{}}},emits:["update:modelValue"],data(){return{tippy:null,id:`icon-picker-${Craft.randomString(10)}`,icons:[],search:"",selected:null,isFetching:!1,tippyVisible:!1}},computed:{iconsFiltered(){return Mi(this.icons)?[]:this.icons.reduce((t,e)=>{const n=e.icons.filter(r=>r.label.toLowerCase().includes(this.search.toLowerCase()));return n.length?t.concat({...e,icons:n}):t},[])}},watch:{selected(t){this.$emit("update:modelValue",t)}},created(){this.modelValue&&(this.selected=this.modelValue)},mounted(){const t=this,e=this.$el.querySelector(".js-vui-tippy-template");e.style.display="block",this.tippy=Kr(`#${this.id}`,{content:e,trigger:"focus",allowHTML:!0,arrow:!0,interactive:!0,placement:"bottom-start",theme:"light-border icon-picker",maxWidth:"none",duration:200,zIndex:10,hideOnClick:!1,onCreate(n){t.isFetching=!1,n.popper.style.width="100%"},onShow(n){t.tippyVisible=!0,!(t.isFetching||t.icons.length)&&(t.isFetching=!0,fetch(Craft.getActionUrl("vizy/icons")).then(r=>r.json()).then(r=>{t.icons=r}).catch(r=>{n.setContent(`Request failed. ${r}`)}).finally(()=>{t.isFetching=!1}))},onHide(n){t.isFetching=!1,t.tippyVisible=!1},onHidden(n){t.search=""}})},methods:{select(t){this.selected=t,this.tippy[0].hide()},deleteIcon(){this.selected=null}}},Yse={key:0,class:"vui-icon-input-item"},Jse=["innerHTML"],Xse={class:"vui-icon-input-label"},Zse=["id"],Qse=re("svg",{"aria-hidden":"true",focusable:"false","data-prefix":"fal","data-icon":"times",class:"svg-inline--fa fa-times fa-w-10",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512"},[re("path",{fill:"currentColor",d:"M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z"})],-1),eae=[Qse],tae={class:"vui-icons-pane js-vui-tippy-template",style:{display:"none"}},nae={key:0,class:"vui-no-icons"},rae=re("span",{class:"vui-loading"},null,-1),iae=[rae],oae={key:1,class:"vui-icons-groups"},sae={class:"vui-icons-group-name"},aae={class:"vui-icons"},lae=["title","onClick"],uae=["innerHTML"],cae={class:"vui-icon-label"},fae={key:2,class:"vui-no-icons"};function dae(t,e,n,r,i,o){return ge(),Se("div",null,[re("div",{class:vt(["vui-icon-input",{"tippy-visible":i.tippyVisible}])},[i.selected&&!i.tippyVisible?(ge(),Se("div",Yse,[re("div",{class:"vui-icon-input-svg",innerHTML:i.selected.svg},null,8,Jse),re("span",Xse,Le(i.selected.label),1)])):gt("",!0),Ut(re("input",{id:i.id,"onUpdate:modelValue":e[0]||(e[0]=s=>i.search=s),type:"text",autocomplete:"off",autocorrect:"off",autocapitalize:"off",class:vt(n.inputClasses)},null,10,Zse),[[Mn,i.search]]),i.selected?(ge(),Se("button",{key:1,type:"button",class:"vui-icon-input-delete",onClick:e[1]||(e[1]=lt((...s)=>o.deleteIcon&&o.deleteIcon(...s),["prevent"]))},eae)):gt("",!0)],2),re("div",tae,[i.isFetching?(ge(),Se("div",nae,iae)):Object.keys(o.iconsFiltered).length?(ge(),Se("div",oae,[(ge(!0),Se(kt,null,Zt(o.iconsFiltered,(s,l)=>(ge(),Se("div",{key:l,class:"vui-icons-group"},[re("span",sae,Le(s.name),1),re("div",aae,[(ge(!0),Se(kt,null,Zt(s.icons,(u,f)=>(ge(),Se("div",{key:f,class:"vui-icon-wrap",title:`${u.label} (${s.name})`,onClick:lt(d=>o.select(u),["prevent"])},[re("div",{class:"vui-icon-svg",innerHTML:u.svg},null,8,uae),re("span",cae,Le(u.label),1)],8,lae))),128))])]))),128))])):(ge(),Se("div",fae,Le(t.t("vizy","No icons match your query.")),1))])])}const hae=Bt(Gse,[["render",dae]]),pae={name:"FieldLayoutDesigner",props:{layoutUid:{type:String,default:null},fieldId:{type:String,default:null},blockTypeId:{type:String,default:null},modelValue:{type:[Object,Array,String],default:()=>{}}},emits:["update:modelValue"],data(){return{error:!1,errorMessage:"",loading:!1,mounted:!1,proxyValue:{}}},watch:{proxyValue(t){this.$emit("update:modelValue",t)}},created(){this.proxyValue=this.modelValue},mounted(){this.loading=!0;const t=[];this.fieldId&&t.push(this.fieldId);const n=/fields\/edit\/(\d*)$/g.exec(window.location.href);n&&n[1]&&t.push(n[1]);const r={fieldIds:t,layoutUid:this.layoutUid,blockTypeId:this.blockTypeId,layout:this.proxyValue};Craft.sendActionRequest("POST","vizy/field/layout-designer",{data:r}).then(i=>{if(i.data.html)this.$el.innerHTML=i.data.html,Craft.appendBodyHtml(i.data.footHtml),this.watchForChanges(),this.mounted=!0;else throw new Error(i.data)}).catch(i=>{this.error=!0,this.errorMessage=i,this.loading=!1})},methods:{watchForChanges(){const t=y6(this.serializeLayout,150);new MutationObserver(n=>{t()}).observe(this.$el,{childList:!0,attributes:!0,subtree:!0,characterData:!0})},serializeLayout(){this.mounted&&(this.proxyValue=this.$el.querySelector('input[name="fieldLayout"]').value,setTimeout(()=>{this.proxyValue=this.$el.querySelector('input[name="fieldLayout"]').value},400))}}},mae={ref:"fld-container",class:"vui-block-editor-layout"},gae={class:"vui-workspace"},vae={key:0,class:"vui-loading-pane"},yae=re("div",{class:"vui-loading fui-loading-lg"},null,-1),bae=[yae],_ae={key:1,class:"vui-error-pane error"},wae={class:"vui-error-content"},kae=re("span",{"data-icon":"alert"},null,-1),xae=["innerHTML"];function Sae(t,e,n,r,i,o){return ge(),Se("div",mae,[re("div",gae,[i.loading?(ge(),Se("div",vae,bae)):gt("",!0),i.error?(ge(),Se("div",_ae,[re("div",wae,[kae,re("span",{class:"error",innerHTML:i.errorMessage},null,8,xae)])])):gt("",!0)])],512)}const Cae=Bt(pae,[["render",Sae]]),Tae=Vn({name:"default-section",props:{section:{type:Object,required:!0},currentIndex:{type:[Number,String],required:!1,default:1/0},renderSuggestion:{type:Function,required:!1},normalizeItemFunction:{type:Function,required:!0},componentAttrPrefix:{type:String,required:!0},componentAttrIdAutosuggest:{type:String,required:!0}},data:function(){return{_currentIndex:this.currentIndex}},computed:{list:function(){let{limit:t,data:e}=this.section;return e.lengthi.type!==kt&&i.children.length===0)||[];return mr("ul",{role:"listbox",class:this.section.ulClass,"aria-labelledby":this.section.label&&`${this.componentAttrIdAutosuggest}-${this.section.label}`},[r[0]&&r[0]||this.section.label&&mr("li",{class:n,id:`${this.componentAttrIdAutosuggest}-${this.section.label}`},[this.section.label])||"",this.list.map((i,o)=>{const s=this.normalizeItemFunction(this.section.name,this.section.type,this.section.label,this.section.liClass,i),l=this.getItemIndex(o),u=this._currentIndex===l||parseInt(this.currentIndex)===l;return mr("li",{role:"option","data-suggestion-index":l,"data-section-name":s.name,id:`${t}__results-item--${l}`,...s.liAttributes,key:l,class:{[`${t}__results-item--highlighted`]:u,[`${t}__results-item`]:!0,...s.liClass},onMouseenter:this.onMouseEnter,onMouseleave:this.onMouseLeave},[this.renderSuggestion?this.renderSuggestion(s):this.$slots.default&&this.$slots.default({_key:o,suggestion:s})])}),e.afterSectionDefault&&e.afterSectionDefault({section:this.section,className:`${t}__results-after ${t}__results-after--${this.section.name}`}),e.afterSectionNamed&&e.afterSectionNamed({section:this.section,className:`${t}__results_after ${t}__results-after--${this.section.name}`})])}});function Eae(t,e){return!!t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}function Aae(t,e){Eae(t,e)||(t.className+=" "+e)}function Oae(t,e){t.classList&&t.classList.remove(e)}const xA=-1,SA={name:"default",type:"default-section"},Mae={name:"Autosuggest",components:{DefaultSection:Tae},inheritAttrs:!1,props:{modelValue:{type:String,default:null},inputProps:{type:Object,required:!0},limit:{type:Number,required:!1,default:1/0},suggestions:{type:Array,required:!0},renderSuggestion:{type:Function,required:!1,default:null},getSuggestionValue:{type:Function,required:!1,default:t=>{const e=t.item;return typeof e=="object"&&e.hasOwnProperty("name")?e.name:e}},shouldRenderSuggestions:{type:Function,required:!1,default:(t,e)=>t>0&&!e},sectionConfigs:{type:Object,required:!1,default:()=>({default:{onSelected:null}})},onSelected:{type:Function,required:!1,default:null},componentAttrIdAutosuggest:{type:String,required:!1,default:"autosuggest"},componentAttrClassAutosuggestResultsContainer:{type:String,required:!1,default:null},componentAttrClassAutosuggestResults:{type:String,required:!1,default:null},componentAttrPrefix:{type:String,required:!1,default:"autosuggest"},class:null,style:null},data(){return{internalValue:null,searchInputOriginal:null,currentIndex:null,currentItem:null,loading:!1,didSelectFromOptions:!1,defaultInputProps:{type:"text",autocomplete:"off"},clientXMouseDownInitial:null}},computed:{internal_inputProps(){return{...this.defaultInputProps,...this.inputProps,...this.listeners}},listeners(){return{onInput:t=>{},onClick:()=>{this.loading=!1,this.$attrs.click&&this.$attrs.click(this.currentItem),this.$nextTick(()=>{this.ensureItemVisible(this.currentItem,this.currentIndex)})},onSelected:()=>{this.currentItem&&this.sectionConfigs[this.currentItem.name]&&this.sectionConfigs[this.currentItem.name].onSelected?this.sectionConfigs[this.currentItem.name].onSelected(this.currentItem,this.searchInputOriginal):this.sectionConfigs.default.onSelected?this.sectionConfigs.default.onSelected(null,this.searchInputOriginal):this.onSelected&&this.$emit("selected",this.currentItem,this.currentIndex),this.setChangeItem(null)}}},isOpen(){return this.shouldRenderSuggestions(this.totalResults,this.loading)},computedSections(){let t=0;return this.suggestions.map(e=>{if(!e.data)return;const n=e.name?e.name:SA.name;let r,i,o,s,l=null;this.sectionConfigs[n]&&(r=this.sectionConfigs[n].limit,o=this.sectionConfigs[n].type,i=this.sectionConfigs[n].label,s=this.sectionConfigs[n].ulClass,l=this.sectionConfigs[n].liClass),o=o||SA.type,r=r||this.limit,r=r||1/0,r=e.data.length{if(!e)return t;const{limit:n,data:r}=e;return t+(r.length>=n?n:r.length)},0)},_componentAttrClassAutosuggestResultsContainer(){return this.componentAttrClassAutosuggestResultsContainer||`${this.componentAttrPrefix}__results-container`},_componentAttrClassAutosuggestResults(){return this.componentAttrClassAutosuggestResults||`${this.componentAttrPrefix}__results`}},watch:{modelValue:{handler(t){this.internalValue=t},immediate:!0},isOpen:{handler(t,e){t!==e&&this.$emit(t?"opened":"closed")},immediate:!0}},created(){this.loading=!0},mounted(){document.addEventListener("mouseup",this.onDocumentMouseUp),document.addEventListener("mousedown",this.onDocumentMouseDown)},beforeUnmount(){document.removeEventListener("mouseup",this.onDocumentMouseUp),document.removeEventListener("mousedown",this.onDocumentMouseDown)},methods:{afterSlot(t){return`after-section-${t.name||t.label}`},beforeSlot(t){return`before-section-${t.name||t.label}`},inputHandler(t){const e=t.target.value;this.$emit("update:modelValue",e),this.internalValue=e,this.didSelectFromOptions||(this.searchInputOriginal=e,this.currentIndex=null)},getSectionRef(t){return"computed_section_"+t},getItemByIndex(t){let e=!1;if(t===null)return e;for(var n=0;n=this.computedSections[n].start_index&&t<=this.computedSections[n].end_index){let r=t-this.computedSections[n].start_index;this.computedSections[n].name;let i=this.computedSections[n].data[r];if(i){e=this.normalizeItem(this.computedSections[n].name,this.computedSections[n].type,i.name,"",i);break}}return e},handleKeyStroke(t){const{keyCode:e}=t;if([16,9,17,18,91,93].indexOf(e)>-1)return;const r=!this.isOpen;if(this.loading=!1,this.didSelectFromOptions=!1,this.isOpen)switch(e){case 40:case 38:if(t.preventDefault(),e===38&&this.currentIndex===null)break;const i=e===40?1:-1,o=Math.max((parseInt(this.currentIndex)||0)+(r?0:i),xA);this.setCurrentIndex(o,this.totalResults),this.didSelectFromOptions=!0,this.totalResults>0&&this.currentIndex>=0?(this.setChangeItem(this.getItemByIndex(this.currentIndex)),this.didSelectFromOptions=!0):this.currentIndex===xA&&(this.setChangeItem(null),this.internalValue=this.searchInputOriginal,t.preventDefault()),this.$nextTick(()=>{this.ensureItemVisible(this.currentItem,this.currentIndex)});break;case 13:t.preventDefault(),this.totalResults>0&&this.currentIndex>=0&&(this.setChangeItem(this.getItemByIndex(this.currentIndex),!0),this.didSelectFromOptions=!0),this.loading=!0,this.listeners.onSelected(this.didSelectFromOptions);break;case 27:this.loading=!0,this.currentIndex=null,this.internalValue=this.searchInputOriginal,this.$emit("input",this.searchInputOriginal),t.preventDefault();break}},setChangeItem(t,e=!1){if(this.currentIndex===null||!t)this.currentItem=null,this.$emit("item-changed",null,null);else if(t){this.currentItem=t,this.$emit("item-changed",t,this.currentIndex);const n=this.getSuggestionValue(t);this.internalValue=n,e&&(this.searchInputOriginal=n),this.ensureItemVisible(t,this.currentIndex)}},normalizeItem(t,e,n,r,i){return{name:t,type:e,label:n,liClass:i.liClass||r,item:i}},ensureItemVisible(t,e,n){const r=this.$el.querySelector(n||`.${this._componentAttrClassAutosuggestResults}`);if(!r)return;const i=r.querySelector(`#${this.componentAttrPrefix}__results-item--${e}`);if(!i)return;const o=r.clientHeight,s=r.scrollTop,l=i.clientHeight,u=i.offsetTop;l+u>=s+o?r.scrollTop=l+u-o:u0&&(r.scrollTop=u)},updateCurrentIndex(t){this.setCurrentIndex(t,-1,!0)},clickedOnScrollbar(t,e){const n=this.$el.querySelector(`.${this._componentAttrClassAutosuggestResults}`),r=n&&n.clientWidth<=e+17&&e+17<=n.clientWidth+34;return t.target.tagName==="DIV"&&n&&r||!1},onDocumentMouseDown(t){var e=t.target.getBoundingClientRect?t.target.getBoundingClientRect():0;this.clientXMouseDownInitial=t.clientX-e.left},onDocumentMouseUp(t){if(!this.$el.contains(t.target)){this.loading=!0,this.currentIndex=null;return}t.target.tagName==="INPUT"||this.clickedOnScrollbar(t,this.clientXMouseDownInitial)||(this.loading=!0,this.didSelectFromOptions=!0,this.setChangeItem(this.getItemByIndex(this.currentIndex),!0),this.listeners.onSelected(!0))},setCurrentIndex(t,e=-1,n=!1){let r=t;if(!n){const s=this.currentIndex===null,l=t>=e;(s||l)&&(r=0)}this.currentIndex=r;const i=this.$el.querySelector(`#${this.componentAttrPrefix}__results-item--${this.currentIndex}`),o=`${this.componentAttrPrefix}__results-item--highlighted`;this.$el.querySelector(`.${o}`)&&Oae(this.$el.querySelector(`.${o}`),o),i&&Aae(i,o)}}},Nae=["id"],Lae=["aria-expanded","aria-owns"],Iae=["type","value","autocomplete","aria-activedescendant","aria-controls"],Pae=["id"],Dae=["aria-labelledby"];function Rae(t,e,n,r,i,o){return ge(),Se("div",{id:n.componentAttrIdAutosuggest,class:vt(t.$props.class),style:oi(t.$props.style)},[pn(t.$slots,"before-input"),re("div",{role:"combobox","aria-expanded":o.isOpen?"true":"false","aria-haspopup":"listbox","aria-owns":`${n.componentAttrIdAutosuggest}-${n.componentAttrPrefix}__results`},[re("input",wi({type:o.internal_inputProps.type,value:i.internalValue,autocomplete:o.internal_inputProps.autocomplete,class:[o.isOpen?`${n.componentAttrPrefix}__input--open`:"",o.internal_inputProps.class]},o.internal_inputProps,{"aria-autocomplete":"list","aria-activedescendant":o.isOpen&&i.currentIndex!==null?`${n.componentAttrPrefix}__results-item--${i.currentIndex}`:"","aria-controls":`${n.componentAttrIdAutosuggest}-${n.componentAttrPrefix}__results`,onInput:e[0]||(e[0]=(...s)=>o.inputHandler&&o.inputHandler(...s)),onKeydown:e[1]||(e[1]=(...s)=>o.handleKeyStroke&&o.handleKeyStroke(...s))}),null,16,Iae)],8,Lae),pn(t.$slots,"after-input"),re("div",{id:`${n.componentAttrIdAutosuggest}-${n.componentAttrPrefix}__results`,class:vt(o._componentAttrClassAutosuggestResultsContainer)},[o.isOpen?(ge(),Se("div",{key:0,class:vt(o._componentAttrClassAutosuggestResults),"aria-labelledby":n.componentAttrIdAutosuggest},[pn(t.$slots,"before-suggestions"),(ge(!0),Se(kt,null,Zt(o.computedSections,(s,l)=>(ge(),Ct(Qs(s.type),{ref_for:!0,ref:o.getSectionRef(`${s.name}${l}`),key:o.getSectionRef(`${s.name}${l}`),"current-index":i.currentIndex,"normalize-item-function":o.normalizeItem,"render-suggestion":n.renderSuggestion,section:s,"component-attr-prefix":n.componentAttrPrefix,"component-attr-id-autosuggest":n.componentAttrIdAutosuggest,onUpdateCurrentIndex:o.updateCurrentIndex},{[o.beforeSlot(s)]:Vt(({section:u,className:f})=>[pn(t.$slots,o.beforeSlot(s),{section:u,className:f})]),default:Vt(({suggestion:u,_key:f})=>[pn(t.$slots,"default",{suggestion:u,index:f},()=>[Ui(Le(u.item),1)])]),[o.afterSlot(s)]:Vt(({section:u})=>[pn(t.$slots,`after-section-${s.name||s.label}`,{section:u})]),"after-section":Vt(({section:u})=>[pn(t.$slots,"after-section",{section:u})]),_:2},1064,["current-index","normalize-item-function","render-suggestion","section","component-attr-prefix","component-attr-id-autosuggest","onUpdateCurrentIndex"]))),128)),pn(t.$slots,"after-suggestions")],10,Dae)):gt("",!0),pn(t.$slots,"after-suggestions-container")],10,Pae)],14,Nae)}const zae=Bt(Mae,[["render",Rae]]),Bae={name:"AutoSuggest",components:{VueAutosuggest:zae},props:{id:{type:String,default:""},suggestions:{type:[Object,Array],default:()=>[]},modelValue:{type:String,default:""}},emits:["update:modelValue"],data(){return{query:"",selected:"",filteredOptions:[],inputProps:{class:"text fullwidth",initialValue:this.modelValue,style:"",id:this.id,name:this.id,maxlength:"",autofocus:!1,disabled:!1,title:"",placeholder:""},limit:5}},methods:{onInputChange(t){this.query=(t||"").toLowerCase(),this.updateFilteredOptions(),t||this.$emit("update:modelValue","")},updateFilteredOptions(){if(this.query===""){this.filteredOptions=this.suggestions;return}const t=[];let e,n,r,i;for(e=0;e{const l=this.scoreItem(o,this.query),u=this.scoreItem(s,this.query);return l===u?0:li.inputProps.initialValue=l),o.onInputChange],suggestions:i.filteredOptions,"get-suggestion-value":o.getSuggestionValue,"input-props":i.inputProps,limit:i.limit,"component-attr-id-autosuggest":n.id,onSelected:o.onSelected,onFocus:o.updateFilteredOptions,onBlur:o.onBlur},{default:Vt(({suggestion:l})=>[Ui(Le(l.item.name||l.item)+" ",1),l.item.hint?(ge(),Se("span",$ae,"– "+Le(l.item.hint),1)):gt("",!0)]),_:1},8,["modelValue","suggestions","get-suggestion-value","input-props","limit","component-attr-id-autosuggest","onSelected","onFocus","onBlur","onUpdate:modelValue"])}const Fae=Bt(Bae,[["render",Hae]]),Vae={name:"HandleInput",props:{id:{type:String,default:""},sourceValue:{type:String,default:""},collection:{type:Array,default:()=>[]},modelValue:{type:String,default:""}},emits:["update:modelValue"],data(){return{savedValue:"",proxyValue:""}},watch:{sourceValue(t){this.savedValue===""&&this.generateHandle()},proxyValue(t){this.$emit("update:modelValue",t)}},created(){this.savedValue=this.modelValue,this.proxyValue=this.modelValue},methods:{generateHandle(t){let e=Yee(this.sourceValue);this.collection.length&&(e=ZN(this.collection,e,0)),this.proxyValue=e}}};function jae(t,e,n,r,i,o){return Ut((ge(),Se("input",{id:"id","onUpdate:modelValue":e[0]||(e[0]=s=>i.proxyValue=s),type:"text",class:"text fullwidth code",autocomplete:"off",autocorrect:"off",autocapitalize:"off"},null,512)),[[Mn,i.proxyValue]])}const Wae=Bt(Vae,[["render",jae]]),Uae=function(){return window.safari!==void 0},qae={name:"VizySettings",components:{VizyIconPicker:hae,LightswitchField:XN,FieldLayoutDesigner:Cae,AutoSuggest:Fae,HandleInput:Wae,Drag:Wse,Drop:Kse},props:{fieldName:{type:String,required:!0},errors:{type:[Object,Array],default:()=>{}}},data(){return{selectedBlockType:null,isSafari:Uae(),emptySvg:'',fieldData:[],settings:{}}},computed:{handleCollection(){const t=[];return Array.isArray(this.fieldData)&&this.fieldData.forEach(e=>{e.blockTypes.forEach(n=>{n!==this.selectedBlockType&&t.push(n.handle)})}),t}},created(){this.fieldData=this.$root.fieldData,this.settings=this.$root.settings},mounted(){},methods:{updateSelectedBlockType(t,e=!1){this.selectedBlockType=null,this.$nextTick(()=>{this.selectedBlockType=t,this.$nextTick(()=>{this.$refs["name-field"].value||this.$refs["name-field"].focus()})})},selectBlockType(t){this.selectedBlockType===t?this.selectedBlockType=null:this.updateSelectedBlockType(t)},getErrors(t,e=""){let n=[];const r=`${t.id}:${e}`;return this.errors&&(n=Object.keys(this.errors).filter(i=>i.includes(r)).map(i=>this.errors[i][0])),n},hasErrors(t,e=""){return this.getErrors(t,e).length},addBlockType(t){t.blockTypes||(t.blockTypes=[]),t.blockTypes.push({id:Xm("type-"),enabled:!0}),this.updateSelectedBlockType(t.blockTypes[t.blockTypes.length-1],!0)},addGroup(){const t=prompt(Craft.t("vizy","Give your group a name."));t&&this.fieldData.push({id:Xm("group-"),name:t,blockTypes:[]})},deleteBlockType(){const t=Craft.t("vizy","Are you sure you want to delete “{name}”? This will permanently delete all content created with this block type.",{name:this.selectedBlockType.name});if(confirm(t))for(let e=0;this.fieldData.length;e++){const n=this.fieldData[e].blockTypes.indexOf(this.selectedBlockType);if(n!==-1){this.fieldData[e].blockTypes.splice(n,1),this.selectedBlockType=null;break}}},deleteGroup(t){const e=Craft.t("vizy","Are you sure you want to delete “{name}”? This will permanently delete all content created with any of these block types.",{name:t.name});if(confirm(e)){const n=this.fieldData.indexOf(t);n!==-1&&(this.fieldData.splice(n,1),this.selectedBlockType=null)}},moveGroupUp(t){const e=this.fieldData.indexOf(t),n=e-1,[r]=this.fieldData.splice(e,1);this.fieldData.splice(n,0,r)},moveGroupDown(t){const e=this.fieldData.indexOf(t),n=e+1,[r]=this.fieldData.splice(e,1);this.fieldData.splice(n,0,r)},dragEnter(t,e){e&&e.target.parentNode.classList.add("is-active")},dragLeave(t,e){e&&e.target.parentNode.classList.remove("is-active")},dragDrop(t,e){if(!e)return;e.target.parentNode.classList.remove("is-active");const n=parseInt(t.groupIndex),r=parseInt(t.blockTypeIndex),i=parseInt(e.target.getAttribute("data-group"));let o=parseInt(e.target.getAttribute("data-block"));if(n===i&&r===o||n===i&&r===o-1)return;n===i&&r(ge(),Se("div",{key:_,class:"vui-block-group"},[_>0?(ge(),Se("hr",Xae)):gt("",!0),re("div",Zae,[re("span",{class:"vui-block-items-header-text",contenteditable:"true",onBlur:C=>y.name=C.target.innerText,innerHTML:y.name},null,40,Qae),re("div",ele,[_>0?(ge(),Se("button",{key:0,class:"vui-block-items-header-move",onClick:lt(C=>o.moveGroupUp(y),["prevent"])},rle,8,tle)):gt("",!0),_o.moveGroupDown(y),["prevent"])},sle,8,ile)):gt("",!0),re("button",{class:"vui-block-items-header-delete",onClick:lt(C=>o.deleteGroup(y),["prevent"])},Le(t.t("site","Delete")),9,ale)])]),re("div",lle,[(ge(!0),Se(kt,null,Zt(y.blockTypes,(C,x)=>(ge(),Se("div",{key:x,class:vt(["vui-block-item",{active:i.selectedBlockType===C,"has-error":o.hasErrors(C)}]),onClick:lt(k=>o.selectBlockType(C),["prevent"])},[re("div",cle,[Qe(s,{"data-group":_,"data-block":x,class:"dropzone-vertical",onDrop:o.dragDrop,onDragenter:o.dragEnter,onDragleave:o.dragLeave},null,8,["data-group","data-block","onDrop","onDragenter","onDragleave"]),fle]),Qe(l,{"transfer-data":{groupIndex:_,blockTypeIndex:x}},W1({default:Vt(()=>[re("div",{innerHTML:C.icon?C.icon.svg:i.emptySvg},null,8,dle),re("span",hle,Le(C.name),1),re("span",{class:vt(["vui-block-item-status",{on:C.enabled}])},null,2)]),_:2},[i.isSafari?void 0:{name:"image",fn:Vt(()=>[re("div",ple,[re("div",{innerHTML:C.icon?C.icon.svg:i.emptySvg},null,8,mle),re("span",gle,Le(C.name),1),re("span",{class:vt(["vui-block-item-status",{on:C.enabled}])},null,2)])]),key:"0"}]),1032,["transfer-data"]),x==y.blockTypes.length-1?(ge(),Se("div",vle,[Qe(s,{"data-group":_,"data-block":x+1,class:"dropzone-vertical",onDrop:o.dragDrop,onDragenter:o.dragEnter,onDragleave:o.dragLeave},null,8,["data-group","data-block","onDrop","onDragenter","onDragleave"]),yle])):gt("",!0)],10,ule))),128)),re("div",{class:"vui-block-item vui-block-new-item",onClick:lt(C=>o.addBlockType(y),["prevent"])},[!y.blockTypes||!y.blockTypes.length?(ge(),Se("div",_le,[re("div",wle,[Qe(s,{"data-group":_,"data-block":0,class:"dropzone-vertical",onDrop:o.dragDrop,onDragenter:o.dragEnter,onDragleave:o.dragLeave},null,8,["data-group","onDrop","onDragenter","onDragleave"]),kle])])):gt("",!0),xle,re("span",Sle,Le(t.t("vizy","Add Block")),1)],8,ble)])]))),128)),i.fieldData.length?(ge(),Se("hr",Cle)):gt("",!0),re("div",{class:"vui-block-item vui-block-new-item vui-block-new-group",onClick:e[0]||(e[0]=lt((...y)=>o.addGroup&&o.addGroup(...y),["prevent"]))},[Tle,re("span",Ele,Le(t.t("vizy","Add Group")),1)])])]),i.selectedBlockType?(ge(),Se("div",Ale,[re("div",Ole,[re("div",Mle,Le(i.selectedBlockType.name),1),re("div",Nle,[re("button",{class:"vui-block-titlebar-delete",onClick:e[1]||(e[1]=lt((...y)=>o.deleteBlockType&&o.deleteBlockType(...y),["prevent"]))},Le(t.t("vizy","Delete")),1),Qe(u,{modelValue:i.selectedBlockType.enabled,"onUpdate:modelValue":e[2]||(e[2]=y=>i.selectedBlockType.enabled=y),small:!0},null,8,["modelValue"])])]),o.getErrors(i.selectedBlockType,"general")?(ge(),Se("ul",Lle,[(ge(!0),Se(kt,null,Zt(o.getErrors(i.selectedBlockType,"general"),(y,_)=>(ge(),Se("li",{key:_},Le(y),1))),128))])):gt("",!0),re("div",Ile,[re("div",Ple,[re("label",Dle,Le(t.t("vizy","Name")),1)]),re("div",Rle,[re("p",null,Le(t.t("vizy","What this block type will be called in the control panel.")),1)]),re("div",zle,[Ut(re("input",{id:"name",ref:"name-field","onUpdate:modelValue":e[3]||(e[3]=y=>i.selectedBlockType.name=y),type:"text",class:vt(["text fullwidth",{error:o.hasErrors(i.selectedBlockType,"name")}]),autocomplete:"off",autocorrect:"off",autocapitalize:"off"},null,2),[[Mn,i.selectedBlockType.name]])]),o.getErrors(i.selectedBlockType,"name")?(ge(),Se("ul",Ble,[(ge(!0),Se(kt,null,Zt(o.getErrors(i.selectedBlockType,"name"),(y,_)=>(ge(),Se("li",{key:_},Le(y),1))),128))])):gt("",!0)]),re("div",$le,[re("div",Hle,[re("label",Fle,Le(t.t("vizy","Handle")),1)]),re("div",Vle,[re("p",null,Le(t.t("vizy","How you’ll refer to this block type in the templates.")),1)]),re("div",jle,[Qe(f,{id:"handle",ref:"handle-field",modelValue:i.selectedBlockType.handle,"onUpdate:modelValue":e[4]||(e[4]=y=>i.selectedBlockType.handle=y),"source-value":i.selectedBlockType.name,collection:o.handleCollection,class:vt({error:o.hasErrors(i.selectedBlockType,"handle")})},null,8,["modelValue","source-value","collection","class"])]),o.getErrors(i.selectedBlockType,"handle")?(ge(),Se("ul",Wle,[(ge(!0),Se(kt,null,Zt(o.getErrors(i.selectedBlockType,"handle"),(y,_)=>(ge(),Se("li",{key:_},Le(y),1))),128))])):gt("",!0)]),re("div",Ule,[re("div",qle,[re("label",Kle,Le(t.t("vizy","Icon")),1)]),re("div",Gle,[re("p",null,Le(t.t("vizy","Select an appropriate icon for the block type. Start typing to search via keywords.")),1)]),re("div",Yle,[Qe(d,{modelValue:i.selectedBlockType.icon,"onUpdate:modelValue":e[5]||(e[5]=y=>i.selectedBlockType.icon=y),"input-classes":{error:o.hasErrors(i.selectedBlockType,"icon")}},null,8,["modelValue","input-classes"])]),o.getErrors(i.selectedBlockType,"icon")?(ge(),Se("ul",Jle,[(ge(!0),Se(kt,null,Zt(o.getErrors(i.selectedBlockType,"icon"),(y,_)=>(ge(),Se("li",{key:_},Le(y),1))),128))])):gt("",!0)]),re("div",Xle,[re("div",Zle,[re("label",Qle,Le(t.t("vizy","Layout")),1)]),re("div",eue,[re("p",null,Le(t.t("vizy","Define the field layout for this block type. Empty tabs are not allowed, and you must provide at least one element.")),1)]),re("div",tue,[Qe(m,{modelValue:i.selectedBlockType.layout,"onUpdate:modelValue":e[6]||(e[6]=y=>i.selectedBlockType.layout=y),"layout-uid":i.selectedBlockType.layoutUid,"field-id":i.settings.fieldId,"block-type-id":i.selectedBlockType.id},null,8,["modelValue","layout-uid","field-id","block-type-id"])])]),re("div",nue,[re("div",rue,[re("label",iue,Le(t.t("vizy","Template")),1)]),re("div",oue,[re("p",null,Le(t.t("vizy","Provide the path for a template partial for rendering this block type.")),1)]),re("div",sue,[Qe(v,{id:"template",modelValue:i.selectedBlockType.template,"onUpdate:modelValue":e[7]||(e[7]=y=>i.selectedBlockType.template=y),suggestions:i.settings.suggestions},null,8,["modelValue","suggestions"])]),o.getErrors(i.selectedBlockType,"template")?(ge(),Se("ul",aue,[(ge(!0),Se(kt,null,Zt(o.getErrors(i.selectedBlockType,"template"),(y,_)=>(ge(),Se("li",{key:_},Le(y),1))),128))])):gt("",!0)]),re("div",lue,[re("div",uue,[re("label",cue,Le(t.t("vizy","Min Blocks")),1)]),re("div",fue,[re("p",null,Le(t.t("vizy","The minimum number of blocks of this type the field is allowed to have.")),1)]),re("div",due,[Ut(re("input",{id:"minBlocks",ref:"minBlocks-field","onUpdate:modelValue":e[8]||(e[8]=y=>i.selectedBlockType.minBlocks=y),type:"text",class:vt(["text",{error:o.hasErrors(i.selectedBlockType,"minBlocks")}]),autocomplete:"off",autocorrect:"off",autocapitalize:"off",size:"2"},null,2),[[Mn,i.selectedBlockType.minBlocks]])]),o.getErrors(i.selectedBlockType,"minBlocks")?(ge(),Se("ul",hue,[(ge(!0),Se(kt,null,Zt(o.getErrors(i.selectedBlockType,"minBlocks"),(y,_)=>(ge(),Se("li",{key:_},Le(y),1))),128))])):gt("",!0)]),re("div",pue,[re("div",mue,[re("label",gue,Le(t.t("vizy","Max Blocks")),1)]),re("div",vue,[re("p",null,Le(t.t("vizy","The maximum number of blocks of this type the field is allowed to have.")),1)]),re("div",yue,[Ut(re("input",{id:"maxBlocks",ref:"maxBlocks-field","onUpdate:modelValue":e[9]||(e[9]=y=>i.selectedBlockType.maxBlocks=y),type:"text",class:vt(["text",{error:o.hasErrors(i.selectedBlockType,"maxBlocks")}]),autocomplete:"off",autocorrect:"off",autocapitalize:"off",size:"2"},null,2),[[Mn,i.selectedBlockType.maxBlocks]])]),o.getErrors(i.selectedBlockType,"maxBlocks")?(ge(),Se("ul",bue,[(ge(!0),Se(kt,null,Zt(o.getErrors(i.selectedBlockType,"maxBlocks"),(y,_)=>(ge(),Se("li",{key:_},Le(y),1))),128))])):gt("",!0)])])):(ge(),Se("div",_ue,[i.fieldData.length?(ge(),Se("p",wue,Le(t.t("vizy","Select a block to edit.")),1)):(ge(),Se("p",kue,Le(t.t("vizy","Add a new group to begin.")),1)),xue]))])}const Cue=Bt(qae,[["render",Sue]]);typeof Craft.Vizy>"u"&&(Craft.Vizy={});Craft.Vizy.Config=new aee;document.dispatchEvent(new CustomEvent("onVizyConfigReady",{bubbles:!0}));Craft.Vizy.Input=Garnish.Base.extend({init(t){const e=`#${t}-field .input`,n=O6({components:{VizyInput:kA}});n.component("VizyInput",kA),!document.querySelector(e).__vueInit&&n.mount(e)}});Craft.Vizy.Settings=Garnish.Base.extend({init(t,e,n){this.inputNamePrefix=t,this.inputIdPrefix=Craft.formatInputId(this.inputNamePrefix),O6({components:{VizySettings:Cue},data(){return{fieldData:e,settings:n}}}).mount(`.${this.inputIdPrefix}-vizy-configurator`)}});$(document).ready(()=>{Craft.VizyReady=!0,document.dispatchEvent(new CustomEvent("vizy-loaded"))})});export default Tue(); -//# sourceMappingURL=vizy-91fcee7d.js.map ->>>>>>>> origin/craft-4:src/web/assets/field/dist/assets/vizy-91fcee7d.js diff --git a/src/web/assets/field/dist/assets/vizy-1d31d33d.js.gz b/src/web/assets/field/dist/assets/vizy-1d31d33d.js.gz deleted file mode 100644 index 7bdeeaf..0000000 Binary files a/src/web/assets/field/dist/assets/vizy-1d31d33d.js.gz and /dev/null differ diff --git a/src/web/assets/field/dist/assets/vizy-1d31d33d.js.map b/src/web/assets/field/dist/assets/vizy-1d31d33d.js.map deleted file mode 100644 index 06798a8..0000000 --- a/src/web/assets/field/dist/assets/vizy-1d31d33d.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"vizy-1d31d33d.js","sources":["../../../../../../node_modules/@vue/shared/dist/shared.esm-bundler.js","../../../../../../node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js","../../../../../../node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js","../../../../../../node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js","../../../../../../node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js","../../../../../../node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js","../../../../../../node_modules/vue/dist/vue.esm-bundler.js","../../../../../../node_modules/mitt/dist/mitt.es.js","../../../../../../node_modules/@floating-ui/core/dist/floating-ui.core.esm.js","../../../../../../node_modules/@floating-ui/dom/dist/floating-ui.dom.esm.js","../../../../../../node_modules/floating-vue/dist/floating-vue.es.js","../../../../../../node_modules/vue-final-modal/dist/VueFinalModal.esm.js","../../src/js/vendor/vue-unique-id/index.js","../../src/js/utils/object.js","../../../../../../node_modules/lodash-es/_freeGlobal.js","../../../../../../node_modules/lodash-es/_root.js","../../../../../../node_modules/lodash-es/_Symbol.js","../../../../../../node_modules/lodash-es/_getRawTag.js","../../../../../../node_modules/lodash-es/_objectToString.js","../../../../../../node_modules/lodash-es/_baseGetTag.js","../../../../../../node_modules/lodash-es/isObjectLike.js","../../../../../../node_modules/lodash-es/isSymbol.js","../../../../../../node_modules/lodash-es/_arrayMap.js","../../../../../../node_modules/lodash-es/isArray.js","../../../../../../node_modules/lodash-es/_baseToString.js","../../../../../../node_modules/lodash-es/_trimmedEndIndex.js","../../../../../../node_modules/lodash-es/_baseTrim.js","../../../../../../node_modules/lodash-es/isObject.js","../../../../../../node_modules/lodash-es/toNumber.js","../../../../../../node_modules/lodash-es/toFinite.js","../../../../../../node_modules/lodash-es/toInteger.js","../../../../../../node_modules/lodash-es/identity.js","../../../../../../node_modules/lodash-es/isFunction.js","../../../../../../node_modules/lodash-es/_coreJsData.js","../../../../../../node_modules/lodash-es/_isMasked.js","../../../../../../node_modules/lodash-es/_toSource.js","../../../../../../node_modules/lodash-es/_baseIsNative.js","../../../../../../node_modules/lodash-es/_getValue.js","../../../../../../node_modules/lodash-es/_getNative.js","../../../../../../node_modules/lodash-es/_WeakMap.js","../../../../../../node_modules/lodash-es/_baseCreate.js","../../../../../../node_modules/lodash-es/_apply.js","../../../../../../node_modules/lodash-es/_copyArray.js","../../../../../../node_modules/lodash-es/_shortOut.js","../../../../../../node_modules/lodash-es/constant.js","../../../../../../node_modules/lodash-es/_defineProperty.js","../../../../../../node_modules/lodash-es/_baseSetToString.js","../../../../../../node_modules/lodash-es/_setToString.js","../../../../../../node_modules/lodash-es/_baseFindIndex.js","../../../../../../node_modules/lodash-es/_isIndex.js","../../../../../../node_modules/lodash-es/_baseAssignValue.js","../../../../../../node_modules/lodash-es/eq.js","../../../../../../node_modules/lodash-es/_assignValue.js","../../../../../../node_modules/lodash-es/_copyObject.js","../../../../../../node_modules/lodash-es/_overRest.js","../../../../../../node_modules/lodash-es/_baseRest.js","../../../../../../node_modules/lodash-es/isLength.js","../../../../../../node_modules/lodash-es/isArrayLike.js","../../../../../../node_modules/lodash-es/_isIterateeCall.js","../../../../../../node_modules/lodash-es/_createAssigner.js","../../../../../../node_modules/lodash-es/_isPrototype.js","../../../../../../node_modules/lodash-es/_baseTimes.js","../../../../../../node_modules/lodash-es/_baseIsArguments.js","../../../../../../node_modules/lodash-es/isArguments.js","../../../../../../node_modules/lodash-es/stubFalse.js","../../../../../../node_modules/lodash-es/isBuffer.js","../../../../../../node_modules/lodash-es/_baseIsTypedArray.js","../../../../../../node_modules/lodash-es/_baseUnary.js","../../../../../../node_modules/lodash-es/_nodeUtil.js","../../../../../../node_modules/lodash-es/isTypedArray.js","../../../../../../node_modules/lodash-es/_arrayLikeKeys.js","../../../../../../node_modules/lodash-es/_overArg.js","../../../../../../node_modules/lodash-es/_nativeKeys.js","../../../../../../node_modules/lodash-es/_baseKeys.js","../../../../../../node_modules/lodash-es/keys.js","../../../../../../node_modules/lodash-es/_nativeKeysIn.js","../../../../../../node_modules/lodash-es/_baseKeysIn.js","../../../../../../node_modules/lodash-es/keysIn.js","../../../../../../node_modules/lodash-es/assignInWith.js","../../../../../../node_modules/lodash-es/_isKey.js","../../../../../../node_modules/lodash-es/_nativeCreate.js","../../../../../../node_modules/lodash-es/_hashClear.js","../../../../../../node_modules/lodash-es/_hashDelete.js","../../../../../../node_modules/lodash-es/_hashGet.js","../../../../../../node_modules/lodash-es/_hashHas.js","../../../../../../node_modules/lodash-es/_hashSet.js","../../../../../../node_modules/lodash-es/_Hash.js","../../../../../../node_modules/lodash-es/_listCacheClear.js","../../../../../../node_modules/lodash-es/_assocIndexOf.js","../../../../../../node_modules/lodash-es/_listCacheDelete.js","../../../../../../node_modules/lodash-es/_listCacheGet.js","../../../../../../node_modules/lodash-es/_listCacheHas.js","../../../../../../node_modules/lodash-es/_listCacheSet.js","../../../../../../node_modules/lodash-es/_ListCache.js","../../../../../../node_modules/lodash-es/_Map.js","../../../../../../node_modules/lodash-es/_mapCacheClear.js","../../../../../../node_modules/lodash-es/_isKeyable.js","../../../../../../node_modules/lodash-es/_getMapData.js","../../../../../../node_modules/lodash-es/_mapCacheDelete.js","../../../../../../node_modules/lodash-es/_mapCacheGet.js","../../../../../../node_modules/lodash-es/_mapCacheHas.js","../../../../../../node_modules/lodash-es/_mapCacheSet.js","../../../../../../node_modules/lodash-es/_MapCache.js","../../../../../../node_modules/lodash-es/memoize.js","../../../../../../node_modules/lodash-es/_memoizeCapped.js","../../../../../../node_modules/lodash-es/_stringToPath.js","../../../../../../node_modules/lodash-es/toString.js","../../../../../../node_modules/lodash-es/_castPath.js","../../../../../../node_modules/lodash-es/_toKey.js","../../../../../../node_modules/lodash-es/_baseGet.js","../../../../../../node_modules/lodash-es/get.js","../../../../../../node_modules/lodash-es/_arrayPush.js","../../../../../../node_modules/lodash-es/_getPrototype.js","../../../../../../node_modules/lodash-es/isPlainObject.js","../../../../../../node_modules/lodash-es/isError.js","../../../../../../node_modules/lodash-es/attempt.js","../../../../../../node_modules/lodash-es/_hasUnicode.js","../../../../../../node_modules/lodash-es/_arrayReduce.js","../../../../../../node_modules/lodash-es/_basePropertyOf.js","../../../../../../node_modules/lodash-es/_deburrLetter.js","../../../../../../node_modules/lodash-es/deburr.js","../../../../../../node_modules/lodash-es/_asciiWords.js","../../../../../../node_modules/lodash-es/_hasUnicodeWord.js","../../../../../../node_modules/lodash-es/_unicodeWords.js","../../../../../../node_modules/lodash-es/words.js","../../../../../../node_modules/lodash-es/_createCompounder.js","../../../../../../node_modules/lodash-es/_stackClear.js","../../../../../../node_modules/lodash-es/_stackDelete.js","../../../../../../node_modules/lodash-es/_stackGet.js","../../../../../../node_modules/lodash-es/_stackHas.js","../../../../../../node_modules/lodash-es/_stackSet.js","../../../../../../node_modules/lodash-es/_Stack.js","../../../../../../node_modules/lodash-es/_cloneBuffer.js","../../../../../../node_modules/lodash-es/_arrayFilter.js","../../../../../../node_modules/lodash-es/stubArray.js","../../../../../../node_modules/lodash-es/_getSymbols.js","../../../../../../node_modules/lodash-es/_baseGetAllKeys.js","../../../../../../node_modules/lodash-es/_getAllKeys.js","../../../../../../node_modules/lodash-es/_DataView.js","../../../../../../node_modules/lodash-es/_Promise.js","../../../../../../node_modules/lodash-es/_Set.js","../../../../../../node_modules/lodash-es/_getTag.js","../../../../../../node_modules/lodash-es/_Uint8Array.js","../../../../../../node_modules/lodash-es/_cloneArrayBuffer.js","../../../../../../node_modules/lodash-es/_cloneTypedArray.js","../../../../../../node_modules/lodash-es/_initCloneObject.js","../../../../../../node_modules/lodash-es/_setCacheAdd.js","../../../../../../node_modules/lodash-es/_setCacheHas.js","../../../../../../node_modules/lodash-es/_SetCache.js","../../../../../../node_modules/lodash-es/_arraySome.js","../../../../../../node_modules/lodash-es/_cacheHas.js","../../../../../../node_modules/lodash-es/_equalArrays.js","../../../../../../node_modules/lodash-es/_mapToArray.js","../../../../../../node_modules/lodash-es/_setToArray.js","../../../../../../node_modules/lodash-es/_equalByTag.js","../../../../../../node_modules/lodash-es/_equalObjects.js","../../../../../../node_modules/lodash-es/_baseIsEqualDeep.js","../../../../../../node_modules/lodash-es/_baseIsEqual.js","../../../../../../node_modules/lodash-es/_baseIsMatch.js","../../../../../../node_modules/lodash-es/_isStrictComparable.js","../../../../../../node_modules/lodash-es/_getMatchData.js","../../../../../../node_modules/lodash-es/_matchesStrictComparable.js","../../../../../../node_modules/lodash-es/_baseMatches.js","../../../../../../node_modules/lodash-es/_baseHasIn.js","../../../../../../node_modules/lodash-es/_hasPath.js","../../../../../../node_modules/lodash-es/hasIn.js","../../../../../../node_modules/lodash-es/_baseMatchesProperty.js","../../../../../../node_modules/lodash-es/_baseProperty.js","../../../../../../node_modules/lodash-es/_basePropertyDeep.js","../../../../../../node_modules/lodash-es/property.js","../../../../../../node_modules/lodash-es/_baseIteratee.js","../../../../../../node_modules/lodash-es/_createBaseFor.js","../../../../../../node_modules/lodash-es/_baseFor.js","../../../../../../node_modules/lodash-es/now.js","../../../../../../node_modules/lodash-es/debounce.js","../../../../../../node_modules/lodash-es/_assignMergeValue.js","../../../../../../node_modules/lodash-es/isArrayLikeObject.js","../../../../../../node_modules/lodash-es/_safeGet.js","../../../../../../node_modules/lodash-es/toPlainObject.js","../../../../../../node_modules/lodash-es/_baseMergeDeep.js","../../../../../../node_modules/lodash-es/_baseMerge.js","../../../../../../node_modules/lodash-es/_escapeHtmlChar.js","../../../../../../node_modules/lodash-es/escape.js","../../../../../../node_modules/lodash-es/_createFind.js","../../../../../../node_modules/lodash-es/findIndex.js","../../../../../../node_modules/lodash-es/find.js","../../../../../../node_modules/lodash-es/isString.js","../../../../../../node_modules/lodash-es/_baseValues.js","../../../../../../node_modules/lodash-es/isEmpty.js","../../../../../../node_modules/lodash-es/kebabCase.js","../../../../../../node_modules/lodash-es/merge.js","../../../../../../node_modules/lodash-es/_asciiSize.js","../../../../../../node_modules/lodash-es/_unicodeSize.js","../../../../../../node_modules/lodash-es/_stringSize.js","../../../../../../node_modules/lodash-es/size.js","../../../../../../node_modules/lodash-es/_customDefaultsAssignIn.js","../../../../../../node_modules/lodash-es/_escapeStringChar.js","../../../../../../node_modules/lodash-es/_reInterpolate.js","../../../../../../node_modules/lodash-es/_reEscape.js","../../../../../../node_modules/lodash-es/_reEvaluate.js","../../../../../../node_modules/lodash-es/templateSettings.js","../../../../../../node_modules/lodash-es/template.js","../../src/js/utils/translations.js","../../src/js/config.js","../../../../../../node_modules/orderedmap/dist/index.js","../../../../../../node_modules/prosemirror-model/dist/index.js","../../../../../../node_modules/prosemirror-transform/dist/index.js","../../../../../../node_modules/prosemirror-state/dist/index.js","../../../../../../node_modules/prosemirror-view/dist/index.js","../../../../../../node_modules/w3c-keyname/index.es.js","../../../../../../node_modules/prosemirror-keymap/dist/index.js","../../../../../../node_modules/prosemirror-commands/dist/index.js","../../../../../../node_modules/prosemirror-schema-list/dist/index.js","../../../../../../node_modules/@tiptap/core/dist/index.js","../../src/js/config/Buttons.js","../../../../../../node_modules/@tiptap/extension-bold/dist/index.js","../../../../../../node_modules/@tiptap/extension-code/dist/index.js","../../../../../../node_modules/@tiptap/extension-highlight/dist/index.js","../../../../../../node_modules/@tiptap/extension-italic/dist/index.js","../../../../../../node_modules/@tiptap/extension-strike/dist/index.js","../../../../../../node_modules/@tiptap/extension-subscript/dist/index.js","../../../../../../node_modules/@tiptap/extension-superscript/dist/index.js","../../../../../../node_modules/@tiptap/extension-underline/dist/index.js","../../../../../../node_modules/@tiptap/extension-blockquote/dist/index.js","../../../../../../node_modules/@tiptap/extension-bullet-list/dist/index.js","../../../../../../node_modules/@tiptap/extension-code-block/dist/index.js","../../../../../../node_modules/@tiptap/extension-document/dist/index.js","../../../../../../node_modules/@tiptap/extension-hard-break/dist/index.js","../../../../../../node_modules/@tiptap/extension-heading/dist/index.js","../../../../../../node_modules/@tiptap/extension-horizontal-rule/dist/index.js","../../../../../../node_modules/@tiptap/extension-list-item/dist/index.js","../../../../../../node_modules/@tiptap/extension-ordered-list/dist/index.js","../../../../../../node_modules/@tiptap/extension-paragraph/dist/index.js","../../../../../../node_modules/prosemirror-tables/dist/index.js","../../../../../../node_modules/@tiptap/extension-table/dist/index.js","../../../../../../node_modules/@tiptap/extension-table-cell/dist/index.js","../../../../../../node_modules/@tiptap/extension-table-header/dist/index.js","../../../../../../node_modules/@tiptap/extension-table-row/dist/index.js","../../../../../../node_modules/@tiptap/extension-text/dist/index.js","../../../../../../node_modules/prosemirror-dropcursor/dist/index.js","../../../../../../node_modules/@tiptap/extension-dropcursor/dist/index.js","../../../../../../node_modules/@tiptap/extension-focus/dist/index.js","../../../../../../node_modules/prosemirror-gapcursor/dist/index.js","../../../../../../node_modules/@tiptap/extension-gapcursor/dist/index.js","../../../../../../node_modules/rope-sequence/dist/index.es.js","../../../../../../node_modules/prosemirror-history/dist/index.js","../../../../../../node_modules/@tiptap/extension-history/dist/index.js","../../../../../../node_modules/@tiptap/extension-text-align/dist/index.js","../../../../../../node_modules/linkifyjs/dist/linkify.es.js","../../../../../../node_modules/@tiptap/extension-link/dist/index.js","../../src/js/components/input/link/Link.js","../../../../../../node_modules/@tiptap/extension-image/dist/index.js","../../src/js/components/input/image/Image.js","../../../../../../node_modules/@popperjs/core/lib/enums.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/getWindow.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","../../../../../../node_modules/@popperjs/core/lib/modifiers/applyStyles.js","../../../../../../node_modules/@popperjs/core/lib/utils/getBasePlacement.js","../../../../../../node_modules/@popperjs/core/lib/utils/math.js","../../../../../../node_modules/@popperjs/core/lib/utils/userAgent.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/contains.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js","../../../../../../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js","../../../../../../node_modules/@popperjs/core/lib/utils/within.js","../../../../../../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js","../../../../../../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js","../../../../../../node_modules/@popperjs/core/lib/utils/expandToHashMap.js","../../../../../../node_modules/@popperjs/core/lib/modifiers/arrow.js","../../../../../../node_modules/@popperjs/core/lib/utils/getVariation.js","../../../../../../node_modules/@popperjs/core/lib/modifiers/computeStyles.js","../../../../../../node_modules/@popperjs/core/lib/modifiers/eventListeners.js","../../../../../../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js","../../../../../../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js","../../../../../../node_modules/@popperjs/core/lib/utils/rectToClientRect.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js","../../../../../../node_modules/@popperjs/core/lib/utils/computeOffsets.js","../../../../../../node_modules/@popperjs/core/lib/utils/detectOverflow.js","../../../../../../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js","../../../../../../node_modules/@popperjs/core/lib/modifiers/flip.js","../../../../../../node_modules/@popperjs/core/lib/modifiers/hide.js","../../../../../../node_modules/@popperjs/core/lib/modifiers/offset.js","../../../../../../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js","../../../../../../node_modules/@popperjs/core/lib/utils/getAltAxis.js","../../../../../../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js","../../../../../../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js","../../../../../../node_modules/@popperjs/core/lib/utils/orderModifiers.js","../../../../../../node_modules/@popperjs/core/lib/utils/debounce.js","../../../../../../node_modules/@popperjs/core/lib/utils/mergeByName.js","../../../../../../node_modules/@popperjs/core/lib/createPopper.js","../../../../../../node_modules/@popperjs/core/lib/popper.js","../../../../../../node_modules/tippy.js/dist/tippy.esm.js","../../../../../../node_modules/@tiptap/vue-3/dist/index.js","../../src/js/components/input/iframe/IframeView.vue","../../src/js/components/input/iframe/Iframe.js","../../../../../../node_modules/@extractus/oembed-extractor/src/utils/linker.js","../../../../../../node_modules/@extractus/oembed-extractor/src/deno/cross-fetch.js","../../../../../../node_modules/@extractus/oembed-extractor/src/utils/retrieve.js","../../../../../../node_modules/@extractus/oembed-extractor/src/utils/fetchEmbed.js","../../../../../../node_modules/@extractus/oembed-extractor/src/utils/providers.latest.js","../../../../../../node_modules/@extractus/oembed-extractor/src/utils/provider.js","../../../../../../node_modules/@extractus/oembed-extractor/src/main.js","../../src/js/utils/forms.js","../../src/js/components/input/media-embed/MediaEmbedView.vue","../../src/js/components/input/media-embed/MediaEmbed.js","../../src/js/config/Extensions.js","../../src/js/config/Commands.js","../../src/js/VizyConfig.js","../../../../../../node_modules/@tiptap/extension-text-style/dist/index.js","../../../../../../node_modules/@ivanv/vue-collapse-transition/src/CollapseTransition.vue","../../src/js/utils/bool.js","../../src/js/components/settings/LightswitchField.vue","../../src/js/components/input/VizyBlockFields.vue","../../src/js/utils/htmlize.js","../../src/js/components/input/VizyBlock.vue","../../src/js/components/input/VizyBlock.js","../../../../../../node_modules/@tiptap/suggestion/dist/index.js","../../src/js/components/input/commands/Commands.js","../../src/js/utils/string.js","../../../../../../node_modules/@fortawesome/fontawesome-svg-core/index.mjs","../../../../../../node_modules/@fortawesome/vue-fontawesome/index.es.js","../../../../../../node_modules/@fortawesome/free-solid-svg-icons/index.mjs","../../src/js/components/input/SvgIcon.vue","../../src/js/components/input/commands/CommandsList.vue","../../src/js/components/input/commands/Suggestion.js","../../src/js/components/input/GlobalAttributes.js","../../src/js/components/input/MenuBarItem.vue","../../src/js/utils/tiptap/marks.js","../../src/js/components/input/MenuBarModal.vue","../../src/js/components/input/link/LinkMenuModal.vue","../../src/js/components/input/link/LinkMenuBubble.vue","../../src/js/components/input/link/LinkMenuBarItem.vue","../../src/js/components/input/image/ImageMenuModal.vue","../../src/js/utils/tiptap/nodes.js","../../src/js/utils/tippy/followCursor.js","../../src/js/components/input/image/ImageMenuBubble.vue","../../src/js/components/input/image/ImageMenuBarItem.vue","../../src/js/components/input/iframe/IframeMenuModal.vue","../../src/js/components/input/iframe/IframeMenuBubble.vue","../../src/js/components/input/iframe/IframeMenuBarItem.vue","../../src/js/components/input/media-embed/MediaEmbedMenuModal.vue","../../src/js/components/input/media-embed/MediaEmbedMenuBubble.vue","../../src/js/components/input/media-embed/MediaEmbedMenuBarItem.vue","../../src/js/components/input/MenuBar.vue","../../src/js/components/input/FloatingMenu.js","../../src/js/components/input/FloatingMenu.vue","../../src/js/components/input/BlockPicker.vue","../../../../../../node_modules/codemirror/lib/codemirror.js","../../../../../../node_modules/codemirror/addon/merge/merge.js","../../../../../../node_modules/diff-match-patch/index.js","../../../../../../node_modules/codemirror/addon/mode/simple.js","../../../../../../node_modules/codemirror-editor-vue3/dist/codemirror-editor-vue3.js","../../../../../../node_modules/js-beautify/js/src/core/output.js","../../../../../../node_modules/js-beautify/js/src/core/token.js","../../../../../../node_modules/js-beautify/js/src/javascript/acorn.js","../../../../../../node_modules/js-beautify/js/src/core/options.js","../../../../../../node_modules/js-beautify/js/src/javascript/options.js","../../../../../../node_modules/js-beautify/js/src/core/inputscanner.js","../../../../../../node_modules/js-beautify/js/src/core/tokenstream.js","../../../../../../node_modules/js-beautify/js/src/core/pattern.js","../../../../../../node_modules/js-beautify/js/src/core/whitespacepattern.js","../../../../../../node_modules/js-beautify/js/src/core/tokenizer.js","../../../../../../node_modules/js-beautify/js/src/core/directives.js","../../../../../../node_modules/js-beautify/js/src/core/templatablepattern.js","../../../../../../node_modules/js-beautify/js/src/javascript/tokenizer.js","../../../../../../node_modules/js-beautify/js/src/javascript/beautifier.js","../../../../../../node_modules/js-beautify/js/src/javascript/index.js","../../../../../../node_modules/js-beautify/js/src/css/options.js","../../../../../../node_modules/js-beautify/js/src/css/beautifier.js","../../../../../../node_modules/js-beautify/js/src/css/index.js","../../../../../../node_modules/js-beautify/js/src/html/options.js","../../../../../../node_modules/js-beautify/js/src/html/tokenizer.js","../../../../../../node_modules/js-beautify/js/src/html/beautifier.js","../../../../../../node_modules/js-beautify/js/src/html/index.js","../../../../../../node_modules/js-beautify/js/src/index.js","../../../../../../node_modules/js-beautify/js/index.js","../../../../../../node_modules/codemirror/addon/mode/overlay.js","../../../../../../node_modules/codemirror/mode/xml/xml.js","../../../../../../node_modules/codemirror/mode/javascript/javascript.js","../../../../../../node_modules/codemirror/mode/coffeescript/coffeescript.js","../../../../../../node_modules/codemirror/mode/css/css.js","../../../../../../node_modules/codemirror/mode/sass/sass.js","../../../../../../node_modules/codemirror/mode/stylus/stylus.js","../../../../../../node_modules/codemirror/mode/htmlmixed/htmlmixed.js","../../../../../../node_modules/codemirror/mode/pug/pug.js","../../../../../../node_modules/codemirror/addon/mode/multiplex.js","../../../../../../node_modules/codemirror/mode/handlebars/handlebars.js","../../../../../../node_modules/codemirror/mode/vue/vue.js","../../src/js/components/input/CodeEditor.vue","../../src/js/components/VizyInput.vue","../../src/js/vendor/vue-drag-drop/transferDataStore.js","../../src/js/vendor/vue-drag-drop/constants.js","../../src/js/vendor/vue-drag-drop/Drag.vue","../../src/js/vendor/vue-drag-drop/Drop.vue","../../src/js/components/settings/VizyIconPicker.vue","../../src/js/components/settings/FieldLayoutDesigner.vue","../../src/js/vendor/vue-autosuggest/parts/DefaultSection.js","../../src/js/vendor/vue-autosuggest/utils.js","../../src/js/vendor/vue-autosuggest/Autosuggest.vue","../../src/js/components/settings/AutoSuggest.vue","../../src/js/components/settings/HandleInput.vue","../../src/js/utils/browser.js","../../src/js/components/VizySettings.vue","../../src/js/vizy.js"],"sourcesContent":["/**\n* @vue/shared v3.4.15\n* (c) 2018-present Yuxi (Evan) You and Vue contributors\n* @license MIT\n**/\nfunction makeMap(str, expectsLowerCase) {\n const set = new Set(str.split(\",\"));\n return expectsLowerCase ? (val) => set.has(val.toLowerCase()) : (val) => set.has(val);\n}\n\nconst EMPTY_OBJ = !!(process.env.NODE_ENV !== \"production\") ? Object.freeze({}) : {};\nconst EMPTY_ARR = !!(process.env.NODE_ENV !== \"production\") ? Object.freeze([]) : [];\nconst NOOP = () => {\n};\nconst NO = () => false;\nconst isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter\n(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);\nconst isModelListener = (key) => key.startsWith(\"onUpdate:\");\nconst extend = Object.assign;\nconst remove = (arr, el) => {\n const i = arr.indexOf(el);\n if (i > -1) {\n arr.splice(i, 1);\n }\n};\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\nconst hasOwn = (val, key) => hasOwnProperty.call(val, key);\nconst isArray = Array.isArray;\nconst isMap = (val) => toTypeString(val) === \"[object Map]\";\nconst isSet = (val) => toTypeString(val) === \"[object Set]\";\nconst isDate = (val) => toTypeString(val) === \"[object Date]\";\nconst isRegExp = (val) => toTypeString(val) === \"[object RegExp]\";\nconst isFunction = (val) => typeof val === \"function\";\nconst isString = (val) => typeof val === \"string\";\nconst isSymbol = (val) => typeof val === \"symbol\";\nconst isObject = (val) => val !== null && typeof val === \"object\";\nconst isPromise = (val) => {\n return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);\n};\nconst objectToString = Object.prototype.toString;\nconst toTypeString = (value) => objectToString.call(value);\nconst toRawType = (value) => {\n return toTypeString(value).slice(8, -1);\n};\nconst isPlainObject = (val) => toTypeString(val) === \"[object Object]\";\nconst isIntegerKey = (key) => isString(key) && key !== \"NaN\" && key[0] !== \"-\" && \"\" + parseInt(key, 10) === key;\nconst isReservedProp = /* @__PURE__ */ makeMap(\n // the leading comma is intentional so empty string \"\" is also included\n \",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted\"\n);\nconst isBuiltInDirective = /* @__PURE__ */ makeMap(\n \"bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo\"\n);\nconst cacheStringFunction = (fn) => {\n const cache = /* @__PURE__ */ Object.create(null);\n return (str) => {\n const hit = cache[str];\n return hit || (cache[str] = fn(str));\n };\n};\nconst camelizeRE = /-(\\w)/g;\nconst camelize = cacheStringFunction((str) => {\n return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : \"\");\n});\nconst hyphenateRE = /\\B([A-Z])/g;\nconst hyphenate = cacheStringFunction(\n (str) => str.replace(hyphenateRE, \"-$1\").toLowerCase()\n);\nconst capitalize = cacheStringFunction((str) => {\n return str.charAt(0).toUpperCase() + str.slice(1);\n});\nconst toHandlerKey = cacheStringFunction((str) => {\n const s = str ? `on${capitalize(str)}` : ``;\n return s;\n});\nconst hasChanged = (value, oldValue) => !Object.is(value, oldValue);\nconst invokeArrayFns = (fns, arg) => {\n for (let i = 0; i < fns.length; i++) {\n fns[i](arg);\n }\n};\nconst def = (obj, key, value) => {\n Object.defineProperty(obj, key, {\n configurable: true,\n enumerable: false,\n value\n });\n};\nconst looseToNumber = (val) => {\n const n = parseFloat(val);\n return isNaN(n) ? val : n;\n};\nconst toNumber = (val) => {\n const n = isString(val) ? Number(val) : NaN;\n return isNaN(n) ? val : n;\n};\nlet _globalThis;\nconst getGlobalThis = () => {\n return _globalThis || (_globalThis = typeof globalThis !== \"undefined\" ? globalThis : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : {});\n};\nconst identRE = /^[_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*$/;\nfunction genPropsAccessExp(name) {\n return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`;\n}\n\nconst PatchFlags = {\n \"TEXT\": 1,\n \"1\": \"TEXT\",\n \"CLASS\": 2,\n \"2\": \"CLASS\",\n \"STYLE\": 4,\n \"4\": \"STYLE\",\n \"PROPS\": 8,\n \"8\": \"PROPS\",\n \"FULL_PROPS\": 16,\n \"16\": \"FULL_PROPS\",\n \"NEED_HYDRATION\": 32,\n \"32\": \"NEED_HYDRATION\",\n \"STABLE_FRAGMENT\": 64,\n \"64\": \"STABLE_FRAGMENT\",\n \"KEYED_FRAGMENT\": 128,\n \"128\": \"KEYED_FRAGMENT\",\n \"UNKEYED_FRAGMENT\": 256,\n \"256\": \"UNKEYED_FRAGMENT\",\n \"NEED_PATCH\": 512,\n \"512\": \"NEED_PATCH\",\n \"DYNAMIC_SLOTS\": 1024,\n \"1024\": \"DYNAMIC_SLOTS\",\n \"DEV_ROOT_FRAGMENT\": 2048,\n \"2048\": \"DEV_ROOT_FRAGMENT\",\n \"HOISTED\": -1,\n \"-1\": \"HOISTED\",\n \"BAIL\": -2,\n \"-2\": \"BAIL\"\n};\nconst PatchFlagNames = {\n [1]: `TEXT`,\n [2]: `CLASS`,\n [4]: `STYLE`,\n [8]: `PROPS`,\n [16]: `FULL_PROPS`,\n [32]: `NEED_HYDRATION`,\n [64]: `STABLE_FRAGMENT`,\n [128]: `KEYED_FRAGMENT`,\n [256]: `UNKEYED_FRAGMENT`,\n [512]: `NEED_PATCH`,\n [1024]: `DYNAMIC_SLOTS`,\n [2048]: `DEV_ROOT_FRAGMENT`,\n [-1]: `HOISTED`,\n [-2]: `BAIL`\n};\n\nconst ShapeFlags = {\n \"ELEMENT\": 1,\n \"1\": \"ELEMENT\",\n \"FUNCTIONAL_COMPONENT\": 2,\n \"2\": \"FUNCTIONAL_COMPONENT\",\n \"STATEFUL_COMPONENT\": 4,\n \"4\": \"STATEFUL_COMPONENT\",\n \"TEXT_CHILDREN\": 8,\n \"8\": \"TEXT_CHILDREN\",\n \"ARRAY_CHILDREN\": 16,\n \"16\": \"ARRAY_CHILDREN\",\n \"SLOTS_CHILDREN\": 32,\n \"32\": \"SLOTS_CHILDREN\",\n \"TELEPORT\": 64,\n \"64\": \"TELEPORT\",\n \"SUSPENSE\": 128,\n \"128\": \"SUSPENSE\",\n \"COMPONENT_SHOULD_KEEP_ALIVE\": 256,\n \"256\": \"COMPONENT_SHOULD_KEEP_ALIVE\",\n \"COMPONENT_KEPT_ALIVE\": 512,\n \"512\": \"COMPONENT_KEPT_ALIVE\",\n \"COMPONENT\": 6,\n \"6\": \"COMPONENT\"\n};\n\nconst SlotFlags = {\n \"STABLE\": 1,\n \"1\": \"STABLE\",\n \"DYNAMIC\": 2,\n \"2\": \"DYNAMIC\",\n \"FORWARDED\": 3,\n \"3\": \"FORWARDED\"\n};\nconst slotFlagsText = {\n [1]: \"STABLE\",\n [2]: \"DYNAMIC\",\n [3]: \"FORWARDED\"\n};\n\nconst GLOBALS_ALLOWED = \"Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error\";\nconst isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);\nconst isGloballyWhitelisted = isGloballyAllowed;\n\nconst range = 2;\nfunction generateCodeFrame(source, start = 0, end = source.length) {\n let lines = source.split(/(\\r?\\n)/);\n const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);\n lines = lines.filter((_, idx) => idx % 2 === 0);\n let count = 0;\n const res = [];\n for (let i = 0; i < lines.length; i++) {\n count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0);\n if (count >= start) {\n for (let j = i - range; j <= i + range || end > count; j++) {\n if (j < 0 || j >= lines.length)\n continue;\n const line = j + 1;\n res.push(\n `${line}${\" \".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`\n );\n const lineLength = lines[j].length;\n const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0;\n if (j === i) {\n const pad = start - (count - (lineLength + newLineSeqLength));\n const length = Math.max(\n 1,\n end > count ? lineLength - pad : end - start\n );\n res.push(` | ` + \" \".repeat(pad) + \"^\".repeat(length));\n } else if (j > i) {\n if (end > count) {\n const length = Math.max(Math.min(end - count, lineLength), 1);\n res.push(` | ` + \"^\".repeat(length));\n }\n count += lineLength + newLineSeqLength;\n }\n }\n break;\n }\n }\n return res.join(\"\\n\");\n}\n\nfunction normalizeStyle(value) {\n if (isArray(value)) {\n const res = {};\n for (let i = 0; i < value.length; i++) {\n const item = value[i];\n const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);\n if (normalized) {\n for (const key in normalized) {\n res[key] = normalized[key];\n }\n }\n }\n return res;\n } else if (isString(value) || isObject(value)) {\n return value;\n }\n}\nconst listDelimiterRE = /;(?![^(]*\\))/g;\nconst propertyDelimiterRE = /:([^]+)/;\nconst styleCommentRE = /\\/\\*[^]*?\\*\\//g;\nfunction parseStringStyle(cssText) {\n const ret = {};\n cssText.replace(styleCommentRE, \"\").split(listDelimiterRE).forEach((item) => {\n if (item) {\n const tmp = item.split(propertyDelimiterRE);\n tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());\n }\n });\n return ret;\n}\nfunction stringifyStyle(styles) {\n let ret = \"\";\n if (!styles || isString(styles)) {\n return ret;\n }\n for (const key in styles) {\n const value = styles[key];\n const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);\n if (isString(value) || typeof value === \"number\") {\n ret += `${normalizedKey}:${value};`;\n }\n }\n return ret;\n}\nfunction normalizeClass(value) {\n let res = \"\";\n if (isString(value)) {\n res = value;\n } else if (isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n const normalized = normalizeClass(value[i]);\n if (normalized) {\n res += normalized + \" \";\n }\n }\n } else if (isObject(value)) {\n for (const name in value) {\n if (value[name]) {\n res += name + \" \";\n }\n }\n }\n return res.trim();\n}\nfunction normalizeProps(props) {\n if (!props)\n return null;\n let { class: klass, style } = props;\n if (klass && !isString(klass)) {\n props.class = normalizeClass(klass);\n }\n if (style) {\n props.style = normalizeStyle(style);\n }\n return props;\n}\n\nconst HTML_TAGS = \"html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot\";\nconst SVG_TAGS = \"svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view\";\nconst MATH_TAGS = \"annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics\";\nconst VOID_TAGS = \"area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr\";\nconst isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);\nconst isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);\nconst isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);\nconst isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);\n\nconst specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;\nconst isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);\nconst isBooleanAttr = /* @__PURE__ */ makeMap(\n specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`\n);\nfunction includeBooleanAttr(value) {\n return !!value || value === \"\";\n}\nconst unsafeAttrCharRE = /[>/=\"'\\u0009\\u000a\\u000c\\u0020]/;\nconst attrValidationCache = {};\nfunction isSSRSafeAttrName(name) {\n if (attrValidationCache.hasOwnProperty(name)) {\n return attrValidationCache[name];\n }\n const isUnsafe = unsafeAttrCharRE.test(name);\n if (isUnsafe) {\n console.error(`unsafe attribute name: ${name}`);\n }\n return attrValidationCache[name] = !isUnsafe;\n}\nconst propsToAttrMap = {\n acceptCharset: \"accept-charset\",\n className: \"class\",\n htmlFor: \"for\",\n httpEquiv: \"http-equiv\"\n};\nconst isKnownHtmlAttr = /* @__PURE__ */ makeMap(\n `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`\n);\nconst isKnownSvgAttr = /* @__PURE__ */ makeMap(\n `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`\n);\nfunction isRenderableAttrValue(value) {\n if (value == null) {\n return false;\n }\n const type = typeof value;\n return type === \"string\" || type === \"number\" || type === \"boolean\";\n}\n\nconst escapeRE = /[\"'&<>]/;\nfunction escapeHtml(string) {\n const str = \"\" + string;\n const match = escapeRE.exec(str);\n if (!match) {\n return str;\n }\n let html = \"\";\n let escaped;\n let index;\n let lastIndex = 0;\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34:\n escaped = \""\";\n break;\n case 38:\n escaped = \"&\";\n break;\n case 39:\n escaped = \"'\";\n break;\n case 60:\n escaped = \"<\";\n break;\n case 62:\n escaped = \">\";\n break;\n default:\n continue;\n }\n if (lastIndex !== index) {\n html += str.slice(lastIndex, index);\n }\n lastIndex = index + 1;\n html += escaped;\n }\n return lastIndex !== index ? html + str.slice(lastIndex, index) : html;\n}\nconst commentStripRE = /^-?>||--!>| looseEqual(item, val));\n}\n\nconst toDisplayString = (val) => {\n return isString(val) ? val : val == null ? \"\" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);\n};\nconst replacer = (_key, val) => {\n if (val && val.__v_isRef) {\n return replacer(_key, val.value);\n } else if (isMap(val)) {\n return {\n [`Map(${val.size})`]: [...val.entries()].reduce(\n (entries, [key, val2], i) => {\n entries[stringifySymbol(key, i) + \" =>\"] = val2;\n return entries;\n },\n {}\n )\n };\n } else if (isSet(val)) {\n return {\n [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))\n };\n } else if (isSymbol(val)) {\n return stringifySymbol(val);\n } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {\n return String(val);\n }\n return val;\n};\nconst stringifySymbol = (v, i = \"\") => {\n var _a;\n return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;\n};\n\nexport { EMPTY_ARR, EMPTY_OBJ, NO, NOOP, PatchFlagNames, PatchFlags, ShapeFlags, SlotFlags, camelize, capitalize, def, escapeHtml, escapeHtmlComment, extend, genPropsAccessExp, generateCodeFrame, getGlobalThis, hasChanged, hasOwn, hyphenate, includeBooleanAttr, invokeArrayFns, isArray, isBooleanAttr, isBuiltInDirective, isDate, isFunction, isGloballyAllowed, isGloballyWhitelisted, isHTMLTag, isIntegerKey, isKnownHtmlAttr, isKnownSvgAttr, isMap, isMathMLTag, isModelListener, isObject, isOn, isPlainObject, isPromise, isRegExp, isRenderableAttrValue, isReservedProp, isSSRSafeAttrName, isSVGTag, isSet, isSpecialBooleanAttr, isString, isSymbol, isVoidTag, looseEqual, looseIndexOf, looseToNumber, makeMap, normalizeClass, normalizeProps, normalizeStyle, objectToString, parseStringStyle, propsToAttrMap, remove, slotFlagsText, stringifyStyle, toDisplayString, toHandlerKey, toNumber, toRawType, toTypeString };\n","/**\n* @vue/reactivity v3.4.15\n* (c) 2018-present Yuxi (Evan) You and Vue contributors\n* @license MIT\n**/\nimport { NOOP, extend, isArray, isSymbol, isMap, isIntegerKey, hasOwn, hasChanged, isObject, makeMap, capitalize, toRawType, def, isFunction } from '@vue/shared';\n\nfunction warn(msg, ...args) {\n console.warn(`[Vue warn] ${msg}`, ...args);\n}\n\nlet activeEffectScope;\nclass EffectScope {\n constructor(detached = false) {\n this.detached = detached;\n /**\n * @internal\n */\n this._active = true;\n /**\n * @internal\n */\n this.effects = [];\n /**\n * @internal\n */\n this.cleanups = [];\n this.parent = activeEffectScope;\n if (!detached && activeEffectScope) {\n this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(\n this\n ) - 1;\n }\n }\n get active() {\n return this._active;\n }\n run(fn) {\n if (this._active) {\n const currentEffectScope = activeEffectScope;\n try {\n activeEffectScope = this;\n return fn();\n } finally {\n activeEffectScope = currentEffectScope;\n }\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn(`cannot run an inactive effect scope.`);\n }\n }\n /**\n * This should only be called on non-detached scopes\n * @internal\n */\n on() {\n activeEffectScope = this;\n }\n /**\n * This should only be called on non-detached scopes\n * @internal\n */\n off() {\n activeEffectScope = this.parent;\n }\n stop(fromParent) {\n if (this._active) {\n let i, l;\n for (i = 0, l = this.effects.length; i < l; i++) {\n this.effects[i].stop();\n }\n for (i = 0, l = this.cleanups.length; i < l; i++) {\n this.cleanups[i]();\n }\n if (this.scopes) {\n for (i = 0, l = this.scopes.length; i < l; i++) {\n this.scopes[i].stop(true);\n }\n }\n if (!this.detached && this.parent && !fromParent) {\n const last = this.parent.scopes.pop();\n if (last && last !== this) {\n this.parent.scopes[this.index] = last;\n last.index = this.index;\n }\n }\n this.parent = void 0;\n this._active = false;\n }\n }\n}\nfunction effectScope(detached) {\n return new EffectScope(detached);\n}\nfunction recordEffectScope(effect, scope = activeEffectScope) {\n if (scope && scope.active) {\n scope.effects.push(effect);\n }\n}\nfunction getCurrentScope() {\n return activeEffectScope;\n}\nfunction onScopeDispose(fn) {\n if (activeEffectScope) {\n activeEffectScope.cleanups.push(fn);\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn(\n `onScopeDispose() is called when there is no active effect scope to be associated with.`\n );\n }\n}\n\nlet activeEffect;\nclass ReactiveEffect {\n constructor(fn, trigger, scheduler, scope) {\n this.fn = fn;\n this.trigger = trigger;\n this.scheduler = scheduler;\n this.active = true;\n this.deps = [];\n /**\n * @internal\n */\n this._dirtyLevel = 2;\n /**\n * @internal\n */\n this._trackId = 0;\n /**\n * @internal\n */\n this._runnings = 0;\n /**\n * @internal\n */\n this._shouldSchedule = false;\n /**\n * @internal\n */\n this._depsLength = 0;\n recordEffectScope(this, scope);\n }\n get dirty() {\n if (this._dirtyLevel === 1) {\n pauseTracking();\n for (let i = 0; i < this._depsLength; i++) {\n const dep = this.deps[i];\n if (dep.computed) {\n triggerComputed(dep.computed);\n if (this._dirtyLevel >= 2) {\n break;\n }\n }\n }\n if (this._dirtyLevel < 2) {\n this._dirtyLevel = 0;\n }\n resetTracking();\n }\n return this._dirtyLevel >= 2;\n }\n set dirty(v) {\n this._dirtyLevel = v ? 2 : 0;\n }\n run() {\n this._dirtyLevel = 0;\n if (!this.active) {\n return this.fn();\n }\n let lastShouldTrack = shouldTrack;\n let lastEffect = activeEffect;\n try {\n shouldTrack = true;\n activeEffect = this;\n this._runnings++;\n preCleanupEffect(this);\n return this.fn();\n } finally {\n postCleanupEffect(this);\n this._runnings--;\n activeEffect = lastEffect;\n shouldTrack = lastShouldTrack;\n }\n }\n stop() {\n var _a;\n if (this.active) {\n preCleanupEffect(this);\n postCleanupEffect(this);\n (_a = this.onStop) == null ? void 0 : _a.call(this);\n this.active = false;\n }\n }\n}\nfunction triggerComputed(computed) {\n return computed.value;\n}\nfunction preCleanupEffect(effect2) {\n effect2._trackId++;\n effect2._depsLength = 0;\n}\nfunction postCleanupEffect(effect2) {\n if (effect2.deps && effect2.deps.length > effect2._depsLength) {\n for (let i = effect2._depsLength; i < effect2.deps.length; i++) {\n cleanupDepEffect(effect2.deps[i], effect2);\n }\n effect2.deps.length = effect2._depsLength;\n }\n}\nfunction cleanupDepEffect(dep, effect2) {\n const trackId = dep.get(effect2);\n if (trackId !== void 0 && effect2._trackId !== trackId) {\n dep.delete(effect2);\n if (dep.size === 0) {\n dep.cleanup();\n }\n }\n}\nfunction effect(fn, options) {\n if (fn.effect instanceof ReactiveEffect) {\n fn = fn.effect.fn;\n }\n const _effect = new ReactiveEffect(fn, NOOP, () => {\n if (_effect.dirty) {\n _effect.run();\n }\n });\n if (options) {\n extend(_effect, options);\n if (options.scope)\n recordEffectScope(_effect, options.scope);\n }\n if (!options || !options.lazy) {\n _effect.run();\n }\n const runner = _effect.run.bind(_effect);\n runner.effect = _effect;\n return runner;\n}\nfunction stop(runner) {\n runner.effect.stop();\n}\nlet shouldTrack = true;\nlet pauseScheduleStack = 0;\nconst trackStack = [];\nfunction pauseTracking() {\n trackStack.push(shouldTrack);\n shouldTrack = false;\n}\nfunction enableTracking() {\n trackStack.push(shouldTrack);\n shouldTrack = true;\n}\nfunction resetTracking() {\n const last = trackStack.pop();\n shouldTrack = last === void 0 ? true : last;\n}\nfunction pauseScheduling() {\n pauseScheduleStack++;\n}\nfunction resetScheduling() {\n pauseScheduleStack--;\n while (!pauseScheduleStack && queueEffectSchedulers.length) {\n queueEffectSchedulers.shift()();\n }\n}\nfunction trackEffect(effect2, dep, debuggerEventExtraInfo) {\n var _a;\n if (dep.get(effect2) !== effect2._trackId) {\n dep.set(effect2, effect2._trackId);\n const oldDep = effect2.deps[effect2._depsLength];\n if (oldDep !== dep) {\n if (oldDep) {\n cleanupDepEffect(oldDep, effect2);\n }\n effect2.deps[effect2._depsLength++] = dep;\n } else {\n effect2._depsLength++;\n }\n if (!!(process.env.NODE_ENV !== \"production\")) {\n (_a = effect2.onTrack) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));\n }\n }\n}\nconst queueEffectSchedulers = [];\nfunction triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {\n var _a;\n pauseScheduling();\n for (const effect2 of dep.keys()) {\n if (effect2._dirtyLevel < dirtyLevel && dep.get(effect2) === effect2._trackId) {\n const lastDirtyLevel = effect2._dirtyLevel;\n effect2._dirtyLevel = dirtyLevel;\n if (lastDirtyLevel === 0) {\n effect2._shouldSchedule = true;\n if (!!(process.env.NODE_ENV !== \"production\")) {\n (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));\n }\n effect2.trigger();\n }\n }\n }\n scheduleEffects(dep);\n resetScheduling();\n}\nfunction scheduleEffects(dep) {\n for (const effect2 of dep.keys()) {\n if (effect2.scheduler && effect2._shouldSchedule && (!effect2._runnings || effect2.allowRecurse) && dep.get(effect2) === effect2._trackId) {\n effect2._shouldSchedule = false;\n queueEffectSchedulers.push(effect2.scheduler);\n }\n }\n}\n\nconst createDep = (cleanup, computed) => {\n const dep = /* @__PURE__ */ new Map();\n dep.cleanup = cleanup;\n dep.computed = computed;\n return dep;\n};\n\nconst targetMap = /* @__PURE__ */ new WeakMap();\nconst ITERATE_KEY = Symbol(!!(process.env.NODE_ENV !== \"production\") ? \"iterate\" : \"\");\nconst MAP_KEY_ITERATE_KEY = Symbol(!!(process.env.NODE_ENV !== \"production\") ? \"Map key iterate\" : \"\");\nfunction track(target, type, key) {\n if (shouldTrack && activeEffect) {\n let depsMap = targetMap.get(target);\n if (!depsMap) {\n targetMap.set(target, depsMap = /* @__PURE__ */ new Map());\n }\n let dep = depsMap.get(key);\n if (!dep) {\n depsMap.set(key, dep = createDep(() => depsMap.delete(key)));\n }\n trackEffect(\n activeEffect,\n dep,\n !!(process.env.NODE_ENV !== \"production\") ? {\n target,\n type,\n key\n } : void 0\n );\n }\n}\nfunction trigger(target, type, key, newValue, oldValue, oldTarget) {\n const depsMap = targetMap.get(target);\n if (!depsMap) {\n return;\n }\n let deps = [];\n if (type === \"clear\") {\n deps = [...depsMap.values()];\n } else if (key === \"length\" && isArray(target)) {\n const newLength = Number(newValue);\n depsMap.forEach((dep, key2) => {\n if (key2 === \"length\" || !isSymbol(key2) && key2 >= newLength) {\n deps.push(dep);\n }\n });\n } else {\n if (key !== void 0) {\n deps.push(depsMap.get(key));\n }\n switch (type) {\n case \"add\":\n if (!isArray(target)) {\n deps.push(depsMap.get(ITERATE_KEY));\n if (isMap(target)) {\n deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));\n }\n } else if (isIntegerKey(key)) {\n deps.push(depsMap.get(\"length\"));\n }\n break;\n case \"delete\":\n if (!isArray(target)) {\n deps.push(depsMap.get(ITERATE_KEY));\n if (isMap(target)) {\n deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));\n }\n }\n break;\n case \"set\":\n if (isMap(target)) {\n deps.push(depsMap.get(ITERATE_KEY));\n }\n break;\n }\n }\n pauseScheduling();\n for (const dep of deps) {\n if (dep) {\n triggerEffects(\n dep,\n 2,\n !!(process.env.NODE_ENV !== \"production\") ? {\n target,\n type,\n key,\n newValue,\n oldValue,\n oldTarget\n } : void 0\n );\n }\n }\n resetScheduling();\n}\nfunction getDepFromReactive(object, key) {\n var _a;\n return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);\n}\n\nconst isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);\nconst builtInSymbols = new Set(\n /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== \"arguments\" && key !== \"caller\").map((key) => Symbol[key]).filter(isSymbol)\n);\nconst arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();\nfunction createArrayInstrumentations() {\n const instrumentations = {};\n [\"includes\", \"indexOf\", \"lastIndexOf\"].forEach((key) => {\n instrumentations[key] = function(...args) {\n const arr = toRaw(this);\n for (let i = 0, l = this.length; i < l; i++) {\n track(arr, \"get\", i + \"\");\n }\n const res = arr[key](...args);\n if (res === -1 || res === false) {\n return arr[key](...args.map(toRaw));\n } else {\n return res;\n }\n };\n });\n [\"push\", \"pop\", \"shift\", \"unshift\", \"splice\"].forEach((key) => {\n instrumentations[key] = function(...args) {\n pauseTracking();\n pauseScheduling();\n const res = toRaw(this)[key].apply(this, args);\n resetScheduling();\n resetTracking();\n return res;\n };\n });\n return instrumentations;\n}\nfunction hasOwnProperty(key) {\n const obj = toRaw(this);\n track(obj, \"has\", key);\n return obj.hasOwnProperty(key);\n}\nclass BaseReactiveHandler {\n constructor(_isReadonly = false, _shallow = false) {\n this._isReadonly = _isReadonly;\n this._shallow = _shallow;\n }\n get(target, key, receiver) {\n const isReadonly2 = this._isReadonly, shallow = this._shallow;\n if (key === \"__v_isReactive\") {\n return !isReadonly2;\n } else if (key === \"__v_isReadonly\") {\n return isReadonly2;\n } else if (key === \"__v_isShallow\") {\n return shallow;\n } else if (key === \"__v_raw\") {\n if (receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype\n // this means the reciever is a user proxy of the reactive proxy\n Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {\n return target;\n }\n return;\n }\n const targetIsArray = isArray(target);\n if (!isReadonly2) {\n if (targetIsArray && hasOwn(arrayInstrumentations, key)) {\n return Reflect.get(arrayInstrumentations, key, receiver);\n }\n if (key === \"hasOwnProperty\") {\n return hasOwnProperty;\n }\n }\n const res = Reflect.get(target, key, receiver);\n if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {\n return res;\n }\n if (!isReadonly2) {\n track(target, \"get\", key);\n }\n if (shallow) {\n return res;\n }\n if (isRef(res)) {\n return targetIsArray && isIntegerKey(key) ? res : res.value;\n }\n if (isObject(res)) {\n return isReadonly2 ? readonly(res) : reactive(res);\n }\n return res;\n }\n}\nclass MutableReactiveHandler extends BaseReactiveHandler {\n constructor(shallow = false) {\n super(false, shallow);\n }\n set(target, key, value, receiver) {\n let oldValue = target[key];\n if (!this._shallow) {\n const isOldValueReadonly = isReadonly(oldValue);\n if (!isShallow(value) && !isReadonly(value)) {\n oldValue = toRaw(oldValue);\n value = toRaw(value);\n }\n if (!isArray(target) && isRef(oldValue) && !isRef(value)) {\n if (isOldValueReadonly) {\n return false;\n } else {\n oldValue.value = value;\n return true;\n }\n }\n }\n const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);\n const result = Reflect.set(target, key, value, receiver);\n if (target === toRaw(receiver)) {\n if (!hadKey) {\n trigger(target, \"add\", key, value);\n } else if (hasChanged(value, oldValue)) {\n trigger(target, \"set\", key, value, oldValue);\n }\n }\n return result;\n }\n deleteProperty(target, key) {\n const hadKey = hasOwn(target, key);\n const oldValue = target[key];\n const result = Reflect.deleteProperty(target, key);\n if (result && hadKey) {\n trigger(target, \"delete\", key, void 0, oldValue);\n }\n return result;\n }\n has(target, key) {\n const result = Reflect.has(target, key);\n if (!isSymbol(key) || !builtInSymbols.has(key)) {\n track(target, \"has\", key);\n }\n return result;\n }\n ownKeys(target) {\n track(\n target,\n \"iterate\",\n isArray(target) ? \"length\" : ITERATE_KEY\n );\n return Reflect.ownKeys(target);\n }\n}\nclass ReadonlyReactiveHandler extends BaseReactiveHandler {\n constructor(shallow = false) {\n super(true, shallow);\n }\n set(target, key) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n warn(\n `Set operation on key \"${String(key)}\" failed: target is readonly.`,\n target\n );\n }\n return true;\n }\n deleteProperty(target, key) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n warn(\n `Delete operation on key \"${String(key)}\" failed: target is readonly.`,\n target\n );\n }\n return true;\n }\n}\nconst mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();\nconst readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();\nconst shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(\n true\n);\nconst shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);\n\nconst toShallow = (value) => value;\nconst getProto = (v) => Reflect.getPrototypeOf(v);\nfunction get(target, key, isReadonly = false, isShallow = false) {\n target = target[\"__v_raw\"];\n const rawTarget = toRaw(target);\n const rawKey = toRaw(key);\n if (!isReadonly) {\n if (hasChanged(key, rawKey)) {\n track(rawTarget, \"get\", key);\n }\n track(rawTarget, \"get\", rawKey);\n }\n const { has: has2 } = getProto(rawTarget);\n const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;\n if (has2.call(rawTarget, key)) {\n return wrap(target.get(key));\n } else if (has2.call(rawTarget, rawKey)) {\n return wrap(target.get(rawKey));\n } else if (target !== rawTarget) {\n target.get(key);\n }\n}\nfunction has(key, isReadonly = false) {\n const target = this[\"__v_raw\"];\n const rawTarget = toRaw(target);\n const rawKey = toRaw(key);\n if (!isReadonly) {\n if (hasChanged(key, rawKey)) {\n track(rawTarget, \"has\", key);\n }\n track(rawTarget, \"has\", rawKey);\n }\n return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);\n}\nfunction size(target, isReadonly = false) {\n target = target[\"__v_raw\"];\n !isReadonly && track(toRaw(target), \"iterate\", ITERATE_KEY);\n return Reflect.get(target, \"size\", target);\n}\nfunction add(value) {\n value = toRaw(value);\n const target = toRaw(this);\n const proto = getProto(target);\n const hadKey = proto.has.call(target, value);\n if (!hadKey) {\n target.add(value);\n trigger(target, \"add\", value, value);\n }\n return this;\n}\nfunction set(key, value) {\n value = toRaw(value);\n const target = toRaw(this);\n const { has: has2, get: get2 } = getProto(target);\n let hadKey = has2.call(target, key);\n if (!hadKey) {\n key = toRaw(key);\n hadKey = has2.call(target, key);\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n checkIdentityKeys(target, has2, key);\n }\n const oldValue = get2.call(target, key);\n target.set(key, value);\n if (!hadKey) {\n trigger(target, \"add\", key, value);\n } else if (hasChanged(value, oldValue)) {\n trigger(target, \"set\", key, value, oldValue);\n }\n return this;\n}\nfunction deleteEntry(key) {\n const target = toRaw(this);\n const { has: has2, get: get2 } = getProto(target);\n let hadKey = has2.call(target, key);\n if (!hadKey) {\n key = toRaw(key);\n hadKey = has2.call(target, key);\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n checkIdentityKeys(target, has2, key);\n }\n const oldValue = get2 ? get2.call(target, key) : void 0;\n const result = target.delete(key);\n if (hadKey) {\n trigger(target, \"delete\", key, void 0, oldValue);\n }\n return result;\n}\nfunction clear() {\n const target = toRaw(this);\n const hadItems = target.size !== 0;\n const oldTarget = !!(process.env.NODE_ENV !== \"production\") ? isMap(target) ? new Map(target) : new Set(target) : void 0;\n const result = target.clear();\n if (hadItems) {\n trigger(target, \"clear\", void 0, void 0, oldTarget);\n }\n return result;\n}\nfunction createForEach(isReadonly, isShallow) {\n return function forEach(callback, thisArg) {\n const observed = this;\n const target = observed[\"__v_raw\"];\n const rawTarget = toRaw(target);\n const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;\n !isReadonly && track(rawTarget, \"iterate\", ITERATE_KEY);\n return target.forEach((value, key) => {\n return callback.call(thisArg, wrap(value), wrap(key), observed);\n });\n };\n}\nfunction createIterableMethod(method, isReadonly, isShallow) {\n return function(...args) {\n const target = this[\"__v_raw\"];\n const rawTarget = toRaw(target);\n const targetIsMap = isMap(rawTarget);\n const isPair = method === \"entries\" || method === Symbol.iterator && targetIsMap;\n const isKeyOnly = method === \"keys\" && targetIsMap;\n const innerIterator = target[method](...args);\n const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;\n !isReadonly && track(\n rawTarget,\n \"iterate\",\n isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY\n );\n return {\n // iterator protocol\n next() {\n const { value, done } = innerIterator.next();\n return done ? { value, done } : {\n value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),\n done\n };\n },\n // iterable protocol\n [Symbol.iterator]() {\n return this;\n }\n };\n };\n}\nfunction createReadonlyMethod(type) {\n return function(...args) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n const key = args[0] ? `on key \"${args[0]}\" ` : ``;\n console.warn(\n `${capitalize(type)} operation ${key}failed: target is readonly.`,\n toRaw(this)\n );\n }\n return type === \"delete\" ? false : type === \"clear\" ? void 0 : this;\n };\n}\nfunction createInstrumentations() {\n const mutableInstrumentations2 = {\n get(key) {\n return get(this, key);\n },\n get size() {\n return size(this);\n },\n has,\n add,\n set,\n delete: deleteEntry,\n clear,\n forEach: createForEach(false, false)\n };\n const shallowInstrumentations2 = {\n get(key) {\n return get(this, key, false, true);\n },\n get size() {\n return size(this);\n },\n has,\n add,\n set,\n delete: deleteEntry,\n clear,\n forEach: createForEach(false, true)\n };\n const readonlyInstrumentations2 = {\n get(key) {\n return get(this, key, true);\n },\n get size() {\n return size(this, true);\n },\n has(key) {\n return has.call(this, key, true);\n },\n add: createReadonlyMethod(\"add\"),\n set: createReadonlyMethod(\"set\"),\n delete: createReadonlyMethod(\"delete\"),\n clear: createReadonlyMethod(\"clear\"),\n forEach: createForEach(true, false)\n };\n const shallowReadonlyInstrumentations2 = {\n get(key) {\n return get(this, key, true, true);\n },\n get size() {\n return size(this, true);\n },\n has(key) {\n return has.call(this, key, true);\n },\n add: createReadonlyMethod(\"add\"),\n set: createReadonlyMethod(\"set\"),\n delete: createReadonlyMethod(\"delete\"),\n clear: createReadonlyMethod(\"clear\"),\n forEach: createForEach(true, true)\n };\n const iteratorMethods = [\"keys\", \"values\", \"entries\", Symbol.iterator];\n iteratorMethods.forEach((method) => {\n mutableInstrumentations2[method] = createIterableMethod(\n method,\n false,\n false\n );\n readonlyInstrumentations2[method] = createIterableMethod(\n method,\n true,\n false\n );\n shallowInstrumentations2[method] = createIterableMethod(\n method,\n false,\n true\n );\n shallowReadonlyInstrumentations2[method] = createIterableMethod(\n method,\n true,\n true\n );\n });\n return [\n mutableInstrumentations2,\n readonlyInstrumentations2,\n shallowInstrumentations2,\n shallowReadonlyInstrumentations2\n ];\n}\nconst [\n mutableInstrumentations,\n readonlyInstrumentations,\n shallowInstrumentations,\n shallowReadonlyInstrumentations\n] = /* @__PURE__ */ createInstrumentations();\nfunction createInstrumentationGetter(isReadonly, shallow) {\n const instrumentations = shallow ? isReadonly ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly ? readonlyInstrumentations : mutableInstrumentations;\n return (target, key, receiver) => {\n if (key === \"__v_isReactive\") {\n return !isReadonly;\n } else if (key === \"__v_isReadonly\") {\n return isReadonly;\n } else if (key === \"__v_raw\") {\n return target;\n }\n return Reflect.get(\n hasOwn(instrumentations, key) && key in target ? instrumentations : target,\n key,\n receiver\n );\n };\n}\nconst mutableCollectionHandlers = {\n get: /* @__PURE__ */ createInstrumentationGetter(false, false)\n};\nconst shallowCollectionHandlers = {\n get: /* @__PURE__ */ createInstrumentationGetter(false, true)\n};\nconst readonlyCollectionHandlers = {\n get: /* @__PURE__ */ createInstrumentationGetter(true, false)\n};\nconst shallowReadonlyCollectionHandlers = {\n get: /* @__PURE__ */ createInstrumentationGetter(true, true)\n};\nfunction checkIdentityKeys(target, has2, key) {\n const rawKey = toRaw(key);\n if (rawKey !== key && has2.call(target, rawKey)) {\n const type = toRawType(target);\n console.warn(\n `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`\n );\n }\n}\n\nconst reactiveMap = /* @__PURE__ */ new WeakMap();\nconst shallowReactiveMap = /* @__PURE__ */ new WeakMap();\nconst readonlyMap = /* @__PURE__ */ new WeakMap();\nconst shallowReadonlyMap = /* @__PURE__ */ new WeakMap();\nfunction targetTypeMap(rawType) {\n switch (rawType) {\n case \"Object\":\n case \"Array\":\n return 1 /* COMMON */;\n case \"Map\":\n case \"Set\":\n case \"WeakMap\":\n case \"WeakSet\":\n return 2 /* COLLECTION */;\n default:\n return 0 /* INVALID */;\n }\n}\nfunction getTargetType(value) {\n return value[\"__v_skip\"] || !Object.isExtensible(value) ? 0 /* INVALID */ : targetTypeMap(toRawType(value));\n}\nfunction reactive(target) {\n if (isReadonly(target)) {\n return target;\n }\n return createReactiveObject(\n target,\n false,\n mutableHandlers,\n mutableCollectionHandlers,\n reactiveMap\n );\n}\nfunction shallowReactive(target) {\n return createReactiveObject(\n target,\n false,\n shallowReactiveHandlers,\n shallowCollectionHandlers,\n shallowReactiveMap\n );\n}\nfunction readonly(target) {\n return createReactiveObject(\n target,\n true,\n readonlyHandlers,\n readonlyCollectionHandlers,\n readonlyMap\n );\n}\nfunction shallowReadonly(target) {\n return createReactiveObject(\n target,\n true,\n shallowReadonlyHandlers,\n shallowReadonlyCollectionHandlers,\n shallowReadonlyMap\n );\n}\nfunction createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {\n if (!isObject(target)) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n console.warn(`value cannot be made reactive: ${String(target)}`);\n }\n return target;\n }\n if (target[\"__v_raw\"] && !(isReadonly2 && target[\"__v_isReactive\"])) {\n return target;\n }\n const existingProxy = proxyMap.get(target);\n if (existingProxy) {\n return existingProxy;\n }\n const targetType = getTargetType(target);\n if (targetType === 0 /* INVALID */) {\n return target;\n }\n const proxy = new Proxy(\n target,\n targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers\n );\n proxyMap.set(target, proxy);\n return proxy;\n}\nfunction isReactive(value) {\n if (isReadonly(value)) {\n return isReactive(value[\"__v_raw\"]);\n }\n return !!(value && value[\"__v_isReactive\"]);\n}\nfunction isReadonly(value) {\n return !!(value && value[\"__v_isReadonly\"]);\n}\nfunction isShallow(value) {\n return !!(value && value[\"__v_isShallow\"]);\n}\nfunction isProxy(value) {\n return isReactive(value) || isReadonly(value);\n}\nfunction toRaw(observed) {\n const raw = observed && observed[\"__v_raw\"];\n return raw ? toRaw(raw) : observed;\n}\nfunction markRaw(value) {\n def(value, \"__v_skip\", true);\n return value;\n}\nconst toReactive = (value) => isObject(value) ? reactive(value) : value;\nconst toReadonly = (value) => isObject(value) ? readonly(value) : value;\n\nclass ComputedRefImpl {\n constructor(getter, _setter, isReadonly, isSSR) {\n this._setter = _setter;\n this.dep = void 0;\n this.__v_isRef = true;\n this[\"__v_isReadonly\"] = false;\n this.effect = new ReactiveEffect(\n () => getter(this._value),\n () => triggerRefValue(this, 1),\n () => this.dep && scheduleEffects(this.dep)\n );\n this.effect.computed = this;\n this.effect.active = this._cacheable = !isSSR;\n this[\"__v_isReadonly\"] = isReadonly;\n }\n get value() {\n const self = toRaw(this);\n if (!self._cacheable || self.effect.dirty) {\n if (hasChanged(self._value, self._value = self.effect.run())) {\n triggerRefValue(self, 2);\n }\n }\n trackRefValue(self);\n if (self.effect._dirtyLevel >= 1) {\n triggerRefValue(self, 1);\n }\n return self._value;\n }\n set value(newValue) {\n this._setter(newValue);\n }\n // #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x\n get _dirty() {\n return this.effect.dirty;\n }\n set _dirty(v) {\n this.effect.dirty = v;\n }\n // #endregion\n}\nfunction computed(getterOrOptions, debugOptions, isSSR = false) {\n let getter;\n let setter;\n const onlyGetter = isFunction(getterOrOptions);\n if (onlyGetter) {\n getter = getterOrOptions;\n setter = !!(process.env.NODE_ENV !== \"production\") ? () => {\n console.warn(\"Write operation failed: computed value is readonly\");\n } : NOOP;\n } else {\n getter = getterOrOptions.get;\n setter = getterOrOptions.set;\n }\n const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);\n if (!!(process.env.NODE_ENV !== \"production\") && debugOptions && !isSSR) {\n cRef.effect.onTrack = debugOptions.onTrack;\n cRef.effect.onTrigger = debugOptions.onTrigger;\n }\n return cRef;\n}\n\nfunction trackRefValue(ref2) {\n if (shouldTrack && activeEffect) {\n ref2 = toRaw(ref2);\n trackEffect(\n activeEffect,\n ref2.dep || (ref2.dep = createDep(\n () => ref2.dep = void 0,\n ref2 instanceof ComputedRefImpl ? ref2 : void 0\n )),\n !!(process.env.NODE_ENV !== \"production\") ? {\n target: ref2,\n type: \"get\",\n key: \"value\"\n } : void 0\n );\n }\n}\nfunction triggerRefValue(ref2, dirtyLevel = 2, newVal) {\n ref2 = toRaw(ref2);\n const dep = ref2.dep;\n if (dep) {\n triggerEffects(\n dep,\n dirtyLevel,\n !!(process.env.NODE_ENV !== \"production\") ? {\n target: ref2,\n type: \"set\",\n key: \"value\",\n newValue: newVal\n } : void 0\n );\n }\n}\nfunction isRef(r) {\n return !!(r && r.__v_isRef === true);\n}\nfunction ref(value) {\n return createRef(value, false);\n}\nfunction shallowRef(value) {\n return createRef(value, true);\n}\nfunction createRef(rawValue, shallow) {\n if (isRef(rawValue)) {\n return rawValue;\n }\n return new RefImpl(rawValue, shallow);\n}\nclass RefImpl {\n constructor(value, __v_isShallow) {\n this.__v_isShallow = __v_isShallow;\n this.dep = void 0;\n this.__v_isRef = true;\n this._rawValue = __v_isShallow ? value : toRaw(value);\n this._value = __v_isShallow ? value : toReactive(value);\n }\n get value() {\n trackRefValue(this);\n return this._value;\n }\n set value(newVal) {\n const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);\n newVal = useDirectValue ? newVal : toRaw(newVal);\n if (hasChanged(newVal, this._rawValue)) {\n this._rawValue = newVal;\n this._value = useDirectValue ? newVal : toReactive(newVal);\n triggerRefValue(this, 2, newVal);\n }\n }\n}\nfunction triggerRef(ref2) {\n triggerRefValue(ref2, 2, !!(process.env.NODE_ENV !== \"production\") ? ref2.value : void 0);\n}\nfunction unref(ref2) {\n return isRef(ref2) ? ref2.value : ref2;\n}\nfunction toValue(source) {\n return isFunction(source) ? source() : unref(source);\n}\nconst shallowUnwrapHandlers = {\n get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),\n set: (target, key, value, receiver) => {\n const oldValue = target[key];\n if (isRef(oldValue) && !isRef(value)) {\n oldValue.value = value;\n return true;\n } else {\n return Reflect.set(target, key, value, receiver);\n }\n }\n};\nfunction proxyRefs(objectWithRefs) {\n return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);\n}\nclass CustomRefImpl {\n constructor(factory) {\n this.dep = void 0;\n this.__v_isRef = true;\n const { get, set } = factory(\n () => trackRefValue(this),\n () => triggerRefValue(this)\n );\n this._get = get;\n this._set = set;\n }\n get value() {\n return this._get();\n }\n set value(newVal) {\n this._set(newVal);\n }\n}\nfunction customRef(factory) {\n return new CustomRefImpl(factory);\n}\nfunction toRefs(object) {\n if (!!(process.env.NODE_ENV !== \"production\") && !isProxy(object)) {\n console.warn(`toRefs() expects a reactive object but received a plain one.`);\n }\n const ret = isArray(object) ? new Array(object.length) : {};\n for (const key in object) {\n ret[key] = propertyToRef(object, key);\n }\n return ret;\n}\nclass ObjectRefImpl {\n constructor(_object, _key, _defaultValue) {\n this._object = _object;\n this._key = _key;\n this._defaultValue = _defaultValue;\n this.__v_isRef = true;\n }\n get value() {\n const val = this._object[this._key];\n return val === void 0 ? this._defaultValue : val;\n }\n set value(newVal) {\n this._object[this._key] = newVal;\n }\n get dep() {\n return getDepFromReactive(toRaw(this._object), this._key);\n }\n}\nclass GetterRefImpl {\n constructor(_getter) {\n this._getter = _getter;\n this.__v_isRef = true;\n this.__v_isReadonly = true;\n }\n get value() {\n return this._getter();\n }\n}\nfunction toRef(source, key, defaultValue) {\n if (isRef(source)) {\n return source;\n } else if (isFunction(source)) {\n return new GetterRefImpl(source);\n } else if (isObject(source) && arguments.length > 1) {\n return propertyToRef(source, key, defaultValue);\n } else {\n return ref(source);\n }\n}\nfunction propertyToRef(source, key, defaultValue) {\n const val = source[key];\n return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);\n}\n\nconst deferredComputed = computed;\n\nconst TrackOpTypes = {\n \"GET\": \"get\",\n \"HAS\": \"has\",\n \"ITERATE\": \"iterate\"\n};\nconst TriggerOpTypes = {\n \"SET\": \"set\",\n \"ADD\": \"add\",\n \"DELETE\": \"delete\",\n \"CLEAR\": \"clear\"\n};\nconst ReactiveFlags = {\n \"SKIP\": \"__v_skip\",\n \"IS_REACTIVE\": \"__v_isReactive\",\n \"IS_READONLY\": \"__v_isReadonly\",\n \"IS_SHALLOW\": \"__v_isShallow\",\n \"RAW\": \"__v_raw\"\n};\n\nexport { EffectScope, ITERATE_KEY, ReactiveEffect, ReactiveFlags, TrackOpTypes, TriggerOpTypes, computed, customRef, deferredComputed, effect, effectScope, enableTracking, getCurrentScope, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, pauseScheduling, pauseTracking, proxyRefs, reactive, readonly, ref, resetScheduling, resetTracking, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, track, trigger, triggerRef, unref };\n","/**\n* @vue/runtime-core v3.4.15\n* (c) 2018-present Yuxi (Evan) You and Vue contributors\n* @license MIT\n**/\nimport { pauseTracking, resetTracking, isRef, toRaw, isShallow as isShallow$1, isReactive, ReactiveEffect, getCurrentScope, ref, shallowReadonly, track, reactive, shallowReactive, trigger, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1, customRef, isReadonly } from '@vue/reactivity';\nexport { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';\nimport { isString, isFunction, isPromise, isArray, NOOP, getGlobalThis, extend, EMPTY_OBJ, toHandlerKey, looseToNumber, hyphenate, camelize, isObject, isOn, hasOwn, isModelListener, capitalize, toNumber, hasChanged, remove, isSet, isMap, isPlainObject, isBuiltInDirective, invokeArrayFns, isRegExp, isGloballyAllowed, NO, def, isReservedProp, EMPTY_ARR, toRawType, makeMap, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue } from '@vue/shared';\nexport { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';\n\nconst stack = [];\nfunction pushWarningContext(vnode) {\n stack.push(vnode);\n}\nfunction popWarningContext() {\n stack.pop();\n}\nfunction warn$1(msg, ...args) {\n pauseTracking();\n const instance = stack.length ? stack[stack.length - 1].component : null;\n const appWarnHandler = instance && instance.appContext.config.warnHandler;\n const trace = getComponentTrace();\n if (appWarnHandler) {\n callWithErrorHandling(\n appWarnHandler,\n instance,\n 11,\n [\n msg + args.join(\"\"),\n instance && instance.proxy,\n trace.map(\n ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`\n ).join(\"\\n\"),\n trace\n ]\n );\n } else {\n const warnArgs = [`[Vue warn]: ${msg}`, ...args];\n if (trace.length && // avoid spamming console during tests\n true) {\n warnArgs.push(`\n`, ...formatTrace(trace));\n }\n console.warn(...warnArgs);\n }\n resetTracking();\n}\nfunction getComponentTrace() {\n let currentVNode = stack[stack.length - 1];\n if (!currentVNode) {\n return [];\n }\n const normalizedStack = [];\n while (currentVNode) {\n const last = normalizedStack[0];\n if (last && last.vnode === currentVNode) {\n last.recurseCount++;\n } else {\n normalizedStack.push({\n vnode: currentVNode,\n recurseCount: 0\n });\n }\n const parentInstance = currentVNode.component && currentVNode.component.parent;\n currentVNode = parentInstance && parentInstance.vnode;\n }\n return normalizedStack;\n}\nfunction formatTrace(trace) {\n const logs = [];\n trace.forEach((entry, i) => {\n logs.push(...i === 0 ? [] : [`\n`], ...formatTraceEntry(entry));\n });\n return logs;\n}\nfunction formatTraceEntry({ vnode, recurseCount }) {\n const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;\n const isRoot = vnode.component ? vnode.component.parent == null : false;\n const open = ` at <${formatComponentName(\n vnode.component,\n vnode.type,\n isRoot\n )}`;\n const close = `>` + postfix;\n return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];\n}\nfunction formatProps(props) {\n const res = [];\n const keys = Object.keys(props);\n keys.slice(0, 3).forEach((key) => {\n res.push(...formatProp(key, props[key]));\n });\n if (keys.length > 3) {\n res.push(` ...`);\n }\n return res;\n}\nfunction formatProp(key, value, raw) {\n if (isString(value)) {\n value = JSON.stringify(value);\n return raw ? value : [`${key}=${value}`];\n } else if (typeof value === \"number\" || typeof value === \"boolean\" || value == null) {\n return raw ? value : [`${key}=${value}`];\n } else if (isRef(value)) {\n value = formatProp(key, toRaw(value.value), true);\n return raw ? value : [`${key}=Ref<`, value, `>`];\n } else if (isFunction(value)) {\n return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];\n } else {\n value = toRaw(value);\n return raw ? value : [`${key}=`, value];\n }\n}\nfunction assertNumber(val, type) {\n if (!!!(process.env.NODE_ENV !== \"production\"))\n return;\n if (val === void 0) {\n return;\n } else if (typeof val !== \"number\") {\n warn$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`);\n } else if (isNaN(val)) {\n warn$1(`${type} is NaN - the duration expression might be incorrect.`);\n }\n}\n\nconst ErrorCodes = {\n \"SETUP_FUNCTION\": 0,\n \"0\": \"SETUP_FUNCTION\",\n \"RENDER_FUNCTION\": 1,\n \"1\": \"RENDER_FUNCTION\",\n \"WATCH_GETTER\": 2,\n \"2\": \"WATCH_GETTER\",\n \"WATCH_CALLBACK\": 3,\n \"3\": \"WATCH_CALLBACK\",\n \"WATCH_CLEANUP\": 4,\n \"4\": \"WATCH_CLEANUP\",\n \"NATIVE_EVENT_HANDLER\": 5,\n \"5\": \"NATIVE_EVENT_HANDLER\",\n \"COMPONENT_EVENT_HANDLER\": 6,\n \"6\": \"COMPONENT_EVENT_HANDLER\",\n \"VNODE_HOOK\": 7,\n \"7\": \"VNODE_HOOK\",\n \"DIRECTIVE_HOOK\": 8,\n \"8\": \"DIRECTIVE_HOOK\",\n \"TRANSITION_HOOK\": 9,\n \"9\": \"TRANSITION_HOOK\",\n \"APP_ERROR_HANDLER\": 10,\n \"10\": \"APP_ERROR_HANDLER\",\n \"APP_WARN_HANDLER\": 11,\n \"11\": \"APP_WARN_HANDLER\",\n \"FUNCTION_REF\": 12,\n \"12\": \"FUNCTION_REF\",\n \"ASYNC_COMPONENT_LOADER\": 13,\n \"13\": \"ASYNC_COMPONENT_LOADER\",\n \"SCHEDULER\": 14,\n \"14\": \"SCHEDULER\"\n};\nconst ErrorTypeStrings$1 = {\n [\"sp\"]: \"serverPrefetch hook\",\n [\"bc\"]: \"beforeCreate hook\",\n [\"c\"]: \"created hook\",\n [\"bm\"]: \"beforeMount hook\",\n [\"m\"]: \"mounted hook\",\n [\"bu\"]: \"beforeUpdate hook\",\n [\"u\"]: \"updated\",\n [\"bum\"]: \"beforeUnmount hook\",\n [\"um\"]: \"unmounted hook\",\n [\"a\"]: \"activated hook\",\n [\"da\"]: \"deactivated hook\",\n [\"ec\"]: \"errorCaptured hook\",\n [\"rtc\"]: \"renderTracked hook\",\n [\"rtg\"]: \"renderTriggered hook\",\n [0]: \"setup function\",\n [1]: \"render function\",\n [2]: \"watcher getter\",\n [3]: \"watcher callback\",\n [4]: \"watcher cleanup function\",\n [5]: \"native event handler\",\n [6]: \"component event handler\",\n [7]: \"vnode hook\",\n [8]: \"directive hook\",\n [9]: \"transition hook\",\n [10]: \"app errorHandler\",\n [11]: \"app warnHandler\",\n [12]: \"ref function\",\n [13]: \"async component loader\",\n [14]: \"scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core .\"\n};\nfunction callWithErrorHandling(fn, instance, type, args) {\n let res;\n try {\n res = args ? fn(...args) : fn();\n } catch (err) {\n handleError(err, instance, type);\n }\n return res;\n}\nfunction callWithAsyncErrorHandling(fn, instance, type, args) {\n if (isFunction(fn)) {\n const res = callWithErrorHandling(fn, instance, type, args);\n if (res && isPromise(res)) {\n res.catch((err) => {\n handleError(err, instance, type);\n });\n }\n return res;\n }\n const values = [];\n for (let i = 0; i < fn.length; i++) {\n values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));\n }\n return values;\n}\nfunction handleError(err, instance, type, throwInDev = true) {\n const contextVNode = instance ? instance.vnode : null;\n if (instance) {\n let cur = instance.parent;\n const exposedInstance = instance.proxy;\n const errorInfo = !!(process.env.NODE_ENV !== \"production\") ? ErrorTypeStrings$1[type] : `https://vuejs.org/error-reference/#runtime-${type}`;\n while (cur) {\n const errorCapturedHooks = cur.ec;\n if (errorCapturedHooks) {\n for (let i = 0; i < errorCapturedHooks.length; i++) {\n if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {\n return;\n }\n }\n }\n cur = cur.parent;\n }\n const appErrorHandler = instance.appContext.config.errorHandler;\n if (appErrorHandler) {\n callWithErrorHandling(\n appErrorHandler,\n null,\n 10,\n [err, exposedInstance, errorInfo]\n );\n return;\n }\n }\n logError(err, type, contextVNode, throwInDev);\n}\nfunction logError(err, type, contextVNode, throwInDev = true) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n const info = ErrorTypeStrings$1[type];\n if (contextVNode) {\n pushWarningContext(contextVNode);\n }\n warn$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);\n if (contextVNode) {\n popWarningContext();\n }\n if (throwInDev) {\n throw err;\n } else {\n console.error(err);\n }\n } else {\n console.error(err);\n }\n}\n\nlet isFlushing = false;\nlet isFlushPending = false;\nconst queue = [];\nlet flushIndex = 0;\nconst pendingPostFlushCbs = [];\nlet activePostFlushCbs = null;\nlet postFlushIndex = 0;\nconst resolvedPromise = /* @__PURE__ */ Promise.resolve();\nlet currentFlushPromise = null;\nconst RECURSION_LIMIT = 100;\nfunction nextTick(fn) {\n const p = currentFlushPromise || resolvedPromise;\n return fn ? p.then(this ? fn.bind(this) : fn) : p;\n}\nfunction findInsertionIndex(id) {\n let start = flushIndex + 1;\n let end = queue.length;\n while (start < end) {\n const middle = start + end >>> 1;\n const middleJob = queue[middle];\n const middleJobId = getId(middleJob);\n if (middleJobId < id || middleJobId === id && middleJob.pre) {\n start = middle + 1;\n } else {\n end = middle;\n }\n }\n return start;\n}\nfunction queueJob(job) {\n if (!queue.length || !queue.includes(\n job,\n isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex\n )) {\n if (job.id == null) {\n queue.push(job);\n } else {\n queue.splice(findInsertionIndex(job.id), 0, job);\n }\n queueFlush();\n }\n}\nfunction queueFlush() {\n if (!isFlushing && !isFlushPending) {\n isFlushPending = true;\n currentFlushPromise = resolvedPromise.then(flushJobs);\n }\n}\nfunction invalidateJob(job) {\n const i = queue.indexOf(job);\n if (i > flushIndex) {\n queue.splice(i, 1);\n }\n}\nfunction queuePostFlushCb(cb) {\n if (!isArray(cb)) {\n if (!activePostFlushCbs || !activePostFlushCbs.includes(\n cb,\n cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex\n )) {\n pendingPostFlushCbs.push(cb);\n }\n } else {\n pendingPostFlushCbs.push(...cb);\n }\n queueFlush();\n}\nfunction flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n seen = seen || /* @__PURE__ */ new Map();\n }\n for (; i < queue.length; i++) {\n const cb = queue[i];\n if (cb && cb.pre) {\n if (instance && cb.id !== instance.uid) {\n continue;\n }\n if (!!(process.env.NODE_ENV !== \"production\") && checkRecursiveUpdates(seen, cb)) {\n continue;\n }\n queue.splice(i, 1);\n i--;\n cb();\n }\n }\n}\nfunction flushPostFlushCbs(seen) {\n if (pendingPostFlushCbs.length) {\n const deduped = [...new Set(pendingPostFlushCbs)].sort(\n (a, b) => getId(a) - getId(b)\n );\n pendingPostFlushCbs.length = 0;\n if (activePostFlushCbs) {\n activePostFlushCbs.push(...deduped);\n return;\n }\n activePostFlushCbs = deduped;\n if (!!(process.env.NODE_ENV !== \"production\")) {\n seen = seen || /* @__PURE__ */ new Map();\n }\n for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {\n if (!!(process.env.NODE_ENV !== \"production\") && checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {\n continue;\n }\n activePostFlushCbs[postFlushIndex]();\n }\n activePostFlushCbs = null;\n postFlushIndex = 0;\n }\n}\nconst getId = (job) => job.id == null ? Infinity : job.id;\nconst comparator = (a, b) => {\n const diff = getId(a) - getId(b);\n if (diff === 0) {\n if (a.pre && !b.pre)\n return -1;\n if (b.pre && !a.pre)\n return 1;\n }\n return diff;\n};\nfunction flushJobs(seen) {\n isFlushPending = false;\n isFlushing = true;\n if (!!(process.env.NODE_ENV !== \"production\")) {\n seen = seen || /* @__PURE__ */ new Map();\n }\n queue.sort(comparator);\n const check = !!(process.env.NODE_ENV !== \"production\") ? (job) => checkRecursiveUpdates(seen, job) : NOOP;\n try {\n for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {\n const job = queue[flushIndex];\n if (job && job.active !== false) {\n if (!!(process.env.NODE_ENV !== \"production\") && check(job)) {\n continue;\n }\n callWithErrorHandling(job, null, 14);\n }\n }\n } finally {\n flushIndex = 0;\n queue.length = 0;\n flushPostFlushCbs(seen);\n isFlushing = false;\n currentFlushPromise = null;\n if (queue.length || pendingPostFlushCbs.length) {\n flushJobs(seen);\n }\n }\n}\nfunction checkRecursiveUpdates(seen, fn) {\n if (!seen.has(fn)) {\n seen.set(fn, 1);\n } else {\n const count = seen.get(fn);\n if (count > RECURSION_LIMIT) {\n const instance = fn.ownerInstance;\n const componentName = instance && getComponentName(instance.type);\n handleError(\n `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,\n null,\n 10\n );\n return true;\n } else {\n seen.set(fn, count + 1);\n }\n }\n}\n\nlet isHmrUpdating = false;\nconst hmrDirtyComponents = /* @__PURE__ */ new Set();\nif (!!(process.env.NODE_ENV !== \"production\")) {\n getGlobalThis().__VUE_HMR_RUNTIME__ = {\n createRecord: tryWrap(createRecord),\n rerender: tryWrap(rerender),\n reload: tryWrap(reload)\n };\n}\nconst map = /* @__PURE__ */ new Map();\nfunction registerHMR(instance) {\n const id = instance.type.__hmrId;\n let record = map.get(id);\n if (!record) {\n createRecord(id, instance.type);\n record = map.get(id);\n }\n record.instances.add(instance);\n}\nfunction unregisterHMR(instance) {\n map.get(instance.type.__hmrId).instances.delete(instance);\n}\nfunction createRecord(id, initialDef) {\n if (map.has(id)) {\n return false;\n }\n map.set(id, {\n initialDef: normalizeClassComponent(initialDef),\n instances: /* @__PURE__ */ new Set()\n });\n return true;\n}\nfunction normalizeClassComponent(component) {\n return isClassComponent(component) ? component.__vccOpts : component;\n}\nfunction rerender(id, newRender) {\n const record = map.get(id);\n if (!record) {\n return;\n }\n record.initialDef.render = newRender;\n [...record.instances].forEach((instance) => {\n if (newRender) {\n instance.render = newRender;\n normalizeClassComponent(instance.type).render = newRender;\n }\n instance.renderCache = [];\n isHmrUpdating = true;\n instance.effect.dirty = true;\n instance.update();\n isHmrUpdating = false;\n });\n}\nfunction reload(id, newComp) {\n const record = map.get(id);\n if (!record)\n return;\n newComp = normalizeClassComponent(newComp);\n updateComponentDef(record.initialDef, newComp);\n const instances = [...record.instances];\n for (const instance of instances) {\n const oldComp = normalizeClassComponent(instance.type);\n if (!hmrDirtyComponents.has(oldComp)) {\n if (oldComp !== record.initialDef) {\n updateComponentDef(oldComp, newComp);\n }\n hmrDirtyComponents.add(oldComp);\n }\n instance.appContext.propsCache.delete(instance.type);\n instance.appContext.emitsCache.delete(instance.type);\n instance.appContext.optionsCache.delete(instance.type);\n if (instance.ceReload) {\n hmrDirtyComponents.add(oldComp);\n instance.ceReload(newComp.styles);\n hmrDirtyComponents.delete(oldComp);\n } else if (instance.parent) {\n instance.parent.effect.dirty = true;\n queueJob(instance.parent.update);\n } else if (instance.appContext.reload) {\n instance.appContext.reload();\n } else if (typeof window !== \"undefined\") {\n window.location.reload();\n } else {\n console.warn(\n \"[HMR] Root or manually mounted instance modified. Full reload required.\"\n );\n }\n }\n queuePostFlushCb(() => {\n for (const instance of instances) {\n hmrDirtyComponents.delete(\n normalizeClassComponent(instance.type)\n );\n }\n });\n}\nfunction updateComponentDef(oldComp, newComp) {\n extend(oldComp, newComp);\n for (const key in oldComp) {\n if (key !== \"__file\" && !(key in newComp)) {\n delete oldComp[key];\n }\n }\n}\nfunction tryWrap(fn) {\n return (id, arg) => {\n try {\n return fn(id, arg);\n } catch (e) {\n console.error(e);\n console.warn(\n `[HMR] Something went wrong during Vue component hot-reload. Full reload required.`\n );\n }\n };\n}\n\nlet devtools$1;\nlet buffer = [];\nlet devtoolsNotInstalled = false;\nfunction emit$1(event, ...args) {\n if (devtools$1) {\n devtools$1.emit(event, ...args);\n } else if (!devtoolsNotInstalled) {\n buffer.push({ event, args });\n }\n}\nfunction setDevtoolsHook$1(hook, target) {\n var _a, _b;\n devtools$1 = hook;\n if (devtools$1) {\n devtools$1.enabled = true;\n buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args));\n buffer = [];\n } else if (\n // handle late devtools injection - only do this if we are in an actual\n // browser environment to avoid the timer handle stalling test runner exit\n // (#4815)\n typeof window !== \"undefined\" && // some envs mock window but not fully\n window.HTMLElement && // also exclude jsdom\n !((_b = (_a = window.navigator) == null ? void 0 : _a.userAgent) == null ? void 0 : _b.includes(\"jsdom\"))\n ) {\n const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];\n replay.push((newHook) => {\n setDevtoolsHook$1(newHook, target);\n });\n setTimeout(() => {\n if (!devtools$1) {\n target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;\n devtoolsNotInstalled = true;\n buffer = [];\n }\n }, 3e3);\n } else {\n devtoolsNotInstalled = true;\n buffer = [];\n }\n}\nfunction devtoolsInitApp(app, version) {\n emit$1(\"app:init\" /* APP_INIT */, app, version, {\n Fragment,\n Text,\n Comment,\n Static\n });\n}\nfunction devtoolsUnmountApp(app) {\n emit$1(\"app:unmount\" /* APP_UNMOUNT */, app);\n}\nconst devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(\n \"component:added\" /* COMPONENT_ADDED */\n);\nconst devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook(\"component:updated\" /* COMPONENT_UPDATED */);\nconst _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(\n \"component:removed\" /* COMPONENT_REMOVED */\n);\nconst devtoolsComponentRemoved = (component) => {\n if (devtools$1 && typeof devtools$1.cleanupBuffer === \"function\" && // remove the component if it wasn't buffered\n !devtools$1.cleanupBuffer(component)) {\n _devtoolsComponentRemoved(component);\n }\n};\nfunction createDevtoolsComponentHook(hook) {\n return (component) => {\n emit$1(\n hook,\n component.appContext.app,\n component.uid,\n component.parent ? component.parent.uid : void 0,\n component\n );\n };\n}\nconst devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook(\n \"perf:start\" /* PERFORMANCE_START */\n);\nconst devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook(\n \"perf:end\" /* PERFORMANCE_END */\n);\nfunction createDevtoolsPerformanceHook(hook) {\n return (component, type, time) => {\n emit$1(hook, component.appContext.app, component.uid, component, type, time);\n };\n}\nfunction devtoolsComponentEmit(component, event, params) {\n emit$1(\n \"component:emit\" /* COMPONENT_EMIT */,\n component.appContext.app,\n component,\n event,\n params\n );\n}\n\nfunction emit(instance, event, ...rawArgs) {\n if (instance.isUnmounted)\n return;\n const props = instance.vnode.props || EMPTY_OBJ;\n if (!!(process.env.NODE_ENV !== \"production\")) {\n const {\n emitsOptions,\n propsOptions: [propsOptions]\n } = instance;\n if (emitsOptions) {\n if (!(event in emitsOptions) && true) {\n if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {\n warn$1(\n `Component emitted event \"${event}\" but it is neither declared in the emits option nor as an \"${toHandlerKey(event)}\" prop.`\n );\n }\n } else {\n const validator = emitsOptions[event];\n if (isFunction(validator)) {\n const isValid = validator(...rawArgs);\n if (!isValid) {\n warn$1(\n `Invalid event arguments: event validation failed for event \"${event}\".`\n );\n }\n }\n }\n }\n }\n let args = rawArgs;\n const isModelListener = event.startsWith(\"update:\");\n const modelArg = isModelListener && event.slice(7);\n if (modelArg && modelArg in props) {\n const modifiersKey = `${modelArg === \"modelValue\" ? \"model\" : modelArg}Modifiers`;\n const { number, trim } = props[modifiersKey] || EMPTY_OBJ;\n if (trim) {\n args = rawArgs.map((a) => isString(a) ? a.trim() : a);\n }\n if (number) {\n args = rawArgs.map(looseToNumber);\n }\n }\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n devtoolsComponentEmit(instance, event, args);\n }\n if (!!(process.env.NODE_ENV !== \"production\")) {\n const lowerCaseEvent = event.toLowerCase();\n if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {\n warn$1(\n `Event \"${lowerCaseEvent}\" is emitted in component ${formatComponentName(\n instance,\n instance.type\n )} but the handler is registered for \"${event}\". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use \"${hyphenate(\n event\n )}\" instead of \"${event}\".`\n );\n }\n }\n let handlerName;\n let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)\n props[handlerName = toHandlerKey(camelize(event))];\n if (!handler && isModelListener) {\n handler = props[handlerName = toHandlerKey(hyphenate(event))];\n }\n if (handler) {\n callWithAsyncErrorHandling(\n handler,\n instance,\n 6,\n args\n );\n }\n const onceHandler = props[handlerName + `Once`];\n if (onceHandler) {\n if (!instance.emitted) {\n instance.emitted = {};\n } else if (instance.emitted[handlerName]) {\n return;\n }\n instance.emitted[handlerName] = true;\n callWithAsyncErrorHandling(\n onceHandler,\n instance,\n 6,\n args\n );\n }\n}\nfunction normalizeEmitsOptions(comp, appContext, asMixin = false) {\n const cache = appContext.emitsCache;\n const cached = cache.get(comp);\n if (cached !== void 0) {\n return cached;\n }\n const raw = comp.emits;\n let normalized = {};\n let hasExtends = false;\n if (__VUE_OPTIONS_API__ && !isFunction(comp)) {\n const extendEmits = (raw2) => {\n const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);\n if (normalizedFromExtend) {\n hasExtends = true;\n extend(normalized, normalizedFromExtend);\n }\n };\n if (!asMixin && appContext.mixins.length) {\n appContext.mixins.forEach(extendEmits);\n }\n if (comp.extends) {\n extendEmits(comp.extends);\n }\n if (comp.mixins) {\n comp.mixins.forEach(extendEmits);\n }\n }\n if (!raw && !hasExtends) {\n if (isObject(comp)) {\n cache.set(comp, null);\n }\n return null;\n }\n if (isArray(raw)) {\n raw.forEach((key) => normalized[key] = null);\n } else {\n extend(normalized, raw);\n }\n if (isObject(comp)) {\n cache.set(comp, normalized);\n }\n return normalized;\n}\nfunction isEmitListener(options, key) {\n if (!options || !isOn(key)) {\n return false;\n }\n key = key.slice(2).replace(/Once$/, \"\");\n return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);\n}\n\nlet currentRenderingInstance = null;\nlet currentScopeId = null;\nfunction setCurrentRenderingInstance(instance) {\n const prev = currentRenderingInstance;\n currentRenderingInstance = instance;\n currentScopeId = instance && instance.type.__scopeId || null;\n return prev;\n}\nfunction pushScopeId(id) {\n currentScopeId = id;\n}\nfunction popScopeId() {\n currentScopeId = null;\n}\nconst withScopeId = (_id) => withCtx;\nfunction withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {\n if (!ctx)\n return fn;\n if (fn._n) {\n return fn;\n }\n const renderFnWithContext = (...args) => {\n if (renderFnWithContext._d) {\n setBlockTracking(-1);\n }\n const prevInstance = setCurrentRenderingInstance(ctx);\n let res;\n try {\n res = fn(...args);\n } finally {\n setCurrentRenderingInstance(prevInstance);\n if (renderFnWithContext._d) {\n setBlockTracking(1);\n }\n }\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n devtoolsComponentUpdated(ctx);\n }\n return res;\n };\n renderFnWithContext._n = true;\n renderFnWithContext._c = true;\n renderFnWithContext._d = true;\n return renderFnWithContext;\n}\n\nlet accessedAttrs = false;\nfunction markAttrsAccessed() {\n accessedAttrs = true;\n}\nfunction renderComponentRoot(instance) {\n const {\n type: Component,\n vnode,\n proxy,\n withProxy,\n props,\n propsOptions: [propsOptions],\n slots,\n attrs,\n emit,\n render,\n renderCache,\n data,\n setupState,\n ctx,\n inheritAttrs\n } = instance;\n let result;\n let fallthroughAttrs;\n const prev = setCurrentRenderingInstance(instance);\n if (!!(process.env.NODE_ENV !== \"production\")) {\n accessedAttrs = false;\n }\n try {\n if (vnode.shapeFlag & 4) {\n const proxyToUse = withProxy || proxy;\n const thisProxy = !!(process.env.NODE_ENV !== \"production\") && setupState.__isScriptSetup ? new Proxy(proxyToUse, {\n get(target, key, receiver) {\n warn$1(\n `Property '${String(\n key\n )}' was accessed via 'this'. Avoid using 'this' in templates.`\n );\n return Reflect.get(target, key, receiver);\n }\n }) : proxyToUse;\n result = normalizeVNode(\n render.call(\n thisProxy,\n proxyToUse,\n renderCache,\n props,\n setupState,\n data,\n ctx\n )\n );\n fallthroughAttrs = attrs;\n } else {\n const render2 = Component;\n if (!!(process.env.NODE_ENV !== \"production\") && attrs === props) {\n markAttrsAccessed();\n }\n result = normalizeVNode(\n render2.length > 1 ? render2(\n props,\n !!(process.env.NODE_ENV !== \"production\") ? {\n get attrs() {\n markAttrsAccessed();\n return attrs;\n },\n slots,\n emit\n } : { attrs, slots, emit }\n ) : render2(\n props,\n null\n /* we know it doesn't need it */\n )\n );\n fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);\n }\n } catch (err) {\n blockStack.length = 0;\n handleError(err, instance, 1);\n result = createVNode(Comment);\n }\n let root = result;\n let setRoot = void 0;\n if (!!(process.env.NODE_ENV !== \"production\") && result.patchFlag > 0 && result.patchFlag & 2048) {\n [root, setRoot] = getChildRoot(result);\n }\n if (fallthroughAttrs && inheritAttrs !== false) {\n const keys = Object.keys(fallthroughAttrs);\n const { shapeFlag } = root;\n if (keys.length) {\n if (shapeFlag & (1 | 6)) {\n if (propsOptions && keys.some(isModelListener)) {\n fallthroughAttrs = filterModelListeners(\n fallthroughAttrs,\n propsOptions\n );\n }\n root = cloneVNode(root, fallthroughAttrs);\n } else if (!!(process.env.NODE_ENV !== \"production\") && !accessedAttrs && root.type !== Comment) {\n const allAttrs = Object.keys(attrs);\n const eventAttrs = [];\n const extraAttrs = [];\n for (let i = 0, l = allAttrs.length; i < l; i++) {\n const key = allAttrs[i];\n if (isOn(key)) {\n if (!isModelListener(key)) {\n eventAttrs.push(key[2].toLowerCase() + key.slice(3));\n }\n } else {\n extraAttrs.push(key);\n }\n }\n if (extraAttrs.length) {\n warn$1(\n `Extraneous non-props attributes (${extraAttrs.join(\", \")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`\n );\n }\n if (eventAttrs.length) {\n warn$1(\n `Extraneous non-emits event listeners (${eventAttrs.join(\", \")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the \"emits\" option.`\n );\n }\n }\n }\n }\n if (vnode.dirs) {\n if (!!(process.env.NODE_ENV !== \"production\") && !isElementRoot(root)) {\n warn$1(\n `Runtime directive used on component with non-element root node. The directives will not function as intended.`\n );\n }\n root = cloneVNode(root);\n root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;\n }\n if (vnode.transition) {\n if (!!(process.env.NODE_ENV !== \"production\") && !isElementRoot(root)) {\n warn$1(\n `Component inside renders non-element root node that cannot be animated.`\n );\n }\n root.transition = vnode.transition;\n }\n if (!!(process.env.NODE_ENV !== \"production\") && setRoot) {\n setRoot(root);\n } else {\n result = root;\n }\n setCurrentRenderingInstance(prev);\n return result;\n}\nconst getChildRoot = (vnode) => {\n const rawChildren = vnode.children;\n const dynamicChildren = vnode.dynamicChildren;\n const childRoot = filterSingleRoot(rawChildren, false);\n if (!childRoot) {\n return [vnode, void 0];\n } else if (!!(process.env.NODE_ENV !== \"production\") && childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) {\n return getChildRoot(childRoot);\n }\n const index = rawChildren.indexOf(childRoot);\n const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;\n const setRoot = (updatedRoot) => {\n rawChildren[index] = updatedRoot;\n if (dynamicChildren) {\n if (dynamicIndex > -1) {\n dynamicChildren[dynamicIndex] = updatedRoot;\n } else if (updatedRoot.patchFlag > 0) {\n vnode.dynamicChildren = [...dynamicChildren, updatedRoot];\n }\n }\n };\n return [normalizeVNode(childRoot), setRoot];\n};\nfunction filterSingleRoot(children, recurse = true) {\n let singleRoot;\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n if (isVNode(child)) {\n if (child.type !== Comment || child.children === \"v-if\") {\n if (singleRoot) {\n return;\n } else {\n singleRoot = child;\n if (!!(process.env.NODE_ENV !== \"production\") && recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) {\n return filterSingleRoot(singleRoot.children);\n }\n }\n }\n } else {\n return;\n }\n }\n return singleRoot;\n}\nconst getFunctionalFallthrough = (attrs) => {\n let res;\n for (const key in attrs) {\n if (key === \"class\" || key === \"style\" || isOn(key)) {\n (res || (res = {}))[key] = attrs[key];\n }\n }\n return res;\n};\nconst filterModelListeners = (attrs, props) => {\n const res = {};\n for (const key in attrs) {\n if (!isModelListener(key) || !(key.slice(9) in props)) {\n res[key] = attrs[key];\n }\n }\n return res;\n};\nconst isElementRoot = (vnode) => {\n return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;\n};\nfunction shouldUpdateComponent(prevVNode, nextVNode, optimized) {\n const { props: prevProps, children: prevChildren, component } = prevVNode;\n const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;\n const emits = component.emitsOptions;\n if (!!(process.env.NODE_ENV !== \"production\") && (prevChildren || nextChildren) && isHmrUpdating) {\n return true;\n }\n if (nextVNode.dirs || nextVNode.transition) {\n return true;\n }\n if (optimized && patchFlag >= 0) {\n if (patchFlag & 1024) {\n return true;\n }\n if (patchFlag & 16) {\n if (!prevProps) {\n return !!nextProps;\n }\n return hasPropsChanged(prevProps, nextProps, emits);\n } else if (patchFlag & 8) {\n const dynamicProps = nextVNode.dynamicProps;\n for (let i = 0; i < dynamicProps.length; i++) {\n const key = dynamicProps[i];\n if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {\n return true;\n }\n }\n }\n } else {\n if (prevChildren || nextChildren) {\n if (!nextChildren || !nextChildren.$stable) {\n return true;\n }\n }\n if (prevProps === nextProps) {\n return false;\n }\n if (!prevProps) {\n return !!nextProps;\n }\n if (!nextProps) {\n return true;\n }\n return hasPropsChanged(prevProps, nextProps, emits);\n }\n return false;\n}\nfunction hasPropsChanged(prevProps, nextProps, emitsOptions) {\n const nextKeys = Object.keys(nextProps);\n if (nextKeys.length !== Object.keys(prevProps).length) {\n return true;\n }\n for (let i = 0; i < nextKeys.length; i++) {\n const key = nextKeys[i];\n if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {\n return true;\n }\n }\n return false;\n}\nfunction updateHOCHostEl({ vnode, parent }, el) {\n while (parent) {\n const root = parent.subTree;\n if (root.suspense && root.suspense.activeBranch === vnode) {\n root.el = vnode.el;\n }\n if (root === vnode) {\n (vnode = parent.vnode).el = el;\n parent = parent.parent;\n } else {\n break;\n }\n }\n}\n\nconst COMPONENTS = \"components\";\nconst DIRECTIVES = \"directives\";\nfunction resolveComponent(name, maybeSelfReference) {\n return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;\n}\nconst NULL_DYNAMIC_COMPONENT = Symbol.for(\"v-ndc\");\nfunction resolveDynamicComponent(component) {\n if (isString(component)) {\n return resolveAsset(COMPONENTS, component, false) || component;\n } else {\n return component || NULL_DYNAMIC_COMPONENT;\n }\n}\nfunction resolveDirective(name) {\n return resolveAsset(DIRECTIVES, name);\n}\nfunction resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {\n const instance = currentRenderingInstance || currentInstance;\n if (instance) {\n const Component = instance.type;\n if (type === COMPONENTS) {\n const selfName = getComponentName(\n Component,\n false\n );\n if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {\n return Component;\n }\n }\n const res = (\n // local registration\n // check instance[type] first which is resolved for options API\n resolve(instance[type] || Component[type], name) || // global registration\n resolve(instance.appContext[type], name)\n );\n if (!res && maybeSelfReference) {\n return Component;\n }\n if (!!(process.env.NODE_ENV !== \"production\") && warnMissing && !res) {\n const extra = type === COMPONENTS ? `\nIf this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;\n warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);\n }\n return res;\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(\n `resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`\n );\n }\n}\nfunction resolve(registry, name) {\n return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);\n}\n\nconst isSuspense = (type) => type.__isSuspense;\nlet suspenseId = 0;\nconst SuspenseImpl = {\n name: \"Suspense\",\n // In order to make Suspense tree-shakable, we need to avoid importing it\n // directly in the renderer. The renderer checks for the __isSuspense flag\n // on a vnode's type and calls the `process` method, passing in renderer\n // internals.\n __isSuspense: true,\n process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {\n if (n1 == null) {\n mountSuspense(\n n2,\n container,\n anchor,\n parentComponent,\n parentSuspense,\n namespace,\n slotScopeIds,\n optimized,\n rendererInternals\n );\n } else {\n if (parentSuspense && parentSuspense.deps > 0) {\n n2.suspense = n1.suspense;\n return;\n }\n patchSuspense(\n n1,\n n2,\n container,\n anchor,\n parentComponent,\n namespace,\n slotScopeIds,\n optimized,\n rendererInternals\n );\n }\n },\n hydrate: hydrateSuspense,\n create: createSuspenseBoundary,\n normalize: normalizeSuspenseChildren\n};\nconst Suspense = SuspenseImpl ;\nfunction triggerEvent(vnode, name) {\n const eventListener = vnode.props && vnode.props[name];\n if (isFunction(eventListener)) {\n eventListener();\n }\n}\nfunction mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {\n const {\n p: patch,\n o: { createElement }\n } = rendererInternals;\n const hiddenContainer = createElement(\"div\");\n const suspense = vnode.suspense = createSuspenseBoundary(\n vnode,\n parentSuspense,\n parentComponent,\n container,\n hiddenContainer,\n anchor,\n namespace,\n slotScopeIds,\n optimized,\n rendererInternals\n );\n patch(\n null,\n suspense.pendingBranch = vnode.ssContent,\n hiddenContainer,\n null,\n parentComponent,\n suspense,\n namespace,\n slotScopeIds\n );\n if (suspense.deps > 0) {\n triggerEvent(vnode, \"onPending\");\n triggerEvent(vnode, \"onFallback\");\n patch(\n null,\n vnode.ssFallback,\n container,\n anchor,\n parentComponent,\n null,\n // fallback tree will not have suspense context\n namespace,\n slotScopeIds\n );\n setActiveBranch(suspense, vnode.ssFallback);\n } else {\n suspense.resolve(false, true);\n }\n}\nfunction patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {\n const suspense = n2.suspense = n1.suspense;\n suspense.vnode = n2;\n n2.el = n1.el;\n const newBranch = n2.ssContent;\n const newFallback = n2.ssFallback;\n const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;\n if (pendingBranch) {\n suspense.pendingBranch = newBranch;\n if (isSameVNodeType(newBranch, pendingBranch)) {\n patch(\n pendingBranch,\n newBranch,\n suspense.hiddenContainer,\n null,\n parentComponent,\n suspense,\n namespace,\n slotScopeIds,\n optimized\n );\n if (suspense.deps <= 0) {\n suspense.resolve();\n } else if (isInFallback) {\n if (!isHydrating) {\n patch(\n activeBranch,\n newFallback,\n container,\n anchor,\n parentComponent,\n null,\n // fallback tree will not have suspense context\n namespace,\n slotScopeIds,\n optimized\n );\n setActiveBranch(suspense, newFallback);\n }\n }\n } else {\n suspense.pendingId = suspenseId++;\n if (isHydrating) {\n suspense.isHydrating = false;\n suspense.activeBranch = pendingBranch;\n } else {\n unmount(pendingBranch, parentComponent, suspense);\n }\n suspense.deps = 0;\n suspense.effects.length = 0;\n suspense.hiddenContainer = createElement(\"div\");\n if (isInFallback) {\n patch(\n null,\n newBranch,\n suspense.hiddenContainer,\n null,\n parentComponent,\n suspense,\n namespace,\n slotScopeIds,\n optimized\n );\n if (suspense.deps <= 0) {\n suspense.resolve();\n } else {\n patch(\n activeBranch,\n newFallback,\n container,\n anchor,\n parentComponent,\n null,\n // fallback tree will not have suspense context\n namespace,\n slotScopeIds,\n optimized\n );\n setActiveBranch(suspense, newFallback);\n }\n } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {\n patch(\n activeBranch,\n newBranch,\n container,\n anchor,\n parentComponent,\n suspense,\n namespace,\n slotScopeIds,\n optimized\n );\n suspense.resolve(true);\n } else {\n patch(\n null,\n newBranch,\n suspense.hiddenContainer,\n null,\n parentComponent,\n suspense,\n namespace,\n slotScopeIds,\n optimized\n );\n if (suspense.deps <= 0) {\n suspense.resolve();\n }\n }\n }\n } else {\n if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {\n patch(\n activeBranch,\n newBranch,\n container,\n anchor,\n parentComponent,\n suspense,\n namespace,\n slotScopeIds,\n optimized\n );\n setActiveBranch(suspense, newBranch);\n } else {\n triggerEvent(n2, \"onPending\");\n suspense.pendingBranch = newBranch;\n if (newBranch.shapeFlag & 512) {\n suspense.pendingId = newBranch.component.suspenseId;\n } else {\n suspense.pendingId = suspenseId++;\n }\n patch(\n null,\n newBranch,\n suspense.hiddenContainer,\n null,\n parentComponent,\n suspense,\n namespace,\n slotScopeIds,\n optimized\n );\n if (suspense.deps <= 0) {\n suspense.resolve();\n } else {\n const { timeout, pendingId } = suspense;\n if (timeout > 0) {\n setTimeout(() => {\n if (suspense.pendingId === pendingId) {\n suspense.fallback(newFallback);\n }\n }, timeout);\n } else if (timeout === 0) {\n suspense.fallback(newFallback);\n }\n }\n }\n }\n}\nlet hasWarned = false;\nfunction createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {\n if (!!(process.env.NODE_ENV !== \"production\") && true && !hasWarned) {\n hasWarned = true;\n console[console.info ? \"info\" : \"log\"](\n ` is an experimental feature and its API will likely change.`\n );\n }\n const {\n p: patch,\n m: move,\n um: unmount,\n n: next,\n o: { parentNode, remove }\n } = rendererInternals;\n let parentSuspenseId;\n const isSuspensible = isVNodeSuspensible(vnode);\n if (isSuspensible) {\n if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) {\n parentSuspenseId = parentSuspense.pendingId;\n parentSuspense.deps++;\n }\n }\n const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0;\n if (!!(process.env.NODE_ENV !== \"production\")) {\n assertNumber(timeout, `Suspense timeout`);\n }\n const initialAnchor = anchor;\n const suspense = {\n vnode,\n parent: parentSuspense,\n parentComponent,\n namespace,\n container,\n hiddenContainer,\n deps: 0,\n pendingId: suspenseId++,\n timeout: typeof timeout === \"number\" ? timeout : -1,\n activeBranch: null,\n pendingBranch: null,\n isInFallback: !isHydrating,\n isHydrating,\n isUnmounted: false,\n effects: [],\n resolve(resume = false, sync = false) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n if (!resume && !suspense.pendingBranch) {\n throw new Error(\n `suspense.resolve() is called without a pending branch.`\n );\n }\n if (suspense.isUnmounted) {\n throw new Error(\n `suspense.resolve() is called on an already unmounted suspense boundary.`\n );\n }\n }\n const {\n vnode: vnode2,\n activeBranch,\n pendingBranch,\n pendingId,\n effects,\n parentComponent: parentComponent2,\n container: container2\n } = suspense;\n let delayEnter = false;\n if (suspense.isHydrating) {\n suspense.isHydrating = false;\n } else if (!resume) {\n delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === \"out-in\";\n if (delayEnter) {\n activeBranch.transition.afterLeave = () => {\n if (pendingId === suspense.pendingId) {\n move(\n pendingBranch,\n container2,\n anchor === initialAnchor ? next(activeBranch) : anchor,\n 0\n );\n queuePostFlushCb(effects);\n }\n };\n }\n if (activeBranch) {\n if (parentNode(activeBranch.el) !== suspense.hiddenContainer) {\n anchor = next(activeBranch);\n }\n unmount(activeBranch, parentComponent2, suspense, true);\n }\n if (!delayEnter) {\n move(pendingBranch, container2, anchor, 0);\n }\n }\n setActiveBranch(suspense, pendingBranch);\n suspense.pendingBranch = null;\n suspense.isInFallback = false;\n let parent = suspense.parent;\n let hasUnresolvedAncestor = false;\n while (parent) {\n if (parent.pendingBranch) {\n parent.effects.push(...effects);\n hasUnresolvedAncestor = true;\n break;\n }\n parent = parent.parent;\n }\n if (!hasUnresolvedAncestor && !delayEnter) {\n queuePostFlushCb(effects);\n }\n suspense.effects = [];\n if (isSuspensible) {\n if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {\n parentSuspense.deps--;\n if (parentSuspense.deps === 0 && !sync) {\n parentSuspense.resolve();\n }\n }\n }\n triggerEvent(vnode2, \"onResolve\");\n },\n fallback(fallbackVNode) {\n if (!suspense.pendingBranch) {\n return;\n }\n const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;\n triggerEvent(vnode2, \"onFallback\");\n const anchor2 = next(activeBranch);\n const mountFallback = () => {\n if (!suspense.isInFallback) {\n return;\n }\n patch(\n null,\n fallbackVNode,\n container2,\n anchor2,\n parentComponent2,\n null,\n // fallback tree will not have suspense context\n namespace2,\n slotScopeIds,\n optimized\n );\n setActiveBranch(suspense, fallbackVNode);\n };\n const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === \"out-in\";\n if (delayEnter) {\n activeBranch.transition.afterLeave = mountFallback;\n }\n suspense.isInFallback = true;\n unmount(\n activeBranch,\n parentComponent2,\n null,\n // no suspense so unmount hooks fire now\n true\n // shouldRemove\n );\n if (!delayEnter) {\n mountFallback();\n }\n },\n move(container2, anchor2, type) {\n suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);\n suspense.container = container2;\n },\n next() {\n return suspense.activeBranch && next(suspense.activeBranch);\n },\n registerDep(instance, setupRenderEffect) {\n const isInPendingSuspense = !!suspense.pendingBranch;\n if (isInPendingSuspense) {\n suspense.deps++;\n }\n const hydratedEl = instance.vnode.el;\n instance.asyncDep.catch((err) => {\n handleError(err, instance, 0);\n }).then((asyncSetupResult) => {\n if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {\n return;\n }\n instance.asyncResolved = true;\n const { vnode: vnode2 } = instance;\n if (!!(process.env.NODE_ENV !== \"production\")) {\n pushWarningContext(vnode2);\n }\n handleSetupResult(instance, asyncSetupResult, false);\n if (hydratedEl) {\n vnode2.el = hydratedEl;\n }\n const placeholder = !hydratedEl && instance.subTree.el;\n setupRenderEffect(\n instance,\n vnode2,\n // component may have been moved before resolve.\n // if this is not a hydration, instance.subTree will be the comment\n // placeholder.\n parentNode(hydratedEl || instance.subTree.el),\n // anchor will not be used if this is hydration, so only need to\n // consider the comment placeholder case.\n hydratedEl ? null : next(instance.subTree),\n suspense,\n namespace,\n optimized\n );\n if (placeholder) {\n remove(placeholder);\n }\n updateHOCHostEl(instance, vnode2.el);\n if (!!(process.env.NODE_ENV !== \"production\")) {\n popWarningContext();\n }\n if (isInPendingSuspense && --suspense.deps === 0) {\n suspense.resolve();\n }\n });\n },\n unmount(parentSuspense2, doRemove) {\n suspense.isUnmounted = true;\n if (suspense.activeBranch) {\n unmount(\n suspense.activeBranch,\n parentComponent,\n parentSuspense2,\n doRemove\n );\n }\n if (suspense.pendingBranch) {\n unmount(\n suspense.pendingBranch,\n parentComponent,\n parentSuspense2,\n doRemove\n );\n }\n }\n };\n return suspense;\n}\nfunction hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {\n const suspense = vnode.suspense = createSuspenseBoundary(\n vnode,\n parentSuspense,\n parentComponent,\n node.parentNode,\n // eslint-disable-next-line no-restricted-globals\n document.createElement(\"div\"),\n null,\n namespace,\n slotScopeIds,\n optimized,\n rendererInternals,\n true\n );\n const result = hydrateNode(\n node,\n suspense.pendingBranch = vnode.ssContent,\n parentComponent,\n suspense,\n slotScopeIds,\n optimized\n );\n if (suspense.deps === 0) {\n suspense.resolve(false, true);\n }\n return result;\n}\nfunction normalizeSuspenseChildren(vnode) {\n const { shapeFlag, children } = vnode;\n const isSlotChildren = shapeFlag & 32;\n vnode.ssContent = normalizeSuspenseSlot(\n isSlotChildren ? children.default : children\n );\n vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment);\n}\nfunction normalizeSuspenseSlot(s) {\n let block;\n if (isFunction(s)) {\n const trackBlock = isBlockTreeEnabled && s._c;\n if (trackBlock) {\n s._d = false;\n openBlock();\n }\n s = s();\n if (trackBlock) {\n s._d = true;\n block = currentBlock;\n closeBlock();\n }\n }\n if (isArray(s)) {\n const singleChild = filterSingleRoot(s);\n if (!!(process.env.NODE_ENV !== \"production\") && !singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) {\n warn$1(` slots expect a single root node.`);\n }\n s = singleChild;\n }\n s = normalizeVNode(s);\n if (block && !s.dynamicChildren) {\n s.dynamicChildren = block.filter((c) => c !== s);\n }\n return s;\n}\nfunction queueEffectWithSuspense(fn, suspense) {\n if (suspense && suspense.pendingBranch) {\n if (isArray(fn)) {\n suspense.effects.push(...fn);\n } else {\n suspense.effects.push(fn);\n }\n } else {\n queuePostFlushCb(fn);\n }\n}\nfunction setActiveBranch(suspense, branch) {\n suspense.activeBranch = branch;\n const { vnode, parentComponent } = suspense;\n let el = branch.el;\n while (!el && branch.component) {\n branch = branch.component.subTree;\n el = branch.el;\n }\n vnode.el = el;\n if (parentComponent && parentComponent.subTree === vnode) {\n parentComponent.vnode.el = el;\n updateHOCHostEl(parentComponent, el);\n }\n}\nfunction isVNodeSuspensible(vnode) {\n var _a;\n return ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;\n}\n\nconst ssrContextKey = Symbol.for(\"v-scx\");\nconst useSSRContext = () => {\n {\n const ctx = inject(ssrContextKey);\n if (!ctx) {\n !!(process.env.NODE_ENV !== \"production\") && warn$1(\n `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`\n );\n }\n return ctx;\n }\n};\n\nfunction watchEffect(effect, options) {\n return doWatch(effect, null, options);\n}\nfunction watchPostEffect(effect, options) {\n return doWatch(\n effect,\n null,\n !!(process.env.NODE_ENV !== \"production\") ? extend({}, options, { flush: \"post\" }) : { flush: \"post\" }\n );\n}\nfunction watchSyncEffect(effect, options) {\n return doWatch(\n effect,\n null,\n !!(process.env.NODE_ENV !== \"production\") ? extend({}, options, { flush: \"sync\" }) : { flush: \"sync\" }\n );\n}\nconst INITIAL_WATCHER_VALUE = {};\nfunction watch(source, cb, options) {\n if (!!(process.env.NODE_ENV !== \"production\") && !isFunction(cb)) {\n warn$1(\n `\\`watch(fn, options?)\\` signature has been moved to a separate API. Use \\`watchEffect(fn, options?)\\` instead. \\`watch\\` now only supports \\`watch(source, cb, options?) signature.`\n );\n }\n return doWatch(source, cb, options);\n}\nfunction doWatch(source, cb, {\n immediate,\n deep,\n flush,\n once,\n onTrack,\n onTrigger\n} = EMPTY_OBJ) {\n if (cb && once) {\n const _cb = cb;\n cb = (...args) => {\n _cb(...args);\n unwatch();\n };\n }\n if (!!(process.env.NODE_ENV !== \"production\") && deep !== void 0 && typeof deep === \"number\") {\n warn$1(\n `watch() \"deep\" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.`\n );\n }\n if (!!(process.env.NODE_ENV !== \"production\") && !cb) {\n if (immediate !== void 0) {\n warn$1(\n `watch() \"immediate\" option is only respected when using the watch(source, callback, options?) signature.`\n );\n }\n if (deep !== void 0) {\n warn$1(\n `watch() \"deep\" option is only respected when using the watch(source, callback, options?) signature.`\n );\n }\n if (once !== void 0) {\n warn$1(\n `watch() \"once\" option is only respected when using the watch(source, callback, options?) signature.`\n );\n }\n }\n const warnInvalidSource = (s) => {\n warn$1(\n `Invalid watch source: `,\n s,\n `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`\n );\n };\n const instance = currentInstance;\n const reactiveGetter = (source2) => deep === true ? source2 : (\n // for deep: false, only traverse root-level properties\n traverse(source2, deep === false ? 1 : void 0)\n );\n let getter;\n let forceTrigger = false;\n let isMultiSource = false;\n if (isRef(source)) {\n getter = () => source.value;\n forceTrigger = isShallow$1(source);\n } else if (isReactive(source)) {\n getter = () => reactiveGetter(source);\n forceTrigger = true;\n } else if (isArray(source)) {\n isMultiSource = true;\n forceTrigger = source.some((s) => isReactive(s) || isShallow$1(s));\n getter = () => source.map((s) => {\n if (isRef(s)) {\n return s.value;\n } else if (isReactive(s)) {\n return reactiveGetter(s);\n } else if (isFunction(s)) {\n return callWithErrorHandling(s, instance, 2);\n } else {\n !!(process.env.NODE_ENV !== \"production\") && warnInvalidSource(s);\n }\n });\n } else if (isFunction(source)) {\n if (cb) {\n getter = () => callWithErrorHandling(source, instance, 2);\n } else {\n getter = () => {\n if (cleanup) {\n cleanup();\n }\n return callWithAsyncErrorHandling(\n source,\n instance,\n 3,\n [onCleanup]\n );\n };\n }\n } else {\n getter = NOOP;\n !!(process.env.NODE_ENV !== \"production\") && warnInvalidSource(source);\n }\n if (cb && deep) {\n const baseGetter = getter;\n getter = () => traverse(baseGetter());\n }\n let cleanup;\n let onCleanup = (fn) => {\n cleanup = effect.onStop = () => {\n callWithErrorHandling(fn, instance, 4);\n cleanup = effect.onStop = void 0;\n };\n };\n let ssrCleanup;\n if (isInSSRComponentSetup) {\n onCleanup = NOOP;\n if (!cb) {\n getter();\n } else if (immediate) {\n callWithAsyncErrorHandling(cb, instance, 3, [\n getter(),\n isMultiSource ? [] : void 0,\n onCleanup\n ]);\n }\n if (flush === \"sync\") {\n const ctx = useSSRContext();\n ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);\n } else {\n return NOOP;\n }\n }\n let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;\n const job = () => {\n if (!effect.active || !effect.dirty) {\n return;\n }\n if (cb) {\n const newValue = effect.run();\n if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {\n if (cleanup) {\n cleanup();\n }\n callWithAsyncErrorHandling(cb, instance, 3, [\n newValue,\n // pass undefined as the old value when it's changed for the first time\n oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,\n onCleanup\n ]);\n oldValue = newValue;\n }\n } else {\n effect.run();\n }\n };\n job.allowRecurse = !!cb;\n let scheduler;\n if (flush === \"sync\") {\n scheduler = job;\n } else if (flush === \"post\") {\n scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);\n } else {\n job.pre = true;\n if (instance)\n job.id = instance.uid;\n scheduler = () => queueJob(job);\n }\n const effect = new ReactiveEffect(getter, NOOP, scheduler);\n const scope = getCurrentScope();\n const unwatch = () => {\n effect.stop();\n if (scope) {\n remove(scope.effects, effect);\n }\n };\n if (!!(process.env.NODE_ENV !== \"production\")) {\n effect.onTrack = onTrack;\n effect.onTrigger = onTrigger;\n }\n if (cb) {\n if (immediate) {\n job();\n } else {\n oldValue = effect.run();\n }\n } else if (flush === \"post\") {\n queuePostRenderEffect(\n effect.run.bind(effect),\n instance && instance.suspense\n );\n } else {\n effect.run();\n }\n if (ssrCleanup)\n ssrCleanup.push(unwatch);\n return unwatch;\n}\nfunction instanceWatch(source, value, options) {\n const publicThis = this.proxy;\n const getter = isString(source) ? source.includes(\".\") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);\n let cb;\n if (isFunction(value)) {\n cb = value;\n } else {\n cb = value.handler;\n options = value;\n }\n const reset = setCurrentInstance(this);\n const res = doWatch(getter, cb.bind(publicThis), options);\n reset();\n return res;\n}\nfunction createPathGetter(ctx, path) {\n const segments = path.split(\".\");\n return () => {\n let cur = ctx;\n for (let i = 0; i < segments.length && cur; i++) {\n cur = cur[segments[i]];\n }\n return cur;\n };\n}\nfunction traverse(value, depth, currentDepth = 0, seen) {\n if (!isObject(value) || value[\"__v_skip\"]) {\n return value;\n }\n if (depth && depth > 0) {\n if (currentDepth >= depth) {\n return value;\n }\n currentDepth++;\n }\n seen = seen || /* @__PURE__ */ new Set();\n if (seen.has(value)) {\n return value;\n }\n seen.add(value);\n if (isRef(value)) {\n traverse(value.value, depth, currentDepth, seen);\n } else if (isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n traverse(value[i], depth, currentDepth, seen);\n }\n } else if (isSet(value) || isMap(value)) {\n value.forEach((v) => {\n traverse(v, depth, currentDepth, seen);\n });\n } else if (isPlainObject(value)) {\n for (const key in value) {\n traverse(value[key], depth, currentDepth, seen);\n }\n }\n return value;\n}\n\nfunction validateDirectiveName(name) {\n if (isBuiltInDirective(name)) {\n warn$1(\"Do not use built-in directive ids as custom directive id: \" + name);\n }\n}\nfunction withDirectives(vnode, directives) {\n if (currentRenderingInstance === null) {\n !!(process.env.NODE_ENV !== \"production\") && warn$1(`withDirectives can only be used inside render functions.`);\n return vnode;\n }\n const instance = getExposeProxy(currentRenderingInstance) || currentRenderingInstance.proxy;\n const bindings = vnode.dirs || (vnode.dirs = []);\n for (let i = 0; i < directives.length; i++) {\n let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];\n if (dir) {\n if (isFunction(dir)) {\n dir = {\n mounted: dir,\n updated: dir\n };\n }\n if (dir.deep) {\n traverse(value);\n }\n bindings.push({\n dir,\n instance,\n value,\n oldValue: void 0,\n arg,\n modifiers\n });\n }\n }\n return vnode;\n}\nfunction invokeDirectiveHook(vnode, prevVNode, instance, name) {\n const bindings = vnode.dirs;\n const oldBindings = prevVNode && prevVNode.dirs;\n for (let i = 0; i < bindings.length; i++) {\n const binding = bindings[i];\n if (oldBindings) {\n binding.oldValue = oldBindings[i].value;\n }\n let hook = binding.dir[name];\n if (hook) {\n pauseTracking();\n callWithAsyncErrorHandling(hook, instance, 8, [\n vnode.el,\n binding,\n vnode,\n prevVNode\n ]);\n resetTracking();\n }\n }\n}\n\nconst leaveCbKey = Symbol(\"_leaveCb\");\nconst enterCbKey = Symbol(\"_enterCb\");\nfunction useTransitionState() {\n const state = {\n isMounted: false,\n isLeaving: false,\n isUnmounting: false,\n leavingVNodes: /* @__PURE__ */ new Map()\n };\n onMounted(() => {\n state.isMounted = true;\n });\n onBeforeUnmount(() => {\n state.isUnmounting = true;\n });\n return state;\n}\nconst TransitionHookValidator = [Function, Array];\nconst BaseTransitionPropsValidators = {\n mode: String,\n appear: Boolean,\n persisted: Boolean,\n // enter\n onBeforeEnter: TransitionHookValidator,\n onEnter: TransitionHookValidator,\n onAfterEnter: TransitionHookValidator,\n onEnterCancelled: TransitionHookValidator,\n // leave\n onBeforeLeave: TransitionHookValidator,\n onLeave: TransitionHookValidator,\n onAfterLeave: TransitionHookValidator,\n onLeaveCancelled: TransitionHookValidator,\n // appear\n onBeforeAppear: TransitionHookValidator,\n onAppear: TransitionHookValidator,\n onAfterAppear: TransitionHookValidator,\n onAppearCancelled: TransitionHookValidator\n};\nconst BaseTransitionImpl = {\n name: `BaseTransition`,\n props: BaseTransitionPropsValidators,\n setup(props, { slots }) {\n const instance = getCurrentInstance();\n const state = useTransitionState();\n let prevTransitionKey;\n return () => {\n const children = slots.default && getTransitionRawChildren(slots.default(), true);\n if (!children || !children.length) {\n return;\n }\n let child = children[0];\n if (children.length > 1) {\n let hasFound = false;\n for (const c of children) {\n if (c.type !== Comment) {\n if (!!(process.env.NODE_ENV !== \"production\") && hasFound) {\n warn$1(\n \" can only be used on a single element or component. Use for lists.\"\n );\n break;\n }\n child = c;\n hasFound = true;\n if (!!!(process.env.NODE_ENV !== \"production\"))\n break;\n }\n }\n }\n const rawProps = toRaw(props);\n const { mode } = rawProps;\n if (!!(process.env.NODE_ENV !== \"production\") && mode && mode !== \"in-out\" && mode !== \"out-in\" && mode !== \"default\") {\n warn$1(`invalid mode: ${mode}`);\n }\n if (state.isLeaving) {\n return emptyPlaceholder(child);\n }\n const innerChild = getKeepAliveChild(child);\n if (!innerChild) {\n return emptyPlaceholder(child);\n }\n const enterHooks = resolveTransitionHooks(\n innerChild,\n rawProps,\n state,\n instance\n );\n setTransitionHooks(innerChild, enterHooks);\n const oldChild = instance.subTree;\n const oldInnerChild = oldChild && getKeepAliveChild(oldChild);\n let transitionKeyChanged = false;\n const { getTransitionKey } = innerChild.type;\n if (getTransitionKey) {\n const key = getTransitionKey();\n if (prevTransitionKey === void 0) {\n prevTransitionKey = key;\n } else if (key !== prevTransitionKey) {\n prevTransitionKey = key;\n transitionKeyChanged = true;\n }\n }\n if (oldInnerChild && oldInnerChild.type !== Comment && (!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged)) {\n const leavingHooks = resolveTransitionHooks(\n oldInnerChild,\n rawProps,\n state,\n instance\n );\n setTransitionHooks(oldInnerChild, leavingHooks);\n if (mode === \"out-in\") {\n state.isLeaving = true;\n leavingHooks.afterLeave = () => {\n state.isLeaving = false;\n if (instance.update.active !== false) {\n instance.effect.dirty = true;\n instance.update();\n }\n };\n return emptyPlaceholder(child);\n } else if (mode === \"in-out\" && innerChild.type !== Comment) {\n leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {\n const leavingVNodesCache = getLeavingNodesForType(\n state,\n oldInnerChild\n );\n leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;\n el[leaveCbKey] = () => {\n earlyRemove();\n el[leaveCbKey] = void 0;\n delete enterHooks.delayedLeave;\n };\n enterHooks.delayedLeave = delayedLeave;\n };\n }\n }\n return child;\n };\n }\n};\nconst BaseTransition = BaseTransitionImpl;\nfunction getLeavingNodesForType(state, vnode) {\n const { leavingVNodes } = state;\n let leavingVNodesCache = leavingVNodes.get(vnode.type);\n if (!leavingVNodesCache) {\n leavingVNodesCache = /* @__PURE__ */ Object.create(null);\n leavingVNodes.set(vnode.type, leavingVNodesCache);\n }\n return leavingVNodesCache;\n}\nfunction resolveTransitionHooks(vnode, props, state, instance) {\n const {\n appear,\n mode,\n persisted = false,\n onBeforeEnter,\n onEnter,\n onAfterEnter,\n onEnterCancelled,\n onBeforeLeave,\n onLeave,\n onAfterLeave,\n onLeaveCancelled,\n onBeforeAppear,\n onAppear,\n onAfterAppear,\n onAppearCancelled\n } = props;\n const key = String(vnode.key);\n const leavingVNodesCache = getLeavingNodesForType(state, vnode);\n const callHook = (hook, args) => {\n hook && callWithAsyncErrorHandling(\n hook,\n instance,\n 9,\n args\n );\n };\n const callAsyncHook = (hook, args) => {\n const done = args[1];\n callHook(hook, args);\n if (isArray(hook)) {\n if (hook.every((hook2) => hook2.length <= 1))\n done();\n } else if (hook.length <= 1) {\n done();\n }\n };\n const hooks = {\n mode,\n persisted,\n beforeEnter(el) {\n let hook = onBeforeEnter;\n if (!state.isMounted) {\n if (appear) {\n hook = onBeforeAppear || onBeforeEnter;\n } else {\n return;\n }\n }\n if (el[leaveCbKey]) {\n el[leaveCbKey](\n true\n /* cancelled */\n );\n }\n const leavingVNode = leavingVNodesCache[key];\n if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {\n leavingVNode.el[leaveCbKey]();\n }\n callHook(hook, [el]);\n },\n enter(el) {\n let hook = onEnter;\n let afterHook = onAfterEnter;\n let cancelHook = onEnterCancelled;\n if (!state.isMounted) {\n if (appear) {\n hook = onAppear || onEnter;\n afterHook = onAfterAppear || onAfterEnter;\n cancelHook = onAppearCancelled || onEnterCancelled;\n } else {\n return;\n }\n }\n let called = false;\n const done = el[enterCbKey] = (cancelled) => {\n if (called)\n return;\n called = true;\n if (cancelled) {\n callHook(cancelHook, [el]);\n } else {\n callHook(afterHook, [el]);\n }\n if (hooks.delayedLeave) {\n hooks.delayedLeave();\n }\n el[enterCbKey] = void 0;\n };\n if (hook) {\n callAsyncHook(hook, [el, done]);\n } else {\n done();\n }\n },\n leave(el, remove) {\n const key2 = String(vnode.key);\n if (el[enterCbKey]) {\n el[enterCbKey](\n true\n /* cancelled */\n );\n }\n if (state.isUnmounting) {\n return remove();\n }\n callHook(onBeforeLeave, [el]);\n let called = false;\n const done = el[leaveCbKey] = (cancelled) => {\n if (called)\n return;\n called = true;\n remove();\n if (cancelled) {\n callHook(onLeaveCancelled, [el]);\n } else {\n callHook(onAfterLeave, [el]);\n }\n el[leaveCbKey] = void 0;\n if (leavingVNodesCache[key2] === vnode) {\n delete leavingVNodesCache[key2];\n }\n };\n leavingVNodesCache[key2] = vnode;\n if (onLeave) {\n callAsyncHook(onLeave, [el, done]);\n } else {\n done();\n }\n },\n clone(vnode2) {\n return resolveTransitionHooks(vnode2, props, state, instance);\n }\n };\n return hooks;\n}\nfunction emptyPlaceholder(vnode) {\n if (isKeepAlive(vnode)) {\n vnode = cloneVNode(vnode);\n vnode.children = null;\n return vnode;\n }\n}\nfunction getKeepAliveChild(vnode) {\n return isKeepAlive(vnode) ? (\n // #7121 ensure get the child component subtree in case\n // it's been replaced during HMR\n !!(process.env.NODE_ENV !== \"production\") && vnode.component ? vnode.component.subTree : vnode.children ? vnode.children[0] : void 0\n ) : vnode;\n}\nfunction setTransitionHooks(vnode, hooks) {\n if (vnode.shapeFlag & 6 && vnode.component) {\n setTransitionHooks(vnode.component.subTree, hooks);\n } else if (vnode.shapeFlag & 128) {\n vnode.ssContent.transition = hooks.clone(vnode.ssContent);\n vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);\n } else {\n vnode.transition = hooks;\n }\n}\nfunction getTransitionRawChildren(children, keepComment = false, parentKey) {\n let ret = [];\n let keyedFragmentCount = 0;\n for (let i = 0; i < children.length; i++) {\n let child = children[i];\n const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);\n if (child.type === Fragment) {\n if (child.patchFlag & 128)\n keyedFragmentCount++;\n ret = ret.concat(\n getTransitionRawChildren(child.children, keepComment, key)\n );\n } else if (keepComment || child.type !== Comment) {\n ret.push(key != null ? cloneVNode(child, { key }) : child);\n }\n }\n if (keyedFragmentCount > 1) {\n for (let i = 0; i < ret.length; i++) {\n ret[i].patchFlag = -2;\n }\n }\n return ret;\n}\n\n/*! #__NO_SIDE_EFFECTS__ */\n// @__NO_SIDE_EFFECTS__\nfunction defineComponent(options, extraOptions) {\n return isFunction(options) ? (\n // #8326: extend call and options.name access are considered side-effects\n // by Rollup, so we have to wrap it in a pure-annotated IIFE.\n /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()\n ) : options;\n}\n\nconst isAsyncWrapper = (i) => !!i.type.__asyncLoader;\n/*! #__NO_SIDE_EFFECTS__ */\n// @__NO_SIDE_EFFECTS__\nfunction defineAsyncComponent(source) {\n if (isFunction(source)) {\n source = { loader: source };\n }\n const {\n loader,\n loadingComponent,\n errorComponent,\n delay = 200,\n timeout,\n // undefined = never times out\n suspensible = true,\n onError: userOnError\n } = source;\n let pendingRequest = null;\n let resolvedComp;\n let retries = 0;\n const retry = () => {\n retries++;\n pendingRequest = null;\n return load();\n };\n const load = () => {\n let thisRequest;\n return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {\n err = err instanceof Error ? err : new Error(String(err));\n if (userOnError) {\n return new Promise((resolve, reject) => {\n const userRetry = () => resolve(retry());\n const userFail = () => reject(err);\n userOnError(err, userRetry, userFail, retries + 1);\n });\n } else {\n throw err;\n }\n }).then((comp) => {\n if (thisRequest !== pendingRequest && pendingRequest) {\n return pendingRequest;\n }\n if (!!(process.env.NODE_ENV !== \"production\") && !comp) {\n warn$1(\n `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`\n );\n }\n if (comp && (comp.__esModule || comp[Symbol.toStringTag] === \"Module\")) {\n comp = comp.default;\n }\n if (!!(process.env.NODE_ENV !== \"production\") && comp && !isObject(comp) && !isFunction(comp)) {\n throw new Error(`Invalid async component load result: ${comp}`);\n }\n resolvedComp = comp;\n return comp;\n }));\n };\n return defineComponent({\n name: \"AsyncComponentWrapper\",\n __asyncLoader: load,\n get __asyncResolved() {\n return resolvedComp;\n },\n setup() {\n const instance = currentInstance;\n if (resolvedComp) {\n return () => createInnerComp(resolvedComp, instance);\n }\n const onError = (err) => {\n pendingRequest = null;\n handleError(\n err,\n instance,\n 13,\n !errorComponent\n );\n };\n if (suspensible && instance.suspense || isInSSRComponentSetup) {\n return load().then((comp) => {\n return () => createInnerComp(comp, instance);\n }).catch((err) => {\n onError(err);\n return () => errorComponent ? createVNode(errorComponent, {\n error: err\n }) : null;\n });\n }\n const loaded = ref(false);\n const error = ref();\n const delayed = ref(!!delay);\n if (delay) {\n setTimeout(() => {\n delayed.value = false;\n }, delay);\n }\n if (timeout != null) {\n setTimeout(() => {\n if (!loaded.value && !error.value) {\n const err = new Error(\n `Async component timed out after ${timeout}ms.`\n );\n onError(err);\n error.value = err;\n }\n }, timeout);\n }\n load().then(() => {\n loaded.value = true;\n if (instance.parent && isKeepAlive(instance.parent.vnode)) {\n instance.parent.effect.dirty = true;\n queueJob(instance.parent.update);\n }\n }).catch((err) => {\n onError(err);\n error.value = err;\n });\n return () => {\n if (loaded.value && resolvedComp) {\n return createInnerComp(resolvedComp, instance);\n } else if (error.value && errorComponent) {\n return createVNode(errorComponent, {\n error: error.value\n });\n } else if (loadingComponent && !delayed.value) {\n return createVNode(loadingComponent);\n }\n };\n }\n });\n}\nfunction createInnerComp(comp, parent) {\n const { ref: ref2, props, children, ce } = parent.vnode;\n const vnode = createVNode(comp, props, children);\n vnode.ref = ref2;\n vnode.ce = ce;\n delete parent.vnode.ce;\n return vnode;\n}\n\nconst isKeepAlive = (vnode) => vnode.type.__isKeepAlive;\nconst KeepAliveImpl = {\n name: `KeepAlive`,\n // Marker for special handling inside the renderer. We are not using a ===\n // check directly on KeepAlive in the renderer, because importing it directly\n // would prevent it from being tree-shaken.\n __isKeepAlive: true,\n props: {\n include: [String, RegExp, Array],\n exclude: [String, RegExp, Array],\n max: [String, Number]\n },\n setup(props, { slots }) {\n const instance = getCurrentInstance();\n const sharedContext = instance.ctx;\n if (!sharedContext.renderer) {\n return () => {\n const children = slots.default && slots.default();\n return children && children.length === 1 ? children[0] : children;\n };\n }\n const cache = /* @__PURE__ */ new Map();\n const keys = /* @__PURE__ */ new Set();\n let current = null;\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n instance.__v_cache = cache;\n }\n const parentSuspense = instance.suspense;\n const {\n renderer: {\n p: patch,\n m: move,\n um: _unmount,\n o: { createElement }\n }\n } = sharedContext;\n const storageContainer = createElement(\"div\");\n sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {\n const instance2 = vnode.component;\n move(vnode, container, anchor, 0, parentSuspense);\n patch(\n instance2.vnode,\n vnode,\n container,\n anchor,\n instance2,\n parentSuspense,\n namespace,\n vnode.slotScopeIds,\n optimized\n );\n queuePostRenderEffect(() => {\n instance2.isDeactivated = false;\n if (instance2.a) {\n invokeArrayFns(instance2.a);\n }\n const vnodeHook = vnode.props && vnode.props.onVnodeMounted;\n if (vnodeHook) {\n invokeVNodeHook(vnodeHook, instance2.parent, vnode);\n }\n }, parentSuspense);\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n devtoolsComponentAdded(instance2);\n }\n };\n sharedContext.deactivate = (vnode) => {\n const instance2 = vnode.component;\n move(vnode, storageContainer, null, 1, parentSuspense);\n queuePostRenderEffect(() => {\n if (instance2.da) {\n invokeArrayFns(instance2.da);\n }\n const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;\n if (vnodeHook) {\n invokeVNodeHook(vnodeHook, instance2.parent, vnode);\n }\n instance2.isDeactivated = true;\n }, parentSuspense);\n if (!!(process.env.NODE_ENV !== \"production\") || __VUE_PROD_DEVTOOLS__) {\n devtoolsComponentAdded(instance2);\n }\n };\n function unmount(vnode) {\n resetShapeFlag(vnode);\n _unmount(vnode, instance, parentSuspense, true);\n }\n function pruneCache(filter) {\n cache.forEach((vnode, key) => {\n const name = getComponentName(vnode.type);\n if (name && (!filter || !filter(name))) {\n pruneCacheEntry(key);\n }\n });\n }\n function pruneCacheEntry(key) {\n const cached = cache.get(key);\n if (!current || !isSameVNodeType(cached, current)) {\n unmount(cached);\n } else if (current) {\n resetShapeFlag(current);\n }\n cache.delete(key);\n keys.delete(key);\n }\n watch(\n () => [props.include, props.exclude],\n ([include, exclude]) => {\n include && pruneCache((name) => matches(include, name));\n exclude && pruneCache((name) => !matches(exclude, name));\n },\n // prune post-render after `current` has been updated\n { flush: \"post\", deep: true }\n );\n let pendingCacheKey = null;\n const cacheSubtree = () => {\n if (pendingCacheKey != null) {\n cache.set(pendingCacheKey, getInnerChild(instance.subTree));\n }\n };\n onMounted(cacheSubtree);\n onUpdated(cacheSubtree);\n onBeforeUnmount(() => {\n cache.forEach((cached) => {\n const { subTree, suspense } = instance;\n const vnode = getInnerChild(subTree);\n if (cached.type === vnode.type && cached.key === vnode.key) {\n resetShapeFlag(vnode);\n const da = vnode.component.da;\n da && queuePostRenderEffect(da, suspense);\n return;\n }\n unmount(cached);\n });\n });\n return () => {\n pendingCacheKey = null;\n if (!slots.default) {\n return null;\n }\n const children = slots.default();\n const rawVNode = children[0];\n if (children.length > 1) {\n if (!!(process.env.NODE_ENV !== \"production\")) {\n warn$1(`KeepAlive should contain exactly one component child.`);\n }\n current = null;\n return children;\n } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {\n current = null;\n return rawVNode;\n }\n let vnode = getInnerChild(rawVNode);\n const comp = vnode.type;\n const name = getComponentName(\n isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp\n );\n const { include, exclude, max } = props;\n if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {\n current = vnode;\n return rawVNode;\n }\n const key = vnode.key == null ? comp : vnode.key;\n const cachedVNode = cache.get(key);\n if (vnode.el) {\n vnode = cloneVNode(vnode);\n if (rawVNode.shapeFlag & 128) {\n rawVNode.ssContent = vnode;\n }\n }\n pendingCacheKey = key;\n if (cachedVNode) {\n vnode.el = cachedVNode.el;\n vnode.component = cachedVNode.component;\n if (vnode.transition) {\n setTransitionHooks(vnode, vnode.transition);\n }\n vnode.shapeFlag |= 512;\n keys.delete(key);\n keys.add(key);\n } else {\n keys.add(key);\n if (max && keys.size > parseInt(max, 10)) {\n pruneCacheEntry(keys.values().next().value);\n }\n }\n vnode.shapeFlag |= 256;\n current = vnode;\n return isSuspense(rawVNode.type) ? rawVNode : vnode;\n };\n }\n};\nconst KeepAlive = KeepAliveImpl;\nfunction matches(pattern, name) {\n if (isArray(pattern)) {\n return pattern.some((p) => matches(p, name));\n } else if (isString(pattern)) {\n return pattern.split(\",\").includes(name);\n } else if (isRegExp(pattern)) {\n return pattern.test(name);\n }\n return false;\n}\nfunction onActivated(hook, target) {\n registerKeepAliveHook(hook, \"a\", target);\n}\nfunction onDeactivated(hook, target) {\n registerKeepAliveHook(hook, \"da\", target);\n}\nfunction registerKeepAliveHook(hook, type, target = currentInstance) {\n const wrappedHook = hook.__wdc || (hook.__wdc = () => {\n let current = target;\n while (current) {\n if (current.isDeactivated) {\n return;\n }\n current = current.parent;\n }\n return hook();\n });\n injectHook(type, wrappedHook, target);\n if (target) {\n let current = target.parent;\n while (current && current.parent) {\n if (isKeepAlive(current.parent.vnode)) {\n injectToKeepAliveRoot(wrappedHook, type, target, current);\n }\n current = current.parent;\n }\n }\n}\nfunction injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {\n const injected = injectHook(\n type,\n hook,\n keepAliveRoot,\n true\n /* prepend */\n );\n onUnmounted(() => {\n remove(keepAliveRoot[type], injected);\n }, target);\n}\nfunction resetShapeFlag(vnode) {\n vnode.shapeFlag &= ~256;\n vnode.shapeFlag &= ~512;\n}\nfunction getInnerChild(vnode) {\n return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;\n}\n\nfunction injectHook(type, hook, target = currentInstance, prepend = false) {\n if (target) {\n const hooks = target[type] || (target[type] = []);\n const wrappedHook = hook.__weh || (hook.__weh = (...args) => {\n if (target.isUnmounted) {\n return;\n }\n pauseTracking();\n const reset = setCurrentInstance(target);\n const res = callWithAsyncErrorHandling(hook, target, type, args);\n reset();\n resetTracking();\n return res;\n });\n if (prepend) {\n hooks.unshift(wrappedHook);\n } else {\n hooks.push(wrappedHook);\n }\n return wrappedHook;\n } else if (!!(process.env.NODE_ENV !== \"production\")) {\n const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, \"\"));\n warn$1(\n `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` )\n );\n }\n}\nconst createHook = (lifecycle) => (hook, target = currentInstance) => (\n // post-create lifecycle registrations are noops during SSR (except for serverPrefetch)\n (!isInSSRComponentSetup || lifecycle === \"sp\") && injectHook(lifecycle, (...args) => hook(...args), target)\n);\nconst onBeforeMount = createHook(\"bm\");\nconst onMounted = createHook(\"m\");\nconst onBeforeUpdate = createHook(\"bu\");\nconst onUpdated = createHook(\"u\");\nconst onBeforeUnmount = createHook(\"bum\");\nconst onUnmounted = createHook(\"um\");\nconst onServerPrefetch = createHook(\"sp\");\nconst onRenderTriggered = createHook(\n \"rtg\"\n);\nconst onRenderTracked = createHook(\n \"rtc\"\n);\nfunction onErrorCaptured(hook, target = currentInstance) {\n injectHook(\"ec\", hook, target);\n}\n\nfunction renderList(source, renderItem, cache, index) {\n let ret;\n const cached = cache && cache[index];\n if (isArray(source) || isString(source)) {\n ret = new Array(source.length);\n for (let i = 0, l = source.length; i < l; i++) {\n ret[i] = renderItem(source[i], i, void 0, cached && cached[i]);\n }\n } else if (typeof source === \"number\") {\n if (!!(process.env.NODE_ENV !== \"production\") && !Number.isInteger(source)) {\n warn$1(`The v-for range expect an integer value but got ${source}.`);\n }\n ret = new Array(source);\n for (let i = 0; i < source; i++) {\n ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);\n }\n } else if (isObject(source)) {\n if (source[Symbol.iterator]) {\n ret = Array.from(\n source,\n (item, i) => renderItem(item, i, void 0, cached && cached[i])\n );\n } else {\n const keys = Object.keys(source);\n ret = new Array(keys.length);\n for (let i = 0, l = keys.length; i < l; i++) {\n const key = keys[i];\n ret[i] = renderItem(source[key], key, i, cached && cached[i]);\n }\n }\n } else {\n ret = [];\n }\n if (cache) {\n cache[index] = ret;\n }\n return ret;\n}\n\nfunction createSlots(slots, dynamicSlots) {\n for (let i = 0; i < dynamicSlots.length; i++) {\n const slot = dynamicSlots[i];\n if (isArray(slot)) {\n for (let j = 0; j < slot.length; j++) {\n slots[slot[j].name] = slot[j].fn;\n }\n } else if (slot) {\n slots[slot.name] = slot.key ? (...args) => {\n const res = slot.fn(...args);\n if (res)\n res.key = slot.key;\n return res;\n } : slot.fn;\n }\n }\n return slots;\n}\n\nfunction renderSlot(slots, name, props = {}, fallback, noSlotted) {\n if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) {\n if (name !== \"default\")\n props.name = name;\n return createVNode(\"slot\", props, fallback && fallback());\n }\n let slot = slots[name];\n if (!!(process.env.NODE_ENV !== \"production\") && slot && slot.length > 1) {\n warn$1(\n `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.`\n );\n slot = () => [];\n }\n if (slot && slot._c) {\n slot._d = false;\n }\n openBlock();\n const validSlotContent = slot && ensureValidVNode(slot(props));\n const rendered = createBlock(\n Fragment,\n {\n key: props.key || // slot content array of a dynamic conditional slot may have a branch\n // key attached in the `createSlots` helper, respect that\n validSlotContent && validSlotContent.key || `_${name}`\n },\n validSlotContent || (fallback ? fallback() : []),\n validSlotContent && slots._ === 1 ? 64 : -2\n );\n if (!noSlotted && rendered.scopeId) {\n rendered.slotScopeIds = [rendered.scopeId + \"-s\"];\n }\n if (slot && slot._c) {\n slot._d = true;\n }\n return rendered;\n}\nfunction ensureValidVNode(vnodes) {\n return vnodes.some((child) => {\n if (!isVNode(child))\n return true;\n if (child.type === Comment)\n return false;\n if (child.type === Fragment && !ensureValidVNode(child.children))\n return false;\n return true;\n }) ? vnodes : null;\n}\n\nfunction toHandlers(obj, preserveCaseIfNecessary) {\n const ret = {};\n if (!!(process.env.NODE_ENV !== \"production\") && !isObject(obj)) {\n warn$1(`v-on with no argument expects an object value.`);\n return ret;\n }\n for (const key in obj) {\n ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];\n }\n return ret;\n}\n\nconst getPublicInstance = (i) => {\n if (!i)\n return null;\n if (isStatefulComponent(i))\n return getExposeProxy(i) || i.proxy;\n return getPublicInstance(i.parent);\n};\nconst publicPropertiesMap = (\n // Move PURE marker to new line to workaround compiler discarding it\n // due to type annotation\n /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {\n $: (i) => i,\n $el: (i) => i.vnode.el,\n $data: (i) => i.data,\n $props: (i) => !!(process.env.NODE_ENV !== \"production\") ? shallowReadonly(i.props) : i.props,\n $attrs: (i) => !!(process.env.NODE_ENV !== \"production\") ? shallowReadonly(i.attrs) : i.attrs,\n $slots: (i) => !!(process.env.NODE_ENV !== \"production\") ? shallowReadonly(i.slots) : i.slots,\n $refs: (i) => !!(process.env.NODE_ENV !== \"production\") ? shallowReadonly(i.refs) : i.refs,\n $parent: (i) => getPublicInstance(i.parent),\n $root: (i) => getPublicInstance(i.root),\n $emit: (i) => i.emit,\n $options: (i) => __VUE_OPTIONS_API__ ? resolveMergedOptions(i) : i.type,\n $forceUpdate: (i) => i.f || (i.f = () => {\n i.effect.dirty = true;\n queueJob(i.update);\n }),\n $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),\n $watch: (i) => __VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP\n })\n);\nconst isReservedPrefix = (key) => key === \"_\" || key === \"$\";\nconst hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);\nconst PublicInstanceProxyHandlers = {\n get({ _: instance }, key) {\n const { ctx, setupState, data, props, accessCache, type, appContext } = instance;\n if (!!(process.env.NODE_ENV !== \"production\") && key === \"__isVue\") {\n return true;\n }\n let normalizedProps;\n if (key[0] !== \"$\") {\n const n = accessCache[key];\n if (n !== void 0) {\n switch (n) {\n case 1 /* SETUP */:\n return setupState[key];\n case 2 /* DATA */:\n return data[key];\n case 4 /* CONTEXT */:\n return ctx[key];\n case 3 /* PROPS */:\n return props[key];\n }\n } else if (hasSetupBinding(setupState, key)) {\n accessCache[key] = 1 /* SETUP */;\n return setupState[key];\n } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {\n accessCache[key] = 2 /* DATA */;\n return data[key];\n } else if (\n // only cache other properties when instance has declared (thus stable)\n // props\n (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)\n ) {\n accessCache[key] = 3 /* PROPS */;\n return props[key];\n } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {\n accessCache[key] = 4 /* CONTEXT */;\n return ctx[key];\n } else if (!__VUE_OPTIONS_API__ || shouldCacheAccess) {\n accessCache[key] = 0 /* OTHER */;\n }\n }\n const publicGetter = publicPropertiesMap[key];\n let cssModule, globalProperties;\n if (publicGetter) {\n if (key === \"$attrs\") {\n track(instance, \"get\", key);\n !!(process.env.NODE_ENV !== \"production\") && markAttrsAccessed();\n } else if (!!(process.env.NODE_ENV !== \"production\") && key === \"$slots\") {\n track(instance, \"get\", key);\n }\n return publicGetter(instance);\n } else if (\n // css module (injected by vue-loader)\n (cssModule = type.__cssModules) && (cssModule = cssModule[key])\n ) {\n return cssModule;\n } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {\n accessCache[key] = 4 /* CONTEXT */;\n return ctx[key];\n } else if (\n // global properties\n globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)\n ) {\n {\n return globalProperties[key];\n }\n } else if (!!(process.env.NODE_ENV !== \"production\") && currentRenderingInstance && (!isString(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading\n // to infinite warning loop\n key.indexOf(\"__v\") !== 0)) {\n if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {\n warn$1(\n `Property ${JSON.stringify(\n key\n )} must be accessed via $data because it starts with a reserved character (\"$\" or \"_\") and is not proxied on the render context.`\n );\n } else if (instance === currentRenderingInstance) {\n warn$1(\n `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`\n );\n }\n }\n },\n set({ _: instance }, key, value) {\n const { data, setupState, ctx } = instance;\n if (hasSetupBinding(setupState, key)) {\n setupState[key] = value;\n return true;\n } else if (!!(process.env.NODE_ENV !== \"production\") && setupState.__isScriptSetup && hasOwn(setupState, key)) {\n warn$1(`Cannot mutate \n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","export const flatten = (node, descend = true) => {\n if (!node) {\n throw new Error('Invalid \"node\" parameter');\n }\n\n const result = [];\n\n node.descendants((child, pos) => {\n result.push({ node: child, pos });\n if (!descend) {\n return false;\n }\n });\n\n return result;\n};\n\nexport const findChildren = (node, predicate, descend) => {\n if (!node) {\n throw new Error('Invalid \"node\" parameter');\n } else if (!predicate) {\n throw new Error('Invalid \"predicate\" parameter');\n }\n\n return flatten(node, descend).filter((child) => { return predicate(child.node); });\n};\n\nexport const findTextNodes = (node, descend) => {\n return findChildren(node, (child) => { return child.isText; }, descend);\n};\n\nexport const findInlineNodes = (node, descend) => {\n return findChildren(node, (child) => { return child.isInline; }, descend);\n};\n\nexport const findBlockNodes = (node, descend) => {\n return findChildren(node, (child) => { return child.isBlock; }, descend);\n};\n\nexport const findChildrenByAttr = (node, predicate, descend) => {\n return findChildren(node, (child) => { return !!predicate(child.attrs); }, descend);\n};\n\nexport const findChildrenByType = (node, nodeType, descend) => {\n return findChildren(node, (child) => { return child.type === nodeType; }, descend);\n};\n\nexport const findChildrenByMark = (node, markType, descend) => {\n return findChildren(node, (child) => { return markType.isInSet(child.marks); }, descend);\n};\n\nexport const contains = (node, nodeType) => {\n return !!findChildrenByType(node, nodeType).length;\n};\n","export default {\n name: 'followCursor',\n defaultValue: false,\n fn(instance) {\n const { reference } = instance;\n\n return {\n onMount() {\n const event = instance.props.mouseEvent;\n const isCursorOverReference = event.target ? reference.contains(event.target) : true;\n const { clientX, clientY } = event;\n\n const rect = reference.getBoundingClientRect();\n const relativeX = clientX - rect.left;\n const relativeY = clientY - rect.top;\n\n if (isCursorOverReference || !instance.props.interactive) {\n instance.setProps({\n getReferenceClientRect() {\n const rect = reference.getBoundingClientRect();\n\n const x = rect.left + relativeX;\n const y = rect.top + relativeY;\n\n return {\n width: 0,\n height: 0,\n top: y,\n right: x,\n bottom: y,\n left: x,\n };\n },\n });\n }\n },\n };\n },\n};\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","import { isNodeEmpty } from '@tiptap/core';\nimport { Plugin, PluginKey } from 'prosemirror-state';\n\nclass Menu {\n constructor({ options, editorView }) {\n this.options = {\n ...{\n element: null,\n onUpdate: () => { return false; },\n },\n ...options,\n };\n\n this.preventHide = false;\n this.editorView = editorView;\n this.isActive = false;\n this.top = 0;\n this.behaviour = this.options.editor.vizyField.settings.blockTypeBehaviour;\n\n if (this.behaviour === 'click') {\n this.options.element.addEventListener('mousedown', this.mousedownHandler.bind(this), { capture: true });\n this.options.editor.on('focus', this.focusHandler.bind(this));\n this.options.editor.on('blur', this.blurHandler.bind(this));\n this.options.editor.on('resize', this.resizeHandler.bind(this));\n }\n\n if (this.behaviour === 'hover') {\n this.options.editor.view.dom.addEventListener('mousemove', this.mouseenterHandler.bind(this));\n this.options.editor.view.dom.addEventListener('mouseleave', this.mouseleaveHandler.bind(this));\n }\n }\n\n mouseenterHandler(e) {\n const { view } = this.options.editor;\n const pos = view.posAtCoords({ left: e.clientX, top: e.clientY });\n\n if (pos.pos && pos.inside > -1) {\n const position = pos.pos;\n const node = view.state.doc.resolve(position).parent;\n\n if (isNodeEmpty(node)) {\n setTimeout(() => {\n const parent = this.options.element.offsetParent;\n\n if (parent) {\n const parentBox = parent.getBoundingClientRect();\n const cursorCoords = view.coordsAtPos(position);\n const top = cursorCoords.top - parentBox.top;\n\n this.isActive = true;\n this.top = top;\n\n // Record the position against the field, so we can use it to set the cursor\n this.options.editor.vizyField.currentNodeHoverPosition = position;\n\n this.sendUpdate();\n }\n }, 10);\n } else {\n this.hide();\n }\n }\n }\n\n mouseleaveHandler(event) {\n // Don't close when hovering over the button (technically \"out\")\n if (event.relatedTarget && event.relatedTarget.classList.contains('vui-editor-insert-btn')) {\n return;\n }\n\n this.hide();\n }\n\n mousedownHandler() {\n this.preventHide = true;\n }\n\n focusHandler() {\n this.update(this.options.editor.view);\n }\n\n blurHandler(event) {\n if (this.preventHide) {\n this.preventHide = false;\n return;\n }\n\n this.hide(event);\n }\n\n resizeHandler() {\n if (this.isActive) {\n this.update(this.options.editor.view);\n }\n }\n\n isNodeEmpty($node) {\n const nodeJson = $node.toJSON();\n\n // Roll our own version of `isNodeEmpty` to handle text alignment and a few other cases.\n // We just check if the current node has no inner content.\n if (!nodeJson.content) {\n return true;\n }\n\n return false;\n }\n\n update(view, oldState) {\n const { state, composing } = view;\n const { doc, selection } = state;\n const isSame = oldState && oldState.doc.eq(doc) && oldState.selection.eq(selection);\n\n if (composing || isSame) {\n return;\n }\n\n const { $anchor, anchor, empty } = selection;\n const parent = this.options.element.offsetParent;\n const isRootDepth = $anchor.depth === 1;\n const isDefaultNodeType = $anchor.parent.type === state.doc.type.contentMatch.defaultType;\n const isDefaultNodeEmpty = this.isNodeEmpty(selection.$anchor.parent);\n const isActive = isRootDepth && isDefaultNodeType && isDefaultNodeEmpty;\n\n if (!empty || !parent || !isActive) {\n this.hide();\n\n return;\n }\n\n // Give it a sec for the UI to catch up with newly added blocks\n setTimeout(() => {\n const parentBox = parent.getBoundingClientRect();\n const cursorCoords = view.coordsAtPos(anchor);\n const top = cursorCoords.top - parentBox.top;\n\n this.isActive = true;\n this.top = top;\n\n this.sendUpdate();\n }, 10);\n }\n\n sendUpdate() {\n this.options.onUpdate({\n isActive: this.isActive,\n top: this.top,\n });\n }\n\n hide(event) {\n if (event && event.relatedTarget && this.options.element.parentNode && this.options.element.parentNode.contains(event.relatedTarget)) {\n return;\n }\n\n this.isActive = false;\n this.sendUpdate();\n }\n\n destroy() {\n if (this.behaviour === 'click') {\n this.options.element.removeEventListener('mousedown', this.mousedownHandler);\n this.options.editor.off('focus', this.focusHandler);\n this.options.editor.off('blur', this.blurHandler);\n this.options.editor.off('resize', this.resizeHandler);\n }\n\n if (this.behaviour === 'hover') {\n this.options.editor.view.dom.removeEventListener('mousemove', this.mouseenterHandler);\n this.options.editor.view.dom.removeEventListener('mouseleave', this.mouseleaveHandler);\n }\n }\n\n}\n\nexport default function(options) {\n return new Plugin({\n key: new PluginKey('floatingMenu'),\n view(editorView) {\n return new Menu({ editorView, options });\n },\n });\n}\n","\n","\n\n\n\n\n\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// This is CodeMirror (https://codemirror.net/5), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\/(\\d+)/.exec(userAgent);\n var chrome_version = chrome && +chrome[1];\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = safari && (/Mobile\\/\\w+/.test(userAgent) || navigator.maxTouchPoints > 2);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt(doc) {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var activeElement;\n try {\n activeElement = doc.activeElement;\n } catch(e) {\n activeElement = doc.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function doc(cm) { return cm.display.wrapper.ownerDocument }\n\n function win(cm) { return doc(cm).defaultView }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {\n this.id = null;\n this.f = null;\n this.time = 0;\n this.handler = bind(this.onTimeout, this);\n };\n Delayed.prototype.onTimeout = function (self) {\n self.id = 0;\n if (self.time <= +new Date) {\n self.f();\n } else {\n setTimeout(self.handler, self.time - +new Date);\n }\n };\n Delayed.prototype.set = function (ms, f) {\n this.f = f;\n var time = +new Date + ms;\n if (!this.id || time < this.time) {\n clearTimeout(this.id);\n this.id = setTimeout(this.handler, ms);\n this.time = time;\n }\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 50;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\u0300-\\u036f\\u0483-\\u0489\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u065e\\u0670\\u06d6-\\u06dc\\u06de-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07eb-\\u07f3\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0900-\\u0902\\u093c\\u0941-\\u0948\\u094d\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09bc\\u09be\\u09c1-\\u09c4\\u09cd\\u09d7\\u09e2\\u09e3\\u0a01\\u0a02\\u0a3c\\u0a41\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a70\\u0a71\\u0a75\\u0a81\\u0a82\\u0abc\\u0ac1-\\u0ac5\\u0ac7\\u0ac8\\u0acd\\u0ae2\\u0ae3\\u0b01\\u0b3c\\u0b3e\\u0b3f\\u0b41-\\u0b44\\u0b4d\\u0b56\\u0b57\\u0b62\\u0b63\\u0b82\\u0bbe\\u0bc0\\u0bcd\\u0bd7\\u0c3e-\\u0c40\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0cbc\\u0cbf\\u0cc2\\u0cc6\\u0ccc\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0d3e\\u0d41-\\u0d44\\u0d4d\\u0d57\\u0d62\\u0d63\\u0dca\\u0dcf\\u0dd2-\\u0dd4\\u0dd6\\u0ddf\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0eb1\\u0eb4-\\u0eb9\\u0ebb\\u0ebc\\u0ec8-\\u0ecd\\u0f18\\u0f19\\u0f35\\u0f37\\u0f39\\u0f71-\\u0f7e\\u0f80-\\u0f84\\u0f86\\u0f87\\u0f90-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102d-\\u1030\\u1032-\\u1037\\u1039\\u103a\\u103d\\u103e\\u1058\\u1059\\u105e-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108d\\u109d\\u135f\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b7-\\u17bd\\u17c6\\u17c9-\\u17d3\\u17dd\\u180b-\\u180d\\u18a9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193b\\u1a17\\u1a18\\u1a56\\u1a58-\\u1a5e\\u1a60\\u1a62\\u1a65-\\u1a6c\\u1a73-\\u1a7c\\u1a7f\\u1b00-\\u1b03\\u1b34\\u1b36-\\u1b3a\\u1b3c\\u1b42\\u1b6b-\\u1b73\\u1b80\\u1b81\\u1ba2-\\u1ba5\\u1ba8\\u1ba9\\u1c2c-\\u1c33\\u1c36\\u1c37\\u1cd0-\\u1cd2\\u1cd4-\\u1ce0\\u1ce2-\\u1ce8\\u1ced\\u1dc0-\\u1de6\\u1dfd-\\u1dff\\u200c\\u200d\\u20d0-\\u20f0\\u2cef-\\u2cf1\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua66f-\\ua672\\ua67c\\ua67d\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua825\\ua826\\ua8c4\\ua8e0-\\ua8f1\\ua926-\\ua92d\\ua947-\\ua951\\ua980-\\ua982\\ua9b3\\ua9b6-\\ua9b9\\ua9bc\\uaa29-\\uaa2e\\uaa31\\uaa32\\uaa35\\uaa36\\uaa43\\uaa4c\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uabe5\\uabe8\\uabed\\udc00-\\udfff\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe26\\uff9e\\uff9f]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length, isRTL = direction == \"rtl\" ? 1 : 0;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); at += isRTL; }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n at += isRTL;\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map = emitter._handlers || (emitter._handlers = {});\n map[type] = (map[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map = emitter._handlers, arr = map && map[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range;\n try {range = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range || range.parentElement() != te) { return false }\n return range.compareEndPoints(\"StartToEnd\", range) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\\\s)\" + lineClass[2] + \"(?:$|\\\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n\n // Add a span to a line.\n function addMarkedSpan(line, span, op) {\n var inThisOp = op && window.WeakSet && (op.markedSpans || (op.markedSpans = new WeakSet));\n if (inThisOp && line.markedSpans && inThisOp.has(line.markedSpans)) {\n line.markedSpans.push(span);\n } else {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n if (inThisOp) { inThisOp.add(line.markedSpans); }\n }\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo, from, to, marker) {\n var line = getLine(doc, lineNo);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css || attributes) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n gutterWrap.setAttribute(\"aria-hidden\", \"true\");\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.display.gutterSpecs.length; ++k) {\n var id = cm.display.gutterSpecs[k].className, found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n var isWidget = classTest(\"CodeMirror-linewidget\");\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (isWidget.test(node.className)) { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\" + (widget.className ? \" \" + widget.className : \"\"));\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\", \"CodeMirror-line-like\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n if (lineView.rest) {\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map.length; i += 3) {\n mStart = map[i];\n mEnd = map[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map.length - 3 || ch == mEnd && map[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map[i - 2] == map[i - 3] && map[i - 1].insertLeft) {\n node = map[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map.length - 3 && map[i + 3] == map[i + 4] && !map[i + 5].insertLeft) {\n node = map[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX(doc) {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(doc.body.getBoundingClientRect().left - parseInt(getComputedStyle(doc.body).marginLeft)) }\n return doc.defaultView.pageXOffset || (doc.documentElement || doc.body).scrollLeft\n }\n function pageScrollY(doc) {\n if (chrome && android) { return -(doc.body.getBoundingClientRect().top - parseInt(getComputedStyle(doc.body).marginTop)) }\n return doc.defaultView.pageYOffset || (doc.documentElement || doc.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var ref = visualLine(lineObj);\n var widgets = ref.widgets;\n var height = 0;\n if (widgets) { for (var i = 0; i < widgets.length; ++i) { if (widgets[i].above)\n { height += widgetHeight(widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY(doc(cm)));\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX(doc(cm)));\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX(doc(cm));\n top -= pageScrollY(doc(cm));\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = outside; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight; box.bottom += widgetHeight;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top ? -1 : y >= coords.bottom ? 1 : 0;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\", null, \"CodeMirror-line-like\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor], \"CodeMirror-line-like\");\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n var id = cm.display.gutterSpecs[i].className;\n left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[id] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e$1) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel > 0 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n var customCursor = cm.options.$customCursor;\n if (customCursor) { primary = true; }\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range = doc.sel.ranges[i];\n if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }\n var collapsed = range.empty();\n if (customCursor) {\n var head = customCursor(cm, range);\n if (head) { drawSelectionCursor(cm, head, curFragment); }\n } else if (collapsed || cm.options.showCursorWhenSelecting) {\n drawSelectionCursor(cm, range.head, curFragment);\n }\n if (!collapsed)\n { drawSelectionRange(cm, range, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (/\\bcm-fat-cursor\\b/.test(cm.getWrapperElement().className)) {\n var charPos = charCoords(cm, head, \"div\", null, null);\n var width = charPos.right - charPos.left;\n cursor.style.width = (width > 0 ? width : cm.defaultCharWidth()) + \"px\";\n }\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range.from(), sTo = range.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () {\n if (!cm.hasFocus()) { onBlur(cm); }\n display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\";\n }, cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.hasFocus()) {\n cm.display.input.focus();\n if (!cm.state.focused) { onFocus(cm); }\n }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n if (cm.state.focused) { onBlur(cm); }\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent && !cm.state.draggingText) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n var viewTop = Math.max(0, display.scroller.getBoundingClientRect().top);\n var oldHeight = display.lineDiv.getBoundingClientRect().top;\n var mustScroll = 0;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n oldHeight += cur.line.height;\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n if (oldHeight < viewTop) { mustScroll -= diff; }\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n if (Math.abs(mustScroll) > 2) { display.scroller.scrollTop += mustScroll; }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n var doc = display.wrapper.ownerDocument;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (doc.defaultView.innerHeight || doc.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var gutterSpace = cm.options.fixedGutter ? 0 : display.gutters.offsetWidth;\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft - gutterSpace;\n var screenw = displayWidth(cm) - display.gutters.offsetWidth;\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left + gutterSpace - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range = cm.curOp.scrollToPos;\n if (range) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to);\n scrollToCoordsRange(cm, from, to, range.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.max(0, Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val));\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.max(0, Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth));\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.scrollTop = 0;\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.visibility = this.vert.style.visibility = \"hidden\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.visibility = \"\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt != bar) { bar.style.visibility = \"hidden\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId, // Unique ID\n markArrays: null // Used by addMarkedSpan\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt(doc(cm));\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt(doc(cm));\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = win(cm).getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt(snapshot.activeElt.ownerDocument)) { return }\n snapshot.activeElt.focus();\n if (!/^(INPUT|TEXTAREA)$/.test(snapshot.activeElt.nodeName) &&\n snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var doc = snapshot.activeElt.ownerDocument;\n var sel = doc.defaultView.getSelection(), range = doc.createRange();\n range.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n } else if (first) {\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(display) {\n var width = display.gutters.offsetWidth;\n display.sizer.style.marginLeft = width + \"px\";\n // Send an event to consumers responding to changes in gutter width.\n signalLater(display, \"gutterChanged\", display);\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm.display);\n return true\n }\n return false\n }\n\n function getGutters(gutters, lineNumbers) {\n var result = [], sawLineNumbers = false;\n for (var i = 0; i < gutters.length; i++) {\n var name = gutters[i], style = null;\n if (typeof name != \"string\") { style = name.style; name = name.className; }\n if (name == \"CodeMirror-linenumbers\") {\n if (!lineNumbers) { continue }\n else { sawLineNumbers = true; }\n }\n result.push({className: name, style: style});\n }\n if (lineNumbers && !sawLineNumbers) { result.push({className: \"CodeMirror-linenumbers\", style: null}); }\n return result\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function renderGutters(display) {\n var gutters = display.gutters, specs = display.gutterSpecs;\n removeChildren(gutters);\n display.lineGutter = null;\n for (var i = 0; i < specs.length; ++i) {\n var ref = specs[i];\n var className = ref.className;\n var style = ref.style;\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n if (style) { gElt.style.cssText = style; }\n if (className == \"CodeMirror-linenumbers\") {\n display.lineGutter = gElt;\n gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = specs.length ? \"\" : \"none\";\n updateGutterSpace(display);\n }\n\n function updateGutters(cm) {\n renderGutters(cm.display);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input, options) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n // See #6982. FIXME remove when this has been fixed for a while in Chrome\n if (chrome && chrome_version >= 105) { d.wrapper.style.clipPath = \"inset(0px)\"; }\n\n // This attribute is respected by automatic translation systems such as Google Translate,\n // and may also be respected by tools used by human translators.\n d.wrapper.setAttribute('translate', 'no');\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n d.gutterSpecs = getGutters(options.gutters, options.lineNumbers);\n renderGutters(d);\n\n input.init(d);\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n // On Chrome 102, viewport updates somehow stop wheel-based\n // scrolling. Turning off pointer events during the scroll seems\n // to avoid the issue.\n if (chrome && chrome_version == 102) {\n if (cm.display.chromeScrollHack == null) { cm.display.sizer.style.pointerEvents = \"none\"; }\n else { clearTimeout(cm.display.chromeScrollHack); }\n cm.display.chromeScrollHack = setTimeout(function () {\n cm.display.chromeScrollHack = null;\n cm.display.sizer.style.pointerEvents = \"\";\n }, 100);\n }\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n var pixelsPerUnit = wheelPixelsPerUnit;\n if (e.deltaMode === 0) {\n dx = e.deltaX;\n dy = e.deltaY;\n pixelsPerUnit = 1;\n }\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && pixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * pixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * pixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && pixelsPerUnit != null) {\n var pixels = dy * pixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20 && e.deltaMode !== 0) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this.ranges[i].anchor), copyPos(this.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n cm.options.direction = doc.direction;\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(prev) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = prev ? prev.undoDepth : Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = prev ? prev.maxGeneration : 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm && doc.cm.getOption(\"readOnly\") != \"nocursor\")\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = range.head == range.anchor ? newAnchor : skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n\n // Determine if we should prevent the cursor being placed to the left/right of an atomic marker\n // Historically this was determined using the inclusiveLeft/Right option, but the new way to control it\n // is with selectLeft/Right\n var preventCursorLeft = (\"selectLeft\" in m) ? !m.selectLeft : m.inclusiveLeft;\n var preventCursorRight = (\"selectRight\" in m) ? !m.selectRight : m.inclusiveRight;\n\n if ((sp.from == null || (preventCursorLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (preventCursorRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? preventCursorRight : preventCursorLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? preventCursorLeft : preventCursorRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n\n if (doc.cantEdit && skipAtomic(doc, Pos(doc.firstLine(), 0)))\n { doc.cantEdit = false; }\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this.lines[i];\n this.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n for (var e = at + n; at < e; ++at)\n { if (op(this.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this.height -= oldHeight - child.height;\n if (sz == rm) { this.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n for (var i = 0; i < this.children.length; ++i) { this.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this.children.splice(++i, 0, leaf);\n leaf.parent = this;\n }\n child.lines = child.lines.slice(0, remaining);\n this.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n for (var i = 0; i < this.children.length; ++i) {\n var child = this.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (cm && !this.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this.collapsed && !lineIsHidden(this.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null), doc.cm && doc.cm.curOp);\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n if (lineSep === '') { return lines.join('') }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range.head; }\n else if (start == \"anchor\") { pos = range.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range.to(); }\n else { pos = range.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this, ranges[i].anchor),\n clipPos(this, ranges[i].head || ranges[i].anchor)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n changes[i] = {from: range.from(), to: range.to(), text: this.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {\n var this$1 = this;\n\n this.history = new History(this.history);\n linkedDocs(this, function (doc) { return doc.history = this$1.history; }, true);\n },\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo == from.line && from.ch >= span.to ||\n span.from == null && lineNo != from.line ||\n span.from != null && lineNo == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo;\n });\n return clipPos(this, Pos(lineNo, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this.linked[i];\n if (link.doc != other) { continue }\n this.linked.splice(i, 1);\n other.unlinkDoc(this);\n detachSharedMarkers(findSharedMarkers(this));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var markAsReadAndPasteIfAllFilesAreRead = function () {\n if (++read == n) {\n operation(cm, function () {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(\n text.filter(function (t) { return t != null; }).join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(clipPos(cm.doc, pos), clipPos(cm.doc, changeEnd(change))));\n })();\n }\n };\n var readTextFromFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1) {\n markAsReadAndPasteIfAllFilesAreRead();\n return\n }\n var reader = new FileReader;\n reader.onerror = function () { return markAsReadAndPasteIfAllFilesAreRead(); };\n reader.onload = function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) {\n markAsReadAndPasteIfAllFilesAreRead();\n return\n }\n text[i] = content;\n markAsReadAndPasteIfAllFilesAreRead();\n };\n reader.readAsText(file);\n };\n for (var i = 0; i < files.length; i++) { readTextFromFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e$1){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 224: \"Mod\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\", \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\",\n \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\",\n \"Ctrl-T\": \"transposeChars\", \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map, handle, context) {\n map = getKeyMap(map);\n var found = map.call ? map.call(key, context) : map[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map.fallthrough) {\n if (Object.prototype.toString.call(map.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map.fallthrough, handle, context) }\n for (var i = 0; i < map.fallthrough.length; i++) {\n var result = lookupKey(key, map.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Mod\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n if (cm.doc.direction == \"rtl\") { dir = -dir; }\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"codepoint\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(start.ch, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n if (e.target && e.target != cm.display.input.getField()) { return }\n cm.curOp.focus = activeElt(doc(cm));\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n if (gecko && !mac && !handled && code == 46 && e.shiftKey && !e.ctrlKey && document.execCommand)\n { document.execCommand(\"cut\"); }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (e.target && e.target != cm.display.input.getField()) { return }\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n win(cm).focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(doc(cm)); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n if (cm.state.delayingBlurEvent) {\n if (cm.hasFocus()) { cm.state.delayingBlurEvent = false; }\n else { delayBlurEvent(cm); }\n }\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if ((webkit && !safari) || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus({preventScroll: true}); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { return display.input.focus(); }, 20);\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n if (ie) { delayBlurEvent(cm); }\n var display = cm.display, doc$1 = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc$1.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc$1.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc$1.sel.primary();\n ourIndex = doc$1.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend); }\n else\n { ourRange = range; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc$1, new Selection([ourRange], 0), sel_mouse);\n startSel = doc$1.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc$1, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc$1, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc$1.sel;\n } else {\n replaceOneSelection(doc$1, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc$1, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc$1, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc$1, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc$1, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc$1, anchor), head));\n setSelection(doc$1, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt(doc(cm));\n extendTo(cur);\n var visible = visibleLines(display, doc$1);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n // If e is null or undefined we interpret this as someone trying\n // to explicitly cancel the selection rather than the user\n // letting go of the mouse button.\n if (e) {\n e_preventDefault(e);\n display.input.focus();\n }\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc$1.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range) {\n var anchor = range.anchor;\n var head = range.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }\n var order = getOrder(anchorLine);\n if (!order) { return range }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e$1) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.display.gutterSpecs.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.display.gutterSpecs[i];\n signal(cm, type, cm, line, gutter.className, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b\\u200e\\u200f\\u2028\\u2029\\u202d\\u202e\\u2066\\u2067\\u2069\\ufeff\\ufff9-\\ufffc]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n updateGutters(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm, val) {\n cm.display.gutterSpecs = getGutters(val, cm.options.lineNumbers);\n updateGutters(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm, val) {\n cm.display.gutterSpecs = getGutters(cm.options.gutters, val);\n updateGutters(cm);\n }, true);\n option(\"firstLineNumber\", 1, updateGutters, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, updateGutters, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n\n option(\"screenReaderLabel\", null, function (cm, val) {\n val = (val === '') ? null : val;\n cm.display.input.screenReaderLabelChanged(val);\n });\n\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input, options);\n display.wrapper.CodeMirror = this;\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(function () {\n if (this$1.hasFocus() && !this$1.state.focused) { onFocus(this$1); }\n }, 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n on(d.input.getField(), \"contextmenu\", function (e) {\n if (!d.scroller.contains(e.target)) { onContextMenu(cm, e); }\n });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range = sel.ranges[i$1];\n var from = range.from(), to = range.to();\n if (range.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == textLines.join(\"\\n\"))\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput && cm.hasFocus())\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range = sel.ranges[i];\n if (range.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range.head.line)) { continue }\n var mode = cm.getModeAt(range.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range.head.line).text.slice(0, range.head.ch)))\n { indented = indentLine(cm, range.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", autocorrect ? \"on\" : \"off\");\n field.setAttribute(\"autocapitalize\", autocapitalize ? \"on\" : \"off\");\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){win(this).focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map));\n },\n removeKeyMap: function(map) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map || maps[i].name == map) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this.state.modeGen++;\n regChange(this);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range = ranges[i];\n if (!range.empty()) {\n var from = range.from(), to = range.to();\n var start = Math.max(end, from.line);\n end = Math.min(this.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this, j, how); }\n var newRanges = this.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range.head.line > end) {\n indentLine(this, range.head.line, how, true);\n end = range.head.line;\n if (i == this.doc.sel.primIndex) { ensureCursorVisible(this); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range = this.doc.sel.primary();\n if (start == null) { pos = range.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range.from() : range.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range) {\n if (this$1.display.shift || this$1.doc.extend || range.empty())\n { return findPosH(this$1.doc, range.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range.from() : range.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range) {\n var other = findPosH(doc, range.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range.head} : {from: range.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range) {\n if (collapse)\n { return dir < 0 ? range.from() : range.to() }\n var headPos = cursorCoords(this$1, range.head, \"div\");\n if (range.goalColumn != null) { headPos.left = range.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt(doc(this)) },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range, margin) {\n if (range == null) {\n range = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range == \"number\") {\n range = {from: Pos(range, 0), to: null};\n } else if (range.from == null) {\n range = {from: range, to: null};\n }\n if (!range.to) { range.to = range.from; }\n range.margin = margin || 0;\n\n if (range.from.line != null) {\n scrollToRange(this, range);\n } else {\n scrollToCoordsRange(this, range.from, range.to, range.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo = this.display.viewFrom;\n this.doc.iter(lineNo, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo, \"widget\"); break } } }\n ++lineNo;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this.display);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5 || this.options.lineWrapping)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n // Cancel the current text selection if any (#5821)\n if (this.state.selectingText) { this.state.selectingText(); }\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"codepoint\", \"char\", \"column\" (like char, but\n // doesn't cross line boundaries), \"word\" (across next word), or\n // \"group\" (to the start of next group of word or\n // non-word-non-whitespace chars). The visually param controls\n // whether, in right-to-left text, direction 1 means to move towards\n // the next index in the string, or towards the character to the right\n // of the current position. The resulting position will have a\n // hitSide=true property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n var lineDir = visually && doc.direction == \"rtl\" ? -dir : dir;\n function findNextLine() {\n var l = pos.line + lineDir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (unit == \"codepoint\") {\n var ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1));\n if (isNaN(ch)) {\n next = null;\n } else {\n var astral = dir > 0 ? ch >= 0xD800 && ch < 0xDC00 : ch >= 0xDC00 && ch < 0xDFFF;\n next = new Pos(pos.line, Math.max(0, Math.min(lineObj.text.length, pos.ch + dir * (astral ? 2 : 1))), -dir);\n }\n } else if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, lineDir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\" || unit == \"codepoint\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, win(cm).innerHeight || doc(cm).documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n div.contentEditable = true;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n function belongsToInput(e) {\n for (var t = e.target; t; t = t.parentNode) {\n if (t == div) { return true }\n if (/\\bCodeMirror-(?:line)?widget\\b/.test(t.className)) { break }\n }\n return false\n }\n\n on(div, \"paste\", function (e) {\n if (!belongsToInput(e) || signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (!belongsToInput(e) || signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n disableBrowserMagic(te);\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = activeElt(div.ownerDocument);\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.screenReaderLabelChanged = function (label) {\n // Label for screenreaders, accessibility\n if(label) {\n this.div.setAttribute('aria-label', label);\n } else {\n this.div.removeAttribute('aria-label');\n }\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = activeElt(this.div.ownerDocument) == this.div;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor() || activeElt(this.div.ownerDocument) != this.div)\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var this$1 = this;\n\n var input = this;\n if (this.selectionInEditor())\n { setTimeout(function () { return this$1.pollSelection(); }, 20); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.display.gutterSpecs.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range = found[0].find(0)))\n { addText(getBetween(cm.doc, range.from, range.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map.length; j += 3) {\n var curNode = map[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n this.resetting = false;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n var opts = this.cm.options;\n disableBrowserMagic(this.textarea, opts.spellcheck, opts.autocorrect, opts.autocapitalize);\n };\n\n TextareaInput.prototype.screenReaderLabelChanged = function (label) {\n // Label for screenreaders, accessibility\n if(label) {\n this.textarea.setAttribute('aria-label', label);\n } else {\n this.textarea.removeAttribute('aria-label');\n }\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing && typing) { return }\n var cm = this.cm;\n this.resetting = true;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n this.resetting = false;\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt(this.textarea.ownerDocument) != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || this.resetting || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = te.ownerDocument.defaultView.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { te.ownerDocument.defaultView.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n this.textarea.readOnly = !!val;\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt(textarea.ownerDocument);\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (!options.leaveSubmitMethodAlone && typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, …*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.65.12\";\n\n return CodeMirror;\n\n})));\n","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n// declare global: diff_match_patch, DIFF_INSERT, DIFF_DELETE, DIFF_EQUAL\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\")); // Note non-packaged dependency diff_match_patch\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"diff_match_patch\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n var Pos = CodeMirror.Pos;\n var svgNS = \"http://www.w3.org/2000/svg\";\n\n function DiffView(mv, type) {\n this.mv = mv;\n this.type = type;\n this.classes = type == \"left\"\n ? {chunk: \"CodeMirror-merge-l-chunk\",\n start: \"CodeMirror-merge-l-chunk-start\",\n end: \"CodeMirror-merge-l-chunk-end\",\n insert: \"CodeMirror-merge-l-inserted\",\n del: \"CodeMirror-merge-l-deleted\",\n connect: \"CodeMirror-merge-l-connect\"}\n : {chunk: \"CodeMirror-merge-r-chunk\",\n start: \"CodeMirror-merge-r-chunk-start\",\n end: \"CodeMirror-merge-r-chunk-end\",\n insert: \"CodeMirror-merge-r-inserted\",\n del: \"CodeMirror-merge-r-deleted\",\n connect: \"CodeMirror-merge-r-connect\"};\n }\n\n DiffView.prototype = {\n constructor: DiffView,\n init: function(pane, orig, options) {\n this.edit = this.mv.edit;\n ;(this.edit.state.diffViews || (this.edit.state.diffViews = [])).push(this);\n this.orig = CodeMirror(pane, copyObj({value: orig, readOnly: !this.mv.options.allowEditingOriginals}, copyObj(options)));\n if (this.mv.options.connect == \"align\") {\n if (!this.edit.state.trackAlignable) this.edit.state.trackAlignable = new TrackAlignable(this.edit)\n this.orig.state.trackAlignable = new TrackAlignable(this.orig)\n }\n this.lockButton.title = this.edit.phrase(\"Toggle locked scrolling\");\n this.lockButton.setAttribute(\"aria-label\", this.lockButton.title);\n\n this.orig.state.diffViews = [this];\n var classLocation = options.chunkClassLocation || \"background\";\n if (Object.prototype.toString.call(classLocation) != \"[object Array]\") classLocation = [classLocation]\n this.classes.classLocation = classLocation\n\n this.diff = getDiff(asString(orig), asString(options.value), this.mv.options.ignoreWhitespace);\n this.chunks = getChunks(this.diff);\n this.diffOutOfDate = this.dealigned = false;\n this.needsScrollSync = null\n\n this.showDifferences = options.showDifferences !== false;\n },\n registerEvents: function(otherDv) {\n this.forceUpdate = registerUpdate(this);\n setScrollLock(this, true, false);\n registerScroll(this, otherDv);\n },\n setShowDifferences: function(val) {\n val = val !== false;\n if (val != this.showDifferences) {\n this.showDifferences = val;\n this.forceUpdate(\"full\");\n }\n }\n };\n\n function ensureDiff(dv) {\n if (dv.diffOutOfDate) {\n dv.diff = getDiff(dv.orig.getValue(), dv.edit.getValue(), dv.mv.options.ignoreWhitespace);\n dv.chunks = getChunks(dv.diff);\n dv.diffOutOfDate = false;\n CodeMirror.signal(dv.edit, \"updateDiff\", dv.diff);\n }\n }\n\n var updating = false;\n function registerUpdate(dv) {\n var edit = {from: 0, to: 0, marked: []};\n var orig = {from: 0, to: 0, marked: []};\n var debounceChange, updatingFast = false;\n function update(mode) {\n updating = true;\n updatingFast = false;\n if (mode == \"full\") {\n if (dv.svg) clear(dv.svg);\n if (dv.copyButtons) clear(dv.copyButtons);\n clearMarks(dv.edit, edit.marked, dv.classes);\n clearMarks(dv.orig, orig.marked, dv.classes);\n edit.from = edit.to = orig.from = orig.to = 0;\n }\n ensureDiff(dv);\n if (dv.showDifferences) {\n updateMarks(dv.edit, dv.diff, edit, DIFF_INSERT, dv.classes);\n updateMarks(dv.orig, dv.diff, orig, DIFF_DELETE, dv.classes);\n }\n\n if (dv.mv.options.connect == \"align\")\n alignChunks(dv);\n makeConnections(dv);\n if (dv.needsScrollSync != null) syncScroll(dv, dv.needsScrollSync)\n\n updating = false;\n }\n function setDealign(fast) {\n if (updating) return;\n dv.dealigned = true;\n set(fast);\n }\n function set(fast) {\n if (updating || updatingFast) return;\n clearTimeout(debounceChange);\n if (fast === true) updatingFast = true;\n debounceChange = setTimeout(update, fast === true ? 20 : 250);\n }\n function change(_cm, change) {\n if (!dv.diffOutOfDate) {\n dv.diffOutOfDate = true;\n edit.from = edit.to = orig.from = orig.to = 0;\n }\n // Update faster when a line was added/removed\n setDealign(change.text.length - 1 != change.to.line - change.from.line);\n }\n function swapDoc() {\n dv.diffOutOfDate = true;\n dv.dealigned = true;\n update(\"full\");\n }\n dv.edit.on(\"change\", change);\n dv.orig.on(\"change\", change);\n dv.edit.on(\"swapDoc\", swapDoc);\n dv.orig.on(\"swapDoc\", swapDoc);\n if (dv.mv.options.connect == \"align\") {\n CodeMirror.on(dv.edit.state.trackAlignable, \"realign\", setDealign)\n CodeMirror.on(dv.orig.state.trackAlignable, \"realign\", setDealign)\n }\n dv.edit.on(\"viewportChange\", function() { set(false); });\n dv.orig.on(\"viewportChange\", function() { set(false); });\n update();\n return update;\n }\n\n function registerScroll(dv, otherDv) {\n dv.edit.on(\"scroll\", function() {\n syncScroll(dv, true) && makeConnections(dv);\n });\n dv.orig.on(\"scroll\", function() {\n syncScroll(dv, false) && makeConnections(dv);\n if (otherDv) syncScroll(otherDv, true) && makeConnections(otherDv);\n });\n }\n\n function syncScroll(dv, toOrig) {\n // Change handler will do a refresh after a timeout when diff is out of date\n if (dv.diffOutOfDate) {\n if (dv.lockScroll && dv.needsScrollSync == null) dv.needsScrollSync = toOrig\n return false\n }\n dv.needsScrollSync = null\n if (!dv.lockScroll) return true;\n var editor, other, now = +new Date;\n if (toOrig) { editor = dv.edit; other = dv.orig; }\n else { editor = dv.orig; other = dv.edit; }\n // Don't take action if the position of this editor was recently set\n // (to prevent feedback loops)\n if (editor.state.scrollSetBy == dv && (editor.state.scrollSetAt || 0) + 250 > now) return false;\n\n var sInfo = editor.getScrollInfo();\n if (dv.mv.options.connect == \"align\") {\n targetPos = sInfo.top;\n } else {\n var halfScreen = .5 * sInfo.clientHeight, midY = sInfo.top + halfScreen;\n var mid = editor.lineAtHeight(midY, \"local\");\n var around = chunkBoundariesAround(dv.chunks, mid, toOrig);\n var off = getOffsets(editor, toOrig ? around.edit : around.orig);\n var offOther = getOffsets(other, toOrig ? around.orig : around.edit);\n var ratio = (midY - off.top) / (off.bot - off.top);\n var targetPos = (offOther.top - halfScreen) + ratio * (offOther.bot - offOther.top);\n\n var botDist, mix;\n // Some careful tweaking to make sure no space is left out of view\n // when scrolling to top or bottom.\n if (targetPos > sInfo.top && (mix = sInfo.top / halfScreen) < 1) {\n targetPos = targetPos * mix + sInfo.top * (1 - mix);\n } else if ((botDist = sInfo.height - sInfo.clientHeight - sInfo.top) < halfScreen) {\n var otherInfo = other.getScrollInfo();\n var botDistOther = otherInfo.height - otherInfo.clientHeight - targetPos;\n if (botDistOther > botDist && (mix = botDist / halfScreen) < 1)\n targetPos = targetPos * mix + (otherInfo.height - otherInfo.clientHeight - botDist) * (1 - mix);\n }\n }\n\n other.scrollTo(sInfo.left, targetPos);\n other.state.scrollSetAt = now;\n other.state.scrollSetBy = dv;\n return true;\n }\n\n function getOffsets(editor, around) {\n var bot = around.after;\n if (bot == null) bot = editor.lastLine() + 1;\n return {top: editor.heightAtLine(around.before || 0, \"local\"),\n bot: editor.heightAtLine(bot, \"local\")};\n }\n\n function setScrollLock(dv, val, action) {\n dv.lockScroll = val;\n if (val && action != false) syncScroll(dv, DIFF_INSERT) && makeConnections(dv);\n (val ? CodeMirror.addClass : CodeMirror.rmClass)(dv.lockButton, \"CodeMirror-merge-scrolllock-enabled\");\n }\n\n // Updating the marks for editor content\n\n function removeClass(editor, line, classes) {\n var locs = classes.classLocation\n for (var i = 0; i < locs.length; i++) {\n editor.removeLineClass(line, locs[i], classes.chunk);\n editor.removeLineClass(line, locs[i], classes.start);\n editor.removeLineClass(line, locs[i], classes.end);\n }\n }\n\n function clearMarks(editor, arr, classes) {\n for (var i = 0; i < arr.length; ++i) {\n var mark = arr[i];\n if (mark instanceof CodeMirror.TextMarker)\n mark.clear();\n else if (mark.parent)\n removeClass(editor, mark, classes);\n }\n arr.length = 0;\n }\n\n // FIXME maybe add a margin around viewport to prevent too many updates\n function updateMarks(editor, diff, state, type, classes) {\n var vp = editor.getViewport();\n editor.operation(function() {\n if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) {\n clearMarks(editor, state.marked, classes);\n markChanges(editor, diff, type, state.marked, vp.from, vp.to, classes);\n state.from = vp.from; state.to = vp.to;\n } else {\n if (vp.from < state.from) {\n markChanges(editor, diff, type, state.marked, vp.from, state.from, classes);\n state.from = vp.from;\n }\n if (vp.to > state.to) {\n markChanges(editor, diff, type, state.marked, state.to, vp.to, classes);\n state.to = vp.to;\n }\n }\n });\n }\n\n function addClass(editor, lineNr, classes, main, start, end) {\n var locs = classes.classLocation, line = editor.getLineHandle(lineNr);\n for (var i = 0; i < locs.length; i++) {\n if (main) editor.addLineClass(line, locs[i], classes.chunk);\n if (start) editor.addLineClass(line, locs[i], classes.start);\n if (end) editor.addLineClass(line, locs[i], classes.end);\n }\n return line;\n }\n\n function markChanges(editor, diff, type, marks, from, to, classes) {\n var pos = Pos(0, 0);\n var top = Pos(from, 0), bot = editor.clipPos(Pos(to - 1));\n var cls = type == DIFF_DELETE ? classes.del : classes.insert;\n function markChunk(start, end) {\n var bfrom = Math.max(from, start), bto = Math.min(to, end);\n for (var i = bfrom; i < bto; ++i)\n marks.push(addClass(editor, i, classes, true, i == start, i == end - 1));\n // When the chunk is empty, make sure a horizontal line shows up\n if (start == end && bfrom == end && bto == end) {\n if (bfrom)\n marks.push(addClass(editor, bfrom - 1, classes, false, false, true));\n else\n marks.push(addClass(editor, bfrom, classes, false, true, false));\n }\n }\n\n var chunkStart = 0, pending = false;\n for (var i = 0; i < diff.length; ++i) {\n var part = diff[i], tp = part[0], str = part[1];\n if (tp == DIFF_EQUAL) {\n var cleanFrom = pos.line + (startOfLineClean(diff, i) ? 0 : 1);\n moveOver(pos, str);\n var cleanTo = pos.line + (endOfLineClean(diff, i) ? 1 : 0);\n if (cleanTo > cleanFrom) {\n if (pending) { markChunk(chunkStart, cleanFrom); pending = false }\n chunkStart = cleanTo;\n }\n } else {\n pending = true\n if (tp == type) {\n var end = moveOver(pos, str, true);\n var a = posMax(top, pos), b = posMin(bot, end);\n if (!posEq(a, b))\n marks.push(editor.markText(a, b, {className: cls}));\n pos = end;\n }\n }\n }\n if (pending) markChunk(chunkStart, pos.line + 1);\n }\n\n // Updating the gap between editor and original\n\n function makeConnections(dv) {\n if (!dv.showDifferences) return;\n\n if (dv.svg) {\n clear(dv.svg);\n var w = dv.gap.offsetWidth;\n attrs(dv.svg, \"width\", w, \"height\", dv.gap.offsetHeight);\n }\n if (dv.copyButtons) clear(dv.copyButtons);\n\n var vpEdit = dv.edit.getViewport(), vpOrig = dv.orig.getViewport();\n var outerTop = dv.mv.wrap.getBoundingClientRect().top\n var sTopEdit = outerTop - dv.edit.getScrollerElement().getBoundingClientRect().top + dv.edit.getScrollInfo().top\n var sTopOrig = outerTop - dv.orig.getScrollerElement().getBoundingClientRect().top + dv.orig.getScrollInfo().top;\n for (var i = 0; i < dv.chunks.length; i++) {\n var ch = dv.chunks[i];\n if (ch.editFrom <= vpEdit.to && ch.editTo >= vpEdit.from &&\n ch.origFrom <= vpOrig.to && ch.origTo >= vpOrig.from)\n drawConnectorsForChunk(dv, ch, sTopOrig, sTopEdit, w);\n }\n }\n\n function getMatchingOrigLine(editLine, chunks) {\n var editStart = 0, origStart = 0;\n for (var i = 0; i < chunks.length; i++) {\n var chunk = chunks[i];\n if (chunk.editTo > editLine && chunk.editFrom <= editLine) return null;\n if (chunk.editFrom > editLine) break;\n editStart = chunk.editTo;\n origStart = chunk.origTo;\n }\n return origStart + (editLine - editStart);\n }\n\n // Combines information about chunks and widgets/markers to return\n // an array of lines, in a single editor, that probably need to be\n // aligned with their counterparts in the editor next to it.\n function alignableFor(cm, chunks, isOrig) {\n var tracker = cm.state.trackAlignable\n var start = cm.firstLine(), trackI = 0\n var result = []\n for (var i = 0;; i++) {\n var chunk = chunks[i]\n var chunkStart = !chunk ? 1e9 : isOrig ? chunk.origFrom : chunk.editFrom\n for (; trackI < tracker.alignable.length; trackI += 2) {\n var n = tracker.alignable[trackI] + 1\n if (n <= start) continue\n if (n <= chunkStart) result.push(n)\n else break\n }\n if (!chunk) break\n result.push(start = isOrig ? chunk.origTo : chunk.editTo)\n }\n return result\n }\n\n // Given information about alignable lines in two editors, fill in\n // the result (an array of three-element arrays) to reflect the\n // lines that need to be aligned with each other.\n function mergeAlignable(result, origAlignable, chunks, setIndex) {\n var rI = 0, origI = 0, chunkI = 0, diff = 0\n outer: for (;; rI++) {\n var nextR = result[rI], nextO = origAlignable[origI]\n if (!nextR && nextO == null) break\n\n var rLine = nextR ? nextR[0] : 1e9, oLine = nextO == null ? 1e9 : nextO\n while (chunkI < chunks.length) {\n var chunk = chunks[chunkI]\n if (chunk.origFrom <= oLine && chunk.origTo > oLine) {\n origI++\n rI--\n continue outer;\n }\n if (chunk.editTo > rLine) {\n if (chunk.editFrom <= rLine) continue outer;\n break\n }\n diff += (chunk.origTo - chunk.origFrom) - (chunk.editTo - chunk.editFrom)\n chunkI++\n }\n if (rLine == oLine - diff) {\n nextR[setIndex] = oLine\n origI++\n } else if (rLine < oLine - diff) {\n nextR[setIndex] = rLine + diff\n } else {\n var record = [oLine - diff, null, null]\n record[setIndex] = oLine\n result.splice(rI, 0, record)\n origI++\n }\n }\n }\n\n function findAlignedLines(dv, other) {\n var alignable = alignableFor(dv.edit, dv.chunks, false), result = []\n if (other) for (var i = 0, j = 0; i < other.chunks.length; i++) {\n var n = other.chunks[i].editTo\n while (j < alignable.length && alignable[j] < n) j++\n if (j == alignable.length || alignable[j] != n) alignable.splice(j++, 0, n)\n }\n for (var i = 0; i < alignable.length; i++)\n result.push([alignable[i], null, null])\n\n mergeAlignable(result, alignableFor(dv.orig, dv.chunks, true), dv.chunks, 1)\n if (other)\n mergeAlignable(result, alignableFor(other.orig, other.chunks, true), other.chunks, 2)\n\n return result\n }\n\n function alignChunks(dv, force) {\n if (!dv.dealigned && !force) return;\n if (!dv.orig.curOp) return dv.orig.operation(function() {\n alignChunks(dv, force);\n });\n\n dv.dealigned = false;\n var other = dv.mv.left == dv ? dv.mv.right : dv.mv.left;\n if (other) {\n ensureDiff(other);\n other.dealigned = false;\n }\n var linesToAlign = findAlignedLines(dv, other);\n\n // Clear old aligners\n var aligners = dv.mv.aligners;\n for (var i = 0; i < aligners.length; i++)\n aligners[i].clear();\n aligners.length = 0;\n\n var cm = [dv.edit, dv.orig], scroll = [], offset = []\n if (other) cm.push(other.orig);\n for (var i = 0; i < cm.length; i++) {\n scroll.push(cm[i].getScrollInfo().top);\n offset.push(-cm[i].getScrollerElement().getBoundingClientRect().top)\n }\n\n if (offset[0] != offset[1] || cm.length == 3 && offset[1] != offset[2])\n alignLines(cm, offset, [0, 0, 0], aligners)\n for (var ln = 0; ln < linesToAlign.length; ln++)\n alignLines(cm, offset, linesToAlign[ln], aligners);\n\n for (var i = 0; i < cm.length; i++)\n cm[i].scrollTo(null, scroll[i]);\n }\n\n function alignLines(cm, cmOffset, lines, aligners) {\n var maxOffset = -1e8, offset = [];\n for (var i = 0; i < cm.length; i++) if (lines[i] != null) {\n var off = cm[i].heightAtLine(lines[i], \"local\") - cmOffset[i];\n offset[i] = off;\n maxOffset = Math.max(maxOffset, off);\n }\n for (var i = 0; i < cm.length; i++) if (lines[i] != null) {\n var diff = maxOffset - offset[i];\n if (diff > 1)\n aligners.push(padAbove(cm[i], lines[i], diff));\n }\n }\n\n function padAbove(cm, line, size) {\n var above = true;\n if (line > cm.lastLine()) {\n line--;\n above = false;\n }\n var elt = document.createElement(\"div\");\n elt.className = \"CodeMirror-merge-spacer\";\n elt.style.height = size + \"px\"; elt.style.minWidth = \"1px\";\n return cm.addLineWidget(line, elt, {height: size, above: above, mergeSpacer: true, handleMouseEvents: true});\n }\n\n function drawConnectorsForChunk(dv, chunk, sTopOrig, sTopEdit, w) {\n var flip = dv.type == \"left\";\n var top = dv.orig.heightAtLine(chunk.origFrom, \"local\", true) - sTopOrig;\n if (dv.svg) {\n var topLpx = top;\n var topRpx = dv.edit.heightAtLine(chunk.editFrom, \"local\", true) - sTopEdit;\n if (flip) { var tmp = topLpx; topLpx = topRpx; topRpx = tmp; }\n var botLpx = dv.orig.heightAtLine(chunk.origTo, \"local\", true) - sTopOrig;\n var botRpx = dv.edit.heightAtLine(chunk.editTo, \"local\", true) - sTopEdit;\n if (flip) { var tmp = botLpx; botLpx = botRpx; botRpx = tmp; }\n var curveTop = \" C \" + w/2 + \" \" + topRpx + \" \" + w/2 + \" \" + topLpx + \" \" + (w + 2) + \" \" + topLpx;\n var curveBot = \" C \" + w/2 + \" \" + botLpx + \" \" + w/2 + \" \" + botRpx + \" -1 \" + botRpx;\n attrs(dv.svg.appendChild(document.createElementNS(svgNS, \"path\")),\n \"d\", \"M -1 \" + topRpx + curveTop + \" L \" + (w + 2) + \" \" + botLpx + curveBot + \" z\",\n \"class\", dv.classes.connect);\n }\n if (dv.copyButtons) {\n var copy = dv.copyButtons.appendChild(elt(\"div\", dv.type == \"left\" ? \"\\u21dd\" : \"\\u21dc\",\n \"CodeMirror-merge-copy\"));\n var editOriginals = dv.mv.options.allowEditingOriginals;\n copy.title = dv.edit.phrase(editOriginals ? \"Push to left\" : \"Revert chunk\");\n copy.chunk = chunk;\n copy.style.top = (chunk.origTo > chunk.origFrom ? top : dv.edit.heightAtLine(chunk.editFrom, \"local\") - sTopEdit) + \"px\";\n copy.setAttribute(\"role\", \"button\");\n copy.setAttribute(\"tabindex\", \"0\");\n copy.setAttribute(\"aria-label\", copy.title);\n\n if (editOriginals) {\n var topReverse = dv.edit.heightAtLine(chunk.editFrom, \"local\") - sTopEdit;\n var copyReverse = dv.copyButtons.appendChild(elt(\"div\", dv.type == \"right\" ? \"\\u21dd\" : \"\\u21dc\",\n \"CodeMirror-merge-copy-reverse\"));\n copyReverse.title = \"Push to right\";\n copyReverse.chunk = {editFrom: chunk.origFrom, editTo: chunk.origTo,\n origFrom: chunk.editFrom, origTo: chunk.editTo};\n copyReverse.style.top = topReverse + \"px\";\n dv.type == \"right\" ? copyReverse.style.left = \"2px\" : copyReverse.style.right = \"2px\";\n copyReverse.setAttribute(\"role\", \"button\");\n copyReverse.setAttribute(\"tabindex\", \"0\");\n copyReverse.setAttribute(\"aria-label\", copyReverse.title);\n }\n }\n }\n\n function copyChunk(dv, to, from, chunk) {\n if (dv.diffOutOfDate) return;\n var origStart = chunk.origTo > from.lastLine() ? Pos(chunk.origFrom - 1) : Pos(chunk.origFrom, 0)\n var origEnd = Pos(chunk.origTo, 0)\n var editStart = chunk.editTo > to.lastLine() ? Pos(chunk.editFrom - 1) : Pos(chunk.editFrom, 0)\n var editEnd = Pos(chunk.editTo, 0)\n var handler = dv.mv.options.revertChunk\n if (handler)\n handler(dv.mv, from, origStart, origEnd, to, editStart, editEnd)\n else\n to.replaceRange(from.getRange(origStart, origEnd), editStart, editEnd)\n }\n\n // Merge view, containing 0, 1, or 2 diff views.\n\n var MergeView = CodeMirror.MergeView = function(node, options) {\n if (!(this instanceof MergeView)) return new MergeView(node, options);\n\n this.options = options;\n var origLeft = options.origLeft, origRight = options.origRight == null ? options.orig : options.origRight;\n\n var hasLeft = origLeft != null, hasRight = origRight != null;\n var panes = 1 + (hasLeft ? 1 : 0) + (hasRight ? 1 : 0);\n var wrap = [], left = this.left = null, right = this.right = null;\n var self = this;\n\n if (hasLeft) {\n left = this.left = new DiffView(this, \"left\");\n var leftPane = elt(\"div\", null, \"CodeMirror-merge-pane CodeMirror-merge-left\");\n wrap.push(leftPane);\n wrap.push(buildGap(left));\n }\n\n var editPane = elt(\"div\", null, \"CodeMirror-merge-pane CodeMirror-merge-editor\");\n wrap.push(editPane);\n\n if (hasRight) {\n right = this.right = new DiffView(this, \"right\");\n wrap.push(buildGap(right));\n var rightPane = elt(\"div\", null, \"CodeMirror-merge-pane CodeMirror-merge-right\");\n wrap.push(rightPane);\n }\n\n (hasRight ? rightPane : editPane).className += \" CodeMirror-merge-pane-rightmost\";\n\n wrap.push(elt(\"div\", null, null, \"height: 0; clear: both;\"));\n\n var wrapElt = this.wrap = node.appendChild(elt(\"div\", wrap, \"CodeMirror-merge CodeMirror-merge-\" + panes + \"pane\"));\n this.edit = CodeMirror(editPane, copyObj(options));\n\n if (left) left.init(leftPane, origLeft, options);\n if (right) right.init(rightPane, origRight, options);\n if (options.collapseIdentical)\n this.editor().operation(function() {\n collapseIdenticalStretches(self, options.collapseIdentical);\n });\n if (options.connect == \"align\") {\n this.aligners = [];\n alignChunks(this.left || this.right, true);\n }\n if (left) left.registerEvents(right)\n if (right) right.registerEvents(left)\n\n\n var onResize = function() {\n if (left) makeConnections(left);\n if (right) makeConnections(right);\n };\n CodeMirror.on(window, \"resize\", onResize);\n var resizeInterval = setInterval(function() {\n for (var p = wrapElt.parentNode; p && p != document.body; p = p.parentNode) {}\n if (!p) { clearInterval(resizeInterval); CodeMirror.off(window, \"resize\", onResize); }\n }, 5000);\n };\n\n function buildGap(dv) {\n var lock = dv.lockButton = elt(\"div\", null, \"CodeMirror-merge-scrolllock\");\n lock.setAttribute(\"role\", \"button\");\n lock.setAttribute(\"tabindex\", \"0\");\n var lockWrap = elt(\"div\", [lock], \"CodeMirror-merge-scrolllock-wrap\");\n CodeMirror.on(lock, \"click\", function() { setScrollLock(dv, !dv.lockScroll); });\n CodeMirror.on(lock, \"keyup\", function(e) { (e.key === \"Enter\" || e.code === \"Space\") && setScrollLock(dv, !dv.lockScroll); });\n var gapElts = [lockWrap];\n if (dv.mv.options.revertButtons !== false) {\n dv.copyButtons = elt(\"div\", null, \"CodeMirror-merge-copybuttons-\" + dv.type);\n var copyButtons = function(e) {\n var node = e.target || e.srcElement;\n if (!node.chunk) return;\n if (node.className == \"CodeMirror-merge-copy-reverse\") {\n copyChunk(dv, dv.orig, dv.edit, node.chunk);\n return;\n }\n copyChunk(dv, dv.edit, dv.orig, node.chunk);\n }\n CodeMirror.on(dv.copyButtons, \"click\", copyButtons);\n CodeMirror.on(dv.copyButtons, \"keyup\", function(e) { (e.key === \"Enter\" || e.code === \"Space\") && copyButtons(e); });\n gapElts.unshift(dv.copyButtons);\n }\n if (dv.mv.options.connect != \"align\") {\n var svg = document.createElementNS && document.createElementNS(svgNS, \"svg\");\n if (svg && !svg.createSVGRect) svg = null;\n dv.svg = svg;\n if (svg) gapElts.push(svg);\n }\n\n return dv.gap = elt(\"div\", gapElts, \"CodeMirror-merge-gap\");\n }\n\n MergeView.prototype = {\n constructor: MergeView,\n editor: function() { return this.edit; },\n rightOriginal: function() { return this.right && this.right.orig; },\n leftOriginal: function() { return this.left && this.left.orig; },\n setShowDifferences: function(val) {\n if (this.right) this.right.setShowDifferences(val);\n if (this.left) this.left.setShowDifferences(val);\n },\n rightChunks: function() {\n if (this.right) { ensureDiff(this.right); return this.right.chunks; }\n },\n leftChunks: function() {\n if (this.left) { ensureDiff(this.left); return this.left.chunks; }\n }\n };\n\n function asString(obj) {\n if (typeof obj == \"string\") return obj;\n else return obj.getValue();\n }\n\n // Operations on diffs\n var dmp;\n function getDiff(a, b, ignoreWhitespace) {\n if (!dmp) dmp = new diff_match_patch();\n\n var diff = dmp.diff_main(a, b);\n // The library sometimes leaves in empty parts, which confuse the algorithm\n for (var i = 0; i < diff.length; ++i) {\n var part = diff[i];\n if (ignoreWhitespace ? !/[^ \\t]/.test(part[1]) : !part[1]) {\n diff.splice(i--, 1);\n } else if (i && diff[i - 1][0] == part[0]) {\n diff.splice(i--, 1);\n diff[i][1] += part[1];\n }\n }\n return diff;\n }\n\n function getChunks(diff) {\n var chunks = [];\n if (!diff.length) return chunks;\n var startEdit = 0, startOrig = 0;\n var edit = Pos(0, 0), orig = Pos(0, 0);\n for (var i = 0; i < diff.length; ++i) {\n var part = diff[i], tp = part[0];\n if (tp == DIFF_EQUAL) {\n var startOff = !startOfLineClean(diff, i) || edit.line < startEdit || orig.line < startOrig ? 1 : 0;\n var cleanFromEdit = edit.line + startOff, cleanFromOrig = orig.line + startOff;\n moveOver(edit, part[1], null, orig);\n var endOff = endOfLineClean(diff, i) ? 1 : 0;\n var cleanToEdit = edit.line + endOff, cleanToOrig = orig.line + endOff;\n if (cleanToEdit > cleanFromEdit) {\n if (i) chunks.push({origFrom: startOrig, origTo: cleanFromOrig,\n editFrom: startEdit, editTo: cleanFromEdit});\n startEdit = cleanToEdit; startOrig = cleanToOrig;\n }\n } else {\n moveOver(tp == DIFF_INSERT ? edit : orig, part[1]);\n }\n }\n if (startEdit <= edit.line || startOrig <= orig.line)\n chunks.push({origFrom: startOrig, origTo: orig.line + 1,\n editFrom: startEdit, editTo: edit.line + 1});\n return chunks;\n }\n\n function endOfLineClean(diff, i) {\n if (i == diff.length - 1) return true;\n var next = diff[i + 1][1];\n if ((next.length == 1 && i < diff.length - 2) || next.charCodeAt(0) != 10) return false;\n if (i == diff.length - 2) return true;\n next = diff[i + 2][1];\n return (next.length > 1 || i == diff.length - 3) && next.charCodeAt(0) == 10;\n }\n\n function startOfLineClean(diff, i) {\n if (i == 0) return true;\n var last = diff[i - 1][1];\n if (last.charCodeAt(last.length - 1) != 10) return false;\n if (i == 1) return true;\n last = diff[i - 2][1];\n return last.charCodeAt(last.length - 1) == 10;\n }\n\n function chunkBoundariesAround(chunks, n, nInEdit) {\n var beforeE, afterE, beforeO, afterO;\n for (var i = 0; i < chunks.length; i++) {\n var chunk = chunks[i];\n var fromLocal = nInEdit ? chunk.editFrom : chunk.origFrom;\n var toLocal = nInEdit ? chunk.editTo : chunk.origTo;\n if (afterE == null) {\n if (fromLocal > n) { afterE = chunk.editFrom; afterO = chunk.origFrom; }\n else if (toLocal > n) { afterE = chunk.editTo; afterO = chunk.origTo; }\n }\n if (toLocal <= n) { beforeE = chunk.editTo; beforeO = chunk.origTo; }\n else if (fromLocal <= n) { beforeE = chunk.editFrom; beforeO = chunk.origFrom; }\n }\n return {edit: {before: beforeE, after: afterE}, orig: {before: beforeO, after: afterO}};\n }\n\n function collapseSingle(cm, from, to) {\n cm.addLineClass(from, \"wrap\", \"CodeMirror-merge-collapsed-line\");\n var widget = document.createElement(\"span\");\n widget.className = \"CodeMirror-merge-collapsed-widget\";\n widget.title = cm.phrase(\"Identical text collapsed. Click to expand.\");\n var mark = cm.markText(Pos(from, 0), Pos(to - 1), {\n inclusiveLeft: true,\n inclusiveRight: true,\n replacedWith: widget,\n clearOnEnter: true\n });\n function clear() {\n mark.clear();\n cm.removeLineClass(from, \"wrap\", \"CodeMirror-merge-collapsed-line\");\n }\n if (mark.explicitlyCleared) clear();\n CodeMirror.on(widget, \"click\", clear);\n mark.on(\"clear\", clear);\n CodeMirror.on(widget, \"click\", clear);\n return {mark: mark, clear: clear};\n }\n\n function collapseStretch(size, editors) {\n var marks = [];\n function clear() {\n for (var i = 0; i < marks.length; i++) marks[i].clear();\n }\n for (var i = 0; i < editors.length; i++) {\n var editor = editors[i];\n var mark = collapseSingle(editor.cm, editor.line, editor.line + size);\n marks.push(mark);\n mark.mark.on(\"clear\", clear);\n }\n return marks[0].mark;\n }\n\n function unclearNearChunks(dv, margin, off, clear) {\n for (var i = 0; i < dv.chunks.length; i++) {\n var chunk = dv.chunks[i];\n for (var l = chunk.editFrom - margin; l < chunk.editTo + margin; l++) {\n var pos = l + off;\n if (pos >= 0 && pos < clear.length) clear[pos] = false;\n }\n }\n }\n\n function collapseIdenticalStretches(mv, margin) {\n if (typeof margin != \"number\") margin = 2;\n var clear = [], edit = mv.editor(), off = edit.firstLine();\n for (var l = off, e = edit.lastLine(); l <= e; l++) clear.push(true);\n if (mv.left) unclearNearChunks(mv.left, margin, off, clear);\n if (mv.right) unclearNearChunks(mv.right, margin, off, clear);\n\n for (var i = 0; i < clear.length; i++) {\n if (clear[i]) {\n var line = i + off;\n for (var size = 1; i < clear.length - 1 && clear[i + 1]; i++, size++) {}\n if (size > margin) {\n var editors = [{line: line, cm: edit}];\n if (mv.left) editors.push({line: getMatchingOrigLine(line, mv.left.chunks), cm: mv.left.orig});\n if (mv.right) editors.push({line: getMatchingOrigLine(line, mv.right.chunks), cm: mv.right.orig});\n var mark = collapseStretch(size, editors);\n if (mv.options.onCollapse) mv.options.onCollapse(mv, line, size, mark);\n }\n }\n }\n }\n\n // General utilities\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) e.className = className;\n if (style) e.style.cssText = style;\n if (typeof content == \"string\") e.appendChild(document.createTextNode(content));\n else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]);\n return e;\n }\n\n function clear(node) {\n for (var count = node.childNodes.length; count > 0; --count)\n node.removeChild(node.firstChild);\n }\n\n function attrs(elt) {\n for (var i = 1; i < arguments.length; i += 2)\n elt.setAttribute(arguments[i], arguments[i+1]);\n }\n\n function copyObj(obj, target) {\n if (!target) target = {};\n for (var prop in obj) if (obj.hasOwnProperty(prop)) target[prop] = obj[prop];\n return target;\n }\n\n function moveOver(pos, str, copy, other) {\n var out = copy ? Pos(pos.line, pos.ch) : pos, at = 0;\n for (;;) {\n var nl = str.indexOf(\"\\n\", at);\n if (nl == -1) break;\n ++out.line;\n if (other) ++other.line;\n at = nl + 1;\n }\n out.ch = (at ? 0 : out.ch) + (str.length - at);\n if (other) other.ch = (at ? 0 : other.ch) + (str.length - at);\n return out;\n }\n\n // Tracks collapsed markers and line widgets, in order to be able to\n // accurately align the content of two editors.\n\n var F_WIDGET = 1, F_WIDGET_BELOW = 2, F_MARKER = 4\n\n function TrackAlignable(cm) {\n this.cm = cm\n this.alignable = []\n this.height = cm.doc.height\n var self = this\n cm.on(\"markerAdded\", function(_, marker) {\n if (!marker.collapsed) return\n var found = marker.find(1)\n if (found != null) self.set(found.line, F_MARKER)\n })\n cm.on(\"markerCleared\", function(_, marker, _min, max) {\n if (max != null && marker.collapsed)\n self.check(max, F_MARKER, self.hasMarker)\n })\n cm.on(\"markerChanged\", this.signal.bind(this))\n cm.on(\"lineWidgetAdded\", function(_, widget, lineNo) {\n if (widget.mergeSpacer) return\n if (widget.above) self.set(lineNo - 1, F_WIDGET_BELOW)\n else self.set(lineNo, F_WIDGET)\n })\n cm.on(\"lineWidgetCleared\", function(_, widget, lineNo) {\n if (widget.mergeSpacer) return\n if (widget.above) self.check(lineNo - 1, F_WIDGET_BELOW, self.hasWidgetBelow)\n else self.check(lineNo, F_WIDGET, self.hasWidget)\n })\n cm.on(\"lineWidgetChanged\", this.signal.bind(this))\n cm.on(\"change\", function(_, change) {\n var start = change.from.line, nBefore = change.to.line - change.from.line\n var nAfter = change.text.length - 1, end = start + nAfter\n if (nBefore || nAfter) self.map(start, nBefore, nAfter)\n self.check(end, F_MARKER, self.hasMarker)\n if (nBefore || nAfter) self.check(change.from.line, F_MARKER, self.hasMarker)\n })\n cm.on(\"viewportChange\", function() {\n if (self.cm.doc.height != self.height) self.signal()\n })\n }\n\n TrackAlignable.prototype = {\n signal: function() {\n CodeMirror.signal(this, \"realign\")\n this.height = this.cm.doc.height\n },\n\n set: function(n, flags) {\n var pos = -1\n for (; pos < this.alignable.length; pos += 2) {\n var diff = this.alignable[pos] - n\n if (diff == 0) {\n if ((this.alignable[pos + 1] & flags) == flags) return\n this.alignable[pos + 1] |= flags\n this.signal()\n return\n }\n if (diff > 0) break\n }\n this.signal()\n this.alignable.splice(pos, 0, n, flags)\n },\n\n find: function(n) {\n for (var i = 0; i < this.alignable.length; i += 2)\n if (this.alignable[i] == n) return i\n return -1\n },\n\n check: function(n, flag, pred) {\n var found = this.find(n)\n if (found == -1 || !(this.alignable[found + 1] & flag)) return\n if (!pred.call(this, n)) {\n this.signal()\n var flags = this.alignable[found + 1] & ~flag\n if (flags) this.alignable[found + 1] = flags\n else this.alignable.splice(found, 2)\n }\n },\n\n hasMarker: function(n) {\n var handle = this.cm.getLineHandle(n)\n if (handle.markedSpans) for (var i = 0; i < handle.markedSpans.length; i++)\n if (handle.markedSpans[i].marker.collapsed && handle.markedSpans[i].to != null)\n return true\n return false\n },\n\n hasWidget: function(n) {\n var handle = this.cm.getLineHandle(n)\n if (handle.widgets) for (var i = 0; i < handle.widgets.length; i++)\n if (!handle.widgets[i].above && !handle.widgets[i].mergeSpacer) return true\n return false\n },\n\n hasWidgetBelow: function(n) {\n if (n == this.cm.lastLine()) return false\n var handle = this.cm.getLineHandle(n + 1)\n if (handle.widgets) for (var i = 0; i < handle.widgets.length; i++)\n if (handle.widgets[i].above && !handle.widgets[i].mergeSpacer) return true\n return false\n },\n\n map: function(from, nBefore, nAfter) {\n var diff = nAfter - nBefore, to = from + nBefore, widgetFrom = -1, widgetTo = -1\n for (var i = 0; i < this.alignable.length; i += 2) {\n var n = this.alignable[i]\n if (n == from && (this.alignable[i + 1] & F_WIDGET_BELOW)) widgetFrom = i\n if (n == to && (this.alignable[i + 1] & F_WIDGET_BELOW)) widgetTo = i\n if (n <= from) continue\n else if (n < to) this.alignable.splice(i--, 2)\n else this.alignable[i] += diff\n }\n if (widgetFrom > -1) {\n var flags = this.alignable[widgetFrom + 1]\n if (flags == F_WIDGET_BELOW) this.alignable.splice(widgetFrom, 2)\n else this.alignable[widgetFrom + 1] = flags & ~F_WIDGET_BELOW\n }\n if (widgetTo > -1 && nAfter)\n this.set(from + nAfter, F_WIDGET_BELOW)\n }\n }\n\n function posMin(a, b) { return (a.line - b.line || a.ch - b.ch) < 0 ? a : b; }\n function posMax(a, b) { return (a.line - b.line || a.ch - b.ch) > 0 ? a : b; }\n function posEq(a, b) { return a.line == b.line && a.ch == b.ch; }\n\n function findPrevDiff(chunks, start, isOrig) {\n for (var i = chunks.length - 1; i >= 0; i--) {\n var chunk = chunks[i];\n var to = (isOrig ? chunk.origTo : chunk.editTo) - 1;\n if (to < start) return to;\n }\n }\n\n function findNextDiff(chunks, start, isOrig) {\n for (var i = 0; i < chunks.length; i++) {\n var chunk = chunks[i];\n var from = (isOrig ? chunk.origFrom : chunk.editFrom);\n if (from > start) return from;\n }\n }\n\n function goNearbyDiff(cm, dir) {\n var found = null, views = cm.state.diffViews, line = cm.getCursor().line;\n if (views) for (var i = 0; i < views.length; i++) {\n var dv = views[i], isOrig = cm == dv.orig;\n ensureDiff(dv);\n var pos = dir < 0 ? findPrevDiff(dv.chunks, line, isOrig) : findNextDiff(dv.chunks, line, isOrig);\n if (pos != null && (found == null || (dir < 0 ? pos > found : pos < found)))\n found = pos;\n }\n if (found != null)\n cm.setCursor(found, 0);\n else\n return CodeMirror.Pass;\n }\n\n CodeMirror.commands.goNextDiff = function(cm) {\n return goNearbyDiff(cm, 1);\n };\n CodeMirror.commands.goPrevDiff = function(cm) {\n return goNearbyDiff(cm, -1);\n };\n});\n","/**\n * Diff Match and Patch\n * Copyright 2018 The diff-match-patch Authors.\n * https://github.com/google/diff-match-patch\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Computes the difference between two texts to create a patch.\n * Applies the patch onto another text, allowing for errors.\n * @author fraser@google.com (Neil Fraser)\n */\n\n/**\n * Class containing the diff, match and patch methods.\n * @constructor\n */\nvar diff_match_patch = function() {\n\n // Defaults.\n // Redefine these in your program to override the defaults.\n\n // Number of seconds to map a diff before giving up (0 for infinity).\n this.Diff_Timeout = 1.0;\n // Cost of an empty edit operation in terms of edit characters.\n this.Diff_EditCost = 4;\n // At what point is no match declared (0.0 = perfection, 1.0 = very loose).\n this.Match_Threshold = 0.5;\n // How far to search for a match (0 = exact location, 1000+ = broad match).\n // A match this many characters away from the expected location will add\n // 1.0 to the score (0.0 is a perfect match).\n this.Match_Distance = 1000;\n // When deleting a large block of text (over ~64 characters), how close do\n // the contents have to be to match the expected contents. (0.0 = perfection,\n // 1.0 = very loose). Note that Match_Threshold controls how closely the\n // end points of a delete need to match.\n this.Patch_DeleteThreshold = 0.5;\n // Chunk size for context length.\n this.Patch_Margin = 4;\n\n // The number of bits in an int.\n this.Match_MaxBits = 32;\n};\n\n\n// DIFF FUNCTIONS\n\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n/**\n * Class representing one diff tuple.\n * ~Attempts to look like a two-element array (which is what this used to be).~\n * Constructor returns an actual two-element array, to allow destructing @JackuB\n * See https://github.com/JackuB/diff-match-patch/issues/14 for details\n * @param {number} op Operation, one of: DIFF_DELETE, DIFF_INSERT, DIFF_EQUAL.\n * @param {string} text Text to be deleted, inserted, or retained.\n * @constructor\n */\ndiff_match_patch.Diff = function(op, text) {\n return [op, text];\n};\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {boolean=} opt_checklines Optional speedup flag. If present and false,\n * then don't run a line-level diff first to identify the changed areas.\n * Defaults to true, which does a faster, slightly less optimal diff.\n * @param {number=} opt_deadline Optional time when the diff should be complete\n * by. Used internally for recursive calls. Users should set DiffTimeout\n * instead.\n * @return {!Array.} Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_main = function(text1, text2, opt_checklines,\n opt_deadline) {\n // Set a deadline by which time the diff must be complete.\n if (typeof opt_deadline == 'undefined') {\n if (this.Diff_Timeout <= 0) {\n opt_deadline = Number.MAX_VALUE;\n } else {\n opt_deadline = (new Date).getTime() + this.Diff_Timeout * 1000;\n }\n }\n var deadline = opt_deadline;\n\n // Check for null inputs.\n if (text1 == null || text2 == null) {\n throw new Error('Null input. (diff_main)');\n }\n\n // Check for equality (speedup).\n if (text1 == text2) {\n if (text1) {\n return [new diff_match_patch.Diff(DIFF_EQUAL, text1)];\n }\n return [];\n }\n\n if (typeof opt_checklines == 'undefined') {\n opt_checklines = true;\n }\n var checklines = opt_checklines;\n\n // Trim off common prefix (speedup).\n var commonlength = this.diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = this.diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = this.diff_compute_(text1, text2, checklines, deadline);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift(new diff_match_patch.Diff(DIFF_EQUAL, commonprefix));\n }\n if (commonsuffix) {\n diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, commonsuffix));\n }\n this.diff_cleanupMerge(diffs);\n return diffs;\n};\n\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {boolean} checklines Speedup flag. If false, then don't run a\n * line-level diff first to identify the changed areas.\n * If true, then run a faster, slightly less optimal diff.\n * @param {number} deadline Time when the diff should be complete by.\n * @return {!Array.} Array of diff tuples.\n * @private\n */\ndiff_match_patch.prototype.diff_compute_ = function(text1, text2, checklines,\n deadline) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [new diff_match_patch.Diff(DIFF_INSERT, text2)];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [new diff_match_patch.Diff(DIFF_DELETE, text1)];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i != -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [new diff_match_patch.Diff(DIFF_INSERT, longtext.substring(0, i)),\n new diff_match_patch.Diff(DIFF_EQUAL, shorttext),\n new diff_match_patch.Diff(DIFF_INSERT,\n longtext.substring(i + shorttext.length))];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length == 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [new diff_match_patch.Diff(DIFF_DELETE, text1),\n new diff_match_patch.Diff(DIFF_INSERT, text2)];\n }\n\n // Check to see if the problem can be split in two.\n var hm = this.diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = this.diff_main(text1_a, text2_a, checklines, deadline);\n var diffs_b = this.diff_main(text1_b, text2_b, checklines, deadline);\n // Merge the results.\n return diffs_a.concat([new diff_match_patch.Diff(DIFF_EQUAL, mid_common)],\n diffs_b);\n }\n\n if (checklines && text1.length > 100 && text2.length > 100) {\n return this.diff_lineMode_(text1, text2, deadline);\n }\n\n return this.diff_bisect_(text1, text2, deadline);\n};\n\n\n/**\n * Do a quick line-level diff on both strings, then rediff the parts for\n * greater accuracy.\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} deadline Time when the diff should be complete by.\n * @return {!Array.} Array of diff tuples.\n * @private\n */\ndiff_match_patch.prototype.diff_lineMode_ = function(text1, text2, deadline) {\n // Scan the text on a line-by-line basis first.\n var a = this.diff_linesToChars_(text1, text2);\n text1 = a.chars1;\n text2 = a.chars2;\n var linearray = a.lineArray;\n\n var diffs = this.diff_main(text1, text2, false, deadline);\n\n // Convert the diff back to original text.\n this.diff_charsToLines_(diffs, linearray);\n // Eliminate freak matches (e.g. blank lines)\n this.diff_cleanupSemantic(diffs);\n\n // Rediff any replacement blocks, this time character-by-character.\n // Add a dummy entry at the end.\n diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, ''));\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n while (pointer < diffs.length) {\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n break;\n case DIFF_EQUAL:\n // Upon reaching an equality, check for prior redundancies.\n if (count_delete >= 1 && count_insert >= 1) {\n // Delete the offending records and add the merged ones.\n diffs.splice(pointer - count_delete - count_insert,\n count_delete + count_insert);\n pointer = pointer - count_delete - count_insert;\n var subDiff =\n this.diff_main(text_delete, text_insert, false, deadline);\n for (var j = subDiff.length - 1; j >= 0; j--) {\n diffs.splice(pointer, 0, subDiff[j]);\n }\n pointer = pointer + subDiff.length;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n pointer++;\n }\n diffs.pop(); // Remove the dummy entry at the end.\n\n return diffs;\n};\n\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} deadline Time at which to bail if not yet complete.\n * @return {!Array.} Array of diff tuples.\n * @private\n */\ndiff_match_patch.prototype.diff_bisect_ = function(text1, text2, deadline) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = (delta % 2 != 0);\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Bail out if deadline is reached.\n if ((new Date()).getTime() > deadline) {\n break;\n }\n\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (x1 < text1_length && y1 < text2_length &&\n text1.charAt(x1) == text2.charAt(y1)) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return this.diff_bisectSplit_(text1, text2, x1, y1, deadline);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (x2 < text1_length && y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) ==\n text2.charAt(text2_length - y2 - 1)) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return this.diff_bisectSplit_(text1, text2, x1, y1, deadline);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [new diff_match_patch.Diff(DIFF_DELETE, text1),\n new diff_match_patch.Diff(DIFF_INSERT, text2)];\n};\n\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @param {number} deadline Time at which to bail if not yet complete.\n * @return {!Array.} Array of diff tuples.\n * @private\n */\ndiff_match_patch.prototype.diff_bisectSplit_ = function(text1, text2, x, y,\n deadline) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = this.diff_main(text1a, text2a, false, deadline);\n var diffsb = this.diff_main(text1b, text2b, false, deadline);\n\n return diffs.concat(diffsb);\n};\n\n\n/**\n * Split two texts into an array of strings. Reduce the texts to a string of\n * hashes where each Unicode character represents one line.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {{chars1: string, chars2: string, lineArray: !Array.}}\n * An object containing the encoded text1, the encoded text2 and\n * the array of unique strings.\n * The zeroth element of the array of unique strings is intentionally blank.\n * @private\n */\ndiff_match_patch.prototype.diff_linesToChars_ = function(text1, text2) {\n var lineArray = []; // e.g. lineArray[4] == 'Hello\\n'\n var lineHash = {}; // e.g. lineHash['Hello\\n'] == 4\n\n // '\\x00' is a valid character, but various debuggers don't like it.\n // So we'll insert a junk entry to avoid generating a null character.\n lineArray[0] = '';\n\n /**\n * Split a text into an array of strings. Reduce the texts to a string of\n * hashes where each Unicode character represents one line.\n * Modifies linearray and linehash through being a closure.\n * @param {string} text String to encode.\n * @return {string} Encoded string.\n * @private\n */\n function diff_linesToCharsMunge_(text) {\n var chars = '';\n // Walk the text, pulling out a substring for each line.\n // text.split('\\n') would would temporarily double our memory footprint.\n // Modifying text would create many large strings to garbage collect.\n var lineStart = 0;\n var lineEnd = -1;\n // Keeping our own length variable is faster than looking it up.\n var lineArrayLength = lineArray.length;\n while (lineEnd < text.length - 1) {\n lineEnd = text.indexOf('\\n', lineStart);\n if (lineEnd == -1) {\n lineEnd = text.length - 1;\n }\n var line = text.substring(lineStart, lineEnd + 1);\n\n if (lineHash.hasOwnProperty ? lineHash.hasOwnProperty(line) :\n (lineHash[line] !== undefined)) {\n chars += String.fromCharCode(lineHash[line]);\n } else {\n if (lineArrayLength == maxLines) {\n // Bail out at 65535 because\n // String.fromCharCode(65536) == String.fromCharCode(0)\n line = text.substring(lineStart);\n lineEnd = text.length;\n }\n chars += String.fromCharCode(lineArrayLength);\n lineHash[line] = lineArrayLength;\n lineArray[lineArrayLength++] = line;\n }\n lineStart = lineEnd + 1;\n }\n return chars;\n }\n // Allocate 2/3rds of the space for text1, the rest for text2.\n var maxLines = 40000;\n var chars1 = diff_linesToCharsMunge_(text1);\n maxLines = 65535;\n var chars2 = diff_linesToCharsMunge_(text2);\n return {chars1: chars1, chars2: chars2, lineArray: lineArray};\n};\n\n\n/**\n * Rehydrate the text in a diff from a string of line hashes to real lines of\n * text.\n * @param {!Array.} diffs Array of diff tuples.\n * @param {!Array.} lineArray Array of unique strings.\n * @private\n */\ndiff_match_patch.prototype.diff_charsToLines_ = function(diffs, lineArray) {\n for (var i = 0; i < diffs.length; i++) {\n var chars = diffs[i][1];\n var text = [];\n for (var j = 0; j < chars.length; j++) {\n text[j] = lineArray[chars.charCodeAt(j)];\n }\n diffs[i][1] = text.join('');\n }\n};\n\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\ndiff_match_patch.prototype.diff_commonPrefix = function(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: https://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\ndiff_match_patch.prototype.diff_commonSuffix = function(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 ||\n text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: https://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Determine if the suffix of one string is the prefix of another.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of the first\n * string and the start of the second string.\n * @private\n */\ndiff_match_patch.prototype.diff_commonOverlap_ = function(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n // Eliminate the null case.\n if (text1_length == 0 || text2_length == 0) {\n return 0;\n }\n // Truncate the longer string.\n if (text1_length > text2_length) {\n text1 = text1.substring(text1_length - text2_length);\n } else if (text1_length < text2_length) {\n text2 = text2.substring(0, text1_length);\n }\n var text_length = Math.min(text1_length, text2_length);\n // Quick check for the worst case.\n if (text1 == text2) {\n return text_length;\n }\n\n // Start by looking for a single character match\n // and increase length until no match is found.\n // Performance analysis: https://neil.fraser.name/news/2010/11/04/\n var best = 0;\n var length = 1;\n while (true) {\n var pattern = text1.substring(text_length - length);\n var found = text2.indexOf(pattern);\n if (found == -1) {\n return best;\n }\n length += found;\n if (found == 0 || text1.substring(text_length - length) ==\n text2.substring(0, length)) {\n best = length;\n length++;\n }\n }\n};\n\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n * @private\n */\ndiff_match_patch.prototype.diff_halfMatch_ = function(text1, text2) {\n if (this.Diff_Timeout <= 0) {\n // Don't risk returning a non-optimal diff if we have unlimited time.\n return null;\n }\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n var dmp = this; // 'this' becomes 'window' in a closure.\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = '';\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) != -1) {\n var prefixLength = dmp.diff_commonPrefix(longtext.substring(i),\n shorttext.substring(j));\n var suffixLength = dmp.diff_commonSuffix(longtext.substring(0, i),\n shorttext.substring(0, j));\n if (best_common.length < suffixLength + prefixLength) {\n best_common = shorttext.substring(j - suffixLength, j) +\n shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 4));\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 2));\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n};\n\n\n/**\n * Reduce the number of edits by eliminating semantically trivial equalities.\n * @param {!Array.} diffs Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_cleanupSemantic = function(diffs) {\n var changes = false;\n var equalities = []; // Stack of indices where equalities are found.\n var equalitiesLength = 0; // Keeping our own length var is faster in JS.\n /** @type {?string} */\n var lastEquality = null;\n // Always equal to diffs[equalities[equalitiesLength - 1]][1]\n var pointer = 0; // Index of current position.\n // Number of characters that changed prior to the equality.\n var length_insertions1 = 0;\n var length_deletions1 = 0;\n // Number of characters that changed after the equality.\n var length_insertions2 = 0;\n var length_deletions2 = 0;\n while (pointer < diffs.length) {\n if (diffs[pointer][0] == DIFF_EQUAL) { // Equality found.\n equalities[equalitiesLength++] = pointer;\n length_insertions1 = length_insertions2;\n length_deletions1 = length_deletions2;\n length_insertions2 = 0;\n length_deletions2 = 0;\n lastEquality = diffs[pointer][1];\n } else { // An insertion or deletion.\n if (diffs[pointer][0] == DIFF_INSERT) {\n length_insertions2 += diffs[pointer][1].length;\n } else {\n length_deletions2 += diffs[pointer][1].length;\n }\n // Eliminate an equality that is smaller or equal to the edits on both\n // sides of it.\n if (lastEquality && (lastEquality.length <=\n Math.max(length_insertions1, length_deletions1)) &&\n (lastEquality.length <= Math.max(length_insertions2,\n length_deletions2))) {\n // Duplicate record.\n diffs.splice(equalities[equalitiesLength - 1], 0,\n new diff_match_patch.Diff(DIFF_DELETE, lastEquality));\n // Change second copy to insert.\n diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;\n // Throw away the equality we just deleted.\n equalitiesLength--;\n // Throw away the previous equality (it needs to be reevaluated).\n equalitiesLength--;\n pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1;\n length_insertions1 = 0; // Reset the counters.\n length_deletions1 = 0;\n length_insertions2 = 0;\n length_deletions2 = 0;\n lastEquality = null;\n changes = true;\n }\n }\n pointer++;\n }\n\n // Normalize the diff.\n if (changes) {\n this.diff_cleanupMerge(diffs);\n }\n this.diff_cleanupSemanticLossless(diffs);\n\n // Find any overlaps between deletions and insertions.\n // e.g: abcxxxxxxdef\n // -> abcxxxdef\n // e.g: xxxabcdefxxx\n // -> defxxxabc\n // Only extract an overlap if it is as big as the edit ahead or behind it.\n pointer = 1;\n while (pointer < diffs.length) {\n if (diffs[pointer - 1][0] == DIFF_DELETE &&\n diffs[pointer][0] == DIFF_INSERT) {\n var deletion = diffs[pointer - 1][1];\n var insertion = diffs[pointer][1];\n var overlap_length1 = this.diff_commonOverlap_(deletion, insertion);\n var overlap_length2 = this.diff_commonOverlap_(insertion, deletion);\n if (overlap_length1 >= overlap_length2) {\n if (overlap_length1 >= deletion.length / 2 ||\n overlap_length1 >= insertion.length / 2) {\n // Overlap found. Insert an equality and trim the surrounding edits.\n diffs.splice(pointer, 0, new diff_match_patch.Diff(DIFF_EQUAL,\n insertion.substring(0, overlap_length1)));\n diffs[pointer - 1][1] =\n deletion.substring(0, deletion.length - overlap_length1);\n diffs[pointer + 1][1] = insertion.substring(overlap_length1);\n pointer++;\n }\n } else {\n if (overlap_length2 >= deletion.length / 2 ||\n overlap_length2 >= insertion.length / 2) {\n // Reverse overlap found.\n // Insert an equality and swap and trim the surrounding edits.\n diffs.splice(pointer, 0, new diff_match_patch.Diff(DIFF_EQUAL,\n deletion.substring(0, overlap_length2)));\n diffs[pointer - 1][0] = DIFF_INSERT;\n diffs[pointer - 1][1] =\n insertion.substring(0, insertion.length - overlap_length2);\n diffs[pointer + 1][0] = DIFF_DELETE;\n diffs[pointer + 1][1] =\n deletion.substring(overlap_length2);\n pointer++;\n }\n }\n pointer++;\n }\n pointer++;\n }\n};\n\n\n/**\n * Look for single edits surrounded on both sides by equalities\n * which can be shifted sideways to align the edit to a word boundary.\n * e.g: The cat came. -> The cat came.\n * @param {!Array.} diffs Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_cleanupSemanticLossless = function(diffs) {\n /**\n * Given two strings, compute a score representing whether the internal\n * boundary falls on logical boundaries.\n * Scores range from 6 (best) to 0 (worst).\n * Closure, but does not reference any external variables.\n * @param {string} one First string.\n * @param {string} two Second string.\n * @return {number} The score.\n * @private\n */\n function diff_cleanupSemanticScore_(one, two) {\n if (!one || !two) {\n // Edges are the best.\n return 6;\n }\n\n // Each port of this function behaves slightly differently due to\n // subtle differences in each language's definition of things like\n // 'whitespace'. Since this function's purpose is largely cosmetic,\n // the choice has been made to use each language's native features\n // rather than force total conformity.\n var char1 = one.charAt(one.length - 1);\n var char2 = two.charAt(0);\n var nonAlphaNumeric1 = char1.match(diff_match_patch.nonAlphaNumericRegex_);\n var nonAlphaNumeric2 = char2.match(diff_match_patch.nonAlphaNumericRegex_);\n var whitespace1 = nonAlphaNumeric1 &&\n char1.match(diff_match_patch.whitespaceRegex_);\n var whitespace2 = nonAlphaNumeric2 &&\n char2.match(diff_match_patch.whitespaceRegex_);\n var lineBreak1 = whitespace1 &&\n char1.match(diff_match_patch.linebreakRegex_);\n var lineBreak2 = whitespace2 &&\n char2.match(diff_match_patch.linebreakRegex_);\n var blankLine1 = lineBreak1 &&\n one.match(diff_match_patch.blanklineEndRegex_);\n var blankLine2 = lineBreak2 &&\n two.match(diff_match_patch.blanklineStartRegex_);\n\n if (blankLine1 || blankLine2) {\n // Five points for blank lines.\n return 5;\n } else if (lineBreak1 || lineBreak2) {\n // Four points for line breaks.\n return 4;\n } else if (nonAlphaNumeric1 && !whitespace1 && whitespace2) {\n // Three points for end of sentences.\n return 3;\n } else if (whitespace1 || whitespace2) {\n // Two points for whitespace.\n return 2;\n } else if (nonAlphaNumeric1 || nonAlphaNumeric2) {\n // One point for non-alphanumeric.\n return 1;\n }\n return 0;\n }\n\n var pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n var equality1 = diffs[pointer - 1][1];\n var edit = diffs[pointer][1];\n var equality2 = diffs[pointer + 1][1];\n\n // First, shift the edit as far left as possible.\n var commonOffset = this.diff_commonSuffix(equality1, edit);\n if (commonOffset) {\n var commonString = edit.substring(edit.length - commonOffset);\n equality1 = equality1.substring(0, equality1.length - commonOffset);\n edit = commonString + edit.substring(0, edit.length - commonOffset);\n equality2 = commonString + equality2;\n }\n\n // Second, step character by character right, looking for the best fit.\n var bestEquality1 = equality1;\n var bestEdit = edit;\n var bestEquality2 = equality2;\n var bestScore = diff_cleanupSemanticScore_(equality1, edit) +\n diff_cleanupSemanticScore_(edit, equality2);\n while (edit.charAt(0) === equality2.charAt(0)) {\n equality1 += edit.charAt(0);\n edit = edit.substring(1) + equality2.charAt(0);\n equality2 = equality2.substring(1);\n var score = diff_cleanupSemanticScore_(equality1, edit) +\n diff_cleanupSemanticScore_(edit, equality2);\n // The >= encourages trailing rather than leading whitespace on edits.\n if (score >= bestScore) {\n bestScore = score;\n bestEquality1 = equality1;\n bestEdit = edit;\n bestEquality2 = equality2;\n }\n }\n\n if (diffs[pointer - 1][1] != bestEquality1) {\n // We have an improvement, save it back to the diff.\n if (bestEquality1) {\n diffs[pointer - 1][1] = bestEquality1;\n } else {\n diffs.splice(pointer - 1, 1);\n pointer--;\n }\n diffs[pointer][1] = bestEdit;\n if (bestEquality2) {\n diffs[pointer + 1][1] = bestEquality2;\n } else {\n diffs.splice(pointer + 1, 1);\n pointer--;\n }\n }\n }\n pointer++;\n }\n};\n\n// Define some regex patterns for matching boundaries.\ndiff_match_patch.nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/;\ndiff_match_patch.whitespaceRegex_ = /\\s/;\ndiff_match_patch.linebreakRegex_ = /[\\r\\n]/;\ndiff_match_patch.blanklineEndRegex_ = /\\n\\r?\\n$/;\ndiff_match_patch.blanklineStartRegex_ = /^\\r?\\n\\r?\\n/;\n\n/**\n * Reduce the number of edits by eliminating operationally trivial equalities.\n * @param {!Array.} diffs Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_cleanupEfficiency = function(diffs) {\n var changes = false;\n var equalities = []; // Stack of indices where equalities are found.\n var equalitiesLength = 0; // Keeping our own length var is faster in JS.\n /** @type {?string} */\n var lastEquality = null;\n // Always equal to diffs[equalities[equalitiesLength - 1]][1]\n var pointer = 0; // Index of current position.\n // Is there an insertion operation before the last equality.\n var pre_ins = false;\n // Is there a deletion operation before the last equality.\n var pre_del = false;\n // Is there an insertion operation after the last equality.\n var post_ins = false;\n // Is there a deletion operation after the last equality.\n var post_del = false;\n while (pointer < diffs.length) {\n if (diffs[pointer][0] == DIFF_EQUAL) { // Equality found.\n if (diffs[pointer][1].length < this.Diff_EditCost &&\n (post_ins || post_del)) {\n // Candidate found.\n equalities[equalitiesLength++] = pointer;\n pre_ins = post_ins;\n pre_del = post_del;\n lastEquality = diffs[pointer][1];\n } else {\n // Not a candidate, and can never become one.\n equalitiesLength = 0;\n lastEquality = null;\n }\n post_ins = post_del = false;\n } else { // An insertion or deletion.\n if (diffs[pointer][0] == DIFF_DELETE) {\n post_del = true;\n } else {\n post_ins = true;\n }\n /*\n * Five types to be split:\n * ABXYCD\n * AXCD\n * ABXC\n * AXCD\n * ABXC\n */\n if (lastEquality && ((pre_ins && pre_del && post_ins && post_del) ||\n ((lastEquality.length < this.Diff_EditCost / 2) &&\n (pre_ins + pre_del + post_ins + post_del) == 3))) {\n // Duplicate record.\n diffs.splice(equalities[equalitiesLength - 1], 0,\n new diff_match_patch.Diff(DIFF_DELETE, lastEquality));\n // Change second copy to insert.\n diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;\n equalitiesLength--; // Throw away the equality we just deleted;\n lastEquality = null;\n if (pre_ins && pre_del) {\n // No changes made which could affect previous entry, keep going.\n post_ins = post_del = true;\n equalitiesLength = 0;\n } else {\n equalitiesLength--; // Throw away the previous equality.\n pointer = equalitiesLength > 0 ?\n equalities[equalitiesLength - 1] : -1;\n post_ins = post_del = false;\n }\n changes = true;\n }\n }\n pointer++;\n }\n\n if (changes) {\n this.diff_cleanupMerge(diffs);\n }\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {!Array.} diffs Array of diff tuples.\n */\ndiff_match_patch.prototype.diff_cleanupMerge = function(diffs) {\n // Add a dummy entry at the end.\n diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, ''));\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n // Upon reaching an equality, check for prior redundancies.\n if (count_delete + count_insert > 1) {\n if (count_delete !== 0 && count_insert !== 0) {\n // Factor out any common prefixies.\n commonlength = this.diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if ((pointer - count_delete - count_insert) > 0 &&\n diffs[pointer - count_delete - count_insert - 1][0] ==\n DIFF_EQUAL) {\n diffs[pointer - count_delete - count_insert - 1][1] +=\n text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, new diff_match_patch.Diff(DIFF_EQUAL,\n text_insert.substring(0, commonlength)));\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixies.\n commonlength = this.diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] = text_insert.substring(text_insert.length -\n commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length -\n commonlength);\n text_delete = text_delete.substring(0, text_delete.length -\n commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n pointer -= count_delete + count_insert;\n diffs.splice(pointer, count_delete + count_insert);\n if (text_delete.length) {\n diffs.splice(pointer, 0,\n new diff_match_patch.Diff(DIFF_DELETE, text_delete));\n pointer++;\n }\n if (text_insert.length) {\n diffs.splice(pointer, 0,\n new diff_match_patch.Diff(DIFF_INSERT, text_insert));\n pointer++;\n }\n pointer++;\n } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n this.diff_cleanupMerge(diffs);\n }\n};\n\n\n/**\n * loc is a location in text1, compute and return the equivalent location in\n * text2.\n * e.g. 'The cat' vs 'The big cat', 1->1, 5->8\n * @param {!Array.} diffs Array of diff tuples.\n * @param {number} loc Location within text1.\n * @return {number} Location within text2.\n */\ndiff_match_patch.prototype.diff_xIndex = function(diffs, loc) {\n var chars1 = 0;\n var chars2 = 0;\n var last_chars1 = 0;\n var last_chars2 = 0;\n var x;\n for (x = 0; x < diffs.length; x++) {\n if (diffs[x][0] !== DIFF_INSERT) { // Equality or deletion.\n chars1 += diffs[x][1].length;\n }\n if (diffs[x][0] !== DIFF_DELETE) { // Equality or insertion.\n chars2 += diffs[x][1].length;\n }\n if (chars1 > loc) { // Overshot the location.\n break;\n }\n last_chars1 = chars1;\n last_chars2 = chars2;\n }\n // Was the location was deleted?\n if (diffs.length != x && diffs[x][0] === DIFF_DELETE) {\n return last_chars2;\n }\n // Add the remaining character length.\n return last_chars2 + (loc - last_chars1);\n};\n\n\n/**\n * Convert a diff array into a pretty HTML report.\n * @param {!Array.} diffs Array of diff tuples.\n * @return {string} HTML representation.\n */\ndiff_match_patch.prototype.diff_prettyHtml = function(diffs) {\n var html = [];\n var pattern_amp = /&/g;\n var pattern_lt = //g;\n var pattern_para = /\\n/g;\n for (var x = 0; x < diffs.length; x++) {\n var op = diffs[x][0]; // Operation (insert, delete, equal)\n var data = diffs[x][1]; // Text of change.\n var text = data.replace(pattern_amp, '&').replace(pattern_lt, '<')\n .replace(pattern_gt, '>').replace(pattern_para, '¶
');\n switch (op) {\n case DIFF_INSERT:\n html[x] = '' + text + '';\n break;\n case DIFF_DELETE:\n html[x] = '' + text + '';\n break;\n case DIFF_EQUAL:\n html[x] = '' + text + '';\n break;\n }\n }\n return html.join('');\n};\n\n\n/**\n * Compute and return the source text (all equalities and deletions).\n * @param {!Array.} diffs Array of diff tuples.\n * @return {string} Source text.\n */\ndiff_match_patch.prototype.diff_text1 = function(diffs) {\n var text = [];\n for (var x = 0; x < diffs.length; x++) {\n if (diffs[x][0] !== DIFF_INSERT) {\n text[x] = diffs[x][1];\n }\n }\n return text.join('');\n};\n\n\n/**\n * Compute and return the destination text (all equalities and insertions).\n * @param {!Array.} diffs Array of diff tuples.\n * @return {string} Destination text.\n */\ndiff_match_patch.prototype.diff_text2 = function(diffs) {\n var text = [];\n for (var x = 0; x < diffs.length; x++) {\n if (diffs[x][0] !== DIFF_DELETE) {\n text[x] = diffs[x][1];\n }\n }\n return text.join('');\n};\n\n\n/**\n * Compute the Levenshtein distance; the number of inserted, deleted or\n * substituted characters.\n * @param {!Array.} diffs Array of diff tuples.\n * @return {number} Number of changes.\n */\ndiff_match_patch.prototype.diff_levenshtein = function(diffs) {\n var levenshtein = 0;\n var insertions = 0;\n var deletions = 0;\n for (var x = 0; x < diffs.length; x++) {\n var op = diffs[x][0];\n var data = diffs[x][1];\n switch (op) {\n case DIFF_INSERT:\n insertions += data.length;\n break;\n case DIFF_DELETE:\n deletions += data.length;\n break;\n case DIFF_EQUAL:\n // A deletion and an insertion is one substitution.\n levenshtein += Math.max(insertions, deletions);\n insertions = 0;\n deletions = 0;\n break;\n }\n }\n levenshtein += Math.max(insertions, deletions);\n return levenshtein;\n};\n\n\n/**\n * Crush the diff into an encoded string which describes the operations\n * required to transform text1 into text2.\n * E.g. =3\\t-2\\t+ing -> Keep 3 chars, delete 2 chars, insert 'ing'.\n * Operations are tab-separated. Inserted text is escaped using %xx notation.\n * @param {!Array.} diffs Array of diff tuples.\n * @return {string} Delta text.\n */\ndiff_match_patch.prototype.diff_toDelta = function(diffs) {\n var text = [];\n for (var x = 0; x < diffs.length; x++) {\n switch (diffs[x][0]) {\n case DIFF_INSERT:\n text[x] = '+' + encodeURI(diffs[x][1]);\n break;\n case DIFF_DELETE:\n text[x] = '-' + diffs[x][1].length;\n break;\n case DIFF_EQUAL:\n text[x] = '=' + diffs[x][1].length;\n break;\n }\n }\n return text.join('\\t').replace(/%20/g, ' ');\n};\n\n\n/**\n * Given the original text1, and an encoded string which describes the\n * operations required to transform text1 into text2, compute the full diff.\n * @param {string} text1 Source string for the diff.\n * @param {string} delta Delta text.\n * @return {!Array.} Array of diff tuples.\n * @throws {!Error} If invalid input.\n */\ndiff_match_patch.prototype.diff_fromDelta = function(text1, delta) {\n var diffs = [];\n var diffsLength = 0; // Keeping our own length var is faster in JS.\n var pointer = 0; // Cursor in text1\n var tokens = delta.split(/\\t/g);\n for (var x = 0; x < tokens.length; x++) {\n // Each token begins with a one character parameter which specifies the\n // operation of this token (delete, insert, equality).\n var param = tokens[x].substring(1);\n switch (tokens[x].charAt(0)) {\n case '+':\n try {\n diffs[diffsLength++] =\n new diff_match_patch.Diff(DIFF_INSERT, decodeURI(param));\n } catch (ex) {\n // Malformed URI sequence.\n throw new Error('Illegal escape in diff_fromDelta: ' + param);\n }\n break;\n case '-':\n // Fall through.\n case '=':\n var n = parseInt(param, 10);\n if (isNaN(n) || n < 0) {\n throw new Error('Invalid number in diff_fromDelta: ' + param);\n }\n var text = text1.substring(pointer, pointer += n);\n if (tokens[x].charAt(0) == '=') {\n diffs[diffsLength++] = new diff_match_patch.Diff(DIFF_EQUAL, text);\n } else {\n diffs[diffsLength++] = new diff_match_patch.Diff(DIFF_DELETE, text);\n }\n break;\n default:\n // Blank tokens are ok (from a trailing \\t).\n // Anything else is an error.\n if (tokens[x]) {\n throw new Error('Invalid diff operation in diff_fromDelta: ' +\n tokens[x]);\n }\n }\n }\n if (pointer != text1.length) {\n throw new Error('Delta length (' + pointer +\n ') does not equal source text length (' + text1.length + ').');\n }\n return diffs;\n};\n\n\n// MATCH FUNCTIONS\n\n\n/**\n * Locate the best instance of 'pattern' in 'text' near 'loc'.\n * @param {string} text The text to search.\n * @param {string} pattern The pattern to search for.\n * @param {number} loc The location to search around.\n * @return {number} Best match index or -1.\n */\ndiff_match_patch.prototype.match_main = function(text, pattern, loc) {\n // Check for null inputs.\n if (text == null || pattern == null || loc == null) {\n throw new Error('Null input. (match_main)');\n }\n\n loc = Math.max(0, Math.min(loc, text.length));\n if (text == pattern) {\n // Shortcut (potentially not guaranteed by the algorithm)\n return 0;\n } else if (!text.length) {\n // Nothing to match.\n return -1;\n } else if (text.substring(loc, loc + pattern.length) == pattern) {\n // Perfect match at the perfect spot! (Includes case of null pattern)\n return loc;\n } else {\n // Do a fuzzy compare.\n return this.match_bitap_(text, pattern, loc);\n }\n};\n\n\n/**\n * Locate the best instance of 'pattern' in 'text' near 'loc' using the\n * Bitap algorithm.\n * @param {string} text The text to search.\n * @param {string} pattern The pattern to search for.\n * @param {number} loc The location to search around.\n * @return {number} Best match index or -1.\n * @private\n */\ndiff_match_patch.prototype.match_bitap_ = function(text, pattern, loc) {\n if (pattern.length > this.Match_MaxBits) {\n throw new Error('Pattern too long for this browser.');\n }\n\n // Initialise the alphabet.\n var s = this.match_alphabet_(pattern);\n\n var dmp = this; // 'this' becomes 'window' in a closure.\n\n /**\n * Compute and return the score for a match with e errors and x location.\n * Accesses loc and pattern through being a closure.\n * @param {number} e Number of errors in match.\n * @param {number} x Location of match.\n * @return {number} Overall score for match (0.0 = good, 1.0 = bad).\n * @private\n */\n function match_bitapScore_(e, x) {\n var accuracy = e / pattern.length;\n var proximity = Math.abs(loc - x);\n if (!dmp.Match_Distance) {\n // Dodge divide by zero error.\n return proximity ? 1.0 : accuracy;\n }\n return accuracy + (proximity / dmp.Match_Distance);\n }\n\n // Highest score beyond which we give up.\n var score_threshold = this.Match_Threshold;\n // Is there a nearby exact match? (speedup)\n var best_loc = text.indexOf(pattern, loc);\n if (best_loc != -1) {\n score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold);\n // What about in the other direction? (speedup)\n best_loc = text.lastIndexOf(pattern, loc + pattern.length);\n if (best_loc != -1) {\n score_threshold =\n Math.min(match_bitapScore_(0, best_loc), score_threshold);\n }\n }\n\n // Initialise the bit arrays.\n var matchmask = 1 << (pattern.length - 1);\n best_loc = -1;\n\n var bin_min, bin_mid;\n var bin_max = pattern.length + text.length;\n var last_rd;\n for (var d = 0; d < pattern.length; d++) {\n // Scan for the best match; each iteration allows for one more error.\n // Run a binary search to determine how far from 'loc' we can stray at this\n // error level.\n bin_min = 0;\n bin_mid = bin_max;\n while (bin_min < bin_mid) {\n if (match_bitapScore_(d, loc + bin_mid) <= score_threshold) {\n bin_min = bin_mid;\n } else {\n bin_max = bin_mid;\n }\n bin_mid = Math.floor((bin_max - bin_min) / 2 + bin_min);\n }\n // Use the result from this iteration as the maximum for the next.\n bin_max = bin_mid;\n var start = Math.max(1, loc - bin_mid + 1);\n var finish = Math.min(loc + bin_mid, text.length) + pattern.length;\n\n var rd = Array(finish + 2);\n rd[finish + 1] = (1 << d) - 1;\n for (var j = finish; j >= start; j--) {\n // The alphabet (s) is a sparse hash, so the following line generates\n // warnings.\n var charMatch = s[text.charAt(j - 1)];\n if (d === 0) { // First pass: exact match.\n rd[j] = ((rd[j + 1] << 1) | 1) & charMatch;\n } else { // Subsequent passes: fuzzy match.\n rd[j] = (((rd[j + 1] << 1) | 1) & charMatch) |\n (((last_rd[j + 1] | last_rd[j]) << 1) | 1) |\n last_rd[j + 1];\n }\n if (rd[j] & matchmask) {\n var score = match_bitapScore_(d, j - 1);\n // This match will almost certainly be better than any existing match.\n // But check anyway.\n if (score <= score_threshold) {\n // Told you so.\n score_threshold = score;\n best_loc = j - 1;\n if (best_loc > loc) {\n // When passing loc, don't exceed our current distance from loc.\n start = Math.max(1, 2 * loc - best_loc);\n } else {\n // Already passed loc, downhill from here on in.\n break;\n }\n }\n }\n }\n // No hope for a (better) match at greater error levels.\n if (match_bitapScore_(d + 1, loc) > score_threshold) {\n break;\n }\n last_rd = rd;\n }\n return best_loc;\n};\n\n\n/**\n * Initialise the alphabet for the Bitap algorithm.\n * @param {string} pattern The text to encode.\n * @return {!Object} Hash of character locations.\n * @private\n */\ndiff_match_patch.prototype.match_alphabet_ = function(pattern) {\n var s = {};\n for (var i = 0; i < pattern.length; i++) {\n s[pattern.charAt(i)] = 0;\n }\n for (var i = 0; i < pattern.length; i++) {\n s[pattern.charAt(i)] |= 1 << (pattern.length - i - 1);\n }\n return s;\n};\n\n\n// PATCH FUNCTIONS\n\n\n/**\n * Increase the context until it is unique,\n * but don't let the pattern expand beyond Match_MaxBits.\n * @param {!diff_match_patch.patch_obj} patch The patch to grow.\n * @param {string} text Source text.\n * @private\n */\ndiff_match_patch.prototype.patch_addContext_ = function(patch, text) {\n if (text.length == 0) {\n return;\n }\n if (patch.start2 === null) {\n throw Error('patch not initialized');\n }\n var pattern = text.substring(patch.start2, patch.start2 + patch.length1);\n var padding = 0;\n\n // Look for the first and last matches of pattern in text. If two different\n // matches are found, increase the pattern length.\n while (text.indexOf(pattern) != text.lastIndexOf(pattern) &&\n pattern.length < this.Match_MaxBits - this.Patch_Margin -\n this.Patch_Margin) {\n padding += this.Patch_Margin;\n pattern = text.substring(patch.start2 - padding,\n patch.start2 + patch.length1 + padding);\n }\n // Add one chunk for good luck.\n padding += this.Patch_Margin;\n\n // Add the prefix.\n var prefix = text.substring(patch.start2 - padding, patch.start2);\n if (prefix) {\n patch.diffs.unshift(new diff_match_patch.Diff(DIFF_EQUAL, prefix));\n }\n // Add the suffix.\n var suffix = text.substring(patch.start2 + patch.length1,\n patch.start2 + patch.length1 + padding);\n if (suffix) {\n patch.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, suffix));\n }\n\n // Roll back the start points.\n patch.start1 -= prefix.length;\n patch.start2 -= prefix.length;\n // Extend the lengths.\n patch.length1 += prefix.length + suffix.length;\n patch.length2 += prefix.length + suffix.length;\n};\n\n\n/**\n * Compute a list of patches to turn text1 into text2.\n * Use diffs if provided, otherwise compute it ourselves.\n * There are four ways to call this function, depending on what data is\n * available to the caller:\n * Method 1:\n * a = text1, b = text2\n * Method 2:\n * a = diffs\n * Method 3 (optimal):\n * a = text1, b = diffs\n * Method 4 (deprecated, use method 3):\n * a = text1, b = text2, c = diffs\n *\n * @param {string|!Array.} a text1 (methods 1,3,4) or\n * Array of diff tuples for text1 to text2 (method 2).\n * @param {string|!Array.=} opt_b text2 (methods 1,4) or\n * Array of diff tuples for text1 to text2 (method 3) or undefined (method 2).\n * @param {string|!Array.=} opt_c Array of diff tuples\n * for text1 to text2 (method 4) or undefined (methods 1,2,3).\n * @return {!Array.} Array of Patch objects.\n */\ndiff_match_patch.prototype.patch_make = function(a, opt_b, opt_c) {\n var text1, diffs;\n if (typeof a == 'string' && typeof opt_b == 'string' &&\n typeof opt_c == 'undefined') {\n // Method 1: text1, text2\n // Compute diffs from text1 and text2.\n text1 = /** @type {string} */(a);\n diffs = this.diff_main(text1, /** @type {string} */(opt_b), true);\n if (diffs.length > 2) {\n this.diff_cleanupSemantic(diffs);\n this.diff_cleanupEfficiency(diffs);\n }\n } else if (a && typeof a == 'object' && typeof opt_b == 'undefined' &&\n typeof opt_c == 'undefined') {\n // Method 2: diffs\n // Compute text1 from diffs.\n diffs = /** @type {!Array.} */(a);\n text1 = this.diff_text1(diffs);\n } else if (typeof a == 'string' && opt_b && typeof opt_b == 'object' &&\n typeof opt_c == 'undefined') {\n // Method 3: text1, diffs\n text1 = /** @type {string} */(a);\n diffs = /** @type {!Array.} */(opt_b);\n } else if (typeof a == 'string' && typeof opt_b == 'string' &&\n opt_c && typeof opt_c == 'object') {\n // Method 4: text1, text2, diffs\n // text2 is not used.\n text1 = /** @type {string} */(a);\n diffs = /** @type {!Array.} */(opt_c);\n } else {\n throw new Error('Unknown call format to patch_make.');\n }\n\n if (diffs.length === 0) {\n return []; // Get rid of the null case.\n }\n var patches = [];\n var patch = new diff_match_patch.patch_obj();\n var patchDiffLength = 0; // Keeping our own length var is faster in JS.\n var char_count1 = 0; // Number of characters into the text1 string.\n var char_count2 = 0; // Number of characters into the text2 string.\n // Start with text1 (prepatch_text) and apply the diffs until we arrive at\n // text2 (postpatch_text). We recreate the patches one by one to determine\n // context info.\n var prepatch_text = text1;\n var postpatch_text = text1;\n for (var x = 0; x < diffs.length; x++) {\n var diff_type = diffs[x][0];\n var diff_text = diffs[x][1];\n\n if (!patchDiffLength && diff_type !== DIFF_EQUAL) {\n // A new patch starts here.\n patch.start1 = char_count1;\n patch.start2 = char_count2;\n }\n\n switch (diff_type) {\n case DIFF_INSERT:\n patch.diffs[patchDiffLength++] = diffs[x];\n patch.length2 += diff_text.length;\n postpatch_text = postpatch_text.substring(0, char_count2) + diff_text +\n postpatch_text.substring(char_count2);\n break;\n case DIFF_DELETE:\n patch.length1 += diff_text.length;\n patch.diffs[patchDiffLength++] = diffs[x];\n postpatch_text = postpatch_text.substring(0, char_count2) +\n postpatch_text.substring(char_count2 +\n diff_text.length);\n break;\n case DIFF_EQUAL:\n if (diff_text.length <= 2 * this.Patch_Margin &&\n patchDiffLength && diffs.length != x + 1) {\n // Small equality inside a patch.\n patch.diffs[patchDiffLength++] = diffs[x];\n patch.length1 += diff_text.length;\n patch.length2 += diff_text.length;\n } else if (diff_text.length >= 2 * this.Patch_Margin) {\n // Time for a new patch.\n if (patchDiffLength) {\n this.patch_addContext_(patch, prepatch_text);\n patches.push(patch);\n patch = new diff_match_patch.patch_obj();\n patchDiffLength = 0;\n // Unlike Unidiff, our patch lists have a rolling context.\n // https://github.com/google/diff-match-patch/wiki/Unidiff\n // Update prepatch text & pos to reflect the application of the\n // just completed patch.\n prepatch_text = postpatch_text;\n char_count1 = char_count2;\n }\n }\n break;\n }\n\n // Update the current character count.\n if (diff_type !== DIFF_INSERT) {\n char_count1 += diff_text.length;\n }\n if (diff_type !== DIFF_DELETE) {\n char_count2 += diff_text.length;\n }\n }\n // Pick up the leftover patch if not empty.\n if (patchDiffLength) {\n this.patch_addContext_(patch, prepatch_text);\n patches.push(patch);\n }\n\n return patches;\n};\n\n\n/**\n * Given an array of patches, return another array that is identical.\n * @param {!Array.} patches Array of Patch objects.\n * @return {!Array.} Array of Patch objects.\n */\ndiff_match_patch.prototype.patch_deepCopy = function(patches) {\n // Making deep copies is hard in JavaScript.\n var patchesCopy = [];\n for (var x = 0; x < patches.length; x++) {\n var patch = patches[x];\n var patchCopy = new diff_match_patch.patch_obj();\n patchCopy.diffs = [];\n for (var y = 0; y < patch.diffs.length; y++) {\n patchCopy.diffs[y] =\n new diff_match_patch.Diff(patch.diffs[y][0], patch.diffs[y][1]);\n }\n patchCopy.start1 = patch.start1;\n patchCopy.start2 = patch.start2;\n patchCopy.length1 = patch.length1;\n patchCopy.length2 = patch.length2;\n patchesCopy[x] = patchCopy;\n }\n return patchesCopy;\n};\n\n\n/**\n * Merge a set of patches onto the text. Return a patched text, as well\n * as a list of true/false values indicating which patches were applied.\n * @param {!Array.} patches Array of Patch objects.\n * @param {string} text Old text.\n * @return {!Array.>} Two element Array, containing the\n * new text and an array of boolean values.\n */\ndiff_match_patch.prototype.patch_apply = function(patches, text) {\n if (patches.length == 0) {\n return [text, []];\n }\n\n // Deep copy the patches so that no changes are made to originals.\n patches = this.patch_deepCopy(patches);\n\n var nullPadding = this.patch_addPadding(patches);\n text = nullPadding + text + nullPadding;\n\n this.patch_splitMax(patches);\n // delta keeps track of the offset between the expected and actual location\n // of the previous patch. If there are patches expected at positions 10 and\n // 20, but the first patch was found at 12, delta is 2 and the second patch\n // has an effective expected position of 22.\n var delta = 0;\n var results = [];\n for (var x = 0; x < patches.length; x++) {\n var expected_loc = patches[x].start2 + delta;\n var text1 = this.diff_text1(patches[x].diffs);\n var start_loc;\n var end_loc = -1;\n if (text1.length > this.Match_MaxBits) {\n // patch_splitMax will only provide an oversized pattern in the case of\n // a monster delete.\n start_loc = this.match_main(text, text1.substring(0, this.Match_MaxBits),\n expected_loc);\n if (start_loc != -1) {\n end_loc = this.match_main(text,\n text1.substring(text1.length - this.Match_MaxBits),\n expected_loc + text1.length - this.Match_MaxBits);\n if (end_loc == -1 || start_loc >= end_loc) {\n // Can't find valid trailing context. Drop this patch.\n start_loc = -1;\n }\n }\n } else {\n start_loc = this.match_main(text, text1, expected_loc);\n }\n if (start_loc == -1) {\n // No match found. :(\n results[x] = false;\n // Subtract the delta for this failed patch from subsequent patches.\n delta -= patches[x].length2 - patches[x].length1;\n } else {\n // Found a match. :)\n results[x] = true;\n delta = start_loc - expected_loc;\n var text2;\n if (end_loc == -1) {\n text2 = text.substring(start_loc, start_loc + text1.length);\n } else {\n text2 = text.substring(start_loc, end_loc + this.Match_MaxBits);\n }\n if (text1 == text2) {\n // Perfect match, just shove the replacement text in.\n text = text.substring(0, start_loc) +\n this.diff_text2(patches[x].diffs) +\n text.substring(start_loc + text1.length);\n } else {\n // Imperfect match. Run a diff to get a framework of equivalent\n // indices.\n var diffs = this.diff_main(text1, text2, false);\n if (text1.length > this.Match_MaxBits &&\n this.diff_levenshtein(diffs) / text1.length >\n this.Patch_DeleteThreshold) {\n // The end points match, but the content is unacceptably bad.\n results[x] = false;\n } else {\n this.diff_cleanupSemanticLossless(diffs);\n var index1 = 0;\n var index2;\n for (var y = 0; y < patches[x].diffs.length; y++) {\n var mod = patches[x].diffs[y];\n if (mod[0] !== DIFF_EQUAL) {\n index2 = this.diff_xIndex(diffs, index1);\n }\n if (mod[0] === DIFF_INSERT) { // Insertion\n text = text.substring(0, start_loc + index2) + mod[1] +\n text.substring(start_loc + index2);\n } else if (mod[0] === DIFF_DELETE) { // Deletion\n text = text.substring(0, start_loc + index2) +\n text.substring(start_loc + this.diff_xIndex(diffs,\n index1 + mod[1].length));\n }\n if (mod[0] !== DIFF_DELETE) {\n index1 += mod[1].length;\n }\n }\n }\n }\n }\n }\n // Strip the padding off.\n text = text.substring(nullPadding.length, text.length - nullPadding.length);\n return [text, results];\n};\n\n\n/**\n * Add some padding on text start and end so that edges can match something.\n * Intended to be called only from within patch_apply.\n * @param {!Array.} patches Array of Patch objects.\n * @return {string} The padding string added to each side.\n */\ndiff_match_patch.prototype.patch_addPadding = function(patches) {\n var paddingLength = this.Patch_Margin;\n var nullPadding = '';\n for (var x = 1; x <= paddingLength; x++) {\n nullPadding += String.fromCharCode(x);\n }\n\n // Bump all the patches forward.\n for (var x = 0; x < patches.length; x++) {\n patches[x].start1 += paddingLength;\n patches[x].start2 += paddingLength;\n }\n\n // Add some padding on start of first diff.\n var patch = patches[0];\n var diffs = patch.diffs;\n if (diffs.length == 0 || diffs[0][0] != DIFF_EQUAL) {\n // Add nullPadding equality.\n diffs.unshift(new diff_match_patch.Diff(DIFF_EQUAL, nullPadding));\n patch.start1 -= paddingLength; // Should be 0.\n patch.start2 -= paddingLength; // Should be 0.\n patch.length1 += paddingLength;\n patch.length2 += paddingLength;\n } else if (paddingLength > diffs[0][1].length) {\n // Grow first equality.\n var extraLength = paddingLength - diffs[0][1].length;\n diffs[0][1] = nullPadding.substring(diffs[0][1].length) + diffs[0][1];\n patch.start1 -= extraLength;\n patch.start2 -= extraLength;\n patch.length1 += extraLength;\n patch.length2 += extraLength;\n }\n\n // Add some padding on end of last diff.\n patch = patches[patches.length - 1];\n diffs = patch.diffs;\n if (diffs.length == 0 || diffs[diffs.length - 1][0] != DIFF_EQUAL) {\n // Add nullPadding equality.\n diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, nullPadding));\n patch.length1 += paddingLength;\n patch.length2 += paddingLength;\n } else if (paddingLength > diffs[diffs.length - 1][1].length) {\n // Grow last equality.\n var extraLength = paddingLength - diffs[diffs.length - 1][1].length;\n diffs[diffs.length - 1][1] += nullPadding.substring(0, extraLength);\n patch.length1 += extraLength;\n patch.length2 += extraLength;\n }\n\n return nullPadding;\n};\n\n\n/**\n * Look through the patches and break up any which are longer than the maximum\n * limit of the match algorithm.\n * Intended to be called only from within patch_apply.\n * @param {!Array.} patches Array of Patch objects.\n */\ndiff_match_patch.prototype.patch_splitMax = function(patches) {\n var patch_size = this.Match_MaxBits;\n for (var x = 0; x < patches.length; x++) {\n if (patches[x].length1 <= patch_size) {\n continue;\n }\n var bigpatch = patches[x];\n // Remove the big old patch.\n patches.splice(x--, 1);\n var start1 = bigpatch.start1;\n var start2 = bigpatch.start2;\n var precontext = '';\n while (bigpatch.diffs.length !== 0) {\n // Create one of several smaller patches.\n var patch = new diff_match_patch.patch_obj();\n var empty = true;\n patch.start1 = start1 - precontext.length;\n patch.start2 = start2 - precontext.length;\n if (precontext !== '') {\n patch.length1 = patch.length2 = precontext.length;\n patch.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, precontext));\n }\n while (bigpatch.diffs.length !== 0 &&\n patch.length1 < patch_size - this.Patch_Margin) {\n var diff_type = bigpatch.diffs[0][0];\n var diff_text = bigpatch.diffs[0][1];\n if (diff_type === DIFF_INSERT) {\n // Insertions are harmless.\n patch.length2 += diff_text.length;\n start2 += diff_text.length;\n patch.diffs.push(bigpatch.diffs.shift());\n empty = false;\n } else if (diff_type === DIFF_DELETE && patch.diffs.length == 1 &&\n patch.diffs[0][0] == DIFF_EQUAL &&\n diff_text.length > 2 * patch_size) {\n // This is a large deletion. Let it pass in one chunk.\n patch.length1 += diff_text.length;\n start1 += diff_text.length;\n empty = false;\n patch.diffs.push(new diff_match_patch.Diff(diff_type, diff_text));\n bigpatch.diffs.shift();\n } else {\n // Deletion or equality. Only take as much as we can stomach.\n diff_text = diff_text.substring(0,\n patch_size - patch.length1 - this.Patch_Margin);\n patch.length1 += diff_text.length;\n start1 += diff_text.length;\n if (diff_type === DIFF_EQUAL) {\n patch.length2 += diff_text.length;\n start2 += diff_text.length;\n } else {\n empty = false;\n }\n patch.diffs.push(new diff_match_patch.Diff(diff_type, diff_text));\n if (diff_text == bigpatch.diffs[0][1]) {\n bigpatch.diffs.shift();\n } else {\n bigpatch.diffs[0][1] =\n bigpatch.diffs[0][1].substring(diff_text.length);\n }\n }\n }\n // Compute the head context for the next patch.\n precontext = this.diff_text2(patch.diffs);\n precontext =\n precontext.substring(precontext.length - this.Patch_Margin);\n // Append the end context for this patch.\n var postcontext = this.diff_text1(bigpatch.diffs)\n .substring(0, this.Patch_Margin);\n if (postcontext !== '') {\n patch.length1 += postcontext.length;\n patch.length2 += postcontext.length;\n if (patch.diffs.length !== 0 &&\n patch.diffs[patch.diffs.length - 1][0] === DIFF_EQUAL) {\n patch.diffs[patch.diffs.length - 1][1] += postcontext;\n } else {\n patch.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, postcontext));\n }\n }\n if (!empty) {\n patches.splice(++x, 0, patch);\n }\n }\n }\n};\n\n\n/**\n * Take a list of patches and return a textual representation.\n * @param {!Array.} patches Array of Patch objects.\n * @return {string} Text representation of patches.\n */\ndiff_match_patch.prototype.patch_toText = function(patches) {\n var text = [];\n for (var x = 0; x < patches.length; x++) {\n text[x] = patches[x];\n }\n return text.join('');\n};\n\n\n/**\n * Parse a textual representation of patches and return a list of Patch objects.\n * @param {string} textline Text representation of patches.\n * @return {!Array.} Array of Patch objects.\n * @throws {!Error} If invalid input.\n */\ndiff_match_patch.prototype.patch_fromText = function(textline) {\n var patches = [];\n if (!textline) {\n return patches;\n }\n var text = textline.split('\\n');\n var textPointer = 0;\n var patchHeader = /^@@ -(\\d+),?(\\d*) \\+(\\d+),?(\\d*) @@$/;\n while (textPointer < text.length) {\n var m = text[textPointer].match(patchHeader);\n if (!m) {\n throw new Error('Invalid patch string: ' + text[textPointer]);\n }\n var patch = new diff_match_patch.patch_obj();\n patches.push(patch);\n patch.start1 = parseInt(m[1], 10);\n if (m[2] === '') {\n patch.start1--;\n patch.length1 = 1;\n } else if (m[2] == '0') {\n patch.length1 = 0;\n } else {\n patch.start1--;\n patch.length1 = parseInt(m[2], 10);\n }\n\n patch.start2 = parseInt(m[3], 10);\n if (m[4] === '') {\n patch.start2--;\n patch.length2 = 1;\n } else if (m[4] == '0') {\n patch.length2 = 0;\n } else {\n patch.start2--;\n patch.length2 = parseInt(m[4], 10);\n }\n textPointer++;\n\n while (textPointer < text.length) {\n var sign = text[textPointer].charAt(0);\n try {\n var line = decodeURI(text[textPointer].substring(1));\n } catch (ex) {\n // Malformed URI sequence.\n throw new Error('Illegal escape in patch_fromText: ' + line);\n }\n if (sign == '-') {\n // Deletion.\n patch.diffs.push(new diff_match_patch.Diff(DIFF_DELETE, line));\n } else if (sign == '+') {\n // Insertion.\n patch.diffs.push(new diff_match_patch.Diff(DIFF_INSERT, line));\n } else if (sign == ' ') {\n // Minor equality.\n patch.diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, line));\n } else if (sign == '@') {\n // Start of next patch.\n break;\n } else if (sign === '') {\n // Blank line? Whatever.\n } else {\n // WTF?\n throw new Error('Invalid patch mode \"' + sign + '\" in: ' + line);\n }\n textPointer++;\n }\n }\n return patches;\n};\n\n\n/**\n * Class representing one patch operation.\n * @constructor\n */\ndiff_match_patch.patch_obj = function() {\n /** @type {!Array.} */\n this.diffs = [];\n /** @type {?number} */\n this.start1 = null;\n /** @type {?number} */\n this.start2 = null;\n /** @type {number} */\n this.length1 = 0;\n /** @type {number} */\n this.length2 = 0;\n};\n\n\n/**\n * Emulate GNU diff's format.\n * Header: @@ -382,8 +481,9 @@\n * Indices are printed as 1-based, not 0-based.\n * @return {string} The GNU diff string.\n */\ndiff_match_patch.patch_obj.prototype.toString = function() {\n var coords1, coords2;\n if (this.length1 === 0) {\n coords1 = this.start1 + ',0';\n } else if (this.length1 == 1) {\n coords1 = this.start1 + 1;\n } else {\n coords1 = (this.start1 + 1) + ',' + this.length1;\n }\n if (this.length2 === 0) {\n coords2 = this.start2 + ',0';\n } else if (this.length2 == 1) {\n coords2 = this.start2 + 1;\n } else {\n coords2 = (this.start2 + 1) + ',' + this.length2;\n }\n var text = ['@@ -' + coords1 + ' +' + coords2 + ' @@\\n'];\n var op;\n // Escape the body of the patch with %xx notation.\n for (var x = 0; x < this.diffs.length; x++) {\n switch (this.diffs[x][0]) {\n case DIFF_INSERT:\n op = '+';\n break;\n case DIFF_DELETE:\n op = '-';\n break;\n case DIFF_EQUAL:\n op = ' ';\n break;\n }\n text[x + 1] = op + encodeURI(this.diffs[x][1]) + '\\n';\n }\n return text.join('').replace(/%20/g, ' ');\n};\n\n\n// The following export code was added by @ForbesLindesay\nmodule.exports = diff_match_patch;\nmodule.exports['diff_match_patch'] = diff_match_patch;\nmodule.exports['DIFF_DELETE'] = DIFF_DELETE;\nmodule.exports['DIFF_INSERT'] = DIFF_INSERT;\nmodule.exports['DIFF_EQUAL'] = DIFF_EQUAL;","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/5/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n CodeMirror.defineSimpleMode = function(name, states) {\n CodeMirror.defineMode(name, function(config) {\n return CodeMirror.simpleMode(config, states);\n });\n };\n\n CodeMirror.simpleMode = function(config, states) {\n ensureState(states, \"start\");\n var states_ = {}, meta = states.meta || {}, hasIndentation = false;\n for (var state in states) if (state != meta && states.hasOwnProperty(state)) {\n var list = states_[state] = [], orig = states[state];\n for (var i = 0; i < orig.length; i++) {\n var data = orig[i];\n list.push(new Rule(data, states));\n if (data.indent || data.dedent) hasIndentation = true;\n }\n }\n var mode = {\n startState: function() {\n return {state: \"start\", pending: null,\n local: null, localState: null,\n indent: hasIndentation ? [] : null};\n },\n copyState: function(state) {\n var s = {state: state.state, pending: state.pending,\n local: state.local, localState: null,\n indent: state.indent && state.indent.slice(0)};\n if (state.localState)\n s.localState = CodeMirror.copyState(state.local.mode, state.localState);\n if (state.stack)\n s.stack = state.stack.slice(0);\n for (var pers = state.persistentStates; pers; pers = pers.next)\n s.persistentStates = {mode: pers.mode,\n spec: pers.spec,\n state: pers.state == state.localState ? s.localState : CodeMirror.copyState(pers.mode, pers.state),\n next: s.persistentStates};\n return s;\n },\n token: tokenFunction(states_, config),\n innerMode: function(state) { return state.local && {mode: state.local.mode, state: state.localState}; },\n indent: indentFunction(states_, meta)\n };\n if (meta) for (var prop in meta) if (meta.hasOwnProperty(prop))\n mode[prop] = meta[prop];\n return mode;\n };\n\n function ensureState(states, name) {\n if (!states.hasOwnProperty(name))\n throw new Error(\"Undefined state \" + name + \" in simple mode\");\n }\n\n function toRegex(val, caret) {\n if (!val) return /(?:)/;\n var flags = \"\";\n if (val instanceof RegExp) {\n if (val.ignoreCase) flags = \"i\";\n if (val.unicode) flags += \"u\"\n val = val.source;\n } else {\n val = String(val);\n }\n return new RegExp((caret === false ? \"\" : \"^\") + \"(?:\" + val + \")\", flags);\n }\n\n function asToken(val) {\n if (!val) return null;\n if (val.apply) return val\n if (typeof val == \"string\") return val.replace(/\\./g, \" \");\n var result = [];\n for (var i = 0; i < val.length; i++)\n result.push(val[i] && val[i].replace(/\\./g, \" \"));\n return result;\n }\n\n function Rule(data, states) {\n if (data.next || data.push) ensureState(states, data.next || data.push);\n this.regex = toRegex(data.regex);\n this.token = asToken(data.token);\n this.data = data;\n }\n\n function tokenFunction(states, config) {\n return function(stream, state) {\n if (state.pending) {\n var pend = state.pending.shift();\n if (state.pending.length == 0) state.pending = null;\n stream.pos += pend.text.length;\n return pend.token;\n }\n\n if (state.local) {\n if (state.local.end && stream.match(state.local.end)) {\n var tok = state.local.endToken || null;\n state.local = state.localState = null;\n return tok;\n } else {\n var tok = state.local.mode.token(stream, state.localState), m;\n if (state.local.endScan && (m = state.local.endScan.exec(stream.current())))\n stream.pos = stream.start + m.index;\n return tok;\n }\n }\n\n var curState = states[state.state];\n for (var i = 0; i < curState.length; i++) {\n var rule = curState[i];\n var matches = (!rule.data.sol || stream.sol()) && stream.match(rule.regex);\n if (matches) {\n if (rule.data.next) {\n state.state = rule.data.next;\n } else if (rule.data.push) {\n (state.stack || (state.stack = [])).push(state.state);\n state.state = rule.data.push;\n } else if (rule.data.pop && state.stack && state.stack.length) {\n state.state = state.stack.pop();\n }\n\n if (rule.data.mode)\n enterLocalMode(config, state, rule.data.mode, rule.token);\n if (rule.data.indent)\n state.indent.push(stream.indentation() + config.indentUnit);\n if (rule.data.dedent)\n state.indent.pop();\n var token = rule.token\n if (token && token.apply) token = token(matches)\n if (matches.length > 2 && rule.token && typeof rule.token != \"string\") {\n for (var j = 2; j < matches.length; j++)\n if (matches[j])\n (state.pending || (state.pending = [])).push({text: matches[j], token: rule.token[j - 1]});\n stream.backUp(matches[0].length - (matches[1] ? matches[1].length : 0));\n return token[0];\n } else if (token && token.join) {\n return token[0];\n } else {\n return token;\n }\n }\n }\n stream.next();\n return null;\n };\n }\n\n function cmp(a, b) {\n if (a === b) return true;\n if (!a || typeof a != \"object\" || !b || typeof b != \"object\") return false;\n var props = 0;\n for (var prop in a) if (a.hasOwnProperty(prop)) {\n if (!b.hasOwnProperty(prop) || !cmp(a[prop], b[prop])) return false;\n props++;\n }\n for (var prop in b) if (b.hasOwnProperty(prop)) props--;\n return props == 0;\n }\n\n function enterLocalMode(config, state, spec, token) {\n var pers;\n if (spec.persistent) for (var p = state.persistentStates; p && !pers; p = p.next)\n if (spec.spec ? cmp(spec.spec, p.spec) : spec.mode == p.mode) pers = p;\n var mode = pers ? pers.mode : spec.mode || CodeMirror.getMode(config, spec.spec);\n var lState = pers ? pers.state : CodeMirror.startState(mode);\n if (spec.persistent && !pers)\n state.persistentStates = {mode: mode, spec: spec.spec, state: lState, next: state.persistentStates};\n\n state.localState = lState;\n state.local = {mode: mode,\n end: spec.end && toRegex(spec.end),\n endScan: spec.end && spec.forceEnd !== false && toRegex(spec.end, false),\n endToken: token && token.join ? token[token.length - 1] : token};\n }\n\n function indexOf(val, arr) {\n for (var i = 0; i < arr.length; i++) if (arr[i] === val) return true;\n }\n\n function indentFunction(states, meta) {\n return function(state, textAfter, line) {\n if (state.local && state.local.mode.indent)\n return state.local.mode.indent(state.localState, textAfter, line);\n if (state.indent == null || state.local || meta.dontIndentStates && indexOf(state.state, meta.dontIndentStates) > -1)\n return CodeMirror.Pass;\n\n var pos = state.indent.length - 1, rules = states[state.state];\n scan: for (;;) {\n for (var i = 0; i < rules.length; i++) {\n var rule = rules[i];\n if (rule.data.dedent && rule.data.dedentIfLineStart !== false) {\n var m = rule.regex.exec(textAfter);\n if (m && m[0]) {\n pos--;\n if (rule.next || rule.push) rules = states[rule.next || rule.push];\n textAfter = textAfter.slice(m[0].length);\n continue scan;\n }\n }\n }\n break;\n }\n return pos < 0 ? 0 : state.indent[pos];\n };\n }\n});\n","import { defineComponent as M, ref as y, onMounted as j, markRaw as L, watch as x, unref as v, openBlock as b, createElementBlock as S, computed as T, nextTick as G, shallowRef as Z, getCurrentInstance as q, onBeforeUnmount as K, normalizeClass as Q, normalizeStyle as X, createBlock as Y, resolveDynamicComponent as ee, mergeProps as te } from \"vue\";\nimport \"codemirror/lib/codemirror.css\";\nimport H from \"codemirror\";\nimport \"codemirror/addon/merge/merge.css\";\nimport \"codemirror/addon/merge/merge.js\";\nimport ne from \"diff-match-patch\";\nimport \"codemirror/addon/mode/simple.js\";\n!window.CodeMirror && (window.CodeMirror = H);\nconst _ = window.CodeMirror || H, oe = M({\n name: \"DefaultMode\",\n props: {\n name: {\n type: String,\n default: `cm-textarea-${+new Date()}`\n },\n value: {\n type: String,\n default: \"\"\n },\n content: {\n type: String,\n default: \"\"\n },\n options: {\n type: Object,\n default: () => ({})\n },\n cminstance: {\n type: Object,\n default: () => null\n },\n placeholder: {\n type: String,\n default: \"\"\n }\n },\n emits: {\n ready: (e) => e,\n \"update:cminstance\": (e) => e\n },\n setup(e, { emit: o }) {\n const r = y(), t = y(null), n = () => {\n t.value = L(\n _.fromTextArea(r.value, e.options)\n ), o(\"update:cminstance\", t.value);\n const i = x(\n () => e.cminstance,\n (a) => {\n var f;\n a && ((f = e.cminstance) == null || f.setValue(e.value || e.content)), o(\"ready\", v(t)), i == null || i();\n },\n { deep: !0 }\n );\n };\n return j(() => {\n n();\n }), {\n textarea: r,\n initialize: n\n };\n }\n}), I = (e, o) => {\n const r = e.__vccOpts || e;\n for (const [t, n] of o)\n r[t] = n;\n return r;\n}, re = [\"name\", \"placeholder\"];\nfunction ae(e, o, r, t, n, i) {\n return b(), S(\"textarea\", {\n ref: \"textarea\",\n name: e.$props.name,\n placeholder: e.$props.placeholder\n }, null, 8, re);\n}\nconst V = /* @__PURE__ */ I(oe, [[\"render\", ae]]);\nwindow.diff_match_patch = ne;\nwindow.DIFF_DELETE = -1;\nwindow.DIFF_INSERT = 1;\nwindow.DIFF_EQUAL = 0;\nconst se = M({\n name: \"MergeMode\",\n props: {\n options: {\n type: Object,\n default: () => ({})\n },\n cminstance: {\n type: Object,\n default: () => ({})\n }\n },\n emits: [\"update:cminstance\", \"ready\"],\n setup(e, { emit: o }) {\n const r = y(), t = y(), n = () => {\n r.value = L(\n _.MergeView(t.value, e.options)\n ), o(\"update:cminstance\", r.value), o(\"ready\", r);\n };\n return j(() => {\n n();\n }), {\n mergeView: t,\n initialize: n\n };\n }\n}), le = { ref: \"mergeView\" };\nfunction ce(e, o, r, t, n, i) {\n return b(), S(\"div\", le, null, 512);\n}\nconst ie = /* @__PURE__ */ I(se, [[\"render\", ce]]);\nvar ue = /* @__PURE__ */ ((e) => (e.info = \"info\", e.warning = \"warning\", e.error = \"error\", e))(ue || {});\nfunction de() {\n const e = new Date(), o = e.getHours() < 10 ? `0${e.getHours()}` : e.getHours(), r = e.getMinutes() < 10 ? `0${e.getMinutes()}` : e.getMinutes(), t = e.getSeconds() < 10 ? `0${e.getSeconds()}` : e.getSeconds();\n return `${o}:${r}:${t}`;\n}\nfunction Le(e) {\n return `#link#${JSON.stringify(e)}#link#`;\n}\nfunction pe(e) {\n const o = /#link#(.+)#link#/g, r = [];\n let t;\n for (t = o.exec(e); t; ) {\n const n = document.createElement(\"a\"), i = JSON.parse(t[1]), a = Object.entries(i);\n for (const [f, u] of a)\n n.setAttribute(f, u);\n n.className = \"editor_custom_link\", n.innerHTML = \"logDownload\", r.push({\n start: t.index,\n end: t.index + t[0].length,\n node: n\n }), t = o.exec(e);\n }\n return r;\n}\nfunction Te(e = \"\", o = \"info\") {\n return `#log<${o}>log#${e}#log<${o}>log#`;\n}\nfunction ge(e) {\n const o = [];\n function r() {\n const t = /#log<(\\w*)>log#((.|\\r\\n|\\n)*?)#log<(\\w*)>log#/g;\n let n;\n for (n = t.exec(e); n; ) {\n const a = n[0].replace(/\\r\\n/g, `\n`).split(`\n`), u = n[2].replace(/\\r\\n/g, `\n`).split(`\n`), m = document.createElement(\"span\"), c = n[1];\n m.className = `c-editor--log__${c}`;\n let d = 0;\n for (let l = 0; l < a.length; l++) {\n const p = a[l], $ = u[l], w = m.cloneNode(!1);\n w.innerText = $, o.push({\n start: n.index + d,\n end: n.index + d + p.length,\n node: w\n }), d = d + p.length + 1;\n }\n n = t.exec(e);\n }\n }\n return r(), o;\n}\nfunction Ie(e, o) {\n return `[${de()}] <${o}> ${e}`;\n}\nfunction De(e, o, r) {\n const n = new Array(Math.max(o || 15, 5)).join(r || \"=\");\n return `${n}${e}${n}`;\n}\nconst C = [\n {\n regex: /(\\[.*?\\])([ \\t]*)([ \\t])(.+)/,\n token: [\"tag\", \"\", \"error.strong\", \"error.strong\"],\n sol: !0\n // next: \"error\",\n },\n {\n regex: /(\\[.*?\\])([ \\t]*)()(.+)(.?)/,\n token: [\"tag\", \"\", \"bracket\", \"bracket\", \"hr\"],\n sol: !0\n // next: \"info\",\n },\n {\n regex: /(\\[.*?\\])([ \\t]*)()(.+)(.?)/,\n token: [\"tag\", \"\", \"comment\", \"comment\", \"hr\"],\n sol: !0\n // next: \"warning\",\n }\n];\n_.defineSimpleMode(\"fclog\", {\n start: [\n ...C,\n {\n regex: /.*/,\n token: \"hr\"\n }\n ],\n error: [\n ...C,\n {\n regex: /.*/,\n token: \"error.strong\"\n }\n ],\n info: [\n ...C,\n {\n regex: /.*/,\n token: \"bracket\"\n }\n ],\n warning: [\n ...C,\n {\n regex: /.*\\[/,\n token: \"comment\"\n }\n ]\n});\n_.defineSimpleMode(\"log\", {\n start: [\n {\n regex: /^[=]+[^=]*[=]+/,\n token: \"strong\"\n },\n {\n regex: /([^\\w])([A-Z][\\w]*)/,\n token: [\"\", \"string\"]\n },\n {\n regex: /(^[A-Z][\\w]*)/,\n token: \"string\"\n }\n // {\n // regex: /([^\\d])([0-9]+)/,\n // token: [null, 'comment']\n // },\n // {\n // regex: /(^[0-9]+)/,\n // token: 'comment'\n // }\n ]\n});\nconst me = M({\n name: \"CodemirrorFclog\",\n props: {\n value: {\n type: String,\n default: \"\"\n },\n name: {\n type: String,\n default: `cm-textarea-${+new Date()}`\n },\n options: {\n type: Object,\n default: () => ({})\n },\n cminstance: {\n type: Object,\n default: () => ({})\n },\n placeholder: {\n type: String,\n default: \"\"\n }\n },\n emits: [\"update:cminstance\", \"ready\"],\n setup(e, { emit: o }) {\n const r = y(), t = y(null), n = (a = e.cminstance) => {\n a.getAllMarks().forEach((c) => c.clear());\n const u = a.getValue(), m = [].concat(pe(u)).concat(ge(u));\n for (let c = 0; c < m.length; c++) {\n const d = m[c];\n a.markText(\n a.posFromIndex(d.start),\n a.posFromIndex(d.end),\n { replacedWith: d.node }\n );\n }\n }, i = () => {\n var a;\n t.value = L(\n _.fromTextArea(r.value, e.options)\n ), o(\"update:cminstance\", v(t)), (a = t.value) == null || a.on(\"change\", n);\n };\n return x(\n () => e.cminstance,\n (a) => {\n var f;\n a && (n(e.cminstance), (f = e.cminstance) == null || f.setValue(e.value), o(\"ready\", t));\n },\n { deep: !0, immediate: !0 }\n ), j(() => {\n i();\n }), {\n initialize: i,\n textarea: r\n };\n }\n}), fe = [\"name\", \"placeholder\"];\nfunction he(e, o, r, t, n, i) {\n return b(), S(\"textarea\", {\n ref: \"textarea\",\n name: e.$props.name,\n placeholder: e.$props.placeholder\n }, null, 8, fe);\n}\nconst ve = /* @__PURE__ */ I(me, [[\"render\", he]]), R = {\n \"update:value\": () => !0,\n change: (e, o) => ({ value: e, cm: o }),\n input: () => !0,\n ready: (e) => e\n}, ye = [\n \"changes\",\n \"scroll\",\n \"beforeChange\",\n \"cursorActivity\",\n \"keyHandled\",\n \"inputRead\",\n \"electricInput\",\n \"beforeSelectionChange\",\n \"viewportChange\",\n \"swapDoc\",\n \"gutterClick\",\n \"gutterContextMenu\",\n \"focus\",\n \"blur\",\n \"refresh\",\n \"optionChange\",\n \"scrollCursorIntoView\",\n \"update\"\n], we = () => {\n const e = {};\n return ye.forEach((o) => {\n e[o] = (...r) => r;\n }), e;\n}, ke = { ...R, ...we() }, O = {\n mode: \"text\",\n // Language mode\n theme: \"default\",\n // Theme\n lineNumbers: !0,\n // Display line number\n smartIndent: !0,\n // Intelligent indentation\n indentUnit: 2\n};\nfunction $e(e) {\n Promise.resolve().then(() => {\n const o = e.getScrollInfo();\n e.scrollTo(o.left, o.height);\n });\n}\nconst xe = ({\n props: e,\n cminstance: o,\n emit: r,\n internalInstance: t,\n content: n\n}) => {\n const i = T(\n () => {\n var u;\n return e.merge ? (u = v(o)) == null ? void 0 : u.editor() : v(o);\n }\n ), a = () => {\n const u = [];\n return Object.keys(t == null ? void 0 : t.vnode.props).forEach((m) => {\n if (m.startsWith(\"on\")) {\n const c = m.replace(m[2], m[2].toLowerCase()).slice(2);\n !R[c] && u.push(c);\n }\n }), u;\n };\n return {\n listenerEvents: () => {\n i.value.on(\"change\", (c) => {\n const d = c.getValue();\n d === n.value && d !== \"\" || (n.value = d, r(\"update:value\", n.value || \"\"), r(\"input\", n.value || \" \"), Promise.resolve().then(() => {\n r(\"change\", n.value, c);\n }), e.keepCursorInEnd && $e(c));\n });\n const u = {};\n a().filter((c) => !u[c] && (u[c] = !0)).forEach((c) => {\n i.value.on(c, (...d) => {\n r(c, ...d);\n });\n });\n }\n };\n};\nfunction _e({\n props: e,\n cminstance: o,\n presetRef: r\n}) {\n const t = y(null), n = y(null), i = T(\n () => {\n var l;\n return e.merge ? (l = v(o)) == null ? void 0 : l.editor() : v(o);\n }\n ), a = () => {\n G(() => {\n var l;\n (l = i.value) == null || l.refresh();\n });\n }, f = (l = e.width, p = e.height) => {\n var w;\n t.value = String(l).replace(\"px\", \"\"), n.value = String(p).replace(\"px\", \"\");\n const $ = n.value;\n (w = i.value) == null || w.setSize(t.value, $);\n }, u = () => {\n var p;\n const l = (p = i.value) == null ? void 0 : p.getWrapperElement();\n l == null || l.remove();\n }, m = () => {\n var p, $, w;\n const l = (p = i.value) == null ? void 0 : p.getDoc().getHistory();\n ($ = r.value) == null || $.initialize(), u(), (w = i.value) == null || w.getDoc().setHistory(l);\n }, c = () => {\n const l = document.querySelector(\n \".CodeMirror-gutters\"\n );\n return (l == null ? void 0 : l.style.left.replace(\"px\", \"\")) !== \"0\";\n };\n return {\n reload: m,\n refresh: a,\n resize: f,\n destroy: u,\n containerHeight: n,\n reviseStyle: () => {\n if (a(), !c())\n return;\n const l = setInterval(() => {\n c() ? a() : clearInterval(l);\n }, 60), p = setTimeout(() => {\n clearInterval(l), clearTimeout(p);\n }, 400);\n }\n };\n}\nconst F = /* @__PURE__ */ M({\n __name: \"index\",\n props: {\n value: {\n type: String,\n default: \"\"\n },\n options: {\n type: Object,\n default: () => O\n },\n globalOptions: {\n type: Object,\n default: () => O\n },\n placeholder: {\n type: String,\n default: \"\"\n },\n border: {\n type: Boolean,\n default: !1\n },\n width: {\n type: [String, Number],\n default: null\n },\n height: {\n type: [String, Number],\n default: null\n },\n originalStyle: {\n type: Boolean,\n default: !1\n },\n keepCursorInEnd: {\n type: Boolean,\n default: !1\n },\n merge: {\n type: Boolean,\n default: !1\n },\n name: {\n type: String,\n default: \"\"\n },\n marker: {\n type: Function,\n default: () => null\n },\n unseenLines: {\n type: Array,\n default: () => []\n }\n },\n emits: ke,\n setup(e, { expose: o, emit: r }) {\n var N, A;\n const t = e;\n typeof Object.assign != \"function\" && Object.defineProperty(Object, \"assign\", {\n value(s) {\n if (s == null)\n throw new TypeError(\"Cannot convert undefined or null to object\");\n const g = Object(s);\n for (let h = 1; h < arguments.length; h++) {\n const k = arguments[h];\n if (k != null)\n for (const E in k)\n Object.prototype.hasOwnProperty.call(k, E) && (g[E] = k[E]);\n }\n return g;\n },\n writable: !0,\n configurable: !0\n });\n const n = y(null), i = y(\"\"), a = Z(V), f = y({\n ...O,\n ...t.globalOptions,\n ...t.options\n }), u = q(), m = t.name || ((A = (N = u == null ? void 0 : u.parent) == null ? void 0 : N.type) == null ? void 0 : A.name) || void 0, c = y(null), d = T(\n () => {\n var s;\n return t.merge ? (s = v(n)) == null ? void 0 : s.editor() : v(n);\n }\n ), { refresh: l, resize: p, destroy: $, containerHeight: w, reviseStyle: B } = _e({\n props: t,\n cminstance: n,\n presetRef: c\n }), { listenerEvents: P } = xe({\n props: t,\n cminstance: n,\n emit: r,\n internalInstance: u,\n content: i\n }), D = () => {\n t.unseenLines !== void 0 && t.marker !== void 0 && t.unseenLines.forEach((s) => {\n var h, k;\n const g = (h = n.value) == null ? void 0 : h.lineInfo(s);\n (k = n.value) == null || k.setGutterMarker(\n s,\n \"breakpoints\",\n g != null && g.gutterMarkers ? null : t.marker()\n );\n });\n }, U = (s) => {\n var h, k;\n const g = (h = n.value) == null ? void 0 : h.getValue();\n s !== g && ((k = n.value) == null || k.setValue(s), i.value = s, B()), D();\n }, W = () => {\n P(), D(), p(t.width, t.height), r(\"ready\", n.value), x(\n [() => t.width, () => t.height],\n ([s, g]) => {\n p(s, g);\n },\n { deep: !0 }\n );\n }, J = () => {\n if (t.options.mode === \"fclog\" || t.options.mode === \"log\") {\n a.value = ve;\n return;\n }\n if (t.merge) {\n a.value = ie;\n return;\n }\n a.value = V;\n };\n return x(\n () => t.options,\n (s) => {\n var g;\n for (const h in t.options)\n (g = d.value) == null || g.setOption(\n h,\n v(s[h])\n );\n },\n { deep: !0 }\n ), x(\n () => t.value,\n (s) => {\n U(s);\n }\n ), x(() => t.merge, J, { immediate: !0 }), K(() => {\n $();\n }), o({\n cminstance: n,\n resize: p,\n refresh: l,\n destroy: $\n }), (s, g) => (b(), S(\"div\", {\n class: Q([\"codemirror-container\", {\n merge: s.$props.merge,\n bordered: s.$props.border || s.$props.merge && !t.originalStyle,\n \"width-auto\": !s.$props.width || s.$props.width == \"100%\",\n \"height-auto\": !s.$props.height || s.$props.height == \"100%\",\n \"original-style\": t.originalStyle\n }]),\n style: X({\n height: v(w) + \"px\"\n })\n }, [\n (b(), Y(ee(v(a)), te({\n ref_key: \"presetRef\",\n ref: c,\n cminstance: n.value,\n \"onUpdate:cminstance\": g[0] || (g[0] = (h) => n.value = h),\n style: { height: \"100%\" }\n }, {\n ...s.$props,\n ...s.$attrs,\n options: f.value,\n name: v(m),\n content: i.value\n }, { onReady: W }), null, 16, [\"cminstance\"]))\n ], 6));\n }\n});\nconst z = (e, o) => (o && o.options && (F.props.globalOptions.default = () => o.options), e.component((o == null ? void 0 : o.componentName) || \"Codemirror\", F), e), Ne = window.CodeMirror || _, Ae = z, Ve = z;\nfunction styleInject(css,ref){if(ref===void 0){ref={}}var insertAt=ref.insertAt;if(!css||typeof document===\"undefined\"){return}var head=document.head||document.getElementsByTagName(\"head\")[0];var style=document.createElement(\"style\");style.type=\"text/css\";if(insertAt===\"top\"){if(head.firstChild){head.insertBefore(style,head.firstChild)}else{head.appendChild(style)}}else{head.appendChild(style)}if(style.styleSheet){style.styleSheet.cssText=css}else{style.appendChild(document.createTextNode(css))}};styleInject(`.codemirror-container {\n position: relative;\n display: inline-block;\n height: 100%;\n width: fit-content;\n font-size: 12px;\n overflow: hidden;\n}\n.codemirror-container.bordered {\n border-radius: 4px;\n border: 1px solid #dddddd;\n}\n.codemirror-container.width-auto {\n width: 100%;\n}\n.codemirror-container.height-auto {\n height: 100%;\n}\n.codemirror-container.height-auto .CodeMirror,\n.codemirror-container.height-auto .cm-s-default {\n height: 100% !important;\n}\n.codemirror-container .editor_custom_link {\n cursor: pointer;\n color: #1474f1;\n text-decoration: underline;\n}\n.codemirror-container .editor_custom_link:hover {\n color: #04b4fa;\n}\n.codemirror-container:not(.original-style) .CodeMirror-lines .CodeMirror-placeholder.CodeMirror-line-like {\n color: #666;\n}\n.codemirror-container:not(.original-style) .CodeMirror,\n.codemirror-container:not(.original-style) .CodeMirror-merge-pane {\n height: 100%;\n font-family: consolas !important;\n}\n.codemirror-container:not(.original-style) .CodeMirror-merge,\n.codemirror-container:not(.original-style) .CodeMirror-merge-right .CodeMirror {\n height: 100%;\n border: none !important;\n}\n.codemirror-container:not(.original-style) .c-editor--log__error {\n color: #bb0606;\n font-weight: bold;\n}\n.codemirror-container:not(.original-style) .c-editor--log__info {\n color: #333333;\n font-weight: bold;\n}\n.codemirror-container:not(.original-style) .c-editor--log__warning {\n color: #ee9900;\n}\n.codemirror-container:not(.original-style) .c-editor--log__success {\n color: #669600;\n}\n.codemirror-container:not(.original-style) .cm-header,\n.codemirror-container:not(.original-style) .cm-strong {\n font-weight: bold;\n}\n`);\nexport {\n Ne as CodeMirror,\n Ae as GlobalCmComponent,\n Ve as InstallCodemirro,\n F as VueCodemirror,\n Le as createLinkMark,\n Ie as createLog,\n Te as createLogMark,\n De as createTitle,\n F as default,\n pe as getLinkMarks,\n de as getLocalTime,\n ge as getLogMark,\n ue as logErrorType\n};\n","/*jshint node:true */\n/*\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction OutputLine(parent) {\n this.__parent = parent;\n this.__character_count = 0;\n // use indent_count as a marker for this.__lines that have preserved indentation\n this.__indent_count = -1;\n this.__alignment_count = 0;\n this.__wrap_point_index = 0;\n this.__wrap_point_character_count = 0;\n this.__wrap_point_indent_count = -1;\n this.__wrap_point_alignment_count = 0;\n\n this.__items = [];\n}\n\nOutputLine.prototype.clone_empty = function() {\n var line = new OutputLine(this.__parent);\n line.set_indent(this.__indent_count, this.__alignment_count);\n return line;\n};\n\nOutputLine.prototype.item = function(index) {\n if (index < 0) {\n return this.__items[this.__items.length + index];\n } else {\n return this.__items[index];\n }\n};\n\nOutputLine.prototype.has_match = function(pattern) {\n for (var lastCheckedOutput = this.__items.length - 1; lastCheckedOutput >= 0; lastCheckedOutput--) {\n if (this.__items[lastCheckedOutput].match(pattern)) {\n return true;\n }\n }\n return false;\n};\n\nOutputLine.prototype.set_indent = function(indent, alignment) {\n if (this.is_empty()) {\n this.__indent_count = indent || 0;\n this.__alignment_count = alignment || 0;\n this.__character_count = this.__parent.get_indent_size(this.__indent_count, this.__alignment_count);\n }\n};\n\nOutputLine.prototype._set_wrap_point = function() {\n if (this.__parent.wrap_line_length) {\n this.__wrap_point_index = this.__items.length;\n this.__wrap_point_character_count = this.__character_count;\n this.__wrap_point_indent_count = this.__parent.next_line.__indent_count;\n this.__wrap_point_alignment_count = this.__parent.next_line.__alignment_count;\n }\n};\n\nOutputLine.prototype._should_wrap = function() {\n return this.__wrap_point_index &&\n this.__character_count > this.__parent.wrap_line_length &&\n this.__wrap_point_character_count > this.__parent.next_line.__character_count;\n};\n\nOutputLine.prototype._allow_wrap = function() {\n if (this._should_wrap()) {\n this.__parent.add_new_line();\n var next = this.__parent.current_line;\n next.set_indent(this.__wrap_point_indent_count, this.__wrap_point_alignment_count);\n next.__items = this.__items.slice(this.__wrap_point_index);\n this.__items = this.__items.slice(0, this.__wrap_point_index);\n\n next.__character_count += this.__character_count - this.__wrap_point_character_count;\n this.__character_count = this.__wrap_point_character_count;\n\n if (next.__items[0] === \" \") {\n next.__items.splice(0, 1);\n next.__character_count -= 1;\n }\n return true;\n }\n return false;\n};\n\nOutputLine.prototype.is_empty = function() {\n return this.__items.length === 0;\n};\n\nOutputLine.prototype.last = function() {\n if (!this.is_empty()) {\n return this.__items[this.__items.length - 1];\n } else {\n return null;\n }\n};\n\nOutputLine.prototype.push = function(item) {\n this.__items.push(item);\n var last_newline_index = item.lastIndexOf('\\n');\n if (last_newline_index !== -1) {\n this.__character_count = item.length - last_newline_index;\n } else {\n this.__character_count += item.length;\n }\n};\n\nOutputLine.prototype.pop = function() {\n var item = null;\n if (!this.is_empty()) {\n item = this.__items.pop();\n this.__character_count -= item.length;\n }\n return item;\n};\n\n\nOutputLine.prototype._remove_indent = function() {\n if (this.__indent_count > 0) {\n this.__indent_count -= 1;\n this.__character_count -= this.__parent.indent_size;\n }\n};\n\nOutputLine.prototype._remove_wrap_indent = function() {\n if (this.__wrap_point_indent_count > 0) {\n this.__wrap_point_indent_count -= 1;\n }\n};\nOutputLine.prototype.trim = function() {\n while (this.last() === ' ') {\n this.__items.pop();\n this.__character_count -= 1;\n }\n};\n\nOutputLine.prototype.toString = function() {\n var result = '';\n if (this.is_empty()) {\n if (this.__parent.indent_empty_lines) {\n result = this.__parent.get_indent_string(this.__indent_count);\n }\n } else {\n result = this.__parent.get_indent_string(this.__indent_count, this.__alignment_count);\n result += this.__items.join('');\n }\n return result;\n};\n\nfunction IndentStringCache(options, baseIndentString) {\n this.__cache = [''];\n this.__indent_size = options.indent_size;\n this.__indent_string = options.indent_char;\n if (!options.indent_with_tabs) {\n this.__indent_string = new Array(options.indent_size + 1).join(options.indent_char);\n }\n\n // Set to null to continue support for auto detection of base indent\n baseIndentString = baseIndentString || '';\n if (options.indent_level > 0) {\n baseIndentString = new Array(options.indent_level + 1).join(this.__indent_string);\n }\n\n this.__base_string = baseIndentString;\n this.__base_string_length = baseIndentString.length;\n}\n\nIndentStringCache.prototype.get_indent_size = function(indent, column) {\n var result = this.__base_string_length;\n column = column || 0;\n if (indent < 0) {\n result = 0;\n }\n result += indent * this.__indent_size;\n result += column;\n return result;\n};\n\nIndentStringCache.prototype.get_indent_string = function(indent_level, column) {\n var result = this.__base_string;\n column = column || 0;\n if (indent_level < 0) {\n indent_level = 0;\n result = '';\n }\n column += indent_level * this.__indent_size;\n this.__ensure_cache(column);\n result += this.__cache[column];\n return result;\n};\n\nIndentStringCache.prototype.__ensure_cache = function(column) {\n while (column >= this.__cache.length) {\n this.__add_column();\n }\n};\n\nIndentStringCache.prototype.__add_column = function() {\n var column = this.__cache.length;\n var indent = 0;\n var result = '';\n if (this.__indent_size && column >= this.__indent_size) {\n indent = Math.floor(column / this.__indent_size);\n column -= indent * this.__indent_size;\n result = new Array(indent + 1).join(this.__indent_string);\n }\n if (column) {\n result += new Array(column + 1).join(' ');\n }\n\n this.__cache.push(result);\n};\n\nfunction Output(options, baseIndentString) {\n this.__indent_cache = new IndentStringCache(options, baseIndentString);\n this.raw = false;\n this._end_with_newline = options.end_with_newline;\n this.indent_size = options.indent_size;\n this.wrap_line_length = options.wrap_line_length;\n this.indent_empty_lines = options.indent_empty_lines;\n this.__lines = [];\n this.previous_line = null;\n this.current_line = null;\n this.next_line = new OutputLine(this);\n this.space_before_token = false;\n this.non_breaking_space = false;\n this.previous_token_wrapped = false;\n // initialize\n this.__add_outputline();\n}\n\nOutput.prototype.__add_outputline = function() {\n this.previous_line = this.current_line;\n this.current_line = this.next_line.clone_empty();\n this.__lines.push(this.current_line);\n};\n\nOutput.prototype.get_line_number = function() {\n return this.__lines.length;\n};\n\nOutput.prototype.get_indent_string = function(indent, column) {\n return this.__indent_cache.get_indent_string(indent, column);\n};\n\nOutput.prototype.get_indent_size = function(indent, column) {\n return this.__indent_cache.get_indent_size(indent, column);\n};\n\nOutput.prototype.is_empty = function() {\n return !this.previous_line && this.current_line.is_empty();\n};\n\nOutput.prototype.add_new_line = function(force_newline) {\n // never newline at the start of file\n // otherwise, newline only if we didn't just add one or we're forced\n if (this.is_empty() ||\n (!force_newline && this.just_added_newline())) {\n return false;\n }\n\n // if raw output is enabled, don't print additional newlines,\n // but still return True as though you had\n if (!this.raw) {\n this.__add_outputline();\n }\n return true;\n};\n\nOutput.prototype.get_code = function(eol) {\n this.trim(true);\n\n // handle some edge cases where the last tokens\n // has text that ends with newline(s)\n var last_item = this.current_line.pop();\n if (last_item) {\n if (last_item[last_item.length - 1] === '\\n') {\n last_item = last_item.replace(/\\n+$/g, '');\n }\n this.current_line.push(last_item);\n }\n\n if (this._end_with_newline) {\n this.__add_outputline();\n }\n\n var sweet_code = this.__lines.join('\\n');\n\n if (eol !== '\\n') {\n sweet_code = sweet_code.replace(/[\\n]/g, eol);\n }\n return sweet_code;\n};\n\nOutput.prototype.set_wrap_point = function() {\n this.current_line._set_wrap_point();\n};\n\nOutput.prototype.set_indent = function(indent, alignment) {\n indent = indent || 0;\n alignment = alignment || 0;\n\n // Next line stores alignment values\n this.next_line.set_indent(indent, alignment);\n\n // Never indent your first output indent at the start of the file\n if (this.__lines.length > 1) {\n this.current_line.set_indent(indent, alignment);\n return true;\n }\n\n this.current_line.set_indent();\n return false;\n};\n\nOutput.prototype.add_raw_token = function(token) {\n for (var x = 0; x < token.newlines; x++) {\n this.__add_outputline();\n }\n this.current_line.set_indent(-1);\n this.current_line.push(token.whitespace_before);\n this.current_line.push(token.text);\n this.space_before_token = false;\n this.non_breaking_space = false;\n this.previous_token_wrapped = false;\n};\n\nOutput.prototype.add_token = function(printable_token) {\n this.__add_space_before_token();\n this.current_line.push(printable_token);\n this.space_before_token = false;\n this.non_breaking_space = false;\n this.previous_token_wrapped = this.current_line._allow_wrap();\n};\n\nOutput.prototype.__add_space_before_token = function() {\n if (this.space_before_token && !this.just_added_newline()) {\n if (!this.non_breaking_space) {\n this.set_wrap_point();\n }\n this.current_line.push(' ');\n }\n};\n\nOutput.prototype.remove_indent = function(index) {\n var output_length = this.__lines.length;\n while (index < output_length) {\n this.__lines[index]._remove_indent();\n index++;\n }\n this.current_line._remove_wrap_indent();\n};\n\nOutput.prototype.trim = function(eat_newlines) {\n eat_newlines = (eat_newlines === undefined) ? false : eat_newlines;\n\n this.current_line.trim();\n\n while (eat_newlines && this.__lines.length > 1 &&\n this.current_line.is_empty()) {\n this.__lines.pop();\n this.current_line = this.__lines[this.__lines.length - 1];\n this.current_line.trim();\n }\n\n this.previous_line = this.__lines.length > 1 ?\n this.__lines[this.__lines.length - 2] : null;\n};\n\nOutput.prototype.just_added_newline = function() {\n return this.current_line.is_empty();\n};\n\nOutput.prototype.just_added_blankline = function() {\n return this.is_empty() ||\n (this.current_line.is_empty() && this.previous_line.is_empty());\n};\n\nOutput.prototype.ensure_empty_line_above = function(starts_with, ends_with) {\n var index = this.__lines.length - 2;\n while (index >= 0) {\n var potentialEmptyLine = this.__lines[index];\n if (potentialEmptyLine.is_empty()) {\n break;\n } else if (potentialEmptyLine.item(0).indexOf(starts_with) !== 0 &&\n potentialEmptyLine.item(-1) !== ends_with) {\n this.__lines.splice(index + 1, 0, new OutputLine(this));\n this.previous_line = this.__lines[this.__lines.length - 2];\n break;\n }\n index--;\n }\n};\n\nmodule.exports.Output = Output;\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction Token(type, text, newlines, whitespace_before) {\n this.type = type;\n this.text = text;\n\n // comments_before are\n // comments that have a new line before them\n // and may or may not have a newline after\n // this is a set of comments before\n this.comments_before = null; /* inline comment*/\n\n\n // this.comments_after = new TokenStream(); // no new line before and newline after\n this.newlines = newlines || 0;\n this.whitespace_before = whitespace_before || '';\n this.parent = null;\n this.next = null;\n this.previous = null;\n this.opened = null;\n this.closed = null;\n this.directives = null;\n}\n\n\nmodule.exports.Token = Token;\n","/* jshint node: true, curly: false */\n// Parts of this section of code is taken from acorn.\n//\n// Acorn was written by Marijn Haverbeke and released under an MIT\n// license. The Unicode regexps (for identifiers and whitespace) were\n// taken from [Esprima](http://esprima.org) by Ariya Hidayat.\n//\n// Git repositories for Acorn are available at\n//\n// http://marijnhaverbeke.nl/git/acorn\n// https://github.com/marijnh/acorn.git\n\n// ## Character categories\n\n\n'use strict';\n\n// acorn used char codes to squeeze the last bit of performance out\n// Beautifier is okay without that, so we're using regex\n// permit # (23), $ (36), and @ (64). @ is used in ES7 decorators.\n// 65 through 91 are uppercase letters.\n// permit _ (95).\n// 97 through 123 are lowercase letters.\nvar baseASCIIidentifierStartChars = \"\\\\x23\\\\x24\\\\x40\\\\x41-\\\\x5a\\\\x5f\\\\x61-\\\\x7a\";\n\n// inside an identifier @ is not allowed but 0-9 are.\nvar baseASCIIidentifierChars = \"\\\\x24\\\\x30-\\\\x39\\\\x41-\\\\x5a\\\\x5f\\\\x61-\\\\x7a\";\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point above 128.\nvar nonASCIIidentifierStartChars = \"\\\\xaa\\\\xb5\\\\xba\\\\xc0-\\\\xd6\\\\xd8-\\\\xf6\\\\xf8-\\\\u02c1\\\\u02c6-\\\\u02d1\\\\u02e0-\\\\u02e4\\\\u02ec\\\\u02ee\\\\u0370-\\\\u0374\\\\u0376\\\\u0377\\\\u037a-\\\\u037d\\\\u0386\\\\u0388-\\\\u038a\\\\u038c\\\\u038e-\\\\u03a1\\\\u03a3-\\\\u03f5\\\\u03f7-\\\\u0481\\\\u048a-\\\\u0527\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u05d0-\\\\u05ea\\\\u05f0-\\\\u05f2\\\\u0620-\\\\u064a\\\\u066e\\\\u066f\\\\u0671-\\\\u06d3\\\\u06d5\\\\u06e5\\\\u06e6\\\\u06ee\\\\u06ef\\\\u06fa-\\\\u06fc\\\\u06ff\\\\u0710\\\\u0712-\\\\u072f\\\\u074d-\\\\u07a5\\\\u07b1\\\\u07ca-\\\\u07ea\\\\u07f4\\\\u07f5\\\\u07fa\\\\u0800-\\\\u0815\\\\u081a\\\\u0824\\\\u0828\\\\u0840-\\\\u0858\\\\u08a0\\\\u08a2-\\\\u08ac\\\\u0904-\\\\u0939\\\\u093d\\\\u0950\\\\u0958-\\\\u0961\\\\u0971-\\\\u0977\\\\u0979-\\\\u097f\\\\u0985-\\\\u098c\\\\u098f\\\\u0990\\\\u0993-\\\\u09a8\\\\u09aa-\\\\u09b0\\\\u09b2\\\\u09b6-\\\\u09b9\\\\u09bd\\\\u09ce\\\\u09dc\\\\u09dd\\\\u09df-\\\\u09e1\\\\u09f0\\\\u09f1\\\\u0a05-\\\\u0a0a\\\\u0a0f\\\\u0a10\\\\u0a13-\\\\u0a28\\\\u0a2a-\\\\u0a30\\\\u0a32\\\\u0a33\\\\u0a35\\\\u0a36\\\\u0a38\\\\u0a39\\\\u0a59-\\\\u0a5c\\\\u0a5e\\\\u0a72-\\\\u0a74\\\\u0a85-\\\\u0a8d\\\\u0a8f-\\\\u0a91\\\\u0a93-\\\\u0aa8\\\\u0aaa-\\\\u0ab0\\\\u0ab2\\\\u0ab3\\\\u0ab5-\\\\u0ab9\\\\u0abd\\\\u0ad0\\\\u0ae0\\\\u0ae1\\\\u0b05-\\\\u0b0c\\\\u0b0f\\\\u0b10\\\\u0b13-\\\\u0b28\\\\u0b2a-\\\\u0b30\\\\u0b32\\\\u0b33\\\\u0b35-\\\\u0b39\\\\u0b3d\\\\u0b5c\\\\u0b5d\\\\u0b5f-\\\\u0b61\\\\u0b71\\\\u0b83\\\\u0b85-\\\\u0b8a\\\\u0b8e-\\\\u0b90\\\\u0b92-\\\\u0b95\\\\u0b99\\\\u0b9a\\\\u0b9c\\\\u0b9e\\\\u0b9f\\\\u0ba3\\\\u0ba4\\\\u0ba8-\\\\u0baa\\\\u0bae-\\\\u0bb9\\\\u0bd0\\\\u0c05-\\\\u0c0c\\\\u0c0e-\\\\u0c10\\\\u0c12-\\\\u0c28\\\\u0c2a-\\\\u0c33\\\\u0c35-\\\\u0c39\\\\u0c3d\\\\u0c58\\\\u0c59\\\\u0c60\\\\u0c61\\\\u0c85-\\\\u0c8c\\\\u0c8e-\\\\u0c90\\\\u0c92-\\\\u0ca8\\\\u0caa-\\\\u0cb3\\\\u0cb5-\\\\u0cb9\\\\u0cbd\\\\u0cde\\\\u0ce0\\\\u0ce1\\\\u0cf1\\\\u0cf2\\\\u0d05-\\\\u0d0c\\\\u0d0e-\\\\u0d10\\\\u0d12-\\\\u0d3a\\\\u0d3d\\\\u0d4e\\\\u0d60\\\\u0d61\\\\u0d7a-\\\\u0d7f\\\\u0d85-\\\\u0d96\\\\u0d9a-\\\\u0db1\\\\u0db3-\\\\u0dbb\\\\u0dbd\\\\u0dc0-\\\\u0dc6\\\\u0e01-\\\\u0e30\\\\u0e32\\\\u0e33\\\\u0e40-\\\\u0e46\\\\u0e81\\\\u0e82\\\\u0e84\\\\u0e87\\\\u0e88\\\\u0e8a\\\\u0e8d\\\\u0e94-\\\\u0e97\\\\u0e99-\\\\u0e9f\\\\u0ea1-\\\\u0ea3\\\\u0ea5\\\\u0ea7\\\\u0eaa\\\\u0eab\\\\u0ead-\\\\u0eb0\\\\u0eb2\\\\u0eb3\\\\u0ebd\\\\u0ec0-\\\\u0ec4\\\\u0ec6\\\\u0edc-\\\\u0edf\\\\u0f00\\\\u0f40-\\\\u0f47\\\\u0f49-\\\\u0f6c\\\\u0f88-\\\\u0f8c\\\\u1000-\\\\u102a\\\\u103f\\\\u1050-\\\\u1055\\\\u105a-\\\\u105d\\\\u1061\\\\u1065\\\\u1066\\\\u106e-\\\\u1070\\\\u1075-\\\\u1081\\\\u108e\\\\u10a0-\\\\u10c5\\\\u10c7\\\\u10cd\\\\u10d0-\\\\u10fa\\\\u10fc-\\\\u1248\\\\u124a-\\\\u124d\\\\u1250-\\\\u1256\\\\u1258\\\\u125a-\\\\u125d\\\\u1260-\\\\u1288\\\\u128a-\\\\u128d\\\\u1290-\\\\u12b0\\\\u12b2-\\\\u12b5\\\\u12b8-\\\\u12be\\\\u12c0\\\\u12c2-\\\\u12c5\\\\u12c8-\\\\u12d6\\\\u12d8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135a\\\\u1380-\\\\u138f\\\\u13a0-\\\\u13f4\\\\u1401-\\\\u166c\\\\u166f-\\\\u167f\\\\u1681-\\\\u169a\\\\u16a0-\\\\u16ea\\\\u16ee-\\\\u16f0\\\\u1700-\\\\u170c\\\\u170e-\\\\u1711\\\\u1720-\\\\u1731\\\\u1740-\\\\u1751\\\\u1760-\\\\u176c\\\\u176e-\\\\u1770\\\\u1780-\\\\u17b3\\\\u17d7\\\\u17dc\\\\u1820-\\\\u1877\\\\u1880-\\\\u18a8\\\\u18aa\\\\u18b0-\\\\u18f5\\\\u1900-\\\\u191c\\\\u1950-\\\\u196d\\\\u1970-\\\\u1974\\\\u1980-\\\\u19ab\\\\u19c1-\\\\u19c7\\\\u1a00-\\\\u1a16\\\\u1a20-\\\\u1a54\\\\u1aa7\\\\u1b05-\\\\u1b33\\\\u1b45-\\\\u1b4b\\\\u1b83-\\\\u1ba0\\\\u1bae\\\\u1baf\\\\u1bba-\\\\u1be5\\\\u1c00-\\\\u1c23\\\\u1c4d-\\\\u1c4f\\\\u1c5a-\\\\u1c7d\\\\u1ce9-\\\\u1cec\\\\u1cee-\\\\u1cf1\\\\u1cf5\\\\u1cf6\\\\u1d00-\\\\u1dbf\\\\u1e00-\\\\u1f15\\\\u1f18-\\\\u1f1d\\\\u1f20-\\\\u1f45\\\\u1f48-\\\\u1f4d\\\\u1f50-\\\\u1f57\\\\u1f59\\\\u1f5b\\\\u1f5d\\\\u1f5f-\\\\u1f7d\\\\u1f80-\\\\u1fb4\\\\u1fb6-\\\\u1fbc\\\\u1fbe\\\\u1fc2-\\\\u1fc4\\\\u1fc6-\\\\u1fcc\\\\u1fd0-\\\\u1fd3\\\\u1fd6-\\\\u1fdb\\\\u1fe0-\\\\u1fec\\\\u1ff2-\\\\u1ff4\\\\u1ff6-\\\\u1ffc\\\\u2071\\\\u207f\\\\u2090-\\\\u209c\\\\u2102\\\\u2107\\\\u210a-\\\\u2113\\\\u2115\\\\u2119-\\\\u211d\\\\u2124\\\\u2126\\\\u2128\\\\u212a-\\\\u212d\\\\u212f-\\\\u2139\\\\u213c-\\\\u213f\\\\u2145-\\\\u2149\\\\u214e\\\\u2160-\\\\u2188\\\\u2c00-\\\\u2c2e\\\\u2c30-\\\\u2c5e\\\\u2c60-\\\\u2ce4\\\\u2ceb-\\\\u2cee\\\\u2cf2\\\\u2cf3\\\\u2d00-\\\\u2d25\\\\u2d27\\\\u2d2d\\\\u2d30-\\\\u2d67\\\\u2d6f\\\\u2d80-\\\\u2d96\\\\u2da0-\\\\u2da6\\\\u2da8-\\\\u2dae\\\\u2db0-\\\\u2db6\\\\u2db8-\\\\u2dbe\\\\u2dc0-\\\\u2dc6\\\\u2dc8-\\\\u2dce\\\\u2dd0-\\\\u2dd6\\\\u2dd8-\\\\u2dde\\\\u2e2f\\\\u3005-\\\\u3007\\\\u3021-\\\\u3029\\\\u3031-\\\\u3035\\\\u3038-\\\\u303c\\\\u3041-\\\\u3096\\\\u309d-\\\\u309f\\\\u30a1-\\\\u30fa\\\\u30fc-\\\\u30ff\\\\u3105-\\\\u312d\\\\u3131-\\\\u318e\\\\u31a0-\\\\u31ba\\\\u31f0-\\\\u31ff\\\\u3400-\\\\u4db5\\\\u4e00-\\\\u9fcc\\\\ua000-\\\\ua48c\\\\ua4d0-\\\\ua4fd\\\\ua500-\\\\ua60c\\\\ua610-\\\\ua61f\\\\ua62a\\\\ua62b\\\\ua640-\\\\ua66e\\\\ua67f-\\\\ua697\\\\ua6a0-\\\\ua6ef\\\\ua717-\\\\ua71f\\\\ua722-\\\\ua788\\\\ua78b-\\\\ua78e\\\\ua790-\\\\ua793\\\\ua7a0-\\\\ua7aa\\\\ua7f8-\\\\ua801\\\\ua803-\\\\ua805\\\\ua807-\\\\ua80a\\\\ua80c-\\\\ua822\\\\ua840-\\\\ua873\\\\ua882-\\\\ua8b3\\\\ua8f2-\\\\ua8f7\\\\ua8fb\\\\ua90a-\\\\ua925\\\\ua930-\\\\ua946\\\\ua960-\\\\ua97c\\\\ua984-\\\\ua9b2\\\\ua9cf\\\\uaa00-\\\\uaa28\\\\uaa40-\\\\uaa42\\\\uaa44-\\\\uaa4b\\\\uaa60-\\\\uaa76\\\\uaa7a\\\\uaa80-\\\\uaaaf\\\\uaab1\\\\uaab5\\\\uaab6\\\\uaab9-\\\\uaabd\\\\uaac0\\\\uaac2\\\\uaadb-\\\\uaadd\\\\uaae0-\\\\uaaea\\\\uaaf2-\\\\uaaf4\\\\uab01-\\\\uab06\\\\uab09-\\\\uab0e\\\\uab11-\\\\uab16\\\\uab20-\\\\uab26\\\\uab28-\\\\uab2e\\\\uabc0-\\\\uabe2\\\\uac00-\\\\ud7a3\\\\ud7b0-\\\\ud7c6\\\\ud7cb-\\\\ud7fb\\\\uf900-\\\\ufa6d\\\\ufa70-\\\\ufad9\\\\ufb00-\\\\ufb06\\\\ufb13-\\\\ufb17\\\\ufb1d\\\\ufb1f-\\\\ufb28\\\\ufb2a-\\\\ufb36\\\\ufb38-\\\\ufb3c\\\\ufb3e\\\\ufb40\\\\ufb41\\\\ufb43\\\\ufb44\\\\ufb46-\\\\ufbb1\\\\ufbd3-\\\\ufd3d\\\\ufd50-\\\\ufd8f\\\\ufd92-\\\\ufdc7\\\\ufdf0-\\\\ufdfb\\\\ufe70-\\\\ufe74\\\\ufe76-\\\\ufefc\\\\uff21-\\\\uff3a\\\\uff41-\\\\uff5a\\\\uff66-\\\\uffbe\\\\uffc2-\\\\uffc7\\\\uffca-\\\\uffcf\\\\uffd2-\\\\uffd7\\\\uffda-\\\\uffdc\";\nvar nonASCIIidentifierChars = \"\\\\u0300-\\\\u036f\\\\u0483-\\\\u0487\\\\u0591-\\\\u05bd\\\\u05bf\\\\u05c1\\\\u05c2\\\\u05c4\\\\u05c5\\\\u05c7\\\\u0610-\\\\u061a\\\\u0620-\\\\u0649\\\\u0672-\\\\u06d3\\\\u06e7-\\\\u06e8\\\\u06fb-\\\\u06fc\\\\u0730-\\\\u074a\\\\u0800-\\\\u0814\\\\u081b-\\\\u0823\\\\u0825-\\\\u0827\\\\u0829-\\\\u082d\\\\u0840-\\\\u0857\\\\u08e4-\\\\u08fe\\\\u0900-\\\\u0903\\\\u093a-\\\\u093c\\\\u093e-\\\\u094f\\\\u0951-\\\\u0957\\\\u0962-\\\\u0963\\\\u0966-\\\\u096f\\\\u0981-\\\\u0983\\\\u09bc\\\\u09be-\\\\u09c4\\\\u09c7\\\\u09c8\\\\u09d7\\\\u09df-\\\\u09e0\\\\u0a01-\\\\u0a03\\\\u0a3c\\\\u0a3e-\\\\u0a42\\\\u0a47\\\\u0a48\\\\u0a4b-\\\\u0a4d\\\\u0a51\\\\u0a66-\\\\u0a71\\\\u0a75\\\\u0a81-\\\\u0a83\\\\u0abc\\\\u0abe-\\\\u0ac5\\\\u0ac7-\\\\u0ac9\\\\u0acb-\\\\u0acd\\\\u0ae2-\\\\u0ae3\\\\u0ae6-\\\\u0aef\\\\u0b01-\\\\u0b03\\\\u0b3c\\\\u0b3e-\\\\u0b44\\\\u0b47\\\\u0b48\\\\u0b4b-\\\\u0b4d\\\\u0b56\\\\u0b57\\\\u0b5f-\\\\u0b60\\\\u0b66-\\\\u0b6f\\\\u0b82\\\\u0bbe-\\\\u0bc2\\\\u0bc6-\\\\u0bc8\\\\u0bca-\\\\u0bcd\\\\u0bd7\\\\u0be6-\\\\u0bef\\\\u0c01-\\\\u0c03\\\\u0c46-\\\\u0c48\\\\u0c4a-\\\\u0c4d\\\\u0c55\\\\u0c56\\\\u0c62-\\\\u0c63\\\\u0c66-\\\\u0c6f\\\\u0c82\\\\u0c83\\\\u0cbc\\\\u0cbe-\\\\u0cc4\\\\u0cc6-\\\\u0cc8\\\\u0cca-\\\\u0ccd\\\\u0cd5\\\\u0cd6\\\\u0ce2-\\\\u0ce3\\\\u0ce6-\\\\u0cef\\\\u0d02\\\\u0d03\\\\u0d46-\\\\u0d48\\\\u0d57\\\\u0d62-\\\\u0d63\\\\u0d66-\\\\u0d6f\\\\u0d82\\\\u0d83\\\\u0dca\\\\u0dcf-\\\\u0dd4\\\\u0dd6\\\\u0dd8-\\\\u0ddf\\\\u0df2\\\\u0df3\\\\u0e34-\\\\u0e3a\\\\u0e40-\\\\u0e45\\\\u0e50-\\\\u0e59\\\\u0eb4-\\\\u0eb9\\\\u0ec8-\\\\u0ecd\\\\u0ed0-\\\\u0ed9\\\\u0f18\\\\u0f19\\\\u0f20-\\\\u0f29\\\\u0f35\\\\u0f37\\\\u0f39\\\\u0f41-\\\\u0f47\\\\u0f71-\\\\u0f84\\\\u0f86-\\\\u0f87\\\\u0f8d-\\\\u0f97\\\\u0f99-\\\\u0fbc\\\\u0fc6\\\\u1000-\\\\u1029\\\\u1040-\\\\u1049\\\\u1067-\\\\u106d\\\\u1071-\\\\u1074\\\\u1082-\\\\u108d\\\\u108f-\\\\u109d\\\\u135d-\\\\u135f\\\\u170e-\\\\u1710\\\\u1720-\\\\u1730\\\\u1740-\\\\u1750\\\\u1772\\\\u1773\\\\u1780-\\\\u17b2\\\\u17dd\\\\u17e0-\\\\u17e9\\\\u180b-\\\\u180d\\\\u1810-\\\\u1819\\\\u1920-\\\\u192b\\\\u1930-\\\\u193b\\\\u1951-\\\\u196d\\\\u19b0-\\\\u19c0\\\\u19c8-\\\\u19c9\\\\u19d0-\\\\u19d9\\\\u1a00-\\\\u1a15\\\\u1a20-\\\\u1a53\\\\u1a60-\\\\u1a7c\\\\u1a7f-\\\\u1a89\\\\u1a90-\\\\u1a99\\\\u1b46-\\\\u1b4b\\\\u1b50-\\\\u1b59\\\\u1b6b-\\\\u1b73\\\\u1bb0-\\\\u1bb9\\\\u1be6-\\\\u1bf3\\\\u1c00-\\\\u1c22\\\\u1c40-\\\\u1c49\\\\u1c5b-\\\\u1c7d\\\\u1cd0-\\\\u1cd2\\\\u1d00-\\\\u1dbe\\\\u1e01-\\\\u1f15\\\\u200c\\\\u200d\\\\u203f\\\\u2040\\\\u2054\\\\u20d0-\\\\u20dc\\\\u20e1\\\\u20e5-\\\\u20f0\\\\u2d81-\\\\u2d96\\\\u2de0-\\\\u2dff\\\\u3021-\\\\u3028\\\\u3099\\\\u309a\\\\ua640-\\\\ua66d\\\\ua674-\\\\ua67d\\\\ua69f\\\\ua6f0-\\\\ua6f1\\\\ua7f8-\\\\ua800\\\\ua806\\\\ua80b\\\\ua823-\\\\ua827\\\\ua880-\\\\ua881\\\\ua8b4-\\\\ua8c4\\\\ua8d0-\\\\ua8d9\\\\ua8f3-\\\\ua8f7\\\\ua900-\\\\ua909\\\\ua926-\\\\ua92d\\\\ua930-\\\\ua945\\\\ua980-\\\\ua983\\\\ua9b3-\\\\ua9c0\\\\uaa00-\\\\uaa27\\\\uaa40-\\\\uaa41\\\\uaa4c-\\\\uaa4d\\\\uaa50-\\\\uaa59\\\\uaa7b\\\\uaae0-\\\\uaae9\\\\uaaf2-\\\\uaaf3\\\\uabc0-\\\\uabe1\\\\uabec\\\\uabed\\\\uabf0-\\\\uabf9\\\\ufb20-\\\\ufb28\\\\ufe00-\\\\ufe0f\\\\ufe20-\\\\ufe26\\\\ufe33\\\\ufe34\\\\ufe4d-\\\\ufe4f\\\\uff10-\\\\uff19\\\\uff3f\";\n//var nonASCIIidentifierStart = new RegExp(\"[\" + nonASCIIidentifierStartChars + \"]\");\n//var nonASCIIidentifier = new RegExp(\"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\");\n\nvar identifierStart = \"(?:\\\\\\\\u[0-9a-fA-F]{4}|[\" + baseASCIIidentifierStartChars + nonASCIIidentifierStartChars + \"])\";\nvar identifierChars = \"(?:\\\\\\\\u[0-9a-fA-F]{4}|[\" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"])*\";\n\nexports.identifier = new RegExp(identifierStart + identifierChars, 'g');\nexports.identifierStart = new RegExp(identifierStart);\nexports.identifierMatch = new RegExp(\"(?:\\\\\\\\u[0-9a-fA-F]{4}|[\" + baseASCIIidentifierChars + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"])+\");\n\nvar nonASCIIwhitespace = /[\\u1680\\u180e\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff]/; // jshint ignore:line\n\n// Whether a single character denotes a newline.\n\nexports.newline = /[\\n\\r\\u2028\\u2029]/;\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\n\n// in javascript, these two differ\n// in python they are the same, different methods are called on them\nexports.lineBreak = new RegExp('\\r\\n|' + exports.newline.source);\nexports.allLineBreaks = new RegExp(exports.lineBreak.source, 'g');\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction Options(options, merge_child_field) {\n this.raw_options = _mergeOpts(options, merge_child_field);\n\n // Support passing the source text back with no change\n this.disabled = this._get_boolean('disabled');\n\n this.eol = this._get_characters('eol', 'auto');\n this.end_with_newline = this._get_boolean('end_with_newline');\n this.indent_size = this._get_number('indent_size', 4);\n this.indent_char = this._get_characters('indent_char', ' ');\n this.indent_level = this._get_number('indent_level');\n\n this.preserve_newlines = this._get_boolean('preserve_newlines', true);\n this.max_preserve_newlines = this._get_number('max_preserve_newlines', 32786);\n if (!this.preserve_newlines) {\n this.max_preserve_newlines = 0;\n }\n\n this.indent_with_tabs = this._get_boolean('indent_with_tabs', this.indent_char === '\\t');\n if (this.indent_with_tabs) {\n this.indent_char = '\\t';\n\n // indent_size behavior changed after 1.8.6\n // It used to be that indent_size would be\n // set to 1 for indent_with_tabs. That is no longer needed and\n // actually doesn't make sense - why not use spaces? Further,\n // that might produce unexpected behavior - tabs being used\n // for single-column alignment. So, when indent_with_tabs is true\n // and indent_size is 1, reset indent_size to 4.\n if (this.indent_size === 1) {\n this.indent_size = 4;\n }\n }\n\n // Backwards compat with 1.3.x\n this.wrap_line_length = this._get_number('wrap_line_length', this._get_number('max_char'));\n\n this.indent_empty_lines = this._get_boolean('indent_empty_lines');\n\n // valid templating languages ['django', 'erb', 'handlebars', 'php', 'smarty']\n // For now, 'auto' = all off for javascript, all on for html (and inline javascript).\n // other values ignored\n this.templating = this._get_selection_list('templating', ['auto', 'none', 'django', 'erb', 'handlebars', 'php', 'smarty'], ['auto']);\n}\n\nOptions.prototype._get_array = function(name, default_value) {\n var option_value = this.raw_options[name];\n var result = default_value || [];\n if (typeof option_value === 'object') {\n if (option_value !== null && typeof option_value.concat === 'function') {\n result = option_value.concat();\n }\n } else if (typeof option_value === 'string') {\n result = option_value.split(/[^a-zA-Z0-9_\\/\\-]+/);\n }\n return result;\n};\n\nOptions.prototype._get_boolean = function(name, default_value) {\n var option_value = this.raw_options[name];\n var result = option_value === undefined ? !!default_value : !!option_value;\n return result;\n};\n\nOptions.prototype._get_characters = function(name, default_value) {\n var option_value = this.raw_options[name];\n var result = default_value || '';\n if (typeof option_value === 'string') {\n result = option_value.replace(/\\\\r/, '\\r').replace(/\\\\n/, '\\n').replace(/\\\\t/, '\\t');\n }\n return result;\n};\n\nOptions.prototype._get_number = function(name, default_value) {\n var option_value = this.raw_options[name];\n default_value = parseInt(default_value, 10);\n if (isNaN(default_value)) {\n default_value = 0;\n }\n var result = parseInt(option_value, 10);\n if (isNaN(result)) {\n result = default_value;\n }\n return result;\n};\n\nOptions.prototype._get_selection = function(name, selection_list, default_value) {\n var result = this._get_selection_list(name, selection_list, default_value);\n if (result.length !== 1) {\n throw new Error(\n \"Invalid Option Value: The option '\" + name + \"' can only be one of the following values:\\n\" +\n selection_list + \"\\nYou passed in: '\" + this.raw_options[name] + \"'\");\n }\n\n return result[0];\n};\n\n\nOptions.prototype._get_selection_list = function(name, selection_list, default_value) {\n if (!selection_list || selection_list.length === 0) {\n throw new Error(\"Selection list cannot be empty.\");\n }\n\n default_value = default_value || [selection_list[0]];\n if (!this._is_valid_selection(default_value, selection_list)) {\n throw new Error(\"Invalid Default Value!\");\n }\n\n var result = this._get_array(name, default_value);\n if (!this._is_valid_selection(result, selection_list)) {\n throw new Error(\n \"Invalid Option Value: The option '\" + name + \"' can contain only the following values:\\n\" +\n selection_list + \"\\nYou passed in: '\" + this.raw_options[name] + \"'\");\n }\n\n return result;\n};\n\nOptions.prototype._is_valid_selection = function(result, selection_list) {\n return result.length && selection_list.length &&\n !result.some(function(item) { return selection_list.indexOf(item) === -1; });\n};\n\n\n// merges child options up with the parent options object\n// Example: obj = {a: 1, b: {a: 2}}\n// mergeOpts(obj, 'b')\n//\n// Returns: {a: 2}\nfunction _mergeOpts(allOptions, childFieldName) {\n var finalOpts = {};\n allOptions = _normalizeOpts(allOptions);\n var name;\n\n for (name in allOptions) {\n if (name !== childFieldName) {\n finalOpts[name] = allOptions[name];\n }\n }\n\n //merge in the per type settings for the childFieldName\n if (childFieldName && allOptions[childFieldName]) {\n for (name in allOptions[childFieldName]) {\n finalOpts[name] = allOptions[childFieldName][name];\n }\n }\n return finalOpts;\n}\n\nfunction _normalizeOpts(options) {\n var convertedOpts = {};\n var key;\n\n for (key in options) {\n var newKey = key.replace(/-/g, \"_\");\n convertedOpts[newKey] = options[key];\n }\n return convertedOpts;\n}\n\nmodule.exports.Options = Options;\nmodule.exports.normalizeOpts = _normalizeOpts;\nmodule.exports.mergeOpts = _mergeOpts;\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar BaseOptions = require('../core/options').Options;\n\nvar validPositionValues = ['before-newline', 'after-newline', 'preserve-newline'];\n\nfunction Options(options) {\n BaseOptions.call(this, options, 'js');\n\n // compatibility, re\n var raw_brace_style = this.raw_options.brace_style || null;\n if (raw_brace_style === \"expand-strict\") { //graceful handling of deprecated option\n this.raw_options.brace_style = \"expand\";\n } else if (raw_brace_style === \"collapse-preserve-inline\") { //graceful handling of deprecated option\n this.raw_options.brace_style = \"collapse,preserve-inline\";\n } else if (this.raw_options.braces_on_own_line !== undefined) { //graceful handling of deprecated option\n this.raw_options.brace_style = this.raw_options.braces_on_own_line ? \"expand\" : \"collapse\";\n // } else if (!raw_brace_style) { //Nothing exists to set it\n // raw_brace_style = \"collapse\";\n }\n\n //preserve-inline in delimited string will trigger brace_preserve_inline, everything\n //else is considered a brace_style and the last one only will have an effect\n\n var brace_style_split = this._get_selection_list('brace_style', ['collapse', 'expand', 'end-expand', 'none', 'preserve-inline']);\n\n this.brace_preserve_inline = false; //Defaults in case one or other was not specified in meta-option\n this.brace_style = \"collapse\";\n\n for (var bs = 0; bs < brace_style_split.length; bs++) {\n if (brace_style_split[bs] === \"preserve-inline\") {\n this.brace_preserve_inline = true;\n } else {\n this.brace_style = brace_style_split[bs];\n }\n }\n\n this.unindent_chained_methods = this._get_boolean('unindent_chained_methods');\n this.break_chained_methods = this._get_boolean('break_chained_methods');\n this.space_in_paren = this._get_boolean('space_in_paren');\n this.space_in_empty_paren = this._get_boolean('space_in_empty_paren');\n this.jslint_happy = this._get_boolean('jslint_happy');\n this.space_after_anon_function = this._get_boolean('space_after_anon_function');\n this.space_after_named_function = this._get_boolean('space_after_named_function');\n this.keep_array_indentation = this._get_boolean('keep_array_indentation');\n this.space_before_conditional = this._get_boolean('space_before_conditional', true);\n this.unescape_strings = this._get_boolean('unescape_strings');\n this.e4x = this._get_boolean('e4x');\n this.comma_first = this._get_boolean('comma_first');\n this.operator_position = this._get_selection('operator_position', validPositionValues);\n\n // For testing of beautify preserve:start directive\n this.test_output_raw = this._get_boolean('test_output_raw');\n\n // force this._options.space_after_anon_function to true if this._options.jslint_happy\n if (this.jslint_happy) {\n this.space_after_anon_function = true;\n }\n\n}\nOptions.prototype = new BaseOptions();\n\n\n\nmodule.exports.Options = Options;\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar regexp_has_sticky = RegExp.prototype.hasOwnProperty('sticky');\n\nfunction InputScanner(input_string) {\n this.__input = input_string || '';\n this.__input_length = this.__input.length;\n this.__position = 0;\n}\n\nInputScanner.prototype.restart = function() {\n this.__position = 0;\n};\n\nInputScanner.prototype.back = function() {\n if (this.__position > 0) {\n this.__position -= 1;\n }\n};\n\nInputScanner.prototype.hasNext = function() {\n return this.__position < this.__input_length;\n};\n\nInputScanner.prototype.next = function() {\n var val = null;\n if (this.hasNext()) {\n val = this.__input.charAt(this.__position);\n this.__position += 1;\n }\n return val;\n};\n\nInputScanner.prototype.peek = function(index) {\n var val = null;\n index = index || 0;\n index += this.__position;\n if (index >= 0 && index < this.__input_length) {\n val = this.__input.charAt(index);\n }\n return val;\n};\n\n// This is a JavaScript only helper function (not in python)\n// Javascript doesn't have a match method\n// and not all implementation support \"sticky\" flag.\n// If they do not support sticky then both this.match() and this.test() method\n// must get the match and check the index of the match.\n// If sticky is supported and set, this method will use it.\n// Otherwise it will check that global is set, and fall back to the slower method.\nInputScanner.prototype.__match = function(pattern, index) {\n pattern.lastIndex = index;\n var pattern_match = pattern.exec(this.__input);\n\n if (pattern_match && !(regexp_has_sticky && pattern.sticky)) {\n if (pattern_match.index !== index) {\n pattern_match = null;\n }\n }\n\n return pattern_match;\n};\n\nInputScanner.prototype.test = function(pattern, index) {\n index = index || 0;\n index += this.__position;\n\n if (index >= 0 && index < this.__input_length) {\n return !!this.__match(pattern, index);\n } else {\n return false;\n }\n};\n\nInputScanner.prototype.testChar = function(pattern, index) {\n // test one character regex match\n var val = this.peek(index);\n pattern.lastIndex = 0;\n return val !== null && pattern.test(val);\n};\n\nInputScanner.prototype.match = function(pattern) {\n var pattern_match = this.__match(pattern, this.__position);\n if (pattern_match) {\n this.__position += pattern_match[0].length;\n } else {\n pattern_match = null;\n }\n return pattern_match;\n};\n\nInputScanner.prototype.read = function(starting_pattern, until_pattern, until_after) {\n var val = '';\n var match;\n if (starting_pattern) {\n match = this.match(starting_pattern);\n if (match) {\n val += match[0];\n }\n }\n if (until_pattern && (match || !starting_pattern)) {\n val += this.readUntil(until_pattern, until_after);\n }\n return val;\n};\n\nInputScanner.prototype.readUntil = function(pattern, until_after) {\n var val = '';\n var match_index = this.__position;\n pattern.lastIndex = this.__position;\n var pattern_match = pattern.exec(this.__input);\n if (pattern_match) {\n match_index = pattern_match.index;\n if (until_after) {\n match_index += pattern_match[0].length;\n }\n } else {\n match_index = this.__input_length;\n }\n\n val = this.__input.substring(this.__position, match_index);\n this.__position = match_index;\n return val;\n};\n\nInputScanner.prototype.readUntilAfter = function(pattern) {\n return this.readUntil(pattern, true);\n};\n\nInputScanner.prototype.get_regexp = function(pattern, match_from) {\n var result = null;\n var flags = 'g';\n if (match_from && regexp_has_sticky) {\n flags = 'y';\n }\n // strings are converted to regexp\n if (typeof pattern === \"string\" && pattern !== '') {\n // result = new RegExp(pattern.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), flags);\n result = new RegExp(pattern, flags);\n } else if (pattern) {\n result = new RegExp(pattern.source, flags);\n }\n return result;\n};\n\nInputScanner.prototype.get_literal_regexp = function(literal_string) {\n return RegExp(literal_string.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'));\n};\n\n/* css beautifier legacy helpers */\nInputScanner.prototype.peekUntilAfter = function(pattern) {\n var start = this.__position;\n var val = this.readUntilAfter(pattern);\n this.__position = start;\n return val;\n};\n\nInputScanner.prototype.lookBack = function(testVal) {\n var start = this.__position - 1;\n return start >= testVal.length && this.__input.substring(start - testVal.length, start)\n .toLowerCase() === testVal;\n};\n\nmodule.exports.InputScanner = InputScanner;\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction TokenStream(parent_token) {\n // private\n this.__tokens = [];\n this.__tokens_length = this.__tokens.length;\n this.__position = 0;\n this.__parent_token = parent_token;\n}\n\nTokenStream.prototype.restart = function() {\n this.__position = 0;\n};\n\nTokenStream.prototype.isEmpty = function() {\n return this.__tokens_length === 0;\n};\n\nTokenStream.prototype.hasNext = function() {\n return this.__position < this.__tokens_length;\n};\n\nTokenStream.prototype.next = function() {\n var val = null;\n if (this.hasNext()) {\n val = this.__tokens[this.__position];\n this.__position += 1;\n }\n return val;\n};\n\nTokenStream.prototype.peek = function(index) {\n var val = null;\n index = index || 0;\n index += this.__position;\n if (index >= 0 && index < this.__tokens_length) {\n val = this.__tokens[index];\n }\n return val;\n};\n\nTokenStream.prototype.add = function(token) {\n if (this.__parent_token) {\n token.parent = this.__parent_token;\n }\n this.__tokens.push(token);\n this.__tokens_length += 1;\n};\n\nmodule.exports.TokenStream = TokenStream;\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction Pattern(input_scanner, parent) {\n this._input = input_scanner;\n this._starting_pattern = null;\n this._match_pattern = null;\n this._until_pattern = null;\n this._until_after = false;\n\n if (parent) {\n this._starting_pattern = this._input.get_regexp(parent._starting_pattern, true);\n this._match_pattern = this._input.get_regexp(parent._match_pattern, true);\n this._until_pattern = this._input.get_regexp(parent._until_pattern);\n this._until_after = parent._until_after;\n }\n}\n\nPattern.prototype.read = function() {\n var result = this._input.read(this._starting_pattern);\n if (!this._starting_pattern || result) {\n result += this._input.read(this._match_pattern, this._until_pattern, this._until_after);\n }\n return result;\n};\n\nPattern.prototype.read_match = function() {\n return this._input.match(this._match_pattern);\n};\n\nPattern.prototype.until_after = function(pattern) {\n var result = this._create();\n result._until_after = true;\n result._until_pattern = this._input.get_regexp(pattern);\n result._update();\n return result;\n};\n\nPattern.prototype.until = function(pattern) {\n var result = this._create();\n result._until_after = false;\n result._until_pattern = this._input.get_regexp(pattern);\n result._update();\n return result;\n};\n\nPattern.prototype.starting_with = function(pattern) {\n var result = this._create();\n result._starting_pattern = this._input.get_regexp(pattern, true);\n result._update();\n return result;\n};\n\nPattern.prototype.matching = function(pattern) {\n var result = this._create();\n result._match_pattern = this._input.get_regexp(pattern, true);\n result._update();\n return result;\n};\n\nPattern.prototype._create = function() {\n return new Pattern(this._input, this);\n};\n\nPattern.prototype._update = function() {};\n\nmodule.exports.Pattern = Pattern;\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Pattern = require('../core/pattern').Pattern;\n\nfunction WhitespacePattern(input_scanner, parent) {\n Pattern.call(this, input_scanner, parent);\n if (parent) {\n this._line_regexp = this._input.get_regexp(parent._line_regexp);\n } else {\n this.__set_whitespace_patterns('', '');\n }\n\n this.newline_count = 0;\n this.whitespace_before_token = '';\n}\nWhitespacePattern.prototype = new Pattern();\n\nWhitespacePattern.prototype.__set_whitespace_patterns = function(whitespace_chars, newline_chars) {\n whitespace_chars += '\\\\t ';\n newline_chars += '\\\\n\\\\r';\n\n this._match_pattern = this._input.get_regexp(\n '[' + whitespace_chars + newline_chars + ']+', true);\n this._newline_regexp = this._input.get_regexp(\n '\\\\r\\\\n|[' + newline_chars + ']');\n};\n\nWhitespacePattern.prototype.read = function() {\n this.newline_count = 0;\n this.whitespace_before_token = '';\n\n var resulting_string = this._input.read(this._match_pattern);\n if (resulting_string === ' ') {\n this.whitespace_before_token = ' ';\n } else if (resulting_string) {\n var matches = this.__split(this._newline_regexp, resulting_string);\n this.newline_count = matches.length - 1;\n this.whitespace_before_token = matches[this.newline_count];\n }\n\n return resulting_string;\n};\n\nWhitespacePattern.prototype.matching = function(whitespace_chars, newline_chars) {\n var result = this._create();\n result.__set_whitespace_patterns(whitespace_chars, newline_chars);\n result._update();\n return result;\n};\n\nWhitespacePattern.prototype._create = function() {\n return new WhitespacePattern(this._input, this);\n};\n\nWhitespacePattern.prototype.__split = function(regexp, input_string) {\n regexp.lastIndex = 0;\n var start_index = 0;\n var result = [];\n var next_match = regexp.exec(input_string);\n while (next_match) {\n result.push(input_string.substring(start_index, next_match.index));\n start_index = next_match.index + next_match[0].length;\n next_match = regexp.exec(input_string);\n }\n\n if (start_index < input_string.length) {\n result.push(input_string.substring(start_index, input_string.length));\n } else {\n result.push('');\n }\n\n return result;\n};\n\n\n\nmodule.exports.WhitespacePattern = WhitespacePattern;\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar InputScanner = require('../core/inputscanner').InputScanner;\nvar Token = require('../core/token').Token;\nvar TokenStream = require('../core/tokenstream').TokenStream;\nvar WhitespacePattern = require('./whitespacepattern').WhitespacePattern;\n\nvar TOKEN = {\n START: 'TK_START',\n RAW: 'TK_RAW',\n EOF: 'TK_EOF'\n};\n\nvar Tokenizer = function(input_string, options) {\n this._input = new InputScanner(input_string);\n this._options = options || {};\n this.__tokens = null;\n\n this._patterns = {};\n this._patterns.whitespace = new WhitespacePattern(this._input);\n};\n\nTokenizer.prototype.tokenize = function() {\n this._input.restart();\n this.__tokens = new TokenStream();\n\n this._reset();\n\n var current;\n var previous = new Token(TOKEN.START, '');\n var open_token = null;\n var open_stack = [];\n var comments = new TokenStream();\n\n while (previous.type !== TOKEN.EOF) {\n current = this._get_next_token(previous, open_token);\n while (this._is_comment(current)) {\n comments.add(current);\n current = this._get_next_token(previous, open_token);\n }\n\n if (!comments.isEmpty()) {\n current.comments_before = comments;\n comments = new TokenStream();\n }\n\n current.parent = open_token;\n\n if (this._is_opening(current)) {\n open_stack.push(open_token);\n open_token = current;\n } else if (open_token && this._is_closing(current, open_token)) {\n current.opened = open_token;\n open_token.closed = current;\n open_token = open_stack.pop();\n current.parent = open_token;\n }\n\n current.previous = previous;\n previous.next = current;\n\n this.__tokens.add(current);\n previous = current;\n }\n\n return this.__tokens;\n};\n\n\nTokenizer.prototype._is_first_token = function() {\n return this.__tokens.isEmpty();\n};\n\nTokenizer.prototype._reset = function() {};\n\nTokenizer.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false\n this._readWhitespace();\n var resulting_string = this._input.read(/.+/g);\n if (resulting_string) {\n return this._create_token(TOKEN.RAW, resulting_string);\n } else {\n return this._create_token(TOKEN.EOF, '');\n }\n};\n\nTokenizer.prototype._is_comment = function(current_token) { // jshint unused:false\n return false;\n};\n\nTokenizer.prototype._is_opening = function(current_token) { // jshint unused:false\n return false;\n};\n\nTokenizer.prototype._is_closing = function(current_token, open_token) { // jshint unused:false\n return false;\n};\n\nTokenizer.prototype._create_token = function(type, text) {\n var token = new Token(type, text,\n this._patterns.whitespace.newline_count,\n this._patterns.whitespace.whitespace_before_token);\n return token;\n};\n\nTokenizer.prototype._readWhitespace = function() {\n return this._patterns.whitespace.read();\n};\n\n\n\nmodule.exports.Tokenizer = Tokenizer;\nmodule.exports.TOKEN = TOKEN;\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nfunction Directives(start_block_pattern, end_block_pattern) {\n start_block_pattern = typeof start_block_pattern === 'string' ? start_block_pattern : start_block_pattern.source;\n end_block_pattern = typeof end_block_pattern === 'string' ? end_block_pattern : end_block_pattern.source;\n this.__directives_block_pattern = new RegExp(start_block_pattern + / beautify( \\w+[:]\\w+)+ /.source + end_block_pattern, 'g');\n this.__directive_pattern = / (\\w+)[:](\\w+)/g;\n\n this.__directives_end_ignore_pattern = new RegExp(start_block_pattern + /\\sbeautify\\signore:end\\s/.source + end_block_pattern, 'g');\n}\n\nDirectives.prototype.get_directives = function(text) {\n if (!text.match(this.__directives_block_pattern)) {\n return null;\n }\n\n var directives = {};\n this.__directive_pattern.lastIndex = 0;\n var directive_match = this.__directive_pattern.exec(text);\n\n while (directive_match) {\n directives[directive_match[1]] = directive_match[2];\n directive_match = this.__directive_pattern.exec(text);\n }\n\n return directives;\n};\n\nDirectives.prototype.readIgnored = function(input) {\n return input.readUntilAfter(this.__directives_end_ignore_pattern);\n};\n\n\nmodule.exports.Directives = Directives;\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Pattern = require('./pattern').Pattern;\n\n\nvar template_names = {\n django: false,\n erb: false,\n handlebars: false,\n php: false,\n smarty: false\n};\n\n// This lets templates appear anywhere we would do a readUntil\n// The cost is higher but it is pay to play.\nfunction TemplatablePattern(input_scanner, parent) {\n Pattern.call(this, input_scanner, parent);\n this.__template_pattern = null;\n this._disabled = Object.assign({}, template_names);\n this._excluded = Object.assign({}, template_names);\n\n if (parent) {\n this.__template_pattern = this._input.get_regexp(parent.__template_pattern);\n this._excluded = Object.assign(this._excluded, parent._excluded);\n this._disabled = Object.assign(this._disabled, parent._disabled);\n }\n var pattern = new Pattern(input_scanner);\n this.__patterns = {\n handlebars_comment: pattern.starting_with(/{{!--/).until_after(/--}}/),\n handlebars_unescaped: pattern.starting_with(/{{{/).until_after(/}}}/),\n handlebars: pattern.starting_with(/{{/).until_after(/}}/),\n php: pattern.starting_with(/<\\?(?:[= ]|php)/).until_after(/\\?>/),\n erb: pattern.starting_with(/<%[^%]/).until_after(/[^%]%>/),\n // django coflicts with handlebars a bit.\n django: pattern.starting_with(/{%/).until_after(/%}/),\n django_value: pattern.starting_with(/{{/).until_after(/}}/),\n django_comment: pattern.starting_with(/{#/).until_after(/#}/),\n smarty: pattern.starting_with(/{(?=[^}{\\s\\n])/).until_after(/[^\\s\\n]}/),\n smarty_comment: pattern.starting_with(/{\\*/).until_after(/\\*}/),\n smarty_literal: pattern.starting_with(/{literal}/).until_after(/{\\/literal}/)\n };\n}\nTemplatablePattern.prototype = new Pattern();\n\nTemplatablePattern.prototype._create = function() {\n return new TemplatablePattern(this._input, this);\n};\n\nTemplatablePattern.prototype._update = function() {\n this.__set_templated_pattern();\n};\n\nTemplatablePattern.prototype.disable = function(language) {\n var result = this._create();\n result._disabled[language] = true;\n result._update();\n return result;\n};\n\nTemplatablePattern.prototype.read_options = function(options) {\n var result = this._create();\n for (var language in template_names) {\n result._disabled[language] = options.templating.indexOf(language) === -1;\n }\n result._update();\n return result;\n};\n\nTemplatablePattern.prototype.exclude = function(language) {\n var result = this._create();\n result._excluded[language] = true;\n result._update();\n return result;\n};\n\nTemplatablePattern.prototype.read = function() {\n var result = '';\n if (this._match_pattern) {\n result = this._input.read(this._starting_pattern);\n } else {\n result = this._input.read(this._starting_pattern, this.__template_pattern);\n }\n var next = this._read_template();\n while (next) {\n if (this._match_pattern) {\n next += this._input.read(this._match_pattern);\n } else {\n next += this._input.readUntil(this.__template_pattern);\n }\n result += next;\n next = this._read_template();\n }\n\n if (this._until_after) {\n result += this._input.readUntilAfter(this._until_pattern);\n }\n return result;\n};\n\nTemplatablePattern.prototype.__set_templated_pattern = function() {\n var items = [];\n\n if (!this._disabled.php) {\n items.push(this.__patterns.php._starting_pattern.source);\n }\n if (!this._disabled.handlebars) {\n items.push(this.__patterns.handlebars._starting_pattern.source);\n }\n if (!this._disabled.erb) {\n items.push(this.__patterns.erb._starting_pattern.source);\n }\n if (!this._disabled.django) {\n items.push(this.__patterns.django._starting_pattern.source);\n // The starting pattern for django is more complex because it has different\n // patterns for value, comment, and other sections\n items.push(this.__patterns.django_value._starting_pattern.source);\n items.push(this.__patterns.django_comment._starting_pattern.source);\n }\n if (!this._disabled.smarty) {\n items.push(this.__patterns.smarty._starting_pattern.source);\n }\n\n if (this._until_pattern) {\n items.push(this._until_pattern.source);\n }\n this.__template_pattern = this._input.get_regexp('(?:' + items.join('|') + ')');\n};\n\nTemplatablePattern.prototype._read_template = function() {\n var resulting_string = '';\n var c = this._input.peek();\n if (c === '<') {\n var peek1 = this._input.peek(1);\n //if we're in a comment, do something special\n // We treat all comments as literals, even more than preformatted tags\n // we just look for the appropriate close tag\n if (!this._disabled.php && !this._excluded.php && peek1 === '?') {\n resulting_string = resulting_string ||\n this.__patterns.php.read();\n }\n if (!this._disabled.erb && !this._excluded.erb && peek1 === '%') {\n resulting_string = resulting_string ||\n this.__patterns.erb.read();\n }\n } else if (c === '{') {\n if (!this._disabled.handlebars && !this._excluded.handlebars) {\n resulting_string = resulting_string ||\n this.__patterns.handlebars_comment.read();\n resulting_string = resulting_string ||\n this.__patterns.handlebars_unescaped.read();\n resulting_string = resulting_string ||\n this.__patterns.handlebars.read();\n }\n if (!this._disabled.django) {\n // django coflicts with handlebars a bit.\n if (!this._excluded.django && !this._excluded.handlebars) {\n resulting_string = resulting_string ||\n this.__patterns.django_value.read();\n }\n if (!this._excluded.django) {\n resulting_string = resulting_string ||\n this.__patterns.django_comment.read();\n resulting_string = resulting_string ||\n this.__patterns.django.read();\n }\n }\n if (!this._disabled.smarty) {\n // smarty cannot be enabled with django or handlebars enabled\n if (this._disabled.django && this._disabled.handlebars) {\n resulting_string = resulting_string ||\n this.__patterns.smarty_comment.read();\n resulting_string = resulting_string ||\n this.__patterns.smarty_literal.read();\n resulting_string = resulting_string ||\n this.__patterns.smarty.read();\n }\n }\n }\n return resulting_string;\n};\n\n\nmodule.exports.TemplatablePattern = TemplatablePattern;\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar InputScanner = require('../core/inputscanner').InputScanner;\nvar BaseTokenizer = require('../core/tokenizer').Tokenizer;\nvar BASETOKEN = require('../core/tokenizer').TOKEN;\nvar Directives = require('../core/directives').Directives;\nvar acorn = require('./acorn');\nvar Pattern = require('../core/pattern').Pattern;\nvar TemplatablePattern = require('../core/templatablepattern').TemplatablePattern;\n\n\nfunction in_array(what, arr) {\n return arr.indexOf(what) !== -1;\n}\n\n\nvar TOKEN = {\n START_EXPR: 'TK_START_EXPR',\n END_EXPR: 'TK_END_EXPR',\n START_BLOCK: 'TK_START_BLOCK',\n END_BLOCK: 'TK_END_BLOCK',\n WORD: 'TK_WORD',\n RESERVED: 'TK_RESERVED',\n SEMICOLON: 'TK_SEMICOLON',\n STRING: 'TK_STRING',\n EQUALS: 'TK_EQUALS',\n OPERATOR: 'TK_OPERATOR',\n COMMA: 'TK_COMMA',\n BLOCK_COMMENT: 'TK_BLOCK_COMMENT',\n COMMENT: 'TK_COMMENT',\n DOT: 'TK_DOT',\n UNKNOWN: 'TK_UNKNOWN',\n START: BASETOKEN.START,\n RAW: BASETOKEN.RAW,\n EOF: BASETOKEN.EOF\n};\n\n\nvar directives_core = new Directives(/\\/\\*/, /\\*\\//);\n\nvar number_pattern = /0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\\d[\\d_]*n|(?:\\.\\d[\\d_]*|\\d[\\d_]*\\.?[\\d_]*)(?:[eE][+-]?[\\d_]+)?/;\n\nvar digit = /[0-9]/;\n\n// Dot \".\" must be distinguished from \"...\" and decimal\nvar dot_pattern = /[^\\d\\.]/;\n\nvar positionable_operators = (\n \">>> === !== &&= ??= ||= \" +\n \"<< && >= ** != == <= >> || ?? |> \" +\n \"< / - + > : & % ? ^ | *\").split(' ');\n\n// IMPORTANT: this must be sorted longest to shortest or tokenizing many not work.\n// Also, you must update possitionable operators separately from punct\nvar punct =\n \">>>= \" +\n \"... >>= <<= === >>> !== **= &&= ??= ||= \" +\n \"=> ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> \" +\n \"= ! ? > < : / ^ - + * & % ~ |\";\n\npunct = punct.replace(/[-[\\]{}()*+?.,\\\\^$|#]/g, \"\\\\$&\");\n// ?. but not if followed by a number \npunct = '\\\\?\\\\.(?!\\\\d) ' + punct;\npunct = punct.replace(/ /g, '|');\n\nvar punct_pattern = new RegExp(punct);\n\n// words which should always start on new line.\nvar line_starters = 'continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export'.split(',');\nvar reserved_words = line_starters.concat(['do', 'in', 'of', 'else', 'get', 'set', 'new', 'catch', 'finally', 'typeof', 'yield', 'async', 'await', 'from', 'as', 'class', 'extends']);\nvar reserved_word_pattern = new RegExp('^(?:' + reserved_words.join('|') + ')$');\n\n// var template_pattern = /(?:(?:<\\?php|<\\?=)[\\s\\S]*?\\?>)|(?:<%[\\s\\S]*?%>)/g;\n\nvar in_html_comment;\n\nvar Tokenizer = function(input_string, options) {\n BaseTokenizer.call(this, input_string, options);\n\n this._patterns.whitespace = this._patterns.whitespace.matching(\n /\\u00A0\\u1680\\u180e\\u2000-\\u200a\\u202f\\u205f\\u3000\\ufeff/.source,\n /\\u2028\\u2029/.source);\n\n var pattern_reader = new Pattern(this._input);\n var templatable = new TemplatablePattern(this._input)\n .read_options(this._options);\n\n this.__patterns = {\n template: templatable,\n identifier: templatable.starting_with(acorn.identifier).matching(acorn.identifierMatch),\n number: pattern_reader.matching(number_pattern),\n punct: pattern_reader.matching(punct_pattern),\n // comment ends just before nearest linefeed or end of file\n comment: pattern_reader.starting_with(/\\/\\//).until(/[\\n\\r\\u2028\\u2029]/),\n // /* ... */ comment ends with nearest */ or end of file\n block_comment: pattern_reader.starting_with(/\\/\\*/).until_after(/\\*\\//),\n html_comment_start: pattern_reader.matching(//),\n include: pattern_reader.starting_with(/#include/).until_after(acorn.lineBreak),\n shebang: pattern_reader.starting_with(/#!/).until_after(acorn.lineBreak),\n xml: pattern_reader.matching(/[\\s\\S]*?<(\\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\\[CDATA\\[[^\\]]*?\\]\\]|)(\\s*{[^}]+?}|\\s+[-a-zA-Z:0-9_.]+|\\s+[-a-zA-Z:0-9_.]+\\s*=\\s*('[^']*'|\"[^\"]*\"|{([^{}]|{[^}]+?})+?}))*\\s*(\\/?)\\s*>/),\n single_quote: templatable.until(/['\\\\\\n\\r\\u2028\\u2029]/),\n double_quote: templatable.until(/[\"\\\\\\n\\r\\u2028\\u2029]/),\n template_text: templatable.until(/[`\\\\$]/),\n template_expression: templatable.until(/[`}\\\\]/)\n };\n\n};\nTokenizer.prototype = new BaseTokenizer();\n\nTokenizer.prototype._is_comment = function(current_token) {\n return current_token.type === TOKEN.COMMENT || current_token.type === TOKEN.BLOCK_COMMENT || current_token.type === TOKEN.UNKNOWN;\n};\n\nTokenizer.prototype._is_opening = function(current_token) {\n return current_token.type === TOKEN.START_BLOCK || current_token.type === TOKEN.START_EXPR;\n};\n\nTokenizer.prototype._is_closing = function(current_token, open_token) {\n return (current_token.type === TOKEN.END_BLOCK || current_token.type === TOKEN.END_EXPR) &&\n (open_token && (\n (current_token.text === ']' && open_token.text === '[') ||\n (current_token.text === ')' && open_token.text === '(') ||\n (current_token.text === '}' && open_token.text === '{')));\n};\n\nTokenizer.prototype._reset = function() {\n in_html_comment = false;\n};\n\nTokenizer.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false\n var token = null;\n this._readWhitespace();\n var c = this._input.peek();\n\n if (c === null) {\n return this._create_token(TOKEN.EOF, '');\n }\n\n token = token || this._read_non_javascript(c);\n token = token || this._read_string(c);\n token = token || this._read_word(previous_token);\n token = token || this._read_singles(c);\n token = token || this._read_comment(c);\n token = token || this._read_regexp(c, previous_token);\n token = token || this._read_xml(c, previous_token);\n token = token || this._read_punctuation();\n token = token || this._create_token(TOKEN.UNKNOWN, this._input.next());\n\n return token;\n};\n\nTokenizer.prototype._read_word = function(previous_token) {\n var resulting_string;\n resulting_string = this.__patterns.identifier.read();\n if (resulting_string !== '') {\n resulting_string = resulting_string.replace(acorn.allLineBreaks, '\\n');\n if (!(previous_token.type === TOKEN.DOT ||\n (previous_token.type === TOKEN.RESERVED && (previous_token.text === 'set' || previous_token.text === 'get'))) &&\n reserved_word_pattern.test(resulting_string)) {\n if ((resulting_string === 'in' || resulting_string === 'of') &&\n (previous_token.type === TOKEN.WORD || previous_token.type === TOKEN.STRING)) { // hack for 'in' and 'of' operators\n return this._create_token(TOKEN.OPERATOR, resulting_string);\n }\n return this._create_token(TOKEN.RESERVED, resulting_string);\n }\n return this._create_token(TOKEN.WORD, resulting_string);\n }\n\n resulting_string = this.__patterns.number.read();\n if (resulting_string !== '') {\n return this._create_token(TOKEN.WORD, resulting_string);\n }\n};\n\nTokenizer.prototype._read_singles = function(c) {\n var token = null;\n if (c === '(' || c === '[') {\n token = this._create_token(TOKEN.START_EXPR, c);\n } else if (c === ')' || c === ']') {\n token = this._create_token(TOKEN.END_EXPR, c);\n } else if (c === '{') {\n token = this._create_token(TOKEN.START_BLOCK, c);\n } else if (c === '}') {\n token = this._create_token(TOKEN.END_BLOCK, c);\n } else if (c === ';') {\n token = this._create_token(TOKEN.SEMICOLON, c);\n } else if (c === '.' && dot_pattern.test(this._input.peek(1))) {\n token = this._create_token(TOKEN.DOT, c);\n } else if (c === ',') {\n token = this._create_token(TOKEN.COMMA, c);\n }\n\n if (token) {\n this._input.next();\n }\n return token;\n};\n\nTokenizer.prototype._read_punctuation = function() {\n var resulting_string = this.__patterns.punct.read();\n\n if (resulting_string !== '') {\n if (resulting_string === '=') {\n return this._create_token(TOKEN.EQUALS, resulting_string);\n } else if (resulting_string === '?.') {\n return this._create_token(TOKEN.DOT, resulting_string);\n } else {\n return this._create_token(TOKEN.OPERATOR, resulting_string);\n }\n }\n};\n\nTokenizer.prototype._read_non_javascript = function(c) {\n var resulting_string = '';\n\n if (c === '#') {\n if (this._is_first_token()) {\n resulting_string = this.__patterns.shebang.read();\n\n if (resulting_string) {\n return this._create_token(TOKEN.UNKNOWN, resulting_string.trim() + '\\n');\n }\n }\n\n // handles extendscript #includes\n resulting_string = this.__patterns.include.read();\n\n if (resulting_string) {\n return this._create_token(TOKEN.UNKNOWN, resulting_string.trim() + '\\n');\n }\n\n c = this._input.next();\n\n // Spidermonkey-specific sharp variables for circular references. Considered obsolete.\n var sharp = '#';\n if (this._input.hasNext() && this._input.testChar(digit)) {\n do {\n c = this._input.next();\n sharp += c;\n } while (this._input.hasNext() && c !== '#' && c !== '=');\n if (c === '#') {\n //\n } else if (this._input.peek() === '[' && this._input.peek(1) === ']') {\n sharp += '[]';\n this._input.next();\n this._input.next();\n } else if (this._input.peek() === '{' && this._input.peek(1) === '}') {\n sharp += '{}';\n this._input.next();\n this._input.next();\n }\n return this._create_token(TOKEN.WORD, sharp);\n }\n\n this._input.back();\n\n } else if (c === '<' && this._is_first_token()) {\n resulting_string = this.__patterns.html_comment_start.read();\n if (resulting_string) {\n while (this._input.hasNext() && !this._input.testChar(acorn.newline)) {\n resulting_string += this._input.next();\n }\n in_html_comment = true;\n return this._create_token(TOKEN.COMMENT, resulting_string);\n }\n } else if (in_html_comment && c === '-') {\n resulting_string = this.__patterns.html_comment_end.read();\n if (resulting_string) {\n in_html_comment = false;\n return this._create_token(TOKEN.COMMENT, resulting_string);\n }\n }\n\n return null;\n};\n\nTokenizer.prototype._read_comment = function(c) {\n var token = null;\n if (c === '/') {\n var comment = '';\n if (this._input.peek(1) === '*') {\n // peek for comment /* ... */\n comment = this.__patterns.block_comment.read();\n var directives = directives_core.get_directives(comment);\n if (directives && directives.ignore === 'start') {\n comment += directives_core.readIgnored(this._input);\n }\n comment = comment.replace(acorn.allLineBreaks, '\\n');\n token = this._create_token(TOKEN.BLOCK_COMMENT, comment);\n token.directives = directives;\n } else if (this._input.peek(1) === '/') {\n // peek for comment // ...\n comment = this.__patterns.comment.read();\n token = this._create_token(TOKEN.COMMENT, comment);\n }\n }\n return token;\n};\n\nTokenizer.prototype._read_string = function(c) {\n if (c === '`' || c === \"'\" || c === '\"') {\n var resulting_string = this._input.next();\n this.has_char_escapes = false;\n\n if (c === '`') {\n resulting_string += this._read_string_recursive('`', true, '${');\n } else {\n resulting_string += this._read_string_recursive(c);\n }\n\n if (this.has_char_escapes && this._options.unescape_strings) {\n resulting_string = unescape_string(resulting_string);\n }\n\n if (this._input.peek() === c) {\n resulting_string += this._input.next();\n }\n\n resulting_string = resulting_string.replace(acorn.allLineBreaks, '\\n');\n\n return this._create_token(TOKEN.STRING, resulting_string);\n }\n\n return null;\n};\n\nTokenizer.prototype._allow_regexp_or_xml = function(previous_token) {\n // regex and xml can only appear in specific locations during parsing\n return (previous_token.type === TOKEN.RESERVED && in_array(previous_token.text, ['return', 'case', 'throw', 'else', 'do', 'typeof', 'yield'])) ||\n (previous_token.type === TOKEN.END_EXPR && previous_token.text === ')' &&\n previous_token.opened.previous.type === TOKEN.RESERVED && in_array(previous_token.opened.previous.text, ['if', 'while', 'for'])) ||\n (in_array(previous_token.type, [TOKEN.COMMENT, TOKEN.START_EXPR, TOKEN.START_BLOCK, TOKEN.START,\n TOKEN.END_BLOCK, TOKEN.OPERATOR, TOKEN.EQUALS, TOKEN.EOF, TOKEN.SEMICOLON, TOKEN.COMMA\n ]));\n};\n\nTokenizer.prototype._read_regexp = function(c, previous_token) {\n\n if (c === '/' && this._allow_regexp_or_xml(previous_token)) {\n // handle regexp\n //\n var resulting_string = this._input.next();\n var esc = false;\n\n var in_char_class = false;\n while (this._input.hasNext() &&\n ((esc || in_char_class || this._input.peek() !== c) &&\n !this._input.testChar(acorn.newline))) {\n resulting_string += this._input.peek();\n if (!esc) {\n esc = this._input.peek() === '\\\\';\n if (this._input.peek() === '[') {\n in_char_class = true;\n } else if (this._input.peek() === ']') {\n in_char_class = false;\n }\n } else {\n esc = false;\n }\n this._input.next();\n }\n\n if (this._input.peek() === c) {\n resulting_string += this._input.next();\n\n // regexps may have modifiers /regexp/MOD , so fetch those, too\n // Only [gim] are valid, but if the user puts in garbage, do what we can to take it.\n resulting_string += this._input.read(acorn.identifier);\n }\n return this._create_token(TOKEN.STRING, resulting_string);\n }\n return null;\n};\n\nTokenizer.prototype._read_xml = function(c, previous_token) {\n\n if (this._options.e4x && c === \"<\" && this._allow_regexp_or_xml(previous_token)) {\n var xmlStr = '';\n var match = this.__patterns.xml.read_match();\n // handle e4x xml literals\n //\n if (match) {\n // Trim root tag to attempt to\n var rootTag = match[2].replace(/^{\\s+/, '{').replace(/\\s+}$/, '}');\n var isCurlyRoot = rootTag.indexOf('{') === 0;\n var depth = 0;\n while (match) {\n var isEndTag = !!match[1];\n var tagName = match[2];\n var isSingletonTag = (!!match[match.length - 1]) || (tagName.slice(0, 8) === \"![CDATA[\");\n if (!isSingletonTag &&\n (tagName === rootTag || (isCurlyRoot && tagName.replace(/^{\\s+/, '{').replace(/\\s+}$/, '}')))) {\n if (isEndTag) {\n --depth;\n } else {\n ++depth;\n }\n }\n xmlStr += match[0];\n if (depth <= 0) {\n break;\n }\n match = this.__patterns.xml.read_match();\n }\n // if we didn't close correctly, keep unformatted.\n if (!match) {\n xmlStr += this._input.match(/[\\s\\S]*/g)[0];\n }\n xmlStr = xmlStr.replace(acorn.allLineBreaks, '\\n');\n return this._create_token(TOKEN.STRING, xmlStr);\n }\n }\n\n return null;\n};\n\nfunction unescape_string(s) {\n // You think that a regex would work for this\n // return s.replace(/\\\\x([0-9a-f]{2})/gi, function(match, val) {\n // return String.fromCharCode(parseInt(val, 16));\n // })\n // However, dealing with '\\xff', '\\\\xff', '\\\\\\xff' makes this more fun.\n var out = '',\n escaped = 0;\n\n var input_scan = new InputScanner(s);\n var matched = null;\n\n while (input_scan.hasNext()) {\n // Keep any whitespace, non-slash characters\n // also keep slash pairs.\n matched = input_scan.match(/([\\s]|[^\\\\]|\\\\\\\\)+/g);\n\n if (matched) {\n out += matched[0];\n }\n\n if (input_scan.peek() === '\\\\') {\n input_scan.next();\n if (input_scan.peek() === 'x') {\n matched = input_scan.match(/x([0-9A-Fa-f]{2})/g);\n } else if (input_scan.peek() === 'u') {\n matched = input_scan.match(/u([0-9A-Fa-f]{4})/g);\n } else {\n out += '\\\\';\n if (input_scan.hasNext()) {\n out += input_scan.next();\n }\n continue;\n }\n\n // If there's some error decoding, return the original string\n if (!matched) {\n return s;\n }\n\n escaped = parseInt(matched[1], 16);\n\n if (escaped > 0x7e && escaped <= 0xff && matched[0].indexOf('x') === 0) {\n // we bail out on \\x7f..\\xff,\n // leaving whole string escaped,\n // as it's probably completely binary\n return s;\n } else if (escaped >= 0x00 && escaped < 0x20) {\n // leave 0x00...0x1f escaped\n out += '\\\\' + matched[0];\n continue;\n } else if (escaped === 0x22 || escaped === 0x27 || escaped === 0x5c) {\n // single-quote, apostrophe, backslash - escape these\n out += '\\\\' + String.fromCharCode(escaped);\n } else {\n out += String.fromCharCode(escaped);\n }\n }\n }\n\n return out;\n}\n\n// handle string\n//\nTokenizer.prototype._read_string_recursive = function(delimiter, allow_unescaped_newlines, start_sub) {\n var current_char;\n var pattern;\n if (delimiter === '\\'') {\n pattern = this.__patterns.single_quote;\n } else if (delimiter === '\"') {\n pattern = this.__patterns.double_quote;\n } else if (delimiter === '`') {\n pattern = this.__patterns.template_text;\n } else if (delimiter === '}') {\n pattern = this.__patterns.template_expression;\n }\n\n var resulting_string = pattern.read();\n var next = '';\n while (this._input.hasNext()) {\n next = this._input.next();\n if (next === delimiter ||\n (!allow_unescaped_newlines && acorn.newline.test(next))) {\n this._input.back();\n break;\n } else if (next === '\\\\' && this._input.hasNext()) {\n current_char = this._input.peek();\n\n if (current_char === 'x' || current_char === 'u') {\n this.has_char_escapes = true;\n } else if (current_char === '\\r' && this._input.peek(1) === '\\n') {\n this._input.next();\n }\n next += this._input.next();\n } else if (start_sub) {\n if (start_sub === '${' && next === '$' && this._input.peek() === '{') {\n next += this._input.next();\n }\n\n if (start_sub === next) {\n if (delimiter === '`') {\n next += this._read_string_recursive('}', allow_unescaped_newlines, '`');\n } else {\n next += this._read_string_recursive('`', allow_unescaped_newlines, '${');\n }\n if (this._input.hasNext()) {\n next += this._input.next();\n }\n }\n }\n next += pattern.read();\n resulting_string += next;\n }\n\n return resulting_string;\n};\n\nmodule.exports.Tokenizer = Tokenizer;\nmodule.exports.TOKEN = TOKEN;\nmodule.exports.positionable_operators = positionable_operators.slice();\nmodule.exports.line_starters = line_starters.slice();\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Output = require('../core/output').Output;\nvar Token = require('../core/token').Token;\nvar acorn = require('./acorn');\nvar Options = require('./options').Options;\nvar Tokenizer = require('./tokenizer').Tokenizer;\nvar line_starters = require('./tokenizer').line_starters;\nvar positionable_operators = require('./tokenizer').positionable_operators;\nvar TOKEN = require('./tokenizer').TOKEN;\n\n\nfunction in_array(what, arr) {\n return arr.indexOf(what) !== -1;\n}\n\nfunction ltrim(s) {\n return s.replace(/^\\s+/g, '');\n}\n\nfunction generateMapFromStrings(list) {\n var result = {};\n for (var x = 0; x < list.length; x++) {\n // make the mapped names underscored instead of dash\n result[list[x].replace(/-/g, '_')] = list[x];\n }\n return result;\n}\n\nfunction reserved_word(token, word) {\n return token && token.type === TOKEN.RESERVED && token.text === word;\n}\n\nfunction reserved_array(token, words) {\n return token && token.type === TOKEN.RESERVED && in_array(token.text, words);\n}\n// Unsure of what they mean, but they work. Worth cleaning up in future.\nvar special_words = ['case', 'return', 'do', 'if', 'throw', 'else', 'await', 'break', 'continue', 'async'];\n\nvar validPositionValues = ['before-newline', 'after-newline', 'preserve-newline'];\n\n// Generate map from array\nvar OPERATOR_POSITION = generateMapFromStrings(validPositionValues);\n\nvar OPERATOR_POSITION_BEFORE_OR_PRESERVE = [OPERATOR_POSITION.before_newline, OPERATOR_POSITION.preserve_newline];\n\nvar MODE = {\n BlockStatement: 'BlockStatement', // 'BLOCK'\n Statement: 'Statement', // 'STATEMENT'\n ObjectLiteral: 'ObjectLiteral', // 'OBJECT',\n ArrayLiteral: 'ArrayLiteral', //'[EXPRESSION]',\n ForInitializer: 'ForInitializer', //'(FOR-EXPRESSION)',\n Conditional: 'Conditional', //'(COND-EXPRESSION)',\n Expression: 'Expression' //'(EXPRESSION)'\n};\n\nfunction remove_redundant_indentation(output, frame) {\n // This implementation is effective but has some issues:\n // - can cause line wrap to happen too soon due to indent removal\n // after wrap points are calculated\n // These issues are minor compared to ugly indentation.\n\n if (frame.multiline_frame ||\n frame.mode === MODE.ForInitializer ||\n frame.mode === MODE.Conditional) {\n return;\n }\n\n // remove one indent from each line inside this section\n output.remove_indent(frame.start_line_index);\n}\n\n// we could use just string.split, but\n// IE doesn't like returning empty strings\nfunction split_linebreaks(s) {\n //return s.split(/\\x0d\\x0a|\\x0a/);\n\n s = s.replace(acorn.allLineBreaks, '\\n');\n var out = [],\n idx = s.indexOf(\"\\n\");\n while (idx !== -1) {\n out.push(s.substring(0, idx));\n s = s.substring(idx + 1);\n idx = s.indexOf(\"\\n\");\n }\n if (s.length) {\n out.push(s);\n }\n return out;\n}\n\nfunction is_array(mode) {\n return mode === MODE.ArrayLiteral;\n}\n\nfunction is_expression(mode) {\n return in_array(mode, [MODE.Expression, MODE.ForInitializer, MODE.Conditional]);\n}\n\nfunction all_lines_start_with(lines, c) {\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i].trim();\n if (line.charAt(0) !== c) {\n return false;\n }\n }\n return true;\n}\n\nfunction each_line_matches_indent(lines, indent) {\n var i = 0,\n len = lines.length,\n line;\n for (; i < len; i++) {\n line = lines[i];\n // allow empty lines to pass through\n if (line && line.indexOf(indent) !== 0) {\n return false;\n }\n }\n return true;\n}\n\n\nfunction Beautifier(source_text, options) {\n options = options || {};\n this._source_text = source_text || '';\n\n this._output = null;\n this._tokens = null;\n this._last_last_text = null;\n this._flags = null;\n this._previous_flags = null;\n\n this._flag_store = null;\n this._options = new Options(options);\n}\n\nBeautifier.prototype.create_flags = function(flags_base, mode) {\n var next_indent_level = 0;\n if (flags_base) {\n next_indent_level = flags_base.indentation_level;\n if (!this._output.just_added_newline() &&\n flags_base.line_indent_level > next_indent_level) {\n next_indent_level = flags_base.line_indent_level;\n }\n }\n\n var next_flags = {\n mode: mode,\n parent: flags_base,\n last_token: flags_base ? flags_base.last_token : new Token(TOKEN.START_BLOCK, ''), // last token text\n last_word: flags_base ? flags_base.last_word : '', // last TOKEN.WORD passed\n declaration_statement: false,\n declaration_assignment: false,\n multiline_frame: false,\n inline_frame: false,\n if_block: false,\n else_block: false,\n class_start_block: false, // class A { INSIDE HERE } or class B extends C { INSIDE HERE }\n do_block: false,\n do_while: false,\n import_block: false,\n in_case_statement: false, // switch(..){ INSIDE HERE }\n in_case: false, // we're on the exact line with \"case 0:\"\n case_body: false, // the indented case-action block\n case_block: false, // the indented case-action block is wrapped with {}\n indentation_level: next_indent_level,\n alignment: 0,\n line_indent_level: flags_base ? flags_base.line_indent_level : next_indent_level,\n start_line_index: this._output.get_line_number(),\n ternary_depth: 0\n };\n return next_flags;\n};\n\nBeautifier.prototype._reset = function(source_text) {\n var baseIndentString = source_text.match(/^[\\t ]*/)[0];\n\n this._last_last_text = ''; // pre-last token text\n this._output = new Output(this._options, baseIndentString);\n\n // If testing the ignore directive, start with output disable set to true\n this._output.raw = this._options.test_output_raw;\n\n\n // Stack of parsing/formatting states, including MODE.\n // We tokenize, parse, and output in an almost purely a forward-only stream of token input\n // and formatted output. This makes the beautifier less accurate than full parsers\n // but also far more tolerant of syntax errors.\n //\n // For example, the default mode is MODE.BlockStatement. If we see a '{' we push a new frame of type\n // MODE.BlockStatement on the the stack, even though it could be object literal. If we later\n // encounter a \":\", we'll switch to to MODE.ObjectLiteral. If we then see a \";\",\n // most full parsers would die, but the beautifier gracefully falls back to\n // MODE.BlockStatement and continues on.\n this._flag_store = [];\n this.set_mode(MODE.BlockStatement);\n var tokenizer = new Tokenizer(source_text, this._options);\n this._tokens = tokenizer.tokenize();\n return source_text;\n};\n\nBeautifier.prototype.beautify = function() {\n // if disabled, return the input unchanged.\n if (this._options.disabled) {\n return this._source_text;\n }\n\n var sweet_code;\n var source_text = this._reset(this._source_text);\n\n var eol = this._options.eol;\n if (this._options.eol === 'auto') {\n eol = '\\n';\n if (source_text && acorn.lineBreak.test(source_text || '')) {\n eol = source_text.match(acorn.lineBreak)[0];\n }\n }\n\n var current_token = this._tokens.next();\n while (current_token) {\n this.handle_token(current_token);\n\n this._last_last_text = this._flags.last_token.text;\n this._flags.last_token = current_token;\n\n current_token = this._tokens.next();\n }\n\n sweet_code = this._output.get_code(eol);\n\n return sweet_code;\n};\n\nBeautifier.prototype.handle_token = function(current_token, preserve_statement_flags) {\n if (current_token.type === TOKEN.START_EXPR) {\n this.handle_start_expr(current_token);\n } else if (current_token.type === TOKEN.END_EXPR) {\n this.handle_end_expr(current_token);\n } else if (current_token.type === TOKEN.START_BLOCK) {\n this.handle_start_block(current_token);\n } else if (current_token.type === TOKEN.END_BLOCK) {\n this.handle_end_block(current_token);\n } else if (current_token.type === TOKEN.WORD) {\n this.handle_word(current_token);\n } else if (current_token.type === TOKEN.RESERVED) {\n this.handle_word(current_token);\n } else if (current_token.type === TOKEN.SEMICOLON) {\n this.handle_semicolon(current_token);\n } else if (current_token.type === TOKEN.STRING) {\n this.handle_string(current_token);\n } else if (current_token.type === TOKEN.EQUALS) {\n this.handle_equals(current_token);\n } else if (current_token.type === TOKEN.OPERATOR) {\n this.handle_operator(current_token);\n } else if (current_token.type === TOKEN.COMMA) {\n this.handle_comma(current_token);\n } else if (current_token.type === TOKEN.BLOCK_COMMENT) {\n this.handle_block_comment(current_token, preserve_statement_flags);\n } else if (current_token.type === TOKEN.COMMENT) {\n this.handle_comment(current_token, preserve_statement_flags);\n } else if (current_token.type === TOKEN.DOT) {\n this.handle_dot(current_token);\n } else if (current_token.type === TOKEN.EOF) {\n this.handle_eof(current_token);\n } else if (current_token.type === TOKEN.UNKNOWN) {\n this.handle_unknown(current_token, preserve_statement_flags);\n } else {\n this.handle_unknown(current_token, preserve_statement_flags);\n }\n};\n\nBeautifier.prototype.handle_whitespace_and_comments = function(current_token, preserve_statement_flags) {\n var newlines = current_token.newlines;\n var keep_whitespace = this._options.keep_array_indentation && is_array(this._flags.mode);\n\n if (current_token.comments_before) {\n var comment_token = current_token.comments_before.next();\n while (comment_token) {\n // The cleanest handling of inline comments is to treat them as though they aren't there.\n // Just continue formatting and the behavior should be logical.\n // Also ignore unknown tokens. Again, this should result in better behavior.\n this.handle_whitespace_and_comments(comment_token, preserve_statement_flags);\n this.handle_token(comment_token, preserve_statement_flags);\n comment_token = current_token.comments_before.next();\n }\n }\n\n if (keep_whitespace) {\n for (var i = 0; i < newlines; i += 1) {\n this.print_newline(i > 0, preserve_statement_flags);\n }\n } else {\n if (this._options.max_preserve_newlines && newlines > this._options.max_preserve_newlines) {\n newlines = this._options.max_preserve_newlines;\n }\n\n if (this._options.preserve_newlines) {\n if (newlines > 1) {\n this.print_newline(false, preserve_statement_flags);\n for (var j = 1; j < newlines; j += 1) {\n this.print_newline(true, preserve_statement_flags);\n }\n }\n }\n }\n\n};\n\nvar newline_restricted_tokens = ['async', 'break', 'continue', 'return', 'throw', 'yield'];\n\nBeautifier.prototype.allow_wrap_or_preserved_newline = function(current_token, force_linewrap) {\n force_linewrap = (force_linewrap === undefined) ? false : force_linewrap;\n\n // Never wrap the first token on a line\n if (this._output.just_added_newline()) {\n return;\n }\n\n var shouldPreserveOrForce = (this._options.preserve_newlines && current_token.newlines) || force_linewrap;\n var operatorLogicApplies = in_array(this._flags.last_token.text, positionable_operators) ||\n in_array(current_token.text, positionable_operators);\n\n if (operatorLogicApplies) {\n var shouldPrintOperatorNewline = (\n in_array(this._flags.last_token.text, positionable_operators) &&\n in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)\n ) ||\n in_array(current_token.text, positionable_operators);\n shouldPreserveOrForce = shouldPreserveOrForce && shouldPrintOperatorNewline;\n }\n\n if (shouldPreserveOrForce) {\n this.print_newline(false, true);\n } else if (this._options.wrap_line_length) {\n if (reserved_array(this._flags.last_token, newline_restricted_tokens)) {\n // These tokens should never have a newline inserted\n // between them and the following expression.\n return;\n }\n this._output.set_wrap_point();\n }\n};\n\nBeautifier.prototype.print_newline = function(force_newline, preserve_statement_flags) {\n if (!preserve_statement_flags) {\n if (this._flags.last_token.text !== ';' && this._flags.last_token.text !== ',' && this._flags.last_token.text !== '=' && (this._flags.last_token.type !== TOKEN.OPERATOR || this._flags.last_token.text === '--' || this._flags.last_token.text === '++')) {\n var next_token = this._tokens.peek();\n while (this._flags.mode === MODE.Statement &&\n !(this._flags.if_block && reserved_word(next_token, 'else')) &&\n !this._flags.do_block) {\n this.restore_mode();\n }\n }\n }\n\n if (this._output.add_new_line(force_newline)) {\n this._flags.multiline_frame = true;\n }\n};\n\nBeautifier.prototype.print_token_line_indentation = function(current_token) {\n if (this._output.just_added_newline()) {\n if (this._options.keep_array_indentation &&\n current_token.newlines &&\n (current_token.text === '[' || is_array(this._flags.mode))) {\n this._output.current_line.set_indent(-1);\n this._output.current_line.push(current_token.whitespace_before);\n this._output.space_before_token = false;\n } else if (this._output.set_indent(this._flags.indentation_level, this._flags.alignment)) {\n this._flags.line_indent_level = this._flags.indentation_level;\n }\n }\n};\n\nBeautifier.prototype.print_token = function(current_token) {\n if (this._output.raw) {\n this._output.add_raw_token(current_token);\n return;\n }\n\n if (this._options.comma_first && current_token.previous && current_token.previous.type === TOKEN.COMMA &&\n this._output.just_added_newline()) {\n if (this._output.previous_line.last() === ',') {\n var popped = this._output.previous_line.pop();\n // if the comma was already at the start of the line,\n // pull back onto that line and reprint the indentation\n if (this._output.previous_line.is_empty()) {\n this._output.previous_line.push(popped);\n this._output.trim(true);\n this._output.current_line.pop();\n this._output.trim();\n }\n\n // add the comma in front of the next token\n this.print_token_line_indentation(current_token);\n this._output.add_token(',');\n this._output.space_before_token = true;\n }\n }\n\n this.print_token_line_indentation(current_token);\n this._output.non_breaking_space = true;\n this._output.add_token(current_token.text);\n if (this._output.previous_token_wrapped) {\n this._flags.multiline_frame = true;\n }\n};\n\nBeautifier.prototype.indent = function() {\n this._flags.indentation_level += 1;\n this._output.set_indent(this._flags.indentation_level, this._flags.alignment);\n};\n\nBeautifier.prototype.deindent = function() {\n if (this._flags.indentation_level > 0 &&\n ((!this._flags.parent) || this._flags.indentation_level > this._flags.parent.indentation_level)) {\n this._flags.indentation_level -= 1;\n this._output.set_indent(this._flags.indentation_level, this._flags.alignment);\n }\n};\n\nBeautifier.prototype.set_mode = function(mode) {\n if (this._flags) {\n this._flag_store.push(this._flags);\n this._previous_flags = this._flags;\n } else {\n this._previous_flags = this.create_flags(null, mode);\n }\n\n this._flags = this.create_flags(this._previous_flags, mode);\n this._output.set_indent(this._flags.indentation_level, this._flags.alignment);\n};\n\n\nBeautifier.prototype.restore_mode = function() {\n if (this._flag_store.length > 0) {\n this._previous_flags = this._flags;\n this._flags = this._flag_store.pop();\n if (this._previous_flags.mode === MODE.Statement) {\n remove_redundant_indentation(this._output, this._previous_flags);\n }\n this._output.set_indent(this._flags.indentation_level, this._flags.alignment);\n }\n};\n\nBeautifier.prototype.start_of_object_property = function() {\n return this._flags.parent.mode === MODE.ObjectLiteral && this._flags.mode === MODE.Statement && (\n (this._flags.last_token.text === ':' && this._flags.ternary_depth === 0) || (reserved_array(this._flags.last_token, ['get', 'set'])));\n};\n\nBeautifier.prototype.start_of_statement = function(current_token) {\n var start = false;\n start = start || reserved_array(this._flags.last_token, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD;\n start = start || reserved_word(this._flags.last_token, 'do');\n start = start || (!(this._flags.parent.mode === MODE.ObjectLiteral && this._flags.mode === MODE.Statement)) && reserved_array(this._flags.last_token, newline_restricted_tokens) && !current_token.newlines;\n start = start || reserved_word(this._flags.last_token, 'else') &&\n !(reserved_word(current_token, 'if') && !current_token.comments_before);\n start = start || (this._flags.last_token.type === TOKEN.END_EXPR && (this._previous_flags.mode === MODE.ForInitializer || this._previous_flags.mode === MODE.Conditional));\n start = start || (this._flags.last_token.type === TOKEN.WORD && this._flags.mode === MODE.BlockStatement &&\n !this._flags.in_case &&\n !(current_token.text === '--' || current_token.text === '++') &&\n this._last_last_text !== 'function' &&\n current_token.type !== TOKEN.WORD && current_token.type !== TOKEN.RESERVED);\n start = start || (this._flags.mode === MODE.ObjectLiteral && (\n (this._flags.last_token.text === ':' && this._flags.ternary_depth === 0) || reserved_array(this._flags.last_token, ['get', 'set'])));\n\n if (start) {\n this.set_mode(MODE.Statement);\n this.indent();\n\n this.handle_whitespace_and_comments(current_token, true);\n\n // Issue #276:\n // If starting a new statement with [if, for, while, do], push to a new line.\n // if (a) if (b) if(c) d(); else e(); else f();\n if (!this.start_of_object_property()) {\n this.allow_wrap_or_preserved_newline(current_token,\n reserved_array(current_token, ['do', 'for', 'if', 'while']));\n }\n return true;\n }\n return false;\n};\n\nBeautifier.prototype.handle_start_expr = function(current_token) {\n // The conditional starts the statement if appropriate.\n if (!this.start_of_statement(current_token)) {\n this.handle_whitespace_and_comments(current_token);\n }\n\n var next_mode = MODE.Expression;\n if (current_token.text === '[') {\n\n if (this._flags.last_token.type === TOKEN.WORD || this._flags.last_token.text === ')') {\n // this is array index specifier, break immediately\n // a[x], fn()[x]\n if (reserved_array(this._flags.last_token, line_starters)) {\n this._output.space_before_token = true;\n }\n this.print_token(current_token);\n this.set_mode(next_mode);\n this.indent();\n if (this._options.space_in_paren) {\n this._output.space_before_token = true;\n }\n return;\n }\n\n next_mode = MODE.ArrayLiteral;\n if (is_array(this._flags.mode)) {\n if (this._flags.last_token.text === '[' ||\n (this._flags.last_token.text === ',' && (this._last_last_text === ']' || this._last_last_text === '}'))) {\n // ], [ goes to new line\n // }, [ goes to new line\n if (!this._options.keep_array_indentation) {\n this.print_newline();\n }\n }\n }\n\n if (!in_array(this._flags.last_token.type, [TOKEN.START_EXPR, TOKEN.END_EXPR, TOKEN.WORD, TOKEN.OPERATOR, TOKEN.DOT])) {\n this._output.space_before_token = true;\n }\n } else {\n if (this._flags.last_token.type === TOKEN.RESERVED) {\n if (this._flags.last_token.text === 'for') {\n this._output.space_before_token = this._options.space_before_conditional;\n next_mode = MODE.ForInitializer;\n } else if (in_array(this._flags.last_token.text, ['if', 'while', 'switch'])) {\n this._output.space_before_token = this._options.space_before_conditional;\n next_mode = MODE.Conditional;\n } else if (in_array(this._flags.last_word, ['await', 'async'])) {\n // Should be a space between await and an IIFE, or async and an arrow function\n this._output.space_before_token = true;\n } else if (this._flags.last_token.text === 'import' && current_token.whitespace_before === '') {\n this._output.space_before_token = false;\n } else if (in_array(this._flags.last_token.text, line_starters) || this._flags.last_token.text === 'catch') {\n this._output.space_before_token = true;\n }\n } else if (this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) {\n // Support of this kind of newline preservation.\n // a = (b &&\n // (c || d));\n if (!this.start_of_object_property()) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n } else if (this._flags.last_token.type === TOKEN.WORD) {\n this._output.space_before_token = false;\n\n // function name() vs function name ()\n // function* name() vs function* name ()\n // async name() vs async name ()\n // In ES6, you can also define the method properties of an object\n // var obj = {a: function() {}}\n // It can be abbreviated\n // var obj = {a() {}}\n // var obj = { a() {}} vs var obj = { a () {}}\n // var obj = { * a() {}} vs var obj = { * a () {}}\n var peek_back_two = this._tokens.peek(-3);\n if (this._options.space_after_named_function && peek_back_two) {\n // peek starts at next character so -1 is current token\n var peek_back_three = this._tokens.peek(-4);\n if (reserved_array(peek_back_two, ['async', 'function']) ||\n (peek_back_two.text === '*' && reserved_array(peek_back_three, ['async', 'function']))) {\n this._output.space_before_token = true;\n } else if (this._flags.mode === MODE.ObjectLiteral) {\n if ((peek_back_two.text === '{' || peek_back_two.text === ',') ||\n (peek_back_two.text === '*' && (peek_back_three.text === '{' || peek_back_three.text === ','))) {\n this._output.space_before_token = true;\n }\n } else if (this._flags.parent && this._flags.parent.class_start_block) {\n this._output.space_before_token = true;\n }\n }\n } else {\n // Support preserving wrapped arrow function expressions\n // a.b('c',\n // () => d.e\n // )\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n // function() vs function ()\n // yield*() vs yield* ()\n // function*() vs function* ()\n if ((this._flags.last_token.type === TOKEN.RESERVED && (this._flags.last_word === 'function' || this._flags.last_word === 'typeof')) ||\n (this._flags.last_token.text === '*' &&\n (in_array(this._last_last_text, ['function', 'yield']) ||\n (this._flags.mode === MODE.ObjectLiteral && in_array(this._last_last_text, ['{', ',']))))) {\n this._output.space_before_token = this._options.space_after_anon_function;\n }\n }\n\n if (this._flags.last_token.text === ';' || this._flags.last_token.type === TOKEN.START_BLOCK) {\n this.print_newline();\n } else if (this._flags.last_token.type === TOKEN.END_EXPR || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.END_BLOCK || this._flags.last_token.text === '.' || this._flags.last_token.type === TOKEN.COMMA) {\n // do nothing on (( and )( and ][ and ]( and .(\n // TODO: Consider whether forcing this is required. Review failing tests when removed.\n this.allow_wrap_or_preserved_newline(current_token, current_token.newlines);\n }\n\n this.print_token(current_token);\n this.set_mode(next_mode);\n if (this._options.space_in_paren) {\n this._output.space_before_token = true;\n }\n\n // In all cases, if we newline while inside an expression it should be indented.\n this.indent();\n};\n\nBeautifier.prototype.handle_end_expr = function(current_token) {\n // statements inside expressions are not valid syntax, but...\n // statements must all be closed when their container closes\n while (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n\n this.handle_whitespace_and_comments(current_token);\n\n if (this._flags.multiline_frame) {\n this.allow_wrap_or_preserved_newline(current_token,\n current_token.text === ']' && is_array(this._flags.mode) && !this._options.keep_array_indentation);\n }\n\n if (this._options.space_in_paren) {\n if (this._flags.last_token.type === TOKEN.START_EXPR && !this._options.space_in_empty_paren) {\n // () [] no inner space in empty parens like these, ever, ref #320\n this._output.trim();\n this._output.space_before_token = false;\n } else {\n this._output.space_before_token = true;\n }\n }\n this.deindent();\n this.print_token(current_token);\n this.restore_mode();\n\n remove_redundant_indentation(this._output, this._previous_flags);\n\n // do {} while () // no statement required after\n if (this._flags.do_while && this._previous_flags.mode === MODE.Conditional) {\n this._previous_flags.mode = MODE.Expression;\n this._flags.do_block = false;\n this._flags.do_while = false;\n\n }\n};\n\nBeautifier.prototype.handle_start_block = function(current_token) {\n this.handle_whitespace_and_comments(current_token);\n\n // Check if this is should be treated as a ObjectLiteral\n var next_token = this._tokens.peek();\n var second_token = this._tokens.peek(1);\n if (this._flags.last_word === 'switch' && this._flags.last_token.type === TOKEN.END_EXPR) {\n this.set_mode(MODE.BlockStatement);\n this._flags.in_case_statement = true;\n } else if (this._flags.case_body) {\n this.set_mode(MODE.BlockStatement);\n } else if (second_token && (\n (in_array(second_token.text, [':', ',']) && in_array(next_token.type, [TOKEN.STRING, TOKEN.WORD, TOKEN.RESERVED])) ||\n (in_array(next_token.text, ['get', 'set', '...']) && in_array(second_token.type, [TOKEN.WORD, TOKEN.RESERVED]))\n )) {\n // We don't support TypeScript,but we didn't break it for a very long time.\n // We'll try to keep not breaking it.\n if (in_array(this._last_last_text, ['class', 'interface']) && !in_array(second_token.text, [':', ','])) {\n this.set_mode(MODE.BlockStatement);\n } else {\n this.set_mode(MODE.ObjectLiteral);\n }\n } else if (this._flags.last_token.type === TOKEN.OPERATOR && this._flags.last_token.text === '=>') {\n // arrow function: (param1, paramN) => { statements }\n this.set_mode(MODE.BlockStatement);\n } else if (in_array(this._flags.last_token.type, [TOKEN.EQUALS, TOKEN.START_EXPR, TOKEN.COMMA, TOKEN.OPERATOR]) ||\n reserved_array(this._flags.last_token, ['return', 'throw', 'import', 'default'])\n ) {\n // Detecting shorthand function syntax is difficult by scanning forward,\n // so check the surrounding context.\n // If the block is being returned, imported, export default, passed as arg,\n // assigned with = or assigned in a nested object, treat as an ObjectLiteral.\n this.set_mode(MODE.ObjectLiteral);\n } else {\n this.set_mode(MODE.BlockStatement);\n }\n\n if (this._flags.last_token) {\n if (reserved_array(this._flags.last_token.previous, ['class', 'extends'])) {\n this._flags.class_start_block = true;\n }\n }\n\n var empty_braces = !next_token.comments_before && next_token.text === '}';\n var empty_anonymous_function = empty_braces && this._flags.last_word === 'function' &&\n this._flags.last_token.type === TOKEN.END_EXPR;\n\n if (this._options.brace_preserve_inline) // check for inline, set inline_frame if so\n {\n // search forward for a newline wanted inside this block\n var index = 0;\n var check_token = null;\n this._flags.inline_frame = true;\n do {\n index += 1;\n check_token = this._tokens.peek(index - 1);\n if (check_token.newlines) {\n this._flags.inline_frame = false;\n break;\n }\n } while (check_token.type !== TOKEN.EOF &&\n !(check_token.type === TOKEN.END_BLOCK && check_token.opened === current_token));\n }\n\n if ((this._options.brace_style === \"expand\" ||\n (this._options.brace_style === \"none\" && current_token.newlines)) &&\n !this._flags.inline_frame) {\n if (this._flags.last_token.type !== TOKEN.OPERATOR &&\n (empty_anonymous_function ||\n this._flags.last_token.type === TOKEN.EQUALS ||\n (reserved_array(this._flags.last_token, special_words) && this._flags.last_token.text !== 'else'))) {\n this._output.space_before_token = true;\n } else {\n this.print_newline(false, true);\n }\n } else { // collapse || inline_frame\n if (is_array(this._previous_flags.mode) && (this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.COMMA)) {\n if (this._flags.last_token.type === TOKEN.COMMA || this._options.space_in_paren) {\n this._output.space_before_token = true;\n }\n\n if (this._flags.last_token.type === TOKEN.COMMA || (this._flags.last_token.type === TOKEN.START_EXPR && this._flags.inline_frame)) {\n this.allow_wrap_or_preserved_newline(current_token);\n this._previous_flags.multiline_frame = this._previous_flags.multiline_frame || this._flags.multiline_frame;\n this._flags.multiline_frame = false;\n }\n }\n if (this._flags.last_token.type !== TOKEN.OPERATOR && this._flags.last_token.type !== TOKEN.START_EXPR) {\n if (this._flags.last_token.type === TOKEN.START_BLOCK && !this._flags.inline_frame) {\n this.print_newline();\n } else {\n this._output.space_before_token = true;\n }\n }\n }\n this.print_token(current_token);\n this.indent();\n\n // Except for specific cases, open braces are followed by a new line.\n if (!empty_braces && !(this._options.brace_preserve_inline && this._flags.inline_frame)) {\n this.print_newline();\n }\n};\n\nBeautifier.prototype.handle_end_block = function(current_token) {\n // statements must all be closed when their container closes\n this.handle_whitespace_and_comments(current_token);\n\n while (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n\n var empty_braces = this._flags.last_token.type === TOKEN.START_BLOCK;\n\n if (this._flags.inline_frame && !empty_braces) { // try inline_frame (only set if this._options.braces-preserve-inline) first\n this._output.space_before_token = true;\n } else if (this._options.brace_style === \"expand\") {\n if (!empty_braces) {\n this.print_newline();\n }\n } else {\n // skip {}\n if (!empty_braces) {\n if (is_array(this._flags.mode) && this._options.keep_array_indentation) {\n // we REALLY need a newline here, but newliner would skip that\n this._options.keep_array_indentation = false;\n this.print_newline();\n this._options.keep_array_indentation = true;\n\n } else {\n this.print_newline();\n }\n }\n }\n this.restore_mode();\n this.print_token(current_token);\n};\n\nBeautifier.prototype.handle_word = function(current_token) {\n if (current_token.type === TOKEN.RESERVED) {\n if (in_array(current_token.text, ['set', 'get']) && this._flags.mode !== MODE.ObjectLiteral) {\n current_token.type = TOKEN.WORD;\n } else if (current_token.text === 'import' && in_array(this._tokens.peek().text, ['(', '.'])) {\n current_token.type = TOKEN.WORD;\n } else if (in_array(current_token.text, ['as', 'from']) && !this._flags.import_block) {\n current_token.type = TOKEN.WORD;\n } else if (this._flags.mode === MODE.ObjectLiteral) {\n var next_token = this._tokens.peek();\n if (next_token.text === ':') {\n current_token.type = TOKEN.WORD;\n }\n }\n }\n\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n if (reserved_array(this._flags.last_token, ['var', 'let', 'const']) && current_token.type === TOKEN.WORD) {\n this._flags.declaration_statement = true;\n }\n } else if (current_token.newlines && !is_expression(this._flags.mode) &&\n (this._flags.last_token.type !== TOKEN.OPERATOR || (this._flags.last_token.text === '--' || this._flags.last_token.text === '++')) &&\n this._flags.last_token.type !== TOKEN.EQUALS &&\n (this._options.preserve_newlines || !reserved_array(this._flags.last_token, ['var', 'let', 'const', 'set', 'get']))) {\n this.handle_whitespace_and_comments(current_token);\n this.print_newline();\n } else {\n this.handle_whitespace_and_comments(current_token);\n }\n\n if (this._flags.do_block && !this._flags.do_while) {\n if (reserved_word(current_token, 'while')) {\n // do {} ## while ()\n this._output.space_before_token = true;\n this.print_token(current_token);\n this._output.space_before_token = true;\n this._flags.do_while = true;\n return;\n } else {\n // do {} should always have while as the next word.\n // if we don't see the expected while, recover\n this.print_newline();\n this._flags.do_block = false;\n }\n }\n\n // if may be followed by else, or not\n // Bare/inline ifs are tricky\n // Need to unwind the modes correctly: if (a) if (b) c(); else d(); else e();\n if (this._flags.if_block) {\n if (!this._flags.else_block && reserved_word(current_token, 'else')) {\n this._flags.else_block = true;\n } else {\n while (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n this._flags.if_block = false;\n this._flags.else_block = false;\n }\n }\n\n if (this._flags.in_case_statement && reserved_array(current_token, ['case', 'default'])) {\n this.print_newline();\n if (!this._flags.case_block && (this._flags.case_body || this._options.jslint_happy)) {\n // switch cases following one another\n this.deindent();\n }\n this._flags.case_body = false;\n\n this.print_token(current_token);\n this._flags.in_case = true;\n return;\n }\n\n if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) {\n if (!this.start_of_object_property()) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n }\n\n if (reserved_word(current_token, 'function')) {\n if (in_array(this._flags.last_token.text, ['}', ';']) ||\n (this._output.just_added_newline() && !(in_array(this._flags.last_token.text, ['(', '[', '{', ':', '=', ',']) || this._flags.last_token.type === TOKEN.OPERATOR))) {\n // make sure there is a nice clean space of at least one blank line\n // before a new function definition\n if (!this._output.just_added_blankline() && !current_token.comments_before) {\n this.print_newline();\n this.print_newline(true);\n }\n }\n if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD) {\n if (reserved_array(this._flags.last_token, ['get', 'set', 'new', 'export']) ||\n reserved_array(this._flags.last_token, newline_restricted_tokens)) {\n this._output.space_before_token = true;\n } else if (reserved_word(this._flags.last_token, 'default') && this._last_last_text === 'export') {\n this._output.space_before_token = true;\n } else if (this._flags.last_token.text === 'declare') {\n // accomodates Typescript declare function formatting\n this._output.space_before_token = true;\n } else {\n this.print_newline();\n }\n } else if (this._flags.last_token.type === TOKEN.OPERATOR || this._flags.last_token.text === '=') {\n // foo = function\n this._output.space_before_token = true;\n } else if (!this._flags.multiline_frame && (is_expression(this._flags.mode) || is_array(this._flags.mode))) {\n // (function\n } else {\n this.print_newline();\n }\n\n this.print_token(current_token);\n this._flags.last_word = current_token.text;\n return;\n }\n\n var prefix = 'NONE';\n\n if (this._flags.last_token.type === TOKEN.END_BLOCK) {\n\n if (this._previous_flags.inline_frame) {\n prefix = 'SPACE';\n } else if (!reserved_array(current_token, ['else', 'catch', 'finally', 'from'])) {\n prefix = 'NEWLINE';\n } else {\n if (this._options.brace_style === \"expand\" ||\n this._options.brace_style === \"end-expand\" ||\n (this._options.brace_style === \"none\" && current_token.newlines)) {\n prefix = 'NEWLINE';\n } else {\n prefix = 'SPACE';\n this._output.space_before_token = true;\n }\n }\n } else if (this._flags.last_token.type === TOKEN.SEMICOLON && this._flags.mode === MODE.BlockStatement) {\n // TODO: Should this be for STATEMENT as well?\n prefix = 'NEWLINE';\n } else if (this._flags.last_token.type === TOKEN.SEMICOLON && is_expression(this._flags.mode)) {\n prefix = 'SPACE';\n } else if (this._flags.last_token.type === TOKEN.STRING) {\n prefix = 'NEWLINE';\n } else if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD ||\n (this._flags.last_token.text === '*' &&\n (in_array(this._last_last_text, ['function', 'yield']) ||\n (this._flags.mode === MODE.ObjectLiteral && in_array(this._last_last_text, ['{', ',']))))) {\n prefix = 'SPACE';\n } else if (this._flags.last_token.type === TOKEN.START_BLOCK) {\n if (this._flags.inline_frame) {\n prefix = 'SPACE';\n } else {\n prefix = 'NEWLINE';\n }\n } else if (this._flags.last_token.type === TOKEN.END_EXPR) {\n this._output.space_before_token = true;\n prefix = 'NEWLINE';\n }\n\n if (reserved_array(current_token, line_starters) && this._flags.last_token.text !== ')') {\n if (this._flags.inline_frame || this._flags.last_token.text === 'else' || this._flags.last_token.text === 'export') {\n prefix = 'SPACE';\n } else {\n prefix = 'NEWLINE';\n }\n\n }\n\n if (reserved_array(current_token, ['else', 'catch', 'finally'])) {\n if ((!(this._flags.last_token.type === TOKEN.END_BLOCK && this._previous_flags.mode === MODE.BlockStatement) ||\n this._options.brace_style === \"expand\" ||\n this._options.brace_style === \"end-expand\" ||\n (this._options.brace_style === \"none\" && current_token.newlines)) &&\n !this._flags.inline_frame) {\n this.print_newline();\n } else {\n this._output.trim(true);\n var line = this._output.current_line;\n // If we trimmed and there's something other than a close block before us\n // put a newline back in. Handles '} // comment' scenario.\n if (line.last() !== '}') {\n this.print_newline();\n }\n this._output.space_before_token = true;\n }\n } else if (prefix === 'NEWLINE') {\n if (reserved_array(this._flags.last_token, special_words)) {\n // no newline between 'return nnn'\n this._output.space_before_token = true;\n } else if (this._flags.last_token.text === 'declare' && reserved_array(current_token, ['var', 'let', 'const'])) {\n // accomodates Typescript declare formatting\n this._output.space_before_token = true;\n } else if (this._flags.last_token.type !== TOKEN.END_EXPR) {\n if ((this._flags.last_token.type !== TOKEN.START_EXPR || !reserved_array(current_token, ['var', 'let', 'const'])) && this._flags.last_token.text !== ':') {\n // no need to force newline on 'var': for (var x = 0...)\n if (reserved_word(current_token, 'if') && reserved_word(current_token.previous, 'else')) {\n // no newline for } else if {\n this._output.space_before_token = true;\n } else {\n this.print_newline();\n }\n }\n } else if (reserved_array(current_token, line_starters) && this._flags.last_token.text !== ')') {\n this.print_newline();\n }\n } else if (this._flags.multiline_frame && is_array(this._flags.mode) && this._flags.last_token.text === ',' && this._last_last_text === '}') {\n this.print_newline(); // }, in lists get a newline treatment\n } else if (prefix === 'SPACE') {\n this._output.space_before_token = true;\n }\n if (current_token.previous && (current_token.previous.type === TOKEN.WORD || current_token.previous.type === TOKEN.RESERVED)) {\n this._output.space_before_token = true;\n }\n this.print_token(current_token);\n this._flags.last_word = current_token.text;\n\n if (current_token.type === TOKEN.RESERVED) {\n if (current_token.text === 'do') {\n this._flags.do_block = true;\n } else if (current_token.text === 'if') {\n this._flags.if_block = true;\n } else if (current_token.text === 'import') {\n this._flags.import_block = true;\n } else if (this._flags.import_block && reserved_word(current_token, 'from')) {\n this._flags.import_block = false;\n }\n }\n};\n\nBeautifier.prototype.handle_semicolon = function(current_token) {\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n // Semicolon can be the start (and end) of a statement\n this._output.space_before_token = false;\n } else {\n this.handle_whitespace_and_comments(current_token);\n }\n\n var next_token = this._tokens.peek();\n while (this._flags.mode === MODE.Statement &&\n !(this._flags.if_block && reserved_word(next_token, 'else')) &&\n !this._flags.do_block) {\n this.restore_mode();\n }\n\n // hacky but effective for the moment\n if (this._flags.import_block) {\n this._flags.import_block = false;\n }\n this.print_token(current_token);\n};\n\nBeautifier.prototype.handle_string = function(current_token) {\n if (current_token.text.startsWith(\"`\") && current_token.newlines === 0 && current_token.whitespace_before === '' && (current_token.previous.text === ')' || this._flags.last_token.type === TOKEN.WORD)) {\n //Conditional for detectign backtick strings\n } else if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n // One difference - strings want at least a space before\n this._output.space_before_token = true;\n } else {\n this.handle_whitespace_and_comments(current_token);\n if (this._flags.last_token.type === TOKEN.RESERVED || this._flags.last_token.type === TOKEN.WORD || this._flags.inline_frame) {\n this._output.space_before_token = true;\n } else if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR || this._flags.last_token.type === TOKEN.EQUALS || this._flags.last_token.type === TOKEN.OPERATOR) {\n if (!this.start_of_object_property()) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n } else if ((current_token.text.startsWith(\"`\") && this._flags.last_token.type === TOKEN.END_EXPR && (current_token.previous.text === ']' || current_token.previous.text === ')') && current_token.newlines === 0)) {\n this._output.space_before_token = true;\n } else {\n this.print_newline();\n }\n }\n this.print_token(current_token);\n};\n\nBeautifier.prototype.handle_equals = function(current_token) {\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n } else {\n this.handle_whitespace_and_comments(current_token);\n }\n\n if (this._flags.declaration_statement) {\n // just got an '=' in a var-line, different formatting/line-breaking, etc will now be done\n this._flags.declaration_assignment = true;\n }\n this._output.space_before_token = true;\n this.print_token(current_token);\n this._output.space_before_token = true;\n};\n\nBeautifier.prototype.handle_comma = function(current_token) {\n this.handle_whitespace_and_comments(current_token, true);\n\n this.print_token(current_token);\n this._output.space_before_token = true;\n if (this._flags.declaration_statement) {\n if (is_expression(this._flags.parent.mode)) {\n // do not break on comma, for(var a = 1, b = 2)\n this._flags.declaration_assignment = false;\n }\n\n if (this._flags.declaration_assignment) {\n this._flags.declaration_assignment = false;\n this.print_newline(false, true);\n } else if (this._options.comma_first) {\n // for comma-first, we want to allow a newline before the comma\n // to turn into a newline after the comma, which we will fixup later\n this.allow_wrap_or_preserved_newline(current_token);\n }\n } else if (this._flags.mode === MODE.ObjectLiteral ||\n (this._flags.mode === MODE.Statement && this._flags.parent.mode === MODE.ObjectLiteral)) {\n if (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n\n if (!this._flags.inline_frame) {\n this.print_newline();\n }\n } else if (this._options.comma_first) {\n // EXPR or DO_BLOCK\n // for comma-first, we want to allow a newline before the comma\n // to turn into a newline after the comma, which we will fixup later\n this.allow_wrap_or_preserved_newline(current_token);\n }\n};\n\nBeautifier.prototype.handle_operator = function(current_token) {\n var isGeneratorAsterisk = current_token.text === '*' &&\n (reserved_array(this._flags.last_token, ['function', 'yield']) ||\n (in_array(this._flags.last_token.type, [TOKEN.START_BLOCK, TOKEN.COMMA, TOKEN.END_BLOCK, TOKEN.SEMICOLON]))\n );\n var isUnary = in_array(current_token.text, ['-', '+']) && (\n in_array(this._flags.last_token.type, [TOKEN.START_BLOCK, TOKEN.START_EXPR, TOKEN.EQUALS, TOKEN.OPERATOR]) ||\n in_array(this._flags.last_token.text, line_starters) ||\n this._flags.last_token.text === ','\n );\n\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n } else {\n var preserve_statement_flags = !isGeneratorAsterisk;\n this.handle_whitespace_and_comments(current_token, preserve_statement_flags);\n }\n\n // hack for actionscript's import .*;\n if (current_token.text === '*' && this._flags.last_token.type === TOKEN.DOT) {\n this.print_token(current_token);\n return;\n }\n\n if (current_token.text === '::') {\n // no spaces around exotic namespacing syntax operator\n this.print_token(current_token);\n return;\n }\n\n // Allow line wrapping between operators when operator_position is\n // set to before or preserve\n if (this._flags.last_token.type === TOKEN.OPERATOR && in_array(this._options.operator_position, OPERATOR_POSITION_BEFORE_OR_PRESERVE)) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n if (current_token.text === ':' && this._flags.in_case) {\n this.print_token(current_token);\n\n this._flags.in_case = false;\n this._flags.case_body = true;\n if (this._tokens.peek().type !== TOKEN.START_BLOCK) {\n this.indent();\n this.print_newline();\n this._flags.case_block = false;\n } else {\n this._flags.case_block = true;\n this._output.space_before_token = true;\n }\n return;\n }\n\n var space_before = true;\n var space_after = true;\n var in_ternary = false;\n if (current_token.text === ':') {\n if (this._flags.ternary_depth === 0) {\n // Colon is invalid javascript outside of ternary and object, but do our best to guess what was meant.\n space_before = false;\n } else {\n this._flags.ternary_depth -= 1;\n in_ternary = true;\n }\n } else if (current_token.text === '?') {\n this._flags.ternary_depth += 1;\n }\n\n // let's handle the operator_position option prior to any conflicting logic\n if (!isUnary && !isGeneratorAsterisk && this._options.preserve_newlines && in_array(current_token.text, positionable_operators)) {\n var isColon = current_token.text === ':';\n var isTernaryColon = (isColon && in_ternary);\n var isOtherColon = (isColon && !in_ternary);\n\n switch (this._options.operator_position) {\n case OPERATOR_POSITION.before_newline:\n // if the current token is : and it's not a ternary statement then we set space_before to false\n this._output.space_before_token = !isOtherColon;\n\n this.print_token(current_token);\n\n if (!isColon || isTernaryColon) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n this._output.space_before_token = true;\n return;\n\n case OPERATOR_POSITION.after_newline:\n // if the current token is anything but colon, or (via deduction) it's a colon and in a ternary statement,\n // then print a newline.\n\n this._output.space_before_token = true;\n\n if (!isColon || isTernaryColon) {\n if (this._tokens.peek().newlines) {\n this.print_newline(false, true);\n } else {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n } else {\n this._output.space_before_token = false;\n }\n\n this.print_token(current_token);\n\n this._output.space_before_token = true;\n return;\n\n case OPERATOR_POSITION.preserve_newline:\n if (!isOtherColon) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n // if we just added a newline, or the current token is : and it's not a ternary statement,\n // then we set space_before to false\n space_before = !(this._output.just_added_newline() || isOtherColon);\n\n this._output.space_before_token = space_before;\n this.print_token(current_token);\n this._output.space_before_token = true;\n return;\n }\n }\n\n if (isGeneratorAsterisk) {\n this.allow_wrap_or_preserved_newline(current_token);\n space_before = false;\n var next_token = this._tokens.peek();\n space_after = next_token && in_array(next_token.type, [TOKEN.WORD, TOKEN.RESERVED]);\n } else if (current_token.text === '...') {\n this.allow_wrap_or_preserved_newline(current_token);\n space_before = this._flags.last_token.type === TOKEN.START_BLOCK;\n space_after = false;\n } else if (in_array(current_token.text, ['--', '++', '!', '~']) || isUnary) {\n // unary operators (and binary +/- pretending to be unary) special cases\n if (this._flags.last_token.type === TOKEN.COMMA || this._flags.last_token.type === TOKEN.START_EXPR) {\n this.allow_wrap_or_preserved_newline(current_token);\n }\n\n space_before = false;\n space_after = false;\n\n // http://www.ecma-international.org/ecma-262/5.1/#sec-7.9.1\n // if there is a newline between -- or ++ and anything else we should preserve it.\n if (current_token.newlines && (current_token.text === '--' || current_token.text === '++' || current_token.text === '~')) {\n var new_line_needed = reserved_array(this._flags.last_token, special_words) && current_token.newlines;\n if (new_line_needed && (this._previous_flags.if_block || this._previous_flags.else_block)) {\n this.restore_mode();\n }\n this.print_newline(new_line_needed, true);\n }\n\n if (this._flags.last_token.text === ';' && is_expression(this._flags.mode)) {\n // for (;; ++i)\n // ^^^\n space_before = true;\n }\n\n if (this._flags.last_token.type === TOKEN.RESERVED) {\n space_before = true;\n } else if (this._flags.last_token.type === TOKEN.END_EXPR) {\n space_before = !(this._flags.last_token.text === ']' && (current_token.text === '--' || current_token.text === '++'));\n } else if (this._flags.last_token.type === TOKEN.OPERATOR) {\n // a++ + ++b;\n // a - -b\n space_before = in_array(current_token.text, ['--', '-', '++', '+']) && in_array(this._flags.last_token.text, ['--', '-', '++', '+']);\n // + and - are not unary when preceeded by -- or ++ operator\n // a-- + b\n // a * +b\n // a - -b\n if (in_array(current_token.text, ['+', '-']) && in_array(this._flags.last_token.text, ['--', '++'])) {\n space_after = true;\n }\n }\n\n\n if (((this._flags.mode === MODE.BlockStatement && !this._flags.inline_frame) || this._flags.mode === MODE.Statement) &&\n (this._flags.last_token.text === '{' || this._flags.last_token.text === ';')) {\n // { foo; --i }\n // foo(); --bar;\n this.print_newline();\n }\n }\n\n this._output.space_before_token = this._output.space_before_token || space_before;\n this.print_token(current_token);\n this._output.space_before_token = space_after;\n};\n\nBeautifier.prototype.handle_block_comment = function(current_token, preserve_statement_flags) {\n if (this._output.raw) {\n this._output.add_raw_token(current_token);\n if (current_token.directives && current_token.directives.preserve === 'end') {\n // If we're testing the raw output behavior, do not allow a directive to turn it off.\n this._output.raw = this._options.test_output_raw;\n }\n return;\n }\n\n if (current_token.directives) {\n this.print_newline(false, preserve_statement_flags);\n this.print_token(current_token);\n if (current_token.directives.preserve === 'start') {\n this._output.raw = true;\n }\n this.print_newline(false, true);\n return;\n }\n\n // inline block\n if (!acorn.newline.test(current_token.text) && !current_token.newlines) {\n this._output.space_before_token = true;\n this.print_token(current_token);\n this._output.space_before_token = true;\n return;\n } else {\n this.print_block_commment(current_token, preserve_statement_flags);\n }\n};\n\nBeautifier.prototype.print_block_commment = function(current_token, preserve_statement_flags) {\n var lines = split_linebreaks(current_token.text);\n var j; // iterator for this case\n var javadoc = false;\n var starless = false;\n var lastIndent = current_token.whitespace_before;\n var lastIndentLength = lastIndent.length;\n\n // block comment starts with a new line\n this.print_newline(false, preserve_statement_flags);\n\n // first line always indented\n this.print_token_line_indentation(current_token);\n this._output.add_token(lines[0]);\n this.print_newline(false, preserve_statement_flags);\n\n\n if (lines.length > 1) {\n lines = lines.slice(1);\n javadoc = all_lines_start_with(lines, '*');\n starless = each_line_matches_indent(lines, lastIndent);\n\n if (javadoc) {\n this._flags.alignment = 1;\n }\n\n for (j = 0; j < lines.length; j++) {\n if (javadoc) {\n // javadoc: reformat and re-indent\n this.print_token_line_indentation(current_token);\n this._output.add_token(ltrim(lines[j]));\n } else if (starless && lines[j]) {\n // starless: re-indent non-empty content, avoiding trim\n this.print_token_line_indentation(current_token);\n this._output.add_token(lines[j].substring(lastIndentLength));\n } else {\n // normal comments output raw\n this._output.current_line.set_indent(-1);\n this._output.add_token(lines[j]);\n }\n\n // for comments on their own line or more than one line, make sure there's a new line after\n this.print_newline(false, preserve_statement_flags);\n }\n\n this._flags.alignment = 0;\n }\n};\n\n\nBeautifier.prototype.handle_comment = function(current_token, preserve_statement_flags) {\n if (current_token.newlines) {\n this.print_newline(false, preserve_statement_flags);\n } else {\n this._output.trim(true);\n }\n\n this._output.space_before_token = true;\n this.print_token(current_token);\n this.print_newline(false, preserve_statement_flags);\n};\n\nBeautifier.prototype.handle_dot = function(current_token) {\n if (this.start_of_statement(current_token)) {\n // The conditional starts the statement if appropriate.\n } else {\n this.handle_whitespace_and_comments(current_token, true);\n }\n\n if (this._flags.last_token.text.match('^[0-9]+$')) {\n this._output.space_before_token = true;\n }\n\n if (reserved_array(this._flags.last_token, special_words)) {\n this._output.space_before_token = false;\n } else {\n // allow preserved newlines before dots in general\n // force newlines on dots after close paren when break_chained - for bar().baz()\n this.allow_wrap_or_preserved_newline(current_token,\n this._flags.last_token.text === ')' && this._options.break_chained_methods);\n }\n\n // Only unindent chained method dot if this dot starts a new line.\n // Otherwise the automatic extra indentation removal will handle the over indent\n if (this._options.unindent_chained_methods && this._output.just_added_newline()) {\n this.deindent();\n }\n\n this.print_token(current_token);\n};\n\nBeautifier.prototype.handle_unknown = function(current_token, preserve_statement_flags) {\n this.print_token(current_token);\n\n if (current_token.text[current_token.text.length - 1] === '\\n') {\n this.print_newline(false, preserve_statement_flags);\n }\n};\n\nBeautifier.prototype.handle_eof = function(current_token) {\n // Unwind any open statements\n while (this._flags.mode === MODE.Statement) {\n this.restore_mode();\n }\n this.handle_whitespace_and_comments(current_token);\n};\n\nmodule.exports.Beautifier = Beautifier;\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Beautifier = require('./beautifier').Beautifier,\n Options = require('./options').Options;\n\nfunction js_beautify(js_source_text, options) {\n var beautifier = new Beautifier(js_source_text, options);\n return beautifier.beautify();\n}\n\nmodule.exports = js_beautify;\nmodule.exports.defaultOptions = function() {\n return new Options();\n};\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar BaseOptions = require('../core/options').Options;\n\nfunction Options(options) {\n BaseOptions.call(this, options, 'css');\n\n this.selector_separator_newline = this._get_boolean('selector_separator_newline', true);\n this.newline_between_rules = this._get_boolean('newline_between_rules', true);\n var space_around_selector_separator = this._get_boolean('space_around_selector_separator');\n this.space_around_combinator = this._get_boolean('space_around_combinator') || space_around_selector_separator;\n\n var brace_style_split = this._get_selection_list('brace_style', ['collapse', 'expand', 'end-expand', 'none', 'preserve-inline']);\n this.brace_style = 'collapse';\n for (var bs = 0; bs < brace_style_split.length; bs++) {\n if (brace_style_split[bs] !== 'expand') {\n // default to collapse, as only collapse|expand is implemented for now\n this.brace_style = 'collapse';\n } else {\n this.brace_style = brace_style_split[bs];\n }\n }\n}\nOptions.prototype = new BaseOptions();\n\n\n\nmodule.exports.Options = Options;\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Options = require('./options').Options;\nvar Output = require('../core/output').Output;\nvar InputScanner = require('../core/inputscanner').InputScanner;\nvar Directives = require('../core/directives').Directives;\n\nvar directives_core = new Directives(/\\/\\*/, /\\*\\//);\n\nvar lineBreak = /\\r\\n|[\\r\\n]/;\nvar allLineBreaks = /\\r\\n|[\\r\\n]/g;\n\n// tokenizer\nvar whitespaceChar = /\\s/;\nvar whitespacePattern = /(?:\\s|\\n)+/g;\nvar block_comment_pattern = /\\/\\*(?:[\\s\\S]*?)((?:\\*\\/)|$)/g;\nvar comment_pattern = /\\/\\/(?:[^\\n\\r\\u2028\\u2029]*)/g;\n\nfunction Beautifier(source_text, options) {\n this._source_text = source_text || '';\n // Allow the setting of language/file-type specific options\n // with inheritance of overall settings\n this._options = new Options(options);\n this._ch = null;\n this._input = null;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule\n this.NESTED_AT_RULE = {\n \"@page\": true,\n \"@font-face\": true,\n \"@keyframes\": true,\n // also in CONDITIONAL_GROUP_RULE below\n \"@media\": true,\n \"@supports\": true,\n \"@document\": true\n };\n this.CONDITIONAL_GROUP_RULE = {\n \"@media\": true,\n \"@supports\": true,\n \"@document\": true\n };\n this.NON_SEMICOLON_NEWLINE_PROPERTY = [\n \"grid-template-areas\",\n \"grid-template\"\n ];\n\n}\n\nBeautifier.prototype.eatString = function(endChars) {\n var result = '';\n this._ch = this._input.next();\n while (this._ch) {\n result += this._ch;\n if (this._ch === \"\\\\\") {\n result += this._input.next();\n } else if (endChars.indexOf(this._ch) !== -1 || this._ch === \"\\n\") {\n break;\n }\n this._ch = this._input.next();\n }\n return result;\n};\n\n// Skips any white space in the source text from the current position.\n// When allowAtLeastOneNewLine is true, will output new lines for each\n// newline character found; if the user has preserve_newlines off, only\n// the first newline will be output\nBeautifier.prototype.eatWhitespace = function(allowAtLeastOneNewLine) {\n var result = whitespaceChar.test(this._input.peek());\n var newline_count = 0;\n while (whitespaceChar.test(this._input.peek())) {\n this._ch = this._input.next();\n if (allowAtLeastOneNewLine && this._ch === '\\n') {\n if (newline_count === 0 || newline_count < this._options.max_preserve_newlines) {\n newline_count++;\n this._output.add_new_line(true);\n }\n }\n }\n return result;\n};\n\n// Nested pseudo-class if we are insideRule\n// and the next special character found opens\n// a new block\nBeautifier.prototype.foundNestedPseudoClass = function() {\n var openParen = 0;\n var i = 1;\n var ch = this._input.peek(i);\n while (ch) {\n if (ch === \"{\") {\n return true;\n } else if (ch === '(') {\n // pseudoclasses can contain ()\n openParen += 1;\n } else if (ch === ')') {\n if (openParen === 0) {\n return false;\n }\n openParen -= 1;\n } else if (ch === \";\" || ch === \"}\") {\n return false;\n }\n i++;\n ch = this._input.peek(i);\n }\n return false;\n};\n\nBeautifier.prototype.print_string = function(output_string) {\n this._output.set_indent(this._indentLevel);\n this._output.non_breaking_space = true;\n this._output.add_token(output_string);\n};\n\nBeautifier.prototype.preserveSingleSpace = function(isAfterSpace) {\n if (isAfterSpace) {\n this._output.space_before_token = true;\n }\n};\n\nBeautifier.prototype.indent = function() {\n this._indentLevel++;\n};\n\nBeautifier.prototype.outdent = function() {\n if (this._indentLevel > 0) {\n this._indentLevel--;\n }\n};\n\n/*_____________________--------------------_____________________*/\n\nBeautifier.prototype.beautify = function() {\n if (this._options.disabled) {\n return this._source_text;\n }\n\n var source_text = this._source_text;\n var eol = this._options.eol;\n if (eol === 'auto') {\n eol = '\\n';\n if (source_text && lineBreak.test(source_text || '')) {\n eol = source_text.match(lineBreak)[0];\n }\n }\n\n\n // HACK: newline parsing inconsistent. This brute force normalizes the this._input.\n source_text = source_text.replace(allLineBreaks, '\\n');\n\n // reset\n var baseIndentString = source_text.match(/^[\\t ]*/)[0];\n\n this._output = new Output(this._options, baseIndentString);\n this._input = new InputScanner(source_text);\n this._indentLevel = 0;\n this._nestedLevel = 0;\n\n this._ch = null;\n var parenLevel = 0;\n\n var insideRule = false;\n // This is the value side of a property value pair (blue in the following ex)\n // label { content: blue }\n var insidePropertyValue = false;\n var enteringConditionalGroup = false;\n var insideAtExtend = false;\n var insideAtImport = false;\n var insideScssMap = false;\n var topCharacter = this._ch;\n var insideNonSemiColonValues = false;\n var whitespace;\n var isAfterSpace;\n var previous_ch;\n\n while (true) {\n whitespace = this._input.read(whitespacePattern);\n isAfterSpace = whitespace !== '';\n previous_ch = topCharacter;\n this._ch = this._input.next();\n if (this._ch === '\\\\' && this._input.hasNext()) {\n this._ch += this._input.next();\n }\n topCharacter = this._ch;\n\n if (!this._ch) {\n break;\n } else if (this._ch === '/' && this._input.peek() === '*') {\n // /* css comment */\n // Always start block comments on a new line.\n // This handles scenarios where a block comment immediately\n // follows a property definition on the same line or where\n // minified code is being beautified.\n this._output.add_new_line();\n this._input.back();\n\n var comment = this._input.read(block_comment_pattern);\n\n // Handle ignore directive\n var directives = directives_core.get_directives(comment);\n if (directives && directives.ignore === 'start') {\n comment += directives_core.readIgnored(this._input);\n }\n\n this.print_string(comment);\n\n // Ensures any new lines following the comment are preserved\n this.eatWhitespace(true);\n\n // Block comments are followed by a new line so they don't\n // share a line with other properties\n this._output.add_new_line();\n } else if (this._ch === '/' && this._input.peek() === '/') {\n // // single line comment\n // Preserves the space before a comment\n // on the same line as a rule\n this._output.space_before_token = true;\n this._input.back();\n this.print_string(this._input.read(comment_pattern));\n\n // Ensures any new lines following the comment are preserved\n this.eatWhitespace(true);\n } else if (this._ch === '@' || this._ch === '$') {\n this.preserveSingleSpace(isAfterSpace);\n\n // deal with less propery mixins @{...}\n if (this._input.peek() === '{') {\n this.print_string(this._ch + this.eatString('}'));\n } else {\n this.print_string(this._ch);\n\n // strip trailing space, if present, for hash property checks\n var variableOrRule = this._input.peekUntilAfter(/[: ,;{}()[\\]\\/='\"]/g);\n\n if (variableOrRule.match(/[ :]$/)) {\n // we have a variable or pseudo-class, add it and insert one space before continuing\n variableOrRule = this.eatString(\": \").replace(/\\s$/, '');\n this.print_string(variableOrRule);\n this._output.space_before_token = true;\n }\n\n variableOrRule = variableOrRule.replace(/\\s$/, '');\n\n if (variableOrRule === 'extend') {\n insideAtExtend = true;\n } else if (variableOrRule === 'import') {\n insideAtImport = true;\n }\n\n // might be a nesting at-rule\n if (variableOrRule in this.NESTED_AT_RULE) {\n this._nestedLevel += 1;\n if (variableOrRule in this.CONDITIONAL_GROUP_RULE) {\n enteringConditionalGroup = true;\n }\n // might be less variable\n } else if (!insideRule && parenLevel === 0 && variableOrRule.indexOf(':') !== -1) {\n insidePropertyValue = true;\n this.indent();\n }\n }\n } else if (this._ch === '#' && this._input.peek() === '{') {\n this.preserveSingleSpace(isAfterSpace);\n this.print_string(this._ch + this.eatString('}'));\n } else if (this._ch === '{') {\n if (insidePropertyValue) {\n insidePropertyValue = false;\n this.outdent();\n }\n\n // when entering conditional groups, only rulesets are allowed\n if (enteringConditionalGroup) {\n enteringConditionalGroup = false;\n insideRule = (this._indentLevel >= this._nestedLevel);\n } else {\n // otherwise, declarations are also allowed\n insideRule = (this._indentLevel >= this._nestedLevel - 1);\n }\n if (this._options.newline_between_rules && insideRule) {\n if (this._output.previous_line && this._output.previous_line.item(-1) !== '{') {\n this._output.ensure_empty_line_above('/', ',');\n }\n }\n\n this._output.space_before_token = true;\n\n // The difference in print_string and indent order is necessary to indent the '{' correctly\n if (this._options.brace_style === 'expand') {\n this._output.add_new_line();\n this.print_string(this._ch);\n this.indent();\n this._output.set_indent(this._indentLevel);\n } else {\n // inside mixin and first param is object\n if (previous_ch === '(') {\n this._output.space_before_token = false;\n } else if (previous_ch !== ',') {\n this.indent();\n }\n this.print_string(this._ch);\n }\n\n this.eatWhitespace(true);\n this._output.add_new_line();\n } else if (this._ch === '}') {\n this.outdent();\n this._output.add_new_line();\n if (previous_ch === '{') {\n this._output.trim(true);\n }\n insideAtImport = false;\n insideAtExtend = false;\n if (insidePropertyValue) {\n this.outdent();\n insidePropertyValue = false;\n }\n this.print_string(this._ch);\n insideRule = false;\n if (this._nestedLevel) {\n this._nestedLevel--;\n }\n\n this.eatWhitespace(true);\n this._output.add_new_line();\n\n if (this._options.newline_between_rules && !this._output.just_added_blankline()) {\n if (this._input.peek() !== '}') {\n this._output.add_new_line(true);\n }\n }\n if (this._input.peek() === ')') {\n this._output.trim(true);\n if (this._options.brace_style === \"expand\") {\n this._output.add_new_line(true);\n }\n }\n } else if (this._ch === \":\") {\n\n for (var i = 0; i < this.NON_SEMICOLON_NEWLINE_PROPERTY.length; i++) {\n if (this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[i])) {\n insideNonSemiColonValues = true;\n break;\n }\n }\n\n if ((insideRule || enteringConditionalGroup) && !(this._input.lookBack(\"&\") || this.foundNestedPseudoClass()) && !this._input.lookBack(\"(\") && !insideAtExtend && parenLevel === 0) {\n // 'property: value' delimiter\n // which could be in a conditional group query\n this.print_string(':');\n if (!insidePropertyValue) {\n insidePropertyValue = true;\n this._output.space_before_token = true;\n this.eatWhitespace(true);\n this.indent();\n }\n } else {\n // sass/less parent reference don't use a space\n // sass nested pseudo-class don't use a space\n\n // preserve space before pseudoclasses/pseudoelements, as it means \"in any child\"\n if (this._input.lookBack(\" \")) {\n this._output.space_before_token = true;\n }\n if (this._input.peek() === \":\") {\n // pseudo-element\n this._ch = this._input.next();\n this.print_string(\"::\");\n } else {\n // pseudo-class\n this.print_string(':');\n }\n }\n } else if (this._ch === '\"' || this._ch === '\\'') {\n var preserveQuoteSpace = previous_ch === '\"' || previous_ch === '\\'';\n this.preserveSingleSpace(preserveQuoteSpace || isAfterSpace);\n this.print_string(this._ch + this.eatString(this._ch));\n this.eatWhitespace(true);\n } else if (this._ch === ';') {\n insideNonSemiColonValues = false;\n if (parenLevel === 0) {\n if (insidePropertyValue) {\n this.outdent();\n insidePropertyValue = false;\n }\n insideAtExtend = false;\n insideAtImport = false;\n this.print_string(this._ch);\n this.eatWhitespace(true);\n\n // This maintains single line comments on the same\n // line. Block comments are also affected, but\n // a new line is always output before one inside\n // that section\n if (this._input.peek() !== '/') {\n this._output.add_new_line();\n }\n } else {\n this.print_string(this._ch);\n this.eatWhitespace(true);\n this._output.space_before_token = true;\n }\n } else if (this._ch === '(') { // may be a url\n if (this._input.lookBack(\"url\")) {\n this.print_string(this._ch);\n this.eatWhitespace();\n parenLevel++;\n this.indent();\n this._ch = this._input.next();\n if (this._ch === ')' || this._ch === '\"' || this._ch === '\\'') {\n this._input.back();\n } else if (this._ch) {\n this.print_string(this._ch + this.eatString(')'));\n if (parenLevel) {\n parenLevel--;\n this.outdent();\n }\n }\n } else {\n var space_needed = false;\n if (this._input.lookBack(\"with\")) {\n // look back is not an accurate solution, we need tokens to confirm without whitespaces\n space_needed = true;\n }\n this.preserveSingleSpace(isAfterSpace || space_needed);\n this.print_string(this._ch);\n\n // handle scss/sass map\n if (insidePropertyValue && previous_ch === \"$\" && this._options.selector_separator_newline) {\n this._output.add_new_line();\n insideScssMap = true;\n } else {\n this.eatWhitespace();\n parenLevel++;\n this.indent();\n }\n }\n } else if (this._ch === ')') {\n if (parenLevel) {\n parenLevel--;\n this.outdent();\n }\n if (insideScssMap && this._input.peek() === \";\" && this._options.selector_separator_newline) {\n insideScssMap = false;\n this.outdent();\n this._output.add_new_line();\n }\n this.print_string(this._ch);\n } else if (this._ch === ',') {\n this.print_string(this._ch);\n this.eatWhitespace(true);\n if (this._options.selector_separator_newline && (!insidePropertyValue || insideScssMap) && parenLevel === 0 && !insideAtImport && !insideAtExtend) {\n this._output.add_new_line();\n } else {\n this._output.space_before_token = true;\n }\n } else if ((this._ch === '>' || this._ch === '+' || this._ch === '~') && !insidePropertyValue && parenLevel === 0) {\n //handle combinator spacing\n if (this._options.space_around_combinator) {\n this._output.space_before_token = true;\n this.print_string(this._ch);\n this._output.space_before_token = true;\n } else {\n this.print_string(this._ch);\n this.eatWhitespace();\n // squash extra whitespace\n if (this._ch && whitespaceChar.test(this._ch)) {\n this._ch = '';\n }\n }\n } else if (this._ch === ']') {\n this.print_string(this._ch);\n } else if (this._ch === '[') {\n this.preserveSingleSpace(isAfterSpace);\n this.print_string(this._ch);\n } else if (this._ch === '=') { // no whitespace before or after\n this.eatWhitespace();\n this.print_string('=');\n if (whitespaceChar.test(this._ch)) {\n this._ch = '';\n }\n } else if (this._ch === '!' && !this._input.lookBack(\"\\\\\")) { // !important\n this._output.space_before_token = true;\n this.print_string(this._ch);\n } else {\n var preserveAfterSpace = previous_ch === '\"' || previous_ch === '\\'';\n this.preserveSingleSpace(preserveAfterSpace || isAfterSpace);\n this.print_string(this._ch);\n\n if (!this._output.just_added_newline() && this._input.peek() === '\\n' && insideNonSemiColonValues) {\n this._output.add_new_line();\n }\n }\n }\n\n var sweetCode = this._output.get_code(eol);\n\n return sweetCode;\n};\n\nmodule.exports.Beautifier = Beautifier;\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Beautifier = require('./beautifier').Beautifier,\n Options = require('./options').Options;\n\nfunction css_beautify(source_text, options) {\n var beautifier = new Beautifier(source_text, options);\n return beautifier.beautify();\n}\n\nmodule.exports = css_beautify;\nmodule.exports.defaultOptions = function() {\n return new Options();\n};\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar BaseOptions = require('../core/options').Options;\n\nfunction Options(options) {\n BaseOptions.call(this, options, 'html');\n if (this.templating.length === 1 && this.templating[0] === 'auto') {\n this.templating = ['django', 'erb', 'handlebars', 'php'];\n }\n\n this.indent_inner_html = this._get_boolean('indent_inner_html');\n this.indent_body_inner_html = this._get_boolean('indent_body_inner_html', true);\n this.indent_head_inner_html = this._get_boolean('indent_head_inner_html', true);\n\n this.indent_handlebars = this._get_boolean('indent_handlebars', true);\n this.wrap_attributes = this._get_selection('wrap_attributes',\n ['auto', 'force', 'force-aligned', 'force-expand-multiline', 'aligned-multiple', 'preserve', 'preserve-aligned']);\n this.wrap_attributes_indent_size = this._get_number('wrap_attributes_indent_size', this.indent_size);\n this.extra_liners = this._get_array('extra_liners', ['head', 'body', '/html']);\n\n // Block vs inline elements\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements\n // https://www.w3.org/TR/html5/dom.html#phrasing-content\n this.inline = this._get_array('inline', [\n 'a', 'abbr', 'area', 'audio', 'b', 'bdi', 'bdo', 'br', 'button', 'canvas', 'cite',\n 'code', 'data', 'datalist', 'del', 'dfn', 'em', 'embed', 'i', 'iframe', 'img',\n 'input', 'ins', 'kbd', 'keygen', 'label', 'map', 'mark', 'math', 'meter', 'noscript',\n 'object', 'output', 'progress', 'q', 'ruby', 's', 'samp', /* 'script', */ 'select', 'small',\n 'span', 'strong', 'sub', 'sup', 'svg', 'template', 'textarea', 'time', 'u', 'var',\n 'video', 'wbr', 'text',\n // obsolete inline tags\n 'acronym', 'big', 'strike', 'tt'\n ]);\n this.void_elements = this._get_array('void_elements', [\n // HTLM void elements - aka self-closing tags - aka singletons\n // https://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements\n 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen',\n 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr',\n // NOTE: Optional tags are too complex for a simple list\n // they are hard coded in _do_optional_end_element\n\n // Doctype and xml elements\n '!doctype', '?xml',\n\n // obsolete tags\n // basefont: https://www.computerhope.com/jargon/h/html-basefont-tag.htm\n // isndex: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/isindex\n 'basefont', 'isindex'\n ]);\n this.unformatted = this._get_array('unformatted', []);\n this.content_unformatted = this._get_array('content_unformatted', [\n 'pre', 'textarea'\n ]);\n this.unformatted_content_delimiter = this._get_characters('unformatted_content_delimiter');\n this.indent_scripts = this._get_selection('indent_scripts', ['normal', 'keep', 'separate']);\n\n}\nOptions.prototype = new BaseOptions();\n\n\n\nmodule.exports.Options = Options;\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar BaseTokenizer = require('../core/tokenizer').Tokenizer;\nvar BASETOKEN = require('../core/tokenizer').TOKEN;\nvar Directives = require('../core/directives').Directives;\nvar TemplatablePattern = require('../core/templatablepattern').TemplatablePattern;\nvar Pattern = require('../core/pattern').Pattern;\n\nvar TOKEN = {\n TAG_OPEN: 'TK_TAG_OPEN',\n TAG_CLOSE: 'TK_TAG_CLOSE',\n ATTRIBUTE: 'TK_ATTRIBUTE',\n EQUALS: 'TK_EQUALS',\n VALUE: 'TK_VALUE',\n COMMENT: 'TK_COMMENT',\n TEXT: 'TK_TEXT',\n UNKNOWN: 'TK_UNKNOWN',\n START: BASETOKEN.START,\n RAW: BASETOKEN.RAW,\n EOF: BASETOKEN.EOF\n};\n\nvar directives_core = new Directives(/<\\!--/, /-->/);\n\nvar Tokenizer = function(input_string, options) {\n BaseTokenizer.call(this, input_string, options);\n this._current_tag_name = '';\n\n // Words end at whitespace or when a tag starts\n // if we are indenting handlebars, they are considered tags\n var templatable_reader = new TemplatablePattern(this._input).read_options(this._options);\n var pattern_reader = new Pattern(this._input);\n\n this.__patterns = {\n word: templatable_reader.until(/[\\n\\r\\t <]/),\n single_quote: templatable_reader.until_after(/'/),\n double_quote: templatable_reader.until_after(/\"/),\n attribute: templatable_reader.until(/[\\n\\r\\t =>]|\\/>/),\n element_name: templatable_reader.until(/[\\n\\r\\t >\\/]/),\n\n handlebars_comment: pattern_reader.starting_with(/{{!--/).until_after(/--}}/),\n handlebars: pattern_reader.starting_with(/{{/).until_after(/}}/),\n handlebars_open: pattern_reader.until(/[\\n\\r\\t }]/),\n handlebars_raw_close: pattern_reader.until(/}}/),\n comment: pattern_reader.starting_with(//),\n cdata: pattern_reader.starting_with(//),\n // https://en.wikipedia.org/wiki/Conditional_comment\n conditional_comment: pattern_reader.starting_with(//),\n processing: pattern_reader.starting_with(/<\\?/).until_after(/\\?>/)\n };\n\n if (this._options.indent_handlebars) {\n this.__patterns.word = this.__patterns.word.exclude('handlebars');\n }\n\n this._unformatted_content_delimiter = null;\n\n if (this._options.unformatted_content_delimiter) {\n var literal_regexp = this._input.get_literal_regexp(this._options.unformatted_content_delimiter);\n this.__patterns.unformatted_content_delimiter =\n pattern_reader.matching(literal_regexp)\n .until_after(literal_regexp);\n }\n};\nTokenizer.prototype = new BaseTokenizer();\n\nTokenizer.prototype._is_comment = function(current_token) { // jshint unused:false\n return false; //current_token.type === TOKEN.COMMENT || current_token.type === TOKEN.UNKNOWN;\n};\n\nTokenizer.prototype._is_opening = function(current_token) {\n return current_token.type === TOKEN.TAG_OPEN;\n};\n\nTokenizer.prototype._is_closing = function(current_token, open_token) {\n return current_token.type === TOKEN.TAG_CLOSE &&\n (open_token && (\n ((current_token.text === '>' || current_token.text === '/>') && open_token.text[0] === '<') ||\n (current_token.text === '}}' && open_token.text[0] === '{' && open_token.text[1] === '{')));\n};\n\nTokenizer.prototype._reset = function() {\n this._current_tag_name = '';\n};\n\nTokenizer.prototype._get_next_token = function(previous_token, open_token) { // jshint unused:false\n var token = null;\n this._readWhitespace();\n var c = this._input.peek();\n\n if (c === null) {\n return this._create_token(TOKEN.EOF, '');\n }\n\n token = token || this._read_open_handlebars(c, open_token);\n token = token || this._read_attribute(c, previous_token, open_token);\n token = token || this._read_close(c, open_token);\n token = token || this._read_raw_content(c, previous_token, open_token);\n token = token || this._read_content_word(c);\n token = token || this._read_comment_or_cdata(c);\n token = token || this._read_processing(c);\n token = token || this._read_open(c, open_token);\n token = token || this._create_token(TOKEN.UNKNOWN, this._input.next());\n\n return token;\n};\n\nTokenizer.prototype._read_comment_or_cdata = function(c) { // jshint unused:false\n var token = null;\n var resulting_string = null;\n var directives = null;\n\n if (c === '<') {\n var peek1 = this._input.peek(1);\n // We treat all comments as literals, even more than preformatted tags\n // we only look for the appropriate closing marker\n if (peek1 === '!') {\n resulting_string = this.__patterns.comment.read();\n\n // only process directive on html comments\n if (resulting_string) {\n directives = directives_core.get_directives(resulting_string);\n if (directives && directives.ignore === 'start') {\n resulting_string += directives_core.readIgnored(this._input);\n }\n } else {\n resulting_string = this.__patterns.cdata.read();\n }\n }\n\n if (resulting_string) {\n token = this._create_token(TOKEN.COMMENT, resulting_string);\n token.directives = directives;\n }\n }\n\n return token;\n};\n\nTokenizer.prototype._read_processing = function(c) { // jshint unused:false\n var token = null;\n var resulting_string = null;\n var directives = null;\n\n if (c === '<') {\n var peek1 = this._input.peek(1);\n if (peek1 === '!' || peek1 === '?') {\n resulting_string = this.__patterns.conditional_comment.read();\n resulting_string = resulting_string || this.__patterns.processing.read();\n }\n\n if (resulting_string) {\n token = this._create_token(TOKEN.COMMENT, resulting_string);\n token.directives = directives;\n }\n }\n\n return token;\n};\n\nTokenizer.prototype._read_open = function(c, open_token) {\n var resulting_string = null;\n var token = null;\n if (!open_token) {\n if (c === '<') {\n\n resulting_string = this._input.next();\n if (this._input.peek() === '/') {\n resulting_string += this._input.next();\n }\n resulting_string += this.__patterns.element_name.read();\n token = this._create_token(TOKEN.TAG_OPEN, resulting_string);\n }\n }\n return token;\n};\n\nTokenizer.prototype._read_open_handlebars = function(c, open_token) {\n var resulting_string = null;\n var token = null;\n if (!open_token) {\n if (this._options.indent_handlebars && c === '{' && this._input.peek(1) === '{') {\n if (this._input.peek(2) === '!') {\n resulting_string = this.__patterns.handlebars_comment.read();\n resulting_string = resulting_string || this.__patterns.handlebars.read();\n token = this._create_token(TOKEN.COMMENT, resulting_string);\n } else {\n resulting_string = this.__patterns.handlebars_open.read();\n token = this._create_token(TOKEN.TAG_OPEN, resulting_string);\n }\n }\n }\n return token;\n};\n\n\nTokenizer.prototype._read_close = function(c, open_token) {\n var resulting_string = null;\n var token = null;\n if (open_token) {\n if (open_token.text[0] === '<' && (c === '>' || (c === '/' && this._input.peek(1) === '>'))) {\n resulting_string = this._input.next();\n if (c === '/') { // for close tag \"/>\"\n resulting_string += this._input.next();\n }\n token = this._create_token(TOKEN.TAG_CLOSE, resulting_string);\n } else if (open_token.text[0] === '{' && c === '}' && this._input.peek(1) === '}') {\n this._input.next();\n this._input.next();\n token = this._create_token(TOKEN.TAG_CLOSE, '}}');\n }\n }\n\n return token;\n};\n\nTokenizer.prototype._read_attribute = function(c, previous_token, open_token) {\n var token = null;\n var resulting_string = '';\n if (open_token && open_token.text[0] === '<') {\n\n if (c === '=') {\n token = this._create_token(TOKEN.EQUALS, this._input.next());\n } else if (c === '\"' || c === \"'\") {\n var content = this._input.next();\n if (c === '\"') {\n content += this.__patterns.double_quote.read();\n } else {\n content += this.__patterns.single_quote.read();\n }\n token = this._create_token(TOKEN.VALUE, content);\n } else {\n resulting_string = this.__patterns.attribute.read();\n\n if (resulting_string) {\n if (previous_token.type === TOKEN.EQUALS) {\n token = this._create_token(TOKEN.VALUE, resulting_string);\n } else {\n token = this._create_token(TOKEN.ATTRIBUTE, resulting_string);\n }\n }\n }\n }\n return token;\n};\n\nTokenizer.prototype._is_content_unformatted = function(tag_name) {\n // void_elements have no content and so cannot have unformatted content\n // script and style tags should always be read as unformatted content\n // finally content_unformatted and unformatted element contents are unformatted\n return this._options.void_elements.indexOf(tag_name) === -1 &&\n (this._options.content_unformatted.indexOf(tag_name) !== -1 ||\n this._options.unformatted.indexOf(tag_name) !== -1);\n};\n\n\nTokenizer.prototype._read_raw_content = function(c, previous_token, open_token) { // jshint unused:false\n var resulting_string = '';\n if (open_token && open_token.text[0] === '{') {\n resulting_string = this.__patterns.handlebars_raw_close.read();\n } else if (previous_token.type === TOKEN.TAG_CLOSE &&\n previous_token.opened.text[0] === '<' && previous_token.text[0] !== '/') {\n // ^^ empty tag has no content \n var tag_name = previous_token.opened.text.substr(1).toLowerCase();\n if (tag_name === 'script' || tag_name === 'style') {\n // Script and style tags are allowed to have comments wrapping their content\n // or just have regular content.\n var token = this._read_comment_or_cdata(c);\n if (token) {\n token.type = TOKEN.TEXT;\n return token;\n }\n resulting_string = this._input.readUntil(new RegExp('', 'ig'));\n } else if (this._is_content_unformatted(tag_name)) {\n\n resulting_string = this._input.readUntil(new RegExp('', 'ig'));\n }\n }\n\n if (resulting_string) {\n return this._create_token(TOKEN.TEXT, resulting_string);\n }\n\n return null;\n};\n\nTokenizer.prototype._read_content_word = function(c) {\n var resulting_string = '';\n if (this._options.unformatted_content_delimiter) {\n if (c === this._options.unformatted_content_delimiter[0]) {\n resulting_string = this.__patterns.unformatted_content_delimiter.read();\n }\n }\n\n if (!resulting_string) {\n resulting_string = this.__patterns.word.read();\n }\n if (resulting_string) {\n return this._create_token(TOKEN.TEXT, resulting_string);\n }\n};\n\nmodule.exports.Tokenizer = Tokenizer;\nmodule.exports.TOKEN = TOKEN;\n","/*jshint node:true */\n/*\n\n The MIT License (MIT)\n\n Copyright (c) 2007-2018 Einar Lielmanis, Liam Newman, and contributors.\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation files\n (the \"Software\"), to deal in the Software without restriction,\n including without limitation the rights to use, copy, modify, merge,\n publish, distribute, sublicense, and/or sell copies of the Software,\n and to permit persons to whom the Software is furnished to do so,\n subject to the following conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n*/\n\n'use strict';\n\nvar Options = require('../html/options').Options;\nvar Output = require('../core/output').Output;\nvar Tokenizer = require('../html/tokenizer').Tokenizer;\nvar TOKEN = require('../html/tokenizer').TOKEN;\n\nvar lineBreak = /\\r\\n|[\\r\\n]/;\nvar allLineBreaks = /\\r\\n|[\\r\\n]/g;\n\nvar Printer = function(options, base_indent_string) { //handles input/output and some other printing functions\n\n this.indent_level = 0;\n this.alignment_size = 0;\n this.max_preserve_newlines = options.max_preserve_newlines;\n this.preserve_newlines = options.preserve_newlines;\n\n this._output = new Output(options, base_indent_string);\n\n};\n\nPrinter.prototype.current_line_has_match = function(pattern) {\n return this._output.current_line.has_match(pattern);\n};\n\nPrinter.prototype.set_space_before_token = function(value, non_breaking) {\n this._output.space_before_token = value;\n this._output.non_breaking_space = non_breaking;\n};\n\nPrinter.prototype.set_wrap_point = function() {\n this._output.set_indent(this.indent_level, this.alignment_size);\n this._output.set_wrap_point();\n};\n\n\nPrinter.prototype.add_raw_token = function(token) {\n this._output.add_raw_token(token);\n};\n\nPrinter.prototype.print_preserved_newlines = function(raw_token) {\n var newlines = 0;\n if (raw_token.type !== TOKEN.TEXT && raw_token.previous.type !== TOKEN.TEXT) {\n newlines = raw_token.newlines ? 1 : 0;\n }\n\n if (this.preserve_newlines) {\n newlines = raw_token.newlines < this.max_preserve_newlines + 1 ? raw_token.newlines : this.max_preserve_newlines + 1;\n }\n for (var n = 0; n < newlines; n++) {\n this.print_newline(n > 0);\n }\n\n return newlines !== 0;\n};\n\nPrinter.prototype.traverse_whitespace = function(raw_token) {\n if (raw_token.whitespace_before || raw_token.newlines) {\n if (!this.print_preserved_newlines(raw_token)) {\n this._output.space_before_token = true;\n }\n return true;\n }\n return false;\n};\n\nPrinter.prototype.previous_token_wrapped = function() {\n return this._output.previous_token_wrapped;\n};\n\nPrinter.prototype.print_newline = function(force) {\n this._output.add_new_line(force);\n};\n\nPrinter.prototype.print_token = function(token) {\n if (token.text) {\n this._output.set_indent(this.indent_level, this.alignment_size);\n this._output.add_token(token.text);\n }\n};\n\nPrinter.prototype.indent = function() {\n this.indent_level++;\n};\n\nPrinter.prototype.get_full_indent = function(level) {\n level = this.indent_level + (level || 0);\n if (level < 1) {\n return '';\n }\n\n return this._output.get_indent_string(level);\n};\n\nvar get_type_attribute = function(start_token) {\n var result = null;\n var raw_token = start_token.next;\n\n // Search attributes for a type attribute\n while (raw_token.type !== TOKEN.EOF && start_token.closed !== raw_token) {\n if (raw_token.type === TOKEN.ATTRIBUTE && raw_token.text === 'type') {\n if (raw_token.next && raw_token.next.type === TOKEN.EQUALS &&\n raw_token.next.next && raw_token.next.next.type === TOKEN.VALUE) {\n result = raw_token.next.next.text;\n }\n break;\n }\n raw_token = raw_token.next;\n }\n\n return result;\n};\n\nvar get_custom_beautifier_name = function(tag_check, raw_token) {\n var typeAttribute = null;\n var result = null;\n\n if (!raw_token.closed) {\n return null;\n }\n\n if (tag_check === 'script') {\n typeAttribute = 'text/javascript';\n } else if (tag_check === 'style') {\n typeAttribute = 'text/css';\n }\n\n typeAttribute = get_type_attribute(raw_token) || typeAttribute;\n\n // For script and style tags that have a type attribute, only enable custom beautifiers for matching values\n // For those without a type attribute use default;\n if (typeAttribute.search('text/css') > -1) {\n result = 'css';\n } else if (typeAttribute.search(/module|((text|application|dojo)\\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\\+)?json|method|aspect))/) > -1) {\n result = 'javascript';\n } else if (typeAttribute.search(/(text|application|dojo)\\/(x-)?(html)/) > -1) {\n result = 'html';\n } else if (typeAttribute.search(/test\\/null/) > -1) {\n // Test only mime-type for testing the beautifier when null is passed as beautifing function\n result = 'null';\n }\n\n return result;\n};\n\nfunction in_array(what, arr) {\n return arr.indexOf(what) !== -1;\n}\n\nfunction TagFrame(parent, parser_token, indent_level) {\n this.parent = parent || null;\n this.tag = parser_token ? parser_token.tag_name : '';\n this.indent_level = indent_level || 0;\n this.parser_token = parser_token || null;\n}\n\nfunction TagStack(printer) {\n this._printer = printer;\n this._current_frame = null;\n}\n\nTagStack.prototype.get_parser_token = function() {\n return this._current_frame ? this._current_frame.parser_token : null;\n};\n\nTagStack.prototype.record_tag = function(parser_token) { //function to record a tag and its parent in this.tags Object\n var new_frame = new TagFrame(this._current_frame, parser_token, this._printer.indent_level);\n this._current_frame = new_frame;\n};\n\nTagStack.prototype._try_pop_frame = function(frame) { //function to retrieve the opening tag to the corresponding closer\n var parser_token = null;\n\n if (frame) {\n parser_token = frame.parser_token;\n this._printer.indent_level = frame.indent_level;\n this._current_frame = frame.parent;\n }\n\n return parser_token;\n};\n\nTagStack.prototype._get_frame = function(tag_list, stop_list) { //function to retrieve the opening tag to the corresponding closer\n var frame = this._current_frame;\n\n while (frame) { //till we reach '' (the initial value);\n if (tag_list.indexOf(frame.tag) !== -1) { //if this is it use it\n break;\n } else if (stop_list && stop_list.indexOf(frame.tag) !== -1) {\n frame = null;\n break;\n }\n frame = frame.parent;\n }\n\n return frame;\n};\n\nTagStack.prototype.try_pop = function(tag, stop_list) { //function to retrieve the opening tag to the corresponding closer\n var frame = this._get_frame([tag], stop_list);\n return this._try_pop_frame(frame);\n};\n\nTagStack.prototype.indent_to_tag = function(tag_list) {\n var frame = this._get_frame(tag_list);\n if (frame) {\n this._printer.indent_level = frame.indent_level;\n }\n};\n\nfunction Beautifier(source_text, options, js_beautify, css_beautify) {\n //Wrapper function to invoke all the necessary constructors and deal with the output.\n this._source_text = source_text || '';\n options = options || {};\n this._js_beautify = js_beautify;\n this._css_beautify = css_beautify;\n this._tag_stack = null;\n\n // Allow the setting of language/file-type specific options\n // with inheritance of overall settings\n var optionHtml = new Options(options, 'html');\n\n this._options = optionHtml;\n\n this._is_wrap_attributes_force = this._options.wrap_attributes.substr(0, 'force'.length) === 'force';\n this._is_wrap_attributes_force_expand_multiline = (this._options.wrap_attributes === 'force-expand-multiline');\n this._is_wrap_attributes_force_aligned = (this._options.wrap_attributes === 'force-aligned');\n this._is_wrap_attributes_aligned_multiple = (this._options.wrap_attributes === 'aligned-multiple');\n this._is_wrap_attributes_preserve = this._options.wrap_attributes.substr(0, 'preserve'.length) === 'preserve';\n this._is_wrap_attributes_preserve_aligned = (this._options.wrap_attributes === 'preserve-aligned');\n}\n\nBeautifier.prototype.beautify = function() {\n\n // if disabled, return the input unchanged.\n if (this._options.disabled) {\n return this._source_text;\n }\n\n var source_text = this._source_text;\n var eol = this._options.eol;\n if (this._options.eol === 'auto') {\n eol = '\\n';\n if (source_text && lineBreak.test(source_text)) {\n eol = source_text.match(lineBreak)[0];\n }\n }\n\n // HACK: newline parsing inconsistent. This brute force normalizes the input.\n source_text = source_text.replace(allLineBreaks, '\\n');\n\n var baseIndentString = source_text.match(/^[\\t ]*/)[0];\n\n var last_token = {\n text: '',\n type: ''\n };\n\n var last_tag_token = new TagOpenParserToken();\n\n var printer = new Printer(this._options, baseIndentString);\n var tokens = new Tokenizer(source_text, this._options).tokenize();\n\n this._tag_stack = new TagStack(printer);\n\n var parser_token = null;\n var raw_token = tokens.next();\n while (raw_token.type !== TOKEN.EOF) {\n\n if (raw_token.type === TOKEN.TAG_OPEN || raw_token.type === TOKEN.COMMENT) {\n parser_token = this._handle_tag_open(printer, raw_token, last_tag_token, last_token);\n last_tag_token = parser_token;\n } else if ((raw_token.type === TOKEN.ATTRIBUTE || raw_token.type === TOKEN.EQUALS || raw_token.type === TOKEN.VALUE) ||\n (raw_token.type === TOKEN.TEXT && !last_tag_token.tag_complete)) {\n parser_token = this._handle_inside_tag(printer, raw_token, last_tag_token, tokens);\n } else if (raw_token.type === TOKEN.TAG_CLOSE) {\n parser_token = this._handle_tag_close(printer, raw_token, last_tag_token);\n } else if (raw_token.type === TOKEN.TEXT) {\n parser_token = this._handle_text(printer, raw_token, last_tag_token);\n } else {\n // This should never happen, but if it does. Print the raw token\n printer.add_raw_token(raw_token);\n }\n\n last_token = parser_token;\n\n raw_token = tokens.next();\n }\n var sweet_code = printer._output.get_code(eol);\n\n return sweet_code;\n};\n\nBeautifier.prototype._handle_tag_close = function(printer, raw_token, last_tag_token) {\n var parser_token = {\n text: raw_token.text,\n type: raw_token.type\n };\n printer.alignment_size = 0;\n last_tag_token.tag_complete = true;\n\n printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== '', true);\n if (last_tag_token.is_unformatted) {\n printer.add_raw_token(raw_token);\n } else {\n if (last_tag_token.tag_start_char === '<') {\n printer.set_space_before_token(raw_token.text[0] === '/', true); // space before />, no space before >\n if (this._is_wrap_attributes_force_expand_multiline && last_tag_token.has_wrapped_attrs) {\n printer.print_newline(false);\n }\n }\n printer.print_token(raw_token);\n\n }\n\n if (last_tag_token.indent_content &&\n !(last_tag_token.is_unformatted || last_tag_token.is_content_unformatted)) {\n printer.indent();\n\n // only indent once per opened tag\n last_tag_token.indent_content = false;\n }\n\n if (!last_tag_token.is_inline_element &&\n !(last_tag_token.is_unformatted || last_tag_token.is_content_unformatted)) {\n printer.set_wrap_point();\n }\n\n return parser_token;\n};\n\nBeautifier.prototype._handle_inside_tag = function(printer, raw_token, last_tag_token, tokens) {\n var wrapped = last_tag_token.has_wrapped_attrs;\n var parser_token = {\n text: raw_token.text,\n type: raw_token.type\n };\n\n printer.set_space_before_token(raw_token.newlines || raw_token.whitespace_before !== '', true);\n if (last_tag_token.is_unformatted) {\n printer.add_raw_token(raw_token);\n } else if (last_tag_token.tag_start_char === '{' && raw_token.type === TOKEN.TEXT) {\n // For the insides of handlebars allow newlines or a single space between open and contents\n if (printer.print_preserved_newlines(raw_token)) {\n raw_token.newlines = 0;\n printer.add_raw_token(raw_token);\n } else {\n printer.print_token(raw_token);\n }\n } else {\n if (raw_token.type === TOKEN.ATTRIBUTE) {\n printer.set_space_before_token(true);\n last_tag_token.attr_count += 1;\n } else if (raw_token.type === TOKEN.EQUALS) { //no space before =\n printer.set_space_before_token(false);\n } else if (raw_token.type === TOKEN.VALUE && raw_token.previous.type === TOKEN.EQUALS) { //no space before value\n printer.set_space_before_token(false);\n }\n\n if (raw_token.type === TOKEN.ATTRIBUTE && last_tag_token.tag_start_char === '<') {\n if (this._is_wrap_attributes_preserve || this._is_wrap_attributes_preserve_aligned) {\n printer.traverse_whitespace(raw_token);\n wrapped = wrapped || raw_token.newlines !== 0;\n }\n\n\n if (this._is_wrap_attributes_force) {\n var force_attr_wrap = last_tag_token.attr_count > 1;\n if (this._is_wrap_attributes_force_expand_multiline && last_tag_token.attr_count === 1) {\n var is_only_attribute = true;\n var peek_index = 0;\n var peek_token;\n do {\n peek_token = tokens.peek(peek_index);\n if (peek_token.type === TOKEN.ATTRIBUTE) {\n is_only_attribute = false;\n break;\n }\n peek_index += 1;\n } while (peek_index < 4 && peek_token.type !== TOKEN.EOF && peek_token.type !== TOKEN.TAG_CLOSE);\n\n force_attr_wrap = !is_only_attribute;\n }\n\n if (force_attr_wrap) {\n printer.print_newline(false);\n wrapped = true;\n }\n }\n }\n printer.print_token(raw_token);\n wrapped = wrapped || printer.previous_token_wrapped();\n last_tag_token.has_wrapped_attrs = wrapped;\n }\n return parser_token;\n};\n\nBeautifier.prototype._handle_text = function(printer, raw_token, last_tag_token) {\n var parser_token = {\n text: raw_token.text,\n type: 'TK_CONTENT'\n };\n if (last_tag_token.custom_beautifier_name) { //check if we need to format javascript\n this._print_custom_beatifier_text(printer, raw_token, last_tag_token);\n } else if (last_tag_token.is_unformatted || last_tag_token.is_content_unformatted) {\n printer.add_raw_token(raw_token);\n } else {\n printer.traverse_whitespace(raw_token);\n printer.print_token(raw_token);\n }\n return parser_token;\n};\n\nBeautifier.prototype._print_custom_beatifier_text = function(printer, raw_token, last_tag_token) {\n var local = this;\n if (raw_token.text !== '') {\n\n var text = raw_token.text,\n _beautifier,\n script_indent_level = 1,\n pre = '',\n post = '';\n if (last_tag_token.custom_beautifier_name === 'javascript' && typeof this._js_beautify === 'function') {\n _beautifier = this._js_beautify;\n } else if (last_tag_token.custom_beautifier_name === 'css' && typeof this._css_beautify === 'function') {\n _beautifier = this._css_beautify;\n } else if (last_tag_token.custom_beautifier_name === 'html') {\n _beautifier = function(html_source, options) {\n var beautifier = new Beautifier(html_source, options, local._js_beautify, local._css_beautify);\n return beautifier.beautify();\n };\n }\n\n if (this._options.indent_scripts === \"keep\") {\n script_indent_level = 0;\n } else if (this._options.indent_scripts === \"separate\") {\n script_indent_level = -printer.indent_level;\n }\n\n var indentation = printer.get_full_indent(script_indent_level);\n\n // if there is at least one empty line at the end of this text, strip it\n // we'll be adding one back after the text but before the containing tag.\n text = text.replace(/\\n[ \\t]*$/, '');\n\n // Handle the case where content is wrapped in a comment or cdata.\n if (last_tag_token.custom_beautifier_name !== 'html' &&\n text[0] === '<' && text.match(/^(|]]>)$/.exec(text);\n\n // if we start to wrap but don't finish, print raw\n if (!matched) {\n printer.add_raw_token(raw_token);\n return;\n }\n\n pre = indentation + matched[1] + '\\n';\n text = matched[4];\n if (matched[5]) {\n post = indentation + matched[5];\n }\n\n // if there is at least one empty line at the end of this text, strip it\n // we'll be adding one back after the text but before the containing tag.\n text = text.replace(/\\n[ \\t]*$/, '');\n\n if (matched[2] || matched[3].indexOf('\\n') !== -1) {\n // if the first line of the non-comment text has spaces\n // use that as the basis for indenting in null case.\n matched = matched[3].match(/[ \\t]+$/);\n if (matched) {\n raw_token.whitespace_before = matched[0];\n }\n }\n }\n\n if (text) {\n if (_beautifier) {\n\n // call the Beautifier if avaliable\n var Child_options = function() {\n this.eol = '\\n';\n };\n Child_options.prototype = this._options.raw_options;\n var child_options = new Child_options();\n text = _beautifier(indentation + text, child_options);\n } else {\n // simply indent the string otherwise\n var white = raw_token.whitespace_before;\n if (white) {\n text = text.replace(new RegExp('\\n(' + white + ')?', 'g'), '\\n');\n }\n\n text = indentation + text.replace(/\\n/g, '\\n' + indentation);\n }\n }\n\n if (pre) {\n if (!text) {\n text = pre + post;\n } else {\n text = pre + text + '\\n' + post;\n }\n }\n\n printer.print_newline(false);\n if (text) {\n raw_token.text = text;\n raw_token.whitespace_before = '';\n raw_token.newlines = 0;\n printer.add_raw_token(raw_token);\n printer.print_newline(true);\n }\n }\n};\n\nBeautifier.prototype._handle_tag_open = function(printer, raw_token, last_tag_token, last_token) {\n var parser_token = this._get_tag_open_token(raw_token);\n\n if ((last_tag_token.is_unformatted || last_tag_token.is_content_unformatted) &&\n !last_tag_token.is_empty_element &&\n raw_token.type === TOKEN.TAG_OPEN && raw_token.text.indexOf(']*)/);\n this.tag_check = tag_check_match ? tag_check_match[1] : '';\n } else {\n tag_check_match = raw_token.text.match(/^{{~?(?:[\\^]|#\\*?)?([^\\s}]+)/);\n this.tag_check = tag_check_match ? tag_check_match[1] : '';\n\n // handle \"{{#> myPartial}}\" or \"{{~#> myPartial}}\"\n if ((raw_token.text.startsWith('{{#>') || raw_token.text.startsWith('{{~#>')) && this.tag_check[0] === '>') {\n if (this.tag_check === '>' && raw_token.next !== null) {\n this.tag_check = raw_token.next.text.split(' ')[0];\n } else {\n this.tag_check = raw_token.text.split('>')[1];\n }\n }\n }\n\n this.tag_check = this.tag_check.toLowerCase();\n\n if (raw_token.type === TOKEN.COMMENT) {\n this.tag_complete = true;\n }\n\n this.is_start_tag = this.tag_check.charAt(0) !== '/';\n this.tag_name = !this.is_start_tag ? this.tag_check.substr(1) : this.tag_check;\n this.is_end_tag = !this.is_start_tag ||\n (raw_token.closed && raw_token.closed.text === '/>');\n\n // if whitespace handler ~ included (i.e. {{~#if true}}), handlebars tags start at pos 3 not pos 2\n var handlebar_starts = 2;\n if (this.tag_start_char === '{' && this.text.length >= 3) {\n if (this.text.charAt(2) === '~') {\n handlebar_starts = 3;\n }\n }\n\n // handlebars tags that don't start with # or ^ are single_tags, and so also start and end.\n this.is_end_tag = this.is_end_tag ||\n (this.tag_start_char === '{' && (this.text.length < 3 || (/[^#\\^]/.test(this.text.charAt(handlebar_starts)))));\n }\n};\n\nBeautifier.prototype._get_tag_open_token = function(raw_token) { //function to get a full tag and parse its type\n var parser_token = new TagOpenParserToken(this._tag_stack.get_parser_token(), raw_token);\n\n parser_token.alignment_size = this._options.wrap_attributes_indent_size;\n\n parser_token.is_end_tag = parser_token.is_end_tag ||\n in_array(parser_token.tag_check, this._options.void_elements);\n\n parser_token.is_empty_element = parser_token.tag_complete ||\n (parser_token.is_start_tag && parser_token.is_end_tag);\n\n parser_token.is_unformatted = !parser_token.tag_complete && in_array(parser_token.tag_check, this._options.unformatted);\n parser_token.is_content_unformatted = !parser_token.is_empty_element && in_array(parser_token.tag_check, this._options.content_unformatted);\n parser_token.is_inline_element = in_array(parser_token.tag_name, this._options.inline) || parser_token.tag_name.includes(\"-\") || parser_token.tag_start_char === '{';\n\n return parser_token;\n};\n\nBeautifier.prototype._set_tag_position = function(printer, raw_token, parser_token, last_tag_token, last_token) {\n\n if (!parser_token.is_empty_element) {\n if (parser_token.is_end_tag) { //this tag is a double tag so check for tag-ending\n parser_token.start_tag_token = this._tag_stack.try_pop(parser_token.tag_name); //remove it and all ancestors\n } else { // it's a start-tag\n // check if this tag is starting an element that has optional end element\n // and do an ending needed\n if (this._do_optional_end_element(parser_token)) {\n if (!parser_token.is_inline_element) {\n printer.print_newline(false);\n }\n }\n\n this._tag_stack.record_tag(parser_token); //push it on the tag stack\n\n if ((parser_token.tag_name === 'script' || parser_token.tag_name === 'style') &&\n !(parser_token.is_unformatted || parser_token.is_content_unformatted)) {\n parser_token.custom_beautifier_name = get_custom_beautifier_name(parser_token.tag_check, raw_token);\n }\n }\n }\n\n if (in_array(parser_token.tag_check, this._options.extra_liners)) { //check if this double needs an extra line\n printer.print_newline(false);\n if (!printer._output.just_added_blankline()) {\n printer.print_newline(true);\n }\n }\n\n if (parser_token.is_empty_element) { //if this tag name is a single tag type (either in the list or has a closing /)\n\n // if you hit an else case, reset the indent level if you are inside an:\n // 'if', 'unless', or 'each' block.\n if (parser_token.tag_start_char === '{' && parser_token.tag_check === 'else') {\n this._tag_stack.indent_to_tag(['if', 'unless', 'each']);\n parser_token.indent_content = true;\n // Don't add a newline if opening {{#if}} tag is on the current line\n var foundIfOnCurrentLine = printer.current_line_has_match(/{{#if/);\n if (!foundIfOnCurrentLine) {\n printer.print_newline(false);\n }\n }\n\n // Don't add a newline before elements that should remain where they are.\n if (parser_token.tag_name === '!--' && last_token.type === TOKEN.TAG_CLOSE &&\n last_tag_token.is_end_tag && parser_token.text.indexOf('\\n') === -1) {\n //Do nothing. Leave comments on same line.\n } else {\n if (!(parser_token.is_inline_element || parser_token.is_unformatted)) {\n printer.print_newline(false);\n }\n this._calcluate_parent_multiline(printer, parser_token);\n }\n } else if (parser_token.is_end_tag) { //this tag is a double tag so check for tag-ending\n var do_end_expand = false;\n\n // deciding whether a block is multiline should not be this hard\n do_end_expand = parser_token.start_tag_token && parser_token.start_tag_token.multiline_content;\n do_end_expand = do_end_expand || (!parser_token.is_inline_element &&\n !(last_tag_token.is_inline_element || last_tag_token.is_unformatted) &&\n !(last_token.type === TOKEN.TAG_CLOSE && parser_token.start_tag_token === last_tag_token) &&\n last_token.type !== 'TK_CONTENT'\n );\n\n if (parser_token.is_content_unformatted || parser_token.is_unformatted) {\n do_end_expand = false;\n }\n\n if (do_end_expand) {\n printer.print_newline(false);\n }\n } else { // it's a start-tag\n parser_token.indent_content = !parser_token.custom_beautifier_name;\n\n if (parser_token.tag_start_char === '<') {\n if (parser_token.tag_name === 'html') {\n parser_token.indent_content = this._options.indent_inner_html;\n } else if (parser_token.tag_name === 'head') {\n parser_token.indent_content = this._options.indent_head_inner_html;\n } else if (parser_token.tag_name === 'body') {\n parser_token.indent_content = this._options.indent_body_inner_html;\n }\n }\n\n if (!(parser_token.is_inline_element || parser_token.is_unformatted) &&\n (last_token.type !== 'TK_CONTENT' || parser_token.is_content_unformatted)) {\n printer.print_newline(false);\n }\n\n this._calcluate_parent_multiline(printer, parser_token);\n }\n};\n\nBeautifier.prototype._calcluate_parent_multiline = function(printer, parser_token) {\n if (parser_token.parent && printer._output.just_added_newline() &&\n !((parser_token.is_inline_element || parser_token.is_unformatted) && parser_token.parent.is_inline_element)) {\n parser_token.parent.multiline_content = true;\n }\n};\n\n//To be used for

tag special case:\nvar p_closers = ['address', 'article', 'aside', 'blockquote', 'details', 'div', 'dl', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'main', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul'];\nvar p_parent_excludes = ['a', 'audio', 'del', 'ins', 'map', 'noscript', 'video'];\n\nBeautifier.prototype._do_optional_end_element = function(parser_token) {\n var result = null;\n // NOTE: cases of \"if there is no more content in the parent element\"\n // are handled automatically by the beautifier.\n // It assumes parent or ancestor close tag closes all children.\n // https://www.w3.org/TR/html5/syntax.html#optional-tags\n if (parser_token.is_empty_element || !parser_token.is_start_tag || !parser_token.parent) {\n return;\n\n }\n\n if (parser_token.tag_name === 'body') {\n // A head element’s end tag may be omitted if the head element is not immediately followed by a space character or a comment.\n result = result || this._tag_stack.try_pop('head');\n\n //} else if (parser_token.tag_name === 'body') {\n // DONE: A body element’s end tag may be omitted if the body element is not immediately followed by a comment.\n\n } else if (parser_token.tag_name === 'li') {\n // An li element’s end tag may be omitted if the li element is immediately followed by another li element or if there is no more content in the parent element.\n result = result || this._tag_stack.try_pop('li', ['ol', 'ul']);\n\n } else if (parser_token.tag_name === 'dd' || parser_token.tag_name === 'dt') {\n // A dd element’s end tag may be omitted if the dd element is immediately followed by another dd element or a dt element, or if there is no more content in the parent element.\n // A dt element’s end tag may be omitted if the dt element is immediately followed by another dt element or a dd element.\n result = result || this._tag_stack.try_pop('dt', ['dl']);\n result = result || this._tag_stack.try_pop('dd', ['dl']);\n\n\n } else if (parser_token.parent.tag_name === 'p' && p_closers.indexOf(parser_token.tag_name) !== -1) {\n // IMPORTANT: this else-if works because p_closers has no overlap with any other element we look for in this method\n // check for the parent element is an HTML element that is not an ,

tag special case:\nvar p_closers = ['address', 'article', 'aside', 'blockquote', 'details', 'div', 'dl', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'main', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul'];\nvar p_parent_excludes = ['a', 'audio', 'del', 'ins', 'map', 'noscript', 'video'];\n\nBeautifier.prototype._do_optional_end_element = function(parser_token) {\n var result = null;\n // NOTE: cases of \"if there is no more content in the parent element\"\n // are handled automatically by the beautifier.\n // It assumes parent or ancestor close tag closes all children.\n // https://www.w3.org/TR/html5/syntax.html#optional-tags\n if (parser_token.is_empty_element || !parser_token.is_start_tag || !parser_token.parent) {\n return;\n\n }\n\n if (parser_token.tag_name === 'body') {\n // A head element’s end tag may be omitted if the head element is not immediately followed by a space character or a comment.\n result = result || this._tag_stack.try_pop('head');\n\n //} else if (parser_token.tag_name === 'body') {\n // DONE: A body element’s end tag may be omitted if the body element is not immediately followed by a comment.\n\n } else if (parser_token.tag_name === 'li') {\n // An li element’s end tag may be omitted if the li element is immediately followed by another li element or if there is no more content in the parent element.\n result = result || this._tag_stack.try_pop('li', ['ol', 'ul']);\n\n } else if (parser_token.tag_name === 'dd' || parser_token.tag_name === 'dt') {\n // A dd element’s end tag may be omitted if the dd element is immediately followed by another dd element or a dt element, or if there is no more content in the parent element.\n // A dt element’s end tag may be omitted if the dt element is immediately followed by another dt element or a dd element.\n result = result || this._tag_stack.try_pop('dt', ['dl']);\n result = result || this._tag_stack.try_pop('dd', ['dl']);\n\n\n } else if (parser_token.parent.tag_name === 'p' && p_closers.indexOf(parser_token.tag_name) !== -1) {\n // IMPORTANT: this else-if works because p_closers has no overlap with any other element we look for in this method\n // check for the parent element is an HTML element that is not an ,

tag special case:\nvar p_closers = ['address', 'article', 'aside', 'blockquote', 'details', 'div', 'dl', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'main', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul'];\nvar p_parent_excludes = ['a', 'audio', 'del', 'ins', 'map', 'noscript', 'video'];\n\nBeautifier.prototype._do_optional_end_element = function(parser_token) {\n var result = null;\n // NOTE: cases of \"if there is no more content in the parent element\"\n // are handled automatically by the beautifier.\n // It assumes parent or ancestor close tag closes all children.\n // https://www.w3.org/TR/html5/syntax.html#optional-tags\n if (parser_token.is_empty_element || !parser_token.is_start_tag || !parser_token.parent) {\n return;\n\n }\n\n if (parser_token.tag_name === 'body') {\n // A head element’s end tag may be omitted if the head element is not immediately followed by a space character or a comment.\n result = result || this._tag_stack.try_pop('head');\n\n //} else if (parser_token.tag_name === 'body') {\n // DONE: A body element’s end tag may be omitted if the body element is not immediately followed by a comment.\n\n } else if (parser_token.tag_name === 'li') {\n // An li element’s end tag may be omitted if the li element is immediately followed by another li element or if there is no more content in the parent element.\n result = result || this._tag_stack.try_pop('li', ['ol', 'ul']);\n\n } else if (parser_token.tag_name === 'dd' || parser_token.tag_name === 'dt') {\n // A dd element’s end tag may be omitted if the dd element is immediately followed by another dd element or a dt element, or if there is no more content in the parent element.\n // A dt element’s end tag may be omitted if the dt element is immediately followed by another dt element or a dd element.\n result = result || this._tag_stack.try_pop('dt', ['dl']);\n result = result || this._tag_stack.try_pop('dd', ['dl']);\n\n\n } else if (parser_token.parent.tag_name === 'p' && p_closers.indexOf(parser_token.tag_name) !== -1) {\n // IMPORTANT: this else-if works because p_closers has no overlap with any other element we look for in this method\n // check for the parent element is an HTML element that is not an ,